Commit 7c13269a by caoyanzhi

Merge branch 'feature/游戏营销'

# Conflicts:
#	src/views/ai/task/components/defineTime.vue
parents 7940e4b7 d413620a
<template>
<div class="defineTime">
<p class="tips">自定义时段不少于4个小时</p>
<p class="tips">自定义时段不少于2个小时</p>
<el-form :model="form" ref="defineTime">
<div class="flex" v-for="(v, i) in form.timeRangeList" :key="i">
<el-form-item class="mt10" :prop="'timeRangeList.' + i + '.startTime'" :rules="[{ validator: validateTime(i) }, { validator: validateStarTime(v, i) }]">
<el-time-select
placeholder="起始时间"
v-model="v.startTime"
@change="$emit('change')"
:picker-options="{
start: '09:00',
step: '00:30',
......@@ -21,7 +20,6 @@
<el-time-select
placeholder="结束时间"
v-model="v.endTime"
@change="$emit('change')"
:picker-options="{
start: '09:00',
step: '00:30',
......@@ -126,7 +124,7 @@ export default {
}
this.form.timeRangeList.push({});
},
// 提交时校验是否超过4小时
// 提交时校验是否超过2小时
handleCallTime() {
let minutes = 0;
this.form.timeRangeList.forEach(item => {
......@@ -134,8 +132,8 @@ export default {
let start = new Date(new Date().toLocaleDateString() + ' ' + item.startTime).getTime();
minutes = (end - start) / 60000 + minutes;
});
if (minutes < 240) {
this.$message.error('自定义时段不少于4个小时');
if (minutes < 120) {
this.$message.error('自定义时段不少于2个小时');
return false;
} else {
return true;
......@@ -143,11 +141,8 @@ export default {
},
submit() {
return new Promise(resolve => {
if (!this.handleCallTime()) {
resolve(false);
return;
}
this.$refs.defineTime.validate((val, obj) => {
this.handleCallTime();
this.$refs.defineTime.validate(val => {
if (val) {
resolve(this.form);
} else {
......
......@@ -379,7 +379,6 @@ export default {
const { result } = res;
this.$message.success('发布成功');
this.getLink(result);
this.$route.meta.refresh = true;
}
})
.finally(_ => {
......@@ -414,10 +413,12 @@ export default {
editRenew() {
window.location.href = window.location.origin + `/marketing/#/game/cmh/edit/${this.gameId}`;
window.location.reload();
// this.$router.push(`/game/cmh/edit/${this.gameId}`);
},
goList() {
window.close();
if (this.isAdd) {
this.$route.meta.refresh = true;
}
this.$router.push('/game/cmh');
}
}
};
......
......@@ -94,6 +94,7 @@ import links from '../common/links';
import { formatDateTimeByType } from '@/utils/index.js';
import img from '@/assets/img/template1/mould_share_page.png';
import dmDropdown from '@/components/dm-drop-down/dm-drop-down';
export default {
components: {
dmDropdown,
......@@ -257,10 +258,6 @@ export default {
}
next();
},
destroyed() {
const data = { dateTime: this.dateTime, listParams: this.listParams };
sessionStorage.setItem('listParams', JSON.stringify(data));
},
methods: {
goDetail() {
window.open('https://www.yuque.com/exnmlu/hpbb1c/yf16om');
......@@ -325,6 +322,8 @@ export default {
this.listParams.endTime = '';
}
this.loading = true;
const data = { dateTime: this.dateTime, listParams: this.listParams };
sessionStorage.setItem('listParams', JSON.stringify(data));
cmhPage(this.listParams)
.then(res => {
this.tableList = res.result.list || [];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment