diff --git a/common/api/shop.js b/common/api/shop.js index 369489e..18abda3 100644 --- a/common/api/shop.js +++ b/common/api/shop.js @@ -139,7 +139,7 @@ export default { }); }, // 订单步骤2:发起订单,返回订单信息 - sendOrder({ ifcart, cart_id, address_id, buy_city_id, pintuan_id, pintuangroup_id, voucher_id }) { + sendOrder({ ifcart, cart_id, address_id, buy_city_id, pintuan_id, pintuangroup_id, voucher_id, is_selfraising }) { return vm.$u.post('buy/buy_step2', { ifcart: ifcart, cart_id: cart_id, @@ -148,6 +148,7 @@ export default { pintuan_id: pintuan_id, pintuangroup_id: pintuangroup_id, voucher_id: voucher_id, // 优惠券信息 + is_selfraising: is_selfraising, // 是否自提 }); }, // 订单步骤3:发起支付(第三方统一下单) diff --git a/components/comment/index.vue b/components/comment/index.vue index 41ff22f..12b0ed1 100644 --- a/components/comment/index.vue +++ b/components/comment/index.vue @@ -9,7 +9,7 @@ {{ content.geval_content }} - + 掌柜回复: @@ -41,11 +41,12 @@ export default { if(this.content.hasOwnProperty('scores_two')) this.rate = this.content.scores_two; }, methods: { - previewImage(urls) { - console.log(urls); - // uni.previewImage({ - // urls: urls, - // }); + previewImage(urls, index) { + // console.log(urls); + uni.previewImage({ + urls: urls, + current: urls[index] + }); }, } }; diff --git a/components/mine/order-item/index.vue b/components/mine/order-item/index.vue index f68890c..75fac3d 100644 --- a/components/mine/order-item/index.vue +++ b/components/mine/order-item/index.vue @@ -25,7 +25,7 @@ 申请退款 - 查看物流 + 查看物流 确认收货 立即评价 取消支付 diff --git a/pageB/sdetails/index.vue b/pageB/sdetails/index.vue index 75d9f4c..68c4e95 100644 --- a/pageB/sdetails/index.vue +++ b/pageB/sdetails/index.vue @@ -49,7 +49,7 @@ - 商品评价({{ evaluate.evaluate_num }}) + 商品评价({{ evaluate.evaluate_num || '0' }}) 查看全部 diff --git a/pageC/cart/ConfirmOrder.vue b/pageC/cart/ConfirmOrder.vue index 65062c4..3dae2a0 100644 --- a/pageC/cart/ConfirmOrder.vue +++ b/pageC/cart/ConfirmOrder.vue @@ -107,9 +107,15 @@ export default { deliveryList: [{ text: '快递', value: 'express', + disabled: false, }, { text: '骑手', value: 'takeawayer', + disabled: false, + }, { + text: '自提', + value: 'selfraising', + disabled: false, }], delivery: { text: '快递', @@ -123,6 +129,7 @@ export default { goodsClass: [], orderType: '', // 订单类型 1 普通订单 2 拼团订单 3 秒杀订单 4 优惠券 5 购物车订单 debounce: true, + is_selfraising: 0, // 是否自提:0=》否,1=》是 } }, components: { @@ -148,6 +155,8 @@ export default { onLoad(option) { this.orderType = this.$store.state.orderType; this.orderInfo = this.$store.state.orderInfo; + // 判断是否可选自提 + if(!this.orderInfo.is_selfraising) this.deliveryList[2].disabled = true; // console.log('orderType' + this.orderType); // console.log(this.orderInfo); this.getGoodsClass(); @@ -182,8 +191,10 @@ export default { // console.log(this.orderInfo); // console.log(this.$store.state.pintuangroup_headid); if(this.orderInfo.pintuangroup_id) { - Object.assign(params, { pintuangroup_headid: this.$store.state.pintuangroup_headid }); - Object.assign(params, { pintuangroup_id: this.orderInfo.pintuangroup_id }); + Object.assign(params, { + pintuangroup_headid: this.$store.state.pintuangroup_headid, + pintuangroup_id: this.orderInfo.pintuangroup_id + }); } console.log(params); this.$u.api.withImmediate(params).then(res => { @@ -249,6 +260,7 @@ export default { cart_id: id, address_id: this.addressInfo.address_id, buy_city_id: this.addressInfo.city_id, + is_selfraising: this.is_selfraising, } if(coupon.length) Object.assign(params, { voucher_id: coupon }); if(this.orderType == 2) { @@ -262,10 +274,10 @@ export default { type: 'redirect', url: '/pageC/cart/cashier', params: { - ifcart: params.ifcart, + ifcart: ifcart, pay_sn: res.data.pay_sn, price: res.data.order_total_amount, - order_id: res.data.order_list[0].order_id, + order_id: res.data.order_list[0].order_id, } }) } else { @@ -282,13 +294,8 @@ export default { this.couponStatus = true; }, useCoupon(coupon) { - console.log(coupon) - - - - + // console.log(coupon) if(this.couponType.type == 1){ - this.choiceCoupon = {} for(let i in this.orderInfo.store_voucher_all_list){ if(this.orderInfo.store_voucher_all_list[i].voucher_id == coupon.voucher_id && !this.orderInfo.store_voucher_all_list[i].sel){ @@ -338,23 +345,23 @@ export default { const goods = this.orderInfo.store_goods_total; let [freight, price, minPrice] = [0, 0, 0]; // 运费 - for (const key in this.freight) { - if (this.freight.hasOwnProperty(key)) { + for(const key in this.freight) { + if(this.freight.hasOwnProperty(key)) { const element = this.freight[key]; freight += Number(element); } } // 商品价格减去优惠券 // 店铺 - for (const gid in goods) { - if (goods.hasOwnProperty(gid)) { + for(const gid in goods) { + if(goods.hasOwnProperty(gid)) { // 计算最小价格 minPrice += 0.01; // 每个店铺所有商品的价格 let sprice = Number(goods[gid]); if(JSON.stringify(this.storeCoupon) != '{}') { - for (const cid in this.storeCoupon) { - if (this.storeCoupon.hasOwnProperty(cid)) { + for(const cid in this.storeCoupon) { + if(this.storeCoupon.hasOwnProperty(cid)) { const cprice = this.storeCoupon[cid]; // 商品减去优惠券价格 if(gid == cid) { @@ -378,13 +385,31 @@ export default { // console.log("price:" + price); this.totalPrice = (price + freight).toFixed(2); }, - setDelivery(index) { + async setDelivery(index) { + // console.log(index); + if(index == 2) { + this.is_selfraising = 1; + for (const key in this.freight) { + if (this.freight.hasOwnProperty(key)) { + this.freight[key] = '0.00'; + } + } + this.isTakeawayer = false; + this.setTotalPrice(); // 计算总价 + this.delivery = this.deliveryList[index]; + } else { + this.is_selfraising = 0; + } if(index == 1) { if(!this.isTakeawayer) this.$u.toast('此地区不支持骑手配送'); return false; + this.delivery = this.deliveryList[index]; + this.getFreight(); + } + if(index == 0) { + this.delivery = this.deliveryList[index]; + this.getFreight(); } - this.delivery = this.deliveryList[index]; - this.getFreight(); }, settlement() { uni.navigateTo({ @@ -471,7 +496,7 @@ export default { height: 60rpx; border-radius: 50%; margin-right: 15rpx; - background-color: aquamarine; + // background-color: aquamarine; } > view { font-size: 28rpx; @@ -479,6 +504,7 @@ export default { margin-right: 15rpx; } .right { + margin-left: auto; flex-shrink: 0; width: 11rpx; height: 22rpx; @@ -496,7 +522,7 @@ export default { width: 180rpx; height: 160rpx; border-radius: 10rpx; - background-color: aqua; + // background-color: aqua; flex-shrink: 0; } .info { diff --git a/pageE/order/Details.vue b/pageE/order/Details.vue index 448e13e..4896201 100644 --- a/pageE/order/Details.vue +++ b/pageE/order/Details.vue @@ -39,6 +39,10 @@ + + 配送方式 + 自提 + 运费(快递/骑手) ¥{{ orderInfo.shipping_fee }} @@ -75,7 +79,7 @@ 立即评价 取消支付 - 查看物流 + 查看物流 联系骑手 diff --git a/pages.json b/pages.json index 7c1ca24..b9f0e00 100644 --- a/pages.json +++ b/pages.json @@ -135,7 +135,7 @@ "backgroundColor":"#ffffff", "buttons": [ { - // "type":"none", + "type":"none", "text":"\ue503", "float":"right", "fontSize":"20",