朱鑫波 4 éve
szülő
commit
c4487640cf
1 módosított fájl, 152 hozzáadás és 27 törlés
  1. 152 27
      src/views/modules/autoLaunch/configLaunchInfo.vue

+ 152 - 27
src/views/modules/autoLaunch/configLaunchInfo.vue

@@ -244,7 +244,7 @@
                         </div>
                         <div class="input-item">
                             <a-form-item   >
-                                <a-radio-group  v-model="sysType" @change="sysTypeChange">
+                                <a-radio-group  v-model="sysType" @change="sysTypeChange" >
                                 <a-radio-button :value="1">安卓</a-radio-button>
                                 <a-radio-button :value="2">IOS</a-radio-button>
                                 </a-radio-group>
@@ -262,12 +262,13 @@
                             <a-form-item>
                                 <a-select v-decorator="['appId', { rules: [{ required: true, message: '请选择目标应用' }] }]" showSearch allowClear
                                     placeholder="选择应用目标" optionFilterProp="children" style="width: 500px"  
-                                   :filterOption="filterOption" @change="appIdChange" :mode="getFormData('singleAppid')==1?'defalut':'multiple'" :maxTagCount='1'>
+                                   :filterOption="filterOption" @change="appIdChange" :mode="getFormData('singleAppid')==1?'defalut':'multiple'" :maxTagCount='1' 
+                                   :labelInValue="getFormData('singleAppid')==1?false:true">
                                     <a-select-option v-if="getFormData('singleAppid')==0" :value='0' @click="selectAllAppId">选择以下全部</a-select-option>
                                     <a-select-option v-for="appModel in appList" :key="appModel.appId" :value="appModel.appId">
-                                        {{ appModel.appName }}&#12288;&nbsp;&#12288; {{ appModel.appVersion }}&#12288;&#12288;&#12288;{{
+                                        {{
                                         appModel.platform | platform
-                                        }}
+                                        }}&#12288;&#12288;&#12288;{{ appModel.appName }}&#12288;&nbsp;&#12288; {{ appModel.appVersion }}
                                     </a-select-option>
                                 </a-select>
                                 <a-button type="primary" @click="addApplication" style="margin-left:10px" :loading="tongbuLoading">刷新应用</a-button>
@@ -292,6 +293,50 @@
                             </a-form-item>
                         </div>
                     </div>
+
+                    <div class="row-item" v-if="getFormData('singleAppid')==0">
+                    <div class="hint-item"></div>
+                    <div class="label-item">
+                        <div class="text-item">是否多应用分别出价</div>
+                        </div>
+                        <div class="input-item">
+                            <a-form-item  >
+                                <a-radio-group  v-decorator="['multipleBids', {initialValue:0 }]">
+                                    <a-radio-button :value="0">否</a-radio-button>
+                                    <a-radio-button :value="1">是</a-radio-button>
+                                </a-radio-group>
+                            </a-form-item>         
+                        </div>
+                    </div>
+                    <div class="row-item" v-if="getFormData('multipleBids')==1">
+                    <div class="hint-item"></div>
+                    <div class="label-item">
+                        <div class="text-item">分别出价</div>
+                        </div>
+                        <div class="input-item">
+                            <div style="width:120vh;height:300px;overflow:auto;border:1px solid #f2f2f2;padding:10px">
+                                <p v-for="(item,index) in multipleBidData" :key="index" style="display:flex">
+                                   
+                                   
+                                    <span style="white-space:nowrap;line-height: 30px;margin-right: 10px;">OCPM出价</span>
+                                    <a-input-number
+                                        style="width:300px"
+                                        :max="10000"
+                                        :step="0.1"
+                                        v-model="item.cpaBid"
+                                    />
+                                    <span style="margin-left:20px;white-space:nowrap;line-height: 30px;margin-right: 10px;">监测链接</span>
+                                    <a-input style="width:300px" placeholder="请填写链接" v-model="item.trackUrl" />
+                                    <a-icon 
+                                    @click="checkOneBid(item)"
+                                    type="check" style="margin-left:20px;white-space:nowrap;line-height: 30px;margin-right: 10px;cursor:pointer;color:green" />
+                                    <span  style="margin:5px;width:50%">{{item.label}}</span>
+                                   
+                                </p>
+                            </div>
+                        </div>
+                    </div>
+
                     <div class="row-item" v-if="getFormData('campaignType') == 3">
                         <div class="hint-item"></div>
                         <div class="label-item">
@@ -1493,13 +1538,13 @@
                         <div class="required-item"></div>
                         </div>
                         <div class="input-item">
-                        <a-form-item>  
+                        <a-form-item v-for="(item,index) in descriptionList" :key="index">  
                             <div style="position:relative">              
                             <a-textarea
                                 class="rending"
                                 placeholder="请输入广告语"
-                                @change="descriptionchange"
-                                v-decorator="['description',{rules: [ { required: true, message: '请填写广告语' }] } ]"
+                                @change="descriptionchange(item.value,index)"
+                                v-model.trim="item.value"
                                 :autosize="{ minRows: 2, maxRows: 6 }"
                                 :max-length="30"
                             ></a-textarea>
@@ -1517,11 +1562,17 @@
                                 margin-bottom: 0;
                               "
                             >
-                              {{ description.length  }}/30
+                              {{ item.value.length  }}/30
                               <!-- {{ getFormData('description').length  }}/30 -->
                             </p>
+                           <div style="position:absolute;right:-50px;top:-10px">
+                                <a-icon type="plus" @click="addDescription()" style="margin-right:15px"/>
+                                <a-icon type="minus" @click="removeDescription(index)" v-if="descriptionList.length>1"/>
+                           </div>
                             </div>
+
                         </a-form-item>
+
                         </div>
                     </div>  
                     <div class="row-item">
@@ -1934,7 +1985,9 @@ export default {
             appListValue: '',
             checkOptions: [],
             checkAllApp: false,
-            optionsAll: []
+            optionsAll: [],
+            multipleBidData:[],
+            descriptionList:[{value:""}]
            
             
         }
@@ -2041,6 +2094,18 @@ export default {
             },
     },
     methods: {
+        checkOneBid(item) {
+            console.log(item)
+            let params = {...item}
+            params.cpaBid = params.cpaBid*1000
+            postAction('/adsp/kuaiShouAppMultipleBids/saveOrUpdate',params).then(res=>{
+                if(res.success){
+                    this.$message.success('添加成功')
+                }else{
+                    this.$message.error('新增失败')
+                }
+            })
+        },
         convertOk() {
             var dataLink = []
             dataLink = this.convertList.filter((item) => {
@@ -2258,15 +2323,25 @@ export default {
                 appId:undefined
             })
         },
-        descriptionchange(e){
-            if(this.getData('description')){
-                this.$nextTick(()=>{
-                    this.form.setFieldsValue({
-                        description: this.getData('description').replace(/\s/g,'')
-                    })
-                })
-            }
-            this.description=e.target.value.replace(/\s/g,'')
+        addDescription(){
+            this.descriptionList.push({value:""})
+        },
+        removeDescription(index){
+            this.descriptionList.splice(index,1)
+        },
+        descriptionchange(val,index){
+            let data = val;
+            this.$nextTick(()=>{
+                this.descriptionList[index].value = data.replace(/\s/g,'')
+            })
+            // if(this.getData('description')){
+            //     this.$nextTick(()=>{
+            //         this.form.setFieldsValue({
+            //             description: this.getData('description').replace(/\s/g,'')
+            //         })
+            //     })
+            // }
+            // this.description=e.target.value.replace(/\s/g,'')
 
            
         },
@@ -2416,14 +2491,13 @@ export default {
             })
         },
         appIdChange(val){
-            //console.log(val)
+            console.log(val)
             this.siteList=[]
-            
             // this.getPageList(val)
             if(this.getFormData('singleAppid')==0){
                 if(val&&val.indexOf(0)>-1){
                     let appidArr=this.appList.map(item=>{
-                        return item.appId
+                        return {key:item.appId,label:item.appName}
                     })
                     // setTimeout(()=>{
                         
@@ -2435,8 +2509,32 @@ export default {
                         this.form.setFieldsValue({
                             appId:appidArr
                         })
+                        this.multipleBidData = appidArr.map(item=>{
+                            return {
+                                ...item,
+                                cpaBid:null,
+                                trackUrl:'',
+                                appId:item.key,
+                                accountId:this.accountId
+
+                            }
+                        })
                     })
+                    
                 
+                }else{
+                    this.$nextTick(()=>{
+                        this.multipleBidData = val.map(item=>{
+                            return {
+                                ...item,
+                                cpaBid:null,
+                                trackUrl:'',
+                                appId:item.key,
+                                accountId:this.accountId
+
+                            }
+                        })
+                    })
                 }
             }
             
@@ -2689,10 +2787,19 @@ export default {
         goNext() {
 
         this.$nextTick(()=>{
-  
+
+                
+
             this.form.validateFields((err, values) => {
                 //console.log(values) 
-                if (!err) {     
+                if (!err) {  
+                    let isNotComplete = this.descriptionList.findIndex(item => {
+                        return item.value === ''
+                    })
+                    if (isNotComplete > -1) {
+                        this.$message.error('请正确填写必填项目,广告语未填')
+                        return
+                    } 
                     // console.log(values)              
                     this.goNextloading=true;
                    
@@ -2722,10 +2829,10 @@ export default {
                     //     values.endTime= this.dateRange[1].format('YYYY-MM-DD');
                     // }
                     if(this.getData('campaignType') === 2 ) {
-                        values.appIdArray=values.appId instanceof Array?JSON.stringify(values.appId):JSON.stringify([values.appId])
+                        values.appIdArray=values.appId instanceof Array?JSON.stringify(values.appId.map(item=>{return item.key})):JSON.stringify([values.appId])
                         values.appId=undefined;
                     }else if(this.getData('campaignType') === 7){
-                        values.appIdArray=values.appId instanceof Array?JSON.stringify(values.appId):JSON.stringify([values.appId])
+                        values.appIdArray=values.appId instanceof Array?JSON.stringify(values.appId.map(item=>{return item.key})):JSON.stringify([values.appId])
                         values.appId=undefined;
                         values.singleAppid = 1
                     }else {
@@ -2767,7 +2874,9 @@ export default {
                         values.population=this.incluedSelectedRowKeys.length>0?JSON.stringify(this.incluedSelectedRowKeys):'[]';
                     }
                     
-                    
+                    values.description = JSON.stringify(this.descriptionList.map(item=>{
+                        return item.value
+                    }))
                     
                     values.useAppMarket=values.useAppMarket?'1':'0'
                     
@@ -3106,7 +3215,22 @@ export default {
                     this.optionsAll =  res.result.appIds ? (typeof  res.result.appIds == 'string' ? JSON.parse(res.result.appIds) : res.result.appIds) : []
                     this.checkAllApp = false
                     res.result.appInterest = res.result.appInterest?JSON.parse(res.result.appInterest):[]
+                    this.descriptionList = res.result.description.charAt(0) === '['?eval(res.result.description).map(item=>{
+                        return {value:item}
+                    }):[{value:res.result.description}]
 
+                    this.multipleBidData = res.result.appInfoList ? res.result.appInfoList.map(item=>{
+                        
+                        return {
+                            appId:item.app_id,
+                            accountId:item.account_id,
+                            label:`${item.platform === 1?'Android应用下载':item.platform === 2?'Android网页游戏':item.platform === 3?'iOS应用下载':'iOS网页游戏'}`
+                                +'\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0'+
+                                item.app_name+'\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0'+item.app_version,
+                            cpaBid:item.cpa_bid?item.cpa_bid/1000:null,
+                            trackUrl:item.track_url
+                        }
+                    }):[]
                     setTimeout(()=>{                       
                         this.form.setFieldsValue({
                              ...res.result,
@@ -3129,10 +3253,11 @@ export default {
                             iosOsv:res.result.iosOsv?res.result.iosOsv:6,
                             url:res.result.url,
                             schemaUri:res.result.schemaUri,
-                            appId:res.result.singleAppid?JSON.parse(res.result.appIdArray)[0]:JSON.parse(res.result.appIdArray),
+                            appId:res.result.singleAppid?JSON.parse(res.result.appIdArray)[0]:JSON.parse(res.result.appIdArray).map(item=>{return {key:item}}),
                             
                             appInterest:res.result.appInterest,
                             roiRatio:res.result.roiRatio?res.result.roiRatio:null,
+                            multipleBids:res.result.multipleBids
                         })
                         
                     },100)