From 6d4fe7f4cb7a526dfc1e7f1ec271c69db7776bc5 Mon Sep 17 00:00:00 2001 From: Gaoxs <704041637@qq.com> Date: Tue, 12 Jan 2021 15:19:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A7=AF=E5=88=86=E5=95=86?= =?UTF-8?q?=E5=9F=8E=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/OrderGoods.vue | 4 +- pages/order/MyOrder/index.vue | 8 +- pages/order/OrderDetails/index.vue | 779 +++++++++++++------------- pages/order/OrderSubmission/index.vue | 40 +- pages/shop/GoodsCon/index.vue | 27 +- 5 files changed, 449 insertions(+), 409 deletions(-) diff --git a/components/OrderGoods.vue b/components/OrderGoods.vue index 18682ca..5669af9 100644 --- a/components/OrderGoods.vue +++ b/components/OrderGoods.vue @@ -15,7 +15,8 @@ class="attr line1" v-if="cart.productInfo.attrInfo" >{{ cart.productInfo.attrInfo.sku }} - ¥{{ cart.truePrice }} + ¥{{ cart.truePrice }} + {{ cart.productInfo.attrInfo.integral }}积分 评价 @@ -26,6 +27,7 @@ export default { name: "OrderGoods", props: { + isIntegral:Boolean, evaluate: Number, cartInfo: { type: Array, diff --git a/pages/order/MyOrder/index.vue b/pages/order/MyOrder/index.vue index 457bf3d..561dd70 100644 --- a/pages/order/MyOrder/index.vue +++ b/pages/order/MyOrder/index.vue @@ -90,13 +90,16 @@ {{ cart.productInfo.storeName }} - + ¥{{ cart.productInfo.attrInfo ? cart.productInfo.attrInfo.price : cart.productInfo.price }} + + {{order.payIntegral}}积分 + x{{ cart.cartNum }} @@ -104,7 +107,8 @@ 共{{ order.cartInfo.length || 0 }}件商品,总金额 - ¥{{ order.payPrice }} + ¥{{ order.payPrice }} + {{order.payIntegral}}积分 - + 订单编号: @@ -223,10 +195,14 @@ - + 支付金额: ¥{{ orderInfo.totalPrice }} + + 支付积分: + {{ orderInfo.payIntegral }}积分 + 优惠券抵扣: -¥{{ orderInfo.couponPrice }} @@ -241,7 +217,8 @@ 实付款: - ¥{{ orderInfo.payPrice }} + ¥{{ orderInfo.payPrice }} + {{ orderInfo.payIntegral }}积分 @@ -255,26 +232,19 @@ diff --git a/pages/order/OrderSubmission/index.vue b/pages/order/OrderSubmission/index.vue index dbeeaa0..519bcc2 100644 --- a/pages/order/OrderSubmission/index.vue +++ b/pages/order/OrderSubmission/index.vue @@ -44,9 +44,9 @@ - + - + 优惠券 {{ usableCoupon.couponTitle || "请选择" }} @@ -65,7 +65,7 @@ 当前积分 {{ userInfo.integral || 0 }} - + @@ -101,7 +101,7 @@ - + 支付方式 @@ -131,17 +131,18 @@ 商品总价: - ¥{{ orderPrice.totalPrice }} + ¥{{ orderPrice.totalPrice }} + {{ orderPrice.payIntegral }}积分 - + 运费: ¥{{ orderPrice.payPostage }} - + 优惠券抵扣: -¥{{ orderPrice.couponPrice }} - + 积分抵扣: -¥{{ orderPrice.deductionPrice }} @@ -150,7 +151,8 @@ 合计: - ¥{{ orderPrice.payPrice }} + ¥{{ orderPrice.payPrice }} + {{ orderPrice.payIntegral }}积分 立即结算 @@ -324,6 +326,7 @@ contactsTel: "", storeSelfMention: 0, cartid: "", + isIntegral: false }; }, computed: mapGetters(["userInfo", "storeItems"]), @@ -346,6 +349,8 @@ if (that.$yroute.query.pinkid !== undefined) { that.pinkId = that.$yroute.query.pinkid; } + this.isIntegral = that.$yroute.query.isIntegral == 'true' + this.useIntegral = this.isIntegral if (that.$yroute.query.id !== undefined) { that.cartid = that.$yroute.query.id; console.log(that.cartid); @@ -372,6 +377,9 @@ }, changeUseIntegral: function (e) { // this.computedPrice(); + if (this.isIntegral) { + return + } this.useIntegral = e.mp.detail.value[0]; }, computedPrice() { @@ -460,8 +468,20 @@ this.computedPrice(); }, createOrder() { + if (this.isIntegral) { + // 积分支付 + if (this.userInfo.integral < this.orderPrice.payIntegral) { + uni.showToast({ + title: "积分不足", + icon: "none", + duration: 2000, + }); + return + } + this.active = 'integral' + } let shipping_type = this.shipping_type; - if (!this.active) { + if (!this.isIntegral && !this.active) { uni.showToast({ title: "请选择支付方式", icon: "none", diff --git a/pages/shop/GoodsCon/index.vue b/pages/shop/GoodsCon/index.vue index d554105..8ec7378 100644 --- a/pages/shop/GoodsCon/index.vue +++ b/pages/shop/GoodsCon/index.vue @@ -7,7 +7,7 @@