diff --git a/pages/order/detail.vue b/pages/order/detail.vue index f5ef289..a2caba0 100644 --- a/pages/order/detail.vue +++ b/pages/order/detail.vue @@ -143,10 +143,14 @@ 共{{ order.total_num }}件商品,实付款¥{{ order.pay_price?Number(order.pay_price):order.pay_price }} - + - + 取消订单 @@ -316,7 +320,12 @@ v-if="order.order_status == OrderStatusEnum.COMPLETED.value && order.is_comment == 0" @click="handleTargetComment(order.order_id)"> 评价 - --> + --> + + 复制订单详情 + @@ -431,7 +440,7 @@ onShareAppMessage(res) { return { title: this.Store.storeInfo.store_name, - path: "pages/order/detail?orderId="+this.orderId, //这是打开后的跳转路径 + path: "/pages/order/detail?orderId="+this.orderId, //这是打开后的跳转路径 imageUrl:this.Store.storeInfo.image_url, success: function(res){ // 转发成功之后的回调 @@ -449,7 +458,42 @@ } } }, - methods: { + methods: { + onCopyOrderInfo(obj) { + console.log(obj) + /** + * 1.订单编号: + 2.商品型号: + 3.商品编码: + 4.商品单价: + 5.商品数量: + 6.商品总价: + 7.收件人名字: + 8.收件人电话: + 9.收件人地址: + */ + let goods_no = ""; + if(obj.goods && obj.goods.length > 0){ + obj.goods.map(a=>{ + goods_no+=`商品型号: ${(a.goods_sku_id !=0?a.goods_sku_id:'无')};商品编码: ${a.goods_no?a.goods_no:'无编码'};商品单价: ¥${a.goods_price}元;商品数量: ${a.total_num};商品总价: ¥${a.total_price}元` + }) + } + const str =`订单编号:${obj.order_no};${goods_no};收件人名字:${obj.address.name};收件人电话:${obj.address.phone};收件人地址:${obj.address.region.province+obj.address.region.city+obj.address.region.region+obj.address.detail};` + console.log(str) + uni.setClipboardData({ + data: str, + success() { + uni.getClipboardData({ + success() { + uni.showToast({ + icon: "none", + title: "复制成功" + }) + } + }) + } + }) + }, // 联系商家 callStore(phone) { uni.makePhoneCall({ @@ -512,14 +556,14 @@ // 跳转到门店详情页 handleTargetExtract(shopId) { - this.$navTo('pages/shop/detail', { + this.$navTo('/pages/shop/detail', { shopId }) }, // 跳转到物流跟踪页面 handleTargetExpress() { - this.$navTo('pages/order/express/index', { + this.$navTo('/pages/order/express/index', { orderId: this.orderId }) }, @@ -527,12 +571,12 @@ // 跳转到商品详情页面 handleTargetGoods(goodsId) { uni.redirectTo({ - url: 'pages/goods/detail?goodsId=' + goodsId // 目标页面路径 + url: '/pages/goods/detail?goodsId=' + goodsId // 目标页面路径 }) }, // 修改地址 onAdress(orderId) { - this.$navTo('pages/address/index', { + this.$navTo('/pages/address/index', { orderId }) }, @@ -628,14 +672,14 @@ }, // 点击去支付 onPay(orderId) { - this.$navTo('pages/checkout/cashier/index', { + this.$navTo('/pages/checkout/cashier/index', { orderId }) }, // 跳转到订单评价页 handleTargetComment(orderId) { - this.$navTo('pages/order/comment/index', { + this.$navTo('/pages/order/comment/index', { orderId }) },