|
|
|
|
@ -26,8 +26,8 @@
|
|
|
|
|
</view> -->
|
|
|
|
|
</view>
|
|
|
|
|
<view class="shopContent">
|
|
|
|
|
<!--为您推荐-->
|
|
|
|
|
<u-empty v-if="dataList.length==0" marginTop="250" ></u-empty>
|
|
|
|
|
<!--为您推荐-->
|
|
|
|
|
<u-empty v-if="dataList.length==0" marginTop="250"></u-empty>
|
|
|
|
|
<view class="introBox hasMenu" v-if="dataList.length>0">
|
|
|
|
|
<block v-for="(item,index) in dataList">
|
|
|
|
|
<view class="intro_column" @tap="gotoDetail" :data-id="item.id">
|
|
|
|
|
@ -76,7 +76,8 @@
|
|
|
|
|
keyword: "",
|
|
|
|
|
dataList: [],
|
|
|
|
|
currentPage: 1,
|
|
|
|
|
product_type_id: 0
|
|
|
|
|
product_type_id: 0,
|
|
|
|
|
isLoading: false
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -96,7 +97,8 @@
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onReachBottom: function(e) {
|
|
|
|
|
console.log("onReachBottom", this.currentPage + 1)
|
|
|
|
|
if (!isLoading)
|
|
|
|
|
console.log("onReachBottom", this.currentPage + 1)
|
|
|
|
|
this.loadPage(this.currentPage + 1);
|
|
|
|
|
},
|
|
|
|
|
onPullDownRefresh: function(e) {
|
|
|
|
|
@ -131,16 +133,16 @@
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
toback: function() {
|
|
|
|
|
let route = getCurrentPages();
|
|
|
|
|
console.log(route)
|
|
|
|
|
if (route.length >1) {
|
|
|
|
|
uni.navigateBack({
|
|
|
|
|
delta: 1
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
uni.switchTab({
|
|
|
|
|
url: "../../../../pages/home/home"
|
|
|
|
|
})
|
|
|
|
|
let route = getCurrentPages();
|
|
|
|
|
console.log(route)
|
|
|
|
|
if (route.length > 1) {
|
|
|
|
|
uni.navigateBack({
|
|
|
|
|
delta: 1
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
uni.switchTab({
|
|
|
|
|
url: "../../../../pages/home/home"
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
confirm: function() {
|
|
|
|
|
@ -155,6 +157,7 @@
|
|
|
|
|
loadPage: function(page) {
|
|
|
|
|
uni.hideKeyboard()
|
|
|
|
|
var that = this;
|
|
|
|
|
that.isLoading = true;
|
|
|
|
|
weixin.request({
|
|
|
|
|
bindThis: that,
|
|
|
|
|
api: '/api/member/get-products',
|
|
|
|
|
@ -168,6 +171,7 @@
|
|
|
|
|
utilSuccess: function(r) {
|
|
|
|
|
var res = r.data.data;
|
|
|
|
|
|
|
|
|
|
that.isLoading = false;
|
|
|
|
|
var hasNoMore = that.dataList.length < 6 && page > 1;
|
|
|
|
|
if (hasNoMore || res.length == 0 && page > 1) {
|
|
|
|
|
|
|
|
|
|
|