广告内容调整

This commit is contained in:
yulixing 2019-09-16 15:24:45 +08:00
parent c56262a04b
commit 82c1b3dd38
6 changed files with 31 additions and 74 deletions

View File

@ -176,6 +176,7 @@ export default {
// other
exportData() {
this.$emit('selectMaterial', this.selectedData)
console.log(this.selectedData)
},
beforeUpload(file) {
const isLt600k = file.size / 1024 / 1024 < 0.6
@ -191,7 +192,15 @@ export default {
user: this.username,
})
this.$message.success('图片上传成功!')
this.getData({user: this.username})
if(this.useAsCom) {
this.imgList.unshift({url: res.message.url})
this.selectedData.imgs = [{url: res.message.url}]
this.imgsSelected = [0]
} else {
this.getData({user: this.username})
}
},
uploadErr() {
this.$message.error('图片上传失败!')

View File

@ -61,17 +61,6 @@ export const constantRoutes = [
// comRouter,
// adminRouter,
errRouter,
// TODO: 添加granfa 外链
// {
// path: 'external-link',
// component: Layout,
// children: [
// {
// path: 'https://github.com/PanJiaChen/vue-element-admin',
// meta: {title: 'externalLink', icon: 'link'},
// },
// ],
// },
userRouter,
]

View File

@ -66,6 +66,7 @@
placeholder="请选择要投放的广告位置"
class="w100"
:disabled="!writeable"
multiple
>
<el-option
:label="item.label"
@ -184,6 +185,7 @@
type="primary"
size="mini"
@click="openModal"
:disabled="!writeable"
>选择图片</el-button>
</el-form-item>
<el-form-item
@ -268,6 +270,16 @@
>
</el-switch>
</el-form-item>
<el-form-item
label="显示人数"
prop="ad_property.played"
>
<el-input
v-model.number="adForm.ad_property.played"
class="w100"
:disabled="!writeable"
/>
</el-form-item>
<el-form-item>
<el-button
@ -363,7 +375,6 @@ export default {
gameList: [],
platformList: [],
locationList: [],
areaList: {},
typeList: {},
modeList: {},
uploadUrl: `${process.env.VUE_APP_UPLOAD}`,
@ -372,7 +383,7 @@ export default {
name: '',
gameid: '',
channelid: '',
locationid: '',
locationid: [],
ad_title: '',
ad_body: '',
ad_image: '',
@ -392,6 +403,7 @@ export default {
is_recommend: 0,
appid: '',
jump_param: '',
played: 0,
}, //
},
adFormRules: {
@ -402,7 +414,6 @@ export default {
],
locationid: [
{required: true, message: '请选择投放位置', trigger: 'blur'},
{type: 'number', message: '投放位置必须是数值', trigger: 'blur'},
],
ad_image: [
{required: true, message: '请上传广告头像', trigger: 'blur'},
@ -445,11 +456,6 @@ export default {
this.modeList = modeList
this.typeList = typeList
const areaListRes = await this.getAdAreaList()
areaListRes.adAreaList.map(item => {
this.areaList[item.area_id] = item.name
})
//
const allGame = await this.getGameList()
this.allGame = allGame.gameList
@ -493,9 +499,12 @@ export default {
is_recommend: 0,
appid: '',
jump_param: '',
played: 0,
}
}
this.adForm.locationid = JSON.parse(this.adForm.locationid)
//
if (!this.adForm.ad_property.jump_param) {
this.adForm.ad_property.jump_param = this.adForm.jump_param
@ -651,9 +660,7 @@ export default {
const area = item.area.split(',')
return {
id: item.id,
label: `${this.areaList[area[0]]}-(${area[1]},${area[2]})-${
this.modeList[item.mode]
}`,
label: `${JSON.parse(item.ld_property).title}`,
}
})
},
@ -681,6 +688,7 @@ export default {
}
this.adForm.ad_property = JSON.stringify(this.adForm.ad_property)
this.adForm.locationid = JSON.stringify(this.adForm.locationid)
this.adForm.begin_time = this.adForm.dateRange[0]
this.adForm.end_time = this.adForm.dateRange[1]

View File

@ -104,12 +104,6 @@
:formatter="formPlatform"
show-overflow-tooltip
/>
<el-table-column
prop="area"
label="投放位置"
:formatter="formLocation"
show-overflow-tooltip
/>
<el-table-column
prop="jump_status"
label="是否跳转"
@ -227,7 +221,6 @@ export default {
gameList: {},
platformList: {},
locationList: {},
areaList: {},
typeList: {},
modeList: {},
sortList: {
@ -261,10 +254,6 @@ export default {
this.modeList = modeList
this.typeList = typeList
const areaListRes = await this.getAdAreaList()
areaListRes.adAreaList.map(item => {
this.areaList[item.area_id] = item.name
})
const gameListRes = await this.getGameList()
const gameList = gameListRes.gameList
@ -294,19 +283,6 @@ export default {
})
})
},
getAdAreaList(params) {
return new Promise((resolve, reject) => {
getAdAreaList(params)
.then(res => {
const data = res.data
resolve(data)
})
.catch(err => {
reject(err)
console.log(err)
})
})
},
getAdPos(params) {
return new Promise((resolve, reject) => {
getAdPos(params)
@ -420,13 +396,6 @@ export default {
formPlatform(row, column, cellValue, index) {
return `${this.platformList[cellValue]}`
},
formLocation(row, column, cellValue, index) {
const area = cellValue.split(',')
return `${this.areaList[area[0]]}-(${area[1]},${area[2]})-${
this.modeList[row.mode]
}`
},
formJump(row, column, cellValue, index) {
return cellValue === 1 ? '是' : '否'
},

View File

@ -115,12 +115,6 @@
:formatter="formGame"
show-overflow-tooltip
/>
<el-table-column
prop="area"
label="投放位置"
:formatter="formLocation"
show-overflow-tooltip
/>
<el-table-column
prop="jump_status"
label="跳转"
@ -231,7 +225,7 @@
<script>
import { getAd, updateAd, delAd, getAdPos, getAdAreaList } from '@/api/ad'
import { getGameList } from '@/api/game'
import { areaList, typeList, modeList } from '@/utils/ad-data'
import { typeList, modeList } from '@/utils/ad-data'
import { Promise, reject } from 'q'
import moment from 'moment'
@ -243,7 +237,6 @@ export default {
gameList: {},
platformList: {},
locationList: {},
areaList: {},
typeList: {},
modeList: {},
sortList: {
@ -277,11 +270,6 @@ export default {
this.modeList = modeList
this.typeList = typeList
const areaListRes = await this.getAdAreaList()
areaListRes.adAreaList.map(item => {
this.areaList[item.area_id] = item.name
})
const gameListRes = await this.getGameList()
const gameList = gameListRes.gameList
@ -529,12 +517,6 @@ export default {
formSort(row, column, cellValue, index) {
return `${this.sortList[cellValue]}`
},
formLocation(row, column, cellValue, index) {
const area = cellValue.split(',')
return `${this.areaList[area[0]]}-(${area[1]},${area[2]})-${
this.modeList[row.mode]
}`
},
formJump(row, column, cellValue, index) {
return cellValue === 1 ? '是' : '否'
},

View File

@ -40,7 +40,7 @@ module.exports = {
// change xxx-api/login => mock/login
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://154.8.214.202:5015/interface`,
target: `http://154.8.214.202:6015/interface`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '',