刘翔宇-旅管家 3 years ago
parent 17d5bd785d
commit 5f7e8e4785

@ -681,7 +681,8 @@
return
}
this.toDoBuy();
// jsuni.$u.throttle()
uni.$u.throttle(this.toDoBuy, 1000);
},
toDoBuy: function() {

@ -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) {

@ -91,7 +91,8 @@
currentPage: 1,
dataList: [],
dataActiveList: [],
indexNav: []
indexNav: [],
isLoading: false
}
},
onLoad() {
@ -114,7 +115,8 @@
}
},
onReachBottom() {
this.loadPage((this.currentPage + 1), '', 6, 1)
if (true)
this.loadPage((this.currentPage + 1), '', 6, 1)
},
methods: {
async getNav(code) {
@ -132,7 +134,7 @@
}
})
},
toAction: function(item) {
toAction: function(item) {
console.log(item)
if (item.link) {
uni.redirectTo({
@ -163,6 +165,7 @@
loadPage: function(page, product_type_id, page_size, type) {
uni.hideKeyboard()
var that = this;
this.isLoading = true;
weixin.request({
bindThis: that,
api: '/api/member/get-products',
@ -175,6 +178,7 @@
},
utilSuccess: function(r) {
var res = r.data.data;
that.isLoading = false;
for (var m of res) {
// m.created_at = m.created_at.split("T")[0] + " " + m.created_at.split("T")[
// 1]

Loading…
Cancel
Save