喻文俊 пре 3 година
родитељ
комит
1ea5f34cd9

+ 1 - 1
src/main/resources/static/js/supplier/index.js

@@ -27,7 +27,7 @@ var supplierHome = new Vue({
     methods: {
         // 是否显示vip标签价格
         showVipPriceTag: function(product){
-            return (product.priceFlag !== 1 && ((GLOBAL_USER_IDENTITY === 4 && GLOBAL_VIP_FLAG === 1) || GLOBAL_USER_IDENTITY === 2));
+            return (product.priceFlag !== 1 && product.svipProductFlag === 1 && ((GLOBAL_USER_IDENTITY === 4 && GLOBAL_VIP_FLAG === 1) || GLOBAL_USER_IDENTITY === 2));
         },
         getShopInfo: function(){
             var _self = this;

+ 45 - 46
src/main/resources/static/js/user-center/member/memberPage.js

@@ -99,7 +99,7 @@ var memberPage = new Vue({
                 if (res.code === 0) {
                     _self.vipInfo = res.data.vip;
                     window.localStorage.setItem('vipInfo', JSON.stringify(_self.vipInfo));
-                    _self.couponList = _self.initCouponInfo(res.data.coupon.splice(0,4));
+                    _self.couponList = _self.initCouponInfo(res.data.coupon.splice(0, 4));
                     console.log(_self.couponList);
                 } else {
                     CAIMEI.Alert(response.msg, '确定', false);
@@ -140,11 +140,11 @@ var memberPage = new Vue({
             var _self = this;
             var currentPackage = _self.comboInfo[this.currentIndex];
             var popupParams = {
-                content:'确认使用' + (currentPackage.price * currentPackage.proportion) + '采美豆开通' + (currentPackage.duration) + '个月会员?' ,
+                content: '确认使用' + (currentPackage.price * currentPackage.proportion) + '采美豆开通' + (currentPackage.duration) + '个月会员?',
                 confitmBtnText: '确认开通',
                 cancelBtnText: '取消',
             };
-            CAIMEI.Popup(popupParams, function(){
+            CAIMEI.Popup(popupParams, function () {
                 console.log('采美豆支付');
                 var params = {
                     userId: GLOBAL_USER_ID,
@@ -166,17 +166,17 @@ var memberPage = new Vue({
             });
         },
         // 获取套餐
-        fetchSuperPackage: function(){
+        fetchSuperPackage: function () {
             var _self = this;
-            UserApi.FetchSuperPackage({}, function(response){
+            UserApi.FetchSuperPackage({}, function (response) {
                 console.log(response);
-                if(response.code === 0){
+                if (response.code === 0) {
                     _self.comboInfo = response.data;
                 }
             })
         },
         // 初始化优惠券信息
-        initCouponInfo: function(couponList){
+        initCouponInfo: function (couponList) {
             var typeText = {
                 0: '活动券',
                 1: '品类券',
@@ -184,45 +184,44 @@ var memberPage = new Vue({
                 3: '店铺券',
                 4: '新用户券'
             };
-            return couponList.map(function(item, index){
+            return couponList.map(function (item, index) {
                 item.typeText = typeText[item.couponType];
                 return item;
             })
         },
         // 点击去使用跳转路由处理
-        toUseCoupon:function(coupon){
-            if(coupon.useStatus === 1){
-                switch (coupon.couponType) {
-                    case 0:// 活动券跳转到商城首页 / 或者活动页(看是否指定了商品)
-                        if(coupon.productType === 1){
-                            window.location.href='/index.html';
-                        }else{
-                            window.location.href='/product/product-coupon.html?couponId='+coupon.couponId;
-                        }
-                        break;
-                    case 1:// 品类券:跳转到产品 / 仪器页
-                        if(coupon.categoryType === 1){
-                            window.location.href='/product/type-287.html';
-                        }else{
-                            window.location.href='/product/type-286.html';
-                        }
-                        break;
-                    case 2:// 专享券:跳转到商城首页
-                        window.location.href='/index.html';
-                        break;
-                    case 3:// 店铺券:跳转到店铺首页
-                        window.location.href='/supplier-'+coupon.shopId+'.html';
-                        debugger
-                        break;
-                    case 4:// 新用户券:跳转到商城首页
-                        window.location.href='/index.html';
-                        break;
-                }
+        toUseCoupon: function (coupon) {
+            console.log(coupon);
+            switch (coupon.couponType) {
+                case 0:// 活动券跳转到商城首页 / 或者活动页(看是否指定了商品)
+                    if (coupon.productType === 1) {
+                        window.location.href = '/index.html';
+                    } else {
+                        window.location.href = '/product/product-coupon.html?couponId=' + coupon.couponId;
+                    }
+                    break;
+                case 1:// 品类券:跳转到产品 / 仪器页
+                    if (coupon.categoryType === 1) {
+                        window.location.href = '/product/type-287.html';
+                    } else {
+                        window.location.href = '/product/type-286.html';
+                    }
+                    break;
+                case 2:// 专享券:跳转到商城首页
+                    window.location.href = '/index.html';
+                    break;
+                case 3:// 店铺券:跳转到店铺首页
+                    window.location.href = '/supplier-' + coupon.shopId + '.html';
+                debugger
+                    break;
+                case 4:// 新用户券:跳转到商城首页
+                    window.location.href = '/index.html';
+                    break;
             }
         },
 
         // 领取专属优惠券
-        receiveCoupon: function(id){
+        receiveCoupon: function (id) {
             var _self = this;
             ProductApi.ReceiveCoupon({
                 userId: GLOBAL_USER_ID,
@@ -236,39 +235,39 @@ var memberPage = new Vue({
                         }
                         return item;
                     });
-                    CAIMEI.dialog(response.data,false);
+                    CAIMEI.dialog(response.data, false);
                 }
             })
         },
         // 续费弹窗
-        handleShowRenewPopup: function(){
+        handleShowRenewPopup: function () {
             this.fetchSuperPackage();
             this.currentIndex = 1;
             this.showMask = true;
             this.showRenewPopup = true;
         },
         // 关闭续费弹窗
-        handleCloseRenewPopup: function(){
+        handleCloseRenewPopup: function () {
             this.showMask = false;
             this.showRenewPopup = false;
         },
         // 获取页面优惠商品
-        getSvipProductList: function() {
+        getSvipProductList: function () {
             var _self = this;
             ProductApi.GetSvipProductList(this.listQuery, function (res) {
                 if (res.code) return;
                 var resultData = res.data;
-                if (isPC){
-                    _self.productList = resultData.svipProductPage.results.splice(0,5);
-                }else {
-                    _self.productList = resultData.svipProductPage.results.splice(0,6);
+                if (isPC) {
+                    _self.productList = resultData.svipProductPage.results.splice(0, 5);
+                } else {
+                    _self.productList = resultData.svipProductPage.results.splice(0, 6);
                 }
                 setTimeout(function () {
                     $("img[data-original]").lazyload();
                 });
             })
         },
-        makePrice: function(product) {
+        makePrice: function (product) {
             if (!product) return;
             // 普通商品
             var priceFlag = parseInt(product.priceFlag);  //商品可见度 0公开价格 1不公开价格 2仅对会员机构公开

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

@@ -87,7 +87,7 @@
                                 <div class="condition">满{{ item.touchPrice }}可用</div>
                                 <div class="condition" v-html="item.productType === 1 ? '全商城商品通用' : '指定商品可用'"></div>
                                 <div class="receive-btn" v-if="!item.getFlag" @click="receiveCoupon(item.couponId)">立即领取</div>
-                                <div class="receive-btn" v-else @click="toUseCoupon(item)">去使用</div>
+                                <div class="receive-btn" v-else  @click="toUseCoupon(item)">去使用</div>
                             </div>
                         </template>
                         <span v-else>暂无可领取优惠券~</span>