朱鑫波 4 éve
szülő
commit
81020ab2f8

+ 10 - 10
src/views/modules/kuaishouapp/account/advertisingGroup.vue

@@ -130,7 +130,7 @@
               <span slot="sceneId" slot-scope="text"><span v-for="item of text"
                   :key="item">{{ item | sceneId }}</span></span>
               <span slot="showMode" slot-scope="text">{{ text | showModel }}</span>
-              <span slot="unitType" slot-scope="text">{{ text == 4 ? '自定义' : '' }}</span>
+              <span slot="unitType" slot-scope="text">{{ text == 4 ? '自定义' : '程序化创意2.0' }}</span>
               <span slot="urlType" slot-scope="text">{{ text | urlType }}</span>
 
               <template slot="dayBudget" slot-scope="text, record">
@@ -880,15 +880,15 @@
         localStorage.setItem('campaignId', record.campaignId)
         if (localStorage.getItem('originality')) {
           var dataElse = JSON.parse(localStorage.getItem('originality'))
-          for (let i = 0; i < dataElse.length; i++) {
-            if (dataElse[i].unitId == record.unitId) {
-              this.$router.replace({
-                path: '/account/originality'
-              })
-              return
-            }
-          }
-          dataElse.push(record)
+          // for (let i = 0; i < dataElse.length; i++) {
+          //   if (dataElse[i].unitId == record.unitId) {
+          //     this.$router.replace({
+          //       path: '/account/originality'
+          //     })
+          //     return
+          //   }
+          // }
+          dataElse= [record] 
           localStorage.setItem('originality', JSON.stringify(dataElse))
         } else {
           var data = [record]

+ 40 - 2
src/views/modules/kuaishouapp/account/originality.vue

@@ -546,6 +546,36 @@
           }
         })
       },
+
+      getCXHList(id){
+        this.loadingList = true
+        this.dataList = []
+        var params = {}
+        params.unitId = id
+        params.accountId = localStorage.getItem('accountId')
+        params.pageNo = this.ipagination.current
+        params.pageSize = this.ipagination.pageSize
+        // params.creativeId = this.creativeIdTwo
+        // params.creativeName = this.creativeName
+        getAction('/ctop/kuaishouProgramCreative/list', params).then(res => {
+          console.log(res)
+          if (res.code == 0) {
+            this.loadingList = false
+            this.dataList = res.result.records.map((v, index) => {
+              return {
+                ...v,
+                key: index,
+                edit: false,
+                showSwich: v.putStatus == 1 ? true : false
+              }
+            })
+            this.ipagination.total = res.result.total
+          } else {
+            this.$message.error(res.message)
+            this.loadingList = false
+          }
+        })
+      },
       remove(targetKey) {
         let activeKey = this.titleKey
         let lastIndex
@@ -585,10 +615,18 @@
           key: item.unitId ? item.unitId + '' : item.key + '',
           tab: item.unitName ? '广告组:' + item.unitName : '广告组:' + item.tab,
           sceneId: item.sceneId,
-          bid_type: item.ocpxActionType
+          bid_type: item.ocpxActionType,
+          unitType:item.unitType
         }
       })
-      this.getDataList(localStorage.getItem('originalityKey'))
+      if(this.title.filter(item=>{
+        return item.key == this.titleKey+''
+      })[0].unitType==7){
+        this.getCXHList(localStorage.getItem('originalityKey'))
+      }else{
+        this.getDataList(localStorage.getItem('originalityKey'))
+      }
+      
       this.data = JSON.parse(localStorage.getItem('originality'))
     }
   }

+ 3 - 1
src/views/modules/kuaishouapp/account/stepForm/Step2.vue

@@ -946,12 +946,14 @@
                 this.allForm.success = res.result.success
                 this.loading = false
                 if (res.result.success.length > 0) {
+
                   var dataElse =  res.result.success.map(item => {
                       return {
                         tab: item.unitName,
                         key: item.unitId,
                         bidType: item.ocpxActionType,
-                        sceneId:JSON.stringify(item.sceneId)
+                        sceneId:JSON.stringify(item.sceneId),
+                        unitType: item.unitType
                       }
                     })
                   var dataJson = JSON.stringify(dataElse)

+ 273 - 223
src/views/modules/kuaishouapp/account/stepForm/Step4.vue

@@ -137,7 +137,7 @@ li.chouzhen.first:before {
 </style>
 <template>
   <a-card :body-style="{ padding: '24px 32px' }" :bordered="false" class="only-step3">
-    <a-tabs style="width:50%;margin:0 auto" type="editable-card" hideAdd @edit="remove">
+    <a-tabs style="width: 50%; margin: 0 auto" type="editable-card" hideAdd @edit="remove">
       <a-tab-pane
         v-for="(pane, bestIndex) in pans"
         :tab="pane.tab"
@@ -146,12 +146,7 @@ li.chouzhen.first:before {
         disabled
         :closable="pane.closable"
       >
-        <a-form
-          @submit="handleSubmit"
-          :form="form"
-          style="margin-top:20px"
-          :hideRequiredMark="true"
-        >
+        <a-form @submit="handleSubmit" :form="form" style="margin-top: 20px" :hideRequiredMark="true">
           <a-form-item label="广告组名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
             <a-input v-model="pane.tab" read-only></a-input>
           </a-form-item>
@@ -169,7 +164,7 @@ li.chouzhen.first:before {
               <a-radio-button value="1">竖版视频</a-radio-button>
               <a-radio-button value="2">横版视频</a-radio-button>
             </a-radio-group>
-            ({{videoCount+'/8'}})
+            ({{ videoCount + '/8' }})
             <!-- {{verticalPhoto}}/{{horizontalPhoto}} -->
           </a-form-item>
           <!-- <a-form-item label="素材同步" :labelCol="labelCol" :wrapperCol="wrapperCol">
@@ -177,61 +172,58 @@ li.chouzhen.first:before {
           </a-form-item>-->
           <a-form-item label="创意内容" :labelCol="labelCol">
             <a-layout>
-              <a-layout-content style="padding:10px;">
-                <div :style="{ marginBottom: '16px' }" style="float:right">
-                  <a-button
-                    @click="addCreative(bestIndex)"
-                    :disabled="videoCount>=8||listCheck"
-                  >添加创意</a-button>
+              <a-layout-content style="padding: 10px">
+                <div :style="{ marginBottom: '16px' }" style="float: right">
+                  <a-button @click="addCreative(bestIndex)" :disabled="videoCount >= 8 || listCheck">添加创意</a-button>
                 </div>
-                <a-row style="margin-top:50px">
+                <a-row style="margin-top: 50px">
                   <a-col :span="24" v-for="(item, index) of pane.list" :key="index">
                     <a-card title :ref="item">
                       <a-icon
                         type="close"
-                        style="float:right;cursor: pointer;"
+                        style="float: right; cursor: pointer"
                         @click="deleteCreative(bestIndex, index)"
                       />
-                      <div style="clear:both"></div>
+                      <div style="clear: both"></div>
                       <div class="dynamically_add_form_item">
                         <a-form-item label>
                           <a @click="getVideoList('video', index, item, bestIndex)">选择视频</a>
-                          <a @click="uploadVideo(index,bestIndex)" style="margin-left:10px">上传视频</a>
+                          <a @click="uploadVideo(index, bestIndex)" style="margin-left: 10px">上传视频</a>
 
                           <br />
                           <video
                             :src="item.videoList.url"
                             controls="controls"
-                            style="width:25%"
+                            style="width: 25%"
                             v-if="item.videoList"
                           ></video>
                         </a-form-item>
                         <a-form-item label>
                           <a
                             @click="getVideoList('image', index, item, bestIndex)"
-                            :disabled="item.imageList.length>=4"
-                          >选择封面</a>
+                            :disabled="item.imageList.length >= 4"
+                            >选择封面</a
+                          >
                           <a
-                            @click="uploadImages(index,bestIndex)"
-                            style="margin-left:10px"
-                            :disabled="item.imageList.length>=4"
-                          >上传封面</a>
+                            @click="uploadImages(index, bestIndex)"
+                            style="margin-left: 10px"
+                            :disabled="item.imageList.length >= 4"
+                            >上传封面</a
+                          >
                           <a
-                            @click="showImages(index,bestIndex)"
+                            @click="showImages(index, bestIndex)"
                             v-if="item.chouzhenShow"
-                            style="margin-left:10px"
-                            :disabled="item.imageList.length>=4"
-                          >推荐封面</a>
-                          <br />
-                          <span
-                            v-for="(item,deleteIndex) of item.imageList"
-                            style="position:relative;"
+                            style="margin-left: 10px"
+                            :disabled="item.imageList.length >= 4"
+                            >推荐封面</a
                           >
-                            <img :src="item.url" style="width:18%;margin:1%;" :key="item.url" />
+                          <br />
+                          <span v-for="(item, deleteIndex) of item.imageList" style="position: relative">
+                            <img :src="item.url" style="width: 18%; margin: 1%" :key="item.url" />
                             <a-icon
                               type="close-circle"
-                              @click="deleteData(index,bestIndex,deleteIndex)"
-                              style="position: absolute;right: 0px;"
+                              @click="deleteData(index, bestIndex, deleteIndex)"
+                              style="position: absolute; right: 0px"
                             />
                           </span>
                         </a-form-item>
@@ -243,16 +235,18 @@ li.chouzhen.first:before {
             </a-layout>
           </a-form-item>
           <a-form-item label="广告语" :labelCol="labelCol" :wrapperCol="wrapperCol" class="step4-else">
-            <a @click="addCaptions()" :disabled="captionsList.length>=6">添加广告语</a>
-            ({{captionsCount+'/6'}})
+            <a @click="addCaptions()" :disabled="captionsList.length >= 6">添加广告语</a>
+            ({{ captionsCount + '/6' }})
             <div
-              v-for="(item,index) in captionsList"
-              style="display: inline-block;position: relative;
-              border-radius: 4px;
-              border: 1px solid #d9d9d9;
-              width:100%;
+              v-for="(item, index) in captionsList"
+              style="
+                display: inline-block;
+                position: relative;
+                border-radius: 4px;
+                border: 1px solid #d9d9d9;
+                width: 100%;
               "
-              :style="{marginBottom:(index==captionsList.length-1)?'0px':'20px'}"
+              :style="{ marginBottom: index == captionsList.length - 1 ? '0px' : '20px' }"
             >
               <a-textarea
                 class="rending"
@@ -262,14 +256,26 @@ li.chouzhen.first:before {
                 :max-length="30"
               ></a-textarea>
               <p
-                style="font-size: 12px;color: #b6bbc7;letter-spacing: .3px;text-align: right;
-                line-height: 20px;position: absolute;bottom: 0;right: 6px;width: 100%;margin-bottom:0"
-              >{{item.captions.length+'/30'}}</p>
+                style="
+                  font-size: 12px;
+                  color: #b6bbc7;
+                  letter-spacing: 0.3px;
+                  text-align: right;
+                  line-height: 20px;
+                  position: absolute;
+                  bottom: 0;
+                  right: 6px;
+                  width: 100%;
+                  margin-bottom: 0;
+                "
+              >
+                {{ item.captions.length + '/30' }}
+              </p>
               <a-icon
                 type="delete"
                 @click="deleteCaptions(index)"
-                style="position:absolute;bottom:0;right:-50px"
-                :style="{display:(captionsList.length==1)?'none':'block'}"
+                style="position: absolute; bottom: 0; right: -50px"
+                :style="{ display: captionsList.length == 1 ? 'none' : 'block' }"
               />
             </div>
 
@@ -294,67 +300,58 @@ li.chouzhen.first:before {
               optionFilterProp="children"
               :filterOption="filterOption"
             >
-              <a-select-option
-                v-for="appModel in appList"
-                :key="appModel.id"
-                :value="appModel.actionBarText"
-              >{{ appModel.actionBarText }}</a-select-option>
+              <a-select-option v-for="appModel in appList" :key="appModel.id" :value="appModel.actionBarText">{{
+                appModel.actionBarText
+              }}</a-select-option>
             </a-select>
           </a-form-item>
           <a-form-item label="下载详情" v-if="showSite" :labelCol="labelCol" :wrapperCol="wrapperCol">
             <a-select
-              v-decorator="['siteId' ]"
+              v-decorator="['siteId']"
               showSearch
               allowClear
               placeholder="选择应用下载详情页"
               optionFilterProp="children"
               :filterOption="filterOption"
             >
-              <a-select-option
-                v-for="appModel in siteList"
-                :key="appModel.siteId"
-                :value="appModel.siteId"
-              >{{ appModel.name }}</a-select-option>
+              <a-select-option v-for="appModel in siteList" :key="appModel.siteId" :value="appModel.siteId">{{
+                appModel.name
+              }}</a-select-option>
             </a-select>
           </a-form-item>
-
-          <a-form-item label="监测链接" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <!-- , { validator: handleConfirmValue } -->
+          <a-form-item label="点击监测链接" :labelCol="labelCol" :wrapperCol="wrapperCol">
             <a-input
-              v-if="pane.bid_type == 6"
               v-decorator="[
-                'clickTrackUrl',
+                'clickUrl',
                 {
-                  rules: [
-                    {  message: '请输入第三方检测链接' },
-                    { validator: handleConfirmValue }
-                  ]
-                }
+                  rules: [{ message: '请输入第三方点击监测链接' }],
+                },
               ]"
-              placeholder="请输入第三方测链接"
+              placeholder="请输入第三方点击监测链接"
             ></a-input>
+          </a-form-item>
+          <!-- , { validator: handleConfirmValue } -->
+          <a-form-item label="监测链接" :labelCol="labelCol" :wrapperCol="wrapperCol">
             <a-input
-              v-else
               v-decorator="[
-                'clickTrackUrl',
+                'actionbarClickUrl',
                 {
-                  rules: [
-                    {  message: '请输入第三方检测链接' }
-                  ]
-                }
+                  rules: [{ message: '请输入第三方监测链接' }],
+                },
               ]"
-              placeholder="请输入第三方测链接"
+              placeholder="请输入第三方监测链接"
             ></a-input>
-            <a
-              v-if="getData('clickTrackUrl')"
-              @click="clickTrackUrlShow=true"
-              style="margin-right:10px"
-            >收藏监测链接</a>
+            <a v-if="getData('clickTrackUrl')" @click="clickTrackUrlShow = true" style="margin-right: 10px"
+              >收藏监测链接</a
+            >
             <a @click="getClickTrackUrlList()">监测链接列表</a>
           </a-form-item>
 
           <a-form-item label="创意标题" :labelCol="labelCol" :wrapperCol="wrapperCol">
             <a-input
               v-decorator="['packageName', { rules: [{ required: true, message: '创意标题必填' }] }]"
+              :maxLength="100"
             ></a-input>
           </a-form-item>
         </a-form>
@@ -367,14 +364,14 @@ li.chouzhen.first:before {
     <a-modal :maskClosable="false" v-model="visible" title="广告创意创建情况">
       <div>
         创建成功:{{ allForm.success.length }}条
-        <div style="margin-top:20px">
+        <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">
+        <div style="margin-top: 20px">
           <p v-for="(item, index) of allForm.fail" :key="index">
             <span>名称:{{ item.creativeName }}</span>
             <br />
@@ -414,20 +411,17 @@ li.chouzhen.first:before {
           :accessKeyId="accessKeyId" :accessKeySecret="accessKeySecret" :before-upload="fileWater" :dir="dirImg"
         @delete='deleteImage' @loaded="overUploadImage"></upload-to-ali>-->
         <span
-          v-if="material.filter(item => item == false).length > 0 && urlListImage.url.length > 0"
-          style="color:red"
+          v-if="material.filter((item) => item == false).length > 0 && urlListImage.url.length > 0"
+          style="color: red"
         >
           上传素材的尺寸不符,请修改(
-          <span
-            v-for="(item, index) of material"
-            :key="index"
-            v-show="!item"
-          >第{{ index + 1 }}张</span>出错)
+          <span v-for="(item, index) of material" :key="index" v-show="!item">第{{ index + 1 }}张</span>出错)
         </span>
         <span
-          v-else-if="urlListImage.url.length > 0 && material.filter(item => item == false).length == 0"
-          style="color:green"
-        >上传成功</span>
+          v-else-if="urlListImage.url.length > 0 && material.filter((item) => item == false).length == 0"
+          style="color: green"
+          >上传成功</span
+        >
       </a-form-item>
     </a-modal>
 
@@ -457,85 +451,67 @@ li.chouzhen.first:before {
           :accept="acceptVideo" :max="10" :size="1024000" :accessKeyId="accessKeyId" :accessKeySecret="accessKeySecret"
           :before-upload="file" :dir="dirVideo" @loaded="overUpload">
         </upload-to-ali>-->
-        <span v-if="messageTip" style="color:red">{{messageTip}}</span>
+        <span v-if="messageTip" style="color: red">{{ messageTip }}</span>
       </a-form-item>
     </a-modal>
     <a-modal :maskClosable="false" title="抽帧展示" v-model="chouzhen" :width="1000">
       <template slot="footer">
-        <a-button key="back" @click="chouzhen=false">关闭</a-button>
+        <a-button key="back" @click="chouzhen = false">关闭</a-button>
         <a-button key="submit" type="primary" @click="handleOkChouzhen">确定</a-button>
       </template>
       <!-- <a-button type="primary" @click="onCheckAllChange">全选</a-button> -->
       <!-- </a-checkbox> -->
-      <ul
-        v-if="chouzhenList.length>0"
-        style="height:600px;overflow:auto;padding-left:0"
-        class="step3-modal"
-      >
-        <a-checkbox-group v-model="checkList" @change="onChange" style="width:100%;">
+      <ul v-if="chouzhenList.length > 0" style="height: 600px; overflow: auto; padding-left: 0" class="step3-modal">
+        <a-checkbox-group v-model="checkList" @change="onChange" style="width: 100%">
           <li
-            v-for="(item,index) of chouzhenList"
+            v-for="(item, index) of chouzhenList"
             :key="index"
             class="chouzhen"
-            style="height:320px"
-            :class="{'first':index == 0}"
+            style="height: 320px"
+            :class="{ first: index == 0 }"
           >
             <a-checkbox
               :value="item.signature"
-              style="position:absolute;z-index: 100;width:100%;height:100%;right:0;top:0;float:right"
+              style="position: absolute; z-index: 100; width: 100%; height: 100%; right: 0; top: 0; float: right"
             >
-              <img :src="item.url" alt style="width:100%" />
+              <img :src="item.url" alt style="width: 100%" />
             </a-checkbox>
             <a
-              style="position:absolute;bottom:0;width:100%;text-align:center;margin-left: -10px;z-index: 100;"
-              @click.stop="(showImageStr=item.url);(showImageChouzhen=true)"
-            >查看封面</a>
+              style="position: absolute; bottom: 0; width: 100%; text-align: center; margin-left: -10px; z-index: 100"
+              @click.stop="
+                showImageStr = item.url
+                showImageChouzhen = true
+              "
+              >查看封面</a
+            >
           </li>
         </a-checkbox-group>
       </ul>
     </a-modal>
     <a-modal title="抽帧详情" v-model="showImageChouzhen" :width="400" :footer="null">
-      <img :src="showImageStr" style="width:100%" />
+      <img :src="showImageStr" style="width: 100%" />
     </a-modal>
 
-    <a-modal
-      :maskClosable="false"
-      title="选择素材"
-      v-model="visibleMatemal"
-      @ok="handleOkShow"
-      :width="1000"
-    >
+    <a-modal :maskClosable="false" title="选择素材" v-model="visibleMatemal" @ok="handleOkShow" :width="1000">
       <a-tabs type="card" @change="callback" v-model="active" class="check-video">
         <a-tab-pane :tab="item.label" v-for="item of tab" :key="item.value">
-          <a-range-picker name="buildTime" style="width: 400px;margin:10px 0" v-model="time" />
-          <ul v-if="dataSource.length>0" style="overflow:auto;padding-left:0">
-            <a-checkbox-group v-model="checkVideo" @change="onChangeVideo" style="width:100%">
-              <li
-                v-for="(item,index) of dataSource"
-                :key="index"
-                class="chouzhen"
-                style="height:350px;"
-              >
+          <a-range-picker name="buildTime" style="width: 400px; margin: 10px 0" v-model="time" />
+          <ul v-if="dataSource.length > 0" style="overflow: auto; padding-left: 0">
+            <a-checkbox-group v-model="checkVideo" @change="onChangeVideo" style="width: 100%">
+              <li v-for="(item, index) of dataSource" :key="index" class="chouzhen" style="height: 350px">
                 <!-- <video class="video" :src="item.url" controls="controls" style="width:100%">
                   您的浏览器不支持 video 标签。
                 </video>-->
-                <a-checkbox
-                  :value="item"
-                  style="width:100%;position:absolute;z-index: 100;right:0;top:0;"
-                >
-                  <img :src="item.coverUrl" alt style="width:100%;margin-bottom:10px" />
+                <a-checkbox :value="item" style="width: 100%; position: absolute; z-index: 100; right: 0; top: 0">
+                  <img :src="item.coverUrl" alt style="width: 100%; margin-bottom: 10px" />
                 </a-checkbox>
-                <a
-                  @click="matemalVideo(item,index)"
-                  style="position:absolute;z-index: 100;right:56px;bottom: 5px;"
-                >查看视频</a>
+                <a @click="matemalVideo(item, index)" style="position: absolute; z-index: 100; right: 56px; bottom: 5px"
+                  >查看视频</a
+                >
               </li>
             </a-checkbox-group>
           </ul>
-          <div
-            v-else
-            style="width:100%;height:400px;display:flex;justify-content: center;align-items: center;"
-          >
+          <div v-else style="width: 100%; height: 400px; display: flex; justify-content: center; align-items: center">
             <img
               src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1575627350102&di=02972956f2243933bffc0d85099adbfe&imgtype=jpg&src=http%3A%2F%2Fimg0.imgtn.bdimg.com%2Fit%2Fu%3D1095310825%2C1528244349%26fm%3D214%26gp%3D0.jpg"
               alt
@@ -544,12 +520,9 @@ li.chouzhen.first:before {
             <img v-else src="@/views/modules/material/loading.gif" />
           </div>
         </a-tab-pane>
-        <a-button
-          slot="tabBarExtraContent"
-          type="primary"
-          @click="tongbu()"
-          :loading="tongbuLoading"
-        >刷新素材</a-button>
+        <a-button slot="tabBarExtraContent" type="primary" @click="tongbu()" :loading="tongbuLoading"
+          >刷新素材</a-button
+        >
       </a-tabs>
 
       <!-- <ul class="actor-photo-list">
@@ -562,11 +535,11 @@ li.chouzhen.first:before {
             </li>
           </a-checkbox-group>
       </ul>-->
-      <div style="text-align:right">
+      <div style="text-align: right">
         <a-pagination
           size="small"
           :showTotal="ipagination.showTotal"
-          style="float:right"
+          style="float: right"
           v-if="dataSource.length > 0"
           showQuickJumper
           :pageSize.sync="ipagination.pageSize"
@@ -577,21 +550,18 @@ li.chouzhen.first:before {
       </div>
     </a-modal>
     <a-modal title="查看视频" v-model="visibleVideo" :width="400" :footer="null">
-      <video
-        class="video"
-        :src="videoUrlShow"
-        controls="controls"
-        style="width:100%"
-      >您的浏览器不支持 video 标签。</video>
+      <video class="video" :src="videoUrlShow" controls="controls" style="width: 100%">
+        您的浏览器不支持 video 标签。
+      </video>
     </a-modal>
     <a-modal title="推荐标题" v-model="titleVisible" :width="1000" :footer="null">
       <a-row :gutter="10">
-        <a-col :sm="10" style="margin-bottom: 20px;z-index: 10">
-          <a-card class="search-box" style="min-height:500px">
-            <div style="margin-bottom:30px">
-              <span style="display:inline-block;width:80px">行业</span>
+        <a-col :sm="10" style="margin-bottom: 20px; z-index: 10">
+          <a-card class="search-box" style="min-height: 500px">
+            <div style="margin-bottom: 30px">
+              <span style="display: inline-block; width: 80px">行业</span>
               <a-cascader
-                style="margin-top: 1rem;width:300px"
+                style="margin-top: 1rem; width: 300px"
                 v-model="dataOne"
                 :options="options"
                 :showSearch="{ filter }"
@@ -602,16 +572,16 @@ li.chouzhen.first:before {
                 <a-icon type="smile" slot="suffixIcon" class="test" />
               </a-cascader>
             </div>
-            <div style="margin-bottom:30px">
-              <span style="display:inline-block;width:80px">关键词</span>
+            <div style="margin-bottom: 30px">
+              <span style="display: inline-block; width: 80px">关键词</span>
               <a-input placeholder="请输入关键词" v-model="value" style="width: 300px" />
             </div>
-            <span style="display:inline-block;width:80px;float:left"></span>
+            <span style="display: inline-block; width: 80px; float: left"></span>
             <a-button type="primary" @click="searchQuery" :disabled="value == ''">生成</a-button>
           </a-card>
         </a-col>
-        <a-col :sm="14" style="margin-bottom: 20px;z-index: 10">
-          <a-card class="search-box" style="over-flow:auto">
+        <a-col :sm="14" style="margin-bottom: 20px; z-index: 10">
+          <a-card class="search-box" style="over-flow: auto">
             <a-list size="large" bordered :dataSource="title">
               <a-list-item slot="renderItem" slot-scope="item">
                 <a slot="actions" @click="okTitle(item)">选择</a>
@@ -624,8 +594,8 @@ li.chouzhen.first:before {
     </a-modal>
     <a-modal title="收藏标题" v-model="cunTitleVisible" :width="1000" :footer="null">
       <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-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">
@@ -644,46 +614,37 @@ li.chouzhen.first:before {
       <template slot="footer">
         <a-button
           key="submit"
-          :disabled="trackUrlName==''&&(!showTrackUrlNameElse)"
+          :disabled="trackUrlName == '' && !showTrackUrlNameElse"
           type="primary"
           @click="clickTrackUrlOk"
-        >确定</a-button>
+          >确定</a-button
+        >
       </template>
-      <a-input
-        placeholder="请输入监测链接名称"
-        v-model="trackUrlName"
-        @blur="changeTrackUrlName"
-        style="width: 100%"
-      />
-      <span style="color:red" v-if="!showTrackUrlNameElse">名称重复</span>
+      <a-input placeholder="请输入监测链接名称" v-model="trackUrlName" @blur="changeTrackUrlName" style="width: 100%" />
+      <span style="color: red" v-if="!showTrackUrlNameElse">名称重复</span>
     </a-modal>
     <a-modal title="监测链接列表" v-model="clickTrackUrlList" :width="1000" :footer="null">
       <a-row :gutter="10" class="onlny-click-track">
-        <a-col :sm="24" style="margin-bottom: 20px;z-index: 10">
-          <a-card class="search-box" style="over-flow:auto">
+        <a-col :sm="24" style="margin-bottom: 20px; z-index: 10">
+          <a-card class="search-box" style="over-flow: auto">
             <!-- <a-input v-model="trackName"></a-input> -->
             <a-input-search
               placeholder="请输入监测链接名称"
               enter-button="Search"
               size="large"
               @search="onSearch"
-              style="width:40%;margin-bottom:20px"
+              style="width: 40%; margin-bottom: 20px"
               v-model="trackName"
             />
             <a-list size="large" bordered :dataSource="trackUrlList">
-              <a-list-item
-                slot="renderItem"
-                slot-scope="item"
-                :title="item.trackUrl"
-                style="line-height:50px"
-              >
+              <a-list-item slot="renderItem" slot-scope="item" :title="item.trackUrl" style="line-height: 50px">
                 <div slot="actions">
                   <a @click="okClickTrackUrl(item)">选择</a>
                   <a-divider type="vertical" />
                   <a @click="removeClickTrackUrl(item)">删除</a>
                 </div>
                 {{ item.trackName }}
-                <a-input v-model="item.trackUrl" read-only style="margin:10px;width:70%"></a-input>
+                <a-input v-model="item.trackUrl" read-only style="margin: 10px; width: 70%"></a-input>
               </a-list-item>
             </a-list>
           </a-card>
@@ -707,6 +668,22 @@ import uploadFile from '@/components/uploadFile.vue'
 let nowIndex = 0
 let bestIndex = 0
 let showRemove = false
+
+function tqFun(qcArr1) {
+  var tempArr = []
+  function bbFun(qcArr) {
+    for (var i = 0; i < qcArr.length; i++) {
+      if (qcArr[i] instanceof Array) {
+        bbFun(qcArr[i])
+      } else {
+        tempArr.push(qcArr[i])
+      }
+    }
+    return tempArr
+  }
+  return bbFun(qcArr1)
+}
+
 export default {
   name: 'BaseForm',
   components: {
@@ -1181,7 +1158,13 @@ export default {
         //   this.pans[index].list[item.key].imageList.push(...item.image)
 
         if (item.image.length + this.pans[index].list[item.key].imageList > 4) {
-          this.$message.error('当前选择封面' + item.image.length + '张,最多可选择' + (4 - this.pans[index].list[item.key].imageList.length) + '张')
+          this.$message.error(
+            '当前选择封面' +
+              item.image.length +
+              '张,最多可选择' +
+              (4 - this.pans[index].list[item.key].imageList.length) +
+              '张'
+          )
           return
         } else {
           this.pans[index].list[item.key].imageList.push(...item.image)
@@ -1338,55 +1321,110 @@ export default {
       this.form.validateFields((err, values) => {
         if (!err) {
           this.loading = true
-          var dataJson = this.pans[index].list.map((item) => {
-            return {
-              description: item.description,
-              imageArr: item.imageList.map((ele, index) => {
-                return {
-                  signature: ele.signature,
-                  name: item.name,
-                }
-              }),
-              imageArrTwo: item.checkArrImage.map((ele, index) => {
-                return {
-                  signature: ele,
-                  name: item.name,
-                }
-              }),
-              photoId: item.videoList.photoId,
-              name: item.name,
+          // var dataJson = this.pans[index].list.map((item) => {
+          //   return {
+          //     description: item.description,
+          //     imageArr: item.imageList.map((ele, index) => {
+          //       return {
+          //         signature: ele.signature,
+          //         name: item.name,
+          //       }
+          //     }),
+          //     imageArrTwo: item.checkArrImage.map((ele, index) => {
+          //       return {
+          //         signature: ele,
+          //         name: item.name,
+          //       }
+          //     }),
+          //     photoId: item.videoList.photoId,
+          //     name: item.name,
+          //   }
+          // })
+          // var allJson = dataJson.map((item) => {
+          //   return {
+          //     description: item.description,
+          //     imageArr:
+          //       item.imageArr.concat(item.imageArrTwo).length > 0
+          //         ? item.imageArr.concat(item.imageArrTwo)
+          //         : [
+          //             {
+          //               name: item.name,
+          //             },
+          //           ],
+          //     photoId: item.photoId,
+          //   }
+          // })
+          //       horizontalPhoto: [], //横板
+          //  verticalPhoto: [], //竖版
+          //  videoList: '',
+          //     imageList: [],
+          var data = this.verticalPhoto.map((item) => {
+            if (item.imageList.length > 0) {
+              return item.imageList.map((i) => {
+                return i.signature
+              })
+            } else {
+              return []
             }
           })
-          var allJson = dataJson.map((item) => {
-            return {
-              description: item.description,
-              imageArr:
-                item.imageArr.concat(item.imageArrTwo).length > 0
-                  ? item.imageArr.concat(item.imageArrTwo)
-                  : [
-                      {
-                        name: item.name,
-                      },
-                    ],
-              photoId: item.photoId,
+          var dataTwo = this.horizontalPhoto.map((item) => {
+            if (item.imageList.length > 0) {
+              return item.imageList.map((i) => {
+                return i.signature
+              })
+            } else {
+              return []
             }
           })
+          var dataElse = tqFun(data)
+          var dataTwoElse = tqFun(dataTwo)
+
           var params = {
-            dataJson: allJson,
+            // dataJson: allJson,
             ...values,
             unitId: this.pansKey,
             accountId: localStorage.getItem('accountId'),
             content: this.content,
+            captions: this.captionsList.map((item) => {
+              return item.captions
+            }),
+            horizontalPhotoIds: this.horizontalPhoto.map((item) => {
+              return item.videoList.photoId
+            }),
+            verticalPhotoIds: this.verticalPhoto.map((item) => {
+              return item.videoList.photoId
+            }),
+            coverImageTokens: dataElse.concat(dataTwoElse),
           }
-          postAction('/kuaishou/batch/createCreative', params).then((res) => {
+          console.log(params)
+          console.log(dataElse.concat(dataTwoElse))
+          postAction('/ctop/kuaishouProgramCreative/createProgramCreative', params).then((res) => {
             if (res.success) {
-              this.visible = true
-              this.allForm.fail = res.result.fail
-              this.allForm.success = res.result.success
               this.loading = false
+              // this.visible = true
+              // this.allForm.fail = res.result.fail
+              // this.allForm.success = res.result.success
+              if (localStorage.getItem('originality')) {
+                this.$router.replace({
+                  path: '/account/originality',
+                })
+              } else {
+                this.$router.replace({
+                  path: '/account/accountIndex',
+                })
+              }
             } else {
               this.loading = false
               this.$message.error(res.message)
+              if (localStorage.getItem('originality')) {
+                this.$router.replace({
+                  path: '/account/originality',
+                })
+              } else {
+                this.$router.replace({
+                  path: '/account/accountIndex',
+                })
+              }
             }
           })
         }
@@ -1472,7 +1510,13 @@ export default {
         }
       }
       if (arr.length + this.pans[bestIndex].list[nowIndex].imageList.length > 4) {
-        this.$message.error('当前选择封面' + arr.length + '张,最多可选择' + (4 - this.pans[bestIndex].list[nowIndex].imageList.length) + '张')
+        this.$message.error(
+          '当前选择封面' +
+            arr.length +
+            '张,最多可选择' +
+            (4 - this.pans[bestIndex].list[nowIndex].imageList.length) +
+            '张'
+        )
         return
       } else {
         this.pans[bestIndex].list[nowIndex].imageList.push(...arr)
@@ -1536,7 +1580,13 @@ export default {
       postAction('/kusiShouUpload/image', params).then((res) => {
         if (res.success) {
           if (res.result.length + this.pans[bestIndex].list[nowIndex].imageList > 4) {
-            this.$message.error('当前上传封面' + res.result.length + '张,最多可上传' + (4 - this.pans[bestIndex].list[nowIndex].imageList.length) + '张')
+            this.$message.error(
+              '当前上传封面' +
+                res.result.length +
+                '张,最多可上传' +
+                (4 - this.pans[bestIndex].list[nowIndex].imageList.length) +
+                '张'
+            )
             this.loadingImage = false
             return
           } else {
@@ -1831,7 +1881,7 @@ export default {
       var dataElse = this.horizontalPhoto.filter((item) => {
         return item.videoList != ''
       })
-      return (data.length+dataElse.length)
+      return data.length + dataElse.length
     },
     dirImg() {
       let date = new Date()

+ 25 - 3
src/views/modules/kuaishouapp/account/stepForm/StepForm.vue

@@ -8,7 +8,8 @@
     <div class="content">
       <step1 v-if="currentTab === 0" @nextStep="nextStep" ref="step" />
       <step2 v-if="currentTab === 1" :campaignId="campaignId" @nextStep="nextStepTwo" @prevStep="prevStep" />
-      <step3 v-if="currentTab === 2" @prevStep="prevStepTwo" @removeTab="remove" />
+      <component  v-if="currentTab === 2" :is="formComponent" @prevStep="prevStepTwo" @removeTab="remove"></component>
+      <!-- <step3 v-if="currentTab === 2" @prevStep="prevStepTwo" @removeTab="remove" /> -->
     </div>
   </a-card>
 </template>
@@ -17,12 +18,14 @@
 import Step1 from './Step1'
 import Step2 from './Step2'
 import Step3 from './Step3'
+import Step4 from './Step4'
 export default {
   name: 'StepForm',
   components: {
     Step1,
     Step2,
-    Step3
+    Step3,
+    Step4
   },
   data() {
     return {
@@ -30,7 +33,8 @@ export default {
 
       // form
       form: null,
-      campaignId: null
+      campaignId: null,
+      formComponent:null
     }
   },
   methods: {
@@ -47,6 +51,7 @@ export default {
         this.currentTab += 1
         localStorage.setItem('step', this.currentTab)
       }
+     
     },
     prevStep(campaignId) {
       if (this.currentTab > 0) {
@@ -71,6 +76,23 @@ export default {
       this.$emit('removeTab', key)
     }
   },
+  watch:{
+    currentTab(n,o){
+      if(n==2){
+        var data = JSON.parse(localStorage.getItem('pans')).map(item => {
+            return {
+              ...item,
+            }
+          })
+        if(data[0].unitType == '7'){
+          this.formComponent = Step4
+        }else{
+          this.formComponent = Step3
+        }
+        
+      }
+    }
+  },
   mounted() {
     this.currentTab = parseInt(localStorage.getItem('step'))
   }

+ 4 - 3
src/views/modules/material/materialList.vue

@@ -968,9 +968,7 @@ export default {
       var that = this
       return new Promise(function(resolve, reject) {
         bmf.md5(file[0], (err, md5) => {
-          that.urlList.name = file[0].name
-          that.urlList.md5 = md5
-          that.urlList.size = file[0].size
+         
           fileCheck({
             code: md5,
             projectId: that.getData('projectId')
@@ -979,6 +977,9 @@ export default {
               that.$message.error('此素材已经上传')
               reject()
             } else {
+               that.urlList.name = file[0].name
+                that.urlList.md5 = md5
+                that.urlList.size = file[0].size
               resolve()
               //   reject()
             }