feat: 积分商城-完成
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<joyful-selection-orders-skeleton v-if="loading" />
|
||||
<main v-else class="orders-page">
|
||||
<van-nav-bar title="我的订单" left-arrow @click-left="$router.back()" />
|
||||
<van-nav-bar title="我的订单" left-arrow @click-left="$router.replace('/joyful-selection/profile')" />
|
||||
<van-tabs
|
||||
v-model="active"
|
||||
class="order-tabs"
|
||||
@@ -89,6 +89,7 @@ import { mapActions, mapState } from 'pinia'
|
||||
import { Dialog, Toast } from 'vant'
|
||||
import { postFunction } from '@/api/supplied-service'
|
||||
import { useUserStore } from '@/store/user'
|
||||
import { useUiStore } from '@/store/ui'
|
||||
import { savePaymentInfo } from '../../order/payment/payment-data'
|
||||
import JoyfulSelectionOrdersSkeleton from '@/skeleton-view/joyful-selection/profile/orders/index.vue'
|
||||
|
||||
@@ -136,7 +137,6 @@ export default {
|
||||
JoyfulSelectionOrdersSkeleton
|
||||
},
|
||||
data: () => ({
|
||||
active: 0,
|
||||
tabs: [
|
||||
{ label: '全部', type: 'all' },
|
||||
{ label: '待付款', type: 'pending-main' },
|
||||
@@ -152,6 +152,15 @@ export default {
|
||||
}),
|
||||
computed: {
|
||||
...mapState(useUserStore, ['supplierId', 'userId']),
|
||||
...mapState(useUiStore, ['ordersTab']),
|
||||
active: {
|
||||
get() {
|
||||
return this.ordersTab
|
||||
},
|
||||
set(value) {
|
||||
this.setOrdersTab(value)
|
||||
}
|
||||
},
|
||||
activeTab() {
|
||||
return this.tabs[this.active] || this.tabs[0]
|
||||
},
|
||||
@@ -189,7 +198,9 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
...mapActions(useUserStore, ['fetchBridgeToken']),
|
||||
...mapActions(useUiStore, ['loadUi', 'setOrdersTab']),
|
||||
applyRouteTab() {
|
||||
this.loadUi()
|
||||
const tabIndexMap = {
|
||||
'pending-pay': 1,
|
||||
'pending-ship': 2,
|
||||
@@ -199,7 +210,7 @@ export default {
|
||||
const nextActive = tabIndexMap[this.$route.query.tab]
|
||||
|
||||
if (nextActive !== undefined) {
|
||||
this.active = nextActive
|
||||
this.setOrdersTab(nextActive)
|
||||
}
|
||||
},
|
||||
previewProducts(products = []) {
|
||||
|
||||
Reference in New Issue
Block a user