diff --git a/pages/mine/main/main.vue b/pages/mine/main/main.vue index 63cb483..1a850bc 100644 --- a/pages/mine/main/main.vue +++ b/pages/mine/main/main.vue @@ -1,353 +1,377 @@ \ No newline at end of file diff --git a/pages/mine/mineorders/mineorders.vue b/pages/mine/mineorders/mineorders.vue index f24a88c..7fa6994 100644 --- a/pages/mine/mineorders/mineorders.vue +++ b/pages/mine/mineorders/mineorders.vue @@ -71,12 +71,44 @@ src="https://ide.code.fun/api/image?token=67610a10797f850011f30392&name=f10bd62afae3562e9d76103ff6fb0f84.png" /> {{order.totalAmount}} - - --> + + + + 取消订单 + + 去支付 + + + 联系客服 - + + + + 取消订单 + + 查看物流 + + + + 删除订单 @@ -95,18 +127,37 @@ testUrl, suiUrl } from '@/api/request'; + import { onLoad } from "@dcloudio/uni-app"; const Status = ref({ orderStatus: '全部', orders: [], displayedOrders: [], - }); + }) const orderStatus = '' const currentColor = ref(0); - const isSelected = (tab) => Status.value.orderStatus === tab; - onMounted(async () => { - await Getorder(); - Status.value.displayedOrders = Status.value.orders; - }); + const isSelected = (tab) => Status.value.orderStatus === tab + onMounted(async () => { + await Getorder() + if (Status.value.orderStatus === '全部') { + Status.value.displayedOrders = Status.value.orders; + } else { + Status.value.displayedOrders = Status.value.orders.filter((order) => { + switch (Status.value.orderStatus) { + case '待支付': + return order.orderStatus === '待支付' + case '待发货': + return order.orderStatus === '待发货' + case '已发货': + return order.orderStatus === '已发货' + case '已退款': + return order.orderStatus === '已退款' + default: + return false; + } + }) + } + }) + const userInfo = wx.getStorageSync('userInfo') const Getorder = async () => { const res = await uni.request({ @@ -116,17 +167,23 @@ cookie: wx.getStorageSync('cookie') }, data: { - // id:userInfo.value.userInfo.id, id: userInfo.id, }, - }); + }) if (res.data.code === 1) { - console.log('res.data.data--->', res.data.data); - Status.value.orders = res.data.data; + + Status.value.orders = res.data.data } else { - console.log('没拿到用户数据'); + console.log('没拿到用户数据') } - }; + } + const zt = ref({ + tab:'' + }) + onLoad((options)=>{ + zt.value.tab = JSON.parse(options.zt) + changeTab(zt.value.tab) + }) const changeTab = (tab) => { if (tab === '全部') { Status.value.displayedOrders = Status.value.orders; @@ -145,14 +202,11 @@ default: return false; } - }); - Status.value.orderStatus = tab; + }) + Status.value.orderStatus = tab } - }; - - + } const goToText = (index) => { - console.log('下标-->', index); uni.navigateTo({ url: '../../../pages/mine/OrderDetails/OrderDetails?info=' + JSON.stringify(Status.value .displayedOrders[index]), diff --git a/pages/syy.vue b/pages/syy.vue index 3bd976b..74af834 100644 --- a/pages/syy.vue +++ b/pages/syy.vue @@ -1,9 +1,10 @@