|
|
|
@ -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>
|
|
|
|
|
|
|
|
|
|