Prechádzať zdrojové kódy

Merge remote-tracking branch 'remotes/origin/developerC' into developerA

喻文俊 3 rokov pred
rodič
commit
a73163e3d2

+ 25 - 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();}
         },
@@ -716,12 +722,14 @@ var shoppingConfirm = new Vue({
                 _self.orderInvoice.type = parseInt(_self.orderInvoice.type)
                 _self.confirmParam.orderInvoice = _self.orderInvoice;
             }
+            var hanldPostageFlag =
             _self.confirmParam.payInfo.postage = parseInt(_self.hanldPostage).toFixed(2);
             _self.confirmParam.payInfo.postageFlag = parseInt(_self.hanldPostageFlag);
             _self.confirmParam.payInfo.orderShouldPayFee = parseFloat(_self.hanldShouldPayFee).toFixed(2);
             _self.confirmParam.payInfo = JSON.stringify(_self.confirmParam.payInfo);
             _self.confirmParam.orderInfo = JSON.stringify(_self.confirmParam.orderInfo);
             _self.confirmParam.orderInvoice = JSON.stringify(_self.confirmParam.orderInvoice);
+            console.log('confirmParam',_self.confirmParam);
             OrderApi.ConfirmOrder(_self.confirmParam,function (res) {
                 if(res.code === 0){
                     var data = res.data;
@@ -745,10 +753,23 @@ var shoppingConfirm = new Vue({
                     CAIMEI.Alert(res.msg,'确定',true, function(){
                         setTimeout(function(){
                             _self.submitLoading = false;
+                            _self.confirmParam.payInfo = JSON.parse(_self.confirmParam.payInfo);
+                            _self.confirmParam.orderInfo = JSON.parse(_self.confirmParam.orderInfo);
+                            _self.confirmParam.orderInvoice = JSON.parse(_self.confirmParam.orderInvoice);
                         },500);
                     });
                 }
             });
+        },
+        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 () {
@@ -763,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/static/js/user-center/order/list.js

@@ -318,7 +318,7 @@ var orderPage = new Vue({
                     if (type === 2) {
                         window.location.href = '/pay/success.html?pageType=www&type=success&payAmount='+_self.payModelData.pendingPayments;
                     } else {
-                        if (data.order.onlinePayFlag === 1) {
+                        if (response.data.order.onlinePayFlag === 1) {
                             _self.modelType = 3;
                             _self.showModelTypePop();
                         } else {

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

@@ -211,7 +211,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>

+ 1 - 1
src/main/resources/templates/user-center/order/detail.html

@@ -210,7 +210,7 @@
                             <div class="record-list" v-if="discernReceiptList.length>0">
                                 <div class="record-item" v-for="(item,index) in discernReceiptList" :key="index">
                                     <div class="item-time mm">¥{{item.associateAmount | NumFormat}}</div>
-                                    <div class="item-time pp">{{item.payType}}</div>
+                                    <div class="item-time pp">{{item.payTypeStr}}</div>
                                     <div class="item-time tt">{{item.receiptDate}}</div>
                                 </div>
                             </div>