|
|
|
@ -26,7 +26,7 @@ |
|
|
|
<view class="lf-font-32 lf-color-black lf-font-bold">积分变动明细</view> |
|
|
|
<picker mode='date' :value="date" @change="dateChange"> |
|
|
|
<view style="width: 440rpx; text-align: right;"> |
|
|
|
<text>{{ date || '2021-09-01' }}</text> |
|
|
|
<text>{{ date || nowDate }}</text> |
|
|
|
<text class="lf-iconfont icon-xiangyou lf-font-24 lf-m-l-10"></text> |
|
|
|
</view> |
|
|
|
</picker> |
|
|
|
@ -35,11 +35,11 @@ |
|
|
|
@scrolltolower="onScrolltolower" @refresherrefresh="onRefresherrefresh"> |
|
|
|
<view class="item" v-for="(item, index) in list" :key="index"> |
|
|
|
<view class="lf-row-between"> |
|
|
|
<text class="lf-font-36 lf-color-black lf-font-bold" :class="{'lf-color-price': index % 2}">{{ index % 2 ? '-250' : '+80' }}</text> |
|
|
|
<text class="lf-font-24 lf-color-777">2021-09-01 18:27:58</text> |
|
|
|
<text class="lf-font-36 lf-color-black lf-font-bold" :class="{'lf-color-price': item.ifNegative}">{{ item.value }}</text> |
|
|
|
<text class="lf-font-24 lf-color-777">{{item.created_at}}</text> |
|
|
|
</view> |
|
|
|
<view class="lf-m-t-20"> |
|
|
|
<text class="lf-font-24 lf-color-555">商城内消费</text> |
|
|
|
<text class="lf-font-24 lf-color-555">{{item.note}}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 空数据的情况 --> |
|
|
|
@ -58,6 +58,7 @@ |
|
|
|
data(){ |
|
|
|
return { |
|
|
|
date: '', |
|
|
|
nowDate: '', |
|
|
|
point_data: '', |
|
|
|
list: [], |
|
|
|
page: 1, |
|
|
|
@ -78,12 +79,17 @@ |
|
|
|
onLoad(){ |
|
|
|
let info = uni.getSystemInfoSync(); |
|
|
|
this.scrollH = info.screenHeight; |
|
|
|
var date1 = new Date(); |
|
|
|
var date2 = new Date(date1); |
|
|
|
date2.setDate(date1.getDate()); |
|
|
|
this.nowDate = this.$shared.recordTime(date2, '-', 'date') |
|
|
|
this.getPointNum(); |
|
|
|
this.getPointList(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
dateChange(event){ |
|
|
|
this.date = event.detail.value; |
|
|
|
this.getPointList(); |
|
|
|
}, |
|
|
|
getPointNum(){ |
|
|
|
this.$http.get({ |
|
|
|
@ -100,7 +106,7 @@ |
|
|
|
onScrolltolower(){ |
|
|
|
if(this.isPage){ |
|
|
|
this.page = this.page + 1; |
|
|
|
this.getMyActivity(); |
|
|
|
this.getPointList(); |
|
|
|
} |
|
|
|
}, |
|
|
|
// 下拉刷新处理 |
|
|
|
@ -110,7 +116,7 @@ |
|
|
|
this.loadingClass = true; |
|
|
|
this.list = [] |
|
|
|
this.loadingText = '正在加载中'; |
|
|
|
this.getPointList(options); |
|
|
|
this.getPointList(options); |
|
|
|
}, |
|
|
|
// scroll-view 下拉刷新 |
|
|
|
onRefresherrefresh(){ |
|
|
|
@ -120,6 +126,9 @@ |
|
|
|
getPointList(options = {}){ |
|
|
|
this.$http.get({ |
|
|
|
api: 'api/users/point/list', |
|
|
|
data: { |
|
|
|
day: this.date || this.nowDate |
|
|
|
}, |
|
|
|
header: { |
|
|
|
Authorization: this.$cookieStorage.get('user_token') |
|
|
|
} |
|
|
|
@ -137,9 +146,25 @@ |
|
|
|
this.isRefresher = false; |
|
|
|
} |
|
|
|
if(this.page == 1) { |
|
|
|
this.list = res.data.data; |
|
|
|
let list = res.data.data; |
|
|
|
list.forEach((item,index) => { |
|
|
|
if(item.value.indexOf('-') != -1) { |
|
|
|
this.$set(item,'ifNegative',true) |
|
|
|
}else { |
|
|
|
this.$set(item,'ifNegative',false) |
|
|
|
} |
|
|
|
}) |
|
|
|
this.list = list; |
|
|
|
}else { |
|
|
|
this.list.push(...res.data.data); |
|
|
|
let list = res.data.data; |
|
|
|
list.forEach((item,index) => { |
|
|
|
if(item.value.indexOf('-') != -1) { |
|
|
|
this.$set(item,'ifNegative',true) |
|
|
|
}else { |
|
|
|
this.$set(item,'ifNegative',false) |
|
|
|
} |
|
|
|
}) |
|
|
|
this.list.push(...list); |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|