王文杰 8 months ago
parent 5faa1a9812
commit d71247f5f7

@ -1,5 +1,4 @@
<script setup lang="ts">
<<<<<<< HEAD
import { getHomeCategoryAPI } from '@/services/home'
import type { BannerItem, CategoryItem, HotItem } from '@/types/home'
import { onLoad } from '@dcloudio/uni-app'
@ -10,9 +9,7 @@ import CategoryPanel from './components/CategoryPanel.vue'
import PageSkeleton from './components/PageSkeleton.vue'
import PhoneContact from './components/PhoneContact.vue'
import NeighborhoodSite from './components/NeighborhoodSite.vue'
import { useGuessList } from '@/composables'
const memberStore = useMemberStore()
//
const bannerList = ref<BannerItem[]>([
@ -156,70 +153,10 @@ const getSettingInfo = () => {
}
},
})
=======
import { ref } from 'vue'
import { useMemberStore } from '@/stores'
import DataList from './components/DataList.vue'
import { onReady } from '@dcloudio/uni-app'
//
const orderAcceptPopup = ref<UniHelper.UniPopupInstance>()
const memberStore = useMemberStore()
// tabs
const orderTabs = ref([
{ orderState: 0, title: '待接单', isRender: false, statusId: '520192817293693253' },
{ orderState: 1, title: '进行中', isRender: false, statusId: '520192993311854917' },
])
//
const activeIndex = ref(orderTabs.value.findIndex((v) => v.orderState === 0))
orderTabs.value[activeIndex.value].isRender = true
//
// //
// onReady(() => {
// debugger
// if (memberStore.profile?.token) {
// getSettingInfo()
// } else {
// }
// })
const datetimesingle = ref('')
const activeId = ref('')
const handleOrderAccept = (item: any) => {
activeId.value = item.id
datetimesingle.value = item.time
orderAcceptPopup?.value?.open()
}
const changeTime = (e) => {
console.log('change事件:', e)
}
const handleAccept = () => {
const url = `/pages/orderDetail/orderDetail?state=${props.state}&id=${activeId.value}`
uni.navigateTo({ url })
}
const handleLogin = () => {
const url = `/pages/login/login`
uni.navigateTo({ url })
}
const handleIndexChange = (index: any) => {
orderTabs.value.forEach(e => {
e.isRender = false
})
activeIndex.value = index
orderTabs.value[index].isRender = true
>>>>>>> b43f705aac2540e8c44120068fa0efd8a2e163f1
}
</script>
<template>
<view class="viewport">
<<<<<<< HEAD
<!-- 自定义导航栏 -->
<CustomNavbar />
<!-- 滚动容器 -->
@ -241,57 +178,6 @@ const handleIndexChange = (index: any) => {
<NeighborhoodSite />
</template>
</scroll-view>
=======
<template v-if="memberStore.profile?.token">
<view class="cont">
<view class="tabs">
<text
class="item"
:class="{ active: activeIndex == index }"
v-for="(item, index) in orderTabs"
:key="item.title"
@click="handleIndexChange(index)"
>{{ item.title }}
</text>
<!-- 游标 -->
<view class="cursor" :style="{ left: activeIndex ? '65%' : '14%' }"></view>
</view>
<!-- 滑动容器 -->
<swiper class="swiper" :current="activeIndex" @change="activeIndex = $event.detail.current">
<!-- 滑动项 -->
<swiper-item v-for="item in orderTabs" :key="item.title">
<!-- 订单列表 -->
<DataList v-if="item.isRender" :status-id="item.statusId" @orderAccept="handleOrderAccept" />
</swiper-item>
</swiper>
<uni-popup ref="orderAcceptPopup" type="center" background-color="#fff">
<view class="popup-root">
<view class="title">请确保上门时间有效</view>
<view class="description">
<view class="tips">1请和客户确认如下上门时间</view>
<view class="date">
<uni-datetime-picker type="datetime" v-model="datetimesingle" @change="changeTime" />
</view>
</view>
<view class="footer">
<view class="button" @tap="orderAcceptPopup?.close?.()"></view>
<view class="button primary" @tap="handleAccept"></view>
</view>
</view>
</uni-popup>
</view>
</template>
<view class="noLogin" v-else>
<image
class="img"
src="@/static/images/warn_home.png"
mode="scaleToFill"
/>
<view class="title">未登录</view>
<view class="desc">您目前还未登录账号无法加载任何信息请先去登录账号</view>
<view class="button" @click="handleLogin"></view>
</view>
>>>>>>> b43f705aac2540e8c44120068fa0efd8a2e163f1
</view>
</template>

@ -15,36 +15,13 @@ onLoad(async () => {
//
const onGetphonenumber: UniHelper.ButtonOnGetphonenumber = async (ev) => {
await checkedAgreePrivacy()
const { encryptedData, iv } = ev.detail
if (encryptedData) {
<<<<<<< HEAD
const params = {
code,
encryptedData,
iv,
userType: 1, // 1 2
}
const res = await postLoginWxMinAPI(params)
loginSuccess(res.data)
} else {
uni.showToast({ icon: 'none', title: '请授权手机号' })
}
}
// #endif
//
const onGetphonenumberSimple = async () => {
await checkedAgreePrivacy()
const res = await postLoginWxMinSimpleAPI('13123456789')
loginSuccess(res.result)
=======
const res = await postLoginWxMinAPI({ code, encryptedData, iv })
loginSuccess(res.data)
} else {
uni.showToast({ icon: 'none', title: '请授权手机号' })
}
>>>>>>> b43f705aac2540e8c44120068fa0efd8a2e163f1
}
const loginSuccess = (profile: LoginResult) => {
@ -56,21 +33,13 @@ const loginSuccess = (profile: LoginResult) => {
setTimeout(() => {
//
uni.switchTab({ url: '/pages/index/index' })
<<<<<<< HEAD
// uni.navigateBack()
=======
uni.navigateBack()
>>>>>>> b43f705aac2540e8c44120068fa0efd8a2e163f1
}, 500)
}
//
const isAgreePrivacy = ref(true)
<<<<<<< HEAD
const isAgreePrivacyShakeY = ref(true)
=======
const isAgreePrivacyShakeY = ref(false)
>>>>>>> b43f705aac2540e8c44120068fa0efd8a2e163f1
const checkedAgreePrivacy = async () => {
if (!isAgreePrivacy.value) {
uni.showToast({
@ -89,12 +58,6 @@ const checkedAgreePrivacy = async () => {
const onOpenPrivacyContract = () => {
//
wx.openPrivacyContract({})
<<<<<<< HEAD
// #endif
=======
>>>>>>> b43f705aac2540e8c44120068fa0efd8a2e163f1
}
</script>
<template>
@ -116,8 +79,6 @@ const onOpenPrivacyContract = () => {
手机号快捷登录
</button>
</view>
<<<<<<< HEAD
<!-- #endif -->
<!-- <view class="extra">
<view class="caption">
<text>其他登录方式</text>
@ -128,8 +89,6 @@ const onOpenPrivacyContract = () => {
</button>
</view>
</view> -->
=======
>>>>>>> b43f705aac2540e8c44120068fa0efd8a2e163f1
<view class="tips" :class="{ animate__shakeY: isAgreePrivacyShakeY }">
<label class="label" @tap="isAgreePrivacy = !isAgreePrivacy">
<radio class="radio" color="#3775F6" :checked="isAgreePrivacy" />

@ -127,12 +127,7 @@ page {
.viewport {
height: 100%;
background-repeat: no-repeat;
<<<<<<< HEAD
background-image: url('http://174.137.59.38/static/bg.png');
=======
background-image: url('http://174.137.59.38/static/bg.png');
// background-color: #3775F6;
>>>>>>> b43f705aac2540e8c44120068fa0efd8a2e163f1
background-size: 100% auto;
}

@ -26,11 +26,7 @@ type LoginWxMinParams = {
export const postLoginWxMinAPI = (data: LoginWxMinParams) => {
return http<LoginResult>({
method: 'POST',
<<<<<<< HEAD
url: '/common/shlogin',
=======
url: '/scm/wx/hsyGetPhone',
>>>>>>> b43f705aac2540e8c44120068fa0efd8a2e163f1
data,
})
}

@ -1,17 +1,4 @@
/*
* @Author:
* @Date: 2024-01-04 12:54:56
<<<<<<< HEAD
* @LastEditors:
* @LastEditTime: 2024-03-02 09:44:54
* @FilePath: /app-nx-personal/src/utils/http.ts
=======
* @LastEditors:
* @LastEditTime: 2024-02-23 10:49:25
* @FilePath: /app-nx-recycle/src/utils/http.ts
>>>>>>> b43f705aac2540e8c44120068fa0efd8a2e163f1
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
/**
* :
* request
@ -25,12 +12,7 @@
*/
import { useMemberStore } from '@/stores'
<<<<<<< HEAD
const baseURL = 'http://192.168.0.166:8808/api'
=======
const baseURL = 'http://222.71.165.187:3333/api'
>>>>>>> b43f705aac2540e8c44120068fa0efd8a2e163f1
// 添加拦截器
const httpInterceptor = {

@ -7,11 +7,7 @@
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { defineConfig } from 'vite'
<<<<<<< HEAD
// import { viteMockServe } from "vite-plugin-mock";
=======
import { viteMockServe } from 'vite-plugin-mock'
>>>>>>> b43f705aac2540e8c44120068fa0efd8a2e163f1
import uni from '@dcloudio/vite-plugin-uni'
// https://vitejs.dev/config/
@ -22,14 +18,8 @@ export default defineConfig({
},
plugins: [
uni(),
<<<<<<< HEAD
// viteMockServe({
// supportTs: true,
// })
=======
viteMockServe({
supportTs: true,
}),
>>>>>>> b43f705aac2540e8c44120068fa0efd8a2e163f1
],
})

Loading…
Cancel
Save