Quellcode durchsuchen

feat: 添加商品分享功能和极速退款弹窗

refactor: 重构价格减免组件和购物车逻辑

fix: 修复订单详情页退款逻辑和样式问题

style: 优化商品选择弹窗和自定义弹窗样式

docs: 更新订单状态和用户信息字段注释

chore: 移除无用组件并整理代码结构
ylong vor 2 Wochen
Ursprung
Commit
096cd9e468

+ 9 - 7
components/custom-popup.vue

@@ -1,13 +1,14 @@
 <template>
-	<view class="custom-popup" :class="{'custom-popup--show': showPopup}">
+	<view class="custom-popup" :class="{'custom-popup--show': showPopup}" :style="{ zIndex: zIndex }">
 		<!-- 遮罩层 -->
 		<view
+			v-if="mask"
 			class="custom-popup__mask"
 			:style="{
 				backgroundColor: maskBackgroundColor,
 				zIndex: zIndex
 			}"
-			:class="{'custom-popup__mask--show': showPopup && mask}"
+			:class="{'custom-popup__mask--show': showPopup}"
 			@tap="maskClick"
 			@touchmove.stop.prevent="clear"
 		></view>
@@ -99,7 +100,7 @@ export default {
 		// z-index层级
 		zIndex: {
 			type: [String, Number],
-			default: 10070
+			default: 10075
 		},
 		// 遮罩的背景色
 		maskBackgroundColor: {
@@ -165,11 +166,12 @@ export default {
 		position: fixed;
 		top: 0;
 		left: 0;
-        bottom: 0;
-		width: 100%;
-		height: 100%;
+		bottom: 0;
+		right: 0;
 		opacity: 0;
 		transition: opacity 0.3s;
+		background-color: rgba(0, 0, 0, 0.5);
+		z-index: 10075;
 		
 		&--show {
 			opacity: 1;
@@ -179,6 +181,7 @@ export default {
 	&__container {
 		position: fixed;
 		transition: all 0.3s ease-in-out;
+		z-index: 10076;
 		
 		&--center {
 			top: 50%;
@@ -270,7 +273,6 @@ export default {
 	
 	&--show {
 		visibility: visible;
-		z-index: 9999;
 	}
 }
 </style>

+ 1 - 0
pages-car/components/price-reduction-popup.vue → components/price-reduction-popup/price-reduction-popup.vue

@@ -66,6 +66,7 @@
 <script>
 	import customPopup from "@/components/custom-popup.vue";
 	export default {
+		name: 'PriceReductionPopup',
 		components: {
 			customPopup,
 		},

+ 1 - 0
pages-car/components/reduce-qrcode.vue → components/reduce-qrcode/reduce-qrcode.vue

@@ -32,6 +32,7 @@
 <script>
 	import customPopup from '@/components/custom-popup.vue';
 	export default {
+		name: 'ReduceQrcode',
 		components: {
 			customPopup,
 		},

+ 3 - 2
pages-car/components/urge-delivery-dialog.vue

@@ -9,7 +9,7 @@
                 平台跟进发货中
             </view>
             <view class="urge-desc">
-                卖家应在{{ deadlineTime }}前发货,若超时未发货,平台客服将主动联系卖家处理,查看<text class="highlight">进度详情</text>
+                平台应在{{ deadlineTime }}前发货,若超时未发货,平台客服将主动联系您处理
             </view>
 
             <view class="btn-group">
@@ -90,7 +90,7 @@ export default {
 
 <style lang="scss" scoped>
 .urge-dialog-box {
-    padding: 50rpx 40rpx 40rpx;
+    padding: 50rpx 0 40rpx;
     position: relative;
     background: #fff;
     display: flex;
@@ -161,6 +161,7 @@ export default {
             flex: 1.5;
             box-sizing: border-box;
             line-height: 76rpx; // 调整线高因为有边框
+            min-width: 240rpx;
         }
 
         .confirm-btn {

+ 4 - 3
pages-car/pages/apply-refund.vue

@@ -102,10 +102,11 @@
 						this.orderInfo = res.data;
 						
 						// 根据订单状态设置默认售后类型
-						if (this.orderInfo.status == '3') { // 待收货
-							this.refundType = '1';
+						// status <= 3: 仅退款;status > 3: 退货退款
+						if (this.orderInfo.status <= 3) {
+							this.refundType = '2'; // 仅退款
 						} else {
-							this.refundType = '1';
+							this.refundType = '1'; // 退货退款
 						}
 
 						this.address = {

+ 1 - 1
pages-car/pages/confirm-order.vue

@@ -148,7 +148,7 @@
                 return this.selectedPacket ? this.selectedPacket.couponName : '请选择';
             },
             finalTotalMoney() {
-                let total = parseFloat(this.preOrder.totalMoney || 0);
+                let total = parseFloat(this.preOrder.payMoney || 0);
                 if (this.selectedPacket && this.selectedPacket.faceMoney) {
                     total -= parseFloat(this.selectedPacket.faceMoney);
                 }

+ 45 - 19
pages-car/pages/index.vue

@@ -35,6 +35,11 @@
         <!-- 底部占位 -->
         <view style="height: 120rpx;"></view>
 
+        <!-- 悬浮清空按钮 -->
+        <view class="floating-clear-btn" v-if="cartList.length > 0" @click="handleClearCart">
+            <u-icon name="trash" size="36" color="#fa3534"></u-icon>
+        </view>
+
         <!-- 底部结算栏 -->
         <view class="bottom-fixed" v-if="cartList.length > 0">
             <view class="left-part">
@@ -42,19 +47,14 @@
                     <u-checkbox v-model="isAllSelected" shape="circle" active-color="#38C148" :disabled="false"
                         @change="onAllCheckChange">全选</u-checkbox>
                 </view>
-                <!-- 清空按钮 -->
-                <view class="clear-btn" @click="handleClearCart"
-                    style="margin-left: 20rpx; font-size: 24rpx; color: #999;">
-                    清空
-                </view>
             </view>
             <view class="right-part">
                 <view class="total-info">
-                    <view class="reduced-tip" v-if="totalReduced > 0">已降 ¥{{ totalReduced }}</view>
                     <view class="total-price">
                         <text class="label">合计:</text>
                         <text class="price">¥{{ totalPrice }}</text>
                     </view>
+                    <view class="reduced-tip" v-if="totalReduced > 0">已降 ¥{{ totalReduced }}</view>
                 </view>
                 <view class="checkout-btn" @click="checkout">
                     结算({{ selectedCount }})
@@ -74,8 +74,8 @@
 
 <script>
     import CartItem from '../components/cart-item.vue';
-    import PriceReductionPopup from '../components/price-reduction-popup.vue';
-    import ReduceQrcode from '../components/reduce-qrcode.vue';
+    import PriceReductionPopup from '@/components/price-reduction-popup/price-reduction-popup.vue';
+    import ReduceQrcode from '@/components/reduce-qrcode/reduce-qrcode.vue';
     import CommonDialog from '@/components/common-dialog.vue';
     import ConditionPopup from '../components/condition-popup.vue';
 
@@ -155,10 +155,13 @@
                 return this.cartList.filter(item => item.checked && item.stockStatus !== 3 && item.availableStock > 0);
             },
             totalPrice() {
-                return this.selectedItems.reduce((sum, item) => sum + item.price * item.quantity, 0).toFixed(2);
+                const sumPrice = this.selectedItems.reduce((sum, item) => sum + item.price * item.quantity, 0);
+                const sumReduce = this.selectedItems.reduce((sum, item) => sum + (item.currReduceMoney || 0), 0);
+                const result = sumPrice - sumReduce;
+                return result > 0 ? result.toFixed(2) : "0.00";
             },
             totalReduced() {
-                return this.selectedItems.reduce((sum, item) => sum + (item.currReduceMoney || 0) * item.quantity, 0).toFixed(2);
+                return this.selectedItems.reduce((sum, item) => sum + (item.currReduceMoney || 0), 0).toFixed(2);
             },
             selectedCount() {
                 return this.selectedItems.reduce((sum, item) => sum + item.quantity, 0);
@@ -492,6 +495,29 @@
         }
     }
 
+    .floating-clear-btn {
+        position: fixed;
+        right: 30rpx;
+        bottom: 160rpx; /* 留出底部结算栏的空间 */
+        /* #ifdef H5 */
+        bottom: calc(160rpx + 50px);
+        /* #endif */
+        width: 80rpx;
+        height: 80rpx;
+        background-color: #fff;
+        border: 2rpx solid #f56c6c;
+        border-radius: 50%;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        z-index: 98;
+        box-shadow: 0 4rpx 10rpx rgba(250, 53, 52, 0.2);
+        
+        &:active {
+            background-color: #fef0f0;
+        }
+    }
+
     .bottom-fixed {
         position: fixed;
         bottom: 0;
@@ -524,15 +550,6 @@
                 display: flex;
                 align-items: center;
 
-                .reduced-tip {
-                    font-size: 22rpx;
-                    color: #38C148;
-                    border: 1rpx solid #38C148;
-                    border-radius: 4rpx;
-                    padding: 0 6rpx;
-                    margin-right: 10rpx;
-                }
-
                 .total-price {
                     display: flex;
                     align-items: center;
@@ -548,6 +565,15 @@
                         font-weight: bold;
                     }
                 }
+                
+                .reduced-tip {
+                    font-size: 22rpx;
+                    color: #38C148;
+                    border: 1rpx solid #38C148;
+                    border-radius: 4rpx;
+                    padding: 0 10rpx;
+                    margin-left: 10rpx;
+                }
             }
 
             .checkout-btn {

+ 368 - 359
pages-car/pages/order-detail.vue

@@ -69,8 +69,7 @@
                     <u-button v-if="goods.refundOrderId" size="mini" shape="circle" plain
                         @click="goToRefundDetail(goods.refundOrderId)"
                         custom-style="margin-left: 20rpx; height: 50rpx; line-height: 50rpx; color: #333; border-color: #ccc;">查看详情</u-button>
-                    <u-button v-show="!goods.refundOrderId" size="mini" shape="circle" plain
-                        @click="applyRefund(goods)"
+                    <u-button v-show="!goods.refundOrderId" size="mini" shape="circle" plain @click="applyRefund(goods)"
                         custom-style="margin-left: 20rpx; height: 50rpx; line-height: 50rpx; color: #333; border-color: #ccc;">申请售后</u-button>
                 </view>
             </view>
@@ -125,450 +124,460 @@
         <!-- 催发货弹窗 -->
         <urge-delivery-dialog ref="urgeDialog" @success="loadOrderDetail(orderInfo.orderId)"></urge-delivery-dialog>
 
+        <!-- 极速退款弹窗 -->
+        <fast-refund-dialog ref="refundDialog" @refresh="loadOrderDetail(orderInfo.orderId)"></fast-refund-dialog>
+
         <!-- 占位符,防止底部按钮遮挡内容 -->
         <view style="height: 120rpx;"></view>
     </view>
 </template>
 
 <script>
-    import OrderBottomBar from '../components/order-bottom-bar.vue';
-    import CancelOrderPopup from '../components/cancel-order-popup.vue';
-    import UrgeDeliveryDialog from '../components/urge-delivery-dialog.vue';
-
-    export default {
-        components: {
-            OrderBottomBar,
-            CancelOrderPopup,
-            UrgeDeliveryDialog
-        },
-        data() {
-            return {
-                orderInfo: {
-                    status: '2',
-                    orderId: '',
-                    detailVoList: [],
-                    receiverName: '',
-                    receiverMobile: '',
-                    receiverAddress: '',
-                    expressMoney: 0,
-                    totalMoney: 0,
-                    discountMoney: 0,
-                    payMoney: 0,
-                    createTime: ''
-                },
-                isModifyingAddress: false
+import OrderBottomBar from '../components/order-bottom-bar.vue';
+import CancelOrderPopup from '../components/cancel-order-popup.vue';
+import UrgeDeliveryDialog from '../components/urge-delivery-dialog.vue';
+import FastRefundDialog from '../components/fast-refund-dialog.vue';
+
+export default {
+    components: {
+        OrderBottomBar,
+        CancelOrderPopup,
+        UrgeDeliveryDialog,
+        FastRefundDialog
+    },
+    data() {
+        return {
+            orderInfo: {
+                status: '2',
+                orderId: '',
+                detailVoList: [],
+                receiverName: '',
+                receiverMobile: '',
+                receiverAddress: '',
+                expressMoney: 0,
+                totalMoney: 0,
+                discountMoney: 0,
+                payMoney: 0,
+                createTime: ''
+            },
+            isModifyingAddress: false
+        };
+    },
+    computed: {
+        statusText() {
+            //订单状态:1-待付款 2-待发货 3-待收货 4-已完成 5-已取消 6-退款中 7-已退款
+            const map = {
+                '1': '等待买家付款',
+                '2': '等待卖家发货',
+                '3': '已发货',
+                '4': '交易完成',
+                '5': '已取消',
+                '6': '退款中',
+                '7': '交易关闭'
             };
-        },
-        computed: {
-            statusText() {
-                //订单状态:1-待付款 2-待发货 3-待收货 4-已完成 5-已取消 6-退款中 7-已退款
-                const map = {
-                    '1': '等待买家付款',
-                    '2': '等待卖家发货',
-                    '3': '已发货',
-                    '4': '交易完成',
-                    '5': '已取消',
-                    '6': '退款中',
-                    '7': '交易关闭'
-                };
-                return map[String(this.orderInfo.status)] || '未知状态';
+            return map[String(this.orderInfo.status)] || '未知状态';
+        }
+    },
+    onLoad(options) {
+        if (options.orderId) {
+            this.loadOrderDetail(options.orderId);
+        }
+        // 监听地址选择
+        uni.$on('selectAddr', this.onAddressSelected);
+    },
+    onUnload() {
+        uni.$off('selectAddr', this.onAddressSelected);
+    },
+    methods: {
+        onAddressSelected(addr) {
+            if (this.isModifyingAddress && addr && addr.id) {
+                this.$u.api.modifyOrderAddressAjax({
+                    orderId: this.orderInfo.orderId,
+                    addressId: addr.id
+                }).then(res => {
+                    uni.hideLoading();
+                    if (res.code == 200) {
+                        uni.showToast({ title: '修改成功', icon: 'success' });
+                        setTimeout(() => {
+                            this.loadOrderDetail(this.orderInfo.orderId);
+                        }, 1000);
+                    }
+                }).finally(() => {
+                    this.isModifyingAddress = false;
+                });
             }
         },
-        onLoad(options) {
-            if (options.orderId) {
-                this.loadOrderDetail(options.orderId);
+        loadOrderDetail(orderId) {
+            uni.$u.http.get('/token/shop/order/getOrderDetail', {
+                orderId: orderId
+            }).then((res) => {
+                if (res.code === 200) {
+                    this.orderInfo = res.data;
+                }
+            });
+        },
+        copyOrderNo() {
+            uni.setClipboardData({
+                data: String(this.orderInfo.orderId),
+                success: () => {
+                    uni.showToast({ title: '复制成功', icon: 'none' });
+                }
+            });
+        },
+        viewLogistics() {
+            uni.navigateTo({
+                url: `/pages-car/pages/logistics-detail?orderId=${this.orderInfo.orderId}`
+            });
+        },
+        goToRefundDetail(refundOrderId) {
+            uni.navigateTo({
+                url: `/pages-car/pages/refund-detail?refundOrderId=${refundOrderId}`
+            });
+        },
+        applyRefund(goods) {
+            if (this.orderInfo.status == '2') {
+                // 待发货状态,使用极速退款弹窗
+                this.$refs.refundDialog.open(this.orderInfo);
+                return;
             }
-            // 监听地址选择
-            uni.$on('selectAddr', this.onAddressSelected);
+            // 跳转到申请售后页面,并传递 orderId 和对应的 detailOrderId
+            uni.navigateTo({
+                url: `/pages-car/pages/apply-refund?orderId=${this.orderInfo.orderId}&detailOrderId=${goods.detailOrderId}`
+            });
         },
-        onUnload() {
-            uni.$off('selectAddr', this.onAddressSelected);
+        handleAddressClick() {
+            if (this.orderInfo.showModifyAddress == 1) {
+                this.handleAction('address');
+            }
         },
-        methods: {
-            onAddressSelected(addr) {
-                if (this.isModifyingAddress && addr && addr.id) {
-                    this.$u.api.modifyOrderAddressAjax({
-                        orderId: this.orderInfo.orderId,
-                        addressId: addr.id
-                    }).then(res => {
-                        uni.hideLoading();
-                        if (res.code == 200) {
-                            uni.showToast({ title: '修改成功', icon: 'success' });
-                            setTimeout(() => {
-                                this.loadOrderDetail(this.orderInfo.orderId);
-                            }, 1000);
+        handleAction(type) {
+            if (type === 'complaint') {
+                uni.setStorageSync('tempComplaintOrder', this.orderInfo);
+                uni.navigateTo({
+                    url: `/pages-car/pages/complaint?orderId=${this.orderInfo.orderId}`
+                });
+                return;
+            }
+            if (type === 'cancel') {
+                this.$refs.cancelDialog.open(this.orderInfo.orderId);
+                return;
+            }
+            if (type === 'remind') {
+                this.$refs.urgeDialog.open(this.orderInfo);
+                return;
+            }
+            if (type === 'overtime') {
+                // 超时发货补偿
+                uni.showModal({
+                    title: '提示',
+                    content: '确认申请超时发货补偿?',
+                    success: (res) => {
+                        if (res.confirm) {
+                            this.$u.api.sendTimeoutCompensationAjax(this.orderInfo.orderId).then(res => {
+                                if (res.code == 200) {
+                                    uni.showToast({
+                                        title: '申请成功',
+                                        icon: 'success'
+                                    });
+                                    // 刷新订单详情
+                                    this.loadOrderDetail(this.orderInfo.orderId);
+                                }
+                            });
                         }
-                    }).finally(() => {
-                        this.isModifyingAddress = false;
-                    });
-                }
-            },
-            loadOrderDetail(orderId) {
-                uni.$u.http.get('/token/shop/order/getOrderDetail', {
-                    orderId: orderId
-                }).then((res) => {
-                    if (res.code === 200) {
-                        this.orderInfo = res.data;
                     }
                 });
-            },
-            copyOrderNo() {
-                uni.setClipboardData({
-                    data: String(this.orderInfo.orderId),
-                    success: () => {
-                        uni.showToast({ title: '复制成功', icon: 'none' });
+                return;
+            }
+            if (type === 'priceMatch') {
+                // 降价补差
+                uni.showModal({
+                    title: '提示',
+                    content: '确认申请降价补差?',
+                    success: (res) => {
+                        if (res.confirm) {
+                            this.$u.api.priceReductionCompensationAjax(this.orderInfo.orderId).then(res => {
+                                if (res.code == 200) {
+                                    uni.showToast({
+                                        title: '申请成功',
+                                        icon: 'success'
+                                    });
+                                    // 刷新订单详情
+                                    this.loadOrderDetail(this.orderInfo.orderId);
+                                }
+                            });
+                        }
                     }
                 });
-            },
-            viewLogistics() {
+                return;
+            }
+            if (type === 'address') {
+                this.isModifyingAddress = true;
+                // 兼容可能的字段差异
+                const addressId = this.orderInfo.addressId || this.orderInfo.receiverAddressId || '';
                 uni.navigateTo({
-                    url: `/pages-car/pages/logistics-detail?orderId=${this.orderInfo.orderId}`
+                    url: `/pages-mine/pages/address/list?isSelect=1&id=${addressId}`
                 });
-            },
-            goToRefundDetail(refundOrderId) {
-                uni.navigateTo({
-                    url: `/pages-car/pages/refund-detail?refundOrderId=${refundOrderId}`
+                return;
+            }
+            if (type === 'logistics') {
+                this.viewLogistics();
+                return;
+            }
+            if (type === 'confirm') {
+                uni.showModal({
+                    title: '提示',
+                    content: '是否确认收货?',
+                    success: (res) => {
+                        if (res.confirm) {
+                            uni.showLoading({ title: '处理中' });
+                            this.$u.api.confirmReceiveAjax({ orderId: this.orderInfo.orderId }).then(res => {
+                                uni.hideLoading();
+                                if (res.code == 200) {
+                                    uni.showToast({ title: '收货成功', icon: 'success' });
+                                    this.loadOrderDetail(this.orderInfo.orderId);
+                                }
+                            });
+                        }
+                    }
                 });
-            },
-            applyRefund(goods) {
-                // 跳转到申请售后页面,并传递 orderId 和对应的 detailOrderId
+                return;
+            }
+            if (type === 'addToCart') {
+                uni.showLoading({ title: '加载中' });
+                this.$u.api.orderAddToCartAjax({
+                    orderId: this.orderInfo.orderId
+                }).then(res => {
+                    uni.hideLoading();
+                    if (res.code == 200) {
+                        uni.showToast({
+                            title: '已加入购物车',
+                            icon: 'success',
+                            duration: 3000
+                        });
+                        this.$updateCartBadge();
+                    }
+                });
+                return;
+            }
+            if (type === 'pay') {
                 uni.navigateTo({
-                    url: `/pages-car/pages/apply-refund?orderId=${this.orderInfo.orderId}&detailOrderId=${goods.detailOrderId}`
+                    url: `/pages-car/pages/cashier-desk?id=${this.orderInfo.orderId}`
                 });
-            },
-            handleAddressClick() {
-                if (this.orderInfo.showModifyAddress == 1) {
-                    this.handleAction('address');
-                }
-            },
-            handleAction(type) {
-                if (type === 'complaint') {
-                    uni.setStorageSync('tempComplaintOrder', this.orderInfo);
-                    uni.navigateTo({
-                        url: `/pages-car/pages/complaint?orderId=${this.orderInfo.orderId}`
-                    });
-                    return;
-                }
-                if (type === 'cancel') {
-                    this.$refs.cancelDialog.open(this.orderInfo.orderId);
-                    return;
-                }
-                if (type === 'remind') {
-                    this.$refs.urgeDialog.open(this.orderInfo);
-                    return;
-                }
-                if (type === 'overtime') {
-                    // 超时发货补偿
-                    uni.showModal({
-                        title: '提示',
-                        content: '确认申请超时发货补偿?',
-                        success: (res) => {
-                            if (res.confirm) {
-                                this.$u.api.sendTimeoutCompensationAjax(this.orderInfo.orderId).then(res => {
-                                    if (res.code == 200) {
-                                        uni.showToast({
-                                            title: '申请成功',
-                                            icon: 'success'
-                                        });
-                                        // 刷新订单详情
-                                        this.loadOrderDetail(this.orderInfo.orderId);
-                                    }
-                                });
-                            }
-                        }
-                    });
-                    return;
-                }
-                if (type === 'priceMatch') {
-                    // 降价补差
-                    uni.showModal({
-                        title: '提示',
-                        content: '确认申请降价补差?',
-                        success: (res) => {
-                            if (res.confirm) {
-                                this.$u.api.priceReductionCompensationAjax(this.orderInfo.orderId).then(res => {
-                                    if (res.code == 200) {
-                                        uni.showToast({
-                                            title: '申请成功',
-                                            icon: 'success'
-                                        });
-                                        // 刷新订单详情
-                                        this.loadOrderDetail(this.orderInfo.orderId);
-                                    }
-                                });
-                            }
-                        }
-                    });
-                    return;
-                }
-                if (type === 'address') {
-                    this.isModifyingAddress = true;
-                    // 兼容可能的字段差异
-                    const addressId = this.orderInfo.addressId || this.orderInfo.receiverAddressId || '';
-                    uni.navigateTo({
-                        url: `/pages-mine/pages/address/list?isSelect=1&id=${addressId}`
-                    });
-                    return;
-                }
-                if (type === 'logistics') {
-                    this.viewLogistics();
-                    return;
-                }
-                if (type === 'confirm') {
-                    uni.showModal({
-                        title: '提示',
-                        content: '是否确认收货?',
-                        success: (res) => {
-                            if (res.confirm) {
-                                uni.showLoading({ title: '处理中' });
-                                this.$u.api.confirmReceiveAjax({ orderId: this.orderInfo.orderId }).then(res => {
-                                    uni.hideLoading();
-                                    if (res.code == 200) {
-                                        uni.showToast({ title: '收货成功', icon: 'success' });
-                                        this.loadOrderDetail(this.orderInfo.orderId);
-                                    }
-                                });
-                            }
-                        }
-                    });
-                    return;
-                }
-                if (type === 'addToCart') {
-                    uni.showLoading({ title: '加载中' });
-                    this.$u.api.orderAddToCartAjax({
-                        orderId: this.orderInfo.orderId
-                    }).then(res => {
-                        uni.hideLoading();
-                        if (res.code == 200) {
-                            uni.showToast({
-                                title: '已加入购物车',
-                                icon: 'success',
-                                duration: 3000
-                            });
-                            this.$updateCartBadge();
-                        }
-                    });
-                    return;
-                }
-                if (type === 'pay') {
-                    uni.navigateTo({
-                        url: `/pages-car/pages/cashier-desk?id=${this.orderInfo.orderId}`
-                    });
-                    return;
-                }
+                return;
             }
         }
-    };
+    }
+};
 </script>
 
 <style lang="scss" scoped>
-    .order-detail-page {
-        min-height: 100vh;
-        background-color: #F5F5F5;
-        padding-bottom: 20rpx;
-
-        .status-header {
-            background-color: #d1f2d8; // Light green bg
-            padding: 40rpx 30rpx;
-            color: #333;
-
-            .status-text {
-                font-size: 36rpx;
-                font-weight: bold;
+.order-detail-page {
+    min-height: 100vh;
+    background-color: #F5F5F5;
+    padding-bottom: 20rpx;
+
+    .status-header {
+        background-color: #d1f2d8; // Light green bg
+        padding: 40rpx 30rpx;
+        color: #333;
+
+        .status-text {
+            font-size: 36rpx;
+            font-weight: bold;
+            margin-bottom: 10rpx;
+        }
+
+        .status-desc {
+            font-size: 26rpx;
+            color: #666;
+            display: flex;
+            align-items: center;
+        }
+
+        .status-desc-block {
+            font-size: 26rpx;
+            color: #666;
+
+            .status-tip {
                 margin-bottom: 10rpx;
             }
 
-            .status-desc {
-                font-size: 26rpx;
-                color: #666;
+            .status-desc-row {
                 display: flex;
                 align-items: center;
             }
+        }
+    }
 
-            .status-desc-block {
-                font-size: 26rpx;
-                color: #666;
+    .info-card {
+        background-color: #fff;
+        margin: 20rpx;
+        border-radius: 16rpx;
+        padding: 30rpx;
+        display: flex;
 
-                .status-tip {
+        &.address-card {
+            align-items: center;
+
+            .icon-box {
+                margin-right: 20rpx;
+            }
+
+            .address-content {
+                flex: 1;
+                margin-right: 20rpx;
+
+                .user-info {
+                    font-size: 30rpx;
+                    font-weight: 500;
                     margin-bottom: 10rpx;
+
+                    .mobile {
+                        margin-left: 20rpx;
+                    }
                 }
 
-                .status-desc-row {
-                    display: flex;
-                    align-items: center;
+                .address-detail {
+                    font-size: 26rpx;
+                    color: #666;
+                    line-height: 1.4;
                 }
             }
         }
 
-        .info-card {
-            background-color: #fff;
-            margin: 20rpx;
-            border-radius: 16rpx;
-            padding: 30rpx;
-            display: flex;
-
-            &.address-card {
-                align-items: center;
+        &.logistics-card {
+            align-items: center;
 
-                .icon-box {
-                    margin-right: 20rpx;
-                }
+            .icon-box {
+                margin-right: 20rpx;
+            }
 
-                .address-content {
-                    flex: 1;
-                    margin-right: 20rpx;
+            .logistics-content {
+                flex: 1;
+                margin-right: 20rpx;
 
-                    .user-info {
-                        font-size: 30rpx;
-                        font-weight: 500;
-                        margin-bottom: 10rpx;
+                .company-name {
+                    font-size: 28rpx;
+                    color: #38C148;
+                    margin-bottom: 6rpx;
+                }
 
-                        .mobile {
-                            margin-left: 20rpx;
-                        }
-                    }
+                .latest-trace {
+                    font-size: 26rpx;
+                    color: #333;
+                    margin-bottom: 6rpx;
+                    display: -webkit-box;
+                    -webkit-box-orient: vertical;
+                    -webkit-line-clamp: 2;
+                    overflow: hidden;
+                }
 
-                    .address-detail {
-                        font-size: 26rpx;
-                        color: #666;
-                        line-height: 1.4;
-                    }
+                .update-time {
+                    font-size: 24rpx;
+                    color: #999;
                 }
             }
+        }
 
-            &.logistics-card {
-                align-items: center;
+        &.goods-card {
+            display: block;
+
+            .goods-item {
+                display: flex;
+                margin-bottom: 30rpx;
 
-                .icon-box {
+                .goods-cover {
+                    width: 120rpx;
+                    height: 120rpx;
+                    border-radius: 8rpx;
                     margin-right: 20rpx;
+                    background-color: #eee;
                 }
 
-                .logistics-content {
+                .goods-info {
                     flex: 1;
-                    margin-right: 20rpx;
 
-                    .company-name {
+                    .goods-title {
                         font-size: 28rpx;
-                        color: #38C148;
-                        margin-bottom: 6rpx;
-                    }
-
-                    .latest-trace {
-                        font-size: 26rpx;
                         color: #333;
-                        margin-bottom: 6rpx;
-                        display: -webkit-box;
-                        -webkit-box-orient: vertical;
-                        -webkit-line-clamp: 2;
-                        overflow: hidden;
+                        margin-bottom: 10rpx;
                     }
 
-                    .update-time {
+                    .goods-quality {
                         font-size: 24rpx;
                         color: #999;
                     }
-                }
-            }
-
-            &.goods-card {
-                display: block;
-
-                .goods-item {
-                    display: flex;
-                    margin-bottom: 30rpx;
-
-                    .goods-cover {
-                        width: 120rpx;
-                        height: 120rpx;
-                        border-radius: 8rpx;
-                        margin-right: 20rpx;
-                        background-color: #eee;
-                    }
 
-                    .goods-info {
-                        flex: 1;
+                    .price-box {
+                        margin-top: 10rpx;
+                        display: flex;
+                        justify-content: space-between;
 
-                        .goods-title {
-                            font-size: 28rpx;
-                            color: #333;
-                            margin-bottom: 10rpx;
+                        .price {
+                            font-weight: 500;
                         }
 
-                        .goods-quality {
-                            font-size: 24rpx;
+                        .num {
                             color: #999;
                         }
-
-                        .price-box {
-                            margin-top: 10rpx;
-                            display: flex;
-                            justify-content: space-between;
-
-                            .price {
-                                font-weight: 500;
-                            }
-
-                            .num {
-                                color: #999;
-                            }
-                        }
                     }
+                }
 
-                    .goods-action {
-                        display: flex;
-                        align-items: center;
-                    }
+                .goods-action {
+                    display: flex;
+                    align-items: center;
                 }
+            }
 
-                .price-detail {
-                    border-top: 1rpx solid #eee;
-                    padding-top: 20rpx;
+            .price-detail {
+                border-top: 1rpx solid #eee;
+                padding-top: 20rpx;
 
-                    .row {
-                        display: flex;
-                        justify-content: space-between;
-                        font-size: 26rpx;
-                        color: #666;
-                        margin-bottom: 10rpx;
+                .row {
+                    display: flex;
+                    justify-content: space-between;
+                    font-size: 26rpx;
+                    color: #666;
+                    margin-bottom: 10rpx;
 
-                        .goods-total {
-                            color: #38C148;
-                        }
+                    .goods-total {
+                        color: #38C148;
+                    }
 
-                        .discount {
-                            color: #38C148;
-                        }
+                    .discount {
+                        color: #38C148;
                     }
+                }
 
-                    .real-pay-row {
-                        display: flex;
-                        justify-content: space-between;
-                        font-size: 30rpx;
-                        font-weight: 500;
-                        margin-top: 20rpx;
+                .real-pay-row {
+                    display: flex;
+                    justify-content: space-between;
+                    font-size: 30rpx;
+                    font-weight: 500;
+                    margin-top: 20rpx;
 
-                        .real-price {
-                            color: #38C148;
-                        }
+                    .real-price {
+                        color: #38C148;
                     }
                 }
             }
+        }
 
-            &.time-card {
-                display: block;
+        &.time-card {
+            display: block;
 
-                .row {
-                    display: flex;
-                    justify-content: space-between;
-                    font-size: 24rpx;
-                    color: #999;
-                    margin-bottom: 10rpx;
+            .row {
+                display: flex;
+                justify-content: space-between;
+                font-size: 24rpx;
+                color: #999;
+                margin-bottom: 10rpx;
 
-                    &:last-child {
-                        margin-bottom: 0;
-                    }
+                &:last-child {
+                    margin-bottom: 0;
                 }
             }
         }
     }
+}
 </style>

+ 1 - 1
pages-sell/components/recommend-item/index.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="recommend-item" @click="handleClick">
+	<view class="recommend-item" @click.stop="handleClick">
 		<!-- Main Info Row -->
 		<view class="main-info" :style="{ 'margin-bottom': showDesc ? '30rpx' : '0' }">
 			<image :src="item.cover" class="book-cover" mode="aspectFill"></image>

+ 76 - 18
pages-sell/components/select-good-popup/index.vue

@@ -1,7 +1,8 @@
 <template>
-	<u-popup v-model="visible" mode="bottom" border-radius="24" :safe-area-inset-bottom="true" :mask-close-able="true"
-		@close="close">
-		<view class="popup-content">
+	<view>
+		<u-popup v-model="visible" mode="bottom" border-radius="24" :safe-area-inset-bottom="true" :mask-close-able="false"
+			@close="close">
+			<view class="popup-content" @click.stop>
 			<!-- Header -->
 			<view class="header">
 				<text class="title">选择商品品相</text>
@@ -67,22 +68,33 @@
 
 			<!-- Footer Buttons -->
 			<view class="footer-btns">
-				<button class="btn btn-orange" open-type="share">
+				<view class="btn btn-orange" @click="handleShareAction">
 					<text class="price">¥{{ currentProduct.maxReducePrice }}</text>
 					<text class="desc">分享一人可降 {{ currentProduct.reducePrice }} 元</text>
-				</button>
+				</view>
 				<view class="btn btn-green" @click="handleAction">
 					<text v-if="hasStock" class="price">¥{{ displayTotalPrice }}</text>
 					<text class="desc" :class="{ 'notice': !hasStock }">{{ hasStock ? '加入购物车' : '到货通知' }}</text>
 				</view>
 			</view>
-		</view>
-	</u-popup>
+			</view>
+		</u-popup>
+
+		<price-reduction-popup ref="reducePopup" @scan="handleScan"></price-reduction-popup>
+		<reduce-qrcode ref="reduceQrcode"></reduce-qrcode>
+	</view>
 </template>
 
 <script>
+import PriceReductionPopup from '@/components/price-reduction-popup/price-reduction-popup.vue';
+import ReduceQrcode from '@/components/reduce-qrcode/reduce-qrcode.vue';
+
 export default {
 	name: 'SelectGoodPopup',
+	components: {
+		PriceReductionPopup,
+		ReduceQrcode
+	},
 	data() {
 		return {
 			visible: false,
@@ -109,14 +121,14 @@ export default {
 			return this.formatPrice(this.selectedOption.balanceMoney);
 		},
 		displayTotalPrice() {
-			const total = this.toNumber(this.selectedOption.price) * this.quantity;
+			const total = Number(this.selectedOption.price || 0) * this.quantity;
 			return this.formatPrice(total);
 		},
 		hasStock() {
 			const stock = this.selectedOption.stockNum;
 			if (stock === 0) return false;
 			if (stock === undefined || stock === null || stock === '') return true;
-			return this.toNumber(stock) > 0;
+			return Number(stock) > 0;
 		}
 	},
 	methods: {
@@ -149,7 +161,7 @@ export default {
 			const stock = opt.stockNum;
 			if (stock === 0) return true;
 			if (stock === undefined || stock === null || stock === '') return false;
-			return this.toNumber(stock) <= 0;
+			return Number(stock) <= 0;
 		},
 		selectQuality(opt) {
 			if (this.isOptionDisabled(opt)) {
@@ -217,17 +229,63 @@ export default {
 				this.isSubmitting = false; // 重置提交状态
 			});
 		},
-		formatPrice(price) {
-			if (price === undefined || price === null) return '0.00';
-			return Number(price).toFixed(2);
+		handleShareAction() {
+			if (this.isSubmitting) return; // 防止重复提交
+			
+			if (!this.currentProduct.isbn) {
+				this.$u.toast('商品信息缺失');
+				return;
+			}
+
+			const selectedOption = this.selectedOption;
+			const conditionType = selectedOption.conditionType || this.currentQuality;
+
+			if (!conditionType) {
+				this.$u.toast('请选择品相');
+				return;
+			}
+
+			this.isSubmitting = true; // 设置提交中状态
+
+			this.$u.api.addShopCartAjax({
+				isbn: this.currentProduct.isbn,
+				quantity: this.quantity,
+				conditionType: conditionType,
+				sourceFrom: this.sourceFrom
+			}).then(res => {
+				if (res.code === 200) {
+					this.$u.toast('加入购物车成功');
+					this.$updateCartBadge();
+					this.$emit('confirm', {
+						product: this.currentProduct,
+						quality: this.currentQuality,
+						quantity: this.quantity
+					});
+					this.close();
+					
+					// 打开减价弹窗
+					setTimeout(() => {
+						if (this.$refs.reducePopup) {
+							this.$refs.reducePopup.open({
+								isbn: this.currentProduct.isbn,
+								conditionType: conditionType
+							});
+						}
+					}, 300);
+				} else {
+					this.$u.toast(res.msg || '加入购物车失败');
+				}
+			}).finally(() => {
+				this.isSubmitting = false; // 重置提交状态
+			});
 		},
-		toNumber(value) {
-			const num = Number(value);
-			return Number.isFinite(num) ? num : 0;
+		handleScan(bookInfo) {
+			this.$refs.reduceQrcode.open(bookInfo);
 		},
 		formatPrice(value) {
-			const num = this.toNumber(value);
-			return num.toFixed(2);
+			if (value === undefined || value === null) return '0.00';
+			const num = Number(value);
+			return Number.isFinite(num) ? num.toFixed(2) : '0.00';
 		}
 	}
 };

+ 39 - 7
pages-sell/pages/recommend.vue

@@ -13,7 +13,9 @@
 			<view class="header-desc">
 				<view class="title-row">
 					<text class="title-text">{{ showName }}</text>
-					<image class="share-icon" src="/pages-sell/static/recommend/icon-share.png" mode="aspectFit"></image>
+					<button class="share-btn" open-type="share">
+						<image class="share-icon" src="/pages-sell/static/recommend/icon-share.png" mode="aspectFit"></image>
+					</button>
 				</view>
 				<text class="desc-text">{{ remark }}</text>
 			</view>
@@ -60,6 +62,20 @@ export default {
 			this.loadData();
 		}
 	},
+	onShareAppMessage() {
+		return {
+			title: this.showName || '推荐图书专题',
+			path: `/pages-sell/pages/recommend?cateId=${this.cateId}`,
+			imageUrl: this.imageUrl || ''
+		};
+	},
+	onShareTimeline() {
+		return {
+			title: this.showName || '推荐图书专题',
+			query: `cateId=${this.cateId}`,
+			imageUrl: this.imageUrl || ''
+		};
+	},
 	methods: {
 		loadData() {
 			this.loadStatus = 'loading';
@@ -166,12 +182,28 @@ export default {
                 line-height: 1.2;
             }
 
-            .share-icon {
-                width: 34rpx;
-                height: 34rpx;
-                flex-shrink: 0;
-                margin-left: 20rpx;
-                margin-top: 10rpx;
+            .share-btn {
+				max-width: 60rpx;
+                background-color: transparent;
+                padding: 0;
+                margin: 0;
+                line-height: normal;
+                display: flex;
+                align-items: center;
+                justify-content: center;
+                border: none;
+                
+                &::after {
+                    border: none;
+                }
+
+                .share-icon {
+                    width: 34rpx;
+                    height: 34rpx;
+                    flex-shrink: 0;
+                    margin-left: 20rpx;
+                    margin-top: 10rpx;
+                }
             }
         }
 

+ 17 - 7
pages/mine/index.vue

@@ -24,7 +24,7 @@
 					<view class="label">我的钱包</view>
 				</view>
 				<view class="data-item" @click="navigateToTool('/pages-car/pages/red-packet')">
-					<view class="amount">{{ userInfo.couponNum || 0 }}</view>
+					<view class="amount">{{ userInfo.unusedCouponNum || 0 }}</view>
 					<view class="label">我的红包</view>
 					<view class="badge" v-if="userInfo.couponNum">{{ userInfo.couponNum }}个可领</view>
 				</view>
@@ -139,12 +139,18 @@
 					tags: [],
 					accountMoney: 0,
 					couponNum: 0,
+					unusedCouponNum: 0,
 					point: 0,
 					firstAuditNum: 0,
 					pickUpNum: 0,
 					auditNum: 0,
 					payNum: 0,
-					refundNum: 0
+					refundNum: 0,
+					shopWaitPayNum: 0,
+					shopWaitSendNum: 0,
+					shopWaitReceiptNum: 0,
+					shopRefundNum: 0,
+					shopFinishNum: 0
 				},
 				orderTypes: [
 					{
@@ -188,35 +194,35 @@
 						name: '待付款',
 						icon: '/pages-car/static/my-order/icon-1.png',
 						badge: 0,
-						key: 'payNum',
+						key: 'shopWaitPayNum',
 						path: '/pages-car/pages/my-order?status=1'
 					},
 					{
 						name: '待发货',
 						icon: '/pages-car/static/my-order/icon-2.png',
 						badge: 0,
-						key: 'sendNum',
+						key: 'shopWaitSendNum',
 						path: '/pages-car/pages/my-order?status=2'
 					},
 					{
 						name: '待收货',
 						icon: '/pages-car/static/my-order/icon-3.png',
 						badge: 0,
-						key: 'receiveNum',
+						key: 'shopWaitReceiptNum',
 						path: '/pages-car/pages/my-order?status=3'
 					},
 					{
 						name: '退款/售后',
 						icon: '/pages-car/static/my-order/icon-4.png',
 						badge: 0,
-						key: 'refundNum',
+						key: 'shopRefundNum',
 						path: '/pages-car/pages/my-order?status=5'
 					},
 					{
 						name: '已完成',
 						icon: '/pages-car/static/my-order/icon-5.png',
 						badge: 0,
-						key: 'completeNum',
+						key: 'shopFinishNum',
 						path: '/pages-car/pages/my-order?status=4'
 					}
 				],
@@ -387,6 +393,10 @@
 						this.orderTypes.forEach((item) => {
 							item.badge = this.userInfo[item.key];
 						});
+						
+						this.myOrderTypes.forEach((item) => {
+							item.badge = this.userInfo[item.key];
+						});
 					}
 				});
 			},