|
|
@@ -70,6 +70,58 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
+ <!-- 商城订单快捷 -->
|
|
|
+ <view class="mall-section" v-if="totalPoints > 0">
|
|
|
+ <view class="mall-header" @click="goToOrders">
|
|
|
+ <text class="mall-title">🛒 商城订单</text>
|
|
|
+ <text class="mall-more">全部订单 ›</text>
|
|
|
+ </view>
|
|
|
+ <view class="mall-grid">
|
|
|
+ <view class="mall-item" @click="goToOrders">
|
|
|
+ <text class="mall-item-num" v-if="orderPending > 0">{{ orderPending }}</text>
|
|
|
+ <text class="mall-item-num" v-else>0</text>
|
|
|
+ <text class="mall-item-label">待审核</text>
|
|
|
+ </view>
|
|
|
+ <view class="mall-item" @click="goToOrders">
|
|
|
+ <text class="mall-item-num" v-if="orderUnpaid > 0">{{ orderUnpaid }}</text>
|
|
|
+ <text class="mall-item-num" v-else>0</text>
|
|
|
+ <text class="mall-item-label">待付款</text>
|
|
|
+ </view>
|
|
|
+ <view class="mall-item" @click="goToOrders">
|
|
|
+ <text class="mall-item-num" v-if="orderShipped > 0">{{ orderShipped }}</text>
|
|
|
+ <text class="mall-item-num" v-else>0</text>
|
|
|
+ <text class="mall-item-label">待发货</text>
|
|
|
+ </view>
|
|
|
+ <view class="mall-item" @click="goToOrders">
|
|
|
+ <text class="mall-item-num" v-if="orderAfterSale > 0">{{ orderAfterSale }}</text>
|
|
|
+ <text class="mall-item-num" v-else>0</text>
|
|
|
+ <text class="mall-item-label">售后</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 推广中心快捷 -->
|
|
|
+ <view class="mall-section" v-if="commissionBalance > 0 || referralCount > 0 || teamCount > 0">
|
|
|
+ <view class="mall-header" @click="goToPromotion">
|
|
|
+ <text class="mall-title">💰 推广中心</text>
|
|
|
+ <text class="mall-more">进入 ›</text>
|
|
|
+ </view>
|
|
|
+ <view class="mall-grid">
|
|
|
+ <view class="mall-item" @click="goToPromotion">
|
|
|
+ <text class="mall-item-num">{{ commissionBalance }}</text>
|
|
|
+ <text class="mall-item-label">可提现</text>
|
|
|
+ </view>
|
|
|
+ <view class="mall-item" @click="goToPromotion">
|
|
|
+ <text class="mall-item-num">{{ referralCount }}</text>
|
|
|
+ <text class="mall-item-label">邀请人数</text>
|
|
|
+ </view>
|
|
|
+ <view class="mall-item" @click="goToPromotion">
|
|
|
+ <text class="mall-item-num">{{ teamCount }}</text>
|
|
|
+ <text class="mall-item-label">团队人数</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
<!-- 五维能量 -->
|
|
|
<view class="energy-section" v-if="sandboxData">
|
|
|
<view class="section-header">
|
|
|
@@ -158,14 +210,21 @@
|
|
|
<!-- 商城 -->
|
|
|
<view class="menu-group" v-if="showServices">
|
|
|
<view class="menu-group-title">商城</view>
|
|
|
- <view class="menu-item" @click="goToMembership">
|
|
|
- <text class="menu-icon">👑</text>
|
|
|
- <text class="menu-text">会员中心</text>
|
|
|
+ <view class="menu-item" @click="goToPromotion">
|
|
|
+ <text class="menu-icon">💰</text>
|
|
|
+ <text class="menu-text">推广中心</text>
|
|
|
<text class="arrow">›</text>
|
|
|
</view>
|
|
|
<view class="menu-item" @click="goToOrders">
|
|
|
<text class="menu-icon">🛒</text>
|
|
|
<text class="menu-text">我的订单</text>
|
|
|
+ <text class="badge" v-if="orderPending + orderUnpaid + orderShipped + orderAfterSale > 0">{{ orderPending + orderUnpaid + orderShipped + orderAfterSale }}</text>
|
|
|
+ <text class="arrow">›</text>
|
|
|
+ </view>
|
|
|
+ <view class="menu-item" @click="goToCart">
|
|
|
+ <text class="menu-icon">🛍️</text>
|
|
|
+ <text class="menu-text">购物车</text>
|
|
|
+ <text class="badge" v-if="cartCount > 0">{{ cartCount }}</text>
|
|
|
<text class="arrow">›</text>
|
|
|
</view>
|
|
|
<view class="menu-item" @click="goToCoupons">
|
|
|
@@ -206,7 +265,8 @@ import AIFloatingAvatar from '../../components/AIFloatingAvatar.vue'
|
|
|
import {
|
|
|
getChildren, getVisibleFamilyMembers, getFamilyEnergySandbox,
|
|
|
getTodayTasksByCategory, getChallengeList, getMyMembership,
|
|
|
- verifyPassword, getPointsBalance, getUserInfo
|
|
|
+ verifyPassword, getPointsBalance, getUserInfo,
|
|
|
+ cartCount, getOrderCounts, getCommissionSummary, getReferralSummary
|
|
|
} from '../../utils/api.js'
|
|
|
|
|
|
export default {
|
|
|
@@ -227,7 +287,17 @@ export default {
|
|
|
activeChallenges: 0,
|
|
|
profileProgress: 0,
|
|
|
sandboxData: null,
|
|
|
- energyDims: []
|
|
|
+ energyDims: [],
|
|
|
+ // 商城
|
|
|
+ cartCount: 0,
|
|
|
+ orderPending: 0,
|
|
|
+ orderUnpaid: 0,
|
|
|
+ orderShipped: 0,
|
|
|
+ orderAfterSale: 0,
|
|
|
+ // 推广中心
|
|
|
+ commissionBalance: 0,
|
|
|
+ referralCount: 0,
|
|
|
+ teamCount: 0
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -278,6 +348,9 @@ export default {
|
|
|
this.loadSandbox()
|
|
|
this.loadTasks()
|
|
|
this.loadChallenges()
|
|
|
+ this.loadOrderCounts()
|
|
|
+ this.loadCartCount()
|
|
|
+ this.loadPromotion()
|
|
|
},
|
|
|
loadUserInfo() {
|
|
|
var self = this
|
|
|
@@ -358,6 +431,38 @@ export default {
|
|
|
}
|
|
|
}).catch(function() {})
|
|
|
},
|
|
|
+ loadOrderCounts() {
|
|
|
+ var self = this
|
|
|
+ getOrderCounts().then(function(res) {
|
|
|
+ if (res && res.data) {
|
|
|
+ self.orderPending = res.data.pending || 0
|
|
|
+ self.orderUnpaid = res.data.unpaid || res.data.paid || 0
|
|
|
+ self.orderShipped = res.data.shipped || 0
|
|
|
+ self.orderAfterSale = res.data.refunding || res.data.afterSale || 0
|
|
|
+ }
|
|
|
+ }).catch(function() {})
|
|
|
+ },
|
|
|
+ loadCartCount() {
|
|
|
+ var self = this
|
|
|
+ cartCount().then(function(res) {
|
|
|
+ if (res && res.data != null) {
|
|
|
+ self.cartCount = res.data || 0
|
|
|
+ }
|
|
|
+ }).catch(function() {})
|
|
|
+ },
|
|
|
+ loadPromotion() {
|
|
|
+ var self = this
|
|
|
+ getCommissionSummary().then(function(res) {
|
|
|
+ if (res && res.data) {
|
|
|
+ self.commissionBalance = res.data.availableAmount || res.data.balance || 0
|
|
|
+ }
|
|
|
+ }).catch(function() {})
|
|
|
+ getReferralSummary().then(function(res) {
|
|
|
+ if (res && res.data) {
|
|
|
+ self.referralCount = res.data.totalCount || res.data.count || 0
|
|
|
+ }
|
|
|
+ }).catch(function() {})
|
|
|
+ },
|
|
|
getDimColor: function(code) {
|
|
|
var map = {
|
|
|
body: '#FF8C42', mind: '#FF6B9D', wisdom: '#6366F1',
|
|
|
@@ -401,6 +506,12 @@ export default {
|
|
|
goToMembership: function() {
|
|
|
uni.navigateTo({ url: '/pages/membership/index' })
|
|
|
},
|
|
|
+ goToPromotion: function() {
|
|
|
+ uni.navigateTo({ url: '/pages/promotion/index' })
|
|
|
+ },
|
|
|
+ goToCart: function() {
|
|
|
+ uni.navigateTo({ url: '/pages/shop/cart/cart' })
|
|
|
+ },
|
|
|
goToOrders: function() {
|
|
|
uni.navigateTo({ url: '/pages/shop/order-list/order-list' })
|
|
|
},
|