Explorar o código

账户配置 bug 修复

jiayufei %!s(int64=4) %!d(string=hai) anos
pai
achega
ff134e0f4d

+ 2 - 2
src/utils/request.js

@@ -16,8 +16,8 @@ else if (process.env.NODE_ENV == 'debug') {
 else if (process.env.NODE_ENV == 'production') { 
   
   // axios.defaults.baseURL = 'http://apipre.tjyourong.com.cn/jeecg-boot';//预生产
-  axios.defaults.baseURL = 'http://139.186.165.84:8806/jeecg-boot';     
-  // axios.defaults.baseURL = 'http://api.tjyourong.com.cn/jeecg-boot';//生产环境
+  // axios.defaults.baseURL = 'http://139.186.165.84:8806/jeecg-boot';     
+  axios.defaults.baseURL = 'http://api.tjyourong.com.cn/jeecg-boot';//生产环境
 }
 const service = axios.create({
 //   baseURL: '/jeecg-boot', // api base_url

+ 18 - 1
src/views/modules/account-config/account-config.vue

@@ -104,6 +104,7 @@
                             @blur="handleAccountBudget"
                         /> 元
                     </a-form-model-item>
+                    <div v-if="adBudgetShowTitle" style="width: 500px;color: #f00;margin-left: 140px;">单次修改预算幅度, 不能低于100.0元</div>
                 </a-form-model>
             </div>
         </a-modal>
@@ -228,6 +229,7 @@ export default {
             }
         };
         return {
+            adBudgetShowTitle: false,
             budgetVisible: false,
             budgetForm: {
                 budgetType: '1',
@@ -337,7 +339,19 @@ export default {
             this.budgetForm.budget = 0;
         },
         handleAccountBudget(e) {
-            this.budgetForm.budget = Number(Number(e.target.value).toFixed(2));
+            const adBudgetInput = e.target.value;
+            console.log(this.updateModTxt, 'this.updateModTxt-this.updateModTxt');
+            const changeBudget = this.updateModTxt.accountBudget;
+            this.configForm.budget = Number(Number(adBudgetInput).toFixed(2));
+            if (Number(adBudgetInput) >= Number(changeBudget) && Number(adBudgetInput) < (Number(changeBudget) + 100)) {
+                this.adBudgetShowTitle = true;
+            }
+            else if (Number(adBudgetInput) <= Number(changeBudget) && Number(adBudgetInput) > (Number(changeBudget) - 100)) {
+                this.adBudgetShowTitle = true;
+            }
+            else {
+                this.adBudgetShowTitle = false;
+            }
         },
         handleModeSure() {
             let paramsData = new FormData();
@@ -393,6 +407,9 @@ export default {
             paramsData.append('budgetType', this.budgetForm.budgetType);
             paramsData.append('id', this.updateModTxt.id);
             paramsData.append('cost', this.updateModTxt.cost);
+            if (this.adBudgetShowTitle) {
+                return;
+            }
             this.$refs.budgetForm.validate(valid => {
                 if (valid) {
                     this.handlePopoverChange(paramsData);

+ 11 - 3
src/views/modules/account-config/components/configuration-modal.less

@@ -54,12 +54,20 @@
                 }
                 .orientation-content-substance {
                     height: 310px;
-                    margin: 12px;
+                    overflow-y: auto;
+                    margin: 10px;
                     .content-substance-singal {
-                        height: 28px;
-                        line-height: 28px;
+                        display: flex;
+                        margin-top: 10px;
                         .singal-spn {
                             margin-right: 10px;
+                            display: inline-block;
+                            width: 80px;
+                            text-align: right;
+                        }
+                        .singal-content {
+                            display: inline-block;
+                            width: 80%;
                         }
                     }
                 }

+ 35 - 19
src/views/modules/account-config/components/configuration-modal.vue

@@ -74,6 +74,7 @@
                         @blur="handleAccountBudget"
                     /> 元
                 </a-form-model-item>
+                <div v-if="adBudgetShowTitle" style="width: 500px;color: #f00;margin-left: 140px;">单次修改预算幅度, 不能低于100.0元</div>
             </div>
             <div class="separate-module-con">
                 <p class="rock-title">广告组信息</p>
@@ -428,7 +429,7 @@
                         </a-form-model-item>
                     </a-tab-pane>
                     <a-tab-pane key="2" tab="选择定向包">
-                        <a-form-model-item class="select-orientation-class" label="选择已有定向包" prop="adAudiencePackageId">
+                        <a-form-model-item class="select-orientation-class" label="选择已有定向包" :prop="selectPackageTabs === '2' ? 'adAudiencePackageId' : ''">
                             <a-select
                                 class="common-input-long"
                                 v-model="configForm.adAudiencePackageId"
@@ -461,27 +462,27 @@
                             <div v-if="packageMessageDetail.length" class="orientation-content-substance">
                                 <div class="content-substance-singal">
                                     <span class="singal-spn">定向人群包:</span>
-                                    <span>{{ packageMessageDetail[0].description }}</span>
+                                    <span class="singal-content">{{ packageMessageDetail[0].description }}</span>
                                 </div>
                                 <div class="content-substance-singal">
                                     <span class="singal-spn">地域:</span>
-                                    <span>{{ packageMessageDetail[0].replaceCitys }}</span>
+                                    <span class="singal-content">{{ packageMessageDetail[0].replaceCitys }}</span>
                                 </div>
                                 <div class="content-substance-singal">
                                     <span class="singal-spn">性别:</span>
-                                    <span>{{ packageMessageDetail[0].replaceSex }}</span>
+                                    <span class="singal-content">{{ packageMessageDetail[0].replaceSex }}</span>
                                 </div>
                                 <div class="content-substance-singal">
                                     <span class="singal-spn">年龄:</span>
-                                    <span>{{ packageMessageDetail[0].replaceAge }}</span>
+                                    <span class="singal-content">{{ packageMessageDetail[0].replaceAge }}</span>
                                 </div>
                                 <div class="content-substance-singal">
                                     <span class="singal-spn">平台:</span>
-                                    <span>{{ packageMessageDetail[0].replacePlate }}</span>
+                                    <span class="singal-content">{{ packageMessageDetail[0].replacePlate }}</span>
                                 </div>
                                 <div class="content-substance-singal">
                                     <span class="singal-spn">智能放量:</span>
-                                    <span>{{ packageMessageDetail[0].replaceEnabled }}</span>
+                                    <span class="singal-content">{{ packageMessageDetail[0].replaceEnabled }}</span>
                                 </div>
                             </div>
                             <div v-else class="orientation-content-msg">
@@ -518,8 +519,6 @@
                             @blur="handleAdBudgetBlur"
                         />
                     </a-input-group>
-                    <div v-if="adBudgetShowTitle" style="width: 500px;color: #f00;">单次修改预算幅度, 不能低于100.0元</div>
-                    <span class="especial-label budget-mode-label">*</span>
                 </a-form-model-item>
                 <a-form-model-item label="投放时间">
                     <a-radio-group :disabled="modalTitle === 'edit'" v-model="configForm.adScheduleType" button-style="solid" @change="handleAdScheduleType">
@@ -599,6 +598,7 @@
                             @blur="handleAdMaxBidBlur"
                         /> 元
                     </a-form-model-item>
+                    <div v-if="isAdCpaBidBlur" style="width: 500px;color: #f00;margin-left: 140px;">{{ adCpaBidBlurTxt }}</div>
                 </div>
                 <div v-if="configForm.adBidCreateType === 'STEP'">
                     <a-form-model-item label="目标转化出价" class="dp-link-start" prop="adMinBid">
@@ -624,6 +624,7 @@
                             @blur="handleAdMaxBidBlur"
                         /> 元
                     </a-form-model-item>
+                    <div v-if="isAdCpaBidBlur" style="width: 500px;color: #f00;margin-left: 140px">{{ adCpaBidBlurTxt }}</div>
                     <a-form-model-item label="浮动间隔" prop="adStepBid">
                         <a-input-number
                             class="common-input"
@@ -918,7 +919,7 @@ export default {
                 {
                     value: '4G',
                     label: '4G'
-                },
+                }
             ],
             adHideIfConvertedDataOption: [ // 过滤已转化用户option
                 {
@@ -1284,7 +1285,7 @@ export default {
                 this.configForm.adRetargetingTagsExclude = '';
                 this.configForm.updateGetingExclude = [];
                 this.configForm.adRetargetingTagsType = '';
-                this.configForm.adPlatform = 'NONE';
+                // this.configForm.adPlatform = 'NONE';
                 this.configForm.adDeviceSelectType = ['NONE'];
                 this.configForm.adAndroidVersion = 'NONE';
                 this.configForm.adSelectAc = ['NONE'];
@@ -1335,7 +1336,15 @@ export default {
             this.configForm.adMinBid = Number(Number(e.target.value).toFixed(2));
         },
         handleAdMaxBidBlur(e) {
-            this.configForm.adMaxBid = Number(Number(e.target.value).toFixed(2));
+            const defaultValue = e.target.value;
+            this.configForm.adMaxBid = Number(Number(defaultValue).toFixed(2));
+            if (this.configForm.adBudget > 0 && defaultValue > this.configForm.adBudget) {
+                this.isAdCpaBidBlur = true;
+                this.adCpaBidBlurTxt = '出价不能大于预算';
+            }
+            else {
+                this.isAdCpaBidBlur = false;
+            }
         },
         handleDirectionalList() {
             const paramsData = {
@@ -1441,6 +1450,7 @@ export default {
             this.configForm.adMinBid = '';
             this.configForm.adMaxBid = '';
             this.configForm.adStepBid = 0;
+            this.isAdCpaBidBlur = false;
             this.$refs['ruleForm'].clearValidate(['adMinBid']);
             this.$refs['ruleForm'].clearValidate(['adMaxBid']);
         },
@@ -1513,6 +1523,10 @@ export default {
             else {
                 this.isAdCpaBidBlur = false;
             }
+        },
+        handleAccountBudget(e) {
+            const adBudgetInput = e.target.value;
+            this.configForm.accountBudget = Number(Number(adBudgetInput).toFixed(2));
             if (this.modalTitle === 'edit') {
                 if (Number(adBudgetInput) >= Number(this.defaultAdBudget) && Number(adBudgetInput) < (Number(this.defaultAdBudget) + 100)) {
                     this.adBudgetShowTitle = true;
@@ -1525,9 +1539,6 @@ export default {
                 }
             }
         },
-        handleAccountBudget(e) {
-            this.configForm.accountBudget = Number(Number(e.target.value).toFixed(2));
-        },
         handleExportRules(value, min, max, callback) {
             let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/;
             let length = 0;
@@ -1686,13 +1697,17 @@ export default {
                         this.configForm.campaignCnt = detailData.campaignCnt || '';
                         this.configForm.campaignAdCnt = detailData.campaignAdCnt || '';
                         this.configForm.launchTarget = detailData.launchTarget || 'OCPM';
-                        this.configForm.adDownloadType = detailData.adDownloadType || 'DOWNLOAD_URL';
+                        this.configForm.adDownloadType = detailData.adDownloadType;
+                        this.configForm.adPlatform = detailData.adPlatform;
                         this.configForm.adExternalUrl = detailData.adExternalUrl || '';
                         this.configForm.adOpenUrl = detailData.adOpenUrl || '';
                         this.configForm.adDownloadUrl = detailData.adDownloadUrl || '';
                         this.configForm.adPackage = detailData.adPackage || '';
                         this.configForm.adConvertType = detailData.adConvertType || '';
                         this.configForm.adDistrict = detailData.adDistrict || 'NONE';
+                        if (detailData.adDownloadType === 'DOWNLOAD_URL') {
+                            this.handleGetPackage();
+                        }
                         setTimeout(() => {
                             this.listArr = detailData.adCity.split(',');
                             this.configForm.adSelectCity = detailData.adCity.split(',');
@@ -1743,7 +1758,6 @@ export default {
                         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;
                         this.configForm.adHideIfExists = String(detailData.adHideIfExists);
                         this.configForm.adHideIfConverted = detailData.adHideIfConverted;
@@ -1751,7 +1765,7 @@ export default {
                         this.configForm.adSmartBidType = detailData.adSmartBidType;
                         this.configForm.adBudgetMode = detailData.adBudgetMode;
                         this.configForm.adBudget = detailData.adBudget;
-                        this.defaultAdBudget = detailData.adBudget;
+                        this.defaultAdBudget = detailData.accountBudget;
                         this.configForm.adScheduleType = detailData.adScheduleType;
                         this.configForm.launchDateRange[0] = detailData.adStartTime;
                         this.configForm.launchDateRange[1] = detailData.adEndTime;
@@ -1775,7 +1789,6 @@ 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;
@@ -2103,6 +2116,9 @@ export default {
         },
         handleRelaxSure() {
             let paramsFormData = this.configForm;
+            if (this.adBudgetShowTitle) {
+                return;
+            }
             if (this.configForm.adDistrict === 'CITY') {
                 if (!this.configForm.adSelectCity.length) {
                     this.$message.error('请选择省市');