Sfoglia il codice sorgente

feat: 实现图书详情页与订单流程对接

ylong 3 giorni fa
parent
commit
3504dbda31

+ 3 - 0
api/modules/mall.js

@@ -183,5 +183,8 @@ export const useMallApi = (Vue, vm) => {
 		
 		// 确认提交订单 (买书)
 		submitShopOrderAjax: (data) => vm.$u.post('/token/shop/order/submitOrder', data),
+
+        // 图书商品详情页面
+        getBookDetailAjax: (params) => vm.$u.get('/token/shop/bookDetail', params),
 	}
 }

+ 8 - 11
pages-car/components/buy-book-item.vue

@@ -6,25 +6,22 @@
             </view>
             <view class="book-detail">
                 <view class="top-info">
-                    <view class="book-title">{{ book.title }}</view>
-                    <view class="upsell-info" v-if="book.priceReduced">
-                        <text class="has-upsell">已降 ¥{{ book.priceReduced }}</text>
-                    </view>
-                    <view class="upsell-info" v-if="book.canReduce">
-                        <text class="can-upsell">可降 ¥{{ book.canReduce }}</text>
+                    <view class="book-title">{{ book.bookName }}</view>
+                    <view class="upsell-info" v-if="book.reducePrice > 0">
+                        <text class="has-upsell">已降 ¥{{ book.reducePrice }}</text>
                     </view>
                 </view>
 
-                <view class="flex flex-j-b flex-a-c">
-                    <view class="book-quality">品相:{{ book.quality || '中等' }}</view>
-                </view>
+                <!-- <view class="flex flex-j-b flex-a-c">
+                    <view class="book-quality">品相:{{ book.conditionName || '中等' }}</view>
+                </view> -->
                 
                 <view class="flex flex-j-b flex-a-c mt-10">
                     <view class="book-price">
                         <text class="price">¥{{ book.price }}</text>
-                        <text class="original-price ml-10">¥{{ book.originalPrice }}</text>
+                        <text class="original-price ml-10" v-if="book.originalPrice">¥{{ book.originalPrice }}</text>
                     </view>
-                    <view class="book-num">× {{ book.num }}</view>
+                    <view class="book-num">× {{ book.quantity }}</view>
                 </view>
             </view>
         </view>

+ 206 - 230
pages-car/pages/confirm-order.vue

@@ -54,9 +54,9 @@
         <view class="bottom-bar">
             <view class="order-summary">
                 <view class="total">
-                    共<text class="num">{{ totalNum }}</text>本
-                    <text class="reduce-text" v-if="totalReduced > 0">已降¥{{ totalReduced }}</text>
-                    合计: <text class="price">¥{{ totalPrice }}</text>
+                    共<text class="num">{{ preOrder.totalQuantity }}</text>本
+                    <text class="reduce-text" v-if="preOrder.discountMoney > 0">已降¥{{ preOrder.discountMoney }}</text>
+                    合计: <text class="price">¥{{ preOrder.totalMoney }}</text>
                 </view>
                 <u-button type="primary" shape="circle" @click="submitOrder">提交订单</u-button>
             </view>
@@ -69,266 +69,242 @@
 </template>
 
 <script>
-import SubmitConfirm from "@/pages-car/components/submit-confirm.vue";
-import BuyBookItem from "@/pages-car/components/buy-book-item.vue";
-import RedPacketPopup from "@/pages-car/components/red-packet-popup.vue";
-import StockShortagePopup from "@/pages-car/components/stock-shortage-popup.vue";
+    import SubmitConfirm from "@/pages-car/components/submit-confirm.vue";
+    import BuyBookItem from "@/pages-car/components/buy-book-item.vue";
+    import RedPacketPopup from "@/pages-car/components/red-packet-popup.vue";
+    import StockShortagePopup from "@/pages-car/components/stock-shortage-popup.vue";
 
-export default {
-    components: {
-        SubmitConfirm,
-        BuyBookItem,
-        RedPacketPopup,
-        StockShortagePopup
-    },
-    data() {
-        return {
-            titleStyle: {
-                "font-family": "PingFang SC",
-                "font-weight": 400,
-                color: "#333333",
-            },
-            books: [],
-            defaultAddr: {},
-            submitData: {
-                addressId: "",
-                remark: "",
-            },
-            totalNum: 0,
-            totalPrice: 0,
-            totalReduced: 0,
-            btnStyle: {
-                width: '240rpx',
-                height: '80rpx',
-                lineHeight: '80rpx',
-                background: 'linear-gradient(90deg, #ff8c00, #ff4500)',
-                color: '#fff',
-                fontSize: '30rpx',
-                margin: '0'
-            },
-            showRedPacket: false,
-            showStockShortage: false,
-            selectedPacket: null,
-            selectedStockOption: { text: '其他商品继续发货(缺货商品退款)', value: 2 }
-        };
-    },
-    methods: {
-        //添加或者选择地址
-        handleAddress() {
-            uni.navigateTo({
-                url: `/pages-mine/pages/address/list?id=${this.defaultAddr.id}&isSelect=1`,
-            });
+    export default {
+        components: {
+            SubmitConfirm,
+            BuyBookItem,
+            RedPacketPopup,
+            StockShortagePopup
         },
-
-        onRedPacketConfirm(packet) {
-            this.selectedPacket = packet;
-            // Recalculate price if needed
-        },
-
-        onStockShortageConfirm(option) {
-            this.selectedStockOption = option;
+        data() {
+            return {
+                titleStyle: {
+                    "font-family": "PingFang SC",
+                    "font-weight": 400,
+                    color: "#333333",
+                },
+                books: [],
+                defaultAddr: {},
+                submitData: {
+                    cartIdList: [],
+                    addressId: "",
+                    remark: "",
+                    outOfStock: "2", // 默认为2
+                    userCouponIds: []
+                },
+                totalNum: 0,
+                totalPrice: 0,
+                totalReduced: 0,
+                btnStyle: {
+                    width: '240rpx',
+                    height: '80rpx',
+                    lineHeight: '80rpx',
+                    background: 'linear-gradient(90deg, #ff8c00, #ff4500)',
+                    color: '#fff',
+                    fontSize: '30rpx',
+                    margin: '0'
+                },
+                showRedPacket: false,
+                showStockShortage: false,
+                selectedPacket: null,
+                selectedStockOption: { text: '其他商品继续发货(缺货商品退款)', value: 2 },
+                preOrder: {},// 预订单信息
+            };
         },
+        onLoad(options) {
+            // 从本地存储获取提交订单数据
+            const preSubmitOrderData = uni.getStorageSync('preSubmitOrderData');
+            if (preSubmitOrderData) {
+                this.preOrder = preSubmitOrderData;
+                this.books = preSubmitOrderData.orderDetailList || [];
+                this.defaultAddr = preSubmitOrderData.defaultAddress || {};
 
-        submitOrder() {
-            if (!this.submitData.addressId) {
-                this.$u.toast("请选择收货地址");
-                return;
+                //拼接提交数据
+                this.submitData.cartIdList = preSubmitOrderData.cartIdList || [];
+                this.submitData.addressId = this.defaultAddr.id || "";
+            } else {
+                this.$u.toast('参数错误');
+                setTimeout(() => uni.navigateBack(), 1500);
             }
-            // 显示确认弹窗
-            this.$refs.submitConfirmDialog.openPopup();
         },
-
-        // 确认提交订单
-        handleConfirmSubmit() {
-            // 处理订单提交
-            uni.showToast({
-                title: '订单提交成功',
-                icon: "success",
-            });
-            setTimeout(() => {
-                uni.redirectTo({
-                    url: "/pages-car/pages/my-order"
+        methods: {
+            //添加或者选择地址
+            handleAddress() {
+                uni.navigateTo({
+                    url: `/pages-mine/pages/address/list?id=${this.defaultAddr.id}&isSelect=1`,
                 });
-            }, 1500);
-
-            // uni.$u.http.post("/token/order/submitBuyOrder", this.submitData).then((res) => {
-            //     if (res.code == 200) {
-            //         uni.navigateTo({
-            //             url: "/pages-car/pages/pay-success",
-            //         });
-            //     } else {
-            //         uni.showToast({
-            //             title: res.msg,
-            //             icon: "none",
-            //         });
-            //     }
-            // });
-        },
-        //获取默认地址
-        getDefaultAddress() {
-            // Mock default address
-            this.defaultAddr = {
-                id: '1',
-                name: '张三',
-                mobile: '18888888888',
-                fullAddress: '北京市朝阳区xx街道xx小区1号楼101'
-            };
-            this.submitData.addressId = this.defaultAddr.id;
+            },
 
-            // uni.$u.http.get("/token/user/address/getDefault").then((res) => {
-            //     if (res.code == 200) {
-            //         this.defaultAddr = res.data;
-            //         this.submitData.addressId = this.defaultAddr.id;
-            //     }
-            // });
-        },
-        // 获取结算商品信息
-        getCheckoutInfo() {
-            // Mock books data
-            this.books = [
-                {
-                    title: '商品名称商品名称商品',
-                    cover: 'https://k.sinaimg.cn/n/sinakd20116/234/w1000h1634/20251003/b66b-587c9ff400fcf01be52c6693594b6a6d.jpg/w700d1q75cms.jpg',
-                    quality: '中等',
-                    price: '0.01',
-                    originalPrice: '0.01',
-                    priceReduced: '0.5',
-                    num: 1
-                },
-                {
-                    title: '商品名称商品名称商品',
-                    cover: 'https://k.sinaimg.cn/n/sinakd20116/234/w1000h1634/20251003/b66b-587c9ff400fcf01be52c6693594b6a6d.jpg/w700d1q75cms.jpg',
-                    quality: '中等',
-                    canReduce: '0.5',
-                    price: '0.01',
-                    originalPrice: '0.01',
-                    num: 1
+            onRedPacketConfirm(packet) {
+                this.selectedPacket = packet;
+                if (packet && packet.id) {
+                    this.submitData.userCouponIds = [packet.id];
+                } else {
+                    this.submitData.userCouponIds = [];
                 }
-            ];
-            this.totalNum = 2;
-            this.totalPrice = '0.01';
-            this.totalReduced = '1.01';
-        }
-    },
-    mounted() {
-        this.getDefaultAddress();
-        this.getCheckoutInfo();
-    },
-
-    onShow() {
-        let selectAddr = uni.getStorageSync("selectAddr");
-        if (selectAddr) {
-            this.defaultAddr = selectAddr;
-            this.submitData.addressId = selectAddr.id;
-            uni.removeStorageSync("selectAddr"); // Clear after use
-        }
-    },
-};
-</script>
-
-<style lang="scss">
-.confirm-order {
-    min-height: 100vh;
-    background: #f5f5f5;
-    padding: 20rpx 30rpx;
-    padding-bottom: calc(env(safe-area-inset-bottom) + 120rpx);
-}
+                // Recalculate price if needed
+            },
 
-.section-card {
-    background: #fff;
-    margin-bottom: 20rpx;
-    padding: 30rpx;
-    border-radius: 16rpx;
-    box-sizing: border-box;
-}
+            onStockShortageConfirm(option) {
+                this.selectedStockOption = option;
+                this.submitData.outOfStock = option.value;
+            },
 
-.u-required {
-    color: #ff0000;
-    margin-left: 8rpx;
-}
+            submitOrder() {
+                if (!this.submitData.addressId) {
+                    this.$u.toast("请选择收货地址");
+                    return;
+                }
+                // 显示确认弹窗
+                this.$refs.submitConfirmDialog.openPopup();
+            },
 
-.book-list {
-    background: #fff;
-    border-radius: 16rpx;
-    margin-bottom: 20rpx;
-}
+            // 确认提交订单
+            handleConfirmSubmit() {
+                uni.showLoading({ title: '提交中' });
+                this.$u.api.submitShopOrderAjax(this.submitData).then((res) => {
+                    uni.hideLoading();
+                    if (res.code == 200) {
+                        uni.showToast({
+                            title: '下单成功',
+                            icon: "success",
+                        });
+                        uni.removeStorageSync("selectAddr");
+                        setTimeout(() => {
+                            // 支付逻辑待接入,暂时跳转到订单列表或支付成功页
+                            uni.redirectTo({
+                                url: "/pages-car/pages/my-order"
+                            });
+                        }, 1500);
+                    } else {
+                        this.$u.toast(res.msg || '下单失败');
+                    }
+                }).catch(() => {
+                    uni.hideLoading();
+                });
+            },
+        },
 
-.info-row {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    padding: 20rpx 0;
-    font-size: 28rpx;
-    color: #333;
+        onShow() {
+            let selectAddr = uni.getStorageSync("selectAddr");
+            if (selectAddr) {
+                this.defaultAddr = selectAddr;
+                this.submitData.addressId = selectAddr.id;
+                uni.removeStorageSync("selectAddr"); // Clear after use
+            }
+        },
+    };
+</script>
 
-    .label {
-        &.red-label {
-            color: #ff4500;
-            font-weight: bold;
-        }
+<style lang="scss">
+    .confirm-order {
+        min-height: 100vh;
+        background: #f5f5f5;
+        padding: 20rpx 30rpx;
+        padding-bottom: calc(env(safe-area-inset-bottom) + 120rpx);
     }
 
-    .value {
-        &.text-gray {
-            color: #999;
-        }
+    .section-card {
+        background: #fff;
+        margin-bottom: 20rpx;
+        padding: 30rpx;
+        border-radius: 16rpx;
+        box-sizing: border-box;
     }
 
-    .mr-10 {
-        margin-right: 10rpx;
+    .u-required {
+        color: #ff0000;
+        margin-left: 8rpx;
     }
-}
 
-.bottom-bar {
-    position: fixed;
-    bottom: 0;
-    left: 0;
-    right: 0;
-    background: #fff;
-    padding: 20rpx 30rpx;
-    padding-bottom: env(safe-area-inset-bottom);
-    box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
+    .book-list {
+        background: #fff;
+        border-radius: 16rpx;
+        margin-bottom: 20rpx;
+    }
 
-    .order-summary {
+    .info-row {
         display: flex;
         justify-content: space-between;
         align-items: center;
+        padding: 20rpx 0;
+        font-size: 28rpx;
+        color: #333;
 
-        .total {
-            font-size: 28rpx;
-            color: #666;
-
-            .num {
-                color: #333;
+        .label {
+            &.red-label {
+                color: #ff4500;
                 font-weight: bold;
-                margin: 0 4rpx;
             }
+        }
 
-            .reduce-text {
-                color: #38C148;
-                margin-left: 10rpx;
-                margin-right: 10rpx;
-                background-color: #e6f9e9;
-                padding: 4rpx 10rpx;
-                border-radius: 4rpx;
-                font-size: 24rpx;
+        .value {
+            &.text-gray {
+                color: #999;
             }
+        }
 
-            .price {
-                font-size: 36rpx;
-                color: #ff4500;
-                font-weight: bold;
-                margin-left: 10rpx;
+        .mr-10 {
+            margin-right: 10rpx;
+        }
+    }
+
+    .bottom-bar {
+        position: fixed;
+        bottom: 0;
+        left: 0;
+        right: 0;
+        background: #fff;
+        padding: 20rpx 30rpx;
+        padding-bottom: env(safe-area-inset-bottom);
+        box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
+        z-index: 9;
+
+        .order-summary {
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+
+            .total {
+                font-size: 28rpx;
+                color: #666;
+
+                .num {
+                    color: #333;
+                    font-weight: bold;
+                    margin: 0 4rpx;
+                }
+
+                .reduce-text {
+                    color: #38C148;
+                    margin-left: 10rpx;
+                    margin-right: 10rpx;
+                    background-color: #e6f9e9;
+                    padding: 4rpx 10rpx;
+                    border-radius: 4rpx;
+                    font-size: 24rpx;
+                }
+
+                .price {
+                    font-size: 36rpx;
+                    color: #ff4500;
+                    font-weight: bold;
+                    margin-left: 10rpx;
+                }
             }
         }
     }
-}
 
-.mt-20 {
-    margin-top: 20rpx;
-}
+    .mt-20 {
+        margin-top: 20rpx;
+    }
 
-.ml-10 {
-    margin-left: 10rpx;
-}
+    .ml-10 {
+        margin-left: 10rpx;
+    }
 </style>

+ 11 - 10
pages-car/pages/index.vue

@@ -275,18 +275,19 @@
                 this.$u.api.preSubmitOrderAjax({ cartIdList: ids }).then(res => {
                     uni.hideLoading();
                     if (res.code === 200) {
-                        if (res.data.code === 1) {
-                            // 成功,跳转到确认订单页面
-                            uni.navigateTo({
-                                url: `/pages-home/pages/book-order?cartIds=${ids}`
-                            });
-                        } else if (res.data.code === 2) {
-                            // 失败,显示错误信息
-                            this.$u.toast('库存不足');
+                        if (res.data.code === 2) {
+                            return this.$u.toast('库存不足');
                         } else if (res.data.code === 3) {
-                            // 失败,显示错误信息
-                            this.$u.toast('图书已下架');
+                            return this.$u.toast('图书已下架');
                         }
+
+                        uni.navigateTo({
+                            url: `/pages-car/pages/confirm-order`
+                        });
+
+                        //存储提交的数据
+                        res.data.cartIdList = ids;
+                        uni.setStorageSync('preSubmitOrderData', res.data);
                     } else {
                         // 失败,显示错误信息
                         this.$u.toast(res.msg || '无法提交订单');

+ 195 - 218
pages-car/pages/my-order.vue

@@ -2,254 +2,231 @@
     <view class="my-order-page">
         <!-- 标签页 -->
         <view class="tabs-wrapper">
-            <u-tabs 
-                :list="tabList" 
-                :current="currentTab" 
-                @change="handleTabChange" 
-                :is-scroll="false"
-                active-color="#333" 
-                inactive-color="#666"
-                bar-width="40"
-                bar-height="6"
-                bar-style="{backgroundColor: '#ff5b5b'}"
-            ></u-tabs> 
-            <!-- Note: u-tabs styling might need adjustment to match image (red underline) -->
+            <u-tabs :list="tabList" :current="currentTab" @change="handleTabChange" active-color="#38C148" bar-width="60"></u-tabs>
         </view>
 
         <!-- 订单列表 -->
-        <page-scroll 
-            :page-size="10" 
-            @updateList="handleUpdateList" 
-            ref="pageRef" 
-            slotEmpty
-            url="/token/order/getMyBuyOrderList" 
-            :params="params" 
-            :immediate="false"
-        >
+        <page-scroll :page-size="10" @updateList="handleUpdateList" ref="pageRef" slotEmpty
+            url="/token/shop/order/getShopOrderList" :params="params" :immediate="false">
             <view v-if="orderList.length > 0" class="order-list-container">
-                <buy-order-item 
-                    v-for="(order, index) in orderList" 
-                    :key="index" 
-                    :order="order" 
-                    @action="handleAction"
-                ></buy-order-item>
+                <buy-order-item v-for="(order, index) in orderList" :key="index" :order="order"
+                    @action="handleAction"></buy-order-item>
             </view>
         </page-scroll>
 
         <!-- 更多操作菜单 -->
-        <u-action-sheet :list="actionSheetList" v-model="showActionSheet" @click="handleActionSheetClick"></u-action-sheet>
+        <u-action-sheet :list="actionSheetList" v-model="showActionSheet"
+            @click="handleActionSheetClick"></u-action-sheet>
     </view>
 </template>
 
 <script>
-import BuyOrderItem from '../components/buy-order-item.vue';
-import pageScroll from '@/components/pageScroll/index.vue';
+    import BuyOrderItem from '../components/buy-order-item.vue';
+    import pageScroll from '@/components/pageScroll/index.vue';
 
-export default {
-    components: {
-        BuyOrderItem,
-        pageScroll
-    },
-    data() {
-        return {
-            tabList: [
-                { name: '全部', status: '' },
-                { name: '待付款', status: '2' },
-                { name: '待发货', status: '3' },
-                { name: '待收货', status: '8' },
-                { name: '已完成', status: '12' },
-                { name: '退款/售后', status: '10' }
-            ],
-            currentTab: 0,
-            orderList: [],
-            params: {},
-            showActionSheet: false,
-            actionSheetList: [],
-            currentOrder: null
-        };
-    },
-    onLoad(options) {
-        if (options.status) {
-            const index = this.tabList.findIndex(item => item.status === options.status);
-            if (index !== -1) {
-                this.currentTab = index;
-                this.params.status = options.status;
-            }
-        }
-
-        // Load mock data for now since API might not be ready
-        // But pageScroll calls API. We can mock in updateList if API fails or returns empty.
-        // For now let's rely on pageScroll but maybe we need to mock response in pageScroll or here.
-        // Actually, let's trigger load.
-        this.loadOrders(true, this.params);
-    },
-    methods: {
-        loadOrders(refresh = false, params = {}) {
-            this.$nextTick(() => {
-                // If API is not real, pageScroll might fail.
-                // We can mock data here if needed by directly setting list if API fails.
-                // Let's try to use pageScroll mechanism.
-                this.$refs.pageRef?.loadData(refresh, params);
-            });
+    export default {
+        components: {
+            BuyOrderItem,
+            pageScroll
         },
-        handleTabChange(index) {
-            this.currentTab = index;
-            this.params.status = this.tabList[index].status;
-            this.loadOrders(true, this.params);
+        data() {
+            return {
+                //NULL-全部 1待付款 2待发货 3待收货 4已完成 5已取消 6退款中 7已退款
+                tabList: [
+                    { name: '全部', status: '' },
+                    { name: '待付款', status: 1 },
+                    { name: '待发货', status: 2 },
+                    { name: '待收货', status: 3 },
+                    { name: '已完成', status: 4 },
+                    { name: '已取消', status: 5 },
+                    { name: '退款中', status: 6 },
+                    { name: '已退款', status: 7 }
+                ],
+                currentTab: 0,
+                orderList: [],
+                params: {},
+                showActionSheet: false,
+                actionSheetList: [],
+                currentOrder: null
+            };
         },
-        handleUpdateList(list) {
-            // Mock data injection if list is empty (for development)
-            if (!list || list.length === 0) {
-                this.orderList = this.getMockOrders(this.params.status);
-            } else {
-                this.orderList = list;
-            }
-        },
-        handleAction({ type, order, data }) {
-            console.log('Action:', type, order);
-            this.currentOrder = order;
-            
-            if (type === 'more') {
-                // data contains the list of actions to show in sheet
-                // Map internal keys to display text
-                const actionMap = {
-                    'applyAfterSales': { text: '申请售后', type: 'refund' },
-                    'logistics': { text: '查看物流', type: 'logistics' },
-                    'invoice': { text: '申请开票', type: 'invoice' }
-                };
-                
-                this.actionSheetList = data.map(key => actionMap[key]).filter(Boolean);
-                this.showActionSheet = true;
-                return;
+        onLoad(options) {
+            if (options.status) {
+                const index = this.tabList.findIndex(item => item.status == options.status);
+                if (index !== -1) {
+                    this.currentTab = index;
+                    this.params.status = options.status;
+                }
             }
 
-            this.processAction(type, order);
-        },
-        handleActionSheetClick(index) {
-            const action = this.actionSheetList[index];
-            if (action && action.type) {
-                this.processAction(action.type, this.currentOrder);
-            }
+            // Load mock data for now since API might not be ready
+            // But pageScroll calls API. We can mock in updateList if API fails or returns empty.
+            // For now let's rely on pageScroll but maybe we need to mock response in pageScroll or here.
+            // Actually, let's trigger load.
+            this.loadOrders(true, this.params);
         },
-        processAction(type, order) {
-            if (type === 'rebuy' || type === 'addToCart') {
-                // Logic to add to cart
-                uni.showToast({ title: '已加入购物车', icon: 'none' });
-            } else if (type === 'delete') {
-                uni.showModal({
-                    title: '提示',
-                    content: '确定要删除该订单吗?',
-                    success: (res) => {
-                        if (res.confirm) {
-                            // Remove from list
-                            this.orderList = this.orderList.filter(item => item.orderNo !== order.orderNo);
-                            uni.showToast({ title: '删除成功', icon: 'none' });
-                        }
-                    }
-                });
-            } else if (type === 'remind') {
-                uni.showToast({ title: '已提醒商家发货', icon: 'none' });
-            } else if (type === 'refund') {
-                uni.showToast({ title: '进入极速退款/售后流程', icon: 'none' });
-            } else if (type === 'confirm') {
-                uni.showModal({
-                    title: '提示',
-                    content: '确认已收到商品?',
-                    success: (res) => {
-                        if (res.confirm) {
-                            uni.showToast({ title: '确认收货成功', icon: 'none' });
-                            // Update status locally or reload
-                            this.loadOrders(true, this.params);
-                        }
-                    }
+        methods: {
+            loadOrders(refresh = false, params = {}) {
+                this.$nextTick(() => {
+                    // If API is not real, pageScroll might fail.
+                    // We can mock data here if needed by directly setting list if API fails.
+                    // Let's try to use pageScroll mechanism.
+                    this.$refs.pageRef?.loadData(refresh, params);
                 });
-            } else if (type === 'logistics') {
-                uni.showToast({ title: '查看物流信息', icon: 'none' });
-            } else if (type === 'address') {
-                uni.showToast({ title: '修改地址', icon: 'none' });
-            } else if (type === 'pay') {
-                uni.showToast({ title: '去支付', icon: 'none' });
-            } else if (type === 'cancel') {
-                uni.showModal({
-                    title: '提示',
-                    content: '确定要取消订单吗?',
-                    success: (res) => {
-                        if (res.confirm) {
-                            uni.showToast({ title: '订单已取消', icon: 'none' });
-                            this.loadOrders(true, this.params);
+            },
+            handleTabChange(index) {
+                this.currentTab = index;
+                this.params.status = this.tabList[index].status;
+                this.loadOrders(true, this.params);
+            },
+            handleUpdateList(list) {
+                this.orderList = list;
+            },
+            handleAction({ type, order, data }) {
+                console.log('Action:', type, order);
+                this.currentOrder = order;
+
+                if (type === 'more') {
+                    // data contains the list of actions to show in sheet
+                    // Map internal keys to display text
+                    const actionMap = {
+                        'applyAfterSales': { text: '申请售后', type: 'refund' },
+                        'logistics': { text: '查看物流', type: 'logistics' },
+                        'invoice': { text: '申请开票', type: 'invoice' }
+                    };
+
+                    this.actionSheetList = data.map(key => actionMap[key]).filter(Boolean);
+                    this.showActionSheet = true;
+                    return;
+                }
+
+                this.processAction(type, order);
+            },
+            handleActionSheetClick(index) {
+                const action = this.actionSheetList[index];
+                if (action && action.type) {
+                    this.processAction(action.type, this.currentOrder);
+                }
+            },
+            processAction(type, order) {
+                if (type === 'rebuy' || type === 'addToCart') {
+                    // Logic to add to cart
+                    uni.showToast({ title: '已加入购物车', icon: 'none' });
+                } else if (type === 'delete') {
+                    uni.showModal({
+                        title: '提示',
+                        content: '确定要删除该订单吗?',
+                        success: (res) => {
+                            if (res.confirm) {
+                                // Remove from list
+                                this.orderList = this.orderList.filter(item => item.orderNo !== order.orderNo);
+                                uni.showToast({ title: '删除成功', icon: 'none' });
+                            }
                         }
-                    }
-                });
-            } else {
-                uni.showToast({ title: '功能开发中', icon: 'none' });
-            }
-        },
-        getMockOrders(status) {
-            // Generate some mock data based on status
-            const allOrders = [
-                {
-                    orderNo: 'SN1893294923003',
-                    status: 2, // 待付款
-                    totalPrice: 17.2,
-                    realPayPrice: 17.2,
-                    goodsList: [
-                        {
-                            title: '马克思主义基本原理',
-                            cover: 'https://k.sinaimg.cn/n/sinakd20116/234/w1000h1634/20251003/b66b-587c9ff400fcf01be52c6693594b6a6d.jpg/w700d1q75cms.jpg',
-                            price: 8.60,
-                            num: 2,
-                            quality: '中等'
+                    });
+                } else if (type === 'remind') {
+                    uni.showToast({ title: '已提醒商家发货', icon: 'none' });
+                } else if (type === 'refund') {
+                    uni.showToast({ title: '进入极速退款/售后流程', icon: 'none' });
+                } else if (type === 'confirm') {
+                    uni.showModal({
+                        title: '提示',
+                        content: '确认已收到商品?',
+                        success: (res) => {
+                            if (res.confirm) {
+                                uni.showToast({ title: '确认收货成功', icon: 'none' });
+                                // Update status locally or reload
+                                this.loadOrders(true, this.params);
+                            }
                         }
-                    ]
-                },
-                {
-                    orderNo: 'SN1893294923004',
-                    status: 3, // 待发货
-                    totalPrice: 17.2,
-                    realPayPrice: 17.2,
-                    goodsList: [
-                        { cover: 'https://k.sinaimg.cn/n/sinakd20116/234/w1000h1634/20251003/b66b-587c9ff400fcf01be52c6693594b6a6d.jpg/w700d1q75cms.jpg' }, { cover: 'https://k.sinaimg.cn/n/sinakd20116/234/w1000h1634/20251003/b66b-587c9ff400fcf01be52c6693594b6a6d.jpg/w700d1q75cms.jpg' }, { cover: 'https://k.sinaimg.cn/n/sinakd20116/234/w1000h1634/20251003/b66b-587c9ff400fcf01be52c6693594b6a6d.jpg/w700d1q75cms.jpg' }
-                    ]
-                },
-                {
-                    orderNo: 'SN1893294923005',
-                    status: -1, // 已取消
-                    totalPrice: 17.2,
-                    realPayPrice: 17.2,
-                    goodsList: [
-                        {
-                            title: '马克思主义基本原理',
-                            cover: 'https://k.sinaimg.cn/n/sinakd20116/234/w1000h1634/20251003/b66b-587c9ff400fcf01be52c6693594b6a6d.jpg/w700d1q75cms.jpg',
-                            price: 8.60,
-                            num: 2,
-                            quality: '中等'
+                    });
+                } else if (type === 'logistics') {
+                    uni.showToast({ title: '查看物流信息', icon: 'none' });
+                } else if (type === 'address') {
+                    uni.showToast({ title: '修改地址', icon: 'none' });
+                } else if (type === 'pay') {
+                    uni.showToast({ title: '去支付', icon: 'none' });
+                } else if (type === 'cancel') {
+                    uni.showModal({
+                        title: '提示',
+                        content: '确定要取消订单吗?',
+                        success: (res) => {
+                            if (res.confirm) {
+                                uni.showToast({ title: '订单已取消', icon: 'none' });
+                                this.loadOrders(true, this.params);
+                            }
                         }
-                    ]
+                    });
+                } else {
+                    uni.showToast({ title: '功能开发中', icon: 'none' });
                 }
-            ];
+            },
+            getMockOrders(status) {
+                // Generate some mock data based on status
+                const allOrders = [
+                    {
+                        orderNo: 'SN1893294923003',
+                        status: 2, // 待付款
+                        totalPrice: 17.2,
+                        realPayPrice: 17.2,
+                        goodsList: [
+                            {
+                                title: '马克思主义基本原理',
+                                cover: 'https://k.sinaimg.cn/n/sinakd20116/234/w1000h1634/20251003/b66b-587c9ff400fcf01be52c6693594b6a6d.jpg/w700d1q75cms.jpg',
+                                price: 8.60,
+                                num: 2,
+                                quality: '中等'
+                            }
+                        ]
+                    },
+                    {
+                        orderNo: 'SN1893294923004',
+                        status: 3, // 待发货
+                        totalPrice: 17.2,
+                        realPayPrice: 17.2,
+                        goodsList: [
+                            { cover: 'https://k.sinaimg.cn/n/sinakd20116/234/w1000h1634/20251003/b66b-587c9ff400fcf01be52c6693594b6a6d.jpg/w700d1q75cms.jpg' }, { cover: 'https://k.sinaimg.cn/n/sinakd20116/234/w1000h1634/20251003/b66b-587c9ff400fcf01be52c6693594b6a6d.jpg/w700d1q75cms.jpg' }, { cover: 'https://k.sinaimg.cn/n/sinakd20116/234/w1000h1634/20251003/b66b-587c9ff400fcf01be52c6693594b6a6d.jpg/w700d1q75cms.jpg' }
+                        ]
+                    },
+                    {
+                        orderNo: 'SN1893294923005',
+                        status: -1, // 已取消
+                        totalPrice: 17.2,
+                        realPayPrice: 17.2,
+                        goodsList: [
+                            {
+                                title: '马克思主义基本原理',
+                                cover: 'https://k.sinaimg.cn/n/sinakd20116/234/w1000h1634/20251003/b66b-587c9ff400fcf01be52c6693594b6a6d.jpg/w700d1q75cms.jpg',
+                                price: 8.60,
+                                num: 2,
+                                quality: '中等'
+                            }
+                        ]
+                    }
+                ];
 
-            if (!status) return allOrders;
-            return allOrders.filter(o => o.status == status);
+                if (!status) return allOrders;
+                return allOrders.filter(o => o.status == status);
+            }
         }
     }
-}
 </script>
 
 <style lang="scss" scoped>
-.my-order-page {
-    min-height: 100vh;
-    background-color: #F5F5F5;
+    .my-order-page {
+        min-height: 100vh;
+        background-color: #F5F5F5;
 
-    .tabs-wrapper {
-        position: sticky;
-        top: 0;
-        z-index: 99;
-        background: #FFFFFF;
-        border-bottom: 1rpx solid #eee;
-    }
+        .tabs-wrapper {
+            position: sticky;
+            top: 0;
+            z-index: 99;
+            background: #FFFFFF;
+            border-bottom: 1rpx solid #eee;
+        }
 
-    .order-list-container {
-        padding: 20rpx;
+        .order-list-container {
+            padding: 20rpx;
+        }
     }
-}
 </style>

+ 292 - 170
pages-home/pages/book-order.vue

@@ -6,7 +6,7 @@
                 <image src="/pages-mine/static/adderss.png" style="width: 40rpx; height: 40rpx"></image>
                 <view class="flex-d flex-1 ml-24" style="margin-right: 90rpx">
                     <view class="flex-a flex-j-b mb-10">
-                        <view :style="titleStyle">货人:{{ defaultAddr.name }}</view>
+                        <view :style="titleStyle">货人:{{ defaultAddr.name }}</view>
                         <view :style="titleStyle">{{ defaultAddr.mobile }}</view>
                     </view>
                     <view :style="titleStyle">地址:{{ defaultAddr.fullAddress }}</view>
@@ -17,7 +17,7 @@
             <view class="flex-a flex-j-b" @click="handleAddress" v-else>
                 <view class="flex-a">
                     <u-icon name="plus-circle-fill" :size="48" color="#38C148" top="2"></u-icon>
-                    <view :style="titleStyle" class="ml-10 font-30">货地址</view>
+                    <view :style="titleStyle" class="ml-10 font-30">货地址</view>
                     <text class="u-required">*</text>
                 </view>
 
@@ -26,18 +26,40 @@
                     <u-icon name="arrow-right" :size="28" color="#666" top="4"></u-icon>
                 </view>
             </view>
+
+            <view class="free-pickup mb-20 mt-20">
+                <view class="pickup-title">免费上门取货</view>
+                <view class="pickup-desc">书嗨将预约指定快递上门取件,邮费由书嗨承担</view>
+            </view>
+            <view class="flex-a flex-j-b time-card" style="padding: 0 10rpx" @click="showTimePicker = true">
+                <view class="flex-a">
+                    <view :style="titleStyle" class="ml-10 font-28">取件时间</view>
+                    <text class="u-required">*</text>
+                </view>
+
+                <view class="flex-a">
+                    <view v-if="selectedTime.day" :style="titleStyle" class="ml-10">{{ selectedTime.day }}
+                        {{ selectedTime.time }}
+                    </view>
+                    <view v-else :style="titleStyle" class="ml-10">请选择快递上门取件时间</view>
+                    <u-icon name="arrow-right" :size="28" color="#666" top="4"></u-icon>
+                </view>
+            </view>
         </view>
 
-        <!-- 备注部分 -->
+        <!-- 快递备注部分 -->
         <view class="section-card">
-            <view class="flex-a flex-j-b mb-20">
+            <view class="flex-a flex-j-b mb-20" @click="showExpressPicker">
                 <view class="flex-a">
-                    <view :style="titleStyle" class="font-28">订单备注</view>
+                    <view :style="titleStyle" class="font-28">快递备注</view>
                 </view>
-                <view class="flex-a" style="flex: 1; justify-content: flex-end;">
-                    <u-input v-model="submitData.remark" type="text" placeholder="选填,请先和商家协商一致" :custom-style="{textAlign: 'right'}" />
+
+                <view class="flex-a">
+                    <view :style="titleStyle" class="ml-10">{{ submitData.expressDelivery || "请选择" }}</view>
+                    <u-icon name="arrow-right" :size="28" color="#666" top="3"></u-icon>
                 </view>
             </view>
+            <view class="express-desc">请从【顺丰】或【京东】中选择可正常收寄的快递,如您不选择,则由系统根据区域情况自动分配</view>
         </view>
 
         <!-- 书籍列表 -->
@@ -47,195 +69,295 @@
 
         <!-- 底部栏 -->
         <view class="bottom-bar">
+            <view class="agreement">
+                <u-checkbox v-model="agreed" shape="circle">
+                    <text class="agreement-text">我已阅读并同意</text>
+                    <text class="agreement-link" @click="goToAgreement">《书嗨用户协议》</text>
+                </u-checkbox>
+            </view>
             <view class="order-summary">
                 <view class="total">
-                    共<text class="price">{{ totalNum }}</text>件 
-                    合计: <text class="price">¥{{ totalMoney }}</text>
-                    <text v-if="totalDiscount > 0" style="font-size: 24rpx; color: #999; margin-left: 10rpx;">(已优惠 ¥{{ totalDiscount }})</text>
+                    共<text class="price">{{ totalNum }}</text>件 预估回收价
+                    <text class="price">¥{{ totalRecycleMoney }}</text>
+                    <u-icon name="question-circle-fill" color="#333333" size="36" @click="showRules"></u-icon>
                 </view>
                 <u-button type="primary" @click="submitOrder" :custom-style="{ margin: 0 }">提交订单</u-button>
             </view>
         </view>
 
-        <submit-confirm ref="submitConfirmDialog" @confirm="handleConfirmSubmit" title="确认提交订单" content="请确认收货地址和商品信息无误"></submit-confirm>
+        <!-- 添加快递选择器 -->
+        <u-picker v-model="showPicker" mode="selector" :range="expressList" @confirm="onExpressConfirm"
+            @cancel="showPicker = false" range-key="name"></u-picker>
+
+        <pickup-time-picker :show.sync="showTimePicker" @confirm="onTimeConfirm"></pickup-time-picker>
+
+        <submit-confirm ref="submitConfirmDialog" @confirm="handleConfirmSubmit"></submit-confirm>
     </view>
 </template>
 
 <script>
-import bookItem from "@/pages-home/components/BookItem.vue";
-import SubmitConfirm from "@/pages-home/components/SubmitConfirm.vue";
-
-export default {
-    components: {
-        bookItem,
-        SubmitConfirm,
-    },
-    data() {
-        return {
-            titleStyle: {
-                "font-family": "PingFang SC",
-                "font-weight": 400,
-                color: "#333333",
-            },
-            books: [],
-            defaultAddr: {},
-            cartIdList: [], // 接收参数
-            
-            submitData: {
-                cartIdList: [],
-                addressId: "",
-                remark: "",
-                userCouponIds: [],
-            },
-            
-            totalNum: 0,
-            totalMoney: 0,
-            totalDiscount: 0,
-        };
-    },
-    onLoad(options) {
-        if (options.cartIds) {
-            this.cartIdList = options.cartIds.split(',').map(Number);
-            this.submitData.cartIdList = this.cartIdList;
-            this.getPreSubmitOrder();
-        } else {
-            this.$u.toast('参数错误');
-            setTimeout(() => uni.navigateBack(), 1500);
-        }
-    },
-    methods: {
-        // 添加或者选择地址
-        handleAddress() {
-            uni.navigateTo({
-                url: `/pages-mine/pages/address/list?id=${this.defaultAddr.id}&isSelect=1`,
-            });
+    import bookItem from "@/pages-home/components/BookItem.vue";
+    import pickupTimePicker from "@/pages-home/components/PickupTimePicker.vue";
+    import SubmitConfirm from "@/pages-home/components/SubmitConfirm.vue";
+
+    export default {
+        components: {
+            bookItem,
+            pickupTimePicker,
+            SubmitConfirm,
         },
-        
-        submitOrder() {
-            if (!this.submitData.addressId) {
-                this.$u.toast("请选择收货地址");
-                return;
-            }
-            // 显示确认弹窗
-            this.$refs.submitConfirmDialog.openPopup();
+        data() {
+            return {
+                titleStyle: {
+                    "font-family": "PingFang SC",
+                    "font-weight": 400,
+                    color: "#333333",
+                },
+                agreed: false,
+                books: [],
+
+                showPicker: false,
+                expressList: [],
+                showTimePicker: false,
+                selectedTime: {},
+                defaultAddr: {},
+
+                submitData: {
+                    expressDelivery: "",
+                    orderId: "",
+                    addressId: "",
+                    schedulePickupStartTime: "",
+                    schedulePickupEndTime: "",
+                    expressDelivery: "",
+                    remark: "",
+                },
+                totalNum: 0,
+                totalRecycleMoney: 0,
+            };
         },
+        methods: {
+            showRules() {
+                uni.navigateTo({
+                    url: '/pages-mine/pages/rules-for-sellbooks'
+                })
+            },
+            //时间选择
+            onTimeConfirm(data) {
+                this.selectedTime = data;
+                //格式化提交数据的时间
+                let date = this.$u.timeFormat(data.date, "yyyy-mm-dd");
+                let times = data.time.split("-");
+
+                this.submitData.schedulePickupStartTime = `${date} ${times[0]}`;
+                this.submitData.schedulePickupEndTime = `${date} ${times[1]}`;
+                console.log(date, this.submitData, "data");
+            },
+
+            //打开快递选择器
+            showExpressPicker() {
+                this.showPicker = true;
+            },
+            //确认选择快递
+            onExpressConfirm(e) {
+                if (!e.length) return;
+                let item = this.expressList[e[0]];
+                this.submitData.expressDelivery = item.name;
+                this.showPicker = false;
+            },
+            //添加或者选择地址
+            handleAddress() {
+                uni.navigateTo({
+                    url: `/pages-mine/pages/address/list?id=${this.defaultAddr.id}&isSelect=1`,
+                });
+            },
 
-        // 确认提交订单
-        handleConfirmSubmit() {
-            uni.showLoading({ title: '提交中' });
-            this.$u.api.submitShopOrderAjax(this.submitData).then((res) => {
-                uni.hideLoading();
-                if (res.code == 200) {
-                    // 支付逻辑待定,暂时跳转成功页或提示
-                    this.$u.toast('下单成功');
-                    setTimeout(() => {
-                        uni.redirectTo({
+            submitOrder() {
+                if (!this.submitData.addressId) {
+                    this.$u.toast("请选择取货地址");
+                    return;
+                }
+                if (!this.selectedTime.day) {
+                    this.$u.toast("请选择取件时间");
+                    return;
+                }
+                if (!this.agreed) {
+                    this.$u.toast("请先同意用户协议");
+                    return;
+                }
+                // 显示确认弹窗
+                this.$refs.submitConfirmDialog.openPopup();
+            },
+
+            // 确认提交订单
+            handleConfirmSubmit() {
+                // 处理订单提交
+                uni.$u.http.post("/token/order/submitOrder", this.submitData).then((res) => {
+                    if (res.code == 200) {
+                        uni.navigateTo({
                             url: "/pages-home/pages/order-success",
                         });
-                    }, 1000);
-                    uni.removeStorageSync("selectAddr");
-                } else {
-                    this.$u.toast(res.msg || '下单失败');
-                }
-            }).catch(() => {
-                uni.hideLoading();
-            });
-        },
-        
-        // 获取预提交订单信息
-        getPreSubmitOrder() {
-            uni.showLoading({ title: '加载中' });
-            this.$u.api.preSubmitOrderAjax({ 
-                cartIdList: this.cartIdList 
-            }).then((res) => {
-                uni.hideLoading();
-                if (res.code === 200) {
-                    const data = res.data;
-                    
-                    // 地址信息
-                    if (data.defaultAddress) {
-                        this.defaultAddr = data.defaultAddress;
+                        uni.removeStorageSync("selectAddr");
+                    } else {
+                        uni.showToast({
+                            title: res.msg,
+                            icon: "none",
+                        });
+                    }
+                });
+            },
+            //获取默认地址 /api/token/user/address/getDefault
+            getDefaultAddress() {
+                uni.$u.http.get("/token/user/address/getDefault").then((res) => {
+                    if (res.code == 200) {
+                        this.defaultAddr = res.data;
                         this.submitData.addressId = this.defaultAddr.id;
                     }
-                    
-                    // 商品列表
-                    this.books = data.orderDetailList || [];
-                    
-                    // 价格汇总
-                    this.totalMoney = data.totalMoney;
-                    this.totalDiscount = data.discountMoney || 0;
-                    this.totalNum = data.totalQuantity;
-                    
-                } else {
-                    this.$u.toast(res.msg || '获取订单信息失败');
-                }
-            }).catch(() => {
-                uni.hideLoading();
-            });
+                });
+            },
+            //获取当前用户未提交订单 /api/token/order/lastOrder
+            getLastOrder() {
+                uni.$u.http.get("/token/order/lastOrder").then((res) => {
+                    if (res.code == 200) {
+                        this.books = res.data?.orderDetailList
+                            ? res.data.orderDetailList?.map((v) => {
+                                v.orderId = res.data.orderId;
+                                return v;
+                            })
+                            : [];
+
+                        this.submitData.orderId = this.books[0].orderId;
+                    }
+                });
+            },
+            //获取预提交订单
+            getPreSubmitOrder() {
+                let orderId = uni.getStorageSync("orderId");
+                uni.$u.http.get("/token/order/preSubmit?orderId=" + orderId).then((res) => {
+                    this.submitData.orderId = orderId;
+                    this.defaultAddr = res.data.defaultAddress;
+                    this.submitData.addressId = this.defaultAddr.id;
+
+                    this.books = res.data.orderDetailList;
+                    this.expressList = res.data.expressTypes.map((v) => ({
+                        name: v,
+                    }));
+
+                    this.totalRecycleMoney = res.data.totalRecycleMoney;
+                    this.totalNum = res.data.totalNum;
+                });
+            },
+            goToAgreement() {
+                uni.navigateTo({
+                    url: "/pages-home/pages/user-agreement",
+                });
+            },
         },
-    },
-    
-    onShow() {
-        let selectAddr = uni.getStorageSync("selectAddr");
-        if (selectAddr) {
-            this.defaultAddr = selectAddr;
-            this.submitData.addressId = selectAddr.id;
-        }
-    },
-};
+        mounted() {
+            this.getPreSubmitOrder();
+        },
+
+        onShow() {
+            let selectAddr = uni.getStorageSync("selectAddr");
+            if (selectAddr) {
+                this.defaultAddr = selectAddr;
+                this.submitData.addressId = selectAddr.id;
+            }
+
+            //处理从/pages-home/pages/order-success页面返回的情况,在执行返回一级页面
+            let pages = getCurrentPages();
+            let currentPage = pages[pages.length - 1];
+            console.log(pages, currentPage, "currentPage");
+            if (currentPage.route == "pages-home/pages/order-success") {
+                uni.navigateBack({
+                    delta: 1,
+                });
+            }
+        },
+    };
 </script>
 
 <style lang="scss">
-.book-order {
-    min-height: 100vh;
-    background: #f5f5f5;
-    padding: 20rpx 30rpx;
-    padding-bottom: calc(env(safe-area-inset-bottom) + 120rpx);
-}
-
-.section-card {
-    background: #fff;
-    margin-bottom: 20rpx;
-    padding: 30rpx;
-    border-radius: 10rpx;
-    box-sizing: border-box;
-}
-
-.u-required {
-    color: #ff0000;
-    margin-left: 8rpx;
-}
-
-.book-list {
-    margin-bottom: 20rpx;
-}
-
-.bottom-bar {
-    position: fixed;
-    bottom: 0;
-    left: 0;
-    right: 0;
-    background: #fff;
-    padding: 20rpx 30rpx;
-    padding-bottom: env(safe-area-inset-bottom);
-    box-shadow: 0 -2rpx 10rpx rgba(0,0,0,0.05);
-
-    .order-summary {
-        display: flex;
-        justify-content: space-between;
-        align-items: center;
-
-        .total {
+    .book-order {
+        min-height: 100vh;
+        background: #f5f5f5;
+        padding: 20rpx 30rpx;
+        padding-bottom: calc(env(safe-area-inset-bottom) + 190rpx);
+    }
+
+    .section-card {
+        background: #fff;
+        margin-bottom: 20rpx;
+        padding: 30rpx;
+        border-radius: 10rpx;
+        box-sizing: border-box;
+    }
+
+    .u-required {
+        color: #ff0000;
+        margin-left: 8rpx;
+    }
+
+    .time-card {
+        height: 80rpx;
+        background: #f8f8f8;
+        border-radius: 10rpx;
+    }
+
+    .free-pickup {
+        .pickup-title {
+            font-weight: bold;
+            font-size: 28rpx;
+            color: #333333;
+            margin-bottom: 10rpx;
+        }
+
+        .pickup-desc {
+            font-family: PingFang SC;
+            font-weight: 400;
+            font-size: 28rpx;
+            color: #999999;
+        }
+    }
+
+    .express-desc {
+        font-size: 24rpx;
+        color: #666;
+        line-height: 1.4;
+    }
+
+    .bottom-bar {
+        position: fixed;
+        bottom: 0;
+        left: 0;
+        right: 0;
+        background: #fff;
+        padding: 20rpx 30rpx;
+        padding-bottom: env(safe-area-inset-bottom);
+
+        .agreement {
+            font-family: PingFang SC;
+            font-weight: 500;
+            font-size: 28rpx;
+            color: #333333;
+
+            &-link {
+                color: #07c160;
+            }
+        }
+
+        .order-summary {
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+            font-family: PingFang SC;
+            font-weight: 500;
             font-size: 28rpx;
-            color: #333;
-            
+            color: #999999;
+
             .price {
                 color: #ff0000;
-                font-size: 32rpx;
-                font-weight: bold;
-                margin: 0 8rpx;
+                margin: 0 10rpx;
             }
         }
     }
-}
 </style>

+ 1 - 1
pages-sell/components/detail/footer-bar.vue

@@ -59,7 +59,7 @@ export default {
 	justify-content: space-between;
 	padding: 0 20rpx;
 	box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
-	z-index: 100;
+	z-index: 3;
 	padding-bottom: env(safe-area-inset-bottom);
 
 	.icons-area {

+ 5 - 5
pages-sell/components/detail/info-card.vue

@@ -1,20 +1,20 @@
 <template>
 	<view class="info-card">
 		<view class="title-row">
-			<text class="book-title">{{ product.title }}</text>
+			<text class="book-title">{{ product.bookName }}</text>
 		</view>
 		
 		<view class="price-row">
 			<text class="currency">¥</text>
-			<text class="price">{{ product.price }}</text>
-			<view class="balance-tag">
-				<text>余额价 {{ product.balancePrice }}</text>
+			<text class="price">{{ product.sellPrice || product.price }}</text>
+			<view class="balance-tag" v-if="product.balanceMoney">
+				<text>余额价 {{ product.balanceMoney }}</text>
 			</view>
 		</view>
 		
 		<view class="meta-row">
 			<text class="label">原价:</text>
-			<text class="original-price">¥{{ product.originalPrice }}</text>
+			<text class="original-price">¥{{ product.price }}</text>
 		</view>
 		
 		<view class="author-row">

+ 13 - 13
pages-sell/components/detail/poster-popup.vue

@@ -151,7 +151,7 @@ export default {
 				const titleFontSize = 34 * scale;
 				ctx.setFontSize(titleFontSize);
 				ctx.font = `bold ${titleFontSize}px sans-serif`; 
-				const title = this.product.title || '未知书名';
+				const title = this.product.bookName || '未知书名';
 				// Width constraint: Canvas width - 2*contentPadding
 				const lastTitleY = this.drawText(ctx, title, contentPadding, currentY, width - 2 * contentPadding, titleFontSize * 1.5);
 				currentY = lastTitleY + 60 * scale;
@@ -169,29 +169,29 @@ export default {
 				const priceFontSize = 44 * scale;
 				ctx.setFontSize(priceFontSize);
 				ctx.font = `bold ${priceFontSize}px sans-serif`;
-				const price = `¥ ${this.product.balancePrice || '0.00'}`;
+				const price = `¥ ${this.product.balanceMoney || '0.00'}`;
 				const priceWidth = ctx.measureText(price).width;
 				ctx.fillText(price, contentPadding, currentY);
 				
 				// Discount Tag
-				const discount = '5.3折'; 
-				const tagX = contentPadding + priceWidth + 16 * scale;
-				const tagY = currentY - 26 * scale;
+				// const discount = '5.3折'; 
+				// const tagX = contentPadding + priceWidth + 16 * scale;
+				// const tagY = currentY - 26 * scale;
 				
-				ctx.setFillStyle('#D81A00');
-				this.roundRect(ctx, tagX, tagY, 70 * scale, 32 * scale, 4 * scale, '#D81A00');
+				// ctx.setFillStyle('#D81A00');
+				// this.roundRect(ctx, tagX, tagY, 70 * scale, 32 * scale, 4 * scale, '#D81A00');
 				
-				ctx.setFillStyle('#FFFFFF');
-				ctx.setFontSize(20 * scale);
-				ctx.font = `normal ${20 * scale}px sans-serif`;
-				ctx.fillText(discount, tagX + 8 * scale, tagY + 22 * scale);
+				// ctx.setFillStyle('#FFFFFF');
+				// ctx.setFontSize(20 * scale);
+				// ctx.font = `normal ${20 * scale}px sans-serif`;
+				// ctx.fillText(discount, tagX + 8 * scale, tagY + 22 * scale);
 				
 				// Original Price
 				ctx.setFillStyle('#999999');
 				ctx.setFontSize(26 * scale);
 				ctx.font = `normal ${26 * scale}px sans-serif`;
-				const origPrice = `原价: ¥ ${this.product.originalPrice || '0.00'}`;
-				ctx.fillText(origPrice, tagX + 90 * scale, currentY);
+				const origPrice = `原价: ¥ ${this.product.price || '0.00'}`;
+				ctx.fillText(origPrice, contentPadding + priceWidth + 20 * scale, currentY);
 				
 				// Divider
 				const footerHeight = 180 * scale;

+ 8 - 8
pages-sell/components/detail/product-content.vue

@@ -5,13 +5,13 @@
 			<!-- Basic Info List -->
 			<view class="section-title">基本信息</view>
 			<view class="info-list">
-				<view class="info-item"><text class="label">书名:</text><text>{{ product.title }}</text></view>
-				<view class="info-item"><text class="label">作者:</text><text>{{ product.authorFull }}</text></view>
-				<view class="info-item"><text class="label">出版社:</text><text>{{ product.publisher }}</text></view>
-				<view class="info-item"><text class="label">出版日期:</text><text>{{ product.publishDate }}</text></view>
+				<view class="info-item"><text class="label">书名:</text><text>{{ product.bookName }}</text></view>
+				<view class="info-item"><text class="label">作者:</text><text>{{ product.author }}</text></view>
+				<view class="info-item"><text class="label">出版社:</text><text>{{ product.publish }}</text></view>
+				<!-- <view class="info-item"><text class="label">出版日期:</text><text>{{ product.publishDate }}</text></view> -->
 				<view class="info-item"><text class="label">ISBN:</text><text>{{ product.isbn }}</text></view>
-				<view class="info-item"><text class="label">纸张:</text><text>胶版纸</text></view>
-				<view class="info-item"><text class="label">开本:</text><text>16开</text></view>
+				<view class="info-item"><text class="label">纸张:</text><text>{{ product.bookPack || '胶版纸' }}</text></view>
+				<view class="info-item"><text class="label">开本:</text><text>{{ product.bookFormat || '16开' }}</text></view>
 			</view>
 
 			<u-gap height="30"></u-gap>
@@ -19,7 +19,7 @@
 			<!-- Intro Section -->
 			<view class="section-title">内容简介</view>
 			<view class="text-content">
-				{{ product.intro }}
+				{{ product.contentBlurb || '暂无简介' }}
 			</view>
 			
 			<u-gap height="30"></u-gap>
@@ -27,7 +27,7 @@
 			<!-- Catalog Section -->
 			<view class="section-title">目录</view>
 			<view class="text-content">
-				{{ product.catalog }}
+				{{ product.catalog || '暂无目录' }}
 			</view>
 
 			<!-- Product Tips Component -->

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

@@ -1,5 +1,5 @@
 <template>
-	<view class="recommend-item">
+	<view class="recommend-item" @click="handleClick">
 		<!-- Main Info Row -->
 		<view class="main-info" :style="{ 'margin-bottom': showDesc ? '30rpx' : '0' }">
 			<image :src="item.cover" class="book-cover" mode="aspectFill"></image>
@@ -81,6 +81,12 @@ export default {
 		onPopupConfirm(data) {
 			// Emit the confirmed data
 			this.$emit('add-cart', data);
+		},
+		//图书详情页
+		handleClick() {
+			uni.navigateTo({
+				url: '/pages-sell/pages/detail?isbn=' + this.item.isbn
+			});
 		}
 	}
 }

+ 3 - 1
pages-sell/components/select-good-popup/index.vue

@@ -190,7 +190,9 @@
 							quantity: this.quantity
 						});
 						this.close();
-					}
+					} else {
+                        this.$u.toast(res.msg || '加入购物车失败');
+                    }
 				});
 			},
 			toNumber(value) {

+ 115 - 144
pages-sell/components/sell-container/index.vue

@@ -43,9 +43,9 @@
 				<view class="grid-item" v-for="(item, index) in categoryList" :key="index"
 					@click="handleCategory(item)">
 					<view class="icon-circle">
-						<image :src="item.icon" class="cat-icon" mode="aspectFit"></image>
+						<image :src="item.imgUrl" class="cat-icon" mode="aspectFit"></image>
 					</view>
-					<text class="cat-name">{{ item.name }}</text>
+					<text class="cat-name">{{ item.showCateName || '-' }}</text>
 				</view>
 			</view>
 
@@ -54,7 +54,7 @@
 				<!-- 左侧:推广卖书 -->
 				<view class="card-left">
 					<view class="card-content">
-						<u-swiper :list="swiperList"></u-swiper>
+						<u-swiper :list="swiperList" :autoplay="true" :interval="3000" name="imgUrl"></u-swiper>
 					</view>
 				</view>
 
@@ -67,8 +67,7 @@
 					</view>
 					<view class="products-container">
 						<!-- 使用网络图片作为书的封面占位 -->
-						<image :src="bookCoverUrl" class="product-cover" mode="aspectFill"></image>
-						<image :src="bookCoverUrl" class="product-cover" mode="aspectFill"></image>
+						<image v-for="(item, index) in bookList" :key="index" :src="item.imgUrl" class="product-cover" mode="aspectFill" @click="navigateTo(item.jumpUrl)"></image>
 					</view>
 				</view>
 			</view>
@@ -106,7 +105,7 @@
 			</view>
 
 			<!-- 书嗨推荐 -->
-			<view class="recommend-section" @click="navigateTo('/pages-sell/pages/recommend')">
+			<view class="recommend-section" @click="navigateTo(item.jumpUrl)" v-for="(item, index) in topicList" :key="index">
 				<view class="section-header">
 					<text class="section-title">书嗨推荐</text>
 					<view class="view-more">
@@ -115,54 +114,23 @@
 					</view>
 				</view>
 
-				<scroll-view scroll-x class="book-scroll" :show-scrollbar="false">
-					<view class="book-list">
-						<view class="book-item" v-for="(book, index) in recommendBooks" :key="index">
-							<image :src="book.cover" class="book-image" mode="aspectFill"></image>
-							<text class="book-name">{{ book.title }}</text>
-							<view class="price-row">
-								<text class="currency">¥</text>
-								<text class="price-val">{{ book.price }}</text>
-								<text class="price-old">¥{{ book.original }}</text>
-							</view>
-							<view class="add-btn">
-								<text>加入购物车</text>
-								<image src="/pages-sell/static/shape-10.png" class="cart-symbol"></image>
-							</view>
+				<view class="book-list">
+					<view class="book-item" v-for="(book, index) in getDisplayBooks(item)" :key="index" @click="navigateTo('/pages-sell/pages/detail?isbn=' + book.bookIsbn)">
+						<image :src="book.bookImg" class="book-image" mode="aspectFill"></image>
+						<text class="book-name">{{ book.bookName }}</text>
+						<view class="price-row">
+							<text class="currency">¥</text>
+							<text class="price-val">{{ book.bookPrice }}</text>
+							<text class="price-old">¥{{ book.bookOriginalPrice }}</text>
 						</view>
-					</view>
-				</scroll-view>
-			</view>
-
-			<view class="recommend-section" @click="navigateTo('/pages-sell/pages/topic')">
-				<view class="section-header">
-					<text class="section-title">大学四六级推荐</text>
-					<view class="view-more">
-						<text>查看全部</text>
-						<image src="/pages-sell/static/right-arrow.png" class="arrow-icon" mode="widthFix"></image>
-					</view>
-				</view>
-
-				<scroll-view scroll-x class="book-scroll" :show-scrollbar="false">
-					<view class="book-list">
-						<view class="book-item" v-for="(book, index) in recommendBooks" :key="index"
-							@click="navigateTo('/pages-sell/pages/detail')">
-							<image :src="book.cover" class="book-image" mode="aspectFill"></image>
-							<text class="book-name">{{ book.title }}</text>
-							<view class="price-row">
-								<text class="currency">¥</text>
-								<text class="price-val">{{ book.price }}</text>
-								<text class="price-old">¥{{ book.original }}</text>
-							</view>
-							<view class="add-btn">
-								<text>加入购物车</text>
-								<image src="/pages-sell/static/shape-10.png" class="cart-symbol"></image>
-							</view>
+						<view class="add-btn">
+							<text>加入购物车</text>
+							<image src="/pages-sell/static/shape-10.png" class="cart-symbol"></image>
 						</view>
 					</view>
-				</scroll-view>
+				</view>
 			</view>
-
+		
 			<!-- 底部留白,防止遮挡 -->
 			<view class="bottom-safe-area"></view>
 		</view>
@@ -181,17 +149,7 @@
 					position: 'relative',
 					top: '-6rpx',
 				},
-				swiperList: [
-					{
-						image: '/pages-sell/static/banner-3.png'
-					},
-					{
-						image: '/pages-sell/static/banner-1.png'
-					},
-					{
-						image: '/pages-sell/static/banner-2.png'
-					}
-				],
+				swiperList: [],
 				statusBarHeight: 20,
 				keyword: '',
 				// u-tabs 需要对象数组 [{name: 'xxx'}]
@@ -206,23 +164,14 @@
 				currentHotTag: 0,
 				// 临时的网络书封面图片
 				bookCoverUrl: 'https://img.yzcdn.cn/vant/cat.jpeg',
-				categoryList: [
-					{ name: '热销榜单', icon: '/pages-sell/static/icon-hot-sales.png' },
-					{ name: '心灵 / 成长', icon: '/pages-sell/static/icon-heart-growth.png' },
-					{ name: '诺贝尔文学奖', icon: '/pages-sell/static/icon-nobel.png' },
-					{ name: '茅盾文学奖', icon: '/pages-sell/static/icon-maodun.png' },
-					{ name: '樊登书单', icon: '/pages-sell/static/icon-fandeng.png' },
-					{ name: '东野圭吾', icon: '/pages-sell/static/icon-dongye.png' },
-					{ name: '余华', icon: '/pages-sell/static/icon-yuhua.png' },
-					{ name: '村上春树', icon: '/pages-sell/static/icon-haruki.png' },
-					{ name: '童书', icon: '/pages-sell/static/icon-children.png' },
-					{ name: '书嗨推荐', icon: '/pages-sell/static/icon-recommend.png' }
-				],
+				categoryList: [], //金刚区
+				bookList: [], // 右侧推荐书籍
 				recommendBooks: [
 					{ title: '山河岁月', price: '6.80', original: '36.80', cover: 'https://img.yzcdn.cn/vant/cat.jpeg' },
 					{ title: '山河岁月', price: '6.80', original: '36.80', cover: 'https://img.yzcdn.cn/vant/cat.jpeg' },
 					{ title: '山河岁月', price: '6.80', original: '36.80', cover: 'https://img.yzcdn.cn/vant/cat.jpeg' }
-				]
+				],
+				topicList:[], //专题推荐 
 			}
 		},
 		created() {
@@ -233,7 +182,8 @@
 		},
 		methods: {
 			handleCategory(item) {
-				console.log('点击分类:', item.name);
+				if(!item.jumpUrl) return
+				this.navigateTo(item.jumpUrl)
 			},
 			changeHotTag(index) {
 				this.currentHotTag = index;
@@ -241,6 +191,8 @@
 			},
 			//跳转 URL
 			navigateTo(url) {
+				if(!url) return
+				console.log(url)
 				uni.navigateTo({
 					url: url
 				});
@@ -262,8 +214,30 @@
 					console.log(res)
 					if (res.code == 200) {
 						console.log(res.data)
+						this.categoryList = res.data.find(item => item.position == 'diamond_area')?.shopIndexCateVo || []
+						this.swiperList = res.data.find(item => item.position == 'left_banner')?.shopIndexCateVo || []
+						this.bookList = res.data.find(item => item.position == 'right_banner')?.shopIndexCateVo || []
+
+						//获取单排专题推荐
+						let single_row_topic = res.data.find(item => item.position == 'single_row_topic')?.shopIndexCateVo || []
+						single_row_topic.forEach(item => item.positionType = 'single_row_topic')
+						
+						//获取双排专题推荐
+						let double_row_topic = res.data.find(item => item.position == 'double_row_topic')?.shopIndexCateVo || []
+						double_row_topic.forEach(item => item.positionType = 'double_row_topic')
+						
+						this.topicList = [...single_row_topic, ...double_row_topic]
+						console.log(this.topicList)
 					}
 				})
+			},
+			getDisplayBooks(item) {
+				if (!item.bookInfoList) return []
+				let limit = 3
+				if (item.positionType === 'double_row_topic') {
+					limit = 6
+				}
+				return item.bookInfoList.slice(0, limit)
 			}
 		}
 	}
@@ -613,6 +587,7 @@
 		background-color: #fff;
 		border-radius: 20rpx;
 		padding: 30rpx;
+		margin-bottom: 24rpx;
 
 		.section-header {
 			display: flex;
@@ -639,90 +614,86 @@
 			}
 		}
 
-		.book-scroll {
-			width: 100%;
-			white-space: nowrap;
+		.book-list {
+			display: flex;
+			flex-wrap: wrap;
+			justify-content: space-between;
+		}
 
-			.book-list {
-				display: flex;
-				padding-bottom: 10rpx;
-			}
+		.book-item {
+			width: 200rpx;
+			margin-bottom: 24rpx;
+			display: flex;
+			flex-direction: column;
 
-			.book-item {
+			.book-image {
 				width: 200rpx;
-				margin-right: 24rpx;
+				height: 255rpx;
+				border-radius: 2rpx;
+				margin-bottom: 16rpx;
+				background-color: #f9f9f9;
+			}
+
+			.book-name {
+				font-family: 'Source Han Sans SC';
+				font-weight: bold;
+				font-size: 28rpx;
+				color: #303030;
+				margin-bottom: 10rpx;
+				overflow: hidden;
+				text-overflow: ellipsis;
+				white-space: nowrap;
+			}
+
+			.price-row {
 				display: flex;
-				flex-direction: column;
+				align-items: baseline;
+				margin-bottom: 12rpx;
 
-				.book-image {
-					width: 200rpx;
-					height: 255rpx;
-					border-radius: 2rpx;
-					margin-bottom: 16rpx;
-					background-color: #f9f9f9;
+				.currency {
+					font-family: 'Source Han Sans SC';
+					font-weight: 500;
+					font-size: 22rpx;
+					color: #D81A00;
 				}
 
-				.book-name {
+				.price-val {
 					font-family: 'Source Han Sans SC';
-					font-weight: bold;
+					font-weight: 500;
 					font-size: 28rpx;
-					color: #303030;
-					margin-bottom: 10rpx;
-					overflow: hidden;
-					text-overflow: ellipsis;
-					white-space: nowrap;
+					color: #D81A00;
+					margin-right: 12rpx;
 				}
 
-				.price-row {
-					display: flex;
-					align-items: baseline;
-					margin-bottom: 12rpx;
-
-					.currency {
-						font-family: 'Source Han Sans SC';
-						font-weight: 500;
-						font-size: 22rpx;
-						color: #D81A00;
-					}
+				.price-old {
+					font-family: 'Source Han Sans SC';
+					font-weight: 500;
+					font-size: 22rpx;
+					color: #999999;
+					text-decoration: line-through;
+				}
+			}
 
-					.price-val {
-						font-family: 'Source Han Sans SC';
-						font-weight: 500;
-						font-size: 28rpx;
-						color: #D81A00;
-						margin-right: 12rpx;
-					}
+			.add-btn {
+				width: fit-content;
+				height: 36rpx;
+				line-height: 36rpx;
+				background: linear-gradient(0deg, #4ED964 0%, #4ED964 100%);
+				border-radius: 18rpx;
+				padding: 0 20rpx;
+				display: flex;
+				align-items: center;
+				justify-content: center;
 
-					.price-old {
-						font-family: 'Source Han Sans SC';
-						font-weight: 500;
-						font-size: 22rpx;
-						color: #999999;
-						text-decoration: line-through;
-					}
+				text {
+					font-size: 22rpx;
+					color: #fff;
 				}
 
-				.add-btn {
-					width: fit-content;
-					height: 36rpx;
-					line-height: 36rpx;
-					background: linear-gradient(0deg, #4ED964 0%, #4ED964 100%);
-					border-radius: 18rpx;
-					padding: 0 20rpx;
-					display: flex;
-					align-items: center;
-					justify-content: center;
-
-					text {
-						font-size: 22rpx;
-						color: #fff;
-					}
-
-					.cart-symbol {
-						width: 24rpx;
-						height: 24rpx;
-						margin-left: 6rpx;
-					}
+				.cart-symbol {
+					width: 24rpx;
+					height: 24rpx;
+					margin-left: 6rpx;
 				}
 			}
 		}

+ 38 - 25
pages-sell/pages/detail.vue

@@ -4,7 +4,7 @@
         <view class="header-bg"></view>
 
         <!-- Custom Navbar -->
-        <Navbar title="非暴力沟通" :titleSize="32" title-color="#fff" back-icon-color="#fff" background="transparent">
+        <Navbar :title="product.bookName || '详情'" :titleSize="32" title-color="#fff" back-icon-color="#fff" background="transparent">
         </Navbar>
 
         <!-- Notification Bar -->
@@ -109,35 +109,14 @@ export default {
     data() {
         return {
             currentTab: 0,
-            hasStock: true, // Toggle this to test stock status
+            hasStock: false, // Toggle this to test stock status
             tipsContent: [
                 '印刷版次较多,二手图书封面、版次、原价等信息可能与商品介绍有差异,具体以收到实物为准;',
                 '二手图书性质特殊,不保证随新书赠送的光盘、海报、卡片等内容,仅支持图书质量问题退款,否则将扣除运费成本;',
                 '收到的图书如有质量问题,请于七天内联系客服处理,超出售后时效,不予处理。'
             ],
-            relatedBooksList: [
-                { title: '工程数学线性代数第六版', edition: '同济大学数学系编', cover: 'https://img.yzcdn.cn/vant/cat.jpeg' },
-                { title: '高等数学第七版(上册)', edition: '同济大学数学系', cover: 'https://img.yzcdn.cn/vant/cat.jpeg' },
-                { title: 'C++ Primer Plus', edition: '第6版 中文版', cover: 'https://img.yzcdn.cn/vant/cat.jpeg' },
-                { title: '深入理解计算机系统', edition: '原书第3版', cover: 'https://img.yzcdn.cn/vant/cat.jpeg' },
-                { title: '算法导论', edition: '原书第3版', cover: 'https://img.yzcdn.cn/vant/cat.jpeg' },
-                { title: 'Java编程思想', edition: '第4版', cover: 'https://img.yzcdn.cn/vant/cat.jpeg' }
-            ],
-            product: {
-                id: 1,
-                title: '非暴力沟通',
-                author: '美 · 马歇尔 XXXX',
-                authorFull: '马歇尔·卢森堡著 阮胤华',
-                price: '13.80',
-                balancePrice: '6.8',
-                originalPrice: '36.80',
-                cover: 'https://img.yzcdn.cn/vant/cat.jpeg', // Using placeholder for now
-                publisher: '华夏出版社',
-                publishDate: '2018-08',
-                isbn: '9787508095226',
-                intro: '作为一个遵纪守法的好人,也许我们从来没有把谈话和“暴力”扯上关系。不过如果稍微留意一下现实生活中的谈话方式,并且用心体会各种谈话方式给我们的不同感受,我们一定会发现,有些话确实伤人!言语上的指责、嘲讽、否定、说教以及任意打断、拒不回应、随意出口的评价和结论给我们带来的情感和精神上的创伤甚至比肉体的伤害更加令人痛苦。',
-                catalog: '前言\n第一章 让爱融入生活\n第二章 是什么蒙蔽了爱?\n第三章 区分观察和评论\n第四章 体会和表达感受\n第五章 感受的根源\n第六章 请求帮助\n...'
-            },
+            relatedBooksList: [],
+            product: {},
             servicePosition: {
                 left: "auto",
                 right: 0,
@@ -145,7 +124,41 @@ export default {
             },
         }
     },
+	onLoad(options) {
+		const isbn = options.isbn || options.id; // Support both just in case
+		if (isbn) {
+			this.getBookDetail(isbn);
+		} else {
+			uni.showToast({
+				title: '参数错误',
+				icon: 'none'
+			});
+			setTimeout(() => {
+				uni.navigateBack();
+			}, 1500);
+		}
+	},
     methods: {
+		getBookDetail(isbn) {
+			uni.showLoading({ title: '加载中' });
+			this.$u.api.getBookDetailAjax({ isbn }).then(res => {
+				uni.hideLoading();
+				if (res.code === 200) {
+					this.product = res.data;
+					this.hasStock = res.data.skuList.some(sku => sku.stockNum > 0);
+					if (res.data.recommendList) {
+						this.relatedBooksList = res.data.recommendList;
+					}
+				} else {
+					uni.showToast({
+						title: res.msg || '获取详情失败',
+						icon: 'none'
+					});
+				}
+			}).catch(() => {
+				uni.hideLoading();
+			});
+		},
         switchTab(index) {
             this.currentTab = index;
         },

+ 6 - 6
pages/mine/index.vue

@@ -187,35 +187,35 @@ export default {
 					icon: '/pages-car/static/my-order/icon-1.png',
 					badge: 0,
 					key: 'payNum',
-					path: '/pages-car/pages/my-order?status=2'
+					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=3'
+					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=8'
+					path: '/pages-car/pages/my-order?status=3'
 				},
 				{
-					name: '退款/售后',
+					name: '退款',
 					icon: '/pages-car/static/my-order/icon-4.png',
 					badge: 0,
 					key: 'refundNum',
-					path: '/pages-car/pages/my-order?status=10'
+					path: '/pages-car/pages/my-order?status=6'
 				},
 				{
 					name: '已完成',
 					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/5.png',
 					badge: 0,
 					key: 'completeNum',
-					path: '/pages-car/pages/my-order?status=12'
+					path: '/pages-car/pages/my-order?status=4'
 				}
 			],
 			tools: [