瀏覽代碼

提交订单bugfix

chao 4 年之前
父節點
當前提交
acf82cfe15

+ 1 - 0
src/main/resources/static/css/shopping/shopping.css

@@ -89,6 +89,7 @@ li{list-style:none}
     .summaryWrap .summary .right .item{position:relative;text-align:right}
     .summaryWrap .summary .right .item em{color:#f55c5c}
     .summaryWrap .summary .submit{display:inline-block;width:232px;height:50px;line-height:50px;text-align:center;background-color:#e15616;border-radius:2px;color:#FFF}
+    .summaryWrap .summary .submit.dis{background:#999;}
     .summaryWrap.fixed{position:fixed;bottom:0;left:0;margin:0;z-index:99999;box-shadow:20px 20px 102px rgba(0,0,0,0.1)}
     .summaryWrap .summary .item .del{position:absolute;right:0;top:-20px;cursor:pointer;height:24px;font-size:14px}
     .summaryWrap .summary .item .del em{position:absolute;top:-12px;height:24px;white-space:nowrap;right:0;background:#ff4500;line-height:24px;color:#FFF;padding:0 12px;border-radius:2px}

+ 2 - 2
src/main/resources/static/js/base.js

@@ -371,7 +371,7 @@ function updateUrlParam(params) {
     }
 }
 
-function tokenAjax(type, url, params, callback){
+function tokenAjax(type, url, params, callback, errorBack){
     $.ajax({
         type: type,
         url: spiServer + url,
@@ -392,7 +392,7 @@ function tokenAjax(type, url, params, callback){
             }
         },
         error : function (res) {
-           alertInfo("网络连接超时,请重试!")
+           alertInfo("网络连接超时,请重试!",errorBack);
         }
     });
 }

+ 3 - 5
src/main/resources/static/js/common/ajax.service.js

@@ -47,11 +47,9 @@ var Http = {
                     def.resolve(res);
                 }
             }, function(error) {
-                if(error.status == 500 || error.status == 504){
-                    CAIMEI.Alert('网络请求超时,请重试~','确定',true,function () {
-                        window.location.reload();
-                    });
-                }
+                CAIMEI.Alert('网络请求超时,请重试~','确定',true,function () {
+                    window.location.reload();
+                });
                 def.reject(error);
             });
             return def;

+ 15 - 7
src/main/resources/static/js/shopping/confirm.js

@@ -10,6 +10,7 @@ var shoppingConfirm = new Vue({
         kindCount: 0,
         totalCount: 0,
         totalPrice: 0,
+        reducedPrice: 0,
         address: {
             id: '',
             townId: '',
@@ -54,9 +55,9 @@ var shoppingConfirm = new Vue({
         },
         payInfo: {
             clauseId: 0,         //条款(暂时保留)
-            orderShouldPayFee: 0,//提交的总价
+            orderShouldPayFee: 0.00,//提交的总价
             balancePayFlag: 0,   //余额抵扣的状态 0不使用,1使用
-            freight: 0,          //邮费
+            freight: 0.00,          //邮费
             freePostFlag:-1      // 0包邮 -1到付 1 有运费
         },
         invoice: {
@@ -100,6 +101,7 @@ var shoppingConfirm = new Vue({
                 if (r.code === 0 && r.data) {
                     _self.listData = r.data.list;
                     _self.totalPrice =  r.data.totalPrice;
+                    _self.reducedPrice = r.data.reducedPrice;
                     _self.totalCount =  r.data.totalCount;
                     _self.kindCount = r.data.kindCount;
                     _self.balance.userMoney = r.data.userMoney;
@@ -416,7 +418,7 @@ var shoppingConfirm = new Vue({
                 clubUserId: this.userId,   // 机构用户ID
                 addressId: this.address.id,// 地址ID
                 orderInfo: [],             // 商品信息
-                payInfo: this.payInfo,     // 订单信息
+                payInfo: {},     // 订单信息
                 orderInvoice: {type: 0}    // 默认不开发票
             };
             // 发票信息
@@ -456,8 +458,13 @@ var shoppingConfirm = new Vue({
                     productInfo: productInfo
                 }
             });
-            params.payInfo.freight = toFloat(this.payInfo.freight);
-            params.payInfo.orderShouldPayFee = toFloat(this.payInfo.orderShouldPayFee);
+            params.payInfo = {
+                clauseId: 0,
+                orderShouldPayFee: toFloat(this.payInfo.orderShouldPayFee),
+                balancePayFlag: this.payInfo.balancePayFlag,
+                freight: toFloat(this.payInfo.freight),
+                freePostFlag: this.payInfo.freePostFlag
+            };
             console.log(params);
             this.submitLoading = true;
             OrderApi.ConfirmOrder({'params':JSON.stringify(params)},function (r) {
@@ -477,9 +484,10 @@ var shoppingConfirm = new Vue({
                     CAIMEI.Storage.setItem('confirmOrderInfo',JSON.stringify({data:data}));
                     window.location.href = '/pay/caimei-paycash.html?type=confirm&orderID='+r.data.orderID;
                 }else{
-                    CAIMEI.Alert(r.msg,'确定',false);
+                    CAIMEI.Alert(r.msg,'确定',true, function(){
+                        _self.submitLoading = false;
+                    });
                 }
-                _self.submitLoading = false;
             });
         }
     },

+ 3 - 2
src/main/resources/templates/shopping/confirm.html

@@ -287,7 +287,8 @@
                 <span v-if="payInfo.freePostFlag==0">包邮</span>
                 <span v-if="payInfo.freePostFlag==1"><em>¥{{payInfo.freight | NumFormat}}</em></span>
             </p>
-            <p v-if="balance.deductMoney>0">抵扣账户余额: <span><em>¥{{balance.deductMoney | NumFormat}}</em></span></p>
+            <p v-if="reducedPrice>0">促销满减: <span><em>- ¥{{reducedPrice | NumFormat}}</em></span></p>
+            <p v-if="balance.deductMoney>0">抵扣账户余额: <span><em>- ¥{{balance.deductMoney | NumFormat}}</em></span></p>
             <p>总价: <span><em>¥{{payInfo.orderShouldPayFee | NumFormat}}</em></span></p>
         </div>
     </div>
@@ -301,7 +302,7 @@
             </div>
             <div class="right mfbt">
                 <div class="item">总价:<em v-text="'¥'+toFloat(totalPrice)"></em></div>
-                <a class="submit" href="javascript:void(0);" @click="submitOrder()">提交订单</a>
+                <a :class="submitLoading?'submit dis':'submit'" href="javascript:void(0);" @click="submitOrder()">提交订单</a>
             </div>
         </div>
     </div>