签到:签到后增加用户积分、经验

pull/3/head
owen 2023-10-01 09:53:53 +08:00
parent 40ae9ca1c4
commit 1256956825
2 changed files with 30 additions and 5 deletions

View File

@ -60,7 +60,14 @@
<view class='name line1'> {{item.day}} 天签到积分奖励</view> <view class='name line1'> {{item.day}} 天签到积分奖励</view>
<view class='data'>{{ formatDate(item.createTime) }}</view> <view class='data'>{{ formatDate(item.createTime) }}</view>
</view> </view>
<view class='num font-color'>+{{ item.point }}</view> <view>
<view class='num font-color' v-if="item.point > 0">
<span class="num-title">积分</span> +{{ item.point }}
</view>
<view class='num font-color' v-if="item.experience > 0">
<span class="num-title">经验</span> +{{ item.experience }}
</view>
</view>
</view> </view>
<view class='loading' @click='goSignList' v-if="signRecordList.length >= 3"> <view class='loading' @click='goSignList' v-if="signRecordList.length >= 3">
点击加载更多 <text class='iconfont icon-xiangyou' /> 点击加载更多 <text class='iconfont icon-xiangyou' />
@ -73,7 +80,8 @@
<view class='signTipLight loadingpic'></view> <view class='signTipLight loadingpic'></view>
<view class='signTipCon'> <view class='signTipCon'>
<view class='state'>签到成功</view> <view class='state'>签到成功</view>
<view class='integral'>获得{{ point }}积分</view> <view class='integral' v-if="signResult.point > 0">{{ signResult.point }}</view>
<view class='integral' v-if="signResult.experience > 0">{{ signResult.experience }}</view>
<view class='signTipBnt' @click='close'>好的</view> <view class='signTipBnt' @click='close'>好的</view>
</view> </view>
</view> </view>
@ -98,7 +106,7 @@
signRecordList: [], // signRecordList: [], //
active: false, // active: false, //
point: 0, // signResult: 0, //
}; };
}, },
computed: mapGetters(['isLogin', 'userInfo']), computed: mapGetters(['isLogin', 'userInfo']),
@ -176,7 +184,7 @@
} }
SignInApi.createSignInRecord().then(res => { SignInApi.createSignInRecord().then(res => {
this.active = true; this.active = true;
this.point = res.data.point; this.signResult = res.data;
// //
this.getSignInfo(); this.getSignInfo();
this.getSignList(); this.getSignList();
@ -420,6 +428,11 @@
margin-top: 9rpx; margin-top: 9rpx;
} }
.sign .list3 .item .num-title {
font-size: 10rpx;
margin-right: 8rpx;
}
.sign .list3 .item .num { .sign .list3 .item .num {
font-size: 36rpx; font-size: 36rpx;
font-family: 'Guildford Pro'; font-family: 'Guildford Pro';

View File

@ -9,7 +9,14 @@
<view class='name line1'> {{item.day}} 天签到积分奖励</view> <view class='name line1'> {{item.day}} 天签到积分奖励</view>
<view>{{ formatDate(item.createTime) }}</view> <view>{{ formatDate(item.createTime) }}</view>
</view> </view>
<view class='num font-color'>+{{ item.point }}</view> <view>
<view class='num font-color' v-if="item.point > 0">
<span class="num-title">积分</span> +{{ item.point }}
</view>
<view class='num font-color' v-if="item.experience > 0">
<span class="num-title">经验</span> +{{ item.experience }}
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -92,4 +99,9 @@
</script> </script>
<style> <style>
.sign-record .list .item .num-title {
font-size: 10rpx;
margin-right: 8rpx;
}
</style> </style>