Browse Source

优化并提示

master
wanghongjun 2 years ago
parent
commit
4ab094b4d2
  1. 18
      pages/category/economybusiness/list.vue
  2. 3
      pages/category/index.vue
  3. 18
      pages/category/tradingentity/list.vue
  4. 10
      pages/goods/list.vue

18
pages/category/economybusiness/list.vue

@ -29,7 +29,7 @@
<view class="goods-auth-type"> <view class="goods-auth-type">
<text class="twoline-hide">{{ userList.authType }}</text> <text class="twoline-hide">{{ userList.authType }}</text>
</view> </view>
<view class="goods-auth-num"> <view class="goods-auth-num" v-if="total != ''">
<text class="twoline-hide">标的数量{{ total }}</text> <text class="twoline-hide">标的数量{{ total }}</text>
</view> </view>
</view> </view>
@ -136,7 +136,7 @@
}, },
], ],
targetTab: 1, targetTab: 1,
total: 0, total: '',
} }
}, },
@ -219,6 +219,7 @@
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
GoodsApi.nbgoods(param) GoodsApi.nbgoods(param)
.then(result => { .then(result => {
if (result.data.length > 0) {
// //
const newList = app.initList(result.data) const newList = app.initList(result.data)
app.total = result.data.total app.total = result.data.total
@ -227,10 +228,17 @@
app.userList.stateStr = this.getUserStateStr(app.userList.state) app.userList.stateStr = this.getUserStateStr(app.userList.state)
app.userList.user_islicode = newList.data[0].user_islicode app.userList.user_islicode = newList.data[0].user_islicode
resolve(newList) resolve(newList)
} else {
app.$error('该店铺信息不存在,即将返回分类页面!')
setTimeout(app.jumpReturn,2000)
}
}) })
.catch(reject) .catch(reject)
}) })
}, },
jumpReturn() {
this.$navTo('pages/category/index',{curIndex: 3});
},
getUserStateStr(state){ getUserStateStr(state){
let str = '' let str = ''
if (state == "1" || state == "3" || state == "7" || state == "0") { if (state == "1" || state == "3" || state == "7" || state == "0") {
@ -317,8 +325,11 @@
.search-text { .search-text {
text-align: left; text-align: left;
float: left; float: left;
font-size: 20rpx;
margin-left: 20rpx; margin-left: 20rpx;
input {
font-size: 20rpx;
}
} }
.search-text-bu { .search-text-bu {
margin-right: 20rpx; margin-right: 20rpx;
@ -364,7 +375,6 @@
.goods-name { .goods-name {
height: 90rpx; height: 90rpx;
float: left;
} }
.goods-auth-type { .goods-auth-type {

3
pages/category/index.vue

@ -201,9 +201,10 @@
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad() { onLoad(options) {
// //
this.onRefreshPage() this.onRefreshPage()
this.curIndex = options.curIndex ? options.curIndex : 0
}, },
/** /**

18
pages/category/tradingentity/list.vue

@ -29,7 +29,7 @@
<view class="goods-auth-type"> <view class="goods-auth-type">
<text class="twoline-hide">{{ userList.authType }}</text> <text class="twoline-hide">{{ userList.authType }}</text>
</view> </view>
<view class="goods-auth-num"> <view class="goods-auth-num" v-if="total != ''">
<text class="twoline-hide">标的数量{{ total }}</text> <text class="twoline-hide">标的数量{{ total }}</text>
</view> </view>
</view> </view>
@ -136,7 +136,7 @@
}, },
], ],
targetTab: 1, targetTab: 1,
total: 0, total: '',
} }
}, },
@ -220,6 +220,7 @@
GoodsApi.nbgoods(param) GoodsApi.nbgoods(param)
.then(result => { .then(result => {
// //
if (result.data.length > 0) {
const newList = app.initList(result.data) const newList = app.initList(result.data)
app.total = result.data.total app.total = result.data.total
app.list.data = getMoreListData(newList, app.list, pageNo) app.list.data = getMoreListData(newList, app.list, pageNo)
@ -227,10 +228,17 @@
app.userList.stateStr = this.getUserStateStr(app.userList.state) app.userList.stateStr = this.getUserStateStr(app.userList.state)
app.userList.user_islicode = newList.data[0].user_islicode app.userList.user_islicode = newList.data[0].user_islicode
resolve(newList) resolve(newList)
} else {
app.$error('该店铺信息不存在,即将返回分类页面!')
setTimeout(app.jumpReturn,2000)
}
}) })
.catch(reject) .catch(reject)
}) })
}, },
jumpReturn() {
this.$navTo('pages/category/index',{curIndex: 4});
},
getUserStateStr(state){ getUserStateStr(state){
let str = '' let str = ''
if (state == "1" || state == "3" || state == "7" || state == "0") { if (state == "1" || state == "3" || state == "7" || state == "0") {
@ -317,8 +325,11 @@
.search-text { .search-text {
text-align: left; text-align: left;
float: left; float: left;
font-size: 20rpx;
margin-left: 20rpx; margin-left: 20rpx;
input {
font-size: 20rpx;
}
} }
.search-text-bu { .search-text-bu {
margin-right: 20rpx; margin-right: 20rpx;
@ -364,7 +375,6 @@
.goods-name { .goods-name {
height: 90rpx; height: 90rpx;
float: left;
} }
.goods-auth-type { .goods-auth-type {

10
pages/goods/list.vue

@ -29,7 +29,7 @@
<view class="goods-auth-type"> <view class="goods-auth-type">
<text class="twoline-hide">{{ userList.authType }}</text> <text class="twoline-hide">{{ userList.authType }}</text>
</view> </view>
<view class="goods-auth-num"> <view class="goods-auth-num" v-if="total != ''">
<text class="twoline-hide">标的数量{{ total }}</text> <text class="twoline-hide">标的数量{{ total }}</text>
</view> </view>
</view> </view>
@ -131,7 +131,7 @@
}, },
], ],
targetTab: 1, targetTab: 1,
total: 0, total: '',
} }
}, },
@ -311,8 +311,11 @@
.search-text { .search-text {
text-align: left; text-align: left;
float: left; float: left;
font-size: 20rpx;
margin-left: 20rpx; margin-left: 20rpx;
input {
font-size: 20rpx;
}
} }
.search-text-bu { .search-text-bu {
margin-right: 20rpx; margin-right: 20rpx;
@ -358,7 +361,6 @@
.goods-name { .goods-name {
height: 90rpx; height: 90rpx;
float: left;
} }
.goods-auth-type { .goods-auth-type {

Loading…
Cancel
Save