DaMoWang 2 vuotta sitten
vanhempi
sitoutus
e34babe4fb
1 muutettua tiedostoa jossa 8 lisäystä ja 9 poistoa
  1. 8 9
      src/pages/to-pay-list/index.vue

+ 8 - 9
src/pages/to-pay-list/index.vue

@@ -167,19 +167,18 @@ export default {
       post("goods/goodsDetail", da).then((res) => {
         if (res.code === 0) {
           this.goodsInfo = res.data.data;
-          this.obligation = res.data.data.pickerPrice.price;
           post("goods/freight", { type: da.type }).then((res) => {
             if (res.code === 0) this.freight = res.data.freight;
 
             // 计算待支付
-            // let p = this.Data.type == 2 ? this.goodsInfo.trade_price : this.goodsInfo.cost_price; //商品单价
-            // let y = (this.Data.is_sell == 1 || this.Data.prom_type == 1) ? 0 : this.freight; // 运费   寄售的话退运费为0
-            // // let a = p * this.Data.num + y * this.Data.num; //商品总价
-            // // let b = a - this.userinfo.user_money; //待支付金额
-            // let a = this.$h.Mul(p,this.Data.num) + this.$h.Mul(y,this.Data.num); //商品总价
-            // let b = this.$h.Sub(a,this.userinfo.user_money); //待支付金额
-            // if (["4", "5", "6"].includes(this.Data.type)) this.obligation = a;
-            // else this.obligation = b > 0 ? b : 0;
+            let p = this.Data.type == 2 ? this.goodsInfo.trade_price : this.goodsInfo.cost_price; //商品单价
+            let y = (this.Data.is_sell == 1 || this.Data.prom_type == 1) ? 0 : this.freight; // 运费   寄售的话退运费为0
+            // let a = p * this.Data.num + y * this.Data.num; //商品总价
+            // let b = a - this.userinfo.user_money; //待支付金额
+            let a = this.$h.Mul(p,this.Data.num) + this.$h.Mul(y,this.Data.num); //商品总价
+            let b = this.$h.Sub(a,this.userinfo.user_money); //待支付金额
+            if (["4", "5", "6"].includes(this.Data.type)) this.obligation = a;
+            else this.obligation = b > 0 ? b : 0;
           });
         }
       });