|
@@ -150,6 +150,59 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
+ <!-- 我的订单(购物车 + 订单四态入口;修复:改版后仅剩「资产-订单」总数,购物车/待付款/待发货/待收货/售后入口缺失) -->
|
|
|
|
|
+ <view class="assets-section">
|
|
|
|
|
+ <BaseCard padding="md" class="assets-card">
|
|
|
|
|
+ <view class="assets-header">
|
|
|
|
|
+ <text class="assets-title">我的订单</text>
|
|
|
|
|
+ <text class="order-all-link" @click="goToOrders">全部订单 ›</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="order-grid">
|
|
|
|
|
+ <view class="order-grid-item" @click="goToOrderStatus('pending')" aria-label="待付款">
|
|
|
|
|
+ <view class="order-icon-wrap">
|
|
|
|
|
+ <view class="order-ic order-ic-pay"></view>
|
|
|
|
|
+ <text class="order-badge" v-if="orderPending > 0">{{ orderPending > 99 ? '99+' : orderPending }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <text class="order-grid-text">待付款</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="order-grid-item" @click="goToOrderStatus('paid')" aria-label="待发货">
|
|
|
|
|
+ <view class="order-icon-wrap">
|
|
|
|
|
+ <view class="order-ic order-ic-ship"></view>
|
|
|
|
|
+ <text class="order-badge" v-if="orderUnpaid > 0">{{ orderUnpaid > 99 ? '99+' : orderUnpaid }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <text class="order-grid-text">待发货</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="order-grid-item" @click="goToOrderStatus('shipped')" aria-label="待收货">
|
|
|
|
|
+ <view class="order-icon-wrap">
|
|
|
|
|
+ <view class="order-ic order-ic-receive"></view>
|
|
|
|
|
+ <text class="order-badge" v-if="orderShipped > 0">{{ orderShipped > 99 ? '99+' : orderShipped }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <text class="order-grid-text">待收货</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="order-grid-item" @click="goToOrderStatus('refunding')" aria-label="退款售后">
|
|
|
|
|
+ <view class="order-icon-wrap">
|
|
|
|
|
+ <view class="order-ic order-ic-after"></view>
|
|
|
|
|
+ <text class="order-badge" v-if="orderAfterSale > 0">{{ orderAfterSale > 99 ? '99+' : orderAfterSale }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <text class="order-grid-text">退款/售后</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="order-grid-item" @click="goToCart" aria-label="购物车">
|
|
|
|
|
+ <view class="order-icon-wrap">
|
|
|
|
|
+ <view class="order-ic order-ic-cart"></view>
|
|
|
|
|
+ <text class="order-badge" v-if="cartCount > 0">{{ cartCount > 99 ? '99+' : cartCount }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <text class="order-grid-text">购物车</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="order-extra-row">
|
|
|
|
|
+ <view class="order-extra-item" @click="goToAddress" aria-label="收货地址">
|
|
|
|
|
+ <view class="order-ic order-ic-address"></view>
|
|
|
|
|
+ <text class="order-extra-text">收货地址</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </BaseCard>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
<!-- 资产入口区:订单 / 卡券 / 成就 收敛为单卡 3 宫格(原 5+2+5 宫格 -> 3 汇总入口,明细进二级页) -->
|
|
<!-- 资产入口区:订单 / 卡券 / 成就 收敛为单卡 3 宫格(原 5+2+5 宫格 -> 3 汇总入口,明细进二级页) -->
|
|
|
<view class="assets-section">
|
|
<view class="assets-section">
|
|
|
<BaseCard padding="md" class="assets-card">
|
|
<BaseCard padding="md" class="assets-card">
|
|
@@ -281,6 +334,7 @@ import {
|
|
|
getProfileStats, getMyReferrer, getVendorTeamList, getVendorHierarchyInfo, getMyCoupons,
|
|
getProfileStats, getMyReferrer, getVendorTeamList, getVendorHierarchyInfo, getMyCoupons,
|
|
|
getTeacherInfo, getTeacherPendingTasks, getTeacherUnreadCount, getUserRoles,
|
|
getTeacherInfo, getTeacherPendingTasks, getTeacherUnreadCount, getUserRoles,
|
|
|
getReferralCode, extractReferralCode, getShareQrCode, getEnergySandbox,
|
|
getReferralCode, extractReferralCode, getShareQrCode, getEnergySandbox,
|
|
|
|
|
+ cartCount,
|
|
|
vendorStatus
|
|
vendorStatus
|
|
|
} from '../../utils/api.js'
|
|
} from '../../utils/api.js'
|
|
|
import { countAvailableCoupons } from '../../utils/couponCount.js'
|
|
import { countAvailableCoupons } from '../../utils/couponCount.js'
|
|
@@ -321,6 +375,7 @@ export default {
|
|
|
orderUnpaid: 0,
|
|
orderUnpaid: 0,
|
|
|
orderShipped: 0,
|
|
orderShipped: 0,
|
|
|
orderAfterSale: 0,
|
|
orderAfterSale: 0,
|
|
|
|
|
+ cartCount: 0,
|
|
|
couponCount: 0,
|
|
couponCount: 0,
|
|
|
// 待办
|
|
// 待办
|
|
|
pendingTasks: 0,
|
|
pendingTasks: 0,
|
|
@@ -498,6 +553,7 @@ export default {
|
|
|
this.loadFamily()
|
|
this.loadFamily()
|
|
|
this.loadTasks()
|
|
this.loadTasks()
|
|
|
this.loadOrderCounts()
|
|
this.loadOrderCounts()
|
|
|
|
|
+ this.loadCartCount()
|
|
|
this.loadProfileStats()
|
|
this.loadProfileStats()
|
|
|
this.loadReferralEarnings()
|
|
this.loadReferralEarnings()
|
|
|
this.loadTeamInfo()
|
|
this.loadTeamInfo()
|
|
@@ -558,6 +614,14 @@ export default {
|
|
|
}
|
|
}
|
|
|
}).catch(function() {})
|
|
}).catch(function() {})
|
|
|
},
|
|
},
|
|
|
|
|
+ loadCartCount() {
|
|
|
|
|
+ var self = this
|
|
|
|
|
+ cartCount().then(function(res) {
|
|
|
|
|
+ if (res && res.data != null) {
|
|
|
|
|
+ self.cartCount = res.data || 0
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(function() {})
|
|
|
|
|
+ },
|
|
|
loadProfileStats() {
|
|
loadProfileStats() {
|
|
|
var self = this
|
|
var self = this
|
|
|
getProfileStats().then(function(res) {
|
|
getProfileStats().then(function(res) {
|
|
@@ -790,6 +854,16 @@ export default {
|
|
|
goToOrders: function() {
|
|
goToOrders: function() {
|
|
|
uni.navigateTo({ url: '/pages/shop/order-list/order-list' })
|
|
uni.navigateTo({ url: '/pages/shop/order-list/order-list' })
|
|
|
},
|
|
},
|
|
|
|
|
+ // 按订单状态进入列表(order-list 页 onLoad 读 options.status 选中对应 tab)
|
|
|
|
|
+ goToOrderStatus: function(status) {
|
|
|
|
|
+ uni.navigateTo({ url: '/pages/shop/order-list/order-list?status=' + status })
|
|
|
|
|
+ },
|
|
|
|
|
+ goToCart: function() {
|
|
|
|
|
+ uni.navigateTo({ url: '/pages/shop/cart/cart' })
|
|
|
|
|
+ },
|
|
|
|
|
+ goToAddress: function() {
|
|
|
|
|
+ uni.navigateTo({ url: '/pages/shop/address/address' })
|
|
|
|
|
+ },
|
|
|
goToMessageHistory: function() {
|
|
goToMessageHistory: function() {
|
|
|
uni.navigateTo({ url: '/pages/profile/message-history' })
|
|
uni.navigateTo({ url: '/pages/profile/message-history' })
|
|
|
},
|
|
},
|
|
@@ -1124,7 +1198,9 @@ $gp-brand-d: str-slice('#{$brand-primary}', 2);
|
|
|
padding: 6rpx 20rpx;
|
|
padding: 6rpx 20rpx;
|
|
|
flex-shrink: 0;
|
|
flex-shrink: 0;
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
- min-height: 88rpx;
|
|
|
|
|
|
|
+ /* 与 .level-badge(40rpx) 等高对齐(修复:原 min-height:88rpx 过高) */
|
|
|
|
|
+ min-height: 40rpx;
|
|
|
|
|
+ height: 40rpx;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
}
|
|
}
|
|
@@ -1373,6 +1449,86 @@ $gp-brand-d: str-slice('#{$brand-primary}', 2);
|
|
|
line-height: 1;
|
|
line-height: 1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/* ===== 我的订单(购物车 + 订单四态入口 · 改版后补齐) ===== */
|
|
|
|
|
+.order-all-link {
|
|
|
|
|
+ font-size: calc(24rpx * var(--font-scale, 1));
|
|
|
|
|
+ color: $brand-primary;
|
|
|
|
|
+}
|
|
|
|
|
+.order-grid {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: row;
|
|
|
|
|
+ align-items: flex-start;
|
|
|
|
|
+}
|
|
|
|
|
+.order-grid-item {
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 10rpx;
|
|
|
|
|
+}
|
|
|
|
|
+.order-icon-wrap {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ width: 64rpx;
|
|
|
|
|
+ height: 64rpx;
|
|
|
|
|
+ border-radius: 50%;
|
|
|
|
|
+ background: $brand-primary-soft;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+}
|
|
|
|
|
+.order-ic {
|
|
|
|
|
+ width: 34rpx;
|
|
|
|
|
+ height: 34rpx;
|
|
|
|
|
+ background-repeat: no-repeat;
|
|
|
|
|
+ background-position: center;
|
|
|
|
|
+ background-size: 34rpx 34rpx;
|
|
|
|
|
+}
|
|
|
|
|
+.order-ic-pay { background-image: gp-icon($gp-brand-bg, '%3Crect x=%222%22 y=%225%22 width=%2220%22 height=%2214%22 rx=%222%22/%3E%3Cpath d=%22M2 10h20%22/%3E'); }
|
|
|
|
|
+.order-ic-ship { background-image: gp-icon($gp-brand-bg, '%3Cpath d=%22M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z%22/%3E%3Cpath d=%22M16 16v5%22/%3E'); }
|
|
|
|
|
+.order-ic-receive { background-image: gp-icon($gp-brand-bg, '%3Cpath d=%22M1 4h12v11H1z%22/%3E%3Cpath d=%22M13 8h3.5l2.5 3v4h-6%22/%3E%3Ccircle cx=%225.5%22 cy=%2217.5%22 r=%222%22/%3E%3Ccircle cx=%2217.5%22 cy=%2217.5%22 r=%222%22/%3E'); }
|
|
|
|
|
+.order-ic-after { background-image: gp-icon($gp-brand-bg, '%3Cpath d=%22M4 12a8 8 0 0 1 13.7-5.6%22/%3E%3Cpath d=%22M20 12a8 8 0 0 1-13.7 5.6%22/%3E%3Cpolyline points=%224 7.5 4 12 8.5 12%22/%3E%3Cpolyline points=%2220 16.5 20 12 15.5 12%22/%3E'); }
|
|
|
|
|
+.order-ic-cart { background-image: gp-icon($gp-brand-bg, '%3Ccircle cx=%229%22 cy=%2220%22 r=%221.5%22/%3E%3Ccircle cx=%2218%22 cy=%2220%22 r=%221.5%22/%3E%3Cpath d=%22M2 4h3l2.5 12h11l2-8H6%22/%3E'); }
|
|
|
|
|
+.order-badge {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: -8rpx;
|
|
|
|
|
+ right: -12rpx;
|
|
|
|
|
+ min-width: 30rpx;
|
|
|
|
|
+ height: 30rpx;
|
|
|
|
|
+ padding: 0 8rpx;
|
|
|
|
|
+ border-radius: 999rpx;
|
|
|
|
|
+ background: $status-danger-strong;
|
|
|
|
|
+ color: $app-surface;
|
|
|
|
|
+ font-size: 20rpx;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ line-height: 30rpx;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+}
|
|
|
|
|
+.order-grid-text {
|
|
|
|
|
+ font-size: calc(20rpx * var(--font-scale, 1));
|
|
|
|
|
+ color: $facade-text-body;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+}
|
|
|
|
|
+.order-extra-row {
|
|
|
|
|
+ margin-top: 16rpx;
|
|
|
|
|
+ border-top: 1rpx solid $uni-border-subtle;
|
|
|
|
|
+ padding-top: 16rpx;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: row;
|
|
|
|
|
+}
|
|
|
|
|
+.order-extra-item {
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ gap: 12rpx;
|
|
|
|
|
+}
|
|
|
|
|
+.order-ic-address { background-image: gp-icon($gp-brand-bg, '%3Cpath d=%22M12 21s-7-6.2-7-11a7 7 0 0 1 14 0c0 4.8-7 11-7 11z%22/%3E%3Ccircle cx=%2212%22 cy=%2210%22 r=%222.5%22/%3E'); }
|
|
|
|
|
+.order-extra-text {
|
|
|
|
|
+ font-size: calc(24rpx * var(--font-scale, 1));
|
|
|
|
|
+ color: $facade-text-body;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/* 规划师服务中心入口 */
|
|
/* 规划师服务中心入口 */
|
|
|
.service-center-section {
|
|
.service-center-section {
|
|
|
margin: 0 $uni-space-lg 20rpx;
|
|
margin: 0 $uni-space-lg 20rpx;
|