浏览代码

订单模块修改

zhengjinyi 3 年之前
父节点
当前提交
9cf94d0c75
共有 2 个文件被更改,包括 21 次插入3 次删除
  1. 20 2
      src/main/resources/static/js/shopping/confirm.js
  2. 1 1
      src/main/resources/templates/shopping/confirm.html

+ 20 - 2
src/main/resources/static/js/shopping/confirm.js

@@ -169,6 +169,8 @@ var shoppingConfirm = new Vue({
                     _self.balance.userMoney = data.userMoney;
                     _self.balance.originUserMoney = data.userMoney;
                     _self.hanldShouldPayFee = data.totalPrice;
+                    _self.postageParam.productIds =  _self.getProductIds(data.list); // 获取订单商品id列表 以 , 隔开
+                    console.log('邮费接口数据',  _self.postageParam)
                     _self.getAddressList(_self.userId,20);
                     if( data.couponList &&  data.couponList.length>0){
                         _self.isCouponShow = true;
@@ -204,7 +206,9 @@ var shoppingConfirm = new Vue({
                     _self.balance.userMoney = data.userMoney;
                     _self.balance.originUserMoney = data.userMoney;
                     _self.hanldShouldPayFee = data.totalPrice;
+                    _self.postageParam.productIds =  _self.getProductIds(data.list); // 获取订单商品id列表 以 , 隔开
                     _self.getAddressList(_self.userId,20);
+                    console.log('邮费接口数据',  _self.postageParam)
                     if( data.couponList &&  data.couponList.length>0){
                         _self.isCouponShow = true;
                         _self.couponAmount = data.couponList[0].couponAmount;
@@ -227,6 +231,7 @@ var shoppingConfirm = new Vue({
         },
         getFreight: function(){// 获取邮费
             var _self = this;
+            console.log(_self.postageParam, '邮费接口调用')
             OrderApi.GetOrderPostage(_self.postageParam,function (r) {
                 if(r.code === 0 && r.data){
                     _self.confirmParam.payInfo.postageFlag = _self.hanldPostageFlag = r.data.postageFlag;
@@ -374,6 +379,7 @@ var shoppingConfirm = new Vue({
             this.addressForm.provinceId= '';
             this.addressForm.desc= '';
             this.addressForm.default= '';
+            this.addressForm.id = '';
             this.getProvinceOptions();
             if(!isPC){fixedBody();}
         },
@@ -754,6 +760,16 @@ var shoppingConfirm = new Vue({
                     });
                 }
             });
+        },
+        getProductIds: function(list){
+            var productIds = [];
+            list.forEach(function(supplier){
+                supplier.cartList.forEach(function(product){
+                    productIds.push(product.productId)
+                });
+            })
+            // console.log(list);
+            return productIds.join(',');
         }
     },
     created: function () {
@@ -768,12 +784,14 @@ var shoppingConfirm = new Vue({
             // type:(1购物车提交[对应表cm_cart],2直接购买提交, 3协销下单)
             if(urlType === 1) {//购物车提交
                 _self.confirmParam.cartType = 1;
-                _self.cartParam.productIds = _self.postageParam.productIds = _self.productIds = window.localStorage.getItem("shoppingProductIds");
+                // _self.cartParam.productIds = _self.postageParam.productIds = _self.productIds = window.localStorage.getItem("shoppingProductIds");
+                _self.cartParam.productIds =  _self.productIds = window.localStorage.getItem("shoppingProductIds");
                 // 获取列表数据
                 _self.getCartCreateOrderInfo();
             }else if(urlType === 2){//立即购买
                 _self.confirmParam.cartType = 2;
-                _self.productParam.productId = _self.postageParam.productIds = _self.productIds = getUrlParam("productId");
+                // _self.productParam.productId = _self.postageParam.productIds = _self.productIds = getUrlParam("productId");
+                _self.productParam.productId =  _self.productIds = getUrlParam("productId");
                 _self.productParam.productCount = getUrlParam("count");
                 if(_self.productParam.productId && _self.productParam.productCount) {
                     _self.getProductCreateOrderInfo();

+ 1 - 1
src/main/resources/templates/shopping/confirm.html

@@ -196,7 +196,7 @@
                         </div>
                     </div>
                     <div class="c5">{{cart.number}}</div>
-                    <div v-if="isPC" class="c6"><span v-text="'¥'+toFloat(cart.price*cart.number)"></span></div>
+                    <div v-if="isPC" class="c6"><span v-text="'¥'+ (cart.price * cart.number).toFixed(2)"></span></div>
                 </div>
                 <div class="supplierBtn">
                     <span :class="supplier.reducedPrice>0?'priceTotal':'item'">合计:<em v-text="'¥'+toFloat(supplier.totalPrice)"></em>