Browse Source

优惠券

zhengjinyi 3 years ago
parent
commit
358bbcc2a1

+ 15 - 3
src/main/resources/static/css/shopping/shopping.css

@@ -80,9 +80,10 @@ li{list-style:none}
     .invalidTit .tit em{font-style:normal;color:#e15616}
     /*优惠券选择*/
     .couponWrap{width: 100%;min-height: 200px;box-sizing: border-box;padding: 32px 16px 10px 16px;background: #FFF;box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.07);margin-bottom: 32px;float: left;}
-    .couponWrap .coupon-list-cell{width: 369px;height: 148px;float: left;margin-bottom:24px;margin-right: 15px;position: relative;background: url("/img/account/icon-coupon-uesb@2x.png") no-repeat;background-size: cover;}
+    .couponWrap .coupon-list-cell{width: 369px;height: 148px;float: left;cursor: pointer;margin-bottom:24px;margin-right: 15px;position: relative;background: url("/img/account/icon-coupon-uesb@2x.png") no-repeat;background-size: cover;}
     .couponWrap .coupon-list-cell .coupon-list-le{width: 299px;height: 148px;float: left;box-sizing: border-box;padding: 24px 14px 12px 14px;position: relative;}
-    .couponWrap .coupon-list-cell .coupon-list-le .coupon-list-checked{position: absolute;right: 16px;top: 16px;width: 14px;height: 14px;}
+    .couponWrap .coupon-list-cell .coupon-list-le .coupon-list-checked{position: absolute;right: 16px;top: 16px;width: 16px;height: 16px;background: url("/img/cart/icon_weigouxuan@2x.png") no-repeat;background-size: cover;}
+    .couponWrap .coupon-list-cell .coupon-list-le .coupon-list-checked.checked{background: url("/img/cart/icon_yixuanze@2x.png") no-repeat;background-size: cover;}
     .couponWrap .coupon-list-cell .coupon-list-money{width: 100%;height: 56px;line-height: 56px;color: #f94b4b;font-size: 14px;text-align: left;}
     .couponWrap .coupon-list-cell .coupon-list-money .maxMoney{font-size: 40px;margin-right: 8px;}
     .couponWrap .coupon-list-cell .coupon-list-name{width: 100%;height: 22px;line-height: 22px;color: #333333;font-size: 14px;text-align: left;margin-top: 13px;}
@@ -103,6 +104,11 @@ li{list-style:none}
     .summaryWrap .summary .item p.priceTotal-b{height: 18px;font-size: 14px;display: inline-block;width: 100%;float: left;text-align: left;line-height: 18px;}
     .summaryWrap .summary .check{width:14px;height:14px;line-height:14px;vertical-align:top;margin:18px 16px 0 16px}
     .summaryWrap .summary .delete{margin-left:16px;color:#f55c5c}
+    .summaryWrap .summary .totalMoney{display:inline-block;margin-right:32px;position:relative;}
+    .summaryWrap .summary .totalPrice{line-height: 24px;font-size: 18px;}
+    .summaryWrap .summary .totalPrice.none{line-height: 50px;}
+    .summaryWrap .summary .totalPrice span{color: #f55c5c;}
+    .summaryWrap .summary .totalCoupon{font-size:14px;line-height:24px;color: #f55c5c;text-align: left;}
     .summaryWrap .summary .submit{display:inline-block;width:232px;height:50px;line-height:50px;text-align:center;background:linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%);border-radius:2px;color:#FFF;float: right;}
     .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)}
@@ -232,6 +238,7 @@ li{list-style:none}
 * 移动端
 */
 @media screen and (max-width:768px){
+    footer{display: none;}
     h2.title>a{color: #E15621;margin-left: 2vw;}
     .pageTitle .step{width:100%;height:12.4vw;line-height:12.4vw;background:#FFF;color:#9AA5B5;font-size:3.1vw;text-align:center}
     .pageTitle .step span{display:inline-block;height:4.2vw;line-height:4.2vw;vertical-align:middle;position:relative;padding-right:6.4vw}
@@ -287,7 +294,8 @@ li{list-style:none}
     .couponWrap{width: 100%;box-sizing: border-box;padding: 4.8vw 3.2vw 2vw 3.2vw;background: #FFF;box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.07);margin-bottom: 4.8vw;float: left;}
     .couponWrap .coupon-list-cell{width: 93.1vw;height: 33vw;float: left;margin: 0 0 2.4vw 0;position: relative;border-radius: 1vw;}
     .couponWrap .coupon-list-cell .coupon-list-le{width: 77.6vw;height: 33vw;float: left;box-sizing: border-box;padding: 6.8vw 3.7vw 3.3vw 3.7vw;position: relative;}
-    .couponWrap .coupon-list-cell .coupon-list-le .coupon-list-checked{position: absolute;right: 4vw;top: 4vw;width: 3.6vw;height: 3.6vw;}
+    .couponWrap .coupon-list-cell .coupon-list-le .coupon-list-checked{position: absolute;right: 4vw;top: 4vw;width: 3.6vw;height: 3.6vw;background: url("/img/cart/icon_weigouxuan@2x.png") no-repeat;background-size: cover;}
+    .couponWrap .coupon-list-cell .coupon-list-le .coupon-list-checked.checked{background: url("/img/cart/icon_yixuanze@2x.png") no-repeat;background-size: cover;}
     .couponWrap .coupon-list-cell .coupon-list-money{width: 100%;height:10vw;line-height: 10vw;color: #f94b4b;font-size: 3vw;text-align: left; }
     .couponWrap .coupon-list-cell .coupon-list-money .maxMoney{font-size: 7.2vw;margin-right: 2.4vw;}
     .couponWrap .coupon-list-cell .coupon-list-money.none, .coupon-list-cell .coupon-list-name.none, .coupon-list-cell .coupon-list-time.none{color: #FFF;}
@@ -309,6 +317,10 @@ li{list-style:none}
     .summaryWrap .summary .item p.priceTotal-b{height: 4.6vw;font-size: 3vw;display: inline-block;width: 100%;float: left;text-align: left;line-height: 4.6vw;}
     .summaryWrap .summary .check{width:3.5vw;height:3.5vw;line-height:3.5vw;vertical-align:top;margin:3vw 3vw 0 3.3vw}
     .summaryWrap .summary .delete{width:12vw;height:6vw;line-height:6vw;display:inline-block;text-align:center;color:#f55c5c}
+    .summaryWrap .summary .totalPrice{line-height: 5.1vw;font-size: 3.4vw;}
+    .summaryWrap .summary .totalPrice.none{line-height: 11.2vw;}
+    .summaryWrap .summary .totalPrice span{color: #f55c5c;}
+    .summaryWrap .summary .totalCoupon{font-size:3vw;line-height:5.1vw;color: #f55c5c;text-align: left;}
     .summaryWrap .summary .submit{display:inline-block;width:30.4vw;height:11.2vw;line-height:11.2vw;text-align:center;background-color:#e15616;border-radius:2px;color:#FFF;float: right;}
     .summaryWrap.fixed{position:fixed;bottom:0;left:0;margin:0;z-index:99999;box-shadow:20px 20px 102px rgba(0,0,0,0.1)}
     .priceTotal{position:relative;text-align:right;margin-left:6.8vw;height:10.6vw;line-height:18vw;display:inline-block;}

+ 6 - 4
src/main/resources/static/css/user-center/account/coupon-collection.css

@@ -19,8 +19,9 @@ li{list-style:none}
     .coupon-list-cell .coupon-list-money .maxMoney{font-size: 40px;margin-right: 8px;}
     .coupon-list-cell .coupon-list-name{width: 100%;height: 22px;line-height: 22px;color: #333333;font-size: 14px;text-align: left;margin-top: 13px;}
     .coupon-list-cell .coupon-list-time{width: 100%;height: 22px;line-height: 22px;color: #999999;font-size: 12px;text-align: left;}
-    .coupon-list-cell .coupon-list-ri{width: 70px;height: 148px;float: left;box-sizing: border-box;padding: 54px 27px;font-size: 16px;color: #FFF;cursor: pointer;}
-    .coupon-list-cell .coupon-list-ri.none{padding: 45px 27px;}
+    .coupon-list-cell .coupon-list-ri{width: 70px;height: 148px;float: left;box-sizing: border-box;font-size: 16px;color: #FFF;cursor: pointer;}
+    .coupon-list-cell .coupon-list-ri span{display: block;width: 100%;height: 100%;box-sizing: border-box;padding: 45px 27px;}
+    .coupon-list-cell .coupon-list-ri span.none{padding: 54px 27px;}
     .coupon-list-cell .coupon-tags{height: 24px;line-height: 24px;text-align: center;border-radius: 8px 0 8px 0;position: absolute;top: 0;left: 0;padding: 0 10px;background-color: #f94b4b;color: #FFF;}
     .empty{width: 100%;float: left;}
     .empty img{width: 180px;height: 180px;}
@@ -42,8 +43,9 @@ li{list-style:none}
     .coupon-list-cell .coupon-list-money.none, .coupon-list-cell .coupon-list-name.none, .coupon-list-cell .coupon-list-time.none{color: #FFF;}
     .coupon-list-cell .coupon-list-name{width: 100%;height: 4.8vw;line-height: 4.8vw;color: #333333;font-size: 3.4vw;text-align: left;margin-top: 4vw;}
     .coupon-list-cell .coupon-list-time{width: 100%;height: 4.8vw;line-height: 4.8vw;color: #999999;font-size: 2.4vw;text-align: left;}
-    .coupon-list-cell .coupon-list-ri{width: 15.5vw;height: 33vw;float: left;box-sizing: border-box;padding: 11.8vw 6vw;font-size:3.4vw;color: #FFF;cursor: pointer;}
-    .coupon-list-cell .coupon-list-ri.none{padding: 9.5vw 6vw;}
+    .coupon-list-cell .coupon-list-ri{width: 15.5vw;height: 33vw;float: left;box-sizing: border-box;font-size:3.4vw;color: #FFF;cursor: pointer;}
+    .coupon-list-cell .coupon-list-ri span{display: block;width: 100%;height: 100%;box-sizing: border-box;padding: 9.5vw 6vw;}
+    .coupon-list-cell .coupon-list-ri span.none{padding: 11.8vw 6vw;}
     .coupon-list-cell .coupon-tags{height: 4.8vw;line-height: 4.8vw;text-align: center;background-color: #f94b4b;color: #FFF;border-radius: 1.6vw 0 1.6vw 0;position: absolute;top: 0;left: 0;padding: 0 1.5vw;font-size: 3vw;}
     .coupon-list-cell{background: url("/img/account/icon-coupon-uesb@h52x.png") no-repeat;background-size: cover;}
     .empty{width: 100%;float: left;}

BIN
src/main/resources/static/img/cart/icon_weigouxuan@2x.png


BIN
src/main/resources/static/img/cart/icon_yixuanze@2x.png


+ 37 - 40
src/main/resources/static/js/shopping/confirm.js

@@ -123,7 +123,7 @@ var shoppingConfirm = new Vue({
             var el = event.currentTarget;
             verifyHandle(el);
         },
-        getConfirmList: function (productCount) {
+        getConfirmList: function (productCount) {// 初始化确认订单信息
             var _self = this;
             if(this.userId ===0){return;}
             OrderApi.GetOrderConfirmInfo({
@@ -135,31 +135,29 @@ var shoppingConfirm = new Vue({
                     var data = response.data;
                     _self.listData = data.list;
                     _self.totalPrice =  data.totalPrice;
-                    _self.reducedPrice = data.reducedPrice;
+                    _self.totalDiscountAmount = _self.reducedPrice = data.reducedPrice;
                     _self.totalCount =  data.totalCount;
-                    _self.couponList = data.couponList;
                     _self.kindCount = data.kindCount;
                     _self.balance.userMoney = data.userMoney;
                     _self.balance.originUserMoney = data.userMoney;
                     _self.payInfo.orderShouldPayFee = data.totalPrice;
-                    if(_self.couponList.length>0){
+                    _self.getAddressList(_self.userId,20);
+                    if( data.couponList &&  data.couponList.length>0){
                         _self.isCouponShow = true;
-                        _self.couponList.forEach((el,index) => {
-                            _self.dataList.push(Object.assign({},el,{ischecked:false}))
+                        data.couponList.forEach((el) => {
+                            _self.couponList.push(Object.assign(el,{ischecked:false}))
                         })
                     }
                     if(data.invoice){
                         data.invoice.type = 0;
                         _self.invoice =  data.invoice;
                     }
-                    _self.getAddressList(_self.userId,20);
                 }else{
                     CAIMEI.Alert(r.msg, '确定', false);
                 }
             });
         },
-        // 获取邮费
-        getFreight: function(townId){
+        getFreight: function(townId){// 获取邮费
             var _self = this;
             OrderApi.GetOrderPostage({
                 userId: this.userId,
@@ -214,8 +212,7 @@ var shoppingConfirm = new Vue({
                 }
             })
         },
-        // 获取收货地址
-        getAddressList: function(userId,pageSize){
+        getAddressList: function(userId,pageSize){ // 获取收货地址
             var _self = this;
             OrderApi.GetAddressList({
                 userID:userId,
@@ -248,8 +245,7 @@ var shoppingConfirm = new Vue({
                 }
             })
         },
-        // 获取全部省份
-        getProvinceOptions: function(){
+        getProvinceOptions: function(){ // 获取全部省份
             var _self = this;
             PublicApi.GetProvince({},function(r){
                 if(r.code === 0 && r.data){
@@ -259,7 +255,7 @@ var shoppingConfirm = new Vue({
                 }
             });
         },
-        getCityOptions: function(provinceId,callback){
+        getCityOptions: function(provinceId,callback){// 获取地区
             var _self = this;
             if(provinceId && provinceId>0){
                 _self.cityOptions = [];
@@ -291,19 +287,19 @@ var shoppingConfirm = new Vue({
                 })
             }
         },
-        showAddressBox: function(){
+        showAddressBox: function(){// 显示地址弹窗
             this.isShowAddressList = true;
             if(!isPC){fixedBody();}
         },
-        closeAddressBox: function(){
+        closeAddressBox: function(){// 关闭地址弹窗
             this.isShowAddressList = false;
             if(!isPC){looseBody();}
         },
-        hideAddressForm: function(){
+        hideAddressForm: function(){// 隐藏地址表单
             this.isShowAddressForm = false;
             if(!isPC){looseBody();}
         },
-        createAddress: function(){
+        createAddress: function(){// 新建地址
             this.isShowAddressForm = true;
             this.addressForm.name= '';
             this.addressForm.mobile= '';
@@ -315,7 +311,7 @@ var shoppingConfirm = new Vue({
             this.getProvinceOptions();
             if(!isPC){fixedBody();}
         },
-        updateAddress: function(){
+        updateAddress: function(){// 更新选择地址
             this.isShowAddressForm = true;
             this.addressForm.id = this.address.id;
             this.addressForm.name = this.address.name;
@@ -332,7 +328,7 @@ var shoppingConfirm = new Vue({
             });
             if(!isPC){fixedBody();}
         },
-        saveAddressForm: function(){
+        saveAddressForm: function(){// 更新保存地址
             var _self = this;
             var pass = verifyForm();
             if (_self.saveLoading) { return false; }
@@ -358,7 +354,7 @@ var shoppingConfirm = new Vue({
                 _self.saveAddress(params);
             });
         },
-        saveAddress: function(params){
+        saveAddress: function(params){// 更新保存地址
             var _self = this;
             OrderApi.AddSaveAddress(params,function(r){
                 if(r.code === 0){
@@ -372,8 +368,7 @@ var shoppingConfirm = new Vue({
                 }
             });
         },
-        // 列表直接设为默认地址
-        setDefaultAddress: function(addressId){
+        setDefaultAddress: function(addressId){// 列表直接设为默认地址
             var _self = this;
             OrderApi.DefaultAddress({addressId:addressId,userId:_self.userId},function (r) {
                 if(r.code === 0 ){
@@ -384,8 +379,7 @@ var shoppingConfirm = new Vue({
                 }
             });
         },
-        // 列表删除单个地址
-        deleteAddress: function(addressId){
+        deleteAddress: function(addressId){// 列表删除单个地址
             var _self = this;
             CAIMEI.Modal('确定要删除该地址?','取消','确定',function () {
                 OrderApi.DeleteAddress({addressID:addressId,userID:_self.userId},function (r) {
@@ -402,7 +396,7 @@ var shoppingConfirm = new Vue({
         chooseAddress: function(selectedId){
             this.address.selectedId = selectedId;
         },
-        confirmAddress: function(){
+        confirmAddress: function(){// 确认地址并查询邮费
             var _self = this;
             this.addressList.forEach(function(item){
                 if (_self.address.selectedId==item.addressID){
@@ -422,7 +416,7 @@ var shoppingConfirm = new Vue({
             });
             this.closeAddressBox();
         },
-        checkedCoupon:function(coupon,idx){// 选择优惠券
+        checkedCoupon:function(idx){// 选择优惠券
             var _self = this;
             var coupon = { couponAmount:0,clubCouponId:0 };
             _self.checkedIndex = idx;
@@ -437,9 +431,12 @@ var shoppingConfirm = new Vue({
                     coupon.clubCouponId = el.clubCouponId;
                 }
             })
+            console.log('couponList',_self.couponList);
             _self.couponAmount = coupon.couponAmount;
             _self.totalDiscountAmount = _self.reducedPrice + _self.couponAmount;
             _self.clubCouponId = coupon.clubCouponId;
+            _self.changeDeductibleFreight();
+            _self.useUserMoney();
             console.log('couponAmount',_self.couponAmount)
             console.log('totalDiscountAmount',_self.totalDiscountAmount)
             console.log('clubCouponId',_self.clubCouponId)
@@ -469,22 +466,22 @@ var shoppingConfirm = new Vue({
                         if(_self.balance.userMoney>=total){ // 全部抵扣
                             _self.payInfo.orderShouldPayFee = 0;
                             if(_self.balance.isFreight){// 勾选了采美豆丢运费
-                                _self.balance.deductMoney = _self.totalPrice; // 抵扣使用金额 = 订单总金额
+                                _self.balance.deductMoney = _self.totalPrice - _self.couponAmount; // 抵扣使用金额 = 订单总金额
                                 _self.balance.surplusMoney = _self.repiceNumSub(_self.balance.userMoney,_self.totalPrice); // 抵扣后剩余余额 = 余额总额 - (订单总金额+邮费金额)
                                 console.log('余额全部抵扣勾选了采美豆运费',_self.balance.surplusMoney)
                             }else{
-                                _self.balance.deductMoney = total; // 抵扣使用金额 = 订单总金额 + 邮费金额
+                                _self.balance.deductMoney = total - _self.couponAmount; // 抵扣使用金额 = 订单总金额 + 邮费金额 - 优惠券金额
                                 _self.balance.surplusMoney = _self.repiceNumSub(_self.balance.userMoney,_self.balance.deductMoney); // 抵扣后剩余余额 = 余额总额 - 抵扣使用金额
                                 console.log('余额全部抵扣未勾选了采美豆运费',_self.balance.surplusMoney)
                             }
                         }else{ // 部分抵扣
                             if(_self.balance.isFreight){// 勾选了采美豆丢运费
-                                _self.payInfo.orderShouldPayFee = _self.repiceNumSub(_self.totalPrice,_self.balance.userMoney); // 最终订单总价 = 订单总金额 - 余额总额
+                                _self.payInfo.orderShouldPayFee = _self.repiceNumSub(_self.totalPrice,_self.balance.userMoney) - _self.couponAmount; // 最终订单总价 = 订单总金额 - 余额总额
                                 _self.balance.deductMoney = _self.balance.userMoney; // 抵扣使用金额 = 余额总额
                                 _self.balance.surplusMoney = 0; // 抵扣后剩余余额 = 0
                                 console.log('部分抵扣勾选了采美豆运费',_self.payInfo.orderShouldPayFee)
                             }else{
-                                _self.payInfo.orderShouldPayFee = _self.repiceNumSub(total,_self.balance.userMoney); // 最终订单总价 = 订单总金额 - 余额总额
+                                _self.payInfo.orderShouldPayFee = _self.repiceNumSub(total,_self.balance.userMoney) - _self.couponAmount; // 最终订单总价 = 订单总金额 - 余额总额
                                 _self.balance.deductMoney = _self.balance.userMoney; // 抵扣使用金额 = 余额总额
                                 _self.balance.surplusMoney = 0; // 抵扣后剩余余额 = 0
                                 console.log('部分抵扣没有勾选了采美豆运费',_self.payInfo.orderShouldPayFee)
@@ -496,9 +493,9 @@ var shoppingConfirm = new Vue({
                         _self.balance.deductMoney = 0;
                         _self.balance.surplusMoney = _self.balance.originUserMoney;
                         if(_self.balance.isFreight){//判断是否有采美豆抵扣运费
-                            _self.payInfo.orderShouldPayFee = _self.totalPrice; // 最终订单总价 = 订单总金额
+                            _self.payInfo.orderShouldPayFee = _self.totalPrice - _self.couponAmount; // 最终订单总价 = 订单总金额
                         }else{
-                            _self.payInfo.orderShouldPayFee = total; // 最终订单总价 = 订单总金额 + 邮费金额
+                            _self.payInfo.orderShouldPayFee = total - _self.couponAmount; // 最终订单总价 = 订单总金额 + 邮费金额
                         }
                         console.log('取消余额抵扣',_self.payInfo.orderShouldPayFee)
                     }
@@ -520,14 +517,14 @@ var shoppingConfirm = new Vue({
                                 _self.balance.surplusMoney = _self.repiceNumSub(_self.balance.userMoney,_self.balance.deductMoney);  // 抵扣后剩余余额 = 余额总额 - 抵扣使用金额
                                 console.log('有勾选余额抵扣全抵',_self.payInfo.orderShouldPayFee)
                             }else{ // 部分抵扣
-                                _self.payInfo.orderShouldPayFee = _self.repiceNumSub(_self.totalPrice,_self.balance.userMoney);
+                                _self.payInfo.orderShouldPayFee = _self.repiceNumSub(_self.totalPrice,_self.balance.userMoney) - _self.couponAmount;
                                 _self.balance.deductMoney = _self.balance.userMoney; // 抵扣使用金额 = 余额总额
                                 _self.balance.surplusMoney = _self.repiceNumSub(_self.balance.userMoney,_self.balance.deductMoney); // 抵扣后剩余余额 = 余额总额 - 抵扣使用金额
                                 console.log('有勾选余额抵扣部分抵',_self.payInfo.orderShouldPayFee)
                             }
                         }else{
                             console.log('订单总额2222222',total)
-                            _self.payInfo.orderShouldPayFee = (_self.totalPrice*100 + _self.payInfo.freight*100 - _self.freightBeansMoney*100)/100;
+                            _self.payInfo.orderShouldPayFee = ((_self.totalPrice*100 + _self.payInfo.freight*100 - _self.freightBeansMoney*100)/100) - _self.couponAmount;
                             console.log('无余额抵扣',_self.payInfo.orderShouldPayFee)
                         }
                     }
@@ -540,18 +537,18 @@ var shoppingConfirm = new Vue({
                             _self.balance.surplusMoney = _self.repiceNumSub(_self.balance.userMoney,_self.balance.deductMoney);  // 抵扣后剩余余额 = 余额总额 - 抵扣使用金额
                             console.log('到付有勾选余额抵扣全抵',_self.payInfo.orderShouldPayFee)
                         }else{ // 部分抵扣
-                            _self.payInfo.orderShouldPayFee = _self.repiceNumSub(_self.totalPrice,_self.balance.userMoney);
+                            _self.payInfo.orderShouldPayFee = _self.repiceNumSub(_self.totalPrice,_self.balance.userMoney) - _self.couponAmount;
                             _self.balance.deductMoney = _self.balance.userMoney; // 抵扣使用金额 = 余额总额
                             _self.balance.surplusMoney = _self.repiceNumSub(_self.balance.userMoney,_self.balance.deductMoney); // 抵扣后剩余余额 = 余额总额 - 抵扣使用金额
                             console.log('到付有勾选余额抵扣部分抵',_self.payInfo.orderShouldPayFee)
                         }
                     }else{
-                        _self.payInfo.orderShouldPayFee = _self.totalPrice ;
+                        _self.payInfo.orderShouldPayFee = _self.totalPrice - _self.couponAmount ;
                         console.log('到付未勾选余额抵扣',_self.payInfo.orderShouldPayFee)
                     }
                 }else{
                     _self.hanldUserBeans = 0;
-                    _self.payInfo.orderShouldPayFee = _self.totalPrice ;
+                    _self.payInfo.orderShouldPayFee = _self.totalPrice - _self.couponAmount ;
                     console.log('其他',_self.payInfo.orderShouldPayFee)
                 }
             }else{
@@ -566,13 +563,13 @@ var shoppingConfirm = new Vue({
                         console.log('余额全抵抵未勾选采美豆抵扣',_self.payInfo.orderShouldPayFee)
                     }else{
                         console.log('未勾选采美豆抵扣=========》',total)
-                        _self.payInfo.orderShouldPayFee = _self.repiceNumSub(total,_self.balance.userMoney) ;
+                        _self.payInfo.orderShouldPayFee = _self.repiceNumSub(total,_self.balance.userMoney) - _self.couponAmount;
                         _self.balance.deductMoney = _self.balance.userMoney; // 抵扣使用金额 = (订单总金额+邮费金额)
                         _self.balance.surplusMoney = _self.repiceNumSub(_self.balance.userMoney,_self.balance.deductMoney); // 抵扣后剩余余额 = 余额总额 - 抵扣使用金额
                         console.log('余额部分抵未勾选采美豆抵扣',_self.payInfo.orderShouldPayFee)
                     }
                 }else{
-                    _self.payInfo.orderShouldPayFee = _self.totalPrice + _self.payInfo.freight;
+                    _self.payInfo.orderShouldPayFee = (_self.totalPrice + _self.payInfo.freight) - _self.couponAmount;
                 }
             }
         },

+ 22 - 12
src/main/resources/static/js/user-center/account/coupon-collection.js

@@ -82,7 +82,7 @@ var orderPage = new Vue({
             _self.isRequset = true;
             _self.QueryCouponCollarList()
         },
-        QueryCouponCollarList:function(){//查询订单列表
+        QueryCouponCollarList:function(){//查询优惠券列表
             var _self = this;
             ProductApi.QueryCouponCollarList(_self.listQuery,function (response) {
                 if(response.code == 0){
@@ -104,12 +104,17 @@ var orderPage = new Vue({
         },
         receiveCoupon:function(coupon){// 点击领取按钮事件处理
             var  _self = this;
+            console.log(coupon)
             if(_self.listQuery.userId == 0){
                 window.location.href='/login.html';
             }else{
                 ProductApi.ReceiveCoupon({userId:_self.listQuery.userId, couponId:coupon.couponId, source:1}, function (response) {
                     if(response.code == 0){
-                        coupon.couponBtnType = 1;
+                        CAIMEI.dialog('领取成功',true,function () {
+                            setTimeout(function(){
+                                coupon.couponBtnType = 1;
+                            },200)
+                        });
                     }else{
                         CAIMEI.Alert(response.msg, '确定', false);
                     }
@@ -125,32 +130,37 @@ var orderPage = new Vue({
             }
         },
         toUseCoupon:function (coupon){// 去使用跳转路径
-            console.log('coupon',coupon)
+            var _self = this;
             switch (coupon.couponType) {
                 case 0:// 活动券跳转到商城首页 / 或者活动页(看是否指定了商品)
                     if(coupon.productType == 1){
-                        window.location.href='/index.html';
+                        _self.QueryCouponCollarList()
+                        window.open('/index.html');
                     }else{
-                        window.location.href='/product/product-coupon.html?couponId='+coupon.couponId;
+                        _self.QueryCouponCollarList()
+                        window.open('/product/product-coupon.html?couponId='+coupon.couponId);
                     }
                     break;
                 case 1:// 品类券:跳转到产品 / 仪器页
                     if(coupon.categoryType == 1){
-                        window.location.href='/product/type-287.html';
+                        _self.QueryCouponCollarList()
+                        window.open('/product/type-287.html');
                     }else{
-                        window.location.href='/product/type-286.html';
+                        _self.QueryCouponCollarList()
+                        window.open('/product/type-286.html');
                     }
                     break;
                 case 2:// 专享券:跳转到商城首页
-                    window.location.href='/index.html';
+                    _self.QueryCouponCollarList()
+                    window.open('/index.html');
                     break;
                 case 3:// 店铺券:跳转到店铺首页
-                    console.log('22222222222')
-                    window.location.href='/supplier-'+coupon.shopId+'.html';
-                    debugger
+                    _self.QueryCouponCollarList()
+                    window.open('/supplier-'+coupon.shopId+'.html');
                     break;
                 case 4:// 新用户券:跳转到商城首页
-                    window.location.href='/index.html';
+                    _self.QueryCouponCollarList()
+                    window.open('/index.html');
                     break;
             }
         }

+ 7 - 4
src/main/resources/templates/shopping/confirm.html

@@ -292,7 +292,7 @@
             <a href="/user/coupon-exchange.html">兑换优惠券</a>
         </h2>
         <div class="couponWrap" v-if="isCouponShow">
-            <div class="coupon-list-cell" v-for="(coupon, index) in couponList" :key="index">
+            <div class="coupon-list-cell" v-for="(coupon, index) in couponList" :key="index" @click="checkedCoupon(index)">
                 <div class="coupon-list-le">
                     <div class="coupon-list-money">
                         <p>¥<span class="maxMoney">{{ coupon.couponAmount }}</span><span class="minMoney">满{{ coupon.touchPrice }}可用</span></p>
@@ -308,7 +308,7 @@
                         <p v-if="coupon.couponType == 4 || coupon.couponType == 2">全商城商品通用</p>
                     </div>
                     <div class="coupon-list-time">{{ coupon.endDate }}</div>
-                    <input class="coupon-list-checked" v-model="coupon.ischecked" name="useBalance" type="checkbox" @click="checkedCoupon(coupon,index)">
+                    <span class="coupon-list-checked" :class="[coupon.ischecked ?'checked':'']"></span>
                 </div>
                 <div class="coupon-list-ri"><span>已领取</span></div>
                 <div class="coupon-tags">{{ coupon.couponType | TypeFormat }}</div>
@@ -323,7 +323,7 @@
                 <span v-if="payInfo.freePostFlag==1"><em>¥{{payInfo.freight | NumFormat}}</em></span>
             </p>
             <p v-if="reducedPrice>0">促销满减: <span><em>- ¥{{reducedPrice | NumFormat}}</em></span></p>
-            <p>优惠券: <span><em>- ¥{{reducedPrice | NumFormat}}</em></span></p>
+            <p>优惠券: <span><em>- ¥{{couponAmount | 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>
             <p class="pis" v-if="isBeansShow">
@@ -345,7 +345,10 @@
                 </div>
             </div>
             <div class="right mfbt">
-                <div class="item">总价:<em>¥{{payInfo.orderShouldPayFee | NumFormat}}</em></div>
+                <div class="totalMoney">
+                    <div class="totalPrice" :class="totalDiscountAmount == 0 ? 'none' : ''">总价:<span>¥{{payInfo.orderShouldPayFee | NumFormat}}</span></div>
+                    <div class="totalCoupon" v-if="totalDiscountAmount > 0">共减:¥{{ totalDiscountAmount | NumFormat }}</div>
+                </div>
                 <a :class="submitLoading?'submit dis':'submit'" href="javascript:void(0);" @click="submitOrder()" onclick="_czc.push(['_trackEvent','确认订单','点击','用户提交订单','','Um_Event_ConfirmOrder'])">提交订单</a>
             </div>
         </div>

+ 2 - 2
src/main/resources/templates/user-center/account/coupon-collection.html

@@ -42,8 +42,8 @@
                 </div>
                 <div class="coupon-list-time">{{ coupon.endDate }}</div>
               </div>
-              <div class="coupon-list-ri" :class="coupon.couponBtnType == 1 ? 'none' : ''">
-                <span v-if="coupon.couponBtnType == 0" @click="receiveCoupon(coupon)">领取</span>
+              <div class="coupon-list-ri">
+                <span class="none" v-if="coupon.couponBtnType == 0" @click="receiveCoupon(coupon)">领取</span>
                 <span v-if="coupon.couponBtnType == 1" @click="toUseCoupon(coupon)">去使用</span>
               </div>
               <div class="coupon-tags">{{ coupon.couponType | TypeFormat }}</div>

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

@@ -71,8 +71,8 @@
                                     <p v-if="orderInfo.freePostFlag == '1'">运费:<span class="none">¥{{orderInfo.freight | NumFormat}}</span> </p>
                                     <p v-if="orderInfo.userBeans>0">采美豆抵用运费:<span class="none" >{{orderInfo.userBeans }}</span> </p>
                                     <p v-if="orderInfo.discountFee>0">经理折扣:<span class="none">¥{{orderInfo.discountFee | NumFormat}}</span> </p>
-                                    <p v-if="orderInfo.promotionFullReduction>0">促销满减:<span class="none">¥{{orderInfo.promotionFullReduction | NumFormat}}</span> </p>
-                                    <p>优惠券:<span class="red">¥{{orderInfo.promotionFullReduction | NumFormat}}</span> </p>
+                                    <p v-if="orderInfo.promotionFullReduction>0">促销满减:<span class="red">¥{{orderInfo.promotionFullReduction | NumFormat}}</span> </p>
+                                    <p>优惠券:<span class="red">¥{{orderInfo.couponAmount | NumFormat}}</span> </p>
                                     <p v-if="orderInfo.presentCount>0">赠品数:<span class="none">{{orderInfo.presentCount}}</span></p>
                                 </div>
                             </div>