Browse Source

Merge remote-tracking branch 'origin/developerB' into developer

zhengjinyi 2 năm trước cách đây
mục cha
commit
bc76d639ec

+ 2 - 1
src/main/resources/static/css/index/index_new.pc.css

@@ -73,7 +73,8 @@ li{list-style:none;}
 .section_right  .item_text .item_text_name:before{content:'';width:4px;height:4px;border-radius:50%;background-color:#cccccc;position:absolute;left:0;top:11px}
 .section_right  .item_text .item_text_time{float:right}
 .section_right .item_text .item_text_name.info{width:164px;}
-.section_right  .item_text:hover{color:#E15616;text-decoration:underline}
+.section_right  .item_text:hover{color:#E15616;}
+.section_right  .item_text:hover .item_text_name{text-decoration:underline;}
 .section_right  .item_text:hover .item_text_name:before{background-color:#E15616}
 
 footer{width:100%;height:auto;float:left}

+ 6 - 3
src/main/resources/static/js/document/beautyArchiveDetailMixin.js

@@ -115,7 +115,8 @@ var beautyArchiveDetailMixin = {
                 CAIMEI.Popup({
                     content: suffix + '类型文件暂时无法预览',
                     confitmBtnText: '确定',
-                    cancelBtnText: '取消'
+                    cancelBtnText: '取消',
+                    closeIcon:true
                 }, function () {
                 }, function () {
                 });
@@ -146,7 +147,8 @@ var beautyArchiveDetailMixin = {
                 CAIMEI.Popup({
                     content: '确认使用采美豆',
                     confitmBtnText: '确定',
-                    cancelBtnText: '取消'
+                    cancelBtnText: '取消',
+                    closeIcon:true
                 }, function () {
                     _self.SearchArchiveByBeans()
                 }, function () {
@@ -162,7 +164,8 @@ var beautyArchiveDetailMixin = {
             CAIMEI.Popup({
                 content: _self.TipStatus.text,
                 confitmBtnText: _self.TipStatus.btn,
-                cancelBtnText: '取消'
+                cancelBtnText: '取消',
+                closeIcon:true
             }, function () {
                 // 确认 执行 下一步  链接跳转 支付支付采美豆
                 _self.handleClickToPage(_self.TipStatus.redirect);

+ 61 - 48
src/main/resources/static/js/product/detail.js

@@ -221,10 +221,7 @@ var productDetail = new Vue({
                     if (product.stock == 0 && product.validFlag != 3) {
                         _self.disabledText = '售罄'
                     }
-                    if(product.productType === 2 && (GLOBAL_CLUB_TYPE != 1)){
-                        _self.isHideButton = true
-                        _self.handleShowProductType()
-                    }
+                    _self.handleShowProductType(product.commodityDetailsFlag);
                     _self.getRecommends();
                     _self.getProdcutArchiveDetails();  //获取资料列表
                     // 获取路由hash标识,设置默认展开tab
@@ -237,47 +234,64 @@ var productDetail = new Vue({
                 }
             })
         },
-        handleShowProductType: function (){
-            if(GLOBAL_USER_ID === 0){//游客
+        handleShowProductType: function (flag = ''){
+            // 根据商品详情可见度显示弹窗 flag 1.所有人可见 2.所有机构可见 3.仅会员机构可见 4.仅医美机构可见
+            let showModal = false;
+            const flagMap = {
+                '2': true,
+                '3': true,
+                '4': true
+            }
+            const textMap = {
+                '2': '该商品仅限已注册机构查看,请注册机构账户后继续查看。有采美账号的,请直接登录',
+                '3': '该商品仅限资质机构查看,请注册资质机构后继续查看。有采美账号的,请直接登录。',
+                '4': '该商品仅限医美类机构查看,请注册医美机构后继续查看。有采美账号的,请直接登录。',
+                '34': '该商品仅限资质机构查看,请升级为资质机构后继续查看。',
+                '44': '该商品仅限医美类机构查看,请升级为医美机构后继续查看。',
+                '42': '该商品仅限医美类机构查看,您暂无权限。您可去机构资料页面查看机构类型。'
+            }
+            const code = flag === 4 && GLOBAL_USER_IDENTITY === 2 && GLOBAL_CLUB_TYPE !== 1 ? '42' : `${flag}${GLOBAL_USER_IDENTITY}`
+            if (GLOBAL_USER_ID === 0) {
+                showModal = flagMap[flag];
+                this.showProsPopup(showModal,textMap[flag],'去注册/登录','/login.html')
+                return
+            }
+            if(GLOBAL_VIP_FLAG === 1){ return; }
+            if (flag === 3 && GLOBAL_USER_IDENTITY === 4) {
+                showModal = true
+                this.showProsPopup(showModal,textMap[code],'去升级','/user/setting/upgrade.html')
+                return
+            }
+            if (flag === 4 && GLOBAL_USER_IDENTITY === 4) {
+                showModal = true
+                this.showProsPopup(showModal,textMap[code],'去升级','/user/setting/upgrade.html')
+                return
+            }
+            if (flag === 4 && GLOBAL_USER_IDENTITY=== 2 && GLOBAL_CLUB_TYPE !== 1) {
+                showModal = true
+                this.showProsPopup(showModal,textMap[code],'去查看资料','/user/setting/information.html')
+                return
+            }
+        },
+        showProsPopup:function (showFlag,content,confitmBtnText,href) {// 商品详情限制弹窗
+            if(showFlag){
                 CAIMEI.Popup({
-                    content: '<div class="payAlert"><p>该商品仅限医美类机构查看,请注册医美机构后继续查看。有采美账号的,请直接登录。</p></div>',
-                    confitmBtnText: '去注册/登录',
-                    cancelBtnText: '关闭'
+                    content: `<div class="payAlert"><p>${content}</p></div>`,
+                    confitmBtnText: confitmBtnText,
+                    cancelBtnText: '关闭',
+                    closeIcon:false
                 },function(){
                     // 确定
-                    window.location.href = '/login.html';
+                    window.location.href = href;
                 },function(){
                     // 关闭
-                    window.history.back(-1);
-                });
-            }else{
-                if(GLOBAL_USER_IDENTITY === 4 ){// 普通机构
-                    CAIMEI.Popup({
-                        content: '<div class="payAlert"><p>该商品仅限医美类机构查看,请升级为医美机构后继续查看。</p></div>',
-                        confitmBtnText: '去升级',
-                        cancelBtnText: '关闭'
-                    },function(){
-                        // 确定
-                        window.location.href = '/user/setting/upgrade.html';
-                    },function(){
-                        // 关闭
-                        window.history.back(-1);
-                    });
-                }else if( GLOBAL_USER_IDENTITY === 2 ){//会员机构
-                    if(GLOBAL_CLUB_TYPE != 1){
-                        CAIMEI.Popup({
-                            content: '<div class="payAlert"><p>该商品仅限医美类机构查看,您暂无权限。您可去机构资料页面查看机构类型。</p></div>',
-                            confitmBtnText: '去查看资料',
-                            cancelBtnText: '关闭'
-                        },function(){
-                            // 确定
-                            window.location.href = '/user/setting/information.html';
-                        },function(){
-                            // 关闭
-                            window.history.back(-1);
-                        });
+                    if(document.referrer === ''){
+                        window.location.href="/index.html";
+                        window.close();
+                    }else{
+                        window.history.go(-1);
                     }
-                }
+                });
             }
         },
         getProductPrice: function () {//获取商品价格
@@ -810,15 +824,14 @@ var productDetail = new Vue({
         // this.getImages();
         // identity: 0个人,1协销,2会员机构,3供应商,4普通机构
         // visibility:3:所有人可见,2:普通机构可见,1:会员机构可见 4:仅医美机构可见
-        var visible = $("#productVisibility").val() * 1;
-        console.log('visible',visible)
-        var identity = GLOBAL_USER_IDENTITY;
-        this.identity = identity
-        console.log('identity',identity)
-        this.showProduct = visible === 3 || visible == 4 || identity === 1 || identity === 2 || (identity === 4 && visible === 2);
-        if (!this.showProduct) {
-            window.location.href = "/404.html?error=未查询到该商品";
-        }
+        // var visible = $("#productVisibility").val() * 1;
+        // console.log('visible',visible)
+        // var identity = GLOBAL_USER_IDENTITY;
+        // console.log('identity',identity)
+        // this.showProduct = visible === 3 || visible == 4 || identity === 1 || identity === 2 || (identity === 4 && visible === 2);
+        // if (!this.showProduct) {
+        //     window.location.href = "/404.html?error=未查询到该商品";
+        // }
     },
     mounted: function () {
         this.userId = this.couponParam.userId = GLOBAL_USER_ID;

+ 2 - 1
src/main/resources/static/js/supplier-center/article/article-list.js

@@ -153,7 +153,8 @@ var articleList = new Vue({
             var params = {
                 content: '确认删除改文章?',
                 cancelBtnText: '取消',
-                confitmBtnText: '删除'
+                confitmBtnText: '删除',
+                closeIcon:true
             };
             CAIMEI.Popup(params, function () {
                 that.articleDelete(article);

+ 2 - 1
src/main/resources/static/js/supplier-center/encyclopedia/instrument-list.js

@@ -195,7 +195,8 @@ var productList = new Vue({
             var params = {
                 content: '确认删除该仪器信息?',
                 cancelBtnText: '取消',
-                confitmBtnText: '删除'
+                confitmBtnText: '删除',
+                closeIcon:true
             };
             CAIMEI.Popup(params, function () {
                 that.productDelete(product);

+ 2 - 1
src/main/resources/static/js/supplier-center/encyclopedia/product-list.js

@@ -193,7 +193,8 @@ var productList = new Vue({
             var params = {
                 content: '确认删除该商品信息?',
                 cancelBtnText: '取消',
-                confitmBtnText: '删除'
+                confitmBtnText: '删除',
+                closeIcon:true
             };
             CAIMEI.Popup(params, function () {
                 that.productDelete(product);

+ 1 - 0
src/main/resources/static/js/user-center/member/memberPage.js

@@ -159,6 +159,7 @@ var memberPage = new Vue({
                 content: '确认使用' + (currentPackage.price * currentPackage.proportion) + '采美豆开通' + (currentPackage.duration) + '个月会员?',
                 confitmBtnText: '确认开通',
                 cancelBtnText: '取消',
+                closeIcon:true
             };
             CAIMEI.Popup(popupParams, function () {
                 console.log('采美豆支付');

+ 4 - 2
src/main/resources/static/js/user-center/order/detail.js

@@ -177,7 +177,8 @@ var orderPage = new Vue({
                                 CAIMEI.Popup({
                                     content: '<div class="payAlert">您有采美余额<em>¥'+toFloat(data.ableUserMoney)+'</em>暂未使用,是否需要抵扣订单? 抵扣后您只需再支付<em>¥'+toFloat(data.pendingPayments)+'</em></div>',
                                     confitmBtnText: '抵扣,继续付款',
-                                    cancelBtnText: '不抵扣,继续付款'
+                                    cancelBtnText: '不抵扣,继续付款',
+                                    closeIcon:true
                                 },function(){
                                     // 抵扣,继续付款
                                     _self.hanldPaymentConfirm(1)
@@ -191,7 +192,8 @@ var orderPage = new Vue({
                                 CAIMEI.Popup({
                                     content: '<div class="payAlert">您有采美余额<em>¥'+toFloat(data.ableUserMoney)+'</em>暂未使用,是否需要抵扣订单? 抵扣后订单支付完成</div>',
                                     confitmBtnText: '抵扣',
-                                    cancelBtnText: '不抵扣,继续付款'
+                                    cancelBtnText: '不抵扣,继续付款',
+                                    closeIcon:true
                                 },function(){
                                     // 抵扣全款
                                     _self.hanldPaymentConfirm(2);

+ 4 - 2
src/main/resources/static/js/user-center/order/list.js

@@ -253,7 +253,8 @@ var orderPage = new Vue({
                                 CAIMEI.Popup({
                                     content: '<div class="payAlert">您有采美余额<em>¥'+toFloat(data.ableUserMoney)+'</em>暂未使用,是否需要抵扣订单? 抵扣后您只需再支付<em>¥'+toFloat(data.pendingPayments)+'</em></div>',
                                     confitmBtnText: '抵扣,继续付款',
-                                    cancelBtnText: '不抵扣,继续付款'
+                                    cancelBtnText: '不抵扣,继续付款',
+                                    closeIcon:true
                                 },function(){
                                     // 抵扣,继续付款
                                     _self.hanldPaymentConfirm(1)
@@ -267,7 +268,8 @@ var orderPage = new Vue({
                                 CAIMEI.Popup({
                                     content: '<div class="payAlert">您有采美余额<em>¥'+toFloat(data.ableUserMoney)+'</em>暂未使用,是否需要抵扣订单? 抵扣后订单支付完成</div>',
                                     confitmBtnText: '抵扣',
-                                    cancelBtnText: '不抵扣,继续付款'
+                                    cancelBtnText: '不抵扣,继续付款',
+                                    closeIcon:true
                                 },function(){
                                     // 抵扣全款
                                     _self.hanldPaymentConfirm(2);

+ 1 - 1
src/main/resources/static/js/utils.js

@@ -146,7 +146,7 @@ CAIMEI.Popup = function(params,confirmCallback, cancelCallback){
         boxWidth: (isPC?'300px':'70%'),
         title:'提示',
         content: params.content,
-        closeIcon: true,
+        closeIcon: params.closeIcon,
         animation: 'opacity',
         closeAnimation: 'opacity',
         useBootstrap: false,

+ 1 - 1
src/main/resources/templates/product/detail.html

@@ -17,7 +17,7 @@
 <template th:replace="components/header"></template>
 
 <!-- 商品详情 -->
-<div id="productDetail" v-show="showProduct" v-cloak>
+<div id="productDetail" v-cloak>
     <input type="hidden" th:value="${productId}" id="productId">
     <input type="hidden" th:value="${typeId}" id="typeId">
     <input type="hidden" th:value="${product?.stock}" id="productStock">