Browse Source

发版提交

朱鑫波 4 years ago
parent
commit
c9287eb9d9

+ 10 - 8
src/utils/request.js

@@ -4,7 +4,7 @@ import store from '@/store'
 import {VueAxios} from './axios'
 import {Modal, notification} from 'ant-design-vue'
 import {ACCESS_TOKEN} from "@/store/mutation-types"
-
+const key = "1"
 // 创建 axios 实例
 
 if (process.env.NODE_ENV == 'development') { 
@@ -13,8 +13,9 @@ if (process.env.NODE_ENV == 'development') {
 else if (process.env.NODE_ENV == 'debug') { 
 } 
 else if (process.env.NODE_ENV == 'production') { 
-    // axios.defaults.baseURL = 'http://192.168.1.251/jeecg-boot';
-axios.defaults.baseURL = 'http://api.tjyourong.com.cn/jeecg-boot';
+  
+  // axios.defaults.baseURL = 'http://192.168.1.251/jeecg-boot';
+  axios.defaults.baseURL = 'http://api.tjyourong.com.cn/jeecg-boot';
 }
 const service = axios.create({
 //   baseURL: '/jeecg-boot', // api base_url
@@ -32,7 +33,7 @@ const err = (error) => {
     // console.log("------异常响应------", error.response.status)
     switch (error.response.status) {
       case 403:
-        notification.error({key:'0',message: '系统提示', description: '拒绝访问', duration: 4})
+        notification.error({key,message: '系统提示', description: '拒绝访问', duration: 4})
         break
       case 500:
         //notification.error({ message: '系统提示', description:'Token失效,请重新登录!',duration: 4})
@@ -57,13 +58,13 @@ const err = (error) => {
         }
         break
       case 404:
-        notification.error({key:'1',message: '系统提示', description: '很抱歉,资源未找到!', duration: 4})
+        notification.error({key,message: '系统提示', description: '很抱歉,资源未找到!', duration: 4})
         break
       case 504:
-        notification.error({key:'2',message: '系统提示', description: '网络超时'})
+        notification.error({key,message: '系统提示', description: '网络超时'})
         break
       case 401:
-        notification.error({key:'3',message: '系统提示', description: '未授权,请重新登录', duration: 4})
+        notification.error({key,message: '系统提示', description: '未授权,请重新登录', duration: 4})
         if (token) {
           store.dispatch('Logout').then(() => {
             setTimeout(() => {
@@ -74,7 +75,7 @@ const err = (error) => {
         break
       default:
         notification.error({
-          key:'4',
+          key,
           message: '系统提示',
           description: data.message,
           duration: 4
@@ -107,6 +108,7 @@ service.interceptors.response.use((response) => {
   return response.data
 }, (error) => {
     notification.error({
+        key,
         message: '系统提示',
         description: '网络超时,请刷新页面'
       })

+ 6 - 1
src/views/modules/BatchCreate/newCreate.vue

@@ -1,3 +1,8 @@
+<style>
+  .display-none-selset{
+    display: none !important;
+  }
+</style>
 <template>
   <div class="newCreate">
     <a-form :form="form">
@@ -273,7 +278,7 @@
                 </div> -->
 
 
-                 <a-select mode="tags" style="width: 100%" placeholder="按空格生成标签" v-model="createTipList" :token-separators="[' ']" >
+                 <a-select mode="tags" style="width: 100%" placeholder="按空格生成标签" v-model="createTipList" :token-separators="[' ']" dropdownClassName="display-none-selset">
                   
                 </a-select>
               </a-form-item>

+ 61 - 16
src/views/modules/kuaishouapp/account/stepForm/Step3.vue

@@ -1,4 +1,7 @@
 <style lang="scss">
+.display-none-selset{
+  display: none!important;
+}
 .chouzhen span {
   display: inline-block;
 }
@@ -222,15 +225,15 @@ li.chouzhen.first:before {
                           </span>
                         </a-form-item>
 
-                        <a-form-item label="" v-if="getData('creativeMaterialType') != '4'">
+                        <a-form-item label="" v-if="getData('creativeMaterialType') != '4' && stickerStyles.length > 0">
                           <a @click="getCoverUrl(index, item, bestIndex)">封面贴纸</a>
                           <br />
-                          <span style="position: relative;display:block;width:25%"  v-if="item.coverUrl">
-                            <img :src="showStickerStyles(item.coverUrl)" style="width:100%"/>
+                          <span style="position: relative; display: block; width: 25%" v-if="item.coverUrl">
+                            <img :src="showStickerStyles(item.coverUrl)" style="width: 100%" />
                             <a-icon
                               type="close-circle"
                               @click="deleteCover(index, bestIndex)"
-                              style="position: absolute; right: -10px;top:-10px"
+                              style="position: absolute; right: -10px; top: -10px"
                             />
                           </span>
                         </a-form-item>
@@ -430,6 +433,28 @@ li.chouzhen.first:before {
             </a-layout>
           </a-form-item>
 
+          <a-form-item label="创意分类" :labelCol="labelCol" :wrapperCol="wrapperCol">
+            <a-cascader
+              :options="createOptions"
+              v-decorator="['creativeCategory', { rules: [{ required: true, message: '创意分类' }] }]"
+              :fieldNames="fieldNames"
+              placeholder="请选择创意分类"
+            />
+          </a-form-item>
+
+          <a-form-item label="创意标签" :labelCol="labelCol" :wrapperCol="wrapperCol">
+            <a-select
+              mode="tags"
+              style="width: 100%"
+              placeholder="按回车生成标签"
+              v-decorator="['creativeTag', { rules: [{ required: true, message: '创意标签必填' }] }]"
+              dropdownClassName="display-none-selset"
+              :token-separators="[',',' ',',']"
+            >
+            </a-select>
+          </a-form-item>
+
+          <!-- @change="createChange" -->
           <a-form-item label="行动号召" :labelCol="labelCol" :wrapperCol="wrapperCol">
             <a-select
               v-decorator="['actionBarText', { rules: [{ required: true, message: '行动号召按钮文案' }] }]"
@@ -822,6 +847,12 @@ export default {
   },
   data() {
     return {
+      fieldNames: {
+        label: 'category_name',
+        value: 'category_id',
+        children: 'child',
+      },
+      createOptions: [],
       stickerVisible: false,
       stickerStyles: [],
       stickerStylesValue: '',
@@ -1461,8 +1492,8 @@ export default {
               }),
               photoId: item.videoList.photoId,
               name: item.name,
-              overlayType:item.coverUrl,
-              stickerTitle:item.coverSlogans
+              overlayType: item.coverUrl,
+              stickerTitle: item.coverSlogans,
             }
           })
 
@@ -1494,13 +1525,14 @@ export default {
                     ],
               photoId: item.photoId,
               creativeMaterialType: item.creativeMaterialType,
-              overlayType:item.overlayType,
-              stickerTitle:item.stickerTitle
+              overlayType: item.overlayType,
+              stickerTitle: item.stickerTitle,
             }
           })
           var params = {
             dataJson: allJson.concat(dataAd),
             ...values,
+            creativeCategory:values.creativeCategory.pop(),
             unitId: this.pansKey,
             accountId: localStorage.getItem('accountId'),
             content: this.content,
@@ -1830,7 +1862,7 @@ export default {
         })
       }
     },
-    deleteCover(index, bestIndex){
+    deleteCover(index, bestIndex) {
       this.pans[index].list[bestIndex].coverUrl = ''
     },
     deleteData(index, bestIndex, deleteIndex, type) {
@@ -2085,6 +2117,16 @@ export default {
           })
         }
       }
+
+      getAction('/kuaishou/batch/getCreativeCategory', {
+        accountId: localStorage.getItem('accountId'),
+      }).then((res) => {
+        if (res.success) {
+          console.log(res)
+          this.createOptions = res.result
+        }
+      })
+
       getAction('/kuaishou/batch/creativeWord', {
         accountId: localStorage.getItem('accountId'),
       }).then((res) => {
@@ -2098,14 +2140,17 @@ export default {
       }).then((res) => {
         this.stickerStyles = []
         if (res.success) {
-          var data = res.result.map((item) => {
-            return item.sticker_styles
-          })
-          data.map((item) => {
-            item.map((i) => {
-              this.stickerStyles.push(i)
+          if (res.result) {
+            var data = res.result.map((item) => {
+              return item.sticker_styles
             })
-          })
+            data.map((item) => {
+              item.map((i) => {
+                this.stickerStyles.push(i)
+              })
+            })
+          }
+
           // console.log(this.stickerStyles)
         } else {
           this.stickerStyles = []

+ 165 - 59
src/views/modules/kuaishouapp/account/stepForm/Step4.vue

@@ -276,6 +276,8 @@ li.chouzhen.first:before {
           <a-form-item label="广告语" :labelCol="labelCol" :wrapperCol="wrapperCol" class="step4-else">
             <a @click="addCaptions('captionsList')" :disabled="captionsList.length >= 3">添加广告语</a>
             ({{ captionsCount + '/3' }})
+            <a style="margin:0 10px" @click="collection('captionsList')" :disabled="captionsCount==0">收藏</a>
+            <a @click="showCunTitle('captionsList')">收藏列表</a>
             <div
               v-for="(item, index) in captionsList"
               style="
@@ -317,17 +319,6 @@ li.chouzhen.first:before {
                 :style="{ display: captionsList.length == 1 ? 'none' : 'block' }"
               />
             </div>
-
-            <!-- <span v-if="description.length>30" style="color:red">广告语长度不能超过30个字符</span>
-            <br />
-            <a @click="cunTitle(index,bestIndex)">收藏</a>
-            <a @click="showCunTitle(index,bestIndex)" style="margin-left:10px">收藏列表</a>
-            <br />
-            <a-tag
-              v-for="(itemTag,indexTag) of tags"
-              :key="indexTag"
-              @click="getChange(item, itemTag, index)"
-            >{{itemTag.name}}</a-tag>-->
           </a-form-item>
 <!-- stickerStyles -->
 <!-- coverSlogansList -->
@@ -343,6 +334,8 @@ li.chouzhen.first:before {
           <a-form-item label="封面广告语" :labelCol="labelCol" :wrapperCol="wrapperCol" class="step4-else" v-if="stickerStyles.length>0">
             <a @click="addCaptions('coverSlogansList')" :disabled="coverCount >= 6">添加封面广告语</a>
             ({{ coverCount + '/6' }})
+            <a style="margin:0 10px" @click="collection('coverSlogansList')" :disabled="coverCount==0">收藏</a>
+            <a @click="showCunTitle('coverSlogansList')">收藏列表</a>
             <div
               v-for="(item, index) in coverSlogansList"
               style="
@@ -384,6 +377,28 @@ li.chouzhen.first:before {
               />
             </div>
           </a-form-item>
+
+          <a-form-item label="创意分类" :labelCol="labelCol" :wrapperCol="wrapperCol">
+            <a-cascader
+              :options="createOptions"
+              v-decorator="['creativeCategory', { rules: [{ required: true, message: '创意分类' }] }]"
+              :fieldNames="fieldNames"
+              placeholder="请选择创意分类"
+            />
+          </a-form-item>
+
+          <a-form-item label="创意标签" :labelCol="labelCol" :wrapperCol="wrapperCol">
+            <a-select
+              mode="tags"
+              style="width: 100%"
+              placeholder="按回车生成标签"
+              v-decorator="['creativeTag', { rules: [{ required: true, message: '创意标签必填' }] }]"
+              dropdownClassName="display-none-selset"
+              :token-separators="[',',' ',',']"
+            >
+            </a-select>
+          </a-form-item>
+
           <a-form-item label="行动号召" :labelCol="labelCol" :wrapperCol="wrapperCol">
             <a-select
               v-decorator="['actionBarText', { rules: [{ required: true, message: '行动号召按钮文案' }] }]"
@@ -442,21 +457,6 @@ li.chouzhen.first:before {
     <a-modal :maskClosable="false" v-model="visible" title="广告创意创建情况">
       <div style="font-size: 24px">
         {{ allForm.success }}
-        <!-- 创建成功:{{ allForm.success.length }}条
-        <div style="margin-top: 20px">
-          <p v-for="(item, index) of allForm.success" :key="index">
-            <span>名称:{{ item.creativeName }}</span>
-          </p>
-        </div>
-        <br />
-        创建失败:{{ allForm.fail.length }}条
-        <div style="margin-top: 20px">
-          <p v-for="(item, index) of allForm.fail" :key="index">
-            <span>名称:{{ item.creativeName }}</span>
-            <br />
-            <span>错误信息:{{ item.failMessage }}</span>
-          </p>
-        </div> -->
       </div>
       <div v-if="allForm.fail">失败原因:{{ allForm.fail }}</div>
       <template slot="footer">
@@ -672,20 +672,26 @@ li.chouzhen.first:before {
         </a-col>
       </a-row>
     </a-modal>
-    <a-modal title="收藏标题" v-model="cunTitleVisible" :width="1000" :footer="null">
+    <a-modal title="收藏标题" v-model="cunTitleVisible"  :width="1000"  @ok="okTitleCun">
       <a-row :gutter="10">
         <a-col :sm="24" style="margin-bottom: 20px; z-index: 10">
           <a-card class="search-box" style="over-flow: auto">
-            <a-list size="large" bordered :dataSource="cunTitleList">
-              <a-list-item slot="renderItem" slot-scope="item">
-                <div slot="actions">
-                  <a @click="okTitleCun(item)">选择</a>
-                  <a-divider type="vertical" />
-                  <a @click="removeTitleCun(item)">删除</a>
-                </div>
-                {{ item.title }}
-              </a-list-item>
-            </a-list>
+            <a-checkbox-group v-model="guanggao" style="width:100%">
+              <a-list size="large" bordered :dataSource="cunTitleList">
+                <a-list-item slot="renderItem" slot-scope="item">
+                  
+                  <div slot="actions">
+                    <!-- <a @click="okTitleCun(item)">选择</a>
+                    <a-divider type="vertical" /> -->
+                    <a @click="removeTitleCun(item)">删除</a>
+                  </div>
+                  <a-checkbox :value="item">
+                  {{ item.captions?item.captions:item.coverSlogans }}
+                  </a-checkbox>
+                </a-list-item>
+
+              </a-list>
+            </a-checkbox-group>
           </a-card>
         </a-col>
       </a-row>
@@ -770,6 +776,13 @@ export default {
   },
   data() {
     return {
+      fieldNames: {
+        label: 'category_name',
+        value: 'category_id',
+        children: 'child',
+      },
+      createOptions: [],
+      guanggao: [],
       stickerStylesValue: [],
       coverSlogansList: [{ coverSlogans: '' }],
       stickerStyles: [],
@@ -912,13 +925,31 @@ export default {
     }
   },
   methods: {
-    addCaptions(type) { 
+    addCaptions(type) {
       if (type == 'captionsList') {
         this.captionsList.push({ captions: '' })
       } else {
         this.coverSlogansList.push({ coverSlogans: '' })
       }
     },
+    collection(type) {
+      var params = {}
+      params.userId = this.userInfo().id
+      params.accountId = localStorage.getItem('accountId')
+      if (type == 'captionsList') {
+        // this.captionsList.push({ captions: '' })
+        params.captionsList = this.captionsList
+      } else {
+        // this.coverSlogansList.push({ coverSlogans: '' })
+        params.coverSlogansList = this.coverSlogansList
+      }
+      postAction('/kuaishou/collectionSlogans/add', params).then((res) => {
+        console.log(res)
+        if (res.success) {
+          this.$message.success('收藏成功')
+        }
+      })
+    },
     deleteCaptions(index, type) {
       if (type == 'captionsList') {
         this.captionsList.splice(index, 1)
@@ -1050,38 +1081,91 @@ export default {
         })
       }
     },
-    showCunTitle(index, bestIndex) {
-      nowIndex = index
-      bestIndex = bestIndex
+    showCunTitle(type) {
       this.cunTitleVisible = true
-      this.getCunTitle()
+      this.getCunTitle(type)
     },
-    getCunTitle() {
+    getCunTitle(typeAdd) {
       var params = {}
       params.accountId = localStorage.getItem('accountId')
       params.userId = this.userInfo().id
-      params.pageNo = 1
-      params.pageSize = 500
-      getAction('/kuaishou/kuaiShouTitleCollection/list', params).then((res) => {
+      params.type = typeAdd == 'captionsList' ? 2 : 1
+      // params.pageNo = 1
+      // params.pageSize = 500
+      // /kuaishou/collectionSlogans/getByUserId?userId=12312312321&accountId=12&type=1
+      getAction('/kuaishou/collectionSlogans/getByUserId', params).then((res) => {
         if (res.success) {
           console.log(res.result)
-          this.cunTitleList = res.result.records
+          this.cunTitleList = res.result.value
         }
       })
     },
     removeTitleCun(item) {
-      deleteAction('/kuaishou/kuaiShouTitleCollection/delete', {
-        id: item.id,
-      }).then((res) => {
+      console.log(item)
+      var typeAdd = null
+      if (item.captions) {
+        var index = this.cunTitleList.findIndex((v) => v.captions === item.captions)
+        this.cunTitleList.splice(index, 1)
+        var params = {}
+        params.userId = this.userInfo().id
+        params.accountId = localStorage.getItem('accountId')
+
+        params.captionsList = this.cunTitleList
+        params.type = 'delete'
+        typeAdd = 'captionsList'
+      } else {
+        var index = this.cunTitleList.findIndex((v) => v.coverSlogans === item.coverSlogans)
+        this.cunTitleList.splice(index, 1)
+        var params = {}
+        params.userId = this.userInfo().id
+        params.accountId = localStorage.getItem('accountId')
+
+        params.coverSlogansList = this.cunTitleList
+        params.type = 'delete'
+        typeAdd = 'coverSlogansList'
+      }
+      // var index = this.cunTitleList.findIndex((v) => v.captions === item.captions)
+      // this.cunTitleList.splice(index, 1)
+      // var params = {}
+      // params.userId = this.userInfo().id
+      // params.accountId = localStorage.getItem('accountId')
+
+      // params.captionsList = this.cunTitleList
+      // params.type = 'delete'
+      postAction('/kuaishou/collectionSlogans/add', params).then((res) => {
+        console.log(res)
         if (res.success) {
-          this.getCunTitle()
+          this.$message.success('删除成功')
+          this.getCunTitle(typeAdd)
         }
       })
+      // deleteAction('/kuaishou/kuaiShouTitleCollection/delete', {
+      //   id: item.id,
+      // }).then((res) => {
+      //   if (res.success) {
+      //     this.getCunTitle()
+      //   }
+      // })
     },
     okTitleCun(item) {
-      this.pans[bestIndex].list[nowIndex].description = item.title
+      if (this.guanggao.length > 0) {
+        if (this.guanggao[0].captions) {
+          if(this.guanggao.length>3){
+            this.$message.error('广告语最多选择3条')
+            return
+          }
+          this.captionsList = []
+          this.captionsList.push(...this.guanggao)
+        } else {
+           if(this.guanggao.length>6){
+            this.$message.error('封面广告语最多选择6条')
+            return
+          }
+          this.coverSlogansList = []
+          this.coverSlogansList.push(...this.guanggao)
+        }
+      }
       this.cunTitleVisible = false
-      this.cunTitleList = []
     },
     searchQuery() {
       // /ctop/creativeTitle/titleSuggestion
@@ -1430,6 +1514,7 @@ export default {
           var params = {
             // dataJson: allJson,
             ...values,
+            creativeCategory:values.creativeCategory.pop(),
             unitId: this.pansKey,
             accountId: localStorage.getItem('accountId'),
             content: this.content,
@@ -1993,6 +2078,12 @@ export default {
     },
   },
   watch: {
+    cunTitleVisible(n,o){
+      if(!n){
+        this.guanggao = []
+        this.cunTitleList = []
+      }
+    },
     time(n, o) {
       console.log(n)
       if (n.length > 0) {
@@ -2089,16 +2180,31 @@ export default {
           this.tags = res.result
         }
       })
+
+
+      getAction('/kuaishou/batch/getCreativeCategory', {
+        accountId: localStorage.getItem('accountId'),
+      }).then((res) => {
+        if (res.success) {
+          console.log(res)
+          this.createOptions = res.result
+        }
+      })
+
       getAction('/kuaishou/batch/getCreativeWordStyles', {
         accountId: localStorage.getItem('accountId'),
       }).then((res) => {
         if (res.success) {
-          this.stickerStyles = res.result.map((item) => {
-            return {
-              id: item.sticker_style_id,
-              url: item.sticker_styles[0],
-            }
-          })
+          if (res.result) {
+            this.stickerStyles = res.result.map((item) => {
+              return {
+                id: item.sticker_style_id,
+                url: item.sticker_styles[0],
+              }
+            })
+          } else {
+            this.stickerStyles = []
+          }
         } else {
           this.stickerStyles = []
         }

+ 2 - 2
src/views/modules/material/supplierMaterial.vue

@@ -549,7 +549,7 @@
   } from 'vuex'
   import moment from 'moment'
 
-  import selectTable from '@/views/modules/Statistics/components/selecTable.vue'
+  import selectTable from '@/views/modules/Statistics/components/selectPagination.vue'
 
   import BMF from 'browser-md5-file'
   import uploadFile from '@/components/uploadFile.vue'
@@ -559,7 +559,7 @@
   } from '@/utils/videoControl'
   import accountCheck from './accountCheck'
   export default {
-    name: 'YardList',
+    name: 'supplier-material',
     mixins: [JeecgListMixin],
     components: {
       JEllipsis,

+ 18 - 10
src/views/user/Login.vue

@@ -373,18 +373,26 @@
         })
       },
       cmsFailed(err) {
-        this.$notification['error']({
-          message: '登录失败',
-          description: err,
-          duration: 4
-        })
+        setTimeout(() => {
+          this.$notification['error']({
+            key:"1",
+            message: '登录失败',
+            description: err,
+            duration: 4
+          })
+        }, 2000);
+       
       },
       requestFailed(err) {
-        this.$notification['error']({
-          message: '登录失败',
-          description: ((err.response || {}).data || {}).message || err.message || '请求出现错误,请稍后再试',
-          duration: 4
-        })
+        setTimeout(() => {
+          this.$notification['error']({
+            key:"1",
+            message: '登录失败',
+            description: ((err.response || {}).data || {}).message || err.message || '请求出现错误,请稍后再试',
+            duration: 4
+          })
+        }, 2000);
+        
         this.loginBtn = false
       },
       validateMobile(rule, value, callback) {