|
@@ -1,9 +1,13 @@
|
|
<template>
|
|
<template>
|
|
<view>
|
|
<view>
|
|
|
|
+ <scroll-view class="floor-list" style="height: 95vh;"
|
|
|
|
+ :scroll-top="scrollTop" scroll-y="true" @scroll="scroll" @scrolltoupper="upper" @scrolltolower="lower"
|
|
|
|
+ :refresher-enabled="false">
|
|
<view class="money">
|
|
<view class="money">
|
|
<view class="moneysize">{{userinfo.member_points}}</view>
|
|
<view class="moneysize">{{userinfo.member_points}}</view>
|
|
<view>我的圈币</view>
|
|
<view>我的圈币</view>
|
|
</view>
|
|
</view>
|
|
|
|
+
|
|
<van-cell v-for="(item,index) in point_list" :key="index" use-label-slot :title="'圈币来源:'+item.pl_desc" >
|
|
<van-cell v-for="(item,index) in point_list" :key="index" use-label-slot :title="'圈币来源:'+item.pl_desc" >
|
|
<template>
|
|
<template>
|
|
{{item.pl_stage == "payment" ? "-" : "+"}}{{item.pl_points}}
|
|
{{item.pl_stage == "payment" ? "-" : "+"}}{{item.pl_points}}
|
|
@@ -12,11 +16,17 @@
|
|
{{item.pl_addtime}}
|
|
{{item.pl_addtime}}
|
|
</template>
|
|
</template>
|
|
</van-cell>
|
|
</van-cell>
|
|
|
|
+ </scroll-view>
|
|
|
|
+ <Gobacktop @getop="getop" v-if="isTop" />
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+ import Gobacktop from '@/component/Gobacktop.vue'
|
|
export default {
|
|
export default {
|
|
|
|
+ components: {
|
|
|
|
+ Gobacktop
|
|
|
|
+ },
|
|
onReady: function() {
|
|
onReady: function() {
|
|
uni.setNavigationBarColor({
|
|
uni.setNavigationBarColor({
|
|
frontColor: '#ffffff',
|
|
frontColor: '#ffffff',
|
|
@@ -30,8 +40,14 @@
|
|
data() {
|
|
data() {
|
|
return{
|
|
return{
|
|
page: 1,
|
|
page: 1,
|
|
|
|
+ ispull: true,
|
|
point_list:[],
|
|
point_list:[],
|
|
- userinfo:{}
|
|
|
|
|
|
+ userinfo:{},
|
|
|
|
+ scrollTop: 0,
|
|
|
|
+ isTop: false,
|
|
|
|
+ old: {
|
|
|
|
+ scrollTop: 0
|
|
|
|
+ },
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
@@ -39,6 +55,42 @@
|
|
this.getlist();
|
|
this.getlist();
|
|
},
|
|
},
|
|
methods:{
|
|
methods:{
|
|
|
|
+ // 滚动到顶部
|
|
|
|
+ upper(e) {
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ getop() {
|
|
|
|
+ // setTimeout( () => {
|
|
|
|
+ // uni.pageScrollTo({
|
|
|
|
+ // duration:0, //过渡时间必须为0,uniapp bug,否则运行到手机会报错
|
|
|
|
+ // scrollTop: 0,
|
|
|
|
+ // })
|
|
|
|
+ // },300)
|
|
|
|
+ this.scrollTop = this.old.scrollTop
|
|
|
|
+ this.$nextTick(function(){
|
|
|
|
+ this.scrollTop=0;
|
|
|
|
+ });
|
|
|
|
+ this.isTop = false;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 滚到底部
|
|
|
|
+ lower(e) {
|
|
|
|
+ this.page = this.page + 1;
|
|
|
|
+ if(this.ispull) {
|
|
|
|
+ this.getlist();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 滚动时触发
|
|
|
|
+ scroll(e) {
|
|
|
|
+ if(e.detail.scrollTop > 400) {
|
|
|
|
+ this.isTop = true;
|
|
|
|
+ }else{ //当距离小于500时显示回到顶部按钮
|
|
|
|
+ this.isTop = false;
|
|
|
|
+ }
|
|
|
|
+ this.old.scrollTop = e.detail.scrollTop
|
|
|
|
+ },
|
|
getuserinfo() {
|
|
getuserinfo() {
|
|
this.request({
|
|
this.request({
|
|
url:'/v2/member/info',
|
|
url:'/v2/member/info',
|
|
@@ -59,7 +111,12 @@
|
|
page_size: 10
|
|
page_size: 10
|
|
},
|
|
},
|
|
success: (res) => {
|
|
success: (res) => {
|
|
- this.point_list = res.data.data.point_list;
|
|
|
|
|
|
+ // ispull
|
|
|
|
+ let { data } = res.data;
|
|
|
|
+ if(data.point_list.length < 10) {
|
|
|
|
+ this.ispull = false;
|
|
|
|
+ }
|
|
|
|
+ this.point_list = this.point_list.concat(data.point_list);
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|