master
王文杰 8 months ago
parent 9d3cab7f06
commit 436b9e15d7

@ -18,6 +18,12 @@
"navigationBarTitleText": "登录" "navigationBarTitleText": "登录"
} }
}, },
{
"path": "pages/orderDetail/orderDetail",
"style": {
"navigationBarTitleText": "订单详情"
}
},
{ {
"path": "pages/my/my", "path": "pages/my/my",
"style": { "style": {
@ -87,11 +93,12 @@
} }
}, },
{ {
"path": "pages/orerdList/orerdList", "path": "pages/orderList/list",
"style": { "style": {
"navigationBarTitleText": "订单" "navigationBarTitleText": "订单"
} }
}, },
], ],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",

@ -224,7 +224,7 @@ const handleBooking = async () => {
<button hover-class="none" class="item arrow" @click="openAddressPop">{{recycleAddress}}</button> <button hover-class="none" class="item arrow" @click="openAddressPop">{{recycleAddress}}</button>
<button hover-class="none" class="item arrow" @click="openSitePop">{{siteLabel}}</button> <button hover-class="none" class="item arrow" @click="openSitePop">{{siteLabel}}</button>
</view> </view>
<view class="weight"> <!-- <view class="weight">
<view class="weight-title" <view class="weight-title"
>请选择预估重量<span class="desc">预估仅供参考以实际重量为准</span></view >请选择预估重量<span class="desc">预估仅供参考以实际重量为准</span></view
> >
@ -238,7 +238,7 @@ const handleBooking = async () => {
>{{ item.name }}</view >{{ item.name }}</view
> >
</view> </view>
</view> </view> -->
</view> </view>
<time-popup :props-time="appointmentTime" v-if="isShowTimePop" @change="handleTimePopChange" /> <time-popup :props-time="appointmentTime" v-if="isShowTimePop" @change="handleTimePopChange" />
<address-popup v-if="isShowAddressPop" @change="handleAddressPopChange" /> <address-popup v-if="isShowAddressPop" @change="handleAddressPopChange" />

@ -164,7 +164,7 @@ const handleNewsList = () => {
</navigator> </navigator>
<navigator <navigator
class="loation item arrow" class="loation item arrow"
url="/pages/orderList/orderList" url="/pages/orderList/list"
hover-class="none" hover-class="none"
> >
<image class="img" src="/static/images/cart_selected.png" mode="scaleToFill" /> <image class="img" src="/static/images/cart_selected.png" mode="scaleToFill" />

@ -37,122 +37,10 @@ const props = withDefaults(defineProps<Props>(), {
targetLongitude: '121.197665', targetLongitude: '121.197665',
targetLatitude: '31.128418', targetLatitude: '31.128418',
}) })
const tMap = new QQMapWX({
key: 'EAQBZ-BZZCZ-DGUX2-TZI4D-PZRWH-NNFNJ',
})
// -
const getLocationInfo = () => {
uni.getLocation({
type: 'gcj02',
// isHighAccuracy: true,
// highAccuracyExpireTime: 5000,
success(res) {
console.log(res)
tMap.direction({
mode: 'driving',
from: {
// longitude: res.longitude,
// latitude: res.latitude,
longitude: '121.197635',
latitude: '31.128684',
},
to: {
longitude: props.targetLongitude,
latitude: props.targetLatitude,
},
success(res2: any) {
console.log('res2', res2)
const ret = res2
const coors = ret.result.routes[0].polyline,
pl = []
//
const kr = 1000000
for (let i = 2; i < coors.length; i++) {
coors[i] = Number(coors[i - 2]) + Number(coors[i]) / kr
}
//pl
for (let i = 0; i < coors.length; i += 2) {
pl.push({ latitude: coors[i], longitude: coors[i + 1] })
}
console.log(pl)
//polyline线,
latitude.value = pl[0].latitude
longitude.value = pl[0].longitude
polyline.value = [
{
points: pl,
color: '#409eff',
width: 4,
},
]
orderDetailPopup?.value?.open()
},
})
},
fail(err) {
console.log(err)
uni.showModal({
content: '检测到您没打开获取定位功能权限,是否去设置打开?',
confirmText: '确认',
cancelText: '取消',
success: function (res) {
if (res.confirm) {
uni.openSetting({
success() {
getLocationInfo()
},
})
}
},
})
},
})
}
const getAuthorizeInfo = () => {
uni.authorize({
scope: 'scope.userLocation',
success(res) {
getLocationInfo()
},
fail(err) {
uni.showModal({
content: '检测到您没打开获取定位功能权限,是否去设置打开?',
confirmText: '确认',
cancelText: '取消',
success: function (res) {
if (res.confirm) {
uni.openSetting({
success() {
getLocationInfo()
},
})
}
},
})
},
})
}
// -
const getSettingInfo = () => {
uni.getSetting({
success(res) {
if (res.authSetting['scope.userLocation']) {
getLocationInfo()
} else {
getAuthorizeInfo()
}
},
})
}
// //
onReady(() => { onReady(() => {
getSettingInfo()
console.log(props) console.log(props)
}) })
const { ctx }: any = getCurrentInstance()
const mapContext = ref<UniApp.MapContext>(null as unknown as UniApp.MapContext)
// //
// const order = ref<OrderResult>() // const order = ref<OrderResult>()
// const getMemberOrderByIdData = async () => { // const getMemberOrderByIdData = async () => {
@ -209,47 +97,6 @@ const phone = async () => {
// }, // },
// }) // })
// } // }
const handleAction = () => {
if (props.state == '1') {
tMap.direction({
mode: 'walking',
from: {
// longitude: res.longitude,
// latitude: res.latitude,
longitude: '121.197635',
latitude: '31.128684',
},
to: {
longitude: props.targetLongitude,
latitude: props.targetLatitude,
},
success(res: any) {
const ret = res
const distance = ret.result.routes[0].distance
if (distance < 100) {
uni.navigateTo({ url: '/payment/detail/detail' })
} else {
uni.showToast({
icon: 'none',
title: '请先到达订单所在的位置',
})
}
},
})
} else {
orderConfirmPopup.value?.open?.()
}
}
const handleDetailShow = () => {
orderDetailPopup.value?.open?.()
}
const handleDetailPopupClose = () => {
orderDetailPopup.value?.close?.()
}
const handleAcceptConfirm = () => { const handleAcceptConfirm = () => {
uni.navigateTo({ url: '/payment/detail/detail' }) uni.navigateTo({ url: '/payment/detail/detail' })
} }
@ -257,104 +104,20 @@ const handleAcceptConfirm = () => {
<template> <template>
<view class="viewport"> <view class="viewport">
<template v-if="1"> <template v-if="1">
<view class="section-map"> <view class="order-detail">
<map <view class="status">
id="map" <view class="title">待接单中</view>
class="map" <view class="desc">预约时间2023-11-12 11:55</view>
:polyline="polyline" <view class="action">
show-location <view class="button">取消订单</view>
:latitude="latitude" </view>
:longitude="longitude"
></map>
</view>
<!-- 底部操作栏 -->
<view class="toolbar-height" :style="{ paddingBottom: safeAreaInsets?.bottom + 'px' }"></view>
<view class="toolbar" :style="{ paddingBottom: safeAreaInsets?.bottom + 'px' }">
<view class="button" @tap="phone">
<image
class="concat-img"
src="../../../static/images/detail_iphone.png"
mode="scaleToFill"
/>
</view>
<view class="button">
<image
class="concat-img"
src="../../../static/images/detail_concat.png"
mode="scaleToFill"
/>
</view> </view>
<view class="button primary" @click="handleDetailShow"></view>
<view class="button primary" @click="handleAction">{{
props.state == '1' ? '已经到达' : '立即接单'
}}</view>
</view> </view>
</template> </template>
<template v-else> <template v-else>
<PageSkeleton /> <PageSkeleton />
</template> </template>
</view> </view>
<uni-popup ref="orderDetailPopup" type="bottom" background-color="#fff">
<view class="popup-root">
<view class="title">
<view class="text">订单详情</view>
<view class="close" @click="handleDetailPopupClose">X</view>
</view>
<view class="cont">
<view class="info1">
<view class="loction">
<view class="text ellipsis">上海市松江区新松江路92弄开元地中海园区</view>
<view class="num">0.4km</view>
</view>
<view class="coming-time">
<view class="label">上门时间</view>
<view class="val">今天上午 12:00</view>
</view>
<view class="people"> 曾先生 18526235487 </view>
</view>
<view class="info2">
<view class="item">
<view class="label">回收品类</view>
<view class="val">塑料瓶/纸箱</view>
</view>
<view class="item">
<view class="label">预计重量</view>
<view class="val">2kg</view>
</view>
<view class="item">
<view class="label">备注</view>
<view class="val"></view>
</view>
</view>
<view class="time-status">
<text class="label">剩余接单时间</text>
<uni-countdown
:show-day="false"
:minute="30"
:second="0"
color="#E30000"
@timeup="handleTimeup(item)"
/>
</view>
</view>
</view>
</uni-popup>
<uni-popup ref="orderConfirmPopup" 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="orderConfirmPopup?.close?.()"></view>
<view class="button primary" @tap="handleAcceptConfirm"></view>
</view>
</view>
</uni-popup>
</template> </template>
<style lang="scss"> <style lang="scss">
page { page {
@ -370,17 +133,34 @@ page {
margin-bottom: 100rpx; margin-bottom: 100rpx;
overflow: auto; overflow: auto;
scrollbar-width: none; scrollbar-width: none;
.order-detail {
.section-map { .status {
width: 100vw; margin: 40rpx 0;
height: 100vh; .title {
font-size: 42rpx;
.map { color: #0D0D26;
width: 100%; text-align: center;
height: 100%; }
.desc {
margin: 20rpx 0;
font-size: 28rpx;
color: #999A9F;
text-align: center;
}
.action {
.button {
width: 200rpx;
padding: 20rpx 32rpx;
text-align: center;
border: 2rpx solid #D5D6DB;
font-size: 30rpx;
color: #0D0D26;
}
}
} }
} }
.toolbar-height { .toolbar-height {
height: 100rpx; height: 100rpx;
box-sizing: content-box; box-sizing: content-box;

@ -8,20 +8,26 @@ import { getPayMockAPI, getPayWxPayMiniPayAPI } from '@/services/pay'
import type { OrderItem } from '@/types/order' import type { OrderItem } from '@/types/order'
import type { OrderListParams } from '@/types/order' import type { OrderListParams } from '@/types/order'
import { onMounted, ref } from 'vue' import { onMounted, ref } from 'vue'
import { useMemberStore } from '@/stores'
// //
const { safeAreaInsets } = uni.getSystemInfoSync() const { safeAreaInsets } = uni.getSystemInfoSync()
const memberStore = useMemberStore()
// porps // porps
const props = defineProps<{ const props = defineProps<{
orderState: number orderState: string
}>() }>()
// //
const queryParams: Required<OrderListParams> = { const queryParams: Required<OrderListParams> = {
page: 1, pageNo: 1,
pageSize: 5, pageSize: 10,
orderState: props.orderState, status: props.orderState,
location: {
latitude: 31.163973,
longitude: 121.404032
},
id: memberStore.profile?.id,
} }
// //
@ -39,15 +45,14 @@ const getMemberOrderData = async () => {
isLoading.value = true isLoading.value = true
// //
const res = await getMemberOrderAPI(queryParams) const res = await getMemberOrderAPI(queryParams)
// debugger
// //
isLoading.value = false isLoading.value = false
// //
orderList.value.push(...res.result.items) orderList.value.push(...res.data.list)
// //
if (queryParams.page < res.result.pages) { if (queryParams.pageNo < res.data.pages) {
// //
queryParams.page++ queryParams.pageNo++
} else { } else {
// //
isFinish.value = true isFinish.value = true
@ -132,7 +137,7 @@ const onRefresherrefresh = async () => {
// //
isTriggered.value = true isTriggered.value = true
// //
queryParams.page = 1 queryParams.pageNo = 1
orderList.value = [] orderList.value = []
isFinish.value = false isFinish.value = false
// //

@ -0,0 +1,106 @@
<script setup lang="ts">
import { ref } from 'vue'
import OrderList from './components/OrderList.vue'
//
const query = defineProps<{
type: string
}>()
// tabs
const orderTabs = ref([
// { orderState: 0, title: '', isRender: false },
{ orderState: 'PENDING', title: '待接单', isRender: false },
{ orderState: 'UNPROCESSED', title: '待服务', isRender: false },
{ orderState: 'RECYCLING', title: '回收中', isRender: false },
{ orderState: 'FINISHED', title: '已完成', isRender: false },
{ orderState: 'CANCELED', title: '已取消', isRender: false },
])
//
const activeIndex = ref(orderTabs.value.findIndex((v) => v.orderState === 'PENDING'))
//
orderTabs.value[activeIndex.value].isRender = true
</script>
<template>
<view class="viewport">
<!-- tabs -->
<view class="tabs">
<text
class="item"
v-for="(item, index) in orderTabs"
:key="item.title"
@tap="
() => {
activeIndex = index
item.isRender = true
}
"
>
{{ item.title }}
</text>
<!-- 游标 -->
<view class="cursor" :style="{ left: activeIndex * 20 + '%' }"></view>
</view>
<!-- 滑动容器 -->
<swiper class="swiper" :current="activeIndex" @change="activeIndex = $event.detail.current">
<!-- 滑动项 -->
<swiper-item v-for="item in orderTabs" :key="item.title">
<!-- 订单列表 -->
<OrderList v-if="item.isRender" :order-state="item.orderState" />
</swiper-item>
</swiper>
</view>
</template>
<style lang="scss">
page {
height: 100%;
overflow: hidden;
}
.viewport {
height: 100%;
display: flex;
flex-direction: column;
background-color: #fff;
}
// tabs
.tabs {
display: flex;
justify-content: space-around;
line-height: 60rpx;
margin: 0 10rpx;
background-color: #fff;
box-shadow: 0 4rpx 6rpx rgba(240, 240, 240, 0.6);
position: relative;
z-index: 9;
.item {
flex: 1;
text-align: center;
padding: 20rpx;
font-size: 28rpx;
color: #262626;
}
.cursor {
position: absolute;
left: 0;
bottom: 0;
width: 20%;
height: 6rpx;
padding: 0 50rpx;
background-color: #3775F6;
/* 过渡效果 */
transition: all 0.4s;
}
}
// swiper
.swiper {
background-color: #f7f7f8;
}
</style>

@ -1,318 +0,0 @@
<script setup lang="ts">
import { OrderState } from '@/services/constants'
import { orderStateList } from '@/services/constants'
import { putMemberOrderReceiptByIdAPI } from '@/services/order'
import { deleteMemberOrderAPI } from '@/services/order'
import { getMemberOrderAPI } from '@/services/order'
import { getPayMockAPI, getPayWxPayMiniPayAPI } from '@/services/pay'
import type { OrderItem } from '@/types/order'
import type { OrderListParams } from '@/types/order'
import { onMounted, ref, defineEmits } from 'vue'
//
const { safeAreaInsets } = uni.getSystemInfoSync()
// porps
const props = defineProps<{
orderState: number
}>()
//
const queryParams: Required<OrderListParams> = {
page: 1,
pageSize: 5,
orderState: props.orderState,
}
//
// const orderList = ref<OrderItem[]>([])
const orderList = [
{
id: '1747900788929204226',
createTime: '剩余接单时间',
locationNum: '0.4km',
loction: '上海市松江区新松江路92弄开元地中海园区',
people: '曾先生 18526235487',
payType: 1,
orderState: 2,
time: '2024-01-18 17:06:37',
time2: '17:01:01',
postFee: 8.0,
payMoney: 982.0,
totalMoney: 974.0,
totalNum: 13,
payChannel: 2,
countdown: 1579,
},
{
locationNum: '0.4km',
loction: '上海市松江区新松江路92弄开元地中海园区',
id: '1747899379064246273',
people: '曾先生 18526235487',
createTime: '剩余接单时间',
payType: 1,
orderState: 1,
time: '2024-01-18 17:01:01',
time2: '17:01:01',
postFee: 1.0,
payMoney: 70.0,
totalMoney: 69.0,
totalNum: 1,
payChannel: 2,
countdown: 1243,
},
]
//
const isLoading = ref(false)
const emit = defineEmits('tabChange')
const getMemberOrderData = async () => {
// 退
if (isLoading.value) return
// 退
if (isFinish.value === true) {
return uni.showToast({ icon: 'none', title: '没有更多数据~' })
}
//
isLoading.value = true
//
const res = await getMemberOrderAPI(queryParams)
// debugger
//
isLoading.value = false
//
orderList.value.push(...res.result.items)
//
if (queryParams.page < res.result.pages) {
//
queryParams.page++
} else {
//
isFinish.value = true
}
}
onMounted(() => {
// getMemberOrderData()
// const arr: object[] = [
// {
// id: 1,
// name: '233'
// }
// ]
// orderList.value.push(...arr)
})
//
const onOrderPay = async (id: string) => {
emit('tabChange', {})
// uni.$emit('childEvent');
// if (import.meta.env.DEV) {
// //
// await getPayMockAPI({ orderId: id })
// } else {
// // #ifdef MP-WEIXIN
// // 1.2.API
// // const res = await getPayWxPayMiniPayAPI({ orderId: id })
// // await wx.requestPayment(res.result)
// // 线 0.01
// await getPayMockAPI({ orderId: id })
// // #endif
// }
// //
// uni.showToast({ title: '' })
// //
// setTimeout(() => {
// wx.showModal({
// title: '',
// content: '',
// confirmText: '',
// showCancel: false,
// })
// }, 2000)
// //
// const order = orderList.value.find((v) => v.id === id)
// order!.orderState = OrderState.DaiFaHuo
}
//
const onOrderConfirm = (id: string) => {
uni.showModal({
content: '为保障您的权益,请收到货并确认无误后,再确认收货',
confirmColor: '#27BA9B',
success: async (res) => {
if (res.confirm) {
await putMemberOrderReceiptByIdAPI(id)
uni.showToast({ icon: 'success', title: '确认收货成功' })
//
const order = orderList.value.find((v) => v.id === id)
order!.orderState = OrderState.DaiPingJia
}
},
})
}
//
const onOrderDelete = (id: string) => {
uni.showModal({
content: '你确定要删除该订单?',
confirmColor: '#27BA9B',
success: async (res) => {
if (res.confirm) {
await deleteMemberOrderAPI({ ids: [id] })
//
const index = orderList.value.findIndex((v) => v.id === id)
orderList.value.splice(index, 1)
}
},
})
}
//
const isFinish = ref(false)
//
const isTriggered = ref(false)
//
const onRefresherrefresh = async () => {
//
isTriggered.value = true
//
queryParams.page = 1
orderList.value = []
isFinish.value = false
//
await getMemberOrderData()
//
isTriggered.value = false
}
</script>
<template>
<scroll-view
enable-back-to-top
scroll-y
class="orders"
refresher-enabled
:refresher-triggered="isTriggered"
@refresherrefresh="onRefresherrefresh"
@scrolltolower="getMemberOrderData"
>
<view class="card" v-for="item in orderList" :key="item.id">
<!-- 订单信息 -->
<view class="hd">
<text class="locationNum">订单编号HG201604052233</text>
</view>
<navigator class="goods" :url="`/pagesOrder/detail/detail?id=${item.id}`" hover-class="none">
<view class="meta">
<view class="location ellipsis">
<image src="/static/images/loction.png" mode="aspectFit" class="icon" />
{{ item.loction }}</view
>
<view class="people ellipsis">
<image src="/static/images/iphone.png" mode="aspectFit" class="icon" />
{{ item.people }}</view
>
</view>
</navigator>
<!-- 订单操作按钮 -->
<view class="action">
<text class="label">订单完成时间2024-01-16 13:25:22</text>
</view>
<image src="/static/images/order_completed.png" mode="aspectFit" class="img"></image>
</view>
<!-- 底部提示文字 -->
<view class="loading-text" :style="{ paddingBottom: safeAreaInsets?.bottom + 'px' }">
{{ isFinish ? '没有更多数据~' : '正在加载...' }}
</view>
</scroll-view>
</template>
<style lang="scss">
//
.orders {
.card {
padding: 20rpx;
margin: 20rpx 20rpx 0;
border-radius: 10rpx;
position: relative;
background: linear-gradient(180deg, #d2eeff -14%, rgba(255, 255, 255, 0) 63%), #ffffff;
box-shadow: 0px 0px 8px 0px rgba(164, 182, 203, 0.33);
.hd {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28rpx;
padding-bottom: 20rpx;
border-bottom: 2rpx solid #f1e8e8;
.locationNum {
color: #3d3d3d;
}
}
.goods {
display: flex;
.meta {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
padding: 10rpx 0;
border-bottom: 2rpx solid #f2f2f2;
.location {
font-size: 32rpx;
color: #999a9f;
margin-top: 20rpx;
.icon {
width: 32rpx;
height: 32rpx;
margin-right: 6rpx;
}
}
.people {
font-size: 32rpx;
color: #999a9f;
margin: 20rpx 0;
.icon {
width: 32rpx;
height: 32rpx;
margin-right: 6rpx;
}
}
}
}
.action {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 0;
.label {
flex: 1;
align-items: center;
color: #999a9f;
font-size: 32rpx;
}
}
.img {
position: absolute;
top: 0;
right: 0;
width: 140rpx;
height: 140rpx;
}
&:last-child {
padding-bottom: 40rpx;
}
}
.loading-text {
text-align: center;
font-size: 28rpx;
color: #666;
padding: 20rpx 0;
}
}
</style>

@ -1,66 +0,0 @@
<script setup lang="ts">
import { ref } from 'vue'
import OrderItem from './components/OrderItem.vue'
//
const { safeAreaInsets } = uni.getSystemInfoSync()
//
const query = defineProps<{
type: string
}>()
// tabs
const orderTabs = ref([
{ orderState: 0, title: '待接单', isRender: false },
{ orderState: 1, title: '进行中', isRender: false },
])
//
const activeIndex = ref(orderTabs.value.findIndex((v) => v.orderState === Number(query.type)))
//
orderTabs.value[activeIndex.value].isRender = true
const handleTabChange = (type: string) => {
if (!activeIndex.value) {
activeIndex.value = 1
}
}
</script>
<template>
<view class="viewport">
<!-- 滑动容器 -->
<view class="cont" :current="activeIndex" @change="activeIndex = $event.detail.current">
<!-- 滑动项 -->
<view class="item" v-for="item in orderTabs" :key="item.title">
<!-- 订单列表 -->
<OrderItem
v-if="item.isRender"
:order-state="item.orderState"
@tab-change="handleTabChange"
/>
</view>
</view>
</view>
</template>
<style lang="scss">
page {
height: 100%;
overflow: hidden;
}
.viewport {
height: 100%;
display: flex;
flex-direction: column;
}
// swiper
.cont {
background-color: #f7f7f8;
// margin-top: 128rpx;
}
</style>

@ -8,20 +8,26 @@ import { getPayMockAPI, getPayWxPayMiniPayAPI } from '@/services/pay'
import type { OrderItem } from '@/types/order' import type { OrderItem } from '@/types/order'
import type { OrderListParams } from '@/types/order' import type { OrderListParams } from '@/types/order'
import { onMounted, ref } from 'vue' import { onMounted, ref } from 'vue'
import { useMemberStore } from '@/stores'
// //
const { safeAreaInsets } = uni.getSystemInfoSync() const { safeAreaInsets } = uni.getSystemInfoSync()
const memberStore = useMemberStore()
// porps // porps
const props = defineProps<{ const props = defineProps<{
orderState: number orderState: string
}>() }>()
// //
const queryParams: Required<OrderListParams> = { const queryParams: Required<OrderListParams> = {
page: 1, pageNo: 1,
pageSize: 5, pageSize: 5,
orderState: props.orderState, status: props.orderState,
location: {
latitude: 31.163973,
longitude: 121.404032
},
id: memberStore.profile?.id,
} }
// //
@ -42,11 +48,11 @@ const getMemberOrderData = async () => {
// //
isLoading.value = false isLoading.value = false
// //
orderList.value.push(...res.result.items) orderList.value.push(...res.data.list)
// //
if (queryParams.page < res.result.pages) { if (queryParams.pageNo < res.data.pages) {
// //
queryParams.page++ queryParams.pageNo++
} else { } else {
// //
isFinish.value = true isFinish.value = true
@ -131,7 +137,7 @@ const onRefresherrefresh = async () => {
// //
isTriggered.value = true isTriggered.value = true
// //
queryParams.page = 1 queryParams.pageNo = 1
orderList.value = [] orderList.value = []
isFinish.value = false isFinish.value = false
// //

@ -9,15 +9,16 @@ const query = defineProps<{
// tabs // tabs
const orderTabs = ref([ const orderTabs = ref([
{ orderState: 0, title: '全部', isRender: false }, // { orderState: 0, title: '', isRender: false },
{ orderState: 1, title: '待付款', isRender: false }, { orderState: 'PENDING', title: '待接单', isRender: false },
{ orderState: 2, title: '待发货', isRender: false }, { orderState: 'UNPROCESSED', title: '待上门/待服务', isRender: false },
{ orderState: 3, title: '待收货', isRender: false }, { orderState: 'RECYCLING', title: '回收中', isRender: false },
{ orderState: 4, title: '待评价', isRender: false }, { orderState: 'FINISHED', title: '已完成', isRender: false },
{ orderState: 'CANCELED', title: '已取消,可用', isRender: false },
]) ])
// //
const activeIndex = ref(orderTabs.value.findIndex((v) => v.orderState === Number(query.type))) const activeIndex = ref(orderTabs.value.findIndex((v) => v.orderState === 'PENDING'))
// //
orderTabs.value[activeIndex.value].isRender = true orderTabs.value[activeIndex.value].isRender = true
</script> </script>

@ -132,7 +132,7 @@ export const getMemberOrderCancelByIdAPI = (id: string, data: { cancelReason: st
export const getMemberOrderAPI = (data: OrderListParams) => { export const getMemberOrderAPI = (data: OrderListParams) => {
return http<OrderListResult>({ return http<OrderListResult>({
method: 'POST', method: 'POST',
url: `/scm/RecycleOrder/getList`, url: `/recycle-order/page`,
data, data,
}) })
} }

@ -11,7 +11,7 @@
* 4. token * 4. token
*/ */
import { useMemberStore } from '@/stores' import { useMemberStore } from '@/stores'
const baseURL = 'http://192.168.0.166:8808/api' const baseURL = 'http://222.71.165.188:8808/api'
// 添加拦截器 // 添加拦截器
const httpInterceptor = { const httpInterceptor = {

Loading…
Cancel
Save