Bladeren bron

通知消息版本

zhengjinyi 2 jaren geleden
bovenliggende
commit
76e912959c

+ 1 - 1
src/main/resources/config/dev/application-dev.yml

@@ -56,7 +56,7 @@ caimei:
   #spiServer: http://192.168.2.68:8008
 #  coreServer: https://core-b.caimei365.com
 #  coreServer: http://192.168.2.67:18002
-  coreServer: http://192.168.2.75:18002
+  coreServer: http://192.168.2.180:18002
   imageDomain: https://img-b.caimei365.com
   wwwDomain: http://localhost:8009
   destPath: classpath:/

+ 8 - 1
src/main/resources/static/css/base/base.h5.css

@@ -9,6 +9,7 @@
 .pcOnly,.jqSelect .pc,.baseHeadCenter .headCart,.baseHeadCenter .hotKey,.baseTopNav_nav{display:none!important;}
 .baseHeadTop .wrap ul>li,.baseHeadTop .header_top_left{display:none;}
 .mIcon:before{content:'';display:inline-block;font-size:0;background:url(/img/base/icon_m.png) no-repeat;background-size:100vw auto;transition:all .5s}
+.H5-icon:before{content:'';display:inline-block;font-size:0;background:url(/img/base/H5-icon.png) no-repeat;background-size:100vw auto;transition:all .5s}
 .icon.shop,.icon.heart{vertical-align:middle;display:inline-block;height:5.5vw;line-height:5.5vw}
 .icon.shop:before{width:7.5vw;height:6vw;background-position:-91vw -.5vw}
 .icon.heart:before{width:5.5vw;height:5.5vw;background-position:0 -17vw}
@@ -50,11 +51,17 @@
 .baseHeadCenter .logo img,.classifyBox .logo img{display:block;width:24vw;height:6.6vw}
 .baseHeadCenter .mClassBtn,.classifyBox .mClassBtn{float:left}
 .baseHeadCenter .mUserCenter{float:right}
-.baseHeadCenter .mClassBtn,.classifyBox .mClassBtn,.baseHeadCenter .mUserIcon,.baseHeadCenter .mAddCart,.classifyBox .clsHead .close{padding:3.5vw 2.8vw;width:6.4vw;height:6.4vw}
+.baseHeadCenter .mClassBtn,
+.classifyBox .mClassBtn,
+.baseHeadCenter .mUserIcon,
+.baseHeadCenter .mAddCart,
+.baseHeadCenter .mNotice,
+.classifyBox .clsHead .close{padding:3.5vw 1.4vw;width:6.4vw;height:6.4vw}
 .baseHeadCenter .mClassBtn:before,.classifyBox .mClassBtn:before,.baseHeadCenter .mUserIcon:before,.baseHeadCenter .mAddCart:before{content:'';display:block;width:6.4vw;height:6.4vw}
 .baseHeadCenter .mClassBtn:before,.classifyBox .mClassBtn:before{background-position:0 0}
 .baseHeadCenter .mUserIcon:before{background-position:-8.6vw 0}
 .baseHeadCenter .mAddCart:before{background-position:-17vw 0}
+.baseHeadCenter .mNotice:before{content:'';display:block;width:6.4vw;height:6.4vw;background-position:0 0}
 .baseHeadCenter .searchBox{position:absolute;top:13.4vw;left:0;width:100%;padding-top:1.8vw}
 .baseHeadCenter .search{width:93.4vw;height:9.6vw;margin:0 auto;border:1px solid #FFE6DC;border-radius:2px;position:relative}
 .baseHeadCenter .search .jqSelect{width:27vw;height:9.6vw;position:relative;font-size: 0;}

+ 1 - 1
src/main/resources/static/js/account/register-supplier.js

@@ -60,7 +60,7 @@ var registerPage = new Vue({
             town: ''
         },
         rule:{
-            name: '^[a-zA-Z\\u4e00-\\u9fa5]{2,}$',
+            name: '^[\u4E00-\u9FA5A-Za-z0-9_\\\\(\\)(\\)]+$',
             phone: '^\\d{6,12}$',
             code: '^\\d{6}$',
             license: '^[a-zA-Z0-9_]{18}$',

+ 50 - 5
src/main/resources/static/js/base.js

@@ -55,6 +55,7 @@ var globalHead = new Vue({
             productCount: 0,
             priceTotal: 0
         },
+        noticeNum:0,
         shopId:'',
         userIdentity:'',
         articleType: '',
@@ -139,6 +140,37 @@ var globalHead = new Vue({
                 }
             });
         },
+        getAuthClubCount:function (clubId) {
+            var _self = this;
+            PublicApi.getAuthClubCount({commonId: clubId},function(response){
+                if (response.code === 0 && response.data) {
+                    var data = response.data;
+                    if(data.count>99){
+                        _self.noticeNum = '99+'
+                    }else{
+                        _self.noticeNum = data.count
+                    }
+                    console.log('noticeNum',_self.noticeNum)
+                }else{
+                    console.log('获取机构通知消息数量异常')
+                }
+            });
+        },
+        getAuthShopCount:function (shopId) {
+            var _self = this;
+            PublicApi.getAuthShopCount({commonId: shopId},function(response){
+                if (response.code === 0 && response.data) {
+                    var data = response.data;
+                    if(data.count>99){
+                        _self.noticeNum = '99+'
+                    }else{
+                        _self.noticeNum = data.count
+                    }
+                }else{
+                   console.log('获取供应商通知消息数量异常')
+                }
+            });
+        },
         goMsgLinkFn:function (url) {
             var _self = this;
             if(_self.loginStatus){
@@ -190,17 +222,30 @@ var globalHead = new Vue({
         }
     },
     created: function () {
+        var _self = this;
         // 判断登录状态
         if (globalUserData.token) {
             this.loginStatus = true;
             this.userData = globalUserData;
-            var userId = this.userData.userId;
-            if(userId){
-                var _self = this;
-                // 获取头部购物车数据
+            if(this.userData.userIdentity === 3){
+                // 获取头部通知消息数量
                 setTimeout(function(){
-                    _self.getHeadCart(userId);
+                    _self.getAuthShopCount(_self.userData.shopId);
+                }, 1000);
+                // 获取头部通知消息数量
+                var timerShopCount = setInterval(function(){
+                    _self.getAuthShopCount(_self.userData.shopId);
+                }, 1000*120);
+            }else{
+                setTimeout(function(){
+                    // 获取头部购物车数据
+                    _self.getHeadCart(_self.userData.userId);
+                    _self.getAuthClubCount(_self.userData.clubId);
                 }, 1000);
+                // 获取头部通知消息数量
+                var timerClubCount = setInterval(function(){
+                    _self.getAuthClubCount(_self.userData.clubId);
+                }, 1000*120);
             }
         }
         // 信息中心

+ 44 - 0
src/main/resources/static/js/common/serviceapi/supplier.service.js

@@ -607,5 +607,49 @@ var SupplierApi = {
                 callback(res);
             });
         },
+        getAuthShopMessageCount: function (params, callback) {//供应商消息通知中心未读消息数量
+            Http.AjaxService({
+                url: '/user/login/auth/shopMessageCount',
+                type:'get',
+                data:params,
+                json:false,
+                isHost:true
+            }).then(function (res) {
+                callback(res);
+            });
+        },
+        getAuthShopMessageList: function (params, callback) {//供应商消息通知列表
+            Http.AjaxService({
+                url: '/user/login/auth/shopMessageList',
+                type:'get',
+                data:params,
+                json:false,
+                isHost:true
+            }).then(function (res) {
+                callback(res);
+            });
+        },
+        authDeleteMessage: function (params, callback) {//删除通知消息
+            Http.AjaxService({
+                url: '/user/login/auth/deleteMessage',
+                type:'post',
+                data:params,
+                json:false,
+                isHost:true
+            }).then(function (res) {
+                callback(res);
+            });
+        },
+        authUpdateRead: function (params, callback) {//标记通知消息
+            Http.AjaxService({
+                url: '/user/login/auth/updateRead',
+                type:'post',
+                data:params,
+                json:false,
+                isHost:true
+            }).then(function (res) {
+                callback(res);
+            });
+        },
 
 };

+ 45 - 1
src/main/resources/static/js/common/serviceapi/user.service.js

@@ -374,5 +374,49 @@ var UserApi = {
             }).then(function (res) {
                 callback(res);
             });
-        }
+        },
+        getAuthClubMessageCount: function (params, callback) {//机构消息通知中心未读消息数量
+            Http.AjaxService({
+                url: '/user/login/auth/ClubMessageCount',
+                type:'get',
+                data:params,
+                json:false,
+                isHost:true
+            }).then(function (res) {
+                callback(res);
+            });
+        },
+        getAuthClubMessageList: function (params, callback) {//机构消息通知列表
+            Http.AjaxService({
+                url: '/user/login/auth/ClubMessageList',
+                type:'get',
+                data:params,
+                json:false,
+                isHost:true
+            }).then(function (res) {
+                callback(res);
+            });
+        },
+        authDeleteMessage: function (params, callback) {//删除通知消息
+            Http.AjaxService({
+                url: '/user/login/auth/deleteMessage',
+                type:'post',
+                data:params,
+                json:false,
+                isHost:true
+            }).then(function (res) {
+                callback(res);
+            });
+        },
+        authUpdateRead: function (params, callback) {//标记通知消息
+            Http.AjaxService({
+                url: '/user/login/auth/updateRead',
+                type:'post',
+                data:params,
+                json:false,
+                isHost:true
+            }).then(function (res) {
+                callback(res);
+            });
+        },
 };

+ 24 - 0
src/main/resources/static/js/common/serviceapi/utils.service.js

@@ -538,6 +538,30 @@ var PublicApi = {
                 .then(function(res){
                     callback(res)
                 });
+        },
+        getAuthClubCount:function(params,callback){ // 获取机构未读消息数量
+            Http.AjaxService({
+                url:'/user/login/auth/ClubCount',
+                type:'get',
+                data:params,
+                json:false,
+                isHost:true
+            })
+                .then(function(res){
+                    callback(res)
+                });
+        },
+        getAuthShopCount:function(params,callback){ // 获取供应商未读消息数量
+            Http.AjaxService({
+                url:'/user/login/auth/ShopCount',
+                type:'get',
+                data:params,
+                json:false,
+                isHost:true
+            })
+                .then(function(res){
+                    callback(res)
+                });
         }
 
 };

+ 110 - 102
src/main/resources/static/js/supplier-center/message.js

@@ -10,11 +10,13 @@
             {state: 1,text: '账户通知',bages:0},
             {state: 2,text: '服务通知',bages:0},
         ],
-        list:[],
-        listQuery:{
-            userId: '',
-            pageNum:1,
-            pageSize:10,
+        allCount:0,
+        listQuery: {
+            source: 1,
+            commonId: 0,
+            messageType: '',
+            pageNum: 1,
+            pageSize: 10
         },
         noMore:false,
         listRecord: 0,
@@ -26,7 +28,18 @@
         checklist:[],
         msgId:'',
     },
-     computed: {
+    filters: {
+        NumBadge: function (n) {//处理
+            var num = '';
+            if (n > 100) {
+                num = 99
+            } else {
+                num = n;
+            }
+            return num;
+        }
+    },
+    computed: {
         pageTotal: function () {
             var total = Math.ceil(this.listRecord / this.listQuery.pageSize);
             return total > 0 ? total : 1;
@@ -47,7 +60,7 @@
         }
     },
     methods: {
-         toPagination: function (pageNum) {//点击切换分页
+        toPagination: function (pageNum) {//点击切换分页
             if (pageNum <= this.pageTotal) {
                 this.listQuery.pageNum = pageNum;
                 this. GetMyPcMymessageInfo();
@@ -60,133 +73,128 @@
                 this.pageInput = 1;
             }
         },
-        changeTabsFn:function(index,status){//点击Tab切换消息通知
-            var  _self = this;
-            _self.mssageTabBarIndex = index;
-            _self.listQuery.orderState = status;
-            _self.listQuery.searchNo = '';
-            _self.listQuery.beginTime = '';
-            _self.listQuery.endTime = '';
-            _self.listQuery.pageNum = 1;
-            _self.isRequset = true;
-            switch (index) {
-                case 0:
-                    this.list = this.allNoticeList;
-                    break;
-                case 1:
-                    this.list = this.usersNoticeList;
-                    break;
-                case 2:
-                    this.list = this.serveNoticeList;
-                    break;
-            }
-            _self.isRequset = false;
+        changeTabsFn:function(index,messageType){//点击Tab切换消息通知
+            this.mssageTabBarIndex = index;
+            this.listQuery.messageType = messageType;
+            this.listQuery.pageNum = 1;
+            this. getAuthShopMessageList();
         },
-        GetMyPcCenterInfo:function(){
+        getAuthShopMessageCount:function(){//查询tabs数量
             var _self = this;
-           SupplierApi.GetMymessageList(_self.listQuery,function (response) {
-                if(response.code == 0){
+            SupplierApi.getAuthShopMessageCount({commonId:_self.listQuery.commonId},function (response) {
                 var data = response.data;
-                  if (data.results.length>0){
-                         _self.messagesList = data.results;
-                         _self.listRecord =  data.totalRecord;
-                         _self.requestFlag = true;
-                     }else {
-                     _self.requestFlag = false;
-                      _self.listRecord =  data.totalRecord;
-                     }
+                _self.mssageTabBar[0].bages = _self.allCount = data.count;
+                _self.mssageTabBar[1].bages = data.accountCount;
+                _self.mssageTabBar[2].bages = data.notificationCount;
+            })
+        },
+        getAuthShopMessageList:function(){
+            var _self = this;
+            SupplierApi.getAuthShopMessageList(_self.listQuery,function (response) {
+                if(response.code == 0){
+                    _self.isRequset = false;
+                    var data = response.data;
+                    if (data.list.length>0){
+                        _self.messagesList = data.list.map(function (el) {
+                            el.check = false
+                            return el;
+                        });
+                        _self.listRecord =  data.total;
+                        _self.requestFlag = true;
+                    }else {
+                        _self.requestFlag = false;
+                        _self.listRecord =  data.total;
+                    }
                 }else{
                     CAIMEI.Alert(response.msg, '确定', false);
                     _self.requestFlag = false;
                 }
             })
         },
+        checkedContains(arr, val) {// 校验
+            return arr.some(item => item === val)
+        },
         checkedItemFn:function(item){ //单选
             var _self = this;
-                    if(event.target.checked){
-                         _self.checklist.push(item.messageID);
-                         _self.msgId = _self.checklist.toString()+','
-                    }else {
-                      _self.checklist.splice(_self.checklist.indexOf(item.messageID), 1);
-                      _self.msgId = _self.checklist.toString()+','
-                    }
-                    if(_self.checklist.length==_self.messagesList.length){
-                        _self.isCheckedAll=true;
-                    }else {
-                       _self.isCheckedAll=false;
-                    }
-
+            if(event.target.checked){
+                if(!_self.checkedContains(_self.checklist,item.id)){
+                    _self.checklist.push(item.id);
+                }
+            }else {
+                _self.checklist.splice(_self.checklist.indexOf(item.id), 1);
+            }
+            _self.msgId = _self.checklist.toString()+','
+            if(_self.checklist.length==_self.messagesList.length){
+                _self.isCheckedAll=true;
+            }else {
+                _self.isCheckedAll=false;
+            }
         },
         checkedAllFn: function () { //全選
             var _self = this;
             _self.isCheckedAll = !_self.isCheckedAll;
-                if (_self.isCheckedAll) {
-                    _self.checklist = [];
-                    _self.messagesList.forEach(function (item) {
-                            item.check = true;
-                             _self.checklist.push(item.messageID);
-                             _self.msgId = _self.checklist.toString()+','
-                        })
-                }else{
-                     _self.messagesList.forEach(function(item){
-                          item.check = false;
-                    });
-                    _self.checklist = [];
-                    _self.msgId = ''
-                }
+            if (_self.isCheckedAll) {
+                _self.checklist = [];
+                _self.messagesList.forEach(function (item) {
+                    item.check = true;
+                    _self.checklist.push(item.id);
+                    _self.msgId = _self.checklist.toString()+','
+                })
+            }else{
+                _self.messagesList.forEach(function(item){
+                    item.check = false;
+                });
+                _self.checklist = [];
+                _self.msgId = ''
+            }
         },
-       deleteMessageFn: function(){//删除消息
-             var _this =this;
-             if(_this.messagesList==''){
-                 CAIMEI.Alert('暂无消息', '确定', false);
-             }else if(_this.checklist.length==0) {
-                 CAIMEI.Alert('未选择任何消息', '确定', false);
-             }else {
-                PublicApi.deleteMessage({messageIds:_this.msgId},function (res) {
+        deleteMessageFn: function(){//删除消息
+            var _this =this;
+            if(this.allCount === 0){
+                CAIMEI.dialog('暂无消息');
+            }else if(_this.checklist.length==0){
+                CAIMEI.dialog('请勾选未读消息');
+            }else{
+                SupplierApi.authDeleteMessage({id:_this.msgId},function (res) {
                     if (res.code==0){
-                      CAIMEI.dialog('刪除成功');
-                      location.reload();
+                        CAIMEI.dialog('刪除成功');
+                        setTimeout(function (){
+                            _this.getAuthShopMessageList();
+                        },500)
                     }else {
-                      CAIMEI.Alert(res.msg, '确定', false);
+                        CAIMEI.Alert(res.msg, '确定', false);
                     }
                 })
-             }
+            }
         },
-       signMessageFn: function(){//标记为已读
-           var _this =this;
+        signMessageFn: function(){//标记为已读
+            var _this =this;
             console.log(_this.checklist);
             console.log(_this.msgId);
-            if(_this.messagesList==''){
-             CAIMEI.Alert('暂无消息', '确定', false);
+            if(this.allCount === 0){
+                CAIMEI.dialog('暂无未读消息');
             }else if(_this.checklist.length==0){
-              CAIMEI.Alert('未选择任何消息', '确定', false);
+                CAIMEI.dialog('请勾选未读消息');
             }else {
-                     PublicApi.markAsRead({messageIds:_this.msgId},function (res) {
+                SupplierApi.authUpdateRead({userType:2,Id:_this.msgId},function (res) {
                     if(res.code==0){
-                     CAIMEI.dialog('已读成功');
-                     location.reload();
+                        CAIMEI.dialog('标记已读成功');
+                        setTimeout(function (){
+                            _this.getAuthShopMessageCount();
+                            _this.getAuthShopMessageList();
+                        },500)
                     }else {
-                     CAIMEI.Alert(res.msg, '确定', false);
+                        CAIMEI.Alert(res.msg, '确定', false);
                     }
                 })
             }
-
-        },
-        showBadge:function(n){//处理标签
-            var num ='';
-            if(n>100){num = 99}else{num = n;}
-            return num;
-        },
-        toFixedFn:function(text){//处理小数点后两位数
-            return Number(text).toFixed(2);
-        },
-
+        }
     },
     mounted: function () {
         if(globalUserData){
-            this.listQuery.userId = globalUserData.userId;
-            this.list = this.allNoticeList;
-            // this.GetMyPcCenterInfo();
+            this.listQuery.commonId = globalUserData.shopId;
+            this.getAuthShopMessageCount();
+            this.getAuthShopMessageList();
         }
          if(!isPC){
             $('footer').addClass("noneImportant");
@@ -203,7 +211,7 @@
                         if (_self.requestFlag){
                             _self.listQuery.pageNum = next;
                             // 获取列表数据
-                            _self.GetMyPcMymessageInfo();
+                            _self.getAuthShopMessageList();
                         }
                         _self.requestFlag = false;
                     }else{

+ 16 - 222
src/main/resources/static/js/supplier-center/mixins/noticeMixin.js

@@ -2,208 +2,7 @@
 var noticeMixin = function () {// 通知消息
     return {
         data(){
-            return{
-                allNoticeList:[
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:1,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:1,
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:1,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:2,
-                        wechatName:'@ZJY'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:1,
-                        name:'法诺智能美容工作平台-TM700...',
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:3,
-                        endTime:'7日后'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:1,
-                        name:'法诺智能美容工作平台-TM700...',
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:3,
-                        endTime:'今日'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:1,
-                        name:'法诺智能美容工作平台-TM700...',
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:4,
-                        endTime:'今日'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:1,
-                        name:'法诺智能美容工作平台-TM700...',
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:5,
-                        endtime:'3个月'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:1,
-                        name:'法诺智能美容工作平台-TM700...',
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:5,
-                        endtime:'1个月'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:1,
-                        name:'法诺智能美容工作平台-TM700...',
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:5,
-                        endtime:'7天'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:1,
-                        name:'法诺智能美容工作平台-TM700...',
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:5,
-                        endtime:'今天'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:2,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:1,
-                        endTime:'30日后到期'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:2,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:1,
-                        endTime:'7日后到期'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:2,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:1,
-                        endTime:'今日后到期'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:2,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:1,
-                        endTime:'已过期'
-                    }
-                ],
-                usersNoticeList: [
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:1,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:1,
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:1,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:2,
-                        wechatName:'@ZJY'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:1,
-                        name:'法诺智能美容工作平台-TM700...',
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:3,
-                        endTime:'7日后'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:1,
-                        name:'法诺智能美容工作平台-TM700...',
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:3,
-                        endTime:'今日'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:1,
-                        name:'法诺智能美容工作平台-TM700...',
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:4,
-                        endTime:'今日'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:1,
-                        name:'法诺智能美容工作平台-TM700...',
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:5,
-                        endtime:'3个月'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:1,
-                        name:'法诺智能美容工作平台-TM700...',
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:5,
-                        endtime:'1个月'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:1,
-                        name:'法诺智能美容工作平台-TM700...',
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:5,
-                        endtime:'7天'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:1,
-                        name:'法诺智能美容工作平台-TM700...',
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:5,
-                        endtime:'今天'
-                    },
-                ],
-                serveNoticeList: [
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:2,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:1,
-                        endTime:'30日后到期'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:2,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:1,
-                        endTime:'7日后到期'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:2,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:1,
-                        endTime:'今日后到期'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:2,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:1,
-                        endTime:'已过期'
-                    }
-                ],
-            }
+            return{}
         },
         computed: {
 
@@ -217,7 +16,7 @@ var noticeMixin = function () {// 通知消息
                     1:this.noticeUsersText(cell),
                     2:this.noticeServeText(cell),
                 }
-                return $EventFunction[cell.noticeType]
+                return $EventFunction[cell.messageType]
             },
             noticeUsersText(cell) { // 账户通知文案
                 const linkMap = {
@@ -226,44 +25,39 @@ var noticeMixin = function () {// 通知消息
                 }
                 const map = {
                     1: '您的注册信息已审核通过,恭喜您成为采美平台供应商用户。您可以上架商品到采美商城进行出售了。',
-                    2: `恭喜您(微信昵称:${cell.wechatName})成功成为【采美信息技术有限公司】的运营人员。`,
-                    3: `商品”${cell.name}“,上架审核未通过,暂时不能上架采美商城,请重新${linkMap[cell.type]}进行提交。`,
-                    4: `商品”${cell.name}“,新品展示审核未通过,未能展示在采美商城新品橱窗。`,
-                    5: `商品”${cell.name}“,该商品的资质证书将于${cell.endtime}后失效,请及时${linkMap[cell.type]}新证书。`
+                    2: `恭喜您(微信昵称:${cell.content})成功成为【采美信息技术有限公司】的运营人员。`,
+                    3: `商品”${cell.productName}“,上架审核未通过,暂时不能上架采美商城,请重新${linkMap[cell.shopMessType]}进行提交。`,
+                    4: `商品”${cell.productName}“,新品展示审核未通过,未能展示在采美商城新品橱窗。`,
+                    5: `商品”${cell.productName}“,该商品的资质证书将于${cell.content}后失效,请及时${linkMap[cell.shopMessType]}新证书。`
                 }
-                return map[cell.type]
+                return map[cell.shopMessType]
             },
             noticeServeText(cell){//服务通知文案处理
                 const map = {
-                    1: `您的供应商账号上架费将于${cell.endTime}后到期,到期后将无法发布和编辑商品,同时也会影响到其他采美提供的支持服务。请联系采美工作人员进行续费请联系采美工作人员进行续费请联系采美工作人员进行续费,联系电话0755-22907771 或15338851365`
+                    1: `您的供应商账号上架费将于${cell.content}后到期,到期后将无法发布和编辑商品,同时也会影响到其他采美提供的支持服务。请联系采美工作人员进行续费请联系采美工作人员进行续费请联系采美工作人员进行续费,联系电话0755-22907771 或15338851365`
                 }
-                return map[cell.type]
+                return map[cell.shopTieredType]
             },
             handleClick(cell){
-                console.log('cell',cell.noticeType);
-                let _self = this;
-                switch (cell.noticeType) {
+                switch (cell.messageType) {
                     case 1:
-                        _self.handleUsersClick(cell);
+                        this.handleUsersClick(cell);
                         break
                     case 2:
-                        _self.handleServeClick(cell);
+                        this.handleServeClick(cell);
                         break
                 }
             },
             handleUsersClick(cell){
                 console.log('账户通知跳转');
-                if(cell.type === 1 || cell.type === 5 || cell.type === 7){
+                if(cell.shopMessType === 1 || cell.shopMessType === 2 || cell.shopMessType === 4){
                     return;
                 }
                 const linkJumpMap = {
-                    2:'/user/member.html',
-                    3:'/user/member.html',
-                    4:'/user/member.html',
-                    6:'/user/setting/upgrade.html',
+                    3:`/supplier/release.html?productId=${cell.productId}&type=edit`,
+                    5:`/supplier/release.html?productId=${cell.productId}&type=edit`,
                 }
-                console.log('url',linkJumpMap[cell.type])
-                window.open(linkJumpMap[cell.type]);
+                window.open(linkJumpMap[cell.shopMessType]);
             },
             handleServeClick(cell){
                 console.log('服务通知跳转');

+ 97 - 109
src/main/resources/static/js/user-center/message.js

@@ -7,26 +7,26 @@ var helpSuggestion = new Vue({
         isRequset:true,
         mssageTabBarIndex:0,
         mssageTabBar: [
-            {state: 0,text: '全部消息',bages:0},
-            {state: 1,text: '交易物流',bages:0},
-            {state: 2,text: '账户通知',bages:0},
-            {state: 3,text: '服务通知',bages:0},
-            {state: 4,text: '优惠促销',bages:0},
+            {messageType: '',text: '全部消息',bages:0},
+            {messageType: 1,text: '交易物流',bages:0},
+            {messageType: 2,text: '账户通知',bages:0},
+            {messageType: 3,text: '服务通知',bages:0},
+            {messageType: 4,text: '优惠促销',bages:0},
         ],
-        list:[],
-        listQuery:{
-            userId: '',
-            pageNum:1,
-            pageSize:10,
+        allCount:0,
+        listQuery: {
+            source: 1,
+            commonId: 0,
+            messageType: '',
+            pageNum: 1,
+            pageSize: 10
         },
         noMore:false,
         listRecord: 0,
         pageInput: '1',
         degree:'',
         isCheckedAll:false,
-        messagesList:[
-
-        ],//消息列表
+        messagesList:[],//消息列表
         check:false,
         checklist:[],
         msgId:'',
@@ -66,7 +66,7 @@ var helpSuggestion = new Vue({
          toPagination: function (pageNum) {//点击切换分页
             if (pageNum <= this.pageTotal) {
                 this.listQuery.pageNum = pageNum;
-                this. GetMyPcMymessageInfo();
+                this. getAuthClubMessageList();
             }
         },
         checkNum: function () {//输入跳转分页
@@ -76,100 +76,96 @@ var helpSuggestion = new Vue({
                 this.pageInput = 1;
             }
         },
-        changeTabsFn:function(index,status){//点击Tab切换消息通知
-            var  _self = this;
-            _self.mssageTabBarIndex = index;
-            _self.listQuery.orderState = status;
-            _self.listQuery.searchNo = '';
-            _self.listQuery.beginTime = '';
-            _self.listQuery.endTime = '';
-            _self.listQuery.pageNum = 1;
-            _self.isRequset = true;
-            switch (index) {
-                case 0:
-                    this.list = this.orderNoticeList;
-                    break;
-                case 1:
-                    this.list = this.orderNoticeList;
-                    break;
-                case 2:
-                    this.list = this.usersNoticeList;
-                    break;
-                case 3:
-                    this.list = this.orderNoticeList;
-                    break;
-                case 4:
-                    this.list = this.couponNoticeList;
-                    break;
-
-            }
-            _self.isRequset = false;
+        changeTabsFn:function(index,messageType){//点击Tab切换消息通知
+            this.mssageTabBarIndex = index;
+            this.listQuery.messageType = messageType;
+            this.listQuery.pageNum = 1;
+            this. getAuthClubMessageList();
+        },
+        getAuthClubMessageCount:function(){//查询tabs数量
+            var _self = this;
+            UserApi.getAuthClubMessageCount({commonId:_self.listQuery.commonId},function (response) {
+                var data = response.data;
+                _self.mssageTabBar[0].bages = _self.allCount = data.count;
+                _self.mssageTabBar[1].bages = data.tradeCount;
+                _self.mssageTabBar[2].bages = data.account;
+                _self.mssageTabBar[3].bages = data.notificationCount;
+                _self.mssageTabBar[4].bages = data.promotionCount;
+            })
         },
-        GetMyPcMymessageInfo:function(){
+        getAuthClubMessageList:function(){
             var _self = this;
-            UserApi.GetMymessageList(_self.listQuery,function (response) {
+            UserApi.getAuthClubMessageList(_self.listQuery,function (response) {
                 if(response.code == 0){
                     _self.isRequset = false;
-                     if (response.data.results.length>0){
-                      var data = response.data;
-                         _self.messagesList = data.results;
-                         _self.listRecord =  data.totalRecord;
+                    var data = response.data;
+                    if (data.list.length>0){
+                         _self.messagesList = data.list.map(function (el) {
+                             el.check = false
+                             return el;
+                         });
+                         _self.listRecord =  data.total;
                          _self.requestFlag = true;
                      }else {
-                     _self.requestFlag = false;
-                      _self.listRecord =  data.totalRecord;
+                        _self.requestFlag = false;
+                        _self.listRecord =  data.total;
                      }
                 }else{
                     CAIMEI.Alert(response.msg, '确定', false);
-                     _self.requestFlag = false;
+                    _self.requestFlag = false;
                 }
             })
         },
+        checkedContains(arr, val) {// 校验
+            return arr.some(item => item === val)
+        },
         checkedItemFn:function(item){ //单选
             var _self = this;
-                    if(event.target.checked){
-                         _self.checklist.push(item.messageId);
-                         _self.msgId = _self.checklist.toString()+','
-                    }else {
-                      _self.checklist.splice(_self.checklist.indexOf(item.messageId), 1);
-                      _self.msgId = _self.checklist.toString()+','
-                    }
-                    if(_self.checklist.length==_self.messagesList.length){
-                        _self.isCheckedAll=true;
-                    }else {
-                       _self.isCheckedAll=false;
-                    }
-
+            if(event.target.checked){
+                if(!_self.checkedContains(_self.checklist,item.id)){
+                    _self.checklist.push(item.id);
+                }
+            }else {
+              _self.checklist.splice(_self.checklist.indexOf(item.id), 1);
+            }
+            _self.msgId = _self.checklist.toString()+','
+            if(_self.checklist.length==_self.messagesList.length){
+                _self.isCheckedAll=true;
+            }else {
+               _self.isCheckedAll=false;
+            }
         },
-          checkedAllFn: function () { //全選
+        checkedAllFn: function () { //全選
             var _self = this;
             _self.isCheckedAll = !_self.isCheckedAll;
-                if (_self.isCheckedAll) {
-                    _self.checklist = [];
-                    _self.messagesList.forEach(function (item) {
-                             item.check = true;
-                             _self.checklist.push(item.messageId);
-                             _self.msgId = _self.checklist.toString()+','
-                        })
-                }else{
-                     _self.messagesList.forEach(function(item){
-                          item.check = false;
-                    });
-                    _self.checklist = [];
-                    _self.msgId = ''
-                }
+            if (_self.isCheckedAll) {
+                _self.checklist = [];
+                _self.messagesList.forEach(function (item) {
+                         item.check = true;
+                         _self.checklist.push(item.id);
+                         _self.msgId = _self.checklist.toString()+','
+                    })
+            }else{
+                 _self.messagesList.forEach(function(item){
+                      item.check = false;
+                });
+                _self.checklist = [];
+                _self.msgId = ''
+            }
         },
         deleteMessageFn: function(){//删除消息
              var _this =this;
-             if(_this.messagesList==''){
-                 CAIMEI.Alert('暂无消息', '确定', false);
-             }else if(_this.checklist.length==0) {
-                 CAIMEI.Alert('未选择任何消息', '确定', false);
-             }else {
-                PublicApi.deleteMessage({messageIds:_this.msgId},function (res) {
+            if(this.allCount === 0){
+                CAIMEI.dialog('暂无消息');
+            }else if(_this.checklist.length==0){
+                CAIMEI.dialog('请勾选未读消息');
+            }else{
+                UserApi.authDeleteMessage({id:_this.msgId},function (res) {
                     if (res.code==0){
                       CAIMEI.dialog('刪除成功');
-                       location.reload()
+                      setTimeout(function (){
+                          _this.getAuthClubMessageList();
+                      },500)
                     }else {
                       CAIMEI.Alert(res.msg, '确定', false);
                     }
@@ -180,39 +176,31 @@ var helpSuggestion = new Vue({
           var _this =this;
             console.log(_this.checklist);
             console.log(_this.msgId);
-            if(_this.messagesList==''){
-             CAIMEI.Alert('暂无消息', '确定', false);
+            if(this.allCount === 0){
+                CAIMEI.dialog('暂无未读消息');
             }else if(_this.checklist.length==0){
-              CAIMEI.Alert('未选择任何消息', '确定', false);
+                CAIMEI.dialog('请勾选未读消息');
             }else {
-                     PublicApi.markAsRead({messageIds:_this.msgId},function (res) {
+                UserApi.authUpdateRead({userType:1,Id:_this.msgId},function (res) {
                     if(res.code==0){
-                     CAIMEI.dialog('已读成功');
-                     location.reload()
+                        CAIMEI.dialog('标记已读成功');
+                        setTimeout(function (){
+                            _this.getAuthClubMessageCount();
+                            _this.getAuthClubMessageList();
+                        },500)
                     }else {
-                     CAIMEI.Alert(res.msg, '确定', false);
+                        CAIMEI.Alert(res.msg, '确定', false);
                     }
                 })
             }
-
-        },
-        showBadge:function(n){//处理标签
-            var num ='';
-            if(n>100){num = 99}else{num = n;}
-            return num;
-        },
-        toFixedFn:function(text){//处理小数点后两位数
-            return Number(text).toFixed(2);
-        },
-
+        }
     },
     mounted: function () {
         var _self=this;
         if(globalUserData){
-            this.listQuery.userId = globalUserData.userId;
-            this.isRequset = false;
-            this.list = this.orderNoticeList;
-            // this.GetMyPcMymessageInfo();
+            this.listQuery.commonId = globalUserData.clubId;
+            this.getAuthClubMessageCount()
+            this.getAuthClubMessageList();
         }
         if(!isPC){
             $('footer').addClass("noneImportant");
@@ -229,7 +217,7 @@ var helpSuggestion = new Vue({
                         if (_self.requestFlag){
                             _self.listQuery.pageNum = next;
                             // 获取列表数据
-                            _self.GetMyPcMymessageInfo();
+                            _self.getAuthClubMessageList();
                         }
                         _self.requestFlag = false;
                     }else{

+ 34 - 270
src/main/resources/static/js/user-center/mixins/noticeMixin.js

@@ -2,243 +2,7 @@
 var noticeMixin = function () {// 通知消息
     return {
         data(){
-            return{
-                orderNoticeList: [
-                    {
-                        addTime: '2022-07-05 16:51:20',
-                        content:'',
-                        noticeType:1,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        name:'华熙面膜面膜面膜面膜...',
-                        cont:3,
-                        orderId: 1234,
-                        onlinePayFlag:1,
-                        type:1,
-                    },
-                    {
-                        addTime: '2022-07-05 16:51:20',
-                        content:'',
-                        noticeType:1,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        name:'华熙面膜面膜面膜面膜...',
-                        cont:3,
-                        orderId: 1234,
-                        onlinePayFlag:0,
-                        type:1,
-                    },
-                    {
-                        addTime: '2022-07-05 16:51:20',
-                        content:'',
-                        noticeType:1,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        name:'华熙面膜面膜面膜面膜...',
-                        cont:3,
-                        type:2,
-                        orderId: 1234,
-                    },
-                    {
-                        addTime: '2022-07-05 16:51:20',
-                        content:'¥100000.00',
-                        noticeType:1,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        name:'华熙面膜面膜面膜面膜...',
-                        cont:3,
-                        type:3,
-                        returnType:0,
-                        returnAmount:'100000.00',
-                        orderId: 1234,
-                    },
-                    {
-                        addTime: '2022-07-05 16:51:20',
-                        content:'¥100000.00',
-                        noticeType:1,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        name:'华熙面膜面膜面膜面膜...',
-                        cont:3,
-                        type:3,
-                        returnType:1,
-                        returnAmount:'100000.00',
-                        orderId: 1234,
-                    },
-                    {
-                        addTime: '2022-07-05 16:51:20',
-                        content:'已成功取消!',
-                        noticeType:1,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        name:'华熙面膜面膜面膜面膜...',
-                        cont:3,
-                        type:4,
-                        cancelType:0,
-                        orderId: 1234,
-                    },
-                    {
-                        addTime: '2022-07-05 16:51:20',
-                        content:'因超时未确认,系统已自动取消订单!',
-                        noticeType:1,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        name:'华熙面膜面膜面膜面膜...',
-                        cont:3,
-                        type:4,
-                        cancelType:1,
-                        orderId: 1234,
-                    },
-                    {
-                        addTime: '2022-07-05 16:51:20',
-                        content:'因超时未付款,系统已自动取消订单!',
-                        noticeType:1,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        name:'华熙面膜面膜面膜面膜...',
-                        cont:3,
-                        type:4,
-                        cancelType:2,
-                        orderId: 1234,
-                    },
-                    {
-                        addTime: '2022-07-05 16:51:20',
-                        content:'',
-                        noticeType:1,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        name:'华熙面膜面膜面膜面膜...',
-                        cont:3,
-                        type:5,
-                        orderId: 1234,
-                    },
-                    {
-                        addTime: '2022-07-05 16:51:20',
-                        content:'',
-                        noticeType:1,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        name:'华熙面膜面膜面膜面膜...',
-                        cont:3,
-                        type:6,
-                        orderId: 1234,
-                    },
-                ],
-                usersNoticeList: [
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:2,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:1,
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:2,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:2,
-                        vipTime:'3个月'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:2,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:3,
-                        endTime:'7日后'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:2,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:3,
-                        endTime:'今日'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:2,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:4,
-                        vipTime:'3个月'
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:2,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:5
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:2,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:6
-                    },
-                    {
-                        time: '2022-07-05 16:51:20',
-                        noticeType:2,
-                        image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-                        type:7,
-                        wechatName:'@ZJY'
-                    },
-                ],
-                couponNoticeList: [
-                    {
-                        type:1,
-                        noticeType:4,
-                        couponType:0,
-                        couponAmount:'50000.00',
-                        time: '2022-07-05 16:51:20',
-                    },
-                    {
-                        type:1,
-                        noticeType:4,
-                        couponType:1,
-                        categoryType:1,
-                        couponAmount:'50000.00',
-                        time: '2022-07-05 16:51:20',
-                    },
-                    {
-                        type:1,
-                        noticeType:4,
-                        couponType:1,
-                        categoryType:2,
-                        couponAmount:'50000.00',
-                        time: '2022-07-05 16:51:20',
-                    },
-                    {
-                        type:1,
-                        noticeType:4,
-                        couponType:2,
-                        couponAmount:'50000.00',
-                        time: '2022-07-05 16:51:20',
-                    },
-                    {
-                        type:1,
-                        noticeType:4,
-                        couponType:3,
-                        shopName:'采美信息技术有限公司',
-                        couponAmount:'50000.00',
-                        time: '2022-07-05 16:51:20',
-                    },
-                    {
-                        type:1,
-                        noticeType:4,
-                        couponType:4,
-                        couponAmount:'50000.00',
-                        time: '2022-07-05 16:51:20',
-                    },
-                    {
-                        type:2,
-                        noticeType:4,
-                        couponType:4,
-                        couponAmount:'50000.00',
-                        endTime:"3天",
-                        time: '2022-07-05 16:51:20',
-                    },
-                    {
-                        type:3,
-                        noticeType:4,
-                        couponAmount:'50000.00',
-                        endTime:"7天后",
-                        time: '2022-07-05 16:51:20',
-                    },
-                    {
-                        type:3,
-                        noticeType:4,
-                        couponAmount:'50000.00',
-                        endTime:"今日即将",
-                        time: '2022-07-05 16:51:20',
-                    },
-                ],
-            }
+            return{}
         },
         computed: {
 
@@ -254,7 +18,7 @@ var noticeMixin = function () {// 通知消息
                     3:this.noticeServeText(cell),
                     4:this.noticeCouponText(cell)
                 }
-                return $EventFunction[cell.noticeType]
+                return $EventFunction[cell.messageType]
             },
             noticeOrderText(cell) { // 交易物流通知文案
                 const linkMap = {
@@ -266,14 +30,14 @@ var noticeMixin = function () {// 通知消息
                         6:`<span class="link">查看订单</span>`
                 }
                 const map = {
-                    1: `您已成功下单"${cell.name}"等${cell.cont}件商品,订单等待支付,点击${linkMap[cell.type]}进行付款,支付完成后采美将尽快安排发货。`,
-                    2: `订单(${cell.name}"等${cell.cont}件商品)已支付完成,将立即安排发货,点击${linkMap[cell.type]}查看订单详情`,
-                    3: `订单(${cell.name}"等${cell.cont}件商品)已${cell.returnType == 0 ? '全部' : '部分'}退款/货成功,退款金额¥${cell.returnAmount},金额到账时间可能存在延迟,具体以支付方通知为准。点击${linkMap[cell.type]}查看退款详情`,
-                    4: `订单(${cell.name}"等${cell.cont}件商品)${cell.content},点击${linkMap[cell.type]}查看订单详情`,
-                    5: `订单(${cell.name}"等${cell.cont}件商品)已发货,点击${linkMap[cell.type]}查看物流详情`,
-                    6: `订单(${cell.name}"等${cell.cont}件商品)因超时已被系统自动收货,点击${linkMap[cell.type]}查看订单详情`,
+                    1: `您已成功下单"${cell.productName}"等${cell.productCount}件商品,订单等待支付,点击${linkMap[cell.orderMessageType]}进行付款,支付完成后采美将尽快安排发货。`,
+                    2: `订单(${cell.productName}"等${cell.productCount}件商品)已支付完成,将立即安排发货,点击${linkMap[cell.orderMessageType]}查看订单详情`,
+                    3: `订单(${cell.productName}"等${cell.productCount}件商品)已${cell.refundType === 1 ? '部分退' : '全部退'}款/货成功,退款金额¥${cell.returnAmount},金额到账时间可能存在延迟,具体以支付方通知为准。点击${linkMap[cell.orderMessageType]}查看退款详情`,
+                    4: `订单(${cell.productName}"等${cell.productCount}件商品)${cell.content},点击${linkMap[cell.orderMessageType]}查看订单详情`,
+                    5: `订单(${cell.productName}"等${cell.productCount}件商品)已发货,点击${linkMap[cell.orderMessageType]}查看物流详情`,
+                    6: `订单(${cell.productName}"等${cell.productCount}件商品)因超时已被系统自动收货,点击${linkMap[cell.orderMessageType]}查看订单详情`,
                 }
-                return map[cell.type]
+                return map[cell.orderMessageType]
             },
             noticeUsersText(cell) { // 账户通知文案
                 const linkMap = {
@@ -284,42 +48,42 @@ var noticeMixin = function () {// 通知消息
                 }
                 const map = {
                     1: '欢迎成为采美机构用户,祝您开启愉快的采购之旅。',
-                    2: `您已成功购买${cell.vipTime}采美平台超级会员服务,在服务期内每月可领多张大额优惠券,还有更多超级会员专属权益等您体验,点击${linkMap[cell.type]}去体验吧。`,
-                    3: `您的超级会员服务将于${cell.endTime}到期,到期后将无法享受专属会员权益,赶快去${linkMap[cell.type]}续费吧 。`,
-                    4: `您已获得采美平台赠送的${cell.vipTime}超级会员,在服务期内每月可领多张大额优惠券,还有更多超级会员专属权益等您体验,点击${linkMap[cell.type]}去体验吧。`,
+                    2: `您已成功购买${cell.content}采美平台超级会员服务,在服务期内每月可领多张大额优惠券,还有更多超级会员专属权益等您体验,点击${linkMap[cell.accountType]}去体验吧。`,
+                    3: `您的超级会员服务将于${cell.content}到期,到期后将无法享受专属会员权益,赶快去${linkMap[cell.accountType]}续费吧 。`,
+                    4: `您已获得采美平台赠送的${cell.content}超级会员,在服务期内每月可领多张大额优惠券,还有更多超级会员专属权益等您体验,点击${linkMap[cell.accountType]}去体验吧。`,
                     5: '恭喜您成功升级为资质机构用户!现在可以查看更多商品的信息啦,采美平台也将为您提供更多专业服务。',
-                    6: `您的账号升级资质机构失败!点击${linkMap[cell.type]}重新提交吧。`,
-                    7: `恭喜您(微信昵称:${cell.wechatName})成功成为机构运营人员,祝您开启愉快的采购之旅。`
+                    6: `您的账号升级资质机构失败!点击${linkMap[cell.accountType]}重新提交吧。`,
+                    7: `恭喜您(微信昵称:${cell.content})成功成为机构运营人员,祝您开启愉快的采购之旅。`
                 }
-                return map[cell.type]
+                return map[cell.accountType]
             },
             noticeCouponText(cell) { // 优惠促销通知文案
                 const linkMap = {
                     1:`<span class="link">领券中心</span>`,
-                    2:`<span class="link">券中心</span>`,
-                    3:`<span class="link">优惠券中心</span>`,
+                    2:`<span class="link">优惠券中心</span>`,
+                    3:`<span class="link">券中心</span>`,
                 }
                 const copunMap = {
-                    0: `采美平台送您${cell.couponAmount}元优惠券,众多大牌正品等着您,赶快去${linkMap[cell.type]}领取下单吧。`,
-                    1: `采美平台${cell.categoryType == 1 ? '产品' : '仪器'}类商品大优惠,特送您${cell.couponAmount}元优惠券,赶快去${linkMap[cell.type]}领取下单吧。`,
-                    2: `为了答谢您对采美平台的支持,采美送您${cell.couponAmount}元优惠券,赶快去${linkMap[cell.type]}领取下单吧。`,
-                    3: `【${cell.shopName}】赠送您${cell.couponAmount}元的店铺专属优惠券,众多火爆商品等您来!赶快去${linkMap[cell.type]}领取下单吧。>`,
-                    4: `恭喜成功注册采美平台,现赠送您${cell.couponAmount}元新用户优惠券,赶快去${linkMap[cell.type]}领取下单吧。`,
+                    0: `采美平台送您${cell.couponFee}元优惠券,众多大牌正品等着您,赶快去${linkMap[cell.couponMessageType]}领取下单吧。`,
+                    1: `采美平台${cell.content}类商品大优惠,特送您${cell.couponFee}元优惠券,赶快去${linkMap[cell.couponMessageType]}领取下单吧。`,
+                    2: `为了答谢您对采美平台的支持,采美送您${cell.couponFee}元优惠券,赶快去${linkMap[cell.couponMessageType]}领取下单吧。`,
+                    3: `【${cell.content}】赠送您${cell.couponFee}元的店铺专属优惠券,众多火爆商品等您来!赶快去${linkMap[cell.couponMessageType]}领取下单吧。>`,
+                    4: `恭喜成功注册采美平台,现赠送您${cell.couponFee}元新用户优惠券,赶快去${linkMap[cell.couponMessageType]}领取下单吧。`,
                 }
                 const map = {
                     1: copunMap[cell.couponType],
-                    2: `您有${cell.couponAmount}元优惠券尚未领取,优惠券将于${cell.endTime}后下架,赶快去${linkMap[cell.type]}领取下单吧0`,
-                    3: `您有${cell.couponAmount}元优惠券将于${cell.endTime}过期,赶快去${linkMap[cell.type]}查看使用吧。`,
+                    2: `您有${cell.couponFee}元优惠券将于${cell.content}过期,赶快去${linkMap[cell.couponMessageType]}查看使用吧。`,
+                    3: `您有${cell.couponFee}元优惠券尚未领取,优惠券将于${cell.content}后下架,赶快去${linkMap[cell.couponMessageType]}领取下单吧0`,
+
                 }
-                return map[cell.type]
+                return map[cell.couponMessageType]
             },
             noticeServeText(cell){//服务通知文案处理
                 console.log('服务通知文案处理');
             },
             handleClick(cell){
-                console.log('cell',cell.noticeType);
                 let _self = this;
-                switch (cell.noticeType) {
+                switch (cell.messageType) {
                     case 1:
                         _self.handleOrderClick(cell);
                         break
@@ -335,6 +99,7 @@ var noticeMixin = function () {// 通知消息
                 }
             },
             handleOrderClick(cell){
+                console.log('cell',cell)
                 const payLinkMap = {
                     0:'/pay/caimei-paylist.html?orderId='+cell.orderId,
                     1:'/pay/caimei-payunder.html?orderId='+cell.orderId,
@@ -347,12 +112,12 @@ var noticeMixin = function () {// 通知消息
                     5:'/user/order/logistics.html?orderId='+cell.orderId,
                     6:'/user/order/detail.html?orderId='+cell.orderId
                 }
-                console.log('url',linkJumpMap[cell.type])
-                window.open(linkJumpMap[cell.type]);
+                console.log('url',linkJumpMap[cell.orderMessageType])
+                window.open(linkJumpMap[cell.orderMessageType]);
             },
             handleUsersClick(cell){
                 console.log('账户通知跳转');
-                if(cell.type === 1 || cell.type === 5 || cell.type === 7){
+                if(cell.accountType === 1 || cell.accountType === 5 || cell.accountType === 7){
                     return;
                 }
                 const linkJumpMap = {
@@ -361,8 +126,7 @@ var noticeMixin = function () {// 通知消息
                     4:'/user/member.html',
                     6:'/user/setting/upgrade.html',
                 }
-                console.log('url',linkJumpMap[cell.type])
-                window.open(linkJumpMap[cell.type]);
+                window.open(linkJumpMap[cell.accountType]);
             },
             handleServeClick(cell){
                 console.log('服务通知跳转');
@@ -374,8 +138,8 @@ var noticeMixin = function () {// 通知消息
                     2:`/user/coupon-collection.html`,
                     3:`/user/coupon.html`,
                 }
-                console.log('url',linkJumpMap[cell.type])
-                window.open(linkJumpMap[cell.type]);
+                console.log('url',linkJumpMap[cell.couponMessageType])
+                window.open(linkJumpMap[cell.couponMessageType]);
             },
         }
     };

+ 11 - 5
src/main/resources/templates/components/header.html

@@ -6,8 +6,8 @@
             <div class="header_top_left"></div>
             <ul class="header_top_ul" >
                 <li class="headmsg">
-                    <a v-if="userIdentity===3" @click="goMsgLinkFn('/supplier/message/list.html')" href="javascript:void(0)" class="WEB-icon msg-btn">消息<em v-text="'('+headCart.cartCount+')'"></em></a>
-                    <a v-else  @click="goMsgLinkFn('/user/message/list.html')" href="javascript:void(0)" class="WEB-icon msg-btn">消息<em v-text="'('+headCart.cartCount+')'"></em></a>
+                    <a v-if="userIdentity===3" @click="goMsgLinkFn('/supplier/message/list.html')" href="javascript:void(0)" class="WEB-icon msg-btn">消息<em v-text="'('+noticeNum+')'"></em></a>
+                    <a v-else  @click="goMsgLinkFn('/user/message/list.html')" href="javascript:void(0)" class="WEB-icon msg-btn">消息<em v-text="'('+noticeNum+')'"></em></a>
                 </li>
                 <li class="headCart">
                     <a v-if="userIdentity!=3" href="javascript:void(0)" class="addBtn icon" @click="goCartsLinkFn" onclick="_czc.push(['_trackEvent','顶部导航','购物车','点击','','Um_Event_Cart'])">购物车<em v-text="'('+headCart.cartCount+')'"></em></a>
@@ -69,9 +69,15 @@
                 <img class="h5Only" src="/img/base/logo_m.png" alt="采美 生美/医美采购服务平台"/>
             </a>
             <div class="mf h5Only mUserCenter">
-                <a :href="loginStatus?'/shopping/cart.html':'javascript:void(0);'" :class="loginStatus?'mAddCart mIcon':'mAddCart mIcon toLogin'" title="购物车" rel="nofollow"></a>
-                <a v-if="loginStatus" @click="showGlobalMenu()" class="mUserIcon mIcon" href="javascript:void(0);" title="个人中心" rel="nofollow"></a>
-                <a v-else class="mUserIcon mIcon toLogin" href="javascript:void(0);" title="个人中心" rel="nofollow"></a>
+                <template v-if="loginStatus">
+                    <a href="/shopping/cart.html" :class="loginStatus?'mAddCart mIcon':'mAddCart mIcon toLogin'" title="购物车" rel="nofollow"></a>
+                    <a v-if="userIdentity===3" @click="goMsgLinkFn('/supplier/message/list.html')" href="javascript:void(0);" :class="loginStatus?'mNotice H5-icon':'mNotice H5-icon toLogin'" title="消息" rel="nofollow"></a>
+                    <a v-else @click="goMsgLinkFn('/user/message/list.html')" href="javascript:void(0);" :class="loginStatus?'mNotice H5-icon':'mNotice H5-icon toLogin'" title="消息" rel="nofollow"></a>
+                    <a @click="showGlobalMenu()" class="mUserIcon mIcon" href="javascript:void(0);" title="个人中心" rel="nofollow"></a>
+                </template>
+                <template v-else>
+                    <a class="mUserIcon mIcon toLogin" href="javascript:void(0);" title="个人中心" rel="nofollow"></a>
+                </template>
             </div>
             <div class="searchBox" id="topSearch">
                 <div class="search">

+ 5 - 5
src/main/resources/templates/supplier-center/message/list.html

@@ -26,8 +26,8 @@
             <div class="right">
                 <div class="content clear">
                     <div class="title">
-                        <div class="tabs-item"  v-for="(item, index) in mssageTabBar" :key="index" @click="changeTabsFn(index,item.state)" :class="mssageTabBarIndex == index ? 'active':''">
-                            <a href="javascript: void(0);">{{item.text}}<span v-if="index!=0">({{item.bages | NumBadge}})</span></a>
+                        <div class="tabs-item"  v-for="(item, index) in mssageTabBar" :key="index" @click="changeTabsFn(index,item.messageType)" :class="mssageTabBarIndex == index ? 'active':''">
+                            <a href="javascript: void(0);">{{item.text}}<span>({{item.bages | NumBadge}})</span></a>
                         </div>
                     </div>
                     <div class="section">
@@ -41,11 +41,11 @@
                                 <a href="javascript:void(0);" class="btn" @click="signMessageFn">标为已读</a>
                             </div>
                         </div>
-                        <div class="section-content" v-if="list.length > 0">
-                            <div class="new-list" v-for="(item, index) in list" @click="handleClick(item)" :key="index" :class="item.readFlag==1?'notclick':''">
+                        <div class="section-content" v-if="messagesList.length > 0">
+                            <div class="new-list" v-for="(item, index) in messagesList" :key="index" :class="item.readFlag==1?'notclick':''">
                                 <div class="text">
                                     <input type="checkbox"  class="check" v-model="item.check" @change="checkedItemFn(item)" />
-                                    <p v-html="hanldeNoticeText(item)"></p>
+                                    <p v-html="hanldeNoticeText(item)" @click.stop="handleClick(item)"></p>
                                 </div>
                                 <div class="time">{{item.time}}</div>
                             </div>

+ 5 - 5
src/main/resources/templates/user-center/message/list.html

@@ -29,8 +29,8 @@
                 </div>
                 <div class="content clear" v-else>
                     <div class="title">
-                        <div class="tabs-item"  v-for="(item, index) in mssageTabBar" :key="index" @click="changeTabsFn(index,item.state)" :class="mssageTabBarIndex == index ? 'active':''">
-                            <a href="javascript: void(0);">{{item.text}}<span v-if="index!=0">({{item.bages | NumBadge}})</span></a>
+                        <div class="tabs-item"  v-for="(item, index) in mssageTabBar" :key="index" @click="changeTabsFn(index,item.messageType)" :class="mssageTabBarIndex == index ? 'active':''">
+                            <a href="javascript: void(0);">{{item.text}}<span>({{item.bages | NumBadge}})</span></a>
                         </div>
                     </div>
                     <div class="section">
@@ -44,11 +44,11 @@
                                 <a href="javascript:void(0);" class="btn" @click="signMessageFn">标为已读</a>
                             </div>
                         </div>
-                        <div class="section-content" v-if="list.length > 0">
-                            <div class="new-list" v-for="(item, index) in list" @click="handleClick(item)" :key="index" :class="item.readFlag==1?'notclick':''">
+                        <div class="section-content" v-if="messagesList.length > 0">
+                            <div class="new-list" v-for="(item, index) in messagesList" :key="index" :class="item.saved==1?'notclick':''">
                                 <div class="text">
                                     <input type="checkbox"  class="check" v-model="item.check" @change="checkedItemFn(item)" />
-                                    <p v-html="hanldeNoticeText(item)"></p>
+                                    <p v-html="hanldeNoticeText(item)" @click.stop="handleClick(item)"></p>
                                 </div>
                                 <div class="time">{{item.time}}</div>
                             </div>