修复定位不到时无法推荐的问题
This commit is contained in:
parent
1b9a98da38
commit
3a547b90cd
@ -140,7 +140,7 @@
|
||||
<view class='loadingicon acea-row row-center-wrapper' v-if='productList.length > 0'>
|
||||
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
|
||||
</view>
|
||||
<view class='loadingicon acea-row row-center-wrapper' v-else>
|
||||
<view class='loadingicon acea-row row-center-wrapper' v-if='productList2.length > 0||loading2'>
|
||||
<text class='loading iconfont icon-jiazai' :hidden='loading2==false'></text>{{loadTitle2}}
|
||||
</view>
|
||||
<view class="empty_wrapper" v-if="emptyShow">
|
||||
@ -291,7 +291,6 @@
|
||||
},
|
||||
|
||||
onReachBottom() {
|
||||
console.log('ss');
|
||||
if (this.productList.length > 0) {
|
||||
setTimeout(() => {
|
||||
this.list(false, this.street_id);
|
||||
@ -353,12 +352,20 @@
|
||||
},
|
||||
//获取商品列表
|
||||
list(isPage, id) {
|
||||
if(!id) return that.list2(true, ''); // 定位没有获取到时,直接推荐
|
||||
// if(!id) return that.list2(true, ''); // 定位没有获取到时,直接推荐
|
||||
let that = this;
|
||||
if (that.loadend) return;
|
||||
if (that.loading) return;
|
||||
|
||||
if (isPage === true) that.$set(that, 'productList', []);
|
||||
if (isPage === true) {
|
||||
that.$set(that, 'productList', []);
|
||||
that.$set(that, 'where', {
|
||||
category_id: 0,
|
||||
page: 1,
|
||||
limit: 6
|
||||
})
|
||||
}
|
||||
that.$set(that, 'productList2', []);
|
||||
|
||||
that.loading = true;
|
||||
that.loadTitle = '';
|
||||
@ -393,7 +400,15 @@
|
||||
if (that.loadend2) return;
|
||||
if (that.loading2) return;
|
||||
|
||||
if (isPage === true) that.$set(that, 'productList2', []);
|
||||
if (isPage === true) {
|
||||
that.$set(that, 'productList2', []);
|
||||
that.$set(that, 'where2', {
|
||||
category_id: 0,
|
||||
page: 1,
|
||||
limit: 6
|
||||
})
|
||||
}
|
||||
that.$set(that, 'productList', []);
|
||||
|
||||
that.loading2 = true;
|
||||
that.loadTitle2 = '';
|
||||
@ -573,6 +588,7 @@
|
||||
selfLocation() {
|
||||
if (uni.getStorageSync('loction') == true) {
|
||||
this.isshow = false
|
||||
this.list2(true,'')
|
||||
} else {
|
||||
this.isshow = true
|
||||
uni.setStorageSync('loction', true);
|
||||
@ -603,6 +619,7 @@
|
||||
|
||||
}).catch(err => {
|
||||
this.isshow = false
|
||||
this.list2(true,'')
|
||||
uni.showToast({
|
||||
title: err,
|
||||
icon: 'none'
|
||||
@ -610,6 +627,7 @@
|
||||
})
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log('定位失败');
|
||||
this.isshow = false
|
||||
// uni.showToast({
|
||||
// title: "获取定位超时",
|
||||
|
Loading…
x
Reference in New Issue
Block a user