Browse Source

账户配置 BUG 修改

jiayufei 4 năm trước cách đây
mục cha
commit
eb8effd576

+ 2 - 2
src/views/modules/account-config/account-config-server.js

@@ -1,2 +1,2 @@
-export const urlAcount = 'http://118.24.244.213:8080';
-// export const urlAcount = 'http://192.168.1.43:8080';
+// export const urlAcount = 'http://118.24.244.213:8080';
+export const urlAcount = 'http://192.168.1.43:8080';

+ 1 - 0
src/views/modules/account-config/components/configuration-modal.less

@@ -32,6 +32,7 @@
             margin-bottom: 15px;
             .select-orientation-content {
                 margin-left: 198px;
+                margin-top: 20px;
                 width: 440px;
                 border: 1px solid #eee;
                 height: 300px;

+ 64 - 16
src/views/modules/account-config/components/configuration-modal.vue

@@ -325,13 +325,17 @@
                             </a-radio-group>
                         </a-form-model-item>
                         <a-form-model-item label="平台">
+                            <!-- this.platformLoadingType -->
                             <a-radio-group v-model="configForm.adPlatform" button-style="solid">
-                                <a-radio-button value="NONE" :disabled="!!configForm.adDownloadUrl">不限</a-radio-button>
-                                <a-radio-button value="IOS" :disabled="!!configForm.adDownloadUrl">IOS</a-radio-button>
-                                <a-radio-button value="ANDROID">Andriod</a-radio-button>
-                                <a-radio-button value="PC" :disabled="!!configForm.adDownloadUrl">PC</a-radio-button>
+                                <a-radio-button value="NONE" :disabled="platformLoadingType === 'APP_IOS' || platformLoadingType === 'APP_ANDROID'">不限</a-radio-button>
+                                <a-radio-button value="IOS" :disabled="platformLoadingType === 'APP_IOS' || platformLoadingType === 'APP_ANDROID'">IOS</a-radio-button>
+                                <a-radio-button value="ANDROID" :disabled="platformLoadingType === 'APP_IOS' || platformLoadingType === 'APP_ANDROID'">Andriod</a-radio-button>
+                                <a-radio-button value="PC" :disabled="platformLoadingType === 'APP_IOS' || platformLoadingType === 'APP_ANDROID'">PC</a-radio-button>
                             </a-radio-group>
                         </a-form-model-item>
+                        <a-form-model-item label="设备类型">
+                            <radio-check v-model="configForm.adDeviceSelectType" :options="deviceTypeList" @change="getAgeSelect"></radio-check>
+                        </a-form-model-item>
                         <a-form-model-item v-if="configForm.adDownloadUrl" label="安卓版本">
                             <a-radio-group v-model="configForm.adAndroidVersion" button-style="solid" @change="handleAndroidVersion">
                                 <a-radio-button value="NONE">不限</a-radio-button>
@@ -386,8 +390,8 @@
                                 class="common-input-long"
                                 v-model="configForm.adAudiencePackageId"
                                 allow-clear
-                                :placeholder="selectOrientPlaceholder"
-                                :disabled="selectOrientPlaceholder !== '请选择已有定向包名称'"
+                                placeholder="请选择已有定向包名称"
+                                :disabled="selectOrientPlaceholder !== 'able'"
                                 @change="handleSelectiveOrientation"
                             >
                                 <a-select-option
@@ -398,6 +402,9 @@
                                     {{ item.name }}
                                 </a-select-option>
                             </a-select>
+                            <span style="margin-left: 20px;">
+                                <a-button :disabled="selectOrientPlaceholder !== 'able'" type="primary" @click="handleGetAdAudiencePackage">同步定向包</a-button>
+                            </span>
                             <a-tooltip placement="top">
                                 <template slot="title">
                                     <span>已有定向包只展示当前推广目的和投放范围下,定向功能升级后仍可用的定向包</span>
@@ -405,6 +412,7 @@
                                 <a-icon class="form-itrm-icon orientation-icon" type="smile-o"/>
                             </a-tooltip>
                         </a-form-model-item>
+                        <span v-if="selectOrientPlaceholder !== 'able'" style="color: #f00; margin-left: 198px;">{{ selectOrientPlaceholder }}</span>
                         <div class="select-orientation-content">
                             <p class="orientation-header-title">已选定向信息</p>
                             <div v-if="packageMessageDetail.length" class="orientation-content-substance">
@@ -610,7 +618,6 @@
                         class="avatar-uploader"
                         :show-upload-list="false"
                         :before-upload="beforeUpload"
-                        @change="handleChange"
                     >
                         <div v-if="imageUrl" class="upload-img-class" @mouseover="handleChangeActive">
                             <div class="img-flex-url">
@@ -621,7 +628,7 @@
                                 <a-icon class="delete-icon-class" type="delete" @click.stop="handleDeleteImg"/>
                             </div> -->
                         </div>
-                        <div v-if="!imageUrl && !isCoverImgDiv">
+                        <div v-else>
                             <a-icon type="plus" style="margin-top: 10px;"/>
                             <div class="ant-upload-text">Upload</div>
                         </div>
@@ -825,6 +832,20 @@ export default {
             directionalData: [],
             platformLoadingType: '',
             selectPackageTabs: '1',
+            deviceTypeList: [
+                {
+                    value: 'NONE',
+                    label: '不限'
+                },
+                {
+                    value: 'MOBILE',
+                    label: '智能手机'
+                },
+                {
+                    value: 'PAD',
+                    label: '平板'
+                }
+            ],
             adAcList: [
                 {
                     value: 'NONE',
@@ -1048,6 +1069,7 @@ export default {
                 customPerson: 'NONE', // 定向-自定义
                 adSuperiorPopularityType: 'NONE', // 定向-媒体定向
                 adPlatform: 'NONE', // 定向-平台
+                adDeviceSelectType: ['NONE'],
                 adSelectAc: ['NONE'],
                 adAc: '', // 定向-网络
                 adHideIfExists: '0', // 定向-已安装用户
@@ -1083,7 +1105,18 @@ export default {
     },
     computed: {
         selectOrientPlaceholder() {
-            return this.configForm.accountId ? '请选择已有定向包名称' : '请选择广告账户';
+            if (!this.configForm.accountId) {
+                return '请选择账户';
+            }
+            else if (this.configForm.adDownloadType === 'DOWNLOAD_URL' && !this.platformLoadingType) {
+                return '请填写投放内容';
+            }
+            else if (this.configForm.adDownloadType === 'EXTERNAL_URL' && !this.configForm.adExternalUrl) {
+                return '请填写投放内容';
+            }
+            else {
+                return 'able';
+            }
         },
         getEndIndex() {
             return Number(this.configForm.dpLinkStartIndex) + 1;
@@ -1115,6 +1148,7 @@ export default {
                     promotionContent: this.configForm.adDownloadType
                 };
                 this.handleGetOptimizationObjective(paramsData);
+                this.handleGetAdAudiencePackage();
             }
         },
         NewAdPackage(newVal, oldVal) {
@@ -1397,6 +1431,12 @@ export default {
                     if (result.code === 0) {
                         this.configForm.adPackage = result.result.package || '';
                         this.platformLoadingType = result.result.platform || '';
+                        if (result.result.platform && result.result.platform === 'APP_ANDROID') {
+                            this.configForm.adPlatform = 'ANDROID';
+                        }
+                        else if (result.result.platform && result.result.platform === 'APP_IOS') {
+                            this.configForm.adPlatform = 'IOS';
+                        }
                     }
                     else {
                         this.$message.error(result.message);
@@ -1525,7 +1565,6 @@ export default {
                         }, 200);
                         getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getDMPCustomAudience', {accountId: detailData.accountId}).then(result => {
                             if (result.code === 0) {
-                                console.log(result, 'result--8888888888888888888888888888888-result');
                                 result.result.forEach(item => {
                                     item.key = item.custom_audience_id;
                                 });
@@ -1571,6 +1610,7 @@ export default {
                         this.configForm.adLocationType = detailData.adLocationType;
                         this.configForm.adSelectAge = detailData.adAge.split(',');
                         this.configForm.adSelectAc = detailData.adAc.split(',');
+                        this.configForm.adDeviceSelectType = detailData.adDeviceType.split(',');
                         this.configForm.adSuperiorPopularityType = detailData.adSuperiorPopularityType;
                         this.configForm.adPlatform = detailData.adPlatform;
                         this.configForm.adAc = detailData.adAc;
@@ -1604,6 +1644,7 @@ export default {
                         this.imageUrl = detailData.imageUrl;
                         this.urlResult = detailData.imageUrl;
                         this.md5Result = detailData.creativeProductImageCode;
+                        this.handleGetPackage();
                         if (detailData.adAndroidOsv !== 'NONE') {
                             this.configForm.adAndroidVersion = 'a';
                             this.configForm.androidChangeValue = detailData.adAndroidOsv;
@@ -1802,7 +1843,6 @@ export default {
             });
         },
         handleDownloadLink(e) {
-            this.configForm.adPlatform = e.target.value ? 'ANDROID' : 'NONE';
             this.handleGetPackage();
         },
         handleDeleteImg() {
@@ -1825,10 +1865,16 @@ export default {
             const fileOvesize = info.size > (1024 * 1024);
             if (!isZip) {
                 this.$message.error('请上传正确类型的图片');
+                this.imageUrl = '';
+                this.urlResult = '';
+                this.md5Result = '';
                 return;
             }
             if (fileOvesize) {
                 this.$message.error('图片大小不能超过1M');
+                this.imageUrl = '';
+                this.urlResult = '';
+                this.md5Result = '';
                 return;
             }
             new Promise(function (resolve, reject) {
@@ -1843,16 +1889,17 @@ export default {
                 img.src = _URL.createObjectURL(info);
             }).then(() => {
                 this.handleMd5(info);
+                this.getBase64(info, imageUrl => {
+                    this.imageUrl = imageUrl;
+                });
             }, () => {
                 this.$message.error('图片尺寸必须是108*108!');
+                this.imageUrl = '';
+                this.urlResult = '';
+                this.md5Result = '';
                 return Promise.reject();
             });
         },
-        handleChange(info) {
-            this.getBase64(info.file.originFileObj, imageUrl => {
-                this.imageUrl = imageUrl;
-            });
-        },
         cosUpload(file) {
             let that = this;
             let date = new Date();
@@ -2000,6 +2047,7 @@ export default {
             paramsFormData.adCity = paramsFormData.adSelectCity.join(',');
             paramsFormData.adAge = paramsFormData.adSelectAge.join(',');
             paramsFormData.adAc = paramsFormData.adSelectAc.join(',');
+            paramsFormData.adDeviceType = paramsFormData.adDeviceSelectType.join(',');
             paramsFormData.productSellingPoints = this.configForm.defaultFormList && this.configForm.defaultFormList.map(item => item.value);
             paramsFormData.creativeThirdIndustryId = paramsFormData.creativeThirdIndustryIds[2];
             paramsFormData.creativeProductImageCode = this.md5Result;