Bläddra i källkod

Merge branch 'developerB' into developer

xiebaomin 2 år sedan
förälder
incheckning
674fd210ba

+ 8 - 7
src/main/resources/static/css/activity/attestation-new.css

@@ -87,10 +87,10 @@ li{list-style:none}
         height: 48px;
         background-color: rgb(255, 255, 255);
         border-radius: 2px;
-        color: #FF5B00;
+        color: rgb(178, 178, 178);
         top: 450px;
         left: 250px;
-        border: 1px solid #FF5B00;
+        border: 1px solid #ccc;
         text-align: center;
         line-height: 48px;
         font-size: 17px;
@@ -165,13 +165,13 @@ li{list-style:none}
         background: linear-gradient(-90deg, #FFBA63, #F3920D);
     }
     .section_main.four .section_content .section_li .back .bg2{
-        background: linear-gradient(-90deg, #FFBA63, #F3920D);
+        background: linear-gradient(-90deg, #3bb5d2, #0160aa);
     }
     .section_main.four .section_content .section_li .back .bg3{
-        background: linear-gradient(-90deg, #FFBA63, #F3920D);
+        background: linear-gradient(-90deg, #1b3250, #0b1529);
     }
-    .section_main.four .section_content .section_li .back .bg4{background: linear-gradient(-90deg, #FFBA63, #F3920D);}
-    .section_main.four .section_content .section_li .back .bg5{background: linear-gradient(-90deg, #FFBA63, #F3920D);}
+    .section_main.four .section_content .section_li .back .bg4{background: linear-gradient(-90deg, #77b2d0, #4496c3);}
+    .section_main.four .section_content .section_li .back .bg5{background: linear-gradient(-90deg, #8395b3, #cddbef);}
 
     .section_main.four .section_content .section_li:hover .front{-webkit-transform: rotateY(180deg);transform: rotateY(180deg);}
     .section_main.four .section_content .section_li:hover .back{-webkit-transform: rotateY(0deg);transform: rotateY(0deg);}
@@ -361,7 +361,8 @@ li{list-style:none}
     .section_main.four .el-carousel__item .authlistH5{
         width: 48%;
         height: 48%;
-        border: 1px solid #ccc;
+        box-shadow: 0px 6px 28px 0px rgba(51,51,51,0.1);
+        margin: 1%;
         overflow: hidden;
         display: flex;
         justify-content: space-around;

+ 7 - 1
src/main/resources/static/js/activity/attestation-new.js

@@ -113,7 +113,9 @@ new Vue({
         startY: '',
         moveY: '',
         moveX: '',
-        startTime: ''
+        startTime: '',
+        isActivePageLeft: false,
+        isActivePageRight: true
     },
     mounted() {
         this.initPageList = this.firstEntryList.map((item, index) => {
@@ -138,6 +140,8 @@ new Vue({
     },
     methods: {
         changePageNoLeft() {
+            this.isActivePageRight = false
+            this.isActivePageLeft = true
             this.$refs.pcSwiper.prev()
             // console.log(bool)
             // if (bool) {
@@ -151,6 +155,8 @@ new Vue({
             // }
         },
         changePageNoRight() {
+            this.isActivePageRight = true
+            this.isActivePageLeft = false
             this.$refs.pcSwiper.next()
             // if (bool) {
             //     if (this.initPageList[3].id === 4 && this.isAuthActiveNum === 3) {

+ 0 - 2
src/main/resources/static/js/article/detail.js

@@ -47,7 +47,6 @@ var articleRelated = new Vue({
         this.infoId = this.handlearticleId = $("#articleId").val() ? $("#articleId").val()*1 : 0;
         this.articleLabels = $("#articleLabels").val()?$("#articleLabels").val():"";
         this.relatedLabels = $("#relatedLabels").val()?$("#relatedLabels").val():"";
-        console.log('relatedLabels',this.relatedLabels)
         if(this.relatedLabels){
             this.cmSysParams.pageLabel =  this.relatedLabels
         }else{
@@ -56,7 +55,6 @@ var articleRelated = new Vue({
             })
             this.cmSysParams.pageLabel =  pageLabelArray.join('/');
         }
-        console.log('pageLabel', this.cmSysParams.pageLabel)
         // 获取相关阅读
         // this.getRelatedList();
     },

+ 53 - 1
src/main/resources/static/js/supplier-center/article/article-edit.js

@@ -162,7 +162,7 @@ var articleEdit = new Vue({
                     clearTimeout(this.validTime)
                     this.validTime = setTimeout(() => {
                         if (this.validTime) {
-                            this.handleSave()
+                            this.handleSave_new()
                         }
                         clearTimeout(this.validTime)
                         this.validTime = null
@@ -256,6 +256,16 @@ var articleEdit = new Vue({
             });
         },
 
+        handleSave_new() {
+            let _this = this;
+            this.$refs.ruleForm.validate(valide=>{
+                if(!valide) return;
+                // _this.save();
+                const params = {..._this.formData, labelIds: (_this.formData.labelIds && _this.formData.labelIds.length > 0) ? _this.formData.labelIds.join(',') : ''}
+                _this.sensitiveWordsValidate_new(params)
+            });
+        },
+
         // 采美文章预览
         handlePreview() {
             if (window.localStorage.getItem('articelData')) {
@@ -328,6 +338,48 @@ var articleEdit = new Vue({
             })
         },
 
+        sensitiveWordsValidate_new(params) {
+            const whiteList = [];
+            const self = this;
+            SupplierApi.ShopBaikeProductWordsValidate({ checkPoint: 1 }, function(res){
+                let flag = true
+                for (const key in params) {
+                    if (!whiteList.includes(key)) {
+                        const target = JSON.stringify(params[key])
+                        const bool = new RegExp(res.data, 'g').test(target)
+                        if (bool) {
+                            const value = self.matchWords(target, res.data)
+                            self.formValidate[key] = value
+                            flag = false
+                        } else {
+                            self.formValidate[key] = ''
+                        }
+                    }
+                }
+                if(flag) return self.onReallySave_new(params)
+                const tip = '当前发布内容存在敏感词,已为您标记在输入框下方,请修改后,再进行保存发布,强行保存发布将会导致审核不通过!'
+                self.$confirm(tip, '提示', { confirmButtonText: '保存', cancelButtonText: '取消' }).then(function(){
+                    self.onReallySave_new(params)
+                }).catch(function(){
+                    console.log('修改敏感词')
+                    self.socrllToErrorWord() // 滚动到提示处
+                })
+            })
+        },
+
+        onReallySave_new(params) {
+            let _this = this;
+            this.formData.shopId = this.shopId;
+            SupplierApi.ArticleSubmitSave(this.formData, function (res) {
+                if (res.code === 0) {
+                    CAIMEI.dialog('自动保存成功');
+                    _this.onFocused()
+                } else {
+                    CAIMEI.Alert(res.msg, '确定', false);
+                }
+            });
+        },
+
         // 保存接口
         onReallySave: function onReallySave() {
             var _this = this;

+ 89 - 8
src/main/resources/static/js/supplier-center/encyclopedia/edit.js

@@ -285,19 +285,19 @@ const edit = new Vue({
         },
     },
     methods: {
-        onFocused() {
+        onFocused(val = 300) {
             setTimeout(() => {
                 this.validTime = null
                 console.log(111)
                 clearTimeout(this.validTime)
-            }, 300)
+            }, val)
         },
-        onBlured() {
+        onBlured(val = 200) {
             setTimeout(() => {
                 this.isFocus = true
                 this.validFormRule()
                 console.log(222)
-            }, 200)
+            }, val)
         },
         // 自动保存校验
         validFormRule() {
@@ -307,7 +307,7 @@ const edit = new Vue({
                     clearTimeout(this.validTime)
                     this.validTime = setTimeout(() => {
                         if (this.validTime) {
-                            this.handleConfirm()
+                            this.handleConfirm_new()
                         }
                         clearTimeout(this.validTime)
                         this.validTime = null
@@ -321,6 +321,13 @@ const edit = new Vue({
         handlerTypeId() {
             this.onBlured()
         },
+        changeVisible($event) {
+            if ($event) {
+                this.onFocused()
+            } else {
+                this.onBlured()
+            }
+        },
         // 获取表单数据
         fetchEntryData(){
             const self = this
@@ -405,6 +412,40 @@ const edit = new Vue({
                 this.socrllToErrorWord()
             }
         },
+        // 提交表单
+        async handleConfirm_new() {
+            try {
+                if(this.showAgreement){
+                    CAIMEI.dialog('请先阅读编辑须知协议', false);
+                    return
+                }
+                this.formData.shopId = GLOBAL_SHOP_ID
+                this.formData.imageList = this.filterImageList(this.fileList)
+                this.formData.videoList = this.filterVideoList(this.fileList)
+                await this.$refs.ruleForm.validate()
+                const params = {
+                    shopId: this.formData.shopId,
+                    id: this.formData.id, // 词条id
+                    name: this.formData.name, // 词条名称
+                    alias: this.formData.alias, // 义项名
+                    discription: this.formData.discription, // 词条概述
+                    image: this.formData.image, // 头图地址
+                    typeId: this.formData.typeId, // 分类id
+                    seoKeyword: this.formData.seoKeyword, // seo关键字
+                    status: this.formData.status, // 状态0保存草稿箱  1已发布
+                    infoListStr: JSON.stringify(this.formData.infoList), //  信息栏集合
+                    referenceListStr:JSON.stringify(this.formData.referenceList), // 参考资料集合
+                    textInfoListStr: JSON.stringify(this.formData.textInfoList),
+                    imageListStr: JSON.stringify(this.formData.imageList), // 概述图册集合
+                    videoListStr:JSON.stringify(this.formData.videoList), // 视频集合
+                    labelIds: this.formData.labelIds ? this.formData.labelIds.join(',') : '' // 关联标签库列表
+                };
+                this.sensitiveWordsValidate_new(params)
+            } catch (e) {
+                console.log(e)
+                this.socrllToErrorWord()
+            }
+        },
         /// 确定提交
         onReallySave(params) {
             const self = this
@@ -559,7 +600,8 @@ const edit = new Vue({
         // 删除信息栏
         handleInfoRemove(index) {
             this.formData.infoList.splice(index, 1)
-            this.onFocused()
+            this.onFocused(0)
+            this.onBlured(0)
         },
         // 正文目录数据
         genereateTextInfo(type, index) {
@@ -585,7 +627,8 @@ const edit = new Vue({
         // 删除正文目录
         handleRemoveTextInfo(index, type) {
             this.formData.textInfoList.splice(index, 1)
-            this.onFocused()
+            this.onFocused(0)
+            this.onBlured(0)
         },
         // 文件上传成功
         handleUploadSuccess(fileList) {
@@ -595,6 +638,8 @@ const edit = new Vue({
         // 文件移除
         handleFileRemove(file) {
             this.fileList = this.fileList.filter(item => item.uuid !== file.uuid);
+            this.onFocused()
+            this.onBlured()
         },
         // 封面上传成功
         handleCoverUploadSuccess(fileList) {
@@ -606,6 +651,8 @@ const edit = new Vue({
         handleCoverRemove(file) {
             this.formData.image = ''
             this.coverList = this.coverList.filter(item => item.uuid !== file.uuid);
+            this.onFocused()
+            this.onBlured()
         },
         // 资料图片上传
         handleReferenceImageUploadSuccess(fileList){
@@ -650,7 +697,41 @@ const edit = new Vue({
                 })
             })
         },
-
+        // 敏感词校验
+        sensitiveWordsValidate_new(params) {
+            const whiteList = [];
+            const self = this;
+            SupplierApi.ShopBaikeProductWordsValidate({checkPoint: 2}, function (res) {
+                let flag = true
+                for (const key in params) {
+                    if (!whiteList.includes(key)) {
+                        const target = JSON.stringify(params[key])
+                        const bool = new RegExp(res.data, 'g').test(target)
+                        if (bool) {
+                            const value = self.matchWords(target, res.data)
+                            self.$set(self.formValidate, key, value)
+                            flag = false
+                        } else {
+                            self.$set(self.formValidate, key, '')
+                        }
+                    }
+                }
+                if (flag) return self.onReallySave_new(params)
+                console.log(self.formValidate)
+                const tip = '当前发布内容存在敏感词,已为您标记在输入框下方,请修改后,再进行保存发布,强行保存发布将会导致审核不通过!'
+                self.$confirm(tip, '提示', {confirmButtonText: '保存', cancelButtonText: '取消'}).then(function () {
+                    self.onReallySave_new(params)
+                }).catch(function () {
+                    self.socrllToErrorWord() // 滚动到提示处
+                })
+            })
+        },
+        onReallySave_new(params) {
+            shopBikeApi.SaveEntrySumbit(params, (res) => {
+                CAIMEI.dialog('自动保存成功', false);
+                this.onFocused()
+            })
+        },
         // 匹配敏感词
         matchWords(word, validate) {
             const list = []

+ 15 - 15
src/main/resources/templates/activity/attestation-new.html

@@ -26,8 +26,8 @@
         <div class="section_main four">
 <!--            <div class="pageNoChangeLeft isActivePage" @click="changePageNoLeft( firstEntryList[0].id!== 1 || isAuthActiveNum !== 0)" v-if="isPC"><</div>-->
 <!--            <div class="pageNoChangeRight isActivePage" @click="changePageNoRight(firstEntryList[0].id === 1)" v-if="isPC">></div>-->
-            <div class="pageNoChangeLeft isActivePage" @click="changePageNoLeft" v-if="isPC"><</div>
-            <div class="pageNoChangeRight isActivePage" @click="changePageNoRight" v-if="isPC">></div>
+            <div class="pageNoChangeLeft" :class="isActivePageLeft ? 'isActivePage' : ''" @click="changePageNoLeft" v-if="isPC"><</div>
+            <div class="pageNoChangeRight" :class="isActivePageRight ? 'isActivePage' : ''" @click="changePageNoRight" v-if="isPC">></div>
             <div class="inner">
                 <div class="title">
                     <h1>正品查询快捷入口</h1>
@@ -51,34 +51,34 @@
                     <el-carousel indicator-position="outside" height="500px" ref="pcSwiper" :autoplay="false">
                         <el-carousel-item>
                             <div class="section_li li1" v-for="(item, index) in firstEntryList" :key="index" v-if="index<4" @click="changePageNoLink(index, item)">
-                                <div class="box front" :class="isAuthActiveNum === index ? 'isAuthActive' : ''">
+                                <div class="box front">
                                     <img :src="item.logo" alt="" class="icon">
-                                    <h1 :class="isAuthActiveNum === index ? 'isAuthH1' : ''">{{ item.name }}</h1>
-                                    <p><el-button :plain="true" :class="isAuthActiveNum === index ? 'isAuthBtn' : ''" @click="changePageNoLink(index, item)">立即查看</el-button></p>
+                                    <h1>{{ item.name }}</h1>
+                                    <p><el-button :plain="true" @click="changePageNoLink(index, item)">立即查看</el-button></p>
                                 </div>
                                 <div class="box back">
                                     <div :class="item.className"></div>
                                     <div class="content-box">
                                         <img :src="item.logo" alt="" class="icon">
                                         <h1>{{ item.name }}</h1>
-                                        <p><el-button @click="changePageNoLink(index, item)" :plain="true" style="background: linear-gradient(-90deg, #FFBA63, #F3920D);border: 1px solid #fff;color: #fff;">立即查看</el-button></p>
+                                        <p><el-button @click="changePageNoLink(index, item)" :plain="true" style="border: 1px solid #fff;">立即查看</el-button></p>
                                     </div>
                                 </div>
                             </div>
                         </el-carousel-item>
                         <el-carousel-item>
                             <div class="section_li li1" v-for="(item, index) in firstEntryList" :key="index" v-if="index>3" @click="changePageNoLink(index, item)">
-                                <div class="box front" :class="isAuthActiveNum === index ? 'isAuthActive' : ''">
+                                <div class="box front">
                                     <img :src="item.logo" alt="" class="icon">
                                     <h1 :class="isAuthActiveNum === index ? 'isAuthH1' : ''">{{ item.name }}</h1>
-                                    <p><el-button :plain="true" :class="isAuthActiveNum === index ? 'isAuthBtn' : ''" @click="changePageNoLink(index, item)">立即查看</el-button></p>
+                                    <p><el-button :plain="true" @click="changePageNoLink(index, item)">立即查看</el-button></p>
                                 </div>
                                 <div class="box back">
                                     <div :class="item.className"></div>
                                     <div class="content-box">
                                         <img :src="item.logo" alt="" class="icon">
                                         <h1>{{ item.name }}</h1>
-                                        <p><el-button @click="changePageNoLink(index, item)" :plain="true" style="background: linear-gradient(-90deg, #FFBA63, #F3920D);border: 1px solid #fff;color: #fff;">立即查看</el-button></p>
+                                        <p><el-button @click="changePageNoLink(index, item)" :plain="true">立即查看</el-button></p>
                                     </div>
                                 </div>
                             </div>
@@ -95,24 +95,24 @@
                         <el-carousel indicator-position="outside" ref="nop" height="600px" :autoplay="false">
                             <div @touchmove="move($event)" @touchstart="start($event)">
                                 <el-carousel-item>
-                                    <div v-for="(item, index) in firstEntryList" :key="item.id" v-if="index < 4" class="authlistH5" :class="isAuthActiveNum === index ? 'isAuthActive' : ''" @click="changePageNoLink(index, item)">
+                                    <div v-for="(item, index) in firstEntryList" :key="item.id" v-if="index < 4" class="authlistH5" @click="changePageNoLink(index, item)">
                                         <div>
                                             <img :src="item.logo" alt="" class="icon">
                                         </div>
-                                        <div :class="isAuthActiveNum === index ? 'isAuthtext' : ''">{{item.name}}</div>
+                                        <div>{{item.name}}</div>
                                         <div>
-                                            <el-button @click="changePageNoLink(index, item)" :class="isAuthActiveNum === index ? 'isAuthBtn' : ''">立即查看</el-button>
+                                            <el-button @click="changePageNoLink(index, item)">立即查看</el-button>
                                         </div>
                                     </div>
                                 </el-carousel-item>
                                 <el-carousel-item>
-                                    <div v-for="(item, index) in firstEntryList" :key="item.id" v-if="index > 3" class="authlistH5" :class="isAuthActiveNum === index ? 'isAuthActive' : ''" @click="changePageNoLink(index, item)">
+                                    <div v-for="(item, index) in firstEntryList" :key="item.id" v-if="index > 3" class="authlistH5" @click="changePageNoLink(index, item)">
                                         <div>
                                             <img :src="item.logo" alt="" class="icon">
                                         </div>
-                                        <div :class="isAuthActiveNum === index ? 'isAuthtext' : ''">{{item.name}}</div>
+                                        <div>{{item.name}}</div>
                                         <div>
-                                            <el-button @click="changePageNoLink(index, item)" :class="isAuthActiveNum === index ? 'isAuthBtn' : ''">立即查看</el-button>
+                                            <el-button @click="changePageNoLink(index, item)">立即查看</el-button>
                                         </div>
                                     </div>
                                 </el-carousel-item>

+ 1 - 2
src/main/resources/templates/supplier-center/encyclopedia/edit.html

@@ -149,8 +149,7 @@
                                     reserve-keyword
                                     :remote-method="fetchQueryKeywordList"
                                     :loading="remoteLoading"
-                                    @click.native="handlerDiscrip"
-                                    @change="handlerTypeId"
+                                    @visible-change="changeVisible"
                             >
                                 <el-option v-for="item in labelList" :key="item.id" :label="item.keyword" :value="item.id"></el-option>
                             </el-select>