From bc5af47f676406f8ce6f783b7f893b6d6a7f1f74 Mon Sep 17 00:00:00 2001 From: sin <2943460818@qq.com> Date: Thu, 11 Apr 2019 23:10:27 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=9A=84=20mock=20=E6=95=B0=E6=8D=AE=20-=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=95=86=E5=93=81=20title=20=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mobile-web/src/page/product/detail.vue | 4 +- mobile-web/src/page/shipping/order.vue | 51 +++-------- mobile-web/src/page/user/order/list.vue | 107 ++++++------------------ 3 files changed, 36 insertions(+), 126 deletions(-) diff --git a/mobile-web/src/page/product/detail.vue b/mobile-web/src/page/product/detail.vue index adda364b3..9f439ec5b 100644 --- a/mobile-web/src/page/product/detail.vue +++ b/mobile-web/src/page/product/detail.vue @@ -245,12 +245,10 @@ }, onBuyClicked(data) { const { selectedNum } = data; - // debugger; - // console.log(data); - // this.$toast(JSON.stringify(data)); this.$router.push({ path:'/order', query:{ + goodsId: data.id, skuId: data.selectedSkuComb.id, quantity: selectedNum, } diff --git a/mobile-web/src/page/shipping/order.vue b/mobile-web/src/page/shipping/order.vue index 4639b9c30..7cb647b6e 100644 --- a/mobile-web/src/page/shipping/order.vue +++ b/mobile-web/src/page/shipping/order.vue @@ -76,7 +76,6 @@ data() { return { from: 'direct_order', // 目前有两个来源。direct_order:直接下单; card: 购物车下单。 - // 如下两个参数,在直接下单时使用 skuId: this.$route.query.skuId, quantity: this.$route.query.quantity, @@ -85,7 +84,6 @@ addressData: { }, - itemGroups: [], fee: { originalTotal: undefined, @@ -93,48 +91,11 @@ postageTotal: undefined, presentTotal: undefined, }, - - products: [ - { - imageURL: - "https://img10.360buyimg.com/mobilecms/s88x88_jfs/t17572/12/840082281/351445/e1828c58/5aab8dbbNedb77d88.jpg", - title: "良品铺子 肉肉聚汇猪肉脯 猪蹄卤 辣味小吃520g", - desc: "0.670kg/件,肉肉聚汇520g", - price: "59.80", - quantity: 2 - }, - { - imageURL: - "https://img10.360buyimg.com/mobilecms/s88x88_jfs/t22720/128/1410375403/319576/8dbd859f/5b5e69b3Nf4f0e9e7.jpg", - title: "元朗 鸡蛋卷 饼干糕点 中秋礼盒 广东特产680g", - desc: "1.320kg/件", - price: "65.80", - quantity: 1, - gift: [ - { - title: "星巴克(Starbucks)星冰乐小熊吊饰星巴克(Starbucks)星冰乐小熊吊饰", - quantity: 2 - }, - { - title: "星巴克(Starbucks)星冰乐小熊吊饰星巴克(Starbucks)星冰乐小熊吊饰", - quantity: 1 - } - ] - }, - { - imageURL: - "https://img10.360buyimg.com/mobilecms/s88x88_jfs/t17572/12/840082281/351445/e1828c58/5aab8dbbNedb77d88.jpg", - title: "良品铺子 肉肉聚汇猪肉脯 猪蹄卤 辣味小吃520g", - desc: "0.670kg/件,肉肉聚汇520g", - price: "59.80", - quantity: 2 - }, - ] + products: [], }; }, methods: { onSubmit() { - this.$toast("点击按钮"); const { skuId, quantity } = this.$route.query; const userAddressId = this.addressData.id; const remark = ''; @@ -148,6 +109,16 @@ orderItems, userAddressId, remark, + }).then(result => { + if (result) { + const { orderNo } = result; + this.$router.push({ //核心语句 + path:`/order/success`, //跳转的路径 + query:{ //路由传参时push和query搭配使用 ,作用时传递参数 + ...result, + } + }); + } }) }, convertProduct(item) { diff --git a/mobile-web/src/page/user/order/list.vue b/mobile-web/src/page/user/order/list.vue index e7e78d287..5752b0924 100644 --- a/mobile-web/src/page/user/order/list.vue +++ b/mobile-web/src/page/user/order/list.vue @@ -23,17 +23,19 @@