loadmore 7.27

This commit is contained in:
2020-07-27 17:59:47 +08:00
parent 100f31c6f9
commit 6eabd3a575
17 changed files with 421 additions and 58 deletions

View File

@@ -13,11 +13,25 @@
</view>
</template>
<script>
import common from '@/static/js/common.js';
export default {
data() {
return {
nodes: '<h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1>'
nodes: '',
}
},
created() {
this.getMemberPointsStat();
},
methods: {
getMemberPointsStat() {
this.$u.api.getMemberPointsStat().then((res)=>{
if (res.errCode == 0) {
const nodes = res.data.grade_rule;
this.nodes = common.unescapeHTML(nodes);
}
})
},
}
};
</script>

View File

@@ -34,6 +34,8 @@ export default {
couponGroupList: [],
couponList: [],
page: 0,
loadStatus: 'loadmore',
timer: true,
}
},
components: {
@@ -50,6 +52,27 @@ export default {
}
},
methods: {
loadMore(page) {
if(!this.timer) return false;
this.loadStatus = "loading";
this.page++;
this.getGoodsRecommend({
gc_id: this.classifyList[this.current].gc_id,
page: this.page,
reload: false,
}).then(length => {
// console.log(length);
if(length == 0) {
this.page--;
this.loadStatus = 'nomore';
} else {
this.loadStatus = 'loading';
}
}).catch(() => {
this.loadStatus = "nomore";
this.page--;
})
},
getGoodsClass() {
this.$u.api.getGoodsClass().then(res => {
if(res.errCode == 0) {

View File

@@ -73,7 +73,7 @@ export default {
},
filters: {
percentExp(value, rank) {
console.log(rank);
// console.log(rank);
let result = '0/0';
if(rank) result = value + '/' + rank.max;
return result;
@@ -93,7 +93,7 @@ export default {
if (res.errCode == 0) {
this.memberInfo = res.data;
this.percent = (this.memberInfo.member_exppoints / this.rank[this.memberInfo.member_level - 1].max) * 100;
console.log(this.percent);
// console.log(this.percent);
}
})
},

View File

@@ -55,6 +55,13 @@ export default {
this.page = 0;
// again 重新请求列表 不然往列表里添加
value == 6 ? this.getAfterSaleList({ reload: 'again' }): this.getOrderList({ reload: 'again' });
if(value == 6) {
this.getAfterSaleList({ reload: 'again' });
} else if(value == 4) {
this.goodsTryOrderList({ reload: 'again' });
} else {
this.getOrderList({ reload: 'again' });
}
},
},
onLoad(option) {
@@ -113,6 +120,17 @@ export default {
}
return res;
},
async goodsTryOrderList({ reload = '' } = {}) {
const res = await this.$u.api.goodsTryOrderList({
page: this.page,
})
this.timer = true;
if(res.errCode == 0) {
if(reload) this.orderList = res.data;
else this.orderList.push(...res.data);
}
return res;
},
reachBottom() {
// 大于15条才会加载更多
if(this.orderList.length < 15) return false;
@@ -122,6 +140,7 @@ export default {
this.page++;
let promise;
if(this.current == 6) promise = this.getAfterSaleList();
else if(this.current == 4) promise = this.goodsTryOrderList();
else promise = this.getOrderList();
promise.then(res => {
this.loadStatus.splice(this.current, 1, "nomore");

View File

@@ -88,7 +88,6 @@ export default {
this.toApplyPage(current);
},
toApplyPage(index) {
console.log(index)
var that = this;
if(index == 1) {
this.showPopup = false
@@ -175,7 +174,7 @@ export default {
}
}
}
.send-btn{
.send-btn {
width: 100%;
display: flex;
justify-content: flex-end;
@@ -183,7 +182,6 @@ export default {
.btn{
width: 154rpx;
height: 54rpx;
background: RGBA(255, 254, 255, 1);
border-radius: 49rpx;
transform: translate(-50%, 0);
font-size: 26rpx;

View File

@@ -131,7 +131,7 @@
<swiper style="height: 1000px;" vertical="true">
<swiper-item class="swiper-item">
<scroll-view scroll-y class="order-list">
<view v-for="(items, index) in 3" :key="items.index">
<view v-for="(items, index) in 3" :key="index">
<view class="store">
<view>
<image src="../../static/image/mine/23.png" mode=""></image>胖胖的店