Forráskód Böngészése

feat: 优化购物车和订单功能,增加用户体验改进

ylong 12 órája
szülő
commit
03bbfc2550

+ 14 - 4
pages-car/components/cart-item.vue

@@ -1,7 +1,7 @@
 <template>
-    <view class="cart-item">
+    <view class="cart-item" @click="goToDetail">
         <!-- 复选框 -->
-        <view class="checkbox-box">
+        <view class="checkbox-box" @click.stop>
             <u-checkbox v-model="item.checked" shape="circle" active-color="#38C148" @change="onCheckChange"
                 :disabled="!isValid" style="width:100%"></u-checkbox>
         </view>
@@ -61,8 +61,10 @@
                 </view>
 
                 <!-- 数量加减 -->
-                <u-number-box v-model="item.quantity" :min="1" :max="item.availableStock || 99" :disabled="!isValid"
-                    @change="onNumChange" :size="24"></u-number-box>
+                <view @click.stop>
+                    <u-number-box v-model="item.quantity" :min="1" :max="item.availableStock || 99" :disabled="!isValid"
+                        @change="onNumChange" :size="24"></u-number-box>
+                </view>
             </view>
         </view>
     </view>
@@ -116,6 +118,14 @@
             },
             onCountdownFinish() {
                 this.$emit('countdown-finish', this.item);
+            },
+            goToDetail() {
+                const isbn = this.item.isbn || this.item.bookIsbn || this.item.id;
+                if (isbn) {
+                    uni.navigateTo({
+                        url: `/pages-sell/pages/detail?isbn=${isbn}`
+                    });
+                }
             }
         }
     };

+ 184 - 164
pages-car/components/red-packet-item.vue

@@ -1,125 +1,128 @@
 <template>
     <view class="red-packet-item" :class="{ 'is-disabled': isDisabled }">
-        <view class="left-part">
-            <view class="amount-box">
-                <text class="symbol">¥</text>
-                <text class="amount">{{ info.faceMoney || 0 }}</text>
-            </view>
-            <view class="condition" v-if="info.thresholdMoney === 0">无门槛使用</view>
-            <view class="condition" v-else>满 ¥{{ info.thresholdMoney || 0 }} 使用</view>
-        </view>
-        <view class="right-part">
-            <view class="info-top">
-                <view class="title-row">
-                    <view class="tag" :class="info.type == 2 ? 'surprise' : 'normal'">
-                        {{ info.type == 2 ? '惊喜红包' : '普通红包' }}
-                    </view>
-                    <text class="title">{{ info.couponName }}</text>
+        <image class="bg-img" :src="isDisabled ? '/pages-car/static/coupon-no.png' : '/pages-car/static/coupon.png'"
+            mode="scaleToFill"></image>
+        <view class="content">
+            <view class="left-part">
+                <view class="amount-box">
+                    <text class="symbol">¥</text>
+                    <text class="amount">{{ info.faceMoney || 0 }}</text>
                 </view>
-                <view class="date">{{ formatEndTime }}到期</view>
+                <view class="condition" v-if="info.thresholdMoney === 0">无门槛使用</view>
+                <view class="condition" v-else>满{{ info.thresholdMoney || 0 }}使用</view>
             </view>
-            
-            <view class="action-box">
-                <view v-if="status === 0" class="btn-use" @click="onUse">立即使用</view>
-                <view v-else-if="status === 1" class="stamp used">
-                    <text>已使用</text>
+            <view class="right-part">
+                <view class="info-top">
+                    <view class="title-row">
+                        <text class="type-name">{{ getTypeName(info.type) }}</text>
+
+                        <view class="condition" v-if="info.thresholdMoney === 0">无门槛减{{ info.faceMoney || 0 }}元</view>
+                        <text class="sub-title" v-else>满{{ info.thresholdMoney || 0 }}减{{ info.faceMoney || 0 }}元</text>
+                    </view>
+                    <view class="date">{{ formatEndTime }}到期</view>
                 </view>
-                <view v-else-if="status === 2" class="stamp expired">
-                    <text>已过期</text>
+
+                <view class="action-box" v-if="status === 0">
+                    <view class="btn-use" @click="onUse">{{ info.type == 2 ? '赠送给朋友' : '立即使用' }}</view>
                 </view>
             </view>
         </view>
+        <image v-if="status === 1" class="stamp-img" src="/pages-car/static/coupon-used.png" mode="aspectFit"></image>
+        <image v-if="status === 2" class="stamp-img" src="/pages-car/static/coupon-gq.png" mode="aspectFit"></image>
     </view>
 </template>
 
 <script>
-export default {
-    name: "red-packet-item",
-    props: {
-        info: {
-            type: Object,
-            default: () => ({})
-        }
-    },
-    computed: {
-        // 0: unused, 1: used, 2: expired
-        status() {
-            if (this.info.useTime) {
-                return 1;
-            } else if (this.info.effectEndTime && new Date(this.info.effectEndTime.replace(/-/g, '/')).getTime() < new Date().getTime()) {
-                return 2;
+    export default {
+        name: "red-packet-item",
+        props: {
+            info: {
+                type: Object,
+                default: () => ({})
             }
-            return 0;
         },
-        isDisabled() {
-            return this.status !== 0;
+        computed: {
+            // 0: unused, 1: used, 2: expired
+            status() {
+                if (this.info.useTime) {
+                    return 1;
+                } else if (this.info.effectEndTime && new Date(this.info.effectEndTime.replace(/-/g, '/')).getTime() < new Date().getTime()) {
+                    return 2;
+                }
+                return 0;
+            },
+            isDisabled() {
+                return this.status !== 0;
+            },
+            formatEndTime() {
+                let endTime = this.info.effectEndTime || '';
+                if (endTime && endTime.length >= 10) {
+                    return endTime.substring(0, 10).replace(/-/g, '.');
+                }
+                return endTime;
+            }
         },
-        formatEndTime() {
-            let endTime = this.info.effectEndTime || '';
-            if (endTime && endTime.length >= 10) {
-                return endTime.substring(0, 10).replace(/-/g, '.');
+        methods: {
+            getTypeName(type) {
+                if (type == 2) return '惊喜红包';
+                if (type == 3) return '买书得红包';
+                return '普通红包';
+            },
+            onUse() {
+                this.$emit('use', this.info);
             }
-            return endTime;
-        }
-    },
-    methods: {
-        onUse() {
-            this.$emit('use', this.info);
         }
     }
-}
 </script>
 
 <style lang="scss" scoped>
-.red-packet-item {
-    display: flex;
-    background-color: #ffffff;
-    border-radius: 16rpx;
-    margin: 20rpx 24rpx;
-    position: relative;
-    overflow: hidden;
-    box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
-
-    &.is-disabled {
-        .left-part {
-            color: #999;
-            .amount-box {
-                color: #999;
-            }
+    .red-packet-item {
+        position: relative;
+        width: 702rpx;
+        height: 180rpx;
+        margin: 20rpx auto;
+        border-radius: 12rpx;
+        padding: 6rpx;
+        background: radial-gradient( 0% 0% at 0% 0%, #F81011 0%, #FE6F43 100%);
+
+
+        .bg-img {
+            position: absolute;
+            top: 8rpx;
+            left: 6rpx;
+            right: 6rpx;
+            bottom: 4rpx;
+            width: calc(100% - 12rpx);
+            height: calc(100% - 12rpx);
+            z-index: 0;
         }
-        .right-part {
-            .title {
-                color: #999;
-            }
-            .tag {
-                background-color: #ccc;
-                color: #fff;
-            }
+
+        .content {
+            position: relative;
+            z-index: 1;
+            display: flex;
+            width: 100%;
+            height: 100%;
         }
-    }
 
-    .left-part {
-        width: 200rpx;
+        .left-part {
+        width: 220rpx;
         display: flex;
         flex-direction: column;
         justify-content: center;
         align-items: center;
-        color: #e02020;
-        border-right: 1px dashed #eeeeee;
+        color: #F53F3F;
+        padding-left: 10rpx;
         position: relative;
-        padding: 30rpx 0;
 
-        &::before, &::after {
+        &::after {
             content: '';
             position: absolute;
-            right: -10rpx;
-            width: 20rpx;
-            height: 20rpx;
-            background-color: #f5f5f5; // Assume page bg is #f5f5f5
-            border-radius: 50%;
+            right: 0;
+            top: 20rpx;
+            bottom: 20rpx;
+            border-right: 4rpx dashed #E91B13;
         }
-        &::before { top: -10rpx; }
-        &::after { bottom: -10rpx; }
 
         .amount-box {
             display: flex;
@@ -127,105 +130,122 @@ export default {
             font-weight: bold;
             .symbol {
                 font-size: 28rpx;
+                margin-right: 4rpx;
             }
             .amount {
-                font-size: 60rpx;
+                font-size: 64rpx;
                 line-height: 1;
+                background: radial-gradient(0% 0% at 0% 0%, #F81011 0%, #FE6F43 100%);
+                -webkit-background-clip: text;
+                -webkit-text-fill-color: transparent;
+                color: transparent;
             }
         }
-        .condition {
-            font-size: 22rpx;
-            margin-top: 10rpx;
+
+            .condition {
+                font-size: 24rpx;
+                margin-top: 12rpx;
+                color: #666;
+            }
         }
-    }
 
-    .right-part {
-        flex: 1;
-        padding: 30rpx 24rpx;
-        display: flex;
-        flex-direction: column;
-        justify-content: space-between;
-        position: relative;
+        .right-part {
+            flex: 1;
+            padding: 30rpx 30rpx 30rpx 20rpx;
+            display: flex;
+            flex-direction: column;
+            justify-content: space-between;
+            position: relative;
+
+            .info-top {
+                .title-row {
+                    display: flex;
+                    align-items: center;
+                    margin-bottom: 20rpx;
 
-        .info-top {
-            .title-row {
-                display: flex;
-                align-items: center;
-                flex-wrap: wrap;
-                margin-bottom: 16rpx;
-
-                .tag {
-                    font-size: 20rpx;
-                    padding: 2rpx 8rpx;
-                    border-radius: 4rpx;
-                    margin-right: 10rpx;
-                    
-                    &.normal {
-                        background-color: #fcebeb;
-                        color: #e02020;
+                    .type-name {
+                        font-size: 28rpx;
+                        color: #F53F3F;
+                        font-weight: 500;
+                        margin-right: 16rpx;
                     }
-                    &.surprise {
-                        background-color: #fff0e5;
-                        color: #ff6a00;
+
+                    .sub-title {
+                        font-size: 26rpx;
+                        color: #333;
                     }
                 }
 
-                .title {
-                    font-size: 28rpx;
-                    color: #333;
-                    font-weight: 500;
+                .date {
+                    font-size: 24rpx;
+                    color: #999;
                 }
             }
 
-            .date {
-                font-size: 22rpx;
-                color: #999;
+            .action-box {
+                position: absolute;
+                right: 30rpx;
+                bottom: 30rpx;
+
+                .btn-use {
+                    background: radial-gradient( 0% 0% at 0% 0%, #F3B26B 0%, #FFF1D8 100%);
+                    color: #E91B13;
+                    font-size: 24rpx;
+                    padding: 10rpx 26rpx;
+                    border-radius: 30rpx;
+                    box-shadow: 0 4rpx 8rpx rgba(255, 133, 89, 0.3);
+                }
             }
         }
 
-        .action-box {
+        .stamp-img {
             position: absolute;
-            right: 24rpx;
-            bottom: 30rpx;
-            
-            // For status buttons aligned with date or bottom right
+            right: 16rpx;
+            top: 28rpx;
+            width: 133rpx;
+            height: 120rpx;
+            z-index: 2;
         }
 
-        .btn-use {
-            background-color: #e02020;
-            color: #fff;
-            font-size: 24rpx;
-            padding: 10rpx 24rpx;
-            border-radius: 30rpx;
-        }
+        &.is-disabled {
+            background: radial-gradient( 0% 0% at 0% 0%, #C4C4C4 0%, #DCDCDC 100%);
+            .left-part {
+                color: #787878;
+                &::after {
+                    border-right: 4rpx dashed #787878;
+                }
 
-        .stamp {
-            width: 100rpx;
-            height: 100rpx;
-            border: 2rpx solid #ccc;
-            border-radius: 50%;
-            display: flex;
-            justify-content: center;
-            align-items: center;
-            transform: rotate(-30deg);
-            opacity: 0.6;
-            
-            text {
-                font-size: 24rpx;
-                color: #999;
-                font-weight: bold;
-            }
-            
-            &.used {
-                border-color: #999;
-                text { color: #999; }
+                .amount-box {
+                    .amount {
+                        background: none;
+                        -webkit-text-fill-color: initial;
+                        color: #787878;
+                    }
+                }
+
+                .condition {
+                    color: #787878;
+                }
             }
-            
-            &.expired {
-                border-color: #999;
-                text { color: #999; }
+
+            .right-part {
+                .info-top {
+                    .title-row {
+                        .type-name {
+                            color: #787878;
+                        }
+                        .sub-title {
+                            color: #787878;
+                        }
+                        .condition {
+                            color: #787878;
+                        }
+                    }
+                    .date {
+                        color: #787878;
+                    }
+                }
             }
         }
     }
-}
 </style>

+ 6 - 1
pages-car/components/red-packet-popup.vue

@@ -63,7 +63,12 @@
                 this.show = false;
             },
             selectPacket(index) {
-                this.selectedIndex = index;
+                if (this.selectedIndex === index) {
+                    // 如果点击的是已选中的项,则取消选中
+                    this.selectedIndex = -1;
+                } else {
+                    this.selectedIndex = index;
+                }
             },
             confirm() {
                 if (this.list && this.list.length > 0 && this.selectedIndex !== -1) {

+ 5 - 2
pages-car/pages/my-order.vue

@@ -93,6 +93,8 @@
                         uni.hideLoading();
                         if (res.code == 200) {
                             uni.showToast({ title: '修改成功', icon: 'success' });
+                            // 刷新列表
+                            this.loadOrders(true, this.params);
                         }
                     }).finally(() => {
                         this.modifyingOrderId = null;
@@ -146,7 +148,8 @@
                         if (res.code == 200) {
                             uni.showToast({
                                 title: '已加入购物车',
-                                icon: 'success'
+                                icon: 'success',
+                                duration: 3000
                             });
                             this.$updateCartBadge();
                         }
@@ -220,7 +223,7 @@
                     // 兼容列表和详情可能的字段差异
                     const addressId = order.addressId || order.receiverAddressId || '';
                     uni.navigateTo({
-                        url: `/pages-mine/pages/address/list?id=${addressId}&isSelect=1&editAddress=1`
+                        url: `/pages-mine/pages/address/list?id=${addressId}&isSelect=1`
                     });
                 } else if (type === 'pay') {
                     // 跳转到收银台

+ 2 - 1
pages-car/pages/order-detail.vue

@@ -327,7 +327,8 @@
                         if (res.code == 200) {
                             uni.showToast({
                                 title: '已加入购物车',
-                                icon: 'success'
+                                icon: 'success',
+                                duration: 3000
                             });
                             this.$updateCartBadge();
                         }

+ 2 - 2
pages-car/pages/pay-success.vue

@@ -25,12 +25,12 @@ export default {
     methods: {
         handleReturn() {
             uni.switchTab({
-                url: '/pages/home/index'
+                url: '/pages/sell/index'
             })
         },
         handleViewOrder() {
             uni.navigateTo({
-                url: '/pages-mine/pages/return-detail?orderId=' + this.orderId
+                url: '/pages-car/pages/order-detail?orderId=' + this.orderId
             })
         }
     }

BIN
pages-car/static/coupon-gq.png


BIN
pages-car/static/coupon-no.png


BIN
pages-car/static/coupon-used.png


BIN
pages-car/static/coupon.png


+ 7 - 1
pages-mine/pages/address/list.vue

@@ -54,8 +54,12 @@ export default {
     onLoad(ops) {
         if (ops.id) {
             this.selectId = ops.id
+        }
+        if (ops.isSelect) {
             this.isSelect = ops.isSelect
-            this.editAddress = ops.editAddress || 0
+        }
+        if (ops.editAddress) {
+            this.editAddress = ops.editAddress
         }
     },
     onShow(ops) {
@@ -64,6 +68,8 @@ export default {
     methods: {
         //选择地址
         handleSelectAddr(item) {
+            if (!this.isSelect) return;
+            
             if (this.editAddress == 1) {
                 uni.$emit('selectEditAddr', item)
                 uni.setStorageSync('selectEditAddr', item)

+ 34 - 3
pages-sell/components/detail/footer-bar.vue

@@ -11,9 +11,10 @@
 				<image v-else src="/pages-sell/static/goods/icon-star.png" class="bar-icon" mode="aspectFit"></image>
 				<text :style="{ color: isCollect ? '#FFC107' : '#666' }">{{ isCollect ? '已收藏' : '收藏' }}</text>
 			</view>
-			<view class="icon-item" @click="onCart">
+			<view class="icon-item cart-item" @click="onCart">
 				<image src="/pages-sell/static/goods/icon-car.png" class="bar-icon" mode="aspectFit"></image>
 				<text>购物车</text>
+				<u-badge v-if="cartCount > 0" :count="cartCount" type="error" absolute :offset="[-5, 10]"></u-badge>
 			</view>
 		</view>
 
@@ -41,15 +42,44 @@
 				default: false
 			}
 		},
+		data() {
+			return {
+				cartCount: 0
+			};
+		},
+		mounted() {
+			this.fetchCartCount();
+			uni.$on('cartCountChanged', this.updateCartCount);
+		},
+		beforeDestroy() {
+			uni.$off('cartCountChanged', this.updateCartCount);
+		},
 		methods: {
+			fetchCartCount() {
+				const token = uni.getStorageSync('token');
+				if (token && uni.$u && uni.$u.http) {
+					uni.$u.http.post('/token/shop/cart/getCount').then(res => {
+						if (res.code == 200) {
+							this.cartCount = res.data;
+						}
+					});
+				}
+			},
+			updateCartCount(count) {
+				this.cartCount = count;
+			},
 			onHome() {
 				uni.switchTab({
-					url: '/pages/home/index'
+					url: '/pages/sell/index'
 				})
 			},
 			onCart() {
+				// 获取全局购物车角标并更新本地
+				if (uni.getStorageSync('token')) {
+					this.$updateCartBadge();
+				}
 				uni.switchTab({
-					url: '/pages-car/pages/index'
+					url: '/pages/cart/index'
 				})
 			},
 			onCollect() {
@@ -86,6 +116,7 @@
 			margin-right: 20rpx;
 
 			.icon-item {
+				position: relative;
 				display: flex;
 				flex-direction: column;
 				align-items: center;

+ 9 - 1
pages-sell/components/detail/info-card.vue

@@ -19,7 +19,7 @@
 		
 		<view class="author-row">
 			<text class="author">作者:{{ product.author }}</text>
-			<view class="works-link">
+			<view class="works-link" @click="goToAuthorWorks">
 				<text>作品</text>
 				<u-icon name="arrow-right" size="24" color="#F2950A"></u-icon>
 			</view>
@@ -35,6 +35,14 @@ export default {
 			type: Object,
 			default: () => ({})
 		}
+	},
+	methods: {
+		goToAuthorWorks() {
+			if (!this.product.author) return;
+			uni.navigateTo({
+				url: `/pages-sell/pages/search-result?keyword=${encodeURIComponent(this.product.author)}`
+			});
+		}
 	}
 }
 </script>

+ 77 - 69
pages-sell/components/detail/service-card.vue

@@ -6,7 +6,7 @@
 			</view>
 			<text class="service-label">可降</text>
 			<text class="separator">|</text>
-			<text class="service-val red">分享一人助力,可降 1.5 元</text>
+			<text class="service-val red">分享一人助力,可降 {{bookInfo.reducePrice||1}} 元</text>
 			<u-icon name="arrow-right" size="24" color="#999" class="arrow"></u-icon>
 		</view>
 		<view class="service-row">
@@ -15,7 +15,7 @@
 			</view>
 			<text class="service-label">运费</text>
 			<text class="separator">|</text>
-			<text class="service-val green">全场满 5.8 元包邮(偏远地区除外)</text>
+			<text class="service-val green">{{ bookInfo.expressDesc }}(偏远地区除外)</text>
 		</view>
 		<view class="service-row">
 			<view class="icon-box">
@@ -23,7 +23,7 @@
 			</view>
 			<text class="service-label">活动</text>
 			<text class="separator">|</text>
-			<text class="service-val red">每满 48 元减 5 元</text>
+			<text class="service-val red">{{ bookInfo.activityDesc }}</text>
 		</view>
 		<view class="service-row last" @click="openServicePopup">
 			<view class="icon-box">
@@ -39,90 +39,98 @@
 </template>
 
 <script>
-import ServicePopup from '@/pages-sell/components/service-popup/index.vue';
+	import ServicePopup from '@/pages-sell/components/service-popup/index.vue';
 
-export default {
-	name: 'ServiceCard',
-	components: {
-		ServicePopup
-	},
-	methods: {
-		onClick() {
-			this.$emit('click');
+	export default {
+		name: 'ServiceCard',
+		components: {
+			ServicePopup
 		},
-		openServicePopup() {
-			this.$refs.servicePopup.open();
+		props: {
+			bookInfo: {
+				type: Object,
+				default: () => ({})
+			}
+		},
+		methods: {
+			onClick() {
+				this.$emit('click');
+			},
+			openServicePopup() {
+				this.$refs.servicePopup.open();
+			}
 		}
 	}
-}
 </script>
 
 <style lang="scss" scoped>
-.service-card {
-	background: #fff;
-	border-radius: 24rpx 24rpx 0 0;
-	padding: 0 30rpx;
-	margin-bottom: 20rpx;
+	.service-card {
+		background: #fff;
+		border-radius: 24rpx 24rpx 0 0;
+		padding: 0 30rpx;
+		margin-bottom: 20rpx;
 
-	.service-row {
-		display: flex;
-		align-items: center;
-		padding: 30rpx 0;
-		font-size: 26rpx;
-		position: relative;
-		border-bottom: 1rpx solid #F5F5F5;
-
-		&.last {
-			border-bottom: none;
-		}
-
-		.icon-box {
-			width: 32rpx;
-			height: 32rpx;
-			margin-right: 12rpx;
+		.service-row {
 			display: flex;
 			align-items: center;
-			justify-content: center;
-			
-			.service-icon {
-				width: 100%;
-				height: 100%;
+			padding: 30rpx 0;
+			font-size: 26rpx;
+			position: relative;
+			border-bottom: 1rpx solid #F5F5F5;
+
+			&.last {
+				border-bottom: none;
 			}
-		}
 
-		.service-label {
-			color: #333;
-			font-weight: bold;
-			width: 50rpx; // Fixed width for 2 characters to ensure alignment
-			text-align: justify;
-			text-align-last: justify;
-		}
+			.icon-box {
+				width: 32rpx;
+				height: 32rpx;
+				margin-right: 12rpx;
+				display: flex;
+				align-items: center;
+				justify-content: center;
 
-		.separator {
-			color: #eee;
-			margin: 0 10rpx;
-		}
+				.service-icon {
+					width: 100%;
+					height: 100%;
+				}
+			}
 
-		.service-val {
-			color: #666;
-            flex: 1; // Allow text to take remaining space
-            overflow: hidden;
-            white-space: nowrap;
-            text-overflow: ellipsis;
+			.service-label {
+				color: #333;
+				font-weight: bold;
+				min-width: 60rpx; // Fixed width for 2 characters to ensure alignment
+				text-align: justify;
+				text-align-last: justify;
+				word-break: keep-all;
+				white-space: nowrap;
+			}
 
-			&.red {
-				color: #D81A00;
+			.separator {
+				color: #eee;
+				margin: 0 10rpx;
 			}
-			
-			&.green {
-				color: #38C248;
+
+			.service-val {
+				color: #666;
+				flex: 1; // Allow text to take remaining space
+				overflow: hidden;
+				white-space: nowrap;
+				text-overflow: ellipsis;
+
+				&.red {
+					color: #D81A00;
+				}
+
+				&.green {
+					color: #38C248;
+				}
 			}
-		}
 
-		.arrow {
-			position: absolute;
-			right: 0;
+			.arrow {
+				position: absolute;
+				right: 0;
+			}
 		}
 	}
-}
 </style>

+ 36 - 8
pages-sell/components/select-good-popup/index.vue

@@ -41,17 +41,20 @@
 			<!-- Options -->
 			<view class="options-list">
 				<view class="option-item" v-for="(opt, index) in qualityOptions" :key="index"
-					:class="{ active: currentQuality === opt.conditionType }" @click="selectQuality(opt)">
-					<image v-if="currentQuality === opt.conditionType" src="/pages-sell/static/select-good/selected.png"
-						class="bg-image"></image>
+					:class="{ active: currentQuality === opt.conditionType, disabled: isOptionDisabled(opt) }"
+					@click="selectQuality(opt)">
+					<image v-if="currentQuality === opt.conditionType && !isOptionDisabled(opt)"
+						src="/pages-sell/static/select-good/selected.png" class="bg-image"></image>
 					<view class="left">
 						<text class="opt-name">{{ opt.conditionType | conditionText }}</text>
-						<view class="opt-discount" :class="{ active: currentQuality === opt.conditionType }">
+						<view class="opt-discount"
+							:class="{ active: currentQuality === opt.conditionType && !isOptionDisabled(opt) }">
 							<text>{{ opt.discount }}折</text>
 						</view>
 					</view>
 					<view class="right">
-						<text>¥{{ opt.price }} ( 余额价 ¥{{ opt.balanceMoney }} )</text>
+						<text v-if="!isOptionDisabled(opt)">¥{{ opt.price }} ( 余额价 ¥{{ opt.balanceMoney }} )</text>
+						<text v-else>无货</text>
 					</view>
 				</view>
 			</view>
@@ -141,7 +144,17 @@
 			close() {
 				this.visible = false;
 			},
+			isOptionDisabled(opt) {
+				const stock = opt.stockNum;
+				if (stock === 0) return true;
+				if (stock === undefined || stock === null || stock === '') return false;
+				return this.toNumber(stock) <= 0;
+			},
 			selectQuality(opt) {
+				if (this.isOptionDisabled(opt)) {
+					this.$u.toast('该品相暂无库存');
+					return;
+				}
 				this.currentQuality = opt.conditionType;
 			},
 			handleAction() {
@@ -185,7 +198,7 @@
 				}).then(res => {
 					if (res.code === 200) {
 						this.$u.toast('加入购物车成功');
-                        this.$updateCartBadge();
+						this.$updateCartBadge();
 						this.$emit('confirm', {
 							product: this.currentProduct,
 							quality: this.currentQuality,
@@ -193,8 +206,8 @@
 						});
 						this.close();
 					} else {
-                        this.$u.toast(res.msg || '加入购物车失败');
-                    }
+						this.$u.toast(res.msg || '加入购物车失败');
+					}
 				});
 			},
 			formatPrice(price) {
@@ -359,6 +372,21 @@
 				border-color: transparent;
 			}
 
+			&.disabled {
+				background: #F0F0F0;
+				border-color: #E0E0E0;
+				opacity: 0.7;
+
+				.opt-name,
+				.right text {
+					color: #999;
+				}
+
+				.opt-discount {
+					background: #CCCCCC;
+				}
+			}
+
 			.bg-image {
 				position: absolute;
 				top: -6rpx;

+ 6 - 1
pages-sell/components/sell-container/index.vue

@@ -100,7 +100,7 @@
 			</view>
 
 			<!-- 公众号横幅 -->
-			<view class="gzh-section">
+			<view class="gzh-section" @click="navigateToOfficialAccount">
 				<view class="gzh-bg-wrapper">
 					<image src="/pages-sell/static/gzh-banner.png" class="gzh-img-bg" mode="aspectFill"></image>
 					<view class="gzh-content-overlay">
@@ -207,6 +207,11 @@
 					url: url
 				});
 			},
+			navigateToOfficialAccount() {
+				uni.navigateTo({
+					url: '/pages-mine/pages/customer-service'
+				});
+			},
 
 			goRecommend() {
 				uni.navigateTo({

+ 22 - 6
pages-sell/pages/detail.vue

@@ -34,21 +34,19 @@
             </view>
 
             <!-- Service Info -->
-            <ServiceCard @click="showServicePopup"></ServiceCard>
+            <ServiceCard @click="showServicePopup" :bookInfo="product"></ServiceCard>
 
             <!-- Customer Service Float -->
             <FloatingDrag :width="120" :height="120" :initial-position="servicePosition"
                 @position-change="handlePositionChange" :z-index="20">
                 <!-- #ifdef MP-ALIPAY -->
                 <button class="service-btn" @click="navigateToCustomerService">
-                    <image src="/pages-sell/static/goods/icon-kefu.png" class="cs-icon" style="width: 100rpx;"
-                        mode="widthFix"></image>
+                    <image src="/pages-sell/static/goods/icon-kefu.png" class="cs-icon" mode="aspectFit"></image>
                 </button>
                 <!-- #endif -->
                 <!-- #ifndef MP-ALIPAY -->
                 <button class="service-btn" open-type="contact">
-                    <image src="/pages-sell/static/goods/icon-kefu.png" class="cs-icon" style="width: 100rpx"
-                        mode="widthFix"></image>
+                    <image src="/pages-sell/static/goods/icon-kefu.png" class="cs-icon" mode="aspectFit"></image>
                 </button>
                 <!-- #endif -->
             </FloatingDrag>
@@ -174,7 +172,8 @@
                 console.log('Added to cart:', data);
                 uni.showToast({
                     title: '已加入购物车',
-                    icon: 'success'
+                    icon: 'success',
+                    duration: 3000
                 });
                 this.$updateCartBadge();
             },
@@ -221,6 +220,13 @@
                     url: "/pages-mine/pages/customer-service",
                 });
             },
+        },
+        onShareAppMessage() {
+            return {
+                title: `${this.product.bookName}`,
+                path: `/pages-sell/pages/detail?isbn=${this.product.isbn}`,
+                imageUrl: this.product.cover
+            };
         }
     }
 </script>
@@ -314,6 +320,11 @@
     }
 
     .service-btn {
+        width: 100%;
+        height: 100%;
+        display: flex;
+        justify-content: center;
+        align-items: center;
         padding: 0;
         margin: 0;
         background-color: transparent;
@@ -323,6 +334,11 @@
         &::after {
             border: none;
         }
+
+        .cs-icon {
+            width: 100rpx;
+            height: 100rpx;
+        }
     }
 
     .tabs-header {

+ 2 - 1
pages-sell/pages/search-result.vue

@@ -254,7 +254,8 @@
                 console.log('Added to cart:', data);
                 uni.showToast({
                     title: '已加入购物车',
-                    icon: 'success'
+                    icon: 'success',
+                    duration: 3000
                 });
             },
             openPacket(data) {

+ 2 - 1
pages-sell/pages/topic.vue

@@ -114,7 +114,8 @@
 					if (res.code == 200) {
 						uni.showToast({
 							title: '已加入购物车',
-							icon: 'success'
+							icon: 'success',
+							duration: 3000
 						});
                         this.$updateCartBadge();
 					}

+ 16 - 16
pages.json

@@ -3,6 +3,20 @@
         "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
     },
     "pages": [
+        {
+            "path": "pages/sell/index",
+            "style": {
+                "navigationBarTitleText": "书嗨",
+                "navigationBarTextStyle": "white",
+                "navigationStyle": "custom",
+                "usingComponents": {
+                    "sell-container": "/pages-sell/components/sell-container/index"
+                },
+                "componentPlaceholder": {
+                    "sell-container": "view"
+                }
+            }
+        },
         {
             "path": "pages/home/index",
             "style": {
@@ -41,20 +55,6 @@
                 "navigationBarTitleText": "活动"
             }
         },
-        {
-            "path": "pages/sell/index",
-            "style": {
-                "navigationBarTitleText": "书嗨",
-                "navigationBarTextStyle": "white",
-                "navigationStyle": "custom",
-                "usingComponents": {
-                    "sell-container": "/pages-sell/components/sell-container/index"
-                },
-                "componentPlaceholder": {
-                    "sell-container": "view"
-                }
-            }
-        },
         {
             "path": "pages/cart/index",
             "style": {
@@ -460,13 +460,13 @@
         "list": [
             {
                 "text": "首页",
-                "pagePath": "pages/home/index",
+                "pagePath": "pages/sell/index",
                 "iconPath": "/static/tabbar/home.png",
                 "selectedIconPath": "/static/tabbar/home2.png"
             },
             {
                 "text": "卖书",
-                "pagePath": "pages/sell/index",
+                "pagePath": "pages/home/index",
                 "iconPath": "/static/tabbar/sell.png",
                 "selectedIconPath": "/static/tabbar/sell2.png"
             },

+ 535 - 533
pages/mine/index.vue

@@ -35,17 +35,17 @@
 			</view>
 		</view>
 
-		<!-- 卖书订单 -->
+		<!-- 我的订单 -->
 		<view class="order-section">
 			<view class="section-header">
-				<text>书订单</text>
-				<view class="view-all" @click="viewAllOrders">
+				<text>书订单</text>
+				<view class="view-all" @click="navigateToOrder('/pages-car/pages/my-order')">
 					<text>查看全部</text>
 					<u-icon name="arrow-right" size="24" color="#999"></u-icon>
 				</view>
 			</view>
 			<view class="order-types" style="padding: 0 20rpx">
-				<view class="type-item flex-d flex-a-c" v-for="(item, index) in orderTypes" :key="index"
+				<view class="type-item flex-d flex-a-c" v-for="(item, index) in myOrderTypes" :key="index"
 					@click="navigateToOrder(item.path)">
 					<image class="type-icon" :src="item.icon" mode="aspectFit"></image>
 					<text>{{ item.name }}</text>
@@ -54,17 +54,17 @@
 			</view>
 		</view>
 
-		<!-- 我的订单 -->
+		<!-- 卖书订单 -->
 		<view class="order-section" style="margin-top: 30rpx;">
 			<view class="section-header">
-				<text>我的订单</text>
-				<view class="view-all" @click="viewAllOrders">
+				<text>卖书订单</text>
+				<view class="view-all" @click="navigateToOrder('/pages-mine/pages/order-page')">
 					<text>查看全部</text>
 					<u-icon name="arrow-right" size="24" color="#999"></u-icon>
 				</view>
 			</view>
 			<view class="order-types" style="padding: 0 20rpx">
-				<view class="type-item flex-d flex-a-c" v-for="(item, index) in myOrderTypes" :key="index"
+				<view class="type-item flex-d flex-a-c" v-for="(item, index) in orderTypes" :key="index"
 					@click="navigateToOrder(item.path)">
 					<image class="type-icon" :src="item.icon" mode="aspectFit"></image>
 					<text>{{ item.name }}</text>
@@ -73,6 +73,8 @@
 			</view>
 		</view>
 
+
+
 		<!-- 实用工具 -->
 		<view class="tools-section">
 			<view class="section-title">实用工具</view>
@@ -116,604 +118,604 @@
 </template>
 
 <script>
-import WithdrawalProgress from './components/withdrawal-progress.vue';
-import WithdrawalConfirm from '../../components/withdrawal-confirm.vue';
-import floatingActivity from '../../components/floating-activity.vue';
-
-export default {
-	components: {
-		WithdrawalProgress,
-		WithdrawalConfirm,
-		floatingActivity
-	},
-	data() {
-		return {
-			userInfo: {
-				userId: 0,
-				openid: '',
-				imgPath: '',
-				nickName: '这里是昵称.',
-				mobile: '',
-				tags: [],
-				accountMoney: 0,
-				couponNum: 0,
-				point: 0,
-				firstAuditNum: 0,
-				pickUpNum: 0,
-				auditNum: 0,
-				payNum: 0,
-				refundNum: 0
-			},
-			orderTypes: [
-				{
-					name: '待初审',
-					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/1.png',
-					badge: 0,
-					key: 'firstAuditNum',
-					path: '/pages-mine/pages/order-page?status=2'
-				},
-				{
-					name: '待取件',
-					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/2.png',
-					badge: 0,
-					key: 'pickUpNum',
-					path: '/pages-mine/pages/order-page?status=3'
-				},
-				{
-					name: '待审核',
-					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/3.png',
-					badge: 0,
-					key: 'auditNum',
-					path: '/pages-mine/pages/order-page?status=8'
-				},
-				{
-					name: '待到款',
-					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/4.png',
-					badge: 0,
-					key: 'payNum',
-					path: '/pages-mine/pages/order-page?status=10'
-				},
-				{
-					name: '申请退回',
-					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/5.png',
-					badge: 0,
-					key: 'refundNum',
-					path: '/pages-mine/pages/apply-return'
-				}
-			],
-			myOrderTypes: [
-				{
-					name: '待付款',
-					icon: '/pages-car/static/my-order/icon-1.png',
-					badge: 0,
-					key: 'payNum',
-					path: '/pages-car/pages/my-order?status=1'
-				},
-				{
-					name: '待发货',
-					icon: '/pages-car/static/my-order/icon-2.png',
-					badge: 0,
-					key: 'sendNum',
-					path: '/pages-car/pages/my-order?status=2'
-				},
-				{
-					name: '待收货',
-					icon: '/pages-car/static/my-order/icon-3.png',
-					badge: 0,
-					key: 'receiveNum',
-					path: '/pages-car/pages/my-order?status=3'
-				},
-				{
-					name: '退款/售后',
-					icon: '/pages-car/static/my-order/icon-4.png',
-					badge: 0,
-					key: 'refundNum',
-					path: '/pages-car/pages/my-order?status=5'
-				},
-				{
-					name: '已完成',
-					icon: '/pages-car/static/my-order/icon-5.png',
-					badge: 0,
-					key: 'completeNum',
-					path: '/pages-car/pages/my-order?status=4'
-				}
-			],
-			tools: [
-				{
-					name: '消息通知',
-					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t1.png',
-					path: '/pages-mine/pages/notice'
-				},
-				{
-					name: '我的收藏',
-					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t2.png',
-					path: '/pages-car/pages/my-fav'
-				},
-				{
-					name: '我的足迹',
-					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t3.png',
-					path: '/pages-car/pages/my-footprint'
-				},
-				{
-					name: '我的地址',
-					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t4.png',
-					path: '/pages-mine/pages/address/list'
-				},
-				{
-					name: '我的红包',
-					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t5.png',
-					path: '/pages-car/pages/red-packet'
-				},
-				{
-					name: '联系客服',
-					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t6.png',
-					path: 'link-service'
-				},
-				{
-					name: '意见反馈',
-					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t7.png',
-					path: '/pages-mine/pages/feedback'
-				},
-				{
-					name: '到货提醒',
-					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t8.png',
-					path: '/pages-car/pages/arrival-reminder'
-				},
-				{
-					name: '合伙人计划',
-					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t9.png',
-					path: '/pages-mine/pages/partner/partner-rule'
-				},
-				{
-					name: '买卖答疑',
-					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t10.png',
-					path: '/pages-mine/pages/rules-for-sellbooks'
+	import WithdrawalProgress from './components/withdrawal-progress.vue';
+	import WithdrawalConfirm from '../../components/withdrawal-confirm.vue';
+	import floatingActivity from '../../components/floating-activity.vue';
+
+	export default {
+		components: {
+			WithdrawalProgress,
+			WithdrawalConfirm,
+			floatingActivity
+		},
+		data() {
+			return {
+				userInfo: {
+					userId: 0,
+					openid: '',
+					imgPath: '',
+					nickName: '这里是昵称.',
+					mobile: '',
+					tags: [],
+					accountMoney: 0,
+					couponNum: 0,
+					point: 0,
+					firstAuditNum: 0,
+					pickUpNum: 0,
+					auditNum: 0,
+					payNum: 0,
+					refundNum: 0
 				},
-				{
-					name: '关于书嗨',
-					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t11.png',
-					path: '/pages-home/pages/about-us'
+				orderTypes: [
+					{
+						name: '待初审',
+						icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/1.png',
+						badge: 0,
+						key: 'firstAuditNum',
+						path: '/pages-mine/pages/order-page?status=2'
+					},
+					{
+						name: '待取件',
+						icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/2.png',
+						badge: 0,
+						key: 'pickUpNum',
+						path: '/pages-mine/pages/order-page?status=3'
+					},
+					{
+						name: '待审核',
+						icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/3.png',
+						badge: 0,
+						key: 'auditNum',
+						path: '/pages-mine/pages/order-page?status=8'
+					},
+					{
+						name: '待到款',
+						icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/4.png',
+						badge: 0,
+						key: 'payNum',
+						path: '/pages-mine/pages/order-page?status=10'
+					},
+					{
+						name: '申请退回',
+						icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/5.png',
+						badge: 0,
+						key: 'refundNum',
+						path: '/pages-mine/pages/apply-return'
+					}
+				],
+				myOrderTypes: [
+					{
+						name: '待付款',
+						icon: '/pages-car/static/my-order/icon-1.png',
+						badge: 0,
+						key: 'payNum',
+						path: '/pages-car/pages/my-order?status=1'
+					},
+					{
+						name: '待发货',
+						icon: '/pages-car/static/my-order/icon-2.png',
+						badge: 0,
+						key: 'sendNum',
+						path: '/pages-car/pages/my-order?status=2'
+					},
+					{
+						name: '待收货',
+						icon: '/pages-car/static/my-order/icon-3.png',
+						badge: 0,
+						key: 'receiveNum',
+						path: '/pages-car/pages/my-order?status=3'
+					},
+					{
+						name: '退款/售后',
+						icon: '/pages-car/static/my-order/icon-4.png',
+						badge: 0,
+						key: 'refundNum',
+						path: '/pages-car/pages/my-order?status=5'
+					},
+					{
+						name: '已完成',
+						icon: '/pages-car/static/my-order/icon-5.png',
+						badge: 0,
+						key: 'completeNum',
+						path: '/pages-car/pages/my-order?status=4'
+					}
+				],
+				tools: [
+					{
+						name: '消息通知',
+						icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t1.png',
+						path: '/pages-mine/pages/notice'
+					},
+					{
+						name: '我的收藏',
+						icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t2.png',
+						path: '/pages-car/pages/my-fav'
+					},
+					{
+						name: '我的足迹',
+						icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t3.png',
+						path: '/pages-car/pages/my-footprint'
+					},
+					{
+						name: '我的地址',
+						icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t4.png',
+						path: '/pages-mine/pages/address/list'
+					},
+					{
+						name: '我的红包',
+						icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t5.png',
+						path: '/pages-car/pages/red-packet'
+					},
+					{
+						name: '联系客服',
+						icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t6.png',
+						path: 'link-service'
+					},
+					{
+						name: '意见反馈',
+						icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t7.png',
+						path: '/pages-mine/pages/feedback'
+					},
+					{
+						name: '到货提醒',
+						icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t8.png',
+						path: '/pages-car/pages/arrival-reminder'
+					},
+					{
+						name: '合伙人计划',
+						icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t9.png',
+						path: '/pages-mine/pages/partner/partner-rule'
+					},
+					{
+						name: '买卖答疑',
+						icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t10.png',
+						path: '/pages-mine/pages/rules-for-sellbooks'
+					},
+					{
+						name: '关于书嗨',
+						icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t11.png',
+						path: '/pages-home/pages/about-us'
+					},
+					{
+						name: '我的余额',
+						icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t12.png',
+						path: '/pages-mine/pages/wallet'
+					},
+					{
+						name: '用户设置',
+						icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t13.png',
+						path: '/pages-mine/pages/setting'
+					}
+				],
+				// 悬浮按钮位置
+				buttonPosition: {
+					left: 'auto',
+					right: 0,
+					bottom: '10%'
 				},
-				{
-					name: '我的余额',
-					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t12.png',
-					path: '/pages-mine/pages/wallet'
+				// 客服按钮位置
+				activityPosition: {
+					left: 'auto',
+					right: 0,
+					bottom: '25%'
 				},
-				{
-					name: '用户设置',
-					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t13.png',
-					path: '/pages-mine/pages/setting'
-				}
-			],
-			// 悬浮按钮位置
-			buttonPosition: {
-				left: 'auto',
-				right: 0,
-				bottom: '10%'
-			},
-			// 客服按钮位置
-			activityPosition: {
-				left: 'auto',
-				right: 0,
-				bottom: '25%'
-			},
-			withdrawalOrder: [],
-			// 提现进度弹窗相关
-			showWithdrawalModal: false,
-			currentWithdrawalOrder: {},
-
-			//活动弹窗信息
-			activityInfo: {}
-		};
-	},
-	methods: {
-		//获取是否显示活动弹窗
-		getActivityStatus() {
-			uni.$u.http.post('/token/home/activity/dialog').then((res) => {
-				if (res.code == 200) {
-					this.activityInfo = res.data;
-				}
-			});
-		},
-
-		//获取是否存在待确认提现的订单
-		getWithdrawalOrder() {
-			uni.$u.http.get('/token/user/withdrawWindows').then((res) => {
-				console.log(res);
-				if (res.code == 200) {
-					this.withdrawalOrder = res.data;
-				}
-			});
+				withdrawalOrder: [],
+				// 提现进度弹窗相关
+				showWithdrawalModal: false,
+				currentWithdrawalOrder: {},
+
+				//活动弹窗信息
+				activityInfo: {}
+			};
 		},
+		methods: {
+			//获取是否显示活动弹窗
+			getActivityStatus() {
+				uni.$u.http.post('/token/home/activity/dialog').then((res) => {
+					if (res.code == 200) {
+						this.activityInfo = res.data;
+					}
+				});
+			},
 
-		//用户信息
-		handleUpdateUserInfo() {
-			uni.navigateTo({
-				url: '/pages-mine/pages/setting'
-			});
-		},
-		//查看全部订单
-		viewAllOrders() {
-			uni.navigateTo({
-				url: '/pages-car/pages/my-order?status=-1'
-			});
-		},
-		//跳转订单
-		navigateToOrder(path) {
-			uni.navigateTo({
-				url: path
-			});
-		},
-		//跳转工具
-		navigateToTool(path) {
-			if (path === 'link-service') return
-			if (!path)
-				return uni.showToast({
-					title: '开发中...',
-					icon: 'none'
+			//获取是否存在待确认提现的订单
+			getWithdrawalOrder() {
+				uni.$u.http.get('/token/user/withdrawWindows').then((res) => {
+					console.log(res);
+					if (res.code == 200) {
+						this.withdrawalOrder = res.data;
+					}
 				});
+			},
 
-			if (path == '/pages-mine/pages/partner/partner-rule') {
-				this.getPartnerStatus();
-			} else {
+			//用户信息
+			handleUpdateUserInfo() {
 				uni.navigateTo({
-					url: path
+					url: '/pages-mine/pages/setting'
 				});
-			}
-		},
-		// 导航到提现确认页面
-		navigateToWithdrawal() {
-			if (this.withdrawalOrder && this.withdrawalOrder.length > 0) {
-				// 显示提现进度弹窗,使用第一个提现订单
-				this.currentWithdrawalOrder = this.withdrawalOrder[0];
-				this.$refs.withdrawalRef.openModal();
-			} else {
-				// 如果没有待确认的提现订单,直接跳转到钱包页面
+			},
+			//查看全部订单
+			viewAllOrders() {
 				uni.navigateTo({
-					url: '/pages-mine/pages/wallet'
+					url: '/pages-car/pages/my-order?status=-1'
 				});
-			}
-		},
-		//获取用户信息
-		getUserInfo() {
-			uni.$u.http.get('/token/user/detail').then((res) => {
-				console.log(res);
-				if (res.code == 200) {
-					this.userInfo = res.data;
-					uni.setStorageSync('userInfo', this.userInfo);
-
-					this.orderTypes.forEach((item) => {
-						item.badge = this.userInfo[item.key];
+			},
+			//跳转订单
+			navigateToOrder(path) {
+				uni.navigateTo({
+					url: path
+				});
+			},
+			//跳转工具
+			navigateToTool(path) {
+				if (path === 'link-service') return
+				if (!path)
+					return uni.showToast({
+						title: '开发中...',
+						icon: 'none'
+					});
+
+				if (path == '/pages-mine/pages/partner/partner-rule') {
+					this.getPartnerStatus();
+				} else {
+					uni.navigateTo({
+						url: path
 					});
 				}
-			});
-		},
-		//获取合伙人状态
-		getPartnerStatus() {
-			let item = this.tools.find((item) => item.name == '合伙人计划');
-			uni.$u.get('/token/getUserPartnerInfo').then((res) => {
-				if (res.code == 200) {
-					let { status } = res.data;
-					if (status == -1 || status == 4) {
-						item.path = '/pages-mine/pages/partner/partner-rule';
-					} else if (status == 1) {
-						item.path = '/pages-mine/pages/partner/partner-home';
+			},
+			// 导航到提现确认页面
+			navigateToWithdrawal() {
+				if (this.withdrawalOrder && this.withdrawalOrder.length > 0) {
+					// 显示提现进度弹窗,使用第一个提现订单
+					this.currentWithdrawalOrder = this.withdrawalOrder[0];
+					this.$refs.withdrawalRef.openModal();
+				} else {
+					// 如果没有待确认的提现订单,直接跳转到钱包页面
+					uni.navigateTo({
+						url: '/pages-mine/pages/wallet'
+					});
+				}
+			},
+			//获取用户信息
+			getUserInfo() {
+				uni.$u.http.get('/token/user/detail').then((res) => {
+					console.log(res);
+					if (res.code == 200) {
+						this.userInfo = res.data;
+						uni.setStorageSync('userInfo', this.userInfo);
+
+						this.orderTypes.forEach((item) => {
+							item.badge = this.userInfo[item.key];
+						});
+					}
+				});
+			},
+			//获取合伙人状态
+			getPartnerStatus() {
+				let item = this.tools.find((item) => item.name == '合伙人计划');
+				uni.$u.get('/token/getUserPartnerInfo').then((res) => {
+					if (res.code == 200) {
+						let { status } = res.data;
+						if (status == -1 || status == 4) {
+							item.path = '/pages-mine/pages/partner/partner-rule';
+						} else if (status == 1) {
+							item.path = '/pages-mine/pages/partner/partner-home';
+						} else {
+							item.path = '/pages-mine/pages/partner/partner-status';
+						}
 					} else {
 						item.path = '/pages-mine/pages/partner/partner-status';
 					}
-				} else {
-					item.path = '/pages-mine/pages/partner/partner-status';
-				}
 
-				uni.navigateTo({
-					url: item.path
+					uni.navigateTo({
+						url: item.path
+					});
 				});
-			});
-		},
+			},
 
-		// 更新悬浮按钮位置
-		onPositionChange(position) {
-			this.buttonPosition = position;
-		},
+			// 更新悬浮按钮位置
+			onPositionChange(position) {
+				this.buttonPosition = position;
+			},
 
-		// 更新活动按钮位置
-		onActivityButtonPositionChange(position) {
-			this.activityPosition = position;
-		},
+			// 更新活动按钮位置
+			onActivityButtonPositionChange(position) {
+				this.activityPosition = position;
+			},
 
-		// 联系客服
-		contactCustomerService() {
-			uni.navigateTo({
-				url: this.activityInfo.jumpPage
-			});
-		},
+			// 联系客服
+			contactCustomerService() {
+				uni.navigateTo({
+					url: this.activityInfo.jumpPage
+				});
+			},
 
-		// 关闭提现进度弹窗
-		closeWithdrawalModal() {
-			this.$refs.withdrawalRef.handleClose();
-		},
+			// 关闭提现进度弹窗
+			closeWithdrawalModal() {
+				this.$refs.withdrawalRef.handleClose();
+			},
 
-		confirmWithdrawal(item) {
-			uni.$u.http
-				.post('/token/user/withdrawConfirm', {
-					orderNo: item.orderNo
-				})
-				.then((res) => {
-					if (res.code === 200) {
-						this.handleConfirmReceipt(res.data);
-					}
-				})
-				.catch((err) => {
-					uni.showToast({
-						title: err.message || '确认失败',
-						icon: 'none'
-					});
-				});
-		},
-		//执行微信确认收款操作
-		handleConfirmReceipt(data) {
-			if (wx.canIUse('requestMerchantTransfer')) {
-				wx.requestMerchantTransfer({
-					mchId: data.mchId,
-					appId: data.appId,
-					package: data.packageStr,
-					success: (res) => {
-						// res.err_msg将在页面展示成功后返回应用时返回ok,并不代表付款成功
+			confirmWithdrawal(item) {
+				uni.$u.http
+					.post('/token/user/withdrawConfirm', {
+						orderNo: item.orderNo
+					})
+					.then((res) => {
+						if (res.code === 200) {
+							this.handleConfirmReceipt(res.data);
+						}
+					})
+					.catch((err) => {
 						uni.showToast({
-							title: '确认收款成功',
+							title: err.message || '确认失败',
 							icon: 'none'
 						});
-						this.closeWithdrawalModal();
-						// 刷新列表
-						this.getWithdrawalOrder();
-					},
-					fail: (res) => {
-						console.log('fail:', res);
-					}
-				});
-			} else {
-				wx.showModal({
-					content: '你的微信版本过低,请更新至最新版本。',
-					showCancel: false
+					});
+			},
+			//执行微信确认收款操作
+			handleConfirmReceipt(data) {
+				if (wx.canIUse('requestMerchantTransfer')) {
+					wx.requestMerchantTransfer({
+						mchId: data.mchId,
+						appId: data.appId,
+						package: data.packageStr,
+						success: (res) => {
+							// res.err_msg将在页面展示成功后返回应用时返回ok,并不代表付款成功
+							uni.showToast({
+								title: '确认收款成功',
+								icon: 'none'
+							});
+							this.closeWithdrawalModal();
+							// 刷新列表
+							this.getWithdrawalOrder();
+						},
+						fail: (res) => {
+							console.log('fail:', res);
+						}
+					});
+				} else {
+					wx.showModal({
+						content: '你的微信版本过低,请更新至最新版本。',
+						showCancel: false
+					});
+				}
+			},
+			navigateToCustomerService() {
+				uni.navigateTo({
+					url: '/pages-mine/pages/customer-service'
 				});
 			}
 		},
-		navigateToCustomerService() {
-			uni.navigateTo({
-				url: '/pages-mine/pages/customer-service'
+		onReady() {
+			// 获取屏幕宽度和高度
+			uni.getSystemInfo({
+				success: (res) => {
+					this.screenWidth = res.windowWidth;
+					this.screenHeight = res.windowHeight;
+				}
 			});
-		}
-	},
-	onReady() {
-		// 获取屏幕宽度和高度
-		uni.getSystemInfo({
-			success: (res) => {
-				this.screenWidth = res.windowWidth;
-				this.screenHeight = res.windowHeight;
+
+			this.getActivityStatus();
+		},
+		onShow() {
+			let token = uni.getStorageSync('token');
+			if (token) {
+				this.getUserInfo();
+				this.getWithdrawalOrder();
 			}
-		});
-
-		this.getActivityStatus();
-	},
-	onShow() {
-		let token = uni.getStorageSync('token');
-		if (token) {
-			this.getUserInfo();
-			this.getWithdrawalOrder();
 		}
-	}
-};
+	};
 </script>
 
 <style lang="scss" scoped>
-.mine-page {
-	min-height: 100vh;
-	background-color: #f5f5f5;
-	position: relative;
-
-	.link-service {
-		background: transparent;
-		border: none;
-		padding: 0;
-		margin: 0;
-		width: 100%;
-		height: 100%;
-		line-height: 36rpx;
-	}
-
-	.user-info {
-		background: url('/static/img/bg.png') no-repeat center center;
-		background-size: 100% 100%;
-		position: absolute;
-		top: 0;
-		left: 0;
-		padding: 20rpx 50rpx 120rpx;
-		color: #fff;
+	.mine-page {
+		min-height: 100vh;
+		background-color: #f5f5f5;
 		position: relative;
-		padding-top: 160rpx;
 
-		&::after {
-			width: 140%;
+		.link-service {
+			background: transparent;
+			border: none;
+			padding: 0;
+			margin: 0;
+			width: 100%;
+			height: 100%;
+			line-height: 36rpx;
+		}
+
+		.user-info {
+			background: url('/static/img/bg.png') no-repeat center center;
+			background-size: 100% 100%;
 			position: absolute;
-			left: -20%;
 			top: 0;
-			z-index: -1;
-			content: '';
-			border-radius: 0 0 50% 50%;
-			background: #fd6954;
-		}
+			left: 0;
+			padding: 20rpx 50rpx 120rpx;
+			color: #fff;
+			position: relative;
+			padding-top: 160rpx;
+
+			&::after {
+				width: 140%;
+				position: absolute;
+				left: -20%;
+				top: 0;
+				z-index: -1;
+				content: '';
+				border-radius: 0 0 50% 50%;
+				background: #fd6954;
+			}
+
+			.user-header {
+				display: flex;
+				align-items: center;
+				margin-bottom: 40rpx;
 
-		.user-header {
-			display: flex;
-			align-items: center;
-			margin-bottom: 40rpx;
-
-			.user-avatar {
-				border-radius: 50%;
-				margin-right: 20rpx;
-				border: 4rpx solid #fff;
-				width: 128rpx;
-				height: 128rpx;
-				overflow: hidden;
-				flex-shrink: 0;
-				background: #fff;
-
-				.avatar {
-					width: 100%;
-					height: 100%;
+				.user-avatar {
 					border-radius: 50%;
-					object-fit: cover;
+					margin-right: 20rpx;
+					border: 4rpx solid #fff;
+					width: 128rpx;
+					height: 128rpx;
+					overflow: hidden;
+					flex-shrink: 0;
+					background: #fff;
+
+					.avatar {
+						width: 100%;
+						height: 100%;
+						border-radius: 50%;
+						object-fit: cover;
+					}
 				}
-			}
 
-			.user-detail {
-				.nickname {
-					font-size: 32rpx;
-					font-weight: 500;
-					margin-bottom: 8rpx;
-				}
+				.user-detail {
+					.nickname {
+						font-size: 32rpx;
+						font-weight: 500;
+						margin-bottom: 8rpx;
+					}
 
-				.user-tag {
-					display: inline-block;
-					font-size: 22rpx;
-					padding: 4rpx 12rpx;
-					background: linear-gradient(-90deg, #272321, #4b4542);
-					border-radius: 4rpx;
-					margin-top: 8rpx;
-					margin-right: 10rpx;
+					.user-tag {
+						display: inline-block;
+						font-size: 22rpx;
+						padding: 4rpx 12rpx;
+						background: linear-gradient(-90deg, #272321, #4b4542);
+						border-radius: 4rpx;
+						margin-top: 8rpx;
+						margin-right: 10rpx;
+					}
 				}
 			}
-		}
-
-		.user-data {
-			display: flex;
-			justify-content: space-between;
-			position: relative;
-			z-index: 1;
-			padding: 0 40rpx;
 
-			.data-item {
+			.user-data {
+				display: flex;
+				justify-content: space-between;
 				position: relative;
-				text-align: center;
+				z-index: 1;
+				padding: 0 40rpx;
 
-				.amount {
-					font-size: 38rpx;
-					font-weight: 500;
-					margin-bottom: 8rpx;
-				}
+				.data-item {
+					position: relative;
+					text-align: center;
 
-				.label {
-					font-size: 24rpx;
-					font-weight: 400;
-					opacity: 0.9;
-				}
+					.amount {
+						font-size: 38rpx;
+						font-weight: 500;
+						margin-bottom: 8rpx;
+					}
+
+					.label {
+						font-size: 24rpx;
+						font-weight: 400;
+						opacity: 0.9;
+					}
 
-				.badge {
-					position: absolute;
-					top: -15rpx;
-					right: -120%;
-					padding: 0 10rpx;
-					font-size: 20rpx;
-					line-height: 30rpx;
-					height: 30rpx;
-					background: #ff8400;
-					border-radius: 15rpx 15rpx 15rpx 0rpx;
+					.badge {
+						position: absolute;
+						top: -15rpx;
+						right: -120%;
+						padding: 0 10rpx;
+						font-size: 20rpx;
+						line-height: 30rpx;
+						height: 30rpx;
+						background: #ff8400;
+						border-radius: 15rpx 15rpx 15rpx 0rpx;
+					}
 				}
 			}
 		}
-	}
-
-	.order-section {
-		margin: -90rpx 30rpx 20rpx;
-		background: #fff;
-		border-radius: 12rpx;
-		padding: 30rpx;
-		position: relative;
-		z-index: 2;
 
-		.section-header {
-			display: flex;
-			justify-content: space-between;
-			align-items: center;
-			margin-bottom: 30rpx;
+		.order-section {
+			margin: -90rpx 30rpx 20rpx;
+			background: #fff;
+			border-radius: 12rpx;
+			padding: 30rpx;
+			position: relative;
+			z-index: 2;
 
-			.view-all {
+			.section-header {
 				display: flex;
+				justify-content: space-between;
 				align-items: center;
-				color: #999;
-				font-size: 26rpx;
-			}
-		}
-
-		.order-types {
-			display: flex;
-			justify-content: space-between;
-
-			.type-item {
-				text-align: center;
-				position: relative;
+				margin-bottom: 30rpx;
 
-				.badge {
-					position: absolute;
-					top: -15rpx;
-					right: -6px;
-					padding: 0 10rpx;
-					font-size: 20rpx;
-					line-height: 30rpx;
-					height: 30rpx;
-					background: #f56c6c;
-					color: #fff;
-					border-radius: 15rpx 15rpx 15rpx 0rpx;
+				.view-all {
+					display: flex;
+					align-items: center;
+					color: #999;
+					font-size: 26rpx;
 				}
+			}
 
-				.type-icon {
-					width: 60rpx;
-					height: 60rpx;
-					margin-bottom: 12rpx;
-				}
+			.order-types {
+				display: flex;
+				justify-content: space-between;
+
+				.type-item {
+					text-align: center;
+					position: relative;
+
+					.badge {
+						position: absolute;
+						top: -15rpx;
+						right: -6px;
+						padding: 0 10rpx;
+						font-size: 20rpx;
+						line-height: 30rpx;
+						height: 30rpx;
+						background: #f56c6c;
+						color: #fff;
+						border-radius: 15rpx 15rpx 15rpx 0rpx;
+					}
 
-				text {
-					font-size: 26rpx;
-					color: #333;
+					.type-icon {
+						width: 60rpx;
+						height: 60rpx;
+						margin-bottom: 12rpx;
+					}
+
+					text {
+						font-size: 26rpx;
+						color: #333;
+					}
 				}
 			}
 		}
-	}
 
-	.tools-section {
-		margin: 30rpx;
-		background: #fff;
-		border-radius: 12rpx;
-		padding: 30rpx;
-		position: relative;
-		z-index: 2;
+		.tools-section {
+			margin: 30rpx;
+			background: #fff;
+			border-radius: 12rpx;
+			padding: 30rpx;
+			position: relative;
+			z-index: 2;
 
-		.section-title {
-			font-size: 30rpx;
-			font-weight: 500;
-			margin-bottom: 30rpx;
-		}
+			.section-title {
+				font-size: 30rpx;
+				font-weight: 500;
+				margin-bottom: 30rpx;
+			}
 
-		.tools-grid {
-			display: grid;
-			grid-template-columns: repeat(4, 1fr);
-			gap: 30rpx;
+			.tools-grid {
+				display: grid;
+				grid-template-columns: repeat(4, 1fr);
+				gap: 30rpx;
 
-			.tool-item {
-				text-align: center;
+				.tool-item {
+					text-align: center;
 
-				.tool-icon {
-					width: 60rpx;
-					height: 60rpx;
-					margin-bottom: 12rpx;
-				}
+					.tool-icon {
+						width: 60rpx;
+						height: 60rpx;
+						margin-bottom: 12rpx;
+					}
 
-				text {
-					font-size: 24rpx;
-					color: #333;
+					text {
+						font-size: 24rpx;
+						color: #333;
+					}
 				}
 			}
 		}
 	}
-}
 </style>

+ 1 - 0
utils/uniapp-api.js

@@ -35,6 +35,7 @@ export const updateCartBadge = () => {
         uni.$u.http.post('/token/shop/cart/getCount').then(res => {
             if (res.code == 200) {
                 const count = res.data;
+                uni.$emit('cartCountChanged', count);
                 if (count > 0) {
                     uni.setTabBarBadge({
                         index: 2,