diff --git a/pages/users/order_confirm/index.vue b/pages/users/order_confirm/index.vue index 6d884880..3f410b2e 100644 --- a/pages/users/order_confirm/index.vue +++ b/pages/users/order_confirm/index.vue @@ -148,7 +148,15 @@ 立即结算 - + + + { + this.store_self_mention = res.data.pickUpEnable && this.productType === 'normal'; + }) }, /** * 生命周期函数--监听页面显示 @@ -295,10 +308,12 @@ onShow: function() { let _this = this this.textareaStatus = true; + // 获得默认的收货地址 if (this.isLogin && !this.toPay) { this.getaddressInfo(); } + // 来自 goods_details_store/index.vue 的门店选择 uni.$on("handClick", res => { if (res) { _this.system_store = res.address @@ -329,11 +344,6 @@ title: err }); }) - - // 获得门店自提是否开启 - DeliveryApi.getDeliveryConfig().then(res => { - this.store_self_mention = res.data.pickUpEnable && this.productType === 'normal'; - }) }, // 计算订单价格 computedPrice: function() { @@ -363,14 +373,7 @@ }); }); }, - bindPickerChange: function(e) { - let value = e.detail.value; - this.shippingType = value; - this.computedPrice(); - }, - ChangCouponsClone: function() { - this.$set(this.coupon, 'coupon', false); - }, + changeTextareaStatus: function() { for (let i = 0, len = this.coupon.list.length; i < len; i++) { this.coupon.list[i].use_title = ''; @@ -380,39 +383,6 @@ this.status = 0; this.$set(this.coupon, 'list', this.coupon.list); }, - /** - * 处理点击优惠券后的事件 - */ - ChangCoupons: function(e) { - // this.usableCoupon = e - // this.coupon.coupon = false - let index = e, - list = this.coupon.list, - couponTitle = '请选择', - couponId = 0; - for (let i = 0, len = list.length; i < len; i++) { - if (i != index) { - list[i].use_title = ''; - list[i].isUse = 0; - } - } - if (list[index].isUse) { - //不使用优惠券 - list[index].use_title = ''; - list[index].isUse = 0; - } else { - //使用优惠券 - list[index].use_title = '不使用'; - list[index].isUse = 1; - couponTitle = list[index].name; - couponId = list[index].id; - } - this.couponTitle = couponTitle; - this.couponId = couponId; - this.$set(this.coupon, 'coupon', false); - this.$set(this.coupon, 'list', list); - this.computedPrice(); - }, /** * 使用积分抵扣 */ @@ -423,16 +393,7 @@ bindHideKeyboard: function(e) { this.mark = e.detail.value; }, - /** - * 获取当前金额可用优惠券 - * - */ - getCouponList: function() { - getCouponsOrderPrice(this.preOrderNo).then(res => { - this.$set(this.coupon, 'list', res.data); - this.openType = 1; - }); - }, + payItem: function(e) { let that = this; let active = e; @@ -815,6 +776,54 @@ // #endif }, + // ========== 优惠劵 ========== + /** + * 获取当前金额可用优惠券 TODO + */ + getCouponList: function() { + getCouponsOrderPrice(this.preOrderNo).then(res => { + this.$set(this.coupon, 'list', res.data); + this.openType = 1; + }); + }, + /** + * 处理点击优惠券后的事件 TODO + */ + ChangCoupons: function(e) { + // this.usableCoupon = e + // this.coupon.coupon = false + let index = e, + list = this.coupon.list, + couponTitle = '请选择', + couponId = 0; + for (let i = 0, len = list.length; i < len; i++) { + if (i != index) { + list[i].use_title = ''; + list[i].isUse = 0; + } + } + if (list[index].isUse) { + //不使用优惠券 + list[index].use_title = ''; + list[index].isUse = 0; + } else { + //使用优惠券 + list[index].use_title = '不使用'; + list[index].isUse = 1; + couponTitle = list[index].name; + couponId = list[index].id; + } + this.couponTitle = couponTitle; + this.couponId = couponId; + this.$set(this.coupon, 'coupon', false); + this.$set(this.coupon, 'list', list); + this.computedPrice(); + }, + // TODO + ChangCouponsClone: function() { + this.$set(this.coupon, 'coupon', false); + }, + // ========== 收货地址 ========== /** * 打开选择地址的弹窗