|
@@ -18,9 +18,13 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view class="module">
|
|
<view class="module">
|
|
|
<text class="module-title ">投放区域</text>
|
|
<text class="module-title ">投放区域</text>
|
|
|
- <u-form-item label="省市区" prop="district" :label-width="100" required :border-bottom="false">
|
|
|
|
|
- <u-input v-model="queryTreeValue" type="select" :select-open="queryTreeShow"
|
|
|
|
|
- @click="queryTreeShow=true" :custom-style="{textAlign:'right'}" placeholder="请选择"></u-input>
|
|
|
|
|
|
|
+ <u-form-item label="门店地址" prop="address" required :border-bottom="false">
|
|
|
|
|
+ <u-input v-model="adForm.address" type="textarea" disabled
|
|
|
|
|
+ :custom-style="{textAlign:'right'}"></u-input>
|
|
|
|
|
+ </u-form-item>
|
|
|
|
|
+ <u-form-item label="投放范围" prop="coverageArea" required :border-bottom="false">
|
|
|
|
|
+ <u-input v-model="adForm.coverageArea" type="number" :custom-style="{textAlign:'right'}"></u-input>
|
|
|
|
|
+ <text class="ml-1">公里</text>
|
|
|
</u-form-item>
|
|
</u-form-item>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="module">
|
|
<view class="module">
|
|
@@ -207,9 +211,6 @@
|
|
|
提交审核
|
|
提交审核
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <!-- 省市区 -->
|
|
|
|
|
- <u-select v-model="queryTreeShow" mode="mutil-column-auto" label-name="areaCname" value-name="areaCode"
|
|
|
|
|
- child-name="children" :list="queryTreeList" @confirm="queryTreeConfirm"></u-select>
|
|
|
|
|
<!-- 广告位 -->
|
|
<!-- 广告位 -->
|
|
|
<u-select v-model="adSlotShow" mode="single-column" label-name="positionName" value-name="id" :list="adSlotList"
|
|
<u-select v-model="adSlotShow" mode="single-column" label-name="positionName" value-name="id" :list="adSlotList"
|
|
|
@confirm="adSlotConfirm"></u-select>
|
|
@confirm="adSlotConfirm"></u-select>
|
|
@@ -234,6 +235,10 @@
|
|
|
ACCESS_TOKEN,
|
|
ACCESS_TOKEN,
|
|
|
USER_INFO
|
|
USER_INFO
|
|
|
} from '@/common/util/constants.js'
|
|
} from '@/common/util/constants.js'
|
|
|
|
|
+ import {
|
|
|
|
|
+ getCity,
|
|
|
|
|
+ findCityCodeByCname
|
|
|
|
|
+ } from './parseAddress.js' //地址解析函数
|
|
|
import configService from '@/common/service/config.service'
|
|
import configService from '@/common/service/config.service'
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
@@ -267,14 +272,7 @@
|
|
|
positionName: "", //广告位name
|
|
positionName: "", //广告位name
|
|
|
startDate: "", //投放开始时间
|
|
startDate: "", //投放开始时间
|
|
|
endDate: "", //投放结束时间
|
|
endDate: "", //投放结束时间
|
|
|
- province: "", //省
|
|
|
|
|
- provinceCode: "",
|
|
|
|
|
city: "", //市
|
|
city: "", //市
|
|
|
- cityCode: "",
|
|
|
|
|
- district: "", //区
|
|
|
|
|
- districtCode: "",
|
|
|
|
|
- street: "", //街道
|
|
|
|
|
- streetCode: "",
|
|
|
|
|
validPeriodType: "", //生效周期
|
|
validPeriodType: "", //生效周期
|
|
|
validPeriodValue: "", //周期策略
|
|
validPeriodValue: "", //周期策略
|
|
|
validTimeRangeType: "", //生效时段类型
|
|
validTimeRangeType: "", //生效时段类型
|
|
@@ -289,6 +287,10 @@
|
|
|
adBudget: "", //广告预算
|
|
adBudget: "", //广告预算
|
|
|
merchantId: "", //商户id
|
|
merchantId: "", //商户id
|
|
|
merchantName: "", //商户name
|
|
merchantName: "", //商户name
|
|
|
|
|
+ address: "",
|
|
|
|
|
+ longitude: "", //经度
|
|
|
|
|
+ latitude: "", //维度
|
|
|
|
|
+ coverageArea: 0, //范围
|
|
|
},
|
|
},
|
|
|
timeSegmentStart: "", //生效时段开始
|
|
timeSegmentStart: "", //生效时段开始
|
|
|
timeSegmentEnd: "", //生效时段结束
|
|
timeSegmentEnd: "", //生效时段结束
|
|
@@ -443,7 +445,7 @@
|
|
|
await this.queryAdSlot(); // 获取广告位数据
|
|
await this.queryAdSlot(); // 获取广告位数据
|
|
|
this.generateWeek();
|
|
this.generateWeek();
|
|
|
this.generatemonth();
|
|
this.generatemonth();
|
|
|
-
|
|
|
|
|
|
|
+ this.storeDetail();
|
|
|
},
|
|
},
|
|
|
onReady() {
|
|
onReady() {
|
|
|
this.$refs.uForm.setRules(this.adrules);
|
|
this.$refs.uForm.setRules(this.adrules);
|
|
@@ -455,6 +457,20 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 门店
|
|
|
|
|
+ async storeDetail() {
|
|
|
|
|
+ let id = uni.getStorageSync(USER_INFO).merchantId;
|
|
|
|
|
+ let res = await this.$http.get("/merchant/localMerchantInfo/queryAppInfoById?id=" + id)
|
|
|
|
|
+ if (res.data.success) {
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ this.adForm.address = res.data.result.address;
|
|
|
|
|
+ this.adForm.longitude = Number(res.data.result.longitude);
|
|
|
|
|
+ this.adForm.latitude = Number(res.data.result.latitude);
|
|
|
|
|
+ const addressResult = getCity(this.adForm.address); //截取城市
|
|
|
|
|
+ const cityCode = findCityCodeByCname(addressResult, this.queryTreeList) // 查找城市code
|
|
|
|
|
+ this.adForm.city = cityCode;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
submit() {
|
|
submit() {
|
|
|
if (this.adForm.validTimeRangeType == '1' && this.timeSegmentStart && this.timeSegmentEnd) {
|
|
if (this.adForm.validTimeRangeType == '1' && this.timeSegmentStart && this.timeSegmentEnd) {
|
|
|
this.adForm.validTimeRangeValue = this.timeSegmentStart + "," + this.timeSegmentEnd;
|
|
this.adForm.validTimeRangeValue = this.timeSegmentStart + "," + this.timeSegmentEnd;
|
|
@@ -558,7 +574,7 @@
|
|
|
this.$http.get('/adPricingPrice/queryPageList', {
|
|
this.$http.get('/adPricingPrice/queryPageList', {
|
|
|
params: {
|
|
params: {
|
|
|
adPositionId: this.adForm.positionId,
|
|
adPositionId: this.adForm.positionId,
|
|
|
- city: this.adForm.cityCode,
|
|
|
|
|
|
|
+ city: this.adForm.city,
|
|
|
pageNo: 1,
|
|
pageNo: 1,
|
|
|
pageSize: 1000,
|
|
pageSize: 1000,
|
|
|
}
|
|
}
|
|
@@ -628,19 +644,6 @@
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- //省市区选择事件
|
|
|
|
|
- queryTreeConfirm(value) {
|
|
|
|
|
- this.queryTreeValue = `${value[0].label}-${value[1].label}-${value[2].label}-${value[3].label}`
|
|
|
|
|
- this.adForm.provinceCode = value[0].value;
|
|
|
|
|
- this.adForm.cityCode = value[1].value;
|
|
|
|
|
- this.adForm.districtCode = value[2].value;
|
|
|
|
|
- this.adForm.streetCode = value[3].value;
|
|
|
|
|
- this.adForm.province = value[0].label;
|
|
|
|
|
- this.adForm.city = value[1].label;
|
|
|
|
|
- this.adForm.district = value[2].label;
|
|
|
|
|
- this.adForm.street = value[3].label;
|
|
|
|
|
- this.getadBillingModel() //获取计费方式
|
|
|
|
|
- },
|
|
|
|
|
//广告位选择后续操作
|
|
//广告位选择后续操作
|
|
|
adSlotConfirm(value) {
|
|
adSlotConfirm(value) {
|
|
|
let info = this.adSlotList.find(val => val.id == value[0].value).supportMaterial.split(','); //获取投放内容类型
|
|
let info = this.adSlotList.find(val => val.id == value[0].value).supportMaterial.split(','); //获取投放内容类型
|
|
@@ -658,6 +661,7 @@
|
|
|
this.adForm.imageType = info[0];
|
|
this.adForm.imageType = info[0];
|
|
|
this.adForm.positionId = value[0].value;
|
|
this.adForm.positionId = value[0].value;
|
|
|
this.adForm.positionName = value[0].label;
|
|
this.adForm.positionName = value[0].label;
|
|
|
|
|
+ this.getadBillingModel() //获取计费方式
|
|
|
},
|
|
},
|
|
|
//日期选择
|
|
//日期选择
|
|
|
startDateChange(e) {
|
|
startDateChange(e) {
|