Bladeren bron

修改快手

yumeng 5 jaren geleden
bovenliggende
commit
5f23394b26
2 gewijzigde bestanden met toevoegingen van 28 en 22 verwijderingen
  1. 1 1
      src/utils/request.js
  2. 27 21
      src/views/modules/kuaishouapp/creativeCreate.vue

+ 1 - 1
src/utils/request.js

@@ -8,7 +8,7 @@ import {ACCESS_TOKEN} from "@/store/mutation-types"
 // 创建 axios 实例
 const service = axios.create({
   baseURL: '/jeecg-boot', // api base_url
-  timeout: 600000 // 请求超时时间
+  timeout: 6000000 // 请求超时时间
 })
 
 const err = (error) => {

+ 27 - 21
src/views/modules/kuaishouapp/creativeCreate.vue

@@ -17,7 +17,8 @@
             v-for="userAccount in accountList"
             :key="userAccount.accountId"
             :value="userAccount.accountId"
-          >{{userAccount.authName}}</a-select-option>
+          >{{userAccount.authName}}
+          </a-select-option>
         </a-select>
       </a-form-item>
 
@@ -157,7 +158,8 @@
                           class="video"
                           :src="video.localUrl"
                           controls="controls"
-                        >您的浏览器不支持 video 标签。</video>
+                        >您的浏览器不支持 video 标签。
+                        </video>
                         <a-checkbox :value="video.localUrl" class="checkbox_item">
                           <div class="item_txt">{{video.videoName}}</div>
                         </a-checkbox>
@@ -220,7 +222,7 @@
                 <div class="image_item_container">
                   <div v-for="(item ,index) in imageList" class="image_item" :key="index">
                     <label :for="item.id" class="label_item">
-                      <img :src="item.src" alt class="item_img" />
+                      <img :src="item.src" alt class="item_img"/>
                       <p class="item_text">{{item.name}}</p>
                       <p class="item_checkbox">
                         <input
@@ -308,12 +310,12 @@
                 @click="checkAll($event)"
                 class="select_all"
               /> 全选
-              <br />
-              <br />
+              <br/>
+              <br/>
               <div class="image_item_container">
                 <div v-for="(item ,index) in imageList" class="image_item" :key="index">
                   <label :for="item.id" class="label_item">
-                    <img :src="item.src" alt class="item_img" />
+                    <img :src="item.src" alt class="item_img"/>
                     <p class="item_text">{{item.name}}</p>
                     <p class="item_checkbox">
                       <input
@@ -371,12 +373,13 @@
             v-for="actionBar in actionBarTextList"
             :key="actionBar.id"
             :value="actionBar.actionBarText"
-          >{{actionBar.actionBarText}}</a-select-option>
+          >{{actionBar.actionBarText}}
+          </a-select-option>
         </a-select>
       </a-form-item>
 
       <a-form-item label="作品广告语" :labelCol="labelCol" :wrapperCol="wrapperCol">
-        <a-textarea style="width: 650px" v-model="description" :rows="2" />
+        <a-textarea style="width: 650px" v-model="description" :rows="2"/>
       </a-form-item>
 
       <a-form-item label="创意名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
@@ -402,7 +405,7 @@
       </a-form-item>
 
       <a-form-item :wrapperCol="{ span: 24 }" style="text-align: center">
-        <a-button htmlType="submit" type="primary">提交</a-button>
+        <a-button htmlType="submit" type="primary" :loading="loading">提交</a-button>
         <a-button style="margin-left: 8px">保存</a-button>
       </a-form-item>
     </a-form>
@@ -410,8 +413,8 @@
 </template>
 
 <script>
-  import { getAction, postAction } from '@/api/manage'
-  import { mapGetters } from 'vuex'
+  import {getAction, postAction} from '@/api/manage'
+  import {mapGetters} from 'vuex'
   import UploadToAli from '@femessage/upload-to-ali'
   import moment from 'moment'
   import VuePreview from 'vue-preview'
@@ -483,6 +486,7 @@
         isAllChecked: false,
         showClickTrackUrl: true,
         showImpressionUrl: false,
+        loading: false,
         impressionUrl: '',
         positionType: '',
         checkeds: [],
@@ -583,7 +587,7 @@
 
       // 停止播放除当前外的视频
       stopOtherVideo() {
-        jq(document).ready(function() {
+        jq(document).ready(function () {
           // 播放当前视频停止其他视频
           let videos = jq('video')
 
@@ -594,6 +598,7 @@
               i !== self && i.pause()
             })
           }
+
           // 给play事件绑定暂停函数
           ;[].forEach.call(videos, i => {
             i.addEventListener('play', pauseAll.bind(i))
@@ -641,7 +646,7 @@
         this.haveSinglePicimagesList = []
       },
 
-      checkeda: function(id) {
+      checkeda: function (id) {
         let indexOf = this.checkeds.indexOf(id)
         if (indexOf >= 0) {
           this.$delete(this.checkeds, id)
@@ -740,10 +745,7 @@
           getAction(this.url.imageListUrl, params).then(res => {
             this.imageList = res
           })
-        } else if (
-          (this.creativeMaterialType == '1' || this.creativeMaterialType == '2' || this.creativeMaterialType == '3') &&
-          this.sceneId == '3'
-        ) {
+        } else if ((this.creativeMaterialType == '1' || this.creativeMaterialType == '2' || this.creativeMaterialType == '3') && this.sceneId == '3') {
           // 横版竖版有单张图片
           if (this.creativeMaterialType == '1' || this.creativeMaterialType == '2') {
             // 切换横版或竖版
@@ -784,7 +786,7 @@
             })
           } else if (this.creativeMaterialType == '3') {
             // 切换单张图片
-            this.positionType = '1'
+            this.positionType = '2'
             this.singlePicTiepianType = '1'
             this.showImageUpload = true
             this.showUploadType = false
@@ -1034,6 +1036,7 @@
         e.preventDefault()
         this.form.validateFields((err, values) => {
           if (!err) {
+            this.loading = true;
             let params = {}
             params.accountId = this.accountId
             if (this.ids.length == 2) {
@@ -1066,6 +1069,7 @@
                   params.haveSinglePicVideoUrl = this.tiepianVideoLocalUploadList
                 }
               } else if (this.creativeMaterialType == '3') {
+                params.singlePicTiepianType = this.singlePicTiepianType;
                 if (this.changeSinglePicType == '1') {
                   params.haveSinglePicimagesList = this.haveSinglePicimagesList
                 } else if (this.changeSinglePicType == '2') {
@@ -1076,9 +1080,11 @@
             postAction(this.url.creativeUrl, params).then(res => {
               console.log(res)
               if (res.success) {
+                this.loading = false;
                 alert('广告创意创建成功')
-              }else{
-                alert(res.message)
+              } else {
+                this.loading = false;
+                alert(res.message);
               }
             })
           }
@@ -1086,7 +1092,7 @@
       }
     },
 
-    created: function() {
+    created: function () {
       let params = {}
       params.pageSize = '1000'
       params.mediaId = '2'