zhuxinbo 5 年 前
コミット
4d2046db40

+ 27 - 8
src/views/modules/kuaishouapp/account/editGroup.vue

@@ -217,16 +217,32 @@
           }}
         </span>
       </a-form-item>
-      <a-form-item
+            <a-form-item
         label="场景广告位"
         :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
-        :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
+        :wrapperCol="{ lg: { span: 17 }, sm: { span: 17 } }"
       >
         <!-- v-decorator="['speed', { initialValue: '1' }]" -->
-        <a-radio-group buttonStyle="solid" v-decorator="['sceneId', { initialValue: '2' }]">
-          <a-radio-button value="2">信息流广告</a-radio-button>
+        <a-radio-group buttonStyle="solid" v-decorator="['sceneId', { initialValue: '1' }]">
           <a-radio-button value="1">优选广告位</a-radio-button>
+          <a-radio-button value="2">按场景选择广告位</a-radio-button>
         </a-radio-group>
+        <!-- getData('speed') == '2' -->
+        <br>
+       
+      </a-form-item>
+       <a-form-item
+        label=" "
+        :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
+        :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
+        class="else-label"
+        v-if="getData('sceneId') == '2'"
+      >
+        <a-checkbox-group :defaultValue="[7]" v-model="allForm.sceneId">
+            <a-checkbox :value="7">信息流广告</a-checkbox>
+            <a-checkbox :value="6">上下滑大屏广告</a-checkbox>
+            <a-checkbox :value="3">视频播放页广告</a-checkbox>
+        </a-checkbox-group>
       </a-form-item>
       <div style="text-align:center;font-size:16px">优化目标和计费</div>
       <a-form-item
@@ -437,7 +453,8 @@ export default {
         group: [],
         groupTypeData: null,
         fail: [],
-        success: []
+        success: [],
+        sceneId:[7]
       },
       dataList: [],
       unitId: ''
@@ -634,6 +651,9 @@ export default {
         if (res.success) {
           var dataJson = { ...res.result.baseInfo, ...res.result.appInfo, ...res.result.target }
           dataJson.dayBudget = dataJson.dayBudget / 1000
+          dataJson.sceneId = JSON.parse( dataJson.sceneId )[0] == '1'? '1':'2'
+          this.allForm.sceneId = JSON.parse( dataJson.sceneId )[0] == '1'? [7]:JSON.parse( res.result.baseInfo.sceneId )
+          console.log(this.allForm.sceneId)
           this.allForm.dayBudget = dataJson.dayBudget == 0 ? '0' : '1'
           this.allForm.time = dataJson.endTime ? '2' : '1'
           this.timeRange = [moment(dataJson.beginTime), moment(dataJson.endTime)]
@@ -693,9 +713,8 @@ export default {
           this.populationData.allForm.noGenderBreak = dataJson.noGenderBreak + ''
           this.populationData.allForm.noAreaBreak = dataJson.noAreaBreak + ''
 
-          console.log(this.populationData.allForm, dataJson.agesRange)
           this.$nextTick(() => {
-            this.form.setFieldsValue(pick(dataJson, ['appId', 'urlType', 'url', 'dayBudget', 'speed', 'showMode']))
+            this.form.setFieldsValue(pick(dataJson, ['appId', 'urlType', 'url', 'dayBudget', 'speed', 'showMode','sceneId']))
           })
         }
       })
@@ -720,7 +739,7 @@ export default {
               bidType: item.bidType == '1' ? '2' : '6'
             }
           })[0]
-          var json = { ...values, sceneId: [values.sceneId], dayBudget: values.dayBudget * 1000 }
+          var json = { ...values, sceneId: values.sceneId==1?[values.sceneId]:this.allForm.sceneId, dayBudget: values.dayBudget * 1000 }
           var params = {
             ...this.populationData,
             ...json,

+ 18 - 9
src/views/modules/kuaishouapp/account/stepForm/Step2.vue

@@ -220,7 +220,7 @@
       <a-form-item
         label="场景广告位"
         :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
-        :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
+        :wrapperCol="{ lg: { span: 17 }, sm: { span: 17 } }"
       >
         <!-- v-decorator="['speed', { initialValue: '1' }]" -->
         <a-radio-group buttonStyle="solid" v-decorator="['sceneId', { initialValue: '1' }]">
@@ -228,12 +228,20 @@
           <a-radio-button value="2">按场景选择广告位</a-radio-button>
         </a-radio-group>
         <!-- getData('speed') == '2' -->
-        <a-checkbox-group @change="onChange">
-            <a-row>
-                <a-col :span="8"><a-checkbox value="A">信息流广告</a-checkbox></a-col>
-                <a-col :span="8"><a-checkbox value="B">上下滑大屏广告</a-checkbox></a-col>
-                <a-col :span="8"><a-checkbox value="C">视频播放页广告</a-checkbox></a-col>
-            </a-row>
+        <br>
+       
+      </a-form-item>
+       <a-form-item
+        label=" "
+        :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
+        :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
+        class="else-label"
+        v-if="getData('sceneId') == '2'"
+      >
+        <a-checkbox-group :defaultValue="[7]" v-model="allForm.sceneId">
+            <a-checkbox :value="7">信息流广告</a-checkbox>
+            <a-checkbox :value="6">上下滑大屏广告</a-checkbox>
+            <a-checkbox :value="3">视频播放页广告</a-checkbox>
         </a-checkbox-group>
       </a-form-item>
       <div style="text-align:center;font-size:16px">优化目标和计费</div>
@@ -525,7 +533,8 @@ export default {
         group: [],
         groupTypeData: null,
         fail: [],
-        success: []
+        success: [],
+        sceneId:[7]
       },
       dataList: []
     }
@@ -764,7 +773,7 @@ export default {
               bidType: item.bidType == '1' ? '2' : '6'
             }
           })
-          var json = { ...values, sceneId: [values.sceneId], dayBudget: values.dayBudget * 1000 }
+          var json = { ...values, sceneId: values.sceneId==1?[values.sceneId]:this.allForm.sceneId, dayBudget: values.dayBudget * 1000 }
           var params = {
             ...this.populationData,
             ...json,

+ 31 - 22
src/views/modules/kuaishouapp/account/stepForm/stepModule/selectRegion.vue

@@ -191,35 +191,44 @@ export default {
     dataValue: {
       immediate: true, // immediate选项可以开启首次赋值监听
       handler(n, o) {
-        this.getData()
-        if (n.length > 0) {
-          this.checkData = n
-          this.checkMatched = n.map(item => {
-            return item.value
-          })
-          this.checkMatchedCity = n.map(item => {
-            return item.value
-          })
-          this.$emit('update:checkData', this.checkData)
-        }
+        this.getData().then(()=>{
+          if (n.length > 0) {
+            this.checkData = n
+            this.checkMatched = n.map(item => {
+              return item.value
+            })
+            this.checkMatchedCity = n.map(item => {
+              return item.value
+            })
+            this.$emit('update:checkData', this.checkData)
+          }
+        })
+        
       }
     }
   },
   methods: {
     getData() {
-      this.loading = true
-      getProvince(this.CityData, { level: 1 }).then(res => {
-        if (res.code == '0') {
-          //   this.province.push(...res.result.records)
-          this.province = res.result.map(item => {
-            return {
-              label: item.name,
-              value: item.regionId
+        this.loading = true
+        return new Promise(function(resolve, reject) {
+          getProvince(this.CityData, { level: 1 }).then(res => {
+            if (res.code == '0') {
+            //   this.province.push(...res.result.records)
+                this.province = res.result.map(item => {
+                    return {
+                    label: item.name,
+                    value: item.regionId
+                    }
+                })
+                this.province = this.province.filter(item=>{
+                    return item.label != '台湾'&&item.label != '香港'&&item.label != '澳门'
+                })
+                this.loading = false
+                resolve()
             }
           })
-          this.loading = false
-        }
-      })
+        })
+      
     },
     showCity(item, index) {
       this.city = []

+ 2 - 2
vue.config.js

@@ -65,8 +65,8 @@ module.exports = {
        },*/
       '/jeecg-boot': {
         // target: 'http://39.97.120.42:8080', //请求本地 需要jeecg-boot后台项目  生产环境
-        // target: 'http://39.106.184.70:8080', //请求本地 需要jeecg-boot后台项目
-        target: 'http://192.168.1.13:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
+        target: 'http://39.106.184.70:8080', //请求本地 需要jeecg-boot后台项目
+        // target: 'http://192.168.1.13:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
         // target: 'http://192.168.2.109:8080', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.1.103:8080', //请求本地 需要jeecg-boot后台项目
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云