|
|
|
@ -17,7 +17,9 @@ |
|
|
|
|
<!-- <view class="btn btn-01">详情</view> --> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<u-empty text="暂无记录" v-if="presaList.length == 0" mode="list" style="margin-top: 160rpx;"></u-empty> |
|
|
|
|
<view class="empty" v-if="presaList.length == 0"> |
|
|
|
|
<u-empty text="暂无记录" mode="list" style="margin-top: 160rpx;"></u-empty> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
@ -28,6 +30,8 @@ |
|
|
|
|
return { |
|
|
|
|
presaList: [], |
|
|
|
|
isLoading: false, |
|
|
|
|
total:0, |
|
|
|
|
page:1, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
@ -45,46 +49,50 @@ |
|
|
|
|
let start= year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second |
|
|
|
|
return (Date.parse(end.replace(/-/g, '/'))-Date.parse(start.replace(/-/g, '/'))) |
|
|
|
|
}, |
|
|
|
|
onCancel(item) { |
|
|
|
|
let app = this |
|
|
|
|
uni.showModal({ |
|
|
|
|
title: "温馨提示", |
|
|
|
|
content: "是否取消该订单?", |
|
|
|
|
confirmColor: "#F21A1C", |
|
|
|
|
complete(res) { |
|
|
|
|
if (res.confirm) { |
|
|
|
|
GoodsApi.canlpresale({ |
|
|
|
|
id: item.id |
|
|
|
|
}) |
|
|
|
|
.then(result => { |
|
|
|
|
if (result.status == 200) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title:'取消成功', |
|
|
|
|
icon:'none' |
|
|
|
|
}) |
|
|
|
|
app.getPresaleList() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.finally(() => app.isLoading = false) |
|
|
|
|
onCancel(item) { |
|
|
|
|
let app = this |
|
|
|
|
uni.showModal({ |
|
|
|
|
title: "温馨提示", |
|
|
|
|
content: "是否取消该订单?", |
|
|
|
|
confirmColor: "#F21A1C", |
|
|
|
|
complete(res) { |
|
|
|
|
if (res.confirm) { |
|
|
|
|
GoodsApi.canlpresale({ |
|
|
|
|
id: item.id |
|
|
|
|
}) |
|
|
|
|
.then(result => { |
|
|
|
|
if (result.status == 200) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title:'取消成功', |
|
|
|
|
icon:'none' |
|
|
|
|
}) |
|
|
|
|
app.getPresaleList() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.finally(() => app.isLoading = false) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
async getPresaleList() { |
|
|
|
|
let app = this |
|
|
|
|
let res = await GoodsApi.presaleList({page:this.page}); |
|
|
|
|
console.log(res) |
|
|
|
|
if (res.status == 200 && res.data.list.data.length>0) { |
|
|
|
|
res.data.list.data.forEach(function(item) { |
|
|
|
|
item.p_time = app.beginTime(item.p_time) |
|
|
|
|
}); |
|
|
|
|
app.presaList.push(...res.data.list.data) |
|
|
|
|
app.total = res.data.list.total |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
async getPresaleList() { |
|
|
|
|
let app = this |
|
|
|
|
let { |
|
|
|
|
status, |
|
|
|
|
message, |
|
|
|
|
data |
|
|
|
|
} = await GoodsApi.presaleList(); |
|
|
|
|
if (status == 200 && data.length>0) { |
|
|
|
|
data.forEach(function(item) { |
|
|
|
|
item.p_time = app.beginTime(item.p_time) |
|
|
|
|
}); |
|
|
|
|
app.presaList =data |
|
|
|
|
onReachBottom() { |
|
|
|
|
if(this.presaList.length <this.total){ |
|
|
|
|
this.pageNum ++; |
|
|
|
|
this.getPresaleList(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
@ -195,4 +203,10 @@ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.empty{ |
|
|
|
|
height: calc(100vh - 88rpx); |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
justify-content: center; |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|