Commit 4b6ed104 by zhangquan

第二轮bug修改

1 parent cbef8533
......@@ -2,14 +2,14 @@
<div class="equity-wrap">
<div class="active-wrap">
<span class="title">非会员限时活动/天:</span>
<FormatInput :intDigit="2" ref="dayRef" :precise="0" :maxVal="30" :minVal="1" :disabled="!isEdit" class="day-input" size="small" @blur="activeDayBlur" v-model="limitedDay"></FormatInput>
<FormatInput :intDigit="2" ref="dayRef" :precise="0" :maxVal="30" :minVal="1" :disabled="!isEdit" class="day-input" size="small" v-model="limitedDay"></FormatInput>
<!-- <el-input ref="dayRef" v-model="limitedDay"></el-input> -->
<span class="edit" @click="editDay">编辑</span>
<span class="date" v-if="residueDay>-1">剩余<span class="num">{{residueDay ? residueDay : 1 }}</span>天</span>
<span class="edit" @click="editDay">{{isEdit? '完成' : '编辑'}}</span>
<span class="date" v-if="residueDay>0">剩余<span class="num">{{residueDay}}</span>天</span>
<span class="date" v-else>已结束</span>
</div>
<div class="equity-wrap contain">
<GLCombiForm ref="showSearch" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLCombiForm :rowNumber="1" ref="showSearch" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="operate_wrap">
<span class="table_title"></span>
<div class="operate_btn">
......@@ -256,6 +256,7 @@ export default {
{
label: '下单时间',
prop: 'orderStatusName',
width: 220,
formatter: cell => {
return cell.orderTime ? this.dateFormat(cell.orderTime, 'YYYY-MM-DD HH:mm:ss') : '--'
}
......@@ -279,10 +280,14 @@ export default {
return Number((price * amount).toFixed(2))
},
editDay(){
this.isEdit=true
this.$nextTick(()=>{
this.$refs?.dayRef?.$refs?.input?.focus()
})
if(this.isEdit){
this.activeDayBlur()
}else{
this.isEdit=true
this.$nextTick(()=>{
this.$refs?.dayRef?.$refs?.input?.focus()
})
}
},
openDetailDialog(row){
this.dialogVisible = true
......@@ -303,7 +308,6 @@ export default {
},
activeDayBlur(e){
const MAX_DAY = 30
this.isEdit= false
this.$confirm('确认修改活动时长?', '提示', {
type: 'warning'
}).then((resp) => {
......@@ -321,24 +325,28 @@ export default {
setTimeout(()=>{
this.getActiveDay()
}, 500)
}).finally(end =>{
this.isEdit= false
})
},
getActiveDay(){
this.$apis.equityApi.getHwActiveDayApi({}).then(res => {
if(res){
console.log(res)
this.limitedDay = res.limitedDay
let nowTime = new Date().getTime()
let oldTime = new Date(res.updateTime).getTime()
let subtime = (nowTime - oldTime) / 1000;
let days = Math.floor(subtime / 86400)
let y = new Date().getFullYear();
let m = new Date().getMonth()+1;
let d = new Date().getDate();
let curDayTime = new Date(`${y}/${m}/${d}`).getTime()
let updateTimeArr = res.updateTime?.split(' ')
let updateDayTime = updateTimeArr?.length ? new Date(updateTimeArr[0]?.replace('-','/')).getTime() : ''
if(!updateTimeArr?.length) return;
let days = parseInt(parseInt(updateDayTime - curDayTime) / 86400 / 1000)
this.residueDay = res.limitedDay - (days < 0 ? 0 : days)
}
})
},
getBrandListFn(){
this.$apis.equityApi.gethwBrandList({}).then(res => {
console.log(res)
if(res?.length) {
let brandList = []
res.forEach((item,index) => {
......@@ -372,7 +380,6 @@ export default {
this.$apis.equityApi.exportHWOrderList(params).then(res => {
if(res?.data){
let tempaa = this.getExplorer()
console.log(tempaa, res.data)
if (tempaa == 'QQ') {
window.open(res.data)
} else {
......@@ -391,7 +398,6 @@ export default {
month = month < 10 ? '0'+ month : month
let day = today.getDate()
day = day < 10 ? '0'+ day : day
console.log(year, month, day)
const params = {
startTime: `${year}-${month}-${day} 00:00:00`,
endTime: `${year}-${month}-${day} 23:59:59`
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!