[商品权证分页及刷新处理]

This commit is contained in:
2021-10-26 17:14:33 +08:00
parent 6860a9e43c
commit 43813f1f50
3 changed files with 33 additions and 4 deletions

View File

@@ -387,6 +387,7 @@
let submitFund = this.$Route.query.type === 'edit' ? managesGoodsPut(this.$Route.query.id, submitData) : managesGoodsCreate(submitData)
submitFund.then(res => {
uni.setStorageSync('refresh',true)
if(this.type === 2){
uni.showModal({
title : '提示',
@@ -416,6 +417,7 @@
}
}
})
}).catch(err => {
uni.showToast({
title: err.message,

View File

@@ -144,6 +144,7 @@
}
let submitFund = managesGoodsAuth(this.$Route.query.id, submitData)
submitFund.then(res => {
uni.setStorageSync('refresh',true)
uni.showModal({
title : '提示',
content : '商品权证认证信息已提交,请耐心等待平台审核',

View File

@@ -64,27 +64,53 @@
pages : {},
itemGoods : {},
stock : 1,
stockType : ''
stockType : '',
page:1,
has_more :true,
};
},
onShow() {
onLoad() {
this.getList()
},
onShow() {
if(uni.getStorageSync('refresh')){
this.goods = []
this.page = 1
this.has_more = true
this.getList()
}
},
onReachBottom() {
if(this.has_more){
this.page = this.page + 1
this.getList()
}else{
uni.showToast({
title:'我是有底线的~',
icon:'none'
})
}
},
methods: {
// tabs
onTabs(value){
if(value == this.status) return
this.goods = []
this.page =1,
this.has_more = true
this.status = value
this.getList()
},
// 权证列表
getList(){
managesGoodsIndex({
status: this.status
status: this.status,
page:this.page
}).then(res => {
this.goods = res.data
this.goods = this.goods.concat(res.data)
this.pages = res.page
this.has_more = res.page.has_more
uni.setStorageSync('refresh',false)
}).catch(err => {
uni.showToast({
title: err.message,