loadmore 7.27
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user