ソースを参照

feat(订单): 实现订单支付流程并优化订单列表

- 新增收银台页面,支持微信支付和余额支付
- 新增支付成功页面,提供订单查看和返回首页功能
- 优化订单列表组件,适配后端API数据结构
- 调整订单确认页面,跳转至收银台而非直接支付
- 减少提交确认弹窗的倒计时时间
- 更新订单状态映射逻辑,支持取消和退款状态
- 添加订单支付API接口
ylong 2 日 前
コミット
242a57ad2e

+ 3 - 0
api/modules/mall.js

@@ -186,5 +186,8 @@ export const useMallApi = (Vue, vm) => {
 
         // 图书商品详情页面
         getBookDetailAjax: (params) => vm.$u.get('/token/shop/bookDetail', params),
+
+        // 订单支付
+        payShopOrderAjax: (data) => vm.$u.post('/token/shop/order/orderPay', data),
 	}
 }

+ 69 - 127
pages-car/components/buy-order-item.vue

@@ -2,74 +2,64 @@
     <view class="buy-order-item" @click="goToDetail">
         <!-- 订单头部:订单号和状态 -->
         <view class="order-header">
-            <text class="order-no">{{ order.orderNo }}</text>
-            <text class="order-status">{{ getStatusText(order.status) }}</text>
+            <text class="order-no">订单号:{{ order.orderId }}</text>
+            <text class="order-status">{{ getStatusText(order) }}</text>
         </view>
 
         <!-- 商品信息 -->
         <view class="goods-list">
-            <!-- 单个商品 -->
-            <view v-if="order.goodsList && order.goodsList.length === 1" class="single-goods">
-                <image :src="order.goodsList[0].cover || defaultCover" mode="aspectFill" class="goods-cover"></image>
-                <view class="goods-info">
-                    <view class="goods-title">{{ order.goodsList[0].title }}</view>
-                    <view class="goods-quality">品相:{{ order.goodsList[0].quality || '中等' }}</view>
+            <scroll-view scroll-x class="goods-scroll">
+                <view class="goods-wrapper">
+                    <image v-for="(cover, index) in order.detailCoverList" :key="index" :src="cover || defaultCover"
+                        mode="aspectFill" class="goods-cover"></image>
                 </view>
-                <view class="goods-price-num">
-                    <view class="price">¥ {{ order.goodsList[0].price }}</view>
-                    <view class="num">x{{ order.goodsList[0].num }}</view>
-                </view>
-            </view>
-            <!-- 多个商品 -->
-            <view v-else class="multi-goods">
-                <scroll-view scroll-x class="goods-scroll">
-                    <view class="goods-wrapper">
-                        <image v-for="(goods, index) in order.goodsList" :key="index" :src="goods.cover || defaultCover"
-                            mode="aspectFill" class="goods-cover"></image>
-                    </view>
-                </scroll-view>
-            </view>
+            </scroll-view>
         </view>
 
         <!-- 价格汇总 -->
         <view class="order-total">
-            <text>总价 ¥{{ order.totalPrice }}</text>
-            <text class="ml-20">实付款 ¥{{ order.realPayPrice }}</text>
+            <text>共{{ order.totalNum }}本</text>
+            <text class="ml-20">实付款 ¥{{ order.payMoney || 0 }}</text>
         </view>
 
         <!-- 操作按钮 -->
         <view class="action-box">
-            <template v-if="order.status === 2"> <!-- 待付款 -->
-                <u-button size="mini" shape="circle" plain :custom-style="btnStyle" @click="handleAction('address')">修改地址</u-button>
-                <u-button size="mini" shape="circle" type="error" plain :custom-style="btnStyle" @click="handleAction('cancel')">取消订单</u-button>
-                <u-button size="mini" shape="circle" :custom-style="themeBtnStyle" @click="handleAction('pay')">付款</u-button>
+            <!-- 待付款 -->
+            <template v-if="order.status == '1' && order.cancelStatus == '0'">
+                <u-button size="mini" shape="circle" plain :custom-style="btnStyle" @click.stop="handleAction('address')">修改地址</u-button>
+                <u-button size="mini" shape="circle" type="error" plain :custom-style="btnStyle" @click.stop="handleAction('cancel')">取消订单</u-button>
+                <u-button size="mini" shape="circle" :custom-style="themeBtnStyle" @click.stop="handleAction('pay')">付款</u-button>
             </template>
-            <template v-else-if="order.status === 3"> <!-- 待发货 -->
-                <u-button size="mini" shape="circle" plain :custom-style="btnStyle" @click="handleAction('address')">修改地址</u-button>
-                <u-button size="mini" shape="circle" type="error" plain :custom-style="btnStyle" @click="handleAction('refund')">申请售后</u-button>
-                <u-button size="mini" shape="circle" type="warning" plain :custom-style="btnStyle" @click="handleAction('remind')">催发货</u-button>
+            <!-- 待发货 -->
+            <template v-else-if="order.status == '2' && order.refundStatus == '1' && order.cancelStatus == '0'">
+                <u-button size="mini" shape="circle" plain :custom-style="btnStyle" @click.stop="handleAction('address')">修改地址</u-button>
+                <u-button size="mini" shape="circle" type="error" plain :custom-style="btnStyle" @click.stop="handleAction('refund')">申请售后</u-button>
+                <u-button size="mini" shape="circle" type="warning" plain :custom-style="btnStyle" @click.stop="handleAction('remind')">催发货</u-button>
             </template>
-            <template v-else-if="order.status === 8"> <!-- 待收货/已发货 -->
-                <u-button size="mini" shape="circle" plain :custom-style="btnStyle" @click="handleAction('extend')">延长收货</u-button>
-                <u-button size="mini" shape="circle" plain :custom-style="btnStyle" @click="handleAction('invoice')">申请开票</u-button>
-                <u-button size="mini" shape="circle" plain :custom-style="btnStyle" @click="handleAction('complaint')">投诉</u-button>
-                <u-button size="mini" shape="circle" type="primary" plain :custom-style="btnStyle" @click="handleAction('logistics')">查看物流</u-button>
-                <u-button size="mini" shape="circle" :custom-style="themeBtnStyle" @click="handleAction('addToCart')">加入购物车</u-button>
-                <u-button size="mini" shape="circle" :custom-style="themeBtnStyle" @click="handleAction('confirm')">确认收货</u-button>
+            <!-- 待收货 -->
+            <template v-else-if="order.status == '3' && order.refundStatus == '1' && order.cancelStatus == '0'">
+                <u-button size="mini" shape="circle" plain :custom-style="btnStyle" @click.stop="handleAction('extend')">延长收货</u-button>
+                <u-button size="mini" shape="circle" plain :custom-style="btnStyle" @click.stop="handleAction('invoice')">申请开票</u-button>
+                <u-button size="mini" shape="circle" plain :custom-style="btnStyle" @click.stop="handleAction('complaint')">投诉</u-button>
+                <u-button size="mini" shape="circle" type="primary" plain :custom-style="btnStyle" @click.stop="handleAction('logistics')">查看物流</u-button>
+                <u-button size="mini" shape="circle" :custom-style="themeBtnStyle" @click.stop="handleAction('confirm')">确认收货</u-button>
             </template>
-            <template v-else-if="order.status === 12"> <!-- 已完成 -->
-                <u-button size="mini" shape="circle" :custom-style="themeBtnStyle" @click="handleAction('addToCart')">加入购物车</u-button>
-                <u-button size="mini" shape="circle" type="primary" plain :custom-style="btnStyle" @click="handleAction('rebuy')">再买一单</u-button>
-                <u-button size="mini" shape="circle" type="primary" plain :custom-style="btnStyle" @click="handleAction('evaluate')">评价</u-button>
-                <u-button size="mini" shape="circle" plain :custom-style="btnStyle" @click="handleAction('more', ['applyAfterSales', 'logistics', 'invoice'])">更多</u-button>
+            <!-- 已完成 -->
+            <template v-else-if="order.status == '4' && order.refundStatus == '1' && order.cancelStatus == '0'">
+                <u-button size="mini" shape="circle" :custom-style="themeBtnStyle" @click.stop="handleAction('addToCart')">加入购物车</u-button>
+                <u-button size="mini" shape="circle" type="primary" plain :custom-style="btnStyle" @click.stop="handleAction('rebuy')">再买一单</u-button>
+                <u-button size="mini" shape="circle" type="primary" plain :custom-style="btnStyle" @click.stop="handleAction('evaluate')">评价</u-button>
+                <u-button size="mini" shape="circle" plain :custom-style="btnStyle" @click.stop="handleAction('more', ['applyAfterSales', 'logistics', 'invoice'])">更多</u-button>
             </template>
-            <template v-else-if="order.status === 10"> <!-- 退款/售后 -->
-                <u-button size="mini" shape="circle" type="primary" plain :custom-style="btnStyle" @click="handleAction('moneyWhere')">钱款去向</u-button>
-                <u-button size="mini" shape="circle" type="primary" plain :custom-style="btnStyle" @click="handleAction('detail')">查看详情</u-button>
+            <!-- 退款/售后 -->
+            <template v-else-if="order.refundStatus != '1'">
+                <u-button size="mini" shape="circle" type="primary" plain :custom-style="btnStyle" @click.stop="handleAction('moneyWhere')">钱款去向</u-button>
+                <u-button size="mini" shape="circle" type="primary" plain :custom-style="btnStyle" @click.stop="handleAction('detail')">查看详情</u-button>
             </template>
-            <template v-else-if="order.status === -1"> <!-- 已取消 -->
-                <u-button size="mini" shape="circle" type="error" plain :custom-style="btnStyle" @click="handleAction('delete')">删除订单</u-button>
-                <u-button size="mini" shape="circle" :custom-style="themeBtnStyle" @click="handleAction('addToCart')">加入购物车</u-button>
+            <!-- 已取消 -->
+            <template v-else-if="order.cancelStatus == '1'">
+                <u-button size="mini" shape="circle" type="error" plain :custom-style="btnStyle" @click.stop="handleAction('delete')">删除订单</u-button>
+                <u-button size="mini" shape="circle" :custom-style="themeBtnStyle" @click.stop="handleAction('addToCart')">加入购物车</u-button>
             </template>
         </view>
     </view>
@@ -109,19 +99,21 @@ export default {
     methods: {
         goToDetail() {
             uni.navigateTo({
-                url: `/pages-car/pages/order-detail?orderNo=${this.order.orderNo}`
+                url: `/pages-car/pages/order-detail?orderId=${this.order.orderId}`
             })
         },
-        getStatusText(status) {
+        getStatusText(order) {
+            if (order.cancelStatus == '1') return '已取消';
+            if (order.refundStatus == '2') return '退款中';
+            if (order.refundStatus == '3') return '已退款';
+            
             const map = {
-                2: '待付款',
-                3: '待发货',
-                8: '待收货',
-                12: '已完成',
-                10: '退款/售后',
-                '-1': '已取消'
+                '1': '待付款',
+                '2': '待发货',
+                '3': '待收货',
+                '4': '已完成'
             }
-            return map[status] || '未知状态'
+            return map[order.status] || '未知状态'
         },
         handleAction(type, data) {
             this.$emit('action', { type, order: this.order, data })
@@ -156,77 +148,22 @@ export default {
     .goods-list {
         margin-bottom: 20rpx;
 
-        .single-goods {
-            display: flex;
-
-            .goods-cover {
-                width: 140rpx;
-                height: 170rpx;
-                border-radius: 8rpx;
-                margin-right: 20rpx;
-                flex-shrink: 0;
-                background-color: #eee;
-            }
-
-            .goods-info {
-                flex: 1;
-                margin-right: 20rpx;
-
-                .goods-title {
-                    font-size: 28rpx;
-                    color: #333;
-                    margin-bottom: 10rpx;
-                    display: -webkit-box;
-                    -webkit-box-orient: vertical;
-                    -webkit-line-clamp: 2;
-                    overflow: hidden;
-                }
-
-                .goods-quality {
-                    font-size: 24rpx;
-                    color: #999;
-                    background-color: #f5f5f5;
-                    padding: 4rpx 10rpx;
-                    border-radius: 4rpx;
-                    display: inline-block;
-                }
-            }
-
-            .goods-price-num {
-                text-align: right;
-
-                .price {
-                    font-size: 28rpx;
-                    color: #333;
-                    font-weight: 500;
-                }
-
-                .num {
-                    font-size: 24rpx;
-                    color: #999;
-                    margin-top: 6rpx;
-                }
-            }
+        .goods-scroll {
+            width: 100%;
+            white-space: nowrap;
         }
 
-        .multi-goods {
-            .goods-scroll {
-                width: 100%;
-                white-space: nowrap;
-            }
-
-            .goods-wrapper {
-                display: flex;
-            }
+        .goods-wrapper {
+            display: flex;
+        }
 
-            .goods-cover {
-                width: 140rpx;
-                height: 170rpx;
-                border-radius: 8rpx;
-                margin-right: 20rpx;
-                background-color: #eee;
-                display: inline-block;
-            }
+        .goods-cover {
+            width: 140rpx;
+            height: 170rpx;
+            border-radius: 8rpx;
+            margin-right: 20rpx;
+            background-color: #eee;
+            display: inline-block;
         }
     }
 
@@ -246,6 +183,11 @@ export default {
         display: flex;
         justify-content: flex-end;
         align-items: center;
+        flex-wrap: wrap; // 防止按钮过多换行问题
+        
+        u-button {
+             margin-bottom: 10rpx; // 如果换行,增加间距
+        }
 
         .status-desc {
             font-size: 26rpx;

+ 1 - 1
pages-car/components/submit-confirm.vue

@@ -57,7 +57,7 @@ export default {
             this.closePopup();
         },
         startCountdown() {
-            this.countdown = 15;
+            this.countdown = 3;
             const timer = setInterval(() => {
                 if (this.countdown > 0) {
                     this.countdown--;

+ 274 - 0
pages-car/pages/cashier-desk.vue

@@ -0,0 +1,274 @@
+<template>
+    <view class="cashier-desk">
+        <view class="view-top">
+        </view>
+        <view class="payment-methods">
+            <u-radio-group v-model="formData.payType" @change="radioGroupChange">
+                <!-- #ifdef MP-WEIXIN -->
+                <view class="payment-item">
+                    <view class="left">
+                        <image src="/pages-mine/static/pay1.png" class="payment-icon"></image>
+                        <text>微信支付</text>
+                    </view>
+                    <u-radio active-color="#38C148" name="2" />
+                </view>
+                <!-- #endif -->
+                <!-- #ifdef MP-ALIPAY -->
+                <view class="payment-item">
+                    <view class="left">
+                        <image src="/pages-mine/static/alipay.png" class="payment-icon"></image>
+                        <text>支付宝支付</text>
+                    </view>
+                    <u-radio active-color="#38C148" name="2" />
+                </view>
+                <!-- #endif -->
+
+                <view class="payment-item">
+                    <view class="left">
+                        <image src="/pages-mine/static/pay2.png" class="payment-icon"></image>
+                        <text>余额支付(余额{{ orderInfo.accountMoney || 0 }})</text>
+                    </view>
+                    <u-radio active-color="#38C148" name="1" />
+                </view>
+
+                <!-- <view class="payment-item">
+                    <view class="left">
+                        <image src="/pages-mine/static/pay2.png" class="payment-icon"></image>
+                        <text>组合支付</text>
+                    </view>
+                    <u-radio active-color="#38C148" name="3" />
+                </view> -->
+            </u-radio-group>
+        </view>
+
+        <view class="total">
+            <text>总计</text>
+            <text class="amount">¥ {{ formData.payType === '1' ? orderInfo.accountDiscountMoney : orderInfo.orderMoney }}</text>
+        </view>
+
+        <button class="confirm-btn" type="primary" @click="onConfirmPayment">确认支付</button>
+    </view>
+</template>
+
+<script>
+    export default {
+        data() {
+            return {
+                formData: {
+                    payType: '2',
+                    orderId: ''
+                },
+                orderInfo: {}
+            }
+        },
+        onLoad(options) {
+            // 从本地存储获取订单信息
+            const info = uni.getStorageSync('orderBuyInfo');
+            if (info) {
+                this.orderInfo = info;
+                this.formData.orderId = info.orderId;
+            } else {
+                uni.showToast({
+                    title: '订单信息不存在',
+                    icon: 'none'
+                });
+                setTimeout(() => {
+                    uni.navigateBack();
+                }, 1500);
+            }
+        },
+        methods: {
+            radioGroupChange(e) {
+                console.log(e);
+            },
+
+            // 统一支付方法
+            handlePayment(payData) {
+                // #ifdef MP-WEIXIN
+                this.wxPayment(payData);
+                // #endif
+
+                // #ifdef MP-ALIPAY
+                this.aliPayment(payData);
+                // #endif
+            },
+
+            // 微信支付方法
+            wxPayment(payData) {
+                uni.requestPayment({
+                    provider: 'wxpay',
+                    timeStamp: payData.timeStamp,
+                    nonceStr: payData.nonceStr,
+                    package: `prepay_id=${payData.prepayId}`,
+                    signType: payData.signType,
+                    paySign: payData.paySign,
+                    success: (res) => {
+                        // 支付成功
+                        this.paySuccess();
+                    },
+                    fail: (err) => {
+                        console.error('微信支付失败:', err);
+                        uni.showToast({
+                            title: '支付失败',
+                            icon: 'none'
+                        });
+                    }
+                });
+            },
+
+            // 支付宝支付方法
+            aliPayment(payData) {
+                my.tradePay({
+                    tradeNO: payData.tradeNo,
+                    success: (res) => {
+                        if (res.resultCode === '9000') {
+                            // 支付成功
+                            this.paySuccess();
+                        } else {
+                            uni.showToast({
+                                title: '支付失败',
+                                icon: 'none'
+                            });
+                        }
+                    },
+                    fail: (err) => {
+                        console.error('支付宝支付失败:', err);
+                        uni.showToast({
+                            title: '支付失败',
+                            icon: 'none'
+                        });
+                    }
+                });
+            },
+
+            paySuccess() {
+                uni.redirectTo({
+                    url: `/pages-car/pages/pay-success?orderId=${this.orderInfo.orderId}`
+                });
+            },
+
+            // 发起支付
+            onConfirmPayment() {
+                uni.showLoading({
+                    title: '支付处理中'
+                })
+
+                // 构建参数
+                const params = {
+                    payType: this.formData.payType,
+                    orderId: this.orderInfo.orderId 
+                };
+
+                // 获取支付参数
+                this.$u.api.payShopOrderAjax(params).then(res => {
+                    if (res.code === 200) {
+                        if (res.data.needPay == 1) {
+                            // 调用统一支付方法
+                            this.handlePayment(res.data);
+                        } else {
+                            // 不需要支付(如全额余额支付),直接跳转成功
+                            this.paySuccess();
+                        }
+                    } else {
+                        uni.showToast({
+                            title: res.msg || '获取支付参数失败',
+                            icon: 'none'
+                        });
+                    }
+                }).catch(err => {
+                    console.error('获取支付参数失败:', err);
+                    uni.showToast({
+                        title: '请求失败',
+                        icon: 'none'
+                    });
+                }).finally(() => {
+                    uni.hideLoading();
+                })
+            }
+        }
+    }
+</script>
+
+<style lang="scss" scoped>
+    .cashier-desk {
+        min-height: 100vh;
+        background-color: #f5f5f5;
+
+        .view-top {
+            background: #38C148;
+            height: 160rpx;
+            width: 100%;
+        }
+
+        .payment-methods {
+            background-color: #ffffff;
+            border-radius: 16rpx;
+            margin: 30rpx;
+            margin-top: -40px;
+            margin-bottom: 20rpx;
+
+            .payment-item {
+                display: flex;
+                justify-content: space-between;
+                align-items: center;
+                padding: 30rpx;
+                border-bottom: 1px solid #f5f5f5;
+
+                &:last-child {
+                    border-bottom: none;
+                }
+
+                .left {
+                    display: flex;
+                    align-items: center;
+                    gap: 20rpx;
+
+                    .payment-icon {
+                        width: 40rpx;
+                        height: 40rpx;
+                    }
+
+                    text {
+                        font-size: 30rpx;
+                        color: #333;
+                    }
+                }
+            }
+        }
+
+        .total {
+            background-color: #ffffff;
+            border-radius: 16rpx;
+            padding: 30rpx;
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+            margin: 30rpx;
+            margin-bottom: 20rpx;
+
+            text {
+                font-size: 30rpx;
+                color: #333;
+            }
+
+            .amount {
+                color: #ff0000;
+                font-size: 32rpx;
+                font-weight: bold;
+            }
+        }
+
+        .confirm-btn {
+            width: 90%;
+            margin-left: 5%;
+            margin-top: 100rpx;
+            background: #38C148;
+            color: #fff;
+            border-radius: 45rpx;
+
+            &::after {
+                border: none;
+            }
+        }
+    }
+</style>

+ 7 - 6
pages-car/pages/confirm-order.vue

@@ -175,12 +175,13 @@
                             icon: "success",
                         });
                         uni.removeStorageSync("selectAddr");
-                        setTimeout(() => {
-                            // 支付逻辑待接入,暂时跳转到订单列表或支付成功页
-                            uni.redirectTo({
-                                url: "/pages-car/pages/my-order"
-                            });
-                        }, 1500);
+                        //存储订单信息
+                        uni.setStorageSync("orderBuyInfo", res.data);
+
+                        //跳转到 收银台页面
+                        uni.navigateTo({
+                            url: `/pages-car/pages/cashier-desk?id=${res.data.orderId}`
+                        })
                     } else {
                         this.$u.toast(res.msg || '下单失败');
                     }

+ 18 - 68
pages-car/pages/my-order.vue

@@ -31,16 +31,16 @@
         },
         data() {
             return {
-                //NULL-全部 1待付款 2待发货 3待收货 4已完成 5已取消 6退款中 7已退款
+                // value用于前端标识,params用于后端查询
                 tabList: [
-                    { name: '全部', status: '' },
-                    { name: '待付款', status: 1 },
-                    { name: '待发货', status: 2 },
-                    { name: '待收货', status: 3 },
-                    { name: '已完成', status: 4 },
-                    { name: '已取消', status: 5 },
-                    { name: '退款中', status: 6 },
-                    { name: '已退款', status: 7 }
+                    { name: '全部', value: '0', params: {} },
+                    { name: '待付款', value: '1', params: { status: '1' } },
+                    { name: '待发货', value: '2', params: { status: '2' } },
+                    { name: '待收货', value: '3', params: { status: '3' } },
+                    { name: '已完成', value: '4', params: { status: '4' } },
+                    { name: '已取消', value: '5', params: { cancelStatus: '1' } },
+                    { name: '退款中', value: '6', params: { refundStatus: '2' } },
+                    { name: '已退款', value: '7', params: { refundStatus: '3' } }
                 ],
                 currentTab: 0,
                 orderList: [],
@@ -52,31 +52,24 @@
         },
         onLoad(options) {
             if (options.status) {
-                const index = this.tabList.findIndex(item => item.status == options.status);
+                const index = this.tabList.findIndex(item => item.value == options.status);
                 if (index !== -1) {
                     this.currentTab = index;
-                    this.params.status = options.status;
+                    this.params = this.tabList[index].params;
                 }
             }
 
-            // 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);
                 });
             },
             handleTabChange(index) {
                 this.currentTab = index;
-                this.params.status = this.tabList[index].status;
+                this.params = this.tabList[index].params;
                 this.loadOrders(true, this.params);
             },
             handleUpdateList(list) {
@@ -119,8 +112,9 @@
                         success: (res) => {
                             if (res.confirm) {
                                 // Remove from list
-                                this.orderList = this.orderList.filter(item => item.orderNo !== order.orderNo);
+                                this.orderList = this.orderList.filter(item => item.orderId !== order.orderId);
                                 uni.showToast({ title: '删除成功', icon: 'none' });
+                                // Call API to delete if needed
                             }
                         }
                     });
@@ -145,7 +139,10 @@
                 } else if (type === 'address') {
                     uni.showToast({ title: '修改地址', icon: 'none' });
                 } else if (type === 'pay') {
-                    uni.showToast({ title: '去支付', icon: 'none' });
+                    // 跳转到收银台
+                    uni.navigateTo({
+                        url: `/pages-car/pages/cashier-desk?id=${order.orderId}`
+                    });
                 } else if (type === 'cancel') {
                     uni.showModal({
                         title: '提示',
@@ -160,53 +157,6 @@
                 } 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);
             }
         }
     }

+ 101 - 0
pages-car/pages/pay-success.vue

@@ -0,0 +1,101 @@
+<template>
+    <view class="pay-success">
+        <view class="success-icon">
+            <image src="../static/pay-success.png" mode="aspectFit"></image>
+        </view>
+        <view class="success-title">支付成功</view>
+        <view class="success-desc">您的书籍将邮寄,请耐心等待</view>
+        <view class="action-buttons">
+            <button class="btn-return" @click="handleReturn">返回首页</button>
+            <button class="btn-view" @click="handleViewOrder">查看订单</button>
+        </view>
+    </view>
+</template>
+
+<script>
+export default {
+    data() {
+        return {
+            orderId:''
+        }
+    },
+    onLoad(options){
+        this.orderId = options.orderId
+    },
+    methods: {
+        handleReturn() {
+            uni.switchTab({
+                url: '/pages/home/index'
+            })
+        },
+        handleViewOrder() {
+            uni.navigateTo({
+                url: '/pages-mine/pages/return-detail?orderId=' + this.orderId
+            })
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.pay-success {
+    min-height: 100vh;
+    background: #fff;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    padding-top: 120rpx;
+
+    .success-icon {
+        width: 160rpx;
+        height: 160rpx;
+        margin-bottom: 40rpx;
+
+        image {
+            width: 100%;
+            height: 100%;
+        }
+    }
+
+    .success-title {
+        font-size: 36rpx;
+        font-weight: 500;
+        color: #333;
+        margin-bottom: 20rpx;
+    }
+
+    .success-desc {
+        font-size: 28rpx;
+        color: #999;
+        margin-bottom: 80rpx;
+    }
+
+    .action-buttons {
+        display: flex;
+        gap: 30rpx;
+        padding: 0 40rpx;
+        width: 100%;
+        box-sizing: border-box;
+
+        button {
+            flex: 1;
+            height: 88rpx;
+            border-radius: 10rpx;
+            font-size: 32rpx;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+
+            &.btn-return {
+                background: #f5f5f5;
+                color: #666;
+            }
+
+            &.btn-view {
+                background: #07c160;
+                color: #fff;
+            }
+        }
+    }
+}
+</style>

+ 12 - 0
pages.json

@@ -344,6 +344,18 @@
                     "style": {
                         "navigationBarTitleText": "红包"
                     }
+                },
+                {
+                    "path": "pages/cashier-desk",
+                    "style": {
+                        "navigationBarTitleText": "收银台"
+                    }
+                },
+                {
+                    "path": "pages/pay-success",
+                    "style": {
+                        "navigationBarTitleText": "支付成功"
+                    }
                 }
             ]
         },

+ 1 - 1
pages/mine/index.vue

@@ -335,7 +335,7 @@ export default {
 		//查看全部订单
 		viewAllOrders() {
 			uni.navigateTo({
-				url: '/pages-mine/pages/order-page?status=-1'
+				url: '/pages-car/pages/my-order?status=-1'
 			});
 		},
 		//跳转订单