Browse Source

店铺详情数据页面查询优化

master
wanghongjun 2 years ago
parent
commit
99dcf53e90
  1. 18
      pages/category/economybusiness/list.vue
  2. 8
      pages/category/tradingentity/detail.vue
  3. 16
      pages/category/tradingentity/list.vue
  4. 7
      pages/goods/list.vue

18
pages/category/economybusiness/list.vue

@ -151,12 +151,7 @@
methods: {
//
async onSearch() {
if (this.searchValue == '') {
this.$error('请输入搜索关键词');
} else {
await this.getGoodsList()
await this.getHomeListImage()
}
await this.upCallback(1)
},
// tab
async changeTab(val) {
@ -165,8 +160,7 @@
this.$navTo('pages/category/tradingentity/detail',{name})
} else {
this.targetTab = val
await this.getGoodsList()
await this.getHomeListImage()
await this.upCallback(1)
}
},
/**
@ -208,6 +202,9 @@
source_type: '',
is_user_data: '1',
}
GoodsApi.nbgoods(param).then(resultTotal => {
app.total = resultTotal.data.total
})
if (app.searchValue != '') {
param.goods_name = app.searchValue
}
@ -219,10 +216,9 @@
return new Promise((resolve, reject) => {
GoodsApi.nbgoods(param)
.then(result => {
if (result.data.length > 0) {
if (result.data.data.length > 0) {
//
const newList = app.initList(result.data)
app.total = result.data.total
app.list.data = getMoreListData(newList, app.list, pageNo)
app.userList = newList.data[0].user
app.userList.stateStr = this.getUserStateStr(app.userList.state)
@ -230,7 +226,7 @@
resolve(newList)
} else {
app.$error('该店铺信息不存在,即将返回分类页面!')
setTimeout(app.jumpReturn,2000)
setTimeout(app.jumpReturn, 2000)
}
})
.catch(reject)

8
pages/category/tradingentity/detail.vue

@ -114,14 +114,12 @@ export default {
methods: {
//
async onSearch() {
await this.getHomeList(1)
await this.getHomeListImage()
await this.upCallback(1)
},
// tab
async changeTab(val) {
this.targetTab = val
await this.getHomeList(1)
await this.getHomeListImage()
await this.upCallback(1)
},
/**
* 上拉加载的回调 (页面初始化时也会执行一次)
@ -134,7 +132,7 @@ export default {
await app.getHomeList(page.num)
.then(list => {
const curPageLen = list.data.length
const totalSize = list.data.total
const totalSize = list.total
app.mescroll.endBySize(curPageLen, totalSize)
})
.catch(() => app.mescroll.endErr())

16
pages/category/tradingentity/list.vue

@ -151,12 +151,7 @@
methods: {
//
async onSearch() {
if (this.searchValue == '') {
this.$error('请输入搜索关键词');
} else {
await this.getGoodsList()
await this.getHomeListImage()
}
await this.upCallback(1)
},
// tab
async changeTab(val) {
@ -165,8 +160,7 @@
this.$navTo('pages/category/tradingentity/detail',{name})
} else {
this.targetTab = val
await this.getGoodsList()
await this.getHomeListImage()
await this.upCallback(1)
}
},
/**
@ -208,6 +202,9 @@
source_type: '',
is_user_data: '1',
}
GoodsApi.nbgoods(param).then(resultTotal => {
app.total = resultTotal.data.total
})
if (app.searchValue != '') {
param.goods_name = app.searchValue
}
@ -220,9 +217,8 @@
GoodsApi.nbgoods(param)
.then(result => {
//
if (result.data.length > 0) {
if (result.data.data.length > 0) {
const newList = app.initList(result.data)
app.total = result.data.total
app.list.data = getMoreListData(newList, app.list, pageNo)
app.userList = newList.data[0].user
app.userList.stateStr = this.getUserStateStr(app.userList.state)

7
pages/goods/list.vue

@ -197,6 +197,9 @@
source_type: '',
is_user_data: '1',
}
GoodsApi.nbgoods(param).then(resultTotal => {
app.total = resultTotal.data.total
})
if (app.searchValue != '') {
param.goods_name = app.searchValue
}
@ -205,10 +208,6 @@
} else if (app.targetTab === 3) {
param.order_type = 'price'
}
GoodsApi.nbgoods(param).then(resultTotal => {
param.goods_name = ''
app.total = resultTotal.data.total
})
return new Promise((resolve, reject) => {
GoodsApi.nbgoods(param)
.then(result => {

Loading…
Cancel
Save