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