|
|
@ -183,7 +183,7 @@ |
|
|
<FormItem label="期号"><Input v-model="poolForm.periodNo" /></FormItem> |
|
|
<FormItem label="期号"><Input v-model="poolForm.periodNo" /></FormItem> |
|
|
<FormItem label="标题"><Input v-model="poolForm.title" /></FormItem> |
|
|
<FormItem label="标题"><Input v-model="poolForm.title" /></FormItem> |
|
|
<FormItem label="奖池金额"><InputNumber v-model="poolForm.poolAmount" :min="0" style="width:100%" /></FormItem> |
|
|
<FormItem label="奖池金额"><InputNumber v-model="poolForm.poolAmount" :min="0" style="width:100%" /></FormItem> |
|
|
<FormItem label="开奖时间"><DatePicker type="datetime" v-model="poolForm.drawTime" format="yyyy-MM-dd HH:mm:ss" style="width:100%" /></FormItem> |
|
|
<FormItem label="开奖时间"><Input v-model="poolForm.drawTime" disabled placeholder="固定每天22:00开奖" /></FormItem> |
|
|
<FormItem label="状态"> |
|
|
<FormItem label="状态"> |
|
|
<Select v-model="poolForm.status"> |
|
|
<Select v-model="poolForm.status"> |
|
|
<Option :value="0">进行中</Option> |
|
|
<Option :value="0">进行中</Option> |
|
|
@ -879,14 +879,18 @@ |
|
|
loadAdventureSession() { if (!this.guardRegion('adventureSession')) return; this.adventureSession.loading = true; planetAdventureSessionPage(this.baseParams('adventureSession')).then(r => this.fill('adventureSession', r)) }, |
|
|
loadAdventureSession() { if (!this.guardRegion('adventureSession')) return; this.adventureSession.loading = true; planetAdventureSessionPage(this.baseParams('adventureSession')).then(r => this.fill('adventureSession', r)) }, |
|
|
// ---- 奖池 ---- |
|
|
// ---- 奖池 ---- |
|
|
openPool(row) { |
|
|
openPool(row) { |
|
|
this.poolForm = row ? Object.assign({}, row) : { regionId: this.regionId || '', poolAmount: 88.88, status: 0 } |
|
|
this.poolForm = row ? Object.assign({}, row) : { |
|
|
|
|
|
regionId: this.regionId || '', |
|
|
|
|
|
poolAmount: 0, |
|
|
|
|
|
drawTime: this.defaultDrawTime(), |
|
|
|
|
|
status: 0 |
|
|
|
|
|
} |
|
|
|
|
|
if (this.poolForm.status !== 1) this.poolForm.drawTime = this.defaultDrawTime(this.poolForm.drawTime) |
|
|
this.poolModal = true |
|
|
this.poolModal = true |
|
|
}, |
|
|
}, |
|
|
savePool() { |
|
|
savePool() { |
|
|
const form = Object.assign({}, this.poolForm) |
|
|
const form = Object.assign({}, this.poolForm) |
|
|
if (form.drawTime instanceof Date) { |
|
|
if (form.status !== 1) form.drawTime = this.defaultDrawTime(form.drawTime) |
|
|
form.drawTime = this.fmt(form.drawTime) |
|
|
|
|
|
} |
|
|
|
|
|
planetPoolSave(form).then(r => { |
|
|
planetPoolSave(form).then(r => { |
|
|
if (r && r.success) { |
|
|
if (r && r.success) { |
|
|
this.$Message.success('保存成功') |
|
|
this.$Message.success('保存成功') |
|
|
@ -1047,6 +1051,16 @@ |
|
|
fmt(d) { |
|
|
fmt(d) { |
|
|
const p = n => (n < 10 ? '0' + n : n) |
|
|
const p = n => (n < 10 ? '0' + n : n) |
|
|
return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}` |
|
|
return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}` |
|
|
|
|
|
}, |
|
|
|
|
|
defaultDrawTime(value) { |
|
|
|
|
|
let d = value instanceof Date ? value : new Date() |
|
|
|
|
|
if (!(value instanceof Date) && typeof value === 'string' && value.length >= 10) { |
|
|
|
|
|
d = new Date(value.replace(/-/g, '/')) |
|
|
|
|
|
} |
|
|
|
|
|
const now = new Date() |
|
|
|
|
|
const target = new Date(d.getFullYear(), d.getMonth(), d.getDate(), 22, 0, 0) |
|
|
|
|
|
if (target.getTime() <= now.getTime()) target.setDate(target.getDate() + 1) |
|
|
|
|
|
return this.fmt(target) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|