Ver Fonte

updated

xiebaomin há 1 ano atrás
pai
commit
a30f5717e8

+ 8 - 0
src/main/java/com/caimei/www/controller/authorized/AccountController.java

@@ -32,6 +32,7 @@ public class AccountController extends BaseController {
     private static final String BIND_PATH = "account/bind";
     /** 供应商编辑资料 */
     private static final String SUPPLIER_INFORMATION = "account/supplier-information";
+    private static final String CESHI_DEMO = "ceshi/demo";
 
 
     /**
@@ -138,4 +139,11 @@ public class AccountController extends BaseController {
         return SUPPLIER_INFORMATION;
     }
 
+    /**
+     * 测试demo
+     */
+    @GetMapping("/ceshi/demo.html")
+    public String ceshiDemo() {
+        return CESHI_DEMO;
+    }
 }

+ 70 - 64
src/main/resources/static/css/user-center/message.css

@@ -1,64 +1,70 @@
-@charset "utf-8";
-li{list-style:none}
-/**
- * PC端
- */
-@media screen and (min-width:768px){
-    .navLayout{min-height: 500px;}
-    .content .empty{background-color:#FFF;}
-    .content{width: 100%;min-height: 370px;background-color: #FFFFFF;box-sizing: border-box;padding:0 20px 20px 20px;box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.07);margin:0 0 10px 0;}
-    .content .title{width: 100%;height: 56px;border-bottom: solid 1px #e2e7ef;box-sizing: border-box;padding:9px 0;}
-    .content .title .tabs-item{width:18%;height: 38px;float: left;}
-    .content .title .tabs-item a{width:100%;height: 100%;display: block;font-size: 16px;line-height: 38px;text-align: left;color: #9aa5b5;}
-    .content .title .tabs-item.active a{color: #FF5B00;}
-    .content .section .section-top{width: 100%;height: 54px;float: left;box-sizing: border-box;padding: 9px 0;border-bottom: solid 1px #e2e7ef;}
-    .content .section .section-top .cheacked{width: 100px;height: 36px;float: left;cursor: pointer;}
-    .content .section .section-top .cheacked .check{margin: 8px 15px;}
-    .content .section .section-top .cheacked .icon{width: 16px;height: 16px;display: block;float: left;padding: 10px 15px}
-    .content .section .section-top .cheacked span{display: inline-block;line-height: 36px;font-size: 16px;color: #22272e;}
-    .content .section .section-top .button{width: 250px;height: 36px;float: right;}
-    .content .section .section-top .button .btn{width: 90px;height: 34px;float: right;margin-left: 16px;border-radius: 2px;background-color: #ffe6dc;line-height: 34px;text-align: center;font-size: 14px;color: #FF5B00;border: solid 1px #FF5B00;}
-    .content .section .section-content{width: 100%;height: auto;float: left;box-sizing: border-box;padding: 10px 0;}
-    .content .section .section-content .new-list{width: 100%;height:80px;float: left;box-sizing: border-box;padding: 15px 0;}
-    .content .section .section-content .new-list .text{line-height: 36px;float: left;}
-    .content .section .section-content .new-list .icon{width: 16px;height: 16px;display: block;float: left;padding: 10px 15px;line-height: 16px;cursor: pointer;}
-    .content .section .section-content .new-list .text p{width: 700px;height: 48px;line-height: 24px;font-size: 14px;color: #627386;float: left;text-overflow: ellipsis;display: -webkit-box;word-break: break-all;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;}
-    .content .section .section-content .new-list .text p .link{color: #E15621;cursor: pointer;text-decoration: underline;}
-    .content .section .section-content .new-list .text p .link:hover{text-decoration: underline;}
-    .content .section .section-content .new-list .time{line-height: 36px;font-size: 14px;color: #b8bfca;float: right;}
-    .check{float: left;margin: 4px 15px;}
-    .notclick{opacity: .6}
-}
-
-/**
-* 移动端
-*/
-@media screen and (max-width:768px){
-    footer{display: none;}
-    .content{width: 100%;height: auto;background-color: #FFFFFF;box-sizing: border-box;padding:3.3vw;box-shadow: 0px .8vw 1.6vw 0px rgba(0, 0, 0, 0.07);margin:0 0 2.7vw 0;padding-bottom:10px;}
-    .content .title{width: 100%;height: auto;line-height: 8.4vw;color: #22272e;font-size: 3.4vw;}
-    .content .title .tabs-item.active a{color: #FF5B00;}
-    .content .title .tabs-item{display:inline-block;height:8.4vw;border:1px solid #b8bfca;line-height:8.4vw;padding:0 3vw;border-radius:4.2vw;margin-right:4vw;margin-bottom: 2vw;}
-    .content .title .tabs-item a{color:#627386}
-    .content .title .tabs-item a span{color:#FF5B00}
-    .content .title .tabs-item.active{background-color:#ffe6dc;border-color:#FF5B00;color:#FF5B00}
-    .header-tabs .tabs-item.active a{color:#FF5B00}
-    .section-top{width: 100%;height: 54px;box-sizing: border-box;padding: 10px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 999;box-shadow: 0px .8vw 1.6vw 0px rgba(0, 0, 0, 0.07);}
-    .section-top .cheacked{width: 100px;height: 36px;float: left;cursor: pointer;}
-    .section-top .cheacked .icon{width: 16px;height: 16px;display: block;float: left;padding: 10px 15px}
-    .section-top .cheacked span{display: inline-block;line-height: 36px;font-size: 16px;color: #22272e;}
-    .section-top .button{height: 36px;float: right;}
-    .section-top .button .btn{width: 90px;height: 34px;float: right;margin-left: 16px;border-radius: 2px;background-color: #ffd8d8;line-height: 34px;text-align: center;font-size: 14px;color: #f94b4b;border: solid 1px #f94b4b;border-radius: 6.4vw}
-    .section-top .button .btn.Read{border: .27vw solid #1890f9;color: #1890f9;background: #e0f1ff}
-    .content .section .section-content{width: 100%;height: auto;float: left;box-sizing: border-box;padding: 10px 0;}
-    .content .section .section-content .new-list{width: 100%;box-sizing: border-box;float: left;margin-bottom: 4vw;}
-    .content .section .section-content .new-list .text{line-height: 36px;}
-    .content .section .section-content .new-list .icon{width: 16px;height: 16px;display: block;float: left;padding: 10px;line-height: 16px;cursor: pointer;}
-    .content .section .section-content .new-list .text p{line-height: 6vw;font-size: 3.4vw;color: #627386;float: left;width: 77.6vw;}
-    .content .section .section-content .new-list .text p .link{color: #E15621;cursor: pointer;text-decoration: underline;}
-    .content .section .section-content .new-list .time{font-size: 3.1vw;color: #b8bfca;float: left;padding-left: 37px}
-    input.check {width: 3.5vw;height: 3.5vw;line-height: 3.5vw;vertical-align: top;margin: 3vw 3vw 1.3vw 3.3vw;float: left;}
-    .notclick{pointer-events: none;opacity: .6}
-    .empty{padding: 50vw 0}
-}
-
+@charset "utf-8";
+li{list-style:none}
+/**
+ * PC端
+ */
+@media screen and (min-width:768px){
+    .navLayout{min-height: 500px;}
+    .content .empty{background-color:#FFF;}
+    .content{width: 100%;min-height: 370px;background-color: #FFFFFF;box-sizing: border-box;padding:0 20px 20px 20px;box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.07);margin:0 0 10px 0;}
+    .content .title{width: 100%;height: 56px;border-bottom: solid 1px #e2e7ef;box-sizing: border-box;padding:9px 0;}
+    .content .title .tabs-item{width:14%;height: 38px;float: left;}
+    .content .title .tabs-item a{width:100%;height: 100%;display: block;font-size: 16px;line-height: 38px;text-align: left;color: #9aa5b5;}
+    .content .title .tabs-item.active a{color: #FF5B00;}
+    .content .section .section-top{width: 100%;height: 54px;float: left;box-sizing: border-box;padding: 9px 0;border-bottom: solid 1px #e2e7ef;}
+    .content .section .section-top .cheacked{width: 100px;height: 36px;float: left;cursor: pointer;}
+    .content .section .section-top .cheacked .check{margin: 8px 15px;}
+    .content .section .section-top .cheacked .icon{width: 16px;height: 16px;display: block;float: left;padding: 10px 15px}
+    .content .section .section-top .cheacked span{display: inline-block;line-height: 36px;font-size: 16px;color: #22272e;}
+    .content .section .section-top .button{width: 250px;height: 36px;float: right;}
+    .content .section .section-top .button .btn{width: 90px;height: 34px;float: right;margin-left: 16px;border-radius: 2px;background-color: #ffe6dc;line-height: 34px;text-align: center;font-size: 14px;color: #FF5B00;border: solid 1px #FF5B00;}
+    .content .section .section-content{width: 100%;height: auto;float: left;box-sizing: border-box;padding: 10px 0;}
+    .content .section .section-content .new-list{width: 100%;height:80px;float: left;box-sizing: border-box;padding: 15px 0;}
+    .content .section .section-content .new-list .text{line-height: 36px;float: left;}
+    .content .section .section-content .new-list .text .msg-content {display: flex;flex-direction: column;}
+    .content .section .section-content .new-list .icon{width: 16px;height: 16px;display: block;float: left;padding: 10px 15px;line-height: 16px;cursor: pointer;}
+    .content .section .section-content .new-list .text p{width: 700px;height: auto;line-height: 24px;font-size: 14px;color: #627386;float: left;text-overflow: ellipsis;display: -webkit-box;word-break: break-all;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;}
+    .content .section .section-content .new-list .text #text-content {height: 48px;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;text-overflow: ellipsis;}
+    .content .section .section-content .new-list .text p .right-number {margin-left: 100px;}
+    .content .section .section-content .new-list .text p .link{color: #E15621;cursor: pointer;text-decoration: underline;}
+    .content .section .section-content .new-list .text p .link:hover{text-decoration: underline;}
+    .content .section .section-content .new-list .time{line-height: 36px;font-size: 14px;color: #b8bfca;float: right;}
+    .check{float: left;margin: 4px 15px;}
+    .notclick{opacity: .6}
+}
+
+/**
+* 移动端
+*/
+@media screen and (max-width:768px){
+    footer{display: none;}
+    .content{width: 100%;height: auto;background-color: #FFFFFF;box-sizing: border-box;padding:3.3vw;box-shadow: 0px .8vw 1.6vw 0px rgba(0, 0, 0, 0.07);margin:0 0 2.7vw 0;padding-bottom:10px;}
+    .content .title{width: 100%;height: auto;line-height: 8.4vw;color: #22272e;font-size: 3.4vw;}
+    .content .title .tabs-item.active a{color: #FF5B00;}
+    .content .title .tabs-item{display:inline-block;height:8.4vw;border:1px solid #b8bfca;line-height:8.4vw;padding:0 3vw;border-radius:4.2vw;margin-right:4vw;margin-bottom: 2vw;}
+    .content .title .tabs-item a{color:#627386}
+    .content .title .tabs-item a span{color:#FF5B00}
+    .content .title .tabs-item.active{background-color:#ffe6dc;border-color:#FF5B00;color:#FF5B00}
+    .header-tabs .tabs-item.active a{color:#FF5B00}
+    .section-top{width: 100%;height: 54px;box-sizing: border-box;padding: 10px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 999;box-shadow: 0px .8vw 1.6vw 0px rgba(0, 0, 0, 0.07);}
+    .section-top .cheacked{width: 100px;height: 36px;float: left;cursor: pointer;}
+    .section-top .cheacked .icon{width: 16px;height: 16px;display: block;float: left;padding: 10px 15px}
+    .section-top .cheacked span{display: inline-block;line-height: 36px;font-size: 16px;color: #22272e;}
+    .section-top .button{height: 36px;float: right;}
+    .section-top .button .btn{width: 90px;height: 34px;float: right;margin-left: 16px;border-radius: 2px;background-color: #ffd8d8;line-height: 34px;text-align: center;font-size: 14px;color: #f94b4b;border: solid 1px #f94b4b;border-radius: 6.4vw}
+    .section-top .button .btn.Read{border: .27vw solid #1890f9;color: #1890f9;background: #e0f1ff}
+    .content .section .section-content{width: 100%;height: auto;float: left;box-sizing: border-box;padding: 10px 0;}
+    .content .section .section-content .new-list{width: 100%;box-sizing: border-box;float: left;margin-bottom: 4vw;}
+    .content .section .section-content .new-list .text{line-height: 36px;}
+    .content .section .section-content .new-list .text .msg-content {display: flex;flex-direction: column;}
+    .content .section .section-content .new-list .icon{width: 16px;height: 16px;display: block;float: left;padding: 10px;line-height: 16px;cursor: pointer;}
+    .content .section .section-content .new-list .text p{line-height: 6vw;font-size: 3.4vw;color: #627386;float: left;width: 77.6vw;}
+    .content .section .section-content .new-list .text #text-content {height: 12vw;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;text-overflow: ellipsis;}
+    .content .section .section-content .new-list .text p .right-number {margin-left: 5vw;}
+    .content .section .section-content .new-list .text p .link{color: #E15621;cursor: pointer;text-decoration: underline;}
+    .content .section .section-content .new-list .time{font-size: 3.1vw;color: #b8bfca;float: left;padding-left: 37px}
+    input.check {width: 3.5vw;height: 3.5vw;line-height: 3.5vw;vertical-align: top;margin: 3vw 3vw 1.3vw 3.3vw;float: left;}
+    .notclick{pointer-events: none;opacity: .6}
+    .empty{padding: 50vw 0}
+}
+

+ 1 - 1
src/main/resources/static/js/article/common.js

@@ -12,7 +12,7 @@ const handleFileUrl = (id) => {
 }
 // 轮播点击量统计
 const handleSwiperHits = ($event) => {
-    ProductApi.userSwiperHits({ id: $event.id, type: 2 }, (res) => {
+    ProductApi.userSwiperHits({ authorId: $event.id, type: 2 }, (res) => {
         console.log(res)
     })
 }

+ 201 - 201
src/main/resources/static/js/article/recommendation.js

@@ -1,201 +1,201 @@
-var recommendation = new Vue({
-    el: "#Recommendation",
-    mixins: [cmSysVitaMixins],
-    data: {
-        status: {
-            'isDocument': 0, // 文件
-            'isSelected': 1, // 精选
-            'isNotice': 2, // 公告
-        },
-        state: null,
-        params: {
-            size: 10,
-            num: 1,
-            typeId: '',
-            labelId: '',
-            keyword: '',
-            status: 1,
-            startDate: '',
-            endDate: '',
-            productFlag: 1, // 是否统计关键词 1 统计 0 不统计
-            linkageFlag: 0, // 关键词来源是否为用户搜索 0 是 1 不是
-            selectDataRoutes: 1 // 最新 最早
-        },
-        listData: [],
-        articlerecommendationData: [],
-        listRecord: 0,
-        productRecord: 0,
-        productList: [],
-        pageInput: '1',
-        keyword: '',
-        isRossShow: false,
-        stateObj: {},
-        noMore: true,
-    },
-    computed: {
-        pageTotal: function () {
-            let total = Math.ceil(this.listRecord / this.params.size);
-            return total > 0 ? total : 1;
-        },
-        showPageBtn: function () {
-            let total = Math.ceil(this.listRecord / this.params.size);
-            total = total > 0 ? total : 1;
-            let index = this.params.num, arr = [];
-            if (total <= 6) {
-                for (let i = 1; i <= total; i++) {
-                    arr.push(i);
-                }
-                return arr;
-            }
-            if (index <= 3) return [1, 2, 3, 4, 5, 0, total];
-            if (index >= total - 2) return [1, 0, total - 4, total - 3, total - 2, total - 1, total];
-            return [1, 0, index - 2, index - 1, index, index + 1, index + 2, 0, total];
-        },
-    },
-    watch: {
-        'window.location.pathname': {
-            handler() {
-                const query = window.location.search.split('?')[1]
-                this.state = this.status[query]
-            },
-            deep: true,
-            immediate: true
-        }
-    },
-    filters: {
-        filterDate(str) {
-            return str.substring(0, 11)
-        },
-    },
-    mounted() {
-        this.initData()
-    },
-    methods: {
-        initData() {
-            if (this.state === 2) {
-                this.getNewList()
-            } else {
-                this.getArticlerecommendation(this.state)
-            }
-        },
-        getArticlerecommendation: function (id, num) {
-            var _self = this;
-            if (isPC) {
-                let paramsArr = window.location.pathname.split(".")[0].split("-");
-                this.params.num = paramsArr[2]
-                $.getJSON("/info/articlerecommendation/" + id + "/" + this.params.num, {}, function (r) {
-                    if (r.code === 0 && r.data) {
-                        _self.stateObj = r.data
-                        _self.articlerecommendationData = r.data.results;
-                        _self.listRecord = r.data.totalRecord
-                    }
-                });
-            } else {
-                this.params.num = num || '1'
-                $.getJSON("/info/articlerecommendation/" + id + "/" + this.params.num, {}, function (r) {
-                    console.log(r.data)
-                    if (r.code === 0 && r.data) {
-                        _self.stateObj = r.data
-                        _self.articlerecommendationData = [..._self.articlerecommendationData, ...r.data.results];
-                        _self.listRecord = r.data.totalRecord
-                    }
-                });
-            }
-        },
-        getNewList(num) {
-            if (isPC) {
-                let paramsArr = window.location.pathname.split(".")[0].split("-");
-                this.params.num = paramsArr[2]
-                const params = {
-                    pageSize: this.params.size,
-                    pageNum: this.params.num
-                }
-                PublicApi.GetNewsList(params, ({data}) => {
-                    this.listRecord = data.totalRecord
-                    this.listData = data.results
-                })
-            } else {
-                this.params.num = num || '1'
-                const params = {
-                    pageSize: this.params.size,
-                    pageNum: this.params.num
-                }
-                PublicApi.GetNewsList(params, ({data}) => {
-                    this.listRecord = data.totalRecord
-                    this.listData = [...this.listData, ...data.results]
-                })
-            }
-        },
-        //获取更多数据
-        handleMore (num) {
-            if (this.state===2) {
-                if (this.params.num < this.pageTotal) { // 获取列表数据
-                    this.params.num = num
-                    this.getNewList(num);
-                } else { //到底了
-                    this.noMore = false;
-                }
-            } else {
-                this.params.num = num;
-                this.getArticlerecommendation(this.state, num)
-                if (num === this.stateObj.totalPage) {
-                    this.noMore = false;
-                }
-            }
-        },
-        // 页码链接处理
-        paginationUrl (pageNum) {
-            let path = window.location.href;
-            const query = window.location.search
-            let paramsArr = window.location.pathname.split(".")[0].split("-");
-            let pageId = paramsArr.length >= 1 ? paramsArr[1] : '';
-            path = '/info/articlerecommendation-' + pageId + '-' + pageNum + '.html';
-            return path + query;
-        },
-        // 页面修改
-        checkNum: function () {
-            if (this.pageInput > this.pageTotal) {
-                this.pageInput = this.pageTotal;
-            } else if (this.pageInput < 1) {
-                this.pageInput = 1;
-            }
-        },
-        //页面跳转
-        changeLink() {
-            console.log(this.pageInput)
-            if (this.state === 1) {
-                window.location.href = '/info/articlerecommendation-1-' + this.pageInput + '.html?isSelected'
-            } else {
-                window.location.href = '/info/articlerecommendation-0-' + this.pageInput + '.html?isDocument'
-            }
-        },
-        // 过滤标签
-        filterTab(str) {
-            return str.replace(/<[^>]+>/g, '')
-        },
-        // 数组
-        filterArr(str) {
-            return str.split(',')
-        },
-        // 链接跳转
-        handleTramp(id) {
-            if (this.state === 2) {
-                window.location.href = '/news/details.html?id=' + id
-            } else {
-                window.location.href = '/info/detail-' + id + '-1.html'
-            }
-        },
-        // 文件链接跳转
-        handleFileUrl(id) {
-            window.location.href = `/product-${id}.html?tabsIndex=4`
-            // const fileUrl = url.split('?')[0]
-            // let index = fileUrl.lastIndexOf('.');
-            // let suffix = fileUrl.substring(index);
-            // if (suffix === '.doc' || suffix === '.ppt' || suffix === '.pptx' || suffix === '.docx') {
-            //     window.open('https://view.officeapps.live.com/op/view.aspx?src=' + encodeURIComponent(url), '_black') // 下载
-            // } else {
-            //     window.open(fileUrl, '_blank')
-            // }
-        }
-    }
-})
+var recommendation = new Vue({
+    el: "#Recommendation",
+    mixins: [cmSysVitaMixins],
+    data: {
+        status: {
+            'isDocument': 0, // 文件
+            'isSelected': 1, // 精选
+            'isNotice': 2, // 公告
+        },
+        state: null,
+        params: {
+            size: 10,
+            num: 1,
+            typeId: '',
+            labelId: '',
+            keyword: '',
+            status: 1,
+            startDate: '',
+            endDate: '',
+            productFlag: 1, // 是否统计关键词 1 统计 0 不统计
+            linkageFlag: 0, // 关键词来源是否为用户搜索 0 是 1 不是
+            selectDataRoutes: 1 // 最新 最早
+        },
+        listData: [],
+        articlerecommendationData: [],
+        listRecord: 0,
+        productRecord: 0,
+        productList: [],
+        pageInput: '1',
+        keyword: '',
+        isRossShow: false,
+        stateObj: {},
+        noMore: true,
+    },
+    computed: {
+        pageTotal: function () {
+            let total = Math.ceil(this.listRecord / this.params.size);
+            return total > 0 ? total : 1;
+        },
+        showPageBtn: function () {
+            let total = Math.ceil(this.listRecord / this.params.size);
+            total = total > 0 ? total : 1;
+            let index = Number(this.params.num), arr = [];
+            if (total <= 6) {
+                for (let i = 1; i <= total; i++) {
+                    arr.push(i);
+                }
+                return arr;
+            }
+            if (index <= 3) return [1, 2, 3, 4, 5, 0, total];
+            if (index >= total - 2) return [1, 0, total - 4, total - 3, total - 2, total - 1, total];
+            return [1, 0, index - 2, index - 1, index, index + 1, index + 2, 0, total];
+        },
+    },
+    watch: {
+        'window.location.pathname': {
+            handler() {
+                const query = window.location.search.split('?')[1]
+                this.state = this.status[query]
+            },
+            deep: true,
+            immediate: true
+        }
+    },
+    filters: {
+        filterDate(str) {
+            return str.substring(0, 11)
+        },
+    },
+    mounted() {
+        this.initData()
+    },
+    methods: {
+        initData() {
+            if (this.state === 2) {
+                this.getNewList()
+            } else {
+                this.getArticlerecommendation(this.state)
+            }
+        },
+        getArticlerecommendation: function (id, num) {
+            var _self = this;
+            if (isPC) {
+                let paramsArr = window.location.pathname.split(".")[0].split("-");
+                this.params.num = paramsArr[2]
+                $.getJSON("/info/articlerecommendation/" + id + "/" + this.params.num, {}, function (r) {
+                    if (r.code === 0 && r.data) {
+                        _self.stateObj = r.data
+                        _self.articlerecommendationData = r.data.results;
+                        _self.listRecord = r.data.totalRecord
+                    }
+                });
+            } else {
+                this.params.num = num || '1'
+                $.getJSON("/info/articlerecommendation/" + id + "/" + this.params.num, {}, function (r) {
+                    console.log(r.data)
+                    if (r.code === 0 && r.data) {
+                        _self.stateObj = r.data
+                        _self.articlerecommendationData = [..._self.articlerecommendationData, ...r.data.results];
+                        _self.listRecord = r.data.totalRecord
+                    }
+                });
+            }
+        },
+        getNewList(num) {
+            if (isPC) {
+                let paramsArr = window.location.pathname.split(".")[0].split("-");
+                this.params.num = paramsArr[2]
+                const params = {
+                    pageSize: this.params.size,
+                    pageNum: this.params.num
+                }
+                PublicApi.GetNewsList(params, ({data}) => {
+                    this.listRecord = data.totalRecord
+                    this.listData = data.results
+                })
+            } else {
+                this.params.num = num || '1'
+                const params = {
+                    pageSize: this.params.size,
+                    pageNum: this.params.num
+                }
+                PublicApi.GetNewsList(params, ({data}) => {
+                    this.listRecord = data.totalRecord
+                    this.listData = [...this.listData, ...data.results]
+                })
+            }
+        },
+        //获取更多数据
+        handleMore (num) {
+            if (this.state===2) {
+                if (this.params.num < this.pageTotal) { // 获取列表数据
+                    this.params.num = num
+                    this.getNewList(num);
+                } else { //到底了
+                    this.noMore = false;
+                }
+            } else {
+                this.params.num = num;
+                this.getArticlerecommendation(this.state, num)
+                if (num === this.stateObj.totalPage) {
+                    this.noMore = false;
+                }
+            }
+        },
+        // 页码链接处理
+        paginationUrl (pageNum) {
+            let path = window.location.href;
+            const query = window.location.search
+            let paramsArr = window.location.pathname.split(".")[0].split("-");
+            let pageId = paramsArr.length >= 1 ? paramsArr[1] : '';
+            path = '/info/articlerecommendation-' + pageId + '-' + pageNum + '.html';
+            return path + query;
+        },
+        // 页面修改
+        checkNum: function () {
+            if (this.pageInput > this.pageTotal) {
+                this.pageInput = this.pageTotal;
+            } else if (this.pageInput < 1) {
+                this.pageInput = 1;
+            }
+        },
+        //页面跳转
+        changeLink() {
+            console.log(this.pageInput)
+            if (this.state === 1) {
+                window.location.href = '/info/articlerecommendation-1-' + this.pageInput + '.html?isSelected'
+            } else {
+                window.location.href = '/info/articlerecommendation-0-' + this.pageInput + '.html?isDocument'
+            }
+        },
+        // 过滤标签
+        filterTab(str) {
+            return str.replace(/<[^>]+>/g, '')
+        },
+        // 数组
+        filterArr(str) {
+            return str.split(',')
+        },
+        // 链接跳转
+        handleTramp(id) {
+            if (this.state === 2) {
+                window.location.href = '/news/details.html?id=' + id
+            } else {
+                window.location.href = '/info/detail-' + id + '-1.html'
+            }
+        },
+        // 文件链接跳转
+        handleFileUrl(id) {
+            window.location.href = `/product-${id}.html?tabsIndex=4`
+            // const fileUrl = url.split('?')[0]
+            // let index = fileUrl.lastIndexOf('.');
+            // let suffix = fileUrl.substring(index);
+            // if (suffix === '.doc' || suffix === '.ppt' || suffix === '.pptx' || suffix === '.docx') {
+            //     window.open('https://view.officeapps.live.com/op/view.aspx?src=' + encodeURIComponent(url), '_black') // 下载
+            // } else {
+            //     window.open(fileUrl, '_blank')
+            // }
+        }
+    }
+})

+ 88 - 0
src/main/resources/static/js/ceshi/index.js

@@ -0,0 +1,88 @@
+new Vue({
+    el: '#pdf5',
+    data: {
+        pdfUrl: 'https://caimei-oss.oss-cn-shenzhen.aliyuncs.com/beta/archiveFile/d99a0fa229524d1496925e2328a77b70.pdf',
+        wordUrl: 'https://caimei-oss.oss-cn-shenzhen.aliyuncs.com/beta/archiveFile/f1a9288cf05c4b4b9de49bf51c065c23.docx',
+        wordText: ''
+    },
+    mounted() {
+        console.log('================================')
+        // this.getWordText()
+        this.pdfToHtml()
+    },
+    methods:{
+        getWordText() {
+            const xhr = new XMLHttpRequest();
+            xhr.open("get", this.wordUrl, true);
+            xhr.responseType = "arraybuffer";
+            xhr.onload = () => {
+                if (xhr.status == 200) {
+                    console.log(xhr.response)
+                    mammoth.convertToHtml({ arrayBuffer: new Uint8Array(xhr.response) }).then((resultObject) => {
+                        this.wordText = resultObject.value
+                        this.getToPdf()
+                    });
+                }
+            };
+            xhr.send()
+        },
+        htmlToPdf() {
+            const element = document.getElementById('wordView');
+            const options = {
+                filename: 'wordView.pdf',
+                image: { type: 'jpeg', quality: 0.98 },
+                html2canvas: { scale: 2 },
+                jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' },
+            };
+
+            const pdf = html2pdf().set(options).from(element).save();
+            const blobUrl = URL.createObjectURL(new Blob([pdf], { type: 'application/pdf' }));
+            const iframe = document.createElement('iframe');
+            iframe.src = blobUrl;
+            document.body.appendChild(iframe);
+            console.log(pdf);
+        },
+        async getToPdf() {
+            const pdfDoc = await PDFLib.PDFDocument.create()
+            const pages = pdfDoc.getPages();
+            const firstPage = pages[0];
+            console.log(pdfDoc)
+            firstPage.drawText(this.wordText, {
+                x: 50,
+                y: firstPage.getHeight() - 50,
+                size: 12,
+            });
+            const pdfBytes = await pdfDoc.save();
+            const blobUrl = URL.createObjectURL(new Blob([pdfBytes], { type: 'application/pdf' }));
+            const iframe = document.createElement('iframe');
+            iframe.src = blobUrl;
+            document.body.appendChild(iframe);
+        },
+        async pdfToHtml () {
+            const response = await fetch(this.pdfUrl);
+            const pdfData = await response.arrayBuffer();
+            console.log(pdfData)
+            const pdf = await pdfjsLib.getDocument({ data: pdfData })
+            const numPages = pdf.numPages;
+            console.log(pdf)
+            for (let pageNumber = 1; pageNumber <= numPages; pageNumber++) {
+                const page = await pdf.getPage(pageNumber);
+                const scale = 1.5;
+                const viewport = page.getViewport({ scale });
+
+                const canvas = document.createElement('canvas');
+                const context = canvas.getContext('2d');
+                canvas.height = viewport.height;
+                canvas.width = viewport.width;
+
+                const renderContext = {
+                    canvasContext: context,
+                    viewport,
+                };
+
+                await page.render(renderContext);
+                document.body.appendChild(canvas);
+            }
+        },
+    }
+})

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

@@ -1,63 +1,63 @@
-'use strict';
-var noticeMixin = function () {// 通知消息
-    return {
-        data(){
-            return{}
-        },
-        computed: {
-
-        },
-        mounted() {
-            var _this = this;
-            window.handleUsersClick  = this.handleUsersClick;
-        },
-        methods: {
-            hanldeNoticeText(cell){ // 根据tab计算返回显示文案
-                const $EventFunction = {
-                    2:this.noticeUsersText(cell),
-                    3:this.noticeServeText(cell),
-                }
-                return $EventFunction[cell.messageType]
-            },
-            noticeUsersText(cell) { // 账户通知文案
-                const linkMap = {
-                    3:`<span data-type="${cell.shopMessType}" data-id="${cell.productId}" class="link" onclick="handleUsersClick($(this))" class="link">编辑商品</span>`,
-                    5:`<span data-type="${cell.shopMessType}" data-id="${cell.productId}" class="link" onclick="handleUsersClick($(this))" class="link">上传</span>`
-                }
-                const map = {
-                    1: '您的注册信息已审核通过,恭喜您成为采美平台供应商用户。您可以上架商品到采美商城进行出售了。',
-                    2: `恭喜您(微信昵称:${cell.content})成功成为【${cell.shopName}】的运营人员。`,
-                    3: `商品”${cell.productName}“,上架审核未通过,暂时不能上架采美商城,请重新${linkMap[cell.shopMessType]}进行提交。`,
-                    4: `商品”${cell.productName}“,新品展示审核未通过,未能展示在采美商城新品橱窗。`,
-                    5: `商品”${cell.productName}“,该商品的资质证书将于${cell.content}后失效,请及时${linkMap[cell.shopMessType]}新证书。`,
-                    6: `恭喜您发布的采美百科词条“${cell.content}”审核已通过。`,
-                    7: `很遗憾!您发布的采美百科词条“${cell.content}”审核未通过,原因是“${cell.reasonContent}”,可前往电脑端“我的词条”进行修改后,重新提交审核。`,
-                    8: `恭喜您发布的采美文章“${cell.content}”审核已通过。`,
-                    9: `很遗憾!您发布的采美文章“${cell.content}”审核未通过,原因是“${cell.reasonContent}”,可前往电脑端“文章管理”进行修改后,重新提交审核。`
-                }
-                return map[cell.shopMessType]
-            },
-            noticeServeText(cell){//服务通知文案处理
-                const map = {
-                    1: `您的供应商账号上架费将于${cell.content},到期后将无法发布和编辑商品,同时也会影响到其他采美提供的支持服务。请联系采美工作人员进行续费请联系采美工作人员进行续费请联系采美工作人员进行续费,联系电话0755-22907771 或15338851365`
-                }
-                return map[cell.shopTieredType]
-            },
-            handleUsersClick($event){
-                let shopMessType  = Number($event[0].attributes[0].value);
-                let productId  = Number($event[0].attributes[1].value);
-                if(shopMessType === 1 || shopMessType === 2 || shopMessType === 4){
-                    return;
-                }
-                const linkJumpMap = {
-                    3:`/supplier/release.html?productId=${productId}&type=edit`,
-                    5:`/supplier/release.html?productId=${productId}&type=edit`,
-                }
-                window.open(linkJumpMap[shopMessType]);
-            },
-            handleServeClick($event){
-                console.log('服务通知跳转');
-            }
-        }
-    };
-}();
+'use strict';
+var noticeMixin = function () {// 通知消息
+    return {
+        data(){
+            return{}
+        },
+        computed: {
+
+        },
+        mounted() {
+            var _this = this;
+            window.handleUsersClick  = this.handleUsersClick;
+        },
+        methods: {
+            hanldeNoticeText(cell){ // 根据tab计算返回显示文案
+                const $EventFunction = {
+                    2:this.noticeUsersText(cell),
+                    3:this.noticeServeText(cell),
+                }
+                return $EventFunction[cell.messageType]
+            },
+            noticeUsersText(cell) { // 账户通知文案
+                const linkMap = {
+                    3:`<span data-type="${cell.shopMessType}" data-id="${cell.productId}" class="link" onclick="handleUsersClick($(this))" class="link">编辑商品</span>`,
+                    5:`<span data-type="${cell.shopMessType}" data-id="${cell.productId}" class="link" onclick="handleUsersClick($(this))" class="link">上传</span>`
+                }
+                const map = {
+                    1: '您的注册信息已审核通过,恭喜您成为采美平台供应商用户。您可以上架商品到采美商城进行出售了。',
+                    2: `恭喜您(微信昵称:${cell.content})成功成为【${cell.shopName}】的运营人员。`,
+                    3: `商品”${cell.productName}“,上架审核未通过,暂时不能上架采美商城,请重新${linkMap[cell.shopMessType]}进行提交。`,
+                    4: `商品”${cell.productName}“,新品展示审核未通过,未能展示在采美商城新品橱窗。`,
+                    5: `商品”${cell.productName}“,该商品的资质证书将于${cell.content}后失效,请及时${linkMap[cell.shopMessType]}新证书。`,
+                    6: `恭喜您发布的采美百科词条“${cell.content}”审核已通过。`,
+                    7: `很遗憾!您发布的采美百科词条“${cell.content}”审核未通过,原因是“${cell.reasonContent}”,可前往电脑端“我的词条”进行修改后,重新提交审核。`,
+                    8: `恭喜您发布的采美文章“${cell.content}”审核已通过。`,
+                    9: `很遗憾!您发布的采美文章“${cell.content}”审核未通过,原因是“${cell.reasonContent}”,可前往电脑端“文章管理”进行修改后,重新提交审核。`
+                }
+                return map[cell.shopMessType]
+            },
+            noticeServeText(cell){//服务通知文案处理
+                const map = {
+                    1: `您的供应商账号上架费将于${cell.content},到期后将无法发布和编辑商品,同时也会影响到其他采美提供的支持服务。请联系采美工作人员进行续费请联系采美工作人员进行续费请联系采美工作人员进行续费,联系电话0755-22907771 或15338851365`
+                }
+                return map[cell.shopTieredType]
+            },
+            handleUsersClick($event){
+                let shopMessType  = Number($event[0].attributes[0].value);
+                let productId  = Number($event[0].attributes[1].value);
+                if(shopMessType === 1 || shopMessType === 2 || shopMessType === 4){
+                    return;
+                }
+                const linkJumpMap = {
+                    3:`/supplier/release.html?productId=${productId}&type=edit`,
+                    5:`/supplier/release.html?productId=${productId}&type=edit`,
+                }
+                window.open(linkJumpMap[shopMessType]);
+            },
+            handleServeClick($event){
+                console.log('服务通知跳转');
+            }
+        }
+    };
+}();

+ 245 - 242
src/main/resources/static/js/user-center/message.js

@@ -1,242 +1,245 @@
-;
-var helpSuggestion = new Vue({
-    el: "#dashboard",
-    mixins: [noticeMixin,cmSysVitaMixins],
-    data: {
-        btnLoading: false,
-        isRequset:true,
-        mssageTabBarIndex:0,
-        mssageTabBar: [
-            {messageType: '',text: '全部消息',bages:0},
-            {messageType: 1,text: '交易物流',bages:0},
-            {messageType: 2,text: '账户通知',bages:0},
-            {messageType: 3,text: '服务通知',bages:0},
-            {messageType: 4,text: '优惠促销',bages:0},
-        ],
-        allCount:0,
-        listQuery: {
-            source: 1,
-            commonId: 0,
-            messageType: '',
-            pageNum: 1,
-            pageSize: 10
-        },
-        noMore:false,
-        listRecord: 0,
-        pageInput: '1',
-        degree:'',
-        isCheckedAll:false,
-        messagesList:[],//消息列表
-        check:false,
-        checklist:[],
-        msgId:'',
-    },
-    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;
-        },
-        showPageBtn: function () {
-            var total = Math.ceil(this.listRecord / this.listQuery.pageSize);
-            total = total > 0 ? total : 1;
-            var index = this.listQuery.pageNum, arr = [];
-            if (total <= 6) {
-                for (var i = 1; i <= total; i++) {
-                    arr.push(i);
-                }
-                return arr;
-            }
-            if (index <= 3) return [1, 2, 3, 4, 5, 0, total];
-            if (index >= total - 2) return [1, 0, total - 4, total - 3, total - 2, total - 1, total];
-            return [1, 0, index - 2, index - 1, index, index + 1, index + 2, 0, total];
-        }
-    },
-    methods: {
-         toPagination: function (pageNum) {//点击切换分页
-            if (pageNum <= this.pageTotal) {
-                this.listQuery.pageNum = pageNum;
-                this. getAuthClubMessageList();
-            }
-        },
-        checkNum: function () {//输入跳转分页
-            if (this.pageInput > this.pageTotal) {
-                this.pageInput = this.pageTotal;
-            } else if (this.pageInput < 1) {
-                this.pageInput = 1;
-            }
-        },
-        changeTabsFn:function(index,messageType){//点击Tab切换消息通知
-            this.mssageTabBarIndex = index;
-            this.listQuery.messageType = messageType;
-            this.listQuery.pageNum = 1;
-            this.messagesList = [];
-            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;
-            })
-        },
-        getAuthClubMessageList:function(){
-            var _self = this;
-            UserApi.getAuthClubMessageList(_self.listQuery,function (response) {
-                if(response.code == 0){
-                    _self.isRequset = false;
-                    _self.isCheckedAll = false;
-                    var data = response.data;
-                    if (data.list.length>0){
-                        if(isPC){
-                            _self.messagesList = data.list.map(function (el) {
-                                el.check = false
-                                return el;
-                            });
-                        }else{
-                            var list = data.list.map(function (el) {
-                                el.check = false
-                                return el;
-                            });
-                            _self.messagesList = _self.messagesList.concat(list);
-                        }
-                         _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){
-                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.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.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('刪除成功');
-                      setTimeout(function (){
-                          _this.getAuthClubMessageList();
-                      },500)
-                    }else {
-                      CAIMEI.Alert(res.msg, '确定', false);
-                    }
-                })
-             }
-        },
-        signMessageFn: function(){//标记为已读
-          var _this =this;
-            console.log(_this.checklist);
-            console.log(_this.msgId);
-            if(this.allCount === 0){
-                CAIMEI.dialog('暂无未读消息');
-            }else if(_this.checklist.length==0){
-                CAIMEI.dialog('请勾选未读消息');
-            }else {
-                UserApi.authUpdateRead({userType:1,Id:_this.msgId},function (res) {
-                    if(res.code==0){
-                        CAIMEI.dialog('标记已读成功');
-                        setTimeout(function (){
-                            _this.getAuthClubMessageCount();
-                            _this.getAuthClubMessageList();
-                        },500)
-                    }else {
-                        CAIMEI.Alert(res.msg, '确定', false);
-                    }
-                })
-            }
-        }
-    },
-    mounted: function () {
-        var _self=this;
-        if(globalUserData){
-            this.listQuery.commonId = globalUserData.clubId;
-            this.getAuthClubMessageCount()
-            this.getAuthClubMessageList();
-        }
-        if(!isPC){
-            $('footer').addClass("noneImportant");
-            //移动端上垃加载更多
-            $(window).on('scroll', function(){
-                var scrollTop = $(this).scrollTop();
-                var scrollHeight = $(document).height();
-                var windowHeight = window.innerHeight;
-                if (scrollTop + windowHeight >= scrollHeight) {
-                    //此处是滚动条到底部时候触发的事件,在这里写要加载的数据,或者是拉动滚动条的操作
-                    var totalPage = Math.ceil(_self.listRecord / _self.listQuery.pageSize)?Math.ceil(_self.listRecord / _self.listQuery.pageSize):1;
-                    var next = _self.listQuery.pageNum+1;
-                    if(next <= totalPage){
-                        if (_self.requestFlag){
-                            _self.listQuery.pageNum = next;
-                            // 获取列表数据
-                            _self.getAuthClubMessageList();
-                        }
-                        _self.requestFlag = false;
-                    }else{
-                        //到底了
-                        _self.noMore = true;
-                        $('footer').removeClass("noneImportant");
-                    }
-                }
-            });
-        }
-    }
-});
+;
+var helpSuggestion = new Vue({
+    el: "#dashboard",
+    mixins: [noticeMixin,cmSysVitaMixins],
+    data: {
+        btnLoading: false,
+        isRequset:true,
+        mssageTabBarIndex:0,
+        mssageTabBar: [
+            {messageType: '',text: '全部消息',bages:0},
+            {messageType: 1,text: '交易物流',bages:0},
+            {messageType: 2,text: '账户通知',bages:0},
+            {messageType: 3,text: '服务通知',bages:0},
+            {messageType: 4,text: '优惠促销',bages:0},
+            {messageType: 5,text: '最新文章',bages:0},
+            {messageType: 6,text: '最新活动',bages:0},
+        ],
+        allCount:0,
+        listQuery: {
+            source: 1,
+            commonId: 0,
+            messageType: '',
+            pageNum: 1,
+            pageSize: 10
+        },
+        noMore:false,
+        listRecord: 0,
+        pageInput: '1',
+        degree:'',
+        isCheckedAll:false,
+        messagesList:[],//消息列表
+        check:false,
+        checklist:[],
+        msgId:'',
+    },
+    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;
+        },
+        showPageBtn: function () {
+            var total = Math.ceil(this.listRecord / this.listQuery.pageSize);
+            total = total > 0 ? total : 1;
+            var index = this.listQuery.pageNum, arr = [];
+            if (total <= 6) {
+                for (var i = 1; i <= total; i++) {
+                    arr.push(i);
+                }
+                return arr;
+            }
+            if (index <= 3) return [1, 2, 3, 4, 5, 0, total];
+            if (index >= total - 2) return [1, 0, total - 4, total - 3, total - 2, total - 1, total];
+            return [1, 0, index - 2, index - 1, index, index + 1, index + 2, 0, total];
+        }
+    },
+    methods: {
+         toPagination: function (pageNum) {//点击切换分页
+            if (pageNum <= this.pageTotal) {
+                this.listQuery.pageNum = pageNum;
+                this. getAuthClubMessageList();
+            }
+        },
+        checkNum: function () {//输入跳转分页
+            if (this.pageInput > this.pageTotal) {
+                this.pageInput = this.pageTotal;
+            } else if (this.pageInput < 1) {
+                this.pageInput = 1;
+            }
+        },
+        changeTabsFn:function(index,messageType){//点击Tab切换消息通知
+            this.mssageTabBarIndex = index;
+            this.listQuery.messageType = messageType;
+            this.listQuery.pageNum = 1;
+            this.messagesList = [];
+            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;
+            })
+        },
+        getAuthClubMessageList:function(){
+            var _self = this;
+            UserApi.getAuthClubMessageList(_self.listQuery,function (response) {
+                if(response.code == 0){
+                    _self.isRequset = false;
+                    _self.isCheckedAll = false;
+                    var data = response.data;
+                    if (data.list.length>0){
+                        if(isPC){
+                            _self.messagesList = data.list.map(function (el) {
+                                el.check = false
+                                return el;
+                            });
+                            _self.messagesList = [{check:false, messageType: 6, content: '哦哈都会我爱到单位哦对哈我的我啊哦我大号哦啊的文化奥迪哦啊我的好多好单位我哦对哈我的我啊哦我大号哦啊的文化奥迪哦啊我的好多好哦对哈我的我啊哦我大号哦啊的文化奥迪哦啊我的好多好哦对哈我的我啊哦我大号哦啊的文化奥迪哦啊我的好多好哦对哈我的我啊哦我大号哦啊的文化奥迪哦啊我的好多好'}, ..._self.messagesList];
+                        }else{
+                            var list = data.list.map(function (el) {
+                                el.check = false
+                                return el;
+                            });
+                            _self.messagesList = _self.messagesList.concat(list);
+                        }
+                         _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){
+                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.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.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('刪除成功');
+                      setTimeout(function (){
+                          _this.getAuthClubMessageList();
+                      },500)
+                    }else {
+                      CAIMEI.Alert(res.msg, '确定', false);
+                    }
+                })
+             }
+        },
+        signMessageFn: function(){//标记为已读
+          var _this =this;
+            console.log(_this.checklist);
+            console.log(_this.msgId);
+            if(this.allCount === 0){
+                CAIMEI.dialog('暂无未读消息');
+            }else if(_this.checklist.length==0){
+                CAIMEI.dialog('请勾选未读消息');
+            }else {
+                UserApi.authUpdateRead({userType:1,Id:_this.msgId},function (res) {
+                    if(res.code==0){
+                        CAIMEI.dialog('标记已读成功');
+                        setTimeout(function (){
+                            _this.getAuthClubMessageCount();
+                            _this.getAuthClubMessageList();
+                        },500)
+                    }else {
+                        CAIMEI.Alert(res.msg, '确定', false);
+                    }
+                })
+            }
+        }
+    },
+    mounted: function () {
+        var _self=this;
+        if(globalUserData){
+            this.listQuery.commonId = globalUserData.clubId;
+            this.getAuthClubMessageCount()
+            this.getAuthClubMessageList();
+        }
+        if(!isPC){
+            $('footer').addClass("noneImportant");
+            //移动端上垃加载更多
+            $(window).on('scroll', function(){
+                var scrollTop = $(this).scrollTop();
+                var scrollHeight = $(document).height();
+                var windowHeight = window.innerHeight;
+                if (scrollTop + windowHeight >= scrollHeight) {
+                    //此处是滚动条到底部时候触发的事件,在这里写要加载的数据,或者是拉动滚动条的操作
+                    var totalPage = Math.ceil(_self.listRecord / _self.listQuery.pageSize)?Math.ceil(_self.listRecord / _self.listQuery.pageSize):1;
+                    var next = _self.listQuery.pageNum+1;
+                    if(next <= totalPage){
+                        if (_self.requestFlag){
+                            _self.listQuery.pageNum = next;
+                            // 获取列表数据
+                            _self.getAuthClubMessageList();
+                        }
+                        _self.requestFlag = false;
+                    }else{
+                        //到底了
+                        _self.noMore = true;
+                        $('footer').removeClass("noneImportant");
+                    }
+                }
+            });
+        }
+    }
+});

+ 178 - 160
src/main/resources/static/js/user-center/mixins/noticeMixin.js

@@ -1,160 +1,178 @@
-'use strict';
-var noticeMixin = function () {// 通知消息
-    return {
-        data(){
-            return{}
-        },
-        computed: {
-
-        },
-        mounted() {
-            var _this = this;
-            window.handleOrderClick  = this.handleOrderClick;
-            window.handleUsersClick  = this.handleUsersClick;
-            window.handleCouponClick  = this.handleCouponClick;
-        },
-        methods: {
-            hanldeNoticeText(cell){ // 根据tab计算返回显示文案
-                const $EventFunction = {
-                    1:this.noticeOrderText(cell),
-                    2:this.noticeUsersText(cell),
-                    3:this.noticeServeText(cell),
-                    4:this.noticeCouponText(cell)
-                }
-                return $EventFunction[cell.messageType]
-            },
-            noticeOrderText(cell) { // 交易物流通知文案
-                const linkMap = {
-                        1:`<span data-type="${cell.orderMessageType}" data-orderId="${cell.orderId}" data-status="${cell.status}" data-onlinePayFlag="${cell.onlinePayFlag}" class="link" onclick="handleOrderClick($(this))">立即支付</span>`,
-                        2:`<span data-type="${cell.orderMessageType}" data-orderId="${cell.orderId}" data-status="${cell.status}" data-onlinePayFlag="${cell.onlinePayFlag}" class="link" onclick="handleOrderClick($(this))" >查看订单</span>`,
-                        3:`<span data-type="${cell.orderMessageType}" data-orderId="${cell.orderId}" data-status="${cell.status}" data-onlinePayFlag="${cell.onlinePayFlag}" class="link" onclick="handleOrderClick($(this))">查看订单</span>`,
-                        4:`<span data-type="${cell.orderMessageType}" data-orderId="${cell.orderId}" data-status="${cell.status}" data-onlinePayFlag="${cell.onlinePayFlag}" class="link" onclick="handleOrderClick($(this))">查看订单</span>`,
-                        5:`<span data-type="${cell.orderMessageType}" data-orderId="${cell.orderId}" data-status="${cell.status}" data-onlinePayFlag="${cell.onlinePayFlag}" class="link" onclick="handleOrderClick($(this))">查看物流</span>`,
-                        6:`<span data-type="${cell.orderMessageType}" data-orderId="${cell.orderId}" data-status="${cell.status}" data-onlinePayFlag="${cell.onlinePayFlag}" class="link" onclick="handleOrderClick($(this))">查看订单</span>`
-                }
-                const map = {
-                    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.content},金额到账时间可能存在延迟,具体以支付方通知为准。点击${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.orderMessageType]
-            },
-            noticeUsersText(cell) { // 账户通知文案
-                const linkMap = {
-                    2:`<span data-type="${cell.accountType}" class="link" onclick="handleUsersClick($(this))">会员中心</span>`,
-                    3:`<span data-type="${cell.accountType}" class="link" onclick="handleUsersClick($(this))">会员中心</span>`,
-                    4:`<span data-type="${cell.accountType}" class="link" onclick="handleUsersClick($(this))">会员中心</span>`,
-                    6:`<span data-type="${cell.accountType}" class="link" onclick="handleUsersClick($(this))">修改资料</span>`
-                }
-                const map = {
-                    1: '欢迎成为采美机构用户,祝您开启愉快的采购之旅。',
-                    2: `您已成功购买${cell.content}采美平台超级会员服务,在服务期内每月可领多张大额优惠券,还有更多超级会员专属权益等您体验,点击${linkMap[cell.accountType]}去体验吧。`,
-                    3: `您的超级会员服务将于${cell.content}到期,到期后将无法享受专属会员权益,赶快去${linkMap[cell.accountType]}续费吧 。`,
-                    4: `您已获得采美平台赠送的${cell.content}超级会员,在服务期内每月可领多张大额优惠券,还有更多超级会员专属权益等您体验,点击${linkMap[cell.accountType]}去体验吧。`,
-                    5: '恭喜您成功升级为资质机构用户!现在可以查看更多商品的信息啦,采美平台也将为您提供更多专业服务。',
-                    6: `您的账号升级资质机构失败!点击${linkMap[cell.accountType]}重新提交吧。`,
-                    7: `恭喜您(微信昵称:${cell.content})成功成为机构运营人员,祝您开启愉快的采购之旅。`
-                }
-                return map[cell.accountType]
-            },
-            noticeCouponText(cell) { // 优惠促销通知文案
-                const linkMap = {
-                    1:`<span data-type="${cell.couponMessageType}" class="link" onclick="handleCouponClick($(this))">领券中心</span>`,
-                    2:`<span data-type="${cell.couponMessageType}" class="link" onclick="handleCouponClick($(this))">优惠券中心</span>`,
-                    3:`<span data-type="${cell.couponMessageType}" class="link" onclick="handleCouponClick($(this))">领券中心</span>`,
-                }
-                const copunMap = {
-                    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.couponFee}元优惠券将于${cell.content}过期,赶快去${linkMap[cell.couponMessageType]}查看使用吧。`,
-                    3: `您有${cell.couponFee}元优惠券尚未领取,优惠券将于${cell.content}后下架,赶快去${linkMap[cell.couponMessageType]}领取下单吧0`,
-
-                }
-                return map[cell.couponMessageType]
-            },
-            noticeServeText(cell){//服务通知文案处理
-                if (cell.shopTieredType > 4) {
-                    const map = {
-                        5: '采美平台已为您匹配专属客户经理,为您提供专业咨询服务。',
-                        6: '因公司内部人员调整需要,采美平台已为您更换了新客户经理。',
-                    }
-                    return map[cell.shopTieredType]
-                }
-            },
-            handleOrderClick($event){// 订单点击事件
-                let orderMessageType  = Number($event[0].attributes[0].value);
-                let orderId  = Number($event[0].attributes[1].value);
-                let status  = Number($event[0].attributes[2].value);
-                let onlinePayFlag  = Number($event[0].attributes[3].value);
-                let statusVal = [ { val: [11, 12, 13, 21, 22, 23, 111], status: true }];
-                let isOnliyPay = false;
-                statusVal.forEach(el => {
-                    el.val.forEach(value => {
-                        if (status === value) {
-                            isOnliyPay = el.status
-                        }
-                    })
-                })
-                if(orderMessageType === 1){
-                    if(!isOnliyPay){
-                        CAIMEI.dialog('订单已完成支付',false);
-                    }else{
-                        let payLinkMap = {
-                            0:'/pay/caimei-paylist.html?orderId='+orderId,
-                            1:'/pay/caimei-payunder.html?orderId='+orderId,
-                        }
-                        let linkJumpMap = {
-                            1:payLinkMap[onlinePayFlag]
-                        }
-                        window.open(linkJumpMap[orderMessageType]);
-                    }
-                }else{
-                    let linkJumpMap = {
-                        2:'/user/order/detail.html?orderId='+orderId,
-                        3:'/user/order/detail.html?orderId='+orderId,
-                        4:'/user/order/detail.html?orderId='+orderId,
-                        5:'/user/order/logistics.html?orderId='+orderId,
-                        6:'/user/order/detail.html?orderId='+orderId
-                    }
-                    window.open(linkJumpMap[orderMessageType]);
-                }
-            },
-            handleUsersClick($event){
-                console.log('账户通知跳转');
-                const accountType  = Number($event[0].attributes[0].value);
-                if(accountType === 1 || accountType === 5 || accountType === 7){
-                    return;
-                }
-                const linkJumpMap = {
-                    2:'/user/member.html',
-                    3:'/user/member.html',
-                    4:'/user/member.html',
-                    6:'/user/setting/upgrade.html',
-                }
-                window.open(linkJumpMap[accountType]);
-            },
-            handleServeClick($event){
-                console.log('服务通知跳转');
-            },
-            handleCouponClick($event){
-                console.log('优惠促销通知跳转');
-                const couponMessageType  = Number($event[0].attributes[0].value);
-                const linkJumpMap = {
-                    1:`/user/coupon-collection.html`,
-                    2:`/user/coupon-collection.html`,
-                    3:`/user/coupon.html`,
-                }
-                window.open(linkJumpMap[couponMessageType]);
-            },
-        }
-    };
-}();
+'use strict';
+var noticeMixin = function () {// 通知消息
+    return {
+        data(){
+            return{}
+        },
+        computed: {
+
+        },
+        mounted() {
+            var _this = this;
+            window.handleOrderClick  = this.handleOrderClick;
+            window.handleUsersClick  = this.handleUsersClick;
+            window.handleCouponClick  = this.handleCouponClick;
+        },
+        methods: {
+            hanldeNoticeText(cell){ // 根据tab计算返回显示文案
+                const $EventFunction = {
+                    1:this.noticeOrderText(cell),
+                    2:this.noticeUsersText(cell),
+                    3:this.noticeServeText(cell),
+                    4:this.noticeCouponText(cell),
+                    5: this.noticeArticleText(cell),
+                    6: this.noticeActivityText(cell)
+                }
+                return $EventFunction[cell.messageType]
+            },
+            noticeOrderText(cell) { // 交易物流通知文案
+                const linkMap = {
+                        1:`<span data-type="${cell.orderMessageType}" data-orderId="${cell.orderId}" data-status="${cell.status}" data-onlinePayFlag="${cell.onlinePayFlag}" class="link" onclick="handleOrderClick($(this))">立即支付</span>`,
+                        2:`<span data-type="${cell.orderMessageType}" data-orderId="${cell.orderId}" data-status="${cell.status}" data-onlinePayFlag="${cell.onlinePayFlag}" class="link" onclick="handleOrderClick($(this))" >查看订单</span>`,
+                        3:`<span data-type="${cell.orderMessageType}" data-orderId="${cell.orderId}" data-status="${cell.status}" data-onlinePayFlag="${cell.onlinePayFlag}" class="link" onclick="handleOrderClick($(this))">查看订单</span>`,
+                        4:`<span data-type="${cell.orderMessageType}" data-orderId="${cell.orderId}" data-status="${cell.status}" data-onlinePayFlag="${cell.onlinePayFlag}" class="link" onclick="handleOrderClick($(this))">查看订单</span>`,
+                        5:`<span data-type="${cell.orderMessageType}" data-orderId="${cell.orderId}" data-status="${cell.status}" data-onlinePayFlag="${cell.onlinePayFlag}" class="link" onclick="handleOrderClick($(this))">查看物流</span>`,
+                        6:`<span data-type="${cell.orderMessageType}" data-orderId="${cell.orderId}" data-status="${cell.status}" data-onlinePayFlag="${cell.onlinePayFlag}" class="link" onclick="handleOrderClick($(this))">查看订单</span>`
+                }
+                const map = {
+                    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.content},金额到账时间可能存在延迟,具体以支付方通知为准。点击${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.orderMessageType]
+            },
+            noticeUsersText(cell) { // 账户通知文案
+                const linkMap = {
+                    2:`<span data-type="${cell.accountType}" class="link" onclick="handleUsersClick($(this))">会员中心</span>`,
+                    3:`<span data-type="${cell.accountType}" class="link" onclick="handleUsersClick($(this))">会员中心</span>`,
+                    4:`<span data-type="${cell.accountType}" class="link" onclick="handleUsersClick($(this))">会员中心</span>`,
+                    6:`<span data-type="${cell.accountType}" class="link" onclick="handleUsersClick($(this))">修改资料</span>`
+                }
+                const map = {
+                    1: '欢迎成为采美机构用户,祝您开启愉快的采购之旅。',
+                    2: `您已成功购买${cell.content}采美平台超级会员服务,在服务期内每月可领多张大额优惠券,还有更多超级会员专属权益等您体验,点击${linkMap[cell.accountType]}去体验吧。`,
+                    3: `您的超级会员服务将于${cell.content}到期,到期后将无法享受专属会员权益,赶快去${linkMap[cell.accountType]}续费吧 。`,
+                    4: `您已获得采美平台赠送的${cell.content}超级会员,在服务期内每月可领多张大额优惠券,还有更多超级会员专属权益等您体验,点击${linkMap[cell.accountType]}去体验吧。`,
+                    5: '恭喜您成功升级为资质机构用户!现在可以查看更多商品的信息啦,采美平台也将为您提供更多专业服务。',
+                    6: `您的账号升级资质机构失败!点击${linkMap[cell.accountType]}重新提交吧。`,
+                    7: `恭喜您(微信昵称:${cell.content})成功成为机构运营人员,祝您开启愉快的采购之旅。`
+                }
+                return map[cell.accountType]
+            },
+            noticeCouponText(cell) { // 优惠促销通知文案
+                const linkMap = {
+                    1:`<span data-type="${cell.couponMessageType}" class="link" onclick="handleCouponClick($(this))">领券中心</span>`,
+                    2:`<span data-type="${cell.couponMessageType}" class="link" onclick="handleCouponClick($(this))">优惠券中心</span>`,
+                    3:`<span data-type="${cell.couponMessageType}" class="link" onclick="handleCouponClick($(this))">领券中心</span>`,
+                }
+                const copunMap = {
+                    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.couponFee}元优惠券将于${cell.content}过期,赶快去${linkMap[cell.couponMessageType]}查看使用吧。`,
+                    3: `您有${cell.couponFee}元优惠券尚未领取,优惠券将于${cell.content}后下架,赶快去${linkMap[cell.couponMessageType]}领取下单吧0`,
+
+                }
+                return map[cell.couponMessageType]
+            },
+            noticeServeText(cell){//服务通知文案处理
+                if (cell.shopTieredType > 4) {
+                    const map = {
+                        5: '采美平台已为您匹配专属客户经理,为您提供专业咨询服务。',
+                        6: '因公司内部人员调整需要,采美平台已为您更换了新客户经理。',
+                    }
+                    return map[cell.shopTieredType]
+                }
+            },
+            noticeArticleText(cell) { // 最新文章
+                const link = `<span data-id="${cell.id}" class="link" onclick="handleArticleClick($(this))">点击查看</span>`
+                return `${cell.content}${link}`
+            },
+            noticeActivityText(cell) { // 最新活动
+                const link = `<span data-id="${cell.id}" class="link" onclick="handleActivityClick($(this))">点击查看</span>`
+                return `${cell.content}${link}`
+            },
+            handleOrderClick($event){// 订单点击事件
+                let orderMessageType  = Number($event[0].attributes[0].value);
+                let orderId  = Number($event[0].attributes[1].value);
+                let status  = Number($event[0].attributes[2].value);
+                let onlinePayFlag  = Number($event[0].attributes[3].value);
+                let statusVal = [ { val: [11, 12, 13, 21, 22, 23, 111], status: true }];
+                let isOnliyPay = false;
+                statusVal.forEach(el => {
+                    el.val.forEach(value => {
+                        if (status === value) {
+                            isOnliyPay = el.status
+                        }
+                    })
+                })
+                if(orderMessageType === 1){
+                    if(!isOnliyPay){
+                        CAIMEI.dialog('订单已完成支付',false);
+                    }else{
+                        let payLinkMap = {
+                            0:'/pay/caimei-paylist.html?orderId='+orderId,
+                            1:'/pay/caimei-payunder.html?orderId='+orderId,
+                        }
+                        let linkJumpMap = {
+                            1:payLinkMap[onlinePayFlag]
+                        }
+                        window.open(linkJumpMap[orderMessageType]);
+                    }
+                }else{
+                    let linkJumpMap = {
+                        2:'/user/order/detail.html?orderId='+orderId,
+                        3:'/user/order/detail.html?orderId='+orderId,
+                        4:'/user/order/detail.html?orderId='+orderId,
+                        5:'/user/order/logistics.html?orderId='+orderId,
+                        6:'/user/order/detail.html?orderId='+orderId
+                    }
+                    window.open(linkJumpMap[orderMessageType]);
+                }
+            },
+            handleUsersClick($event){
+                console.log('账户通知跳转');
+                const accountType  = Number($event[0].attributes[0].value);
+                if(accountType === 1 || accountType === 5 || accountType === 7){
+                    return;
+                }
+                const linkJumpMap = {
+                    2:'/user/member.html',
+                    3:'/user/member.html',
+                    4:'/user/member.html',
+                    6:'/user/setting/upgrade.html',
+                }
+                window.open(linkJumpMap[accountType]);
+            },
+            handleServeClick($event){
+                console.log('服务通知跳转');
+            },
+            handleCouponClick($event){
+                console.log('优惠促销通知跳转');
+                const couponMessageType  = Number($event[0].attributes[0].value);
+                const linkJumpMap = {
+                    1:`/user/coupon-collection.html`,
+                    2:`/user/coupon-collection.html`,
+                    3:`/user/coupon.html`,
+                }
+                window.open(linkJumpMap[couponMessageType]);
+            },
+            handleArticleClick($event) {
+                const id  = Number($event[0].attributes[0].value);
+                window.open(``);
+            },
+            handleActivityClick($event) {
+                const id  = Number($event[0].attributes[0].value);
+                window.open(``);
+            }
+        }
+    };
+}();

+ 30 - 0
src/main/resources/templates/ceshi/demo.html

@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html lang="zh-CN" xmlns:th="https://www.thymeleaf.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://www.thymeleaf.org " xmlns="http://www.w3.org/1999/html">
+
+<head>
+    <meta charset="UTF-8" />
+    <meta name="referrer" content="never">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=0" />
+    <meta name="format-detection" content="telephone=yes" />
+    <title>ceshi</title>
+    <link rel="canonical" href="https://www.caimei365.com/" />
+</head>
+
+<body>
+<input type="hidden" th:value="${coreServer}" id="coreServer">
+<input type="hidden" th:value="${agent}" id="userAgent">
+<div id="pdf5">
+    <div id="wordView" v-html="wordText"></div>
+</div>
+
+
+<template th:replace="components/foot-link"></template>
+<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/mammoth@1.4.8/mammoth.browser.min.js"></script>
+<!--<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/pdf-lib@1.17.1/dist/pdf-lib.min.js"></script>-->
+<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js" integrity="sha512-GsLlZN/3F2ErC5ifS5QtgpiJtWd43JWSuIgh7mbzZ8zBps+dvLusV+eNQATqgA/HdeKFVgA5v3S/cIrLF7QnIg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
+<script type="text/javascript" src="https://unpkg.com/browse/pdfjs-dist@2.6.347/build/pdf.worker.min.js"></script>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/ceshi/index.js(v=${version})}"></script>
+</body>
+</html>
+

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

@@ -1,105 +1,106 @@
-<!DOCTYPE html>
-<html lang="zh-CN" xmlns:th="https://www.thymeleaf.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-      xsi:schemaLocation="https://www.thymeleaf.org ">
-<head>
-    <title>采美365网-消息列表</title>
-    <template th:replace="components/head-link"></template>
-    <link th:href="@{/css/base/center.css(v=${version})}" rel="stylesheet" type="text/css">
-    <link th:href="@{/css/user-center/message.css(v=${version})}" rel="stylesheet" type="text/css">
-    <template th:replace="components/analysis"></template>
-</head>
-<body>
-<!-- 引用头部 -->
-<template th:replace="components/header"></template>
-
-<!-- 我的消息 -->
-<div id="dashboard">
-    <div class="navLayout" v-cloak>
-        <div v-if="isPC" class="crumbs">
-            <span>我的采美</span>
-            <span>&gt;</span>
-            <span>我的消息</span>
-        </div>
-        <div class="wrap clear">
-            <!--左侧导航-->
-            <template th:replace="user-center/components/tableft"></template>
-            <div class="right">
-                <div v-if="isRequset" class="loading">
-                    <img src="/img/base/loading.gif">
-                </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.messageType)" :class="mssageTabBarIndex == index ? 'active':''">
-                            <a href="javascript: void(0);">{{item.text}}<span>({{item.bages | NumBadge}})</span></a>
-                        </div>
-                    </div>
-                    <div class="section">
-                        <div class="section-top" v-if="messagesList.length > 0 && isPC">
-                            <div class="cheacked" >
-                            <input type="checkbox" v-model="isCheckedAll" class="check" @click="checkedAllFn">
-                                <span>全选</span>
-                            </div>
-                            <div class="button">
-                                <a href="javascript:void(0);" class="btn" @click="deleteMessageFn">删除</a>
-                                <a href="javascript:void(0);" class="btn" @click="signMessageFn">标为已读</a>
-                            </div>
-                        </div>
-                        <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)" />
-                                    <div class="msg-content" style="display: flex;flex-direction: column;">
-                                        <p v-html="hanldeNoticeText(item)"></p>
-                                        <p v-if="item.shopTieredType > 4">客户经理:{{item.userName}}<span style="margin-left: 100px;">手机号:{{item.mobile}}</span></p>
-                                    </div>
-                                </div>
-                                <div class="time">{{item.time}}</div>
-                            </div>
-                        </div>
-                        <div v-else class="empty">
-                            <img src="/img/common/icon-notice-emptys@2x.png">
-                            <div class="msg"><p>暂无数据</p></div>
-                        </div>
-                    </div>
-                </div>
-                <div class="section-top" v-if="messagesList.length > 0 && !isPC">
-                    <div class="cheacked" >
-                     <input type="checkbox" class="check"  @change="checkedAllFn" v-model="isCheckedAll">
-                        <span>全选</span>
-                    </div>
-                    <div class="button" >
-                         <a href="javascript:void(0);" class="btn Read" @click="signMessageFn">标为已读</a>
-                         <a href="javascript:void(0);" class="btn" @click="deleteMessageFn">删除</a>
-                    </div>
-                 </div>
-                <div v-if="(!isPC) && noMore" class="noMore">---- 没有更多了 ----</div>
-                <div v-if="isPC && pageTotal>1" class="pageWrap clear">
-                    <a v-if="listQuery.pageNum>1" class="prev" @click="toPagination(listQuery.pageNum*1-1)" href="javascript:void(0);"></a>
-                    <template v-for="n in showPageBtn">
-                        <a v-if="n" :class="{'on':(n==listQuery.pageNum)}" @click="toPagination(n)" href="javascript:void(0);" v-text="n"></a>
-                        <span v-else>···</span>
-                    </template>
-                    <a v-if="listQuery.pageNum<pageTotal" class="next" @click="toPagination(listQuery.pageNum*1+1)" href="javascript:void(0);"></a>
-                    <span>共<b v-text="pageTotal>1?pageTotal:1"></b>页</span>
-                    <span>跳至</span>
-                    <input v-model="pageInput" @blur="checkNum()"/>
-                    <span>页</span>&nbsp;
-                    <a class="btn" href="javascript:void(0);" @click="toPagination(pageInput)">点击跳转</a>
-                </div>
-            </div>
-        </div>
-    </div>
-    <!--loading-->
-    <div v-else class="loading">
-        <img src="/img/base/loading.gif">
-    </div>
-</div>
-<!-- 引入底部 -->
-<template th:replace="components/footer"></template>
-<template th:replace="components/foot-link"></template>
-<script charset="utf-8" type="text/javascript" th:src="@{/js/center.js(v=${version})}"></script>
-<script charset="utf-8" type="text/javascript" th:src="@{/js/common/serviceapi/user.service.js(v=${version})}"></script>
-<script charset="utf-8" type="text/javascript" th:src="@{/js/user-center/mixins/noticeMixin.js(v=${version})}"></script>
-<script charset="utf-8" type="text/javascript" th:src="@{/js/user-center/message.js(v=${version})}"></script>
-</body>
-</html>
+<!DOCTYPE html>
+<html lang="zh-CN" xmlns:th="https://www.thymeleaf.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="https://www.thymeleaf.org ">
+<head>
+    <title>采美365网-消息列表</title>
+    <template th:replace="components/head-link"></template>
+    <link th:href="@{/css/base/center.css(v=${version})}" rel="stylesheet" type="text/css">
+    <link th:href="@{/css/user-center/message.css(v=${version})}" rel="stylesheet" type="text/css">
+    <template th:replace="components/analysis"></template>
+</head>
+<body>
+<!-- 引用头部 -->
+<template th:replace="components/header"></template>
+
+<!-- 我的消息 -->
+<div id="dashboard">
+    <div class="navLayout" v-cloak>
+        <div v-if="isPC" class="crumbs">
+            <span>我的采美</span>
+            <span>&gt;</span>
+            <span>我的消息</span>
+        </div>
+        <div class="wrap clear">
+            <!--左侧导航-->
+            <template th:replace="user-center/components/tableft"></template>
+            <div class="right">
+                <div v-if="isRequset" class="loading">
+                    <img src="/img/base/loading.gif">
+                </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.messageType)" :class="mssageTabBarIndex == index ? 'active':''">
+                            <a href="javascript: void(0);">{{item.text}}<span>({{item.bages | NumBadge}})</span></a>
+                        </div>
+                    </div>
+                    <div class="section">
+                        <div class="section-top" v-if="messagesList.length > 0 && isPC">
+                            <div class="cheacked" >
+                            <input type="checkbox" v-model="isCheckedAll" class="check" @click="checkedAllFn">
+                                <span>全选</span>
+                            </div>
+                            <div class="button">
+                                <a href="javascript:void(0);" class="btn" @click="deleteMessageFn">删除</a>
+                                <a href="javascript:void(0);" class="btn" @click="signMessageFn">标为已读</a>
+                            </div>
+                        </div>
+                        <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)" />
+                                    <div class="msg-content">
+                                        <p v-html="hanldeNoticeText(item)"></p>
+                                        <span data-id="${cell.id}" class="link" onclick="handleActivityClick($(this))">点击查看</span>
+                                        <p v-if="item.shopTieredType > 4">客户经理:{{item.userName}}<span class="right-number">手机号:{{item.mobile}}</span></p>
+                                    </div>
+                                </div>
+                                <div class="time">{{item.time}}</div>
+                            </div>
+                        </div>
+                        <div v-else class="empty">
+                            <img src="/img/common/icon-notice-emptys@2x.png">
+                            <div class="msg"><p>暂无数据</p></div>
+                        </div>
+                    </div>
+                </div>
+                <div class="section-top" v-if="messagesList.length > 0 && !isPC">
+                    <div class="cheacked" >
+                     <input type="checkbox" class="check"  @change="checkedAllFn" v-model="isCheckedAll">
+                        <span>全选</span>
+                    </div>
+                    <div class="button" >
+                         <a href="javascript:void(0);" class="btn Read" @click="signMessageFn">标为已读</a>
+                         <a href="javascript:void(0);" class="btn" @click="deleteMessageFn">删除</a>
+                    </div>
+                 </div>
+                <div v-if="(!isPC) && noMore" class="noMore">---- 没有更多了 ----</div>
+                <div v-if="isPC && pageTotal>1" class="pageWrap clear">
+                    <a v-if="listQuery.pageNum>1" class="prev" @click="toPagination(listQuery.pageNum*1-1)" href="javascript:void(0);"></a>
+                    <template v-for="n in showPageBtn">
+                        <a v-if="n" :class="{'on':(n==listQuery.pageNum)}" @click="toPagination(n)" href="javascript:void(0);" v-text="n"></a>
+                        <span v-else>···</span>
+                    </template>
+                    <a v-if="listQuery.pageNum<pageTotal" class="next" @click="toPagination(listQuery.pageNum*1+1)" href="javascript:void(0);"></a>
+                    <span>共<b v-text="pageTotal>1?pageTotal:1"></b>页</span>
+                    <span>跳至</span>
+                    <input v-model="pageInput" @blur="checkNum()"/>
+                    <span>页</span>&nbsp;
+                    <a class="btn" href="javascript:void(0);" @click="toPagination(pageInput)">点击跳转</a>
+                </div>
+            </div>
+        </div>
+    </div>
+    <!--loading-->
+    <div v-else class="loading">
+        <img src="/img/base/loading.gif">
+    </div>
+</div>
+<!-- 引入底部 -->
+<template th:replace="components/footer"></template>
+<template th:replace="components/foot-link"></template>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/center.js(v=${version})}"></script>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/common/serviceapi/user.service.js(v=${version})}"></script>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/user-center/mixins/noticeMixin.js(v=${version})}"></script>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/user-center/message.js(v=${version})}"></script>
+</body>
+</html>