123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <template>
- <view class="list">
- <view class="list_con flexB" v-for="item in inteList" :key="item.id">
- <view>
- <view class="inte_title">
- <text>{{ item.remark }}</text>
- <text style="color:#999;margin-left:10rpx;" v-if="item.type==1||item.type==2">({{item.num}}套)</text>
- </view>
- <view class="inte_time">{{ item.created_at }}</view>
- </view>
- <view>
- <text class="inte_num" v-if="item.type == 1||item.type==4">+{{ item.integral_double || 0 }}</text>
- <text class="inte_num" v-else style="color:#FB231F">{{ item.integral_double || 0 }}</text>
- <image src="../../static/money_icon.png" class="icon"></image>
- </view>
- </view>
- <view class="noData" v-if="inteList.length == 0">
- <image src="../../../static/imgs/default/no_card.png" mode=""></image>
- <view>--暂无积分记录--</view>
- </view>
- </view>
- </template>
- <script>
- import {
- getIntegralRecord
- } from '@/apis/shop.js';
- export default {
- data() {
- return {
- inteList: [],
- params: {
- page_index: 1,
- page_size: 15
- },
- totalPage: 0
- };
- },
- onShow() {
- this.getIntegral();
- },
- onReachBottom() {
- this.getMore();
- },
- methods: {
- //获取积分明细
- getIntegral(isMore) {
- uni.showLoading({
- title: '加载中....'
- });
- let params = this.params;
- getIntegralRecord(params)
- .then(res => {
- if (res.code == 200) {
- this.inteList = isMore ? this.inteList.concat(res.data.list) : res.data.list;
- this.totalPage = Math.ceil(res.data.total / this.params.page_size);
- } else {
- uni.showModal({
- content: res.data || '获取积分明细失败',
- showCancel: false
- });
- }
- uni.hideLoading();
- })
- .catch(err => {
- uni.hideLoading();
- });
- },
- getMore() {
- if (this.params.page_index >= this.totalPage) {
- uni.showToast({
- title: '没有更多啦~',
- icon: 'none'
- });
- return false;
- }
- this.params.page_index++;
- this.getIntegral(true);
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .list {
- width: 100%;
- min-height: 100%;
- background: #fff;
- padding: 30rpx 0 100rpx;
- .list_con {
- width: 690rpx;
- margin: 0 auto 30rpx;
- .inte_title {
- font-size: 32rpx;
- font-weight: bold;
- }
- .inte_time {
- font-size: 28rpx;
- color: #999;
- margin-top: 20rpx;
- }
- .icon {
- width: 40rpx;
- height: 40rpx;
- vertical-align: -2rpx;
- }
- .inte_num {
- font-size: 40rpx;
- font-weight: bold;
- margin-right: 10rpx;
- }
- }
- }
- </style>
|