2021-10-22 11:07:32 +08:00
|
|
|
|
<template>
|
|
|
|
|
<view>
|
|
|
|
|
<!-- 状态栏 -->
|
|
|
|
|
<status-nav :titleVal="'签到管理'" :statusTitle="true"></status-nav>
|
2021-11-02 18:23:53 +08:00
|
|
|
|
<view v-if="loading" :style="{paddingTop: statusHNH+'px'}" class=" fon28 col3">
|
2021-11-08 15:50:30 +08:00
|
|
|
|
<view style="position: sticky;z-index: 3;background: #FFFFFF;padding-bottom: 20rpx;" :style="{top:statusHNH+'px'}">
|
|
|
|
|
<view class="posir">
|
|
|
|
|
<image class="posia width100" src="/static/public/sign-01.png" mode="widthFix"></image>
|
|
|
|
|
<view class="posir tc pad-sx20" style="z-index: 5;">
|
|
|
|
|
<image v-if="isSigin==0" @tap="siginEv" src="/static/public/sign-02.png" mode="" class="sigin-img"></image>
|
|
|
|
|
<image v-else src="/static/public/sigined.png" mode="" class="sigin-img"></image>
|
|
|
|
|
<view class="fon20 colf mar-s20">在连续签到可获得积分</view>
|
|
|
|
|
<view class="disjcac mar-sx30">
|
|
|
|
|
<image src="/static/public/sign-03.png" class="sigin-success" mode=""></image>
|
|
|
|
|
<view class="bold colf mar-z10 fon56">{{user_score}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="disjb pad-zy30">
|
|
|
|
|
<view v-for="(item,index) in timeList" :key="index" class="disjcac fc">
|
|
|
|
|
<view class="disjcac fon24 posir sigin-day" :style="{color:item.isSign?'#789CFB':'#FFFFFF',background:item.isSign?'#FFFFFF':''}">
|
|
|
|
|
+{{item.num}}
|
|
|
|
|
<image v-if="item.isSign==1" class="posia" src="/static/public/gou.png" mode=""></image>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="fon28 colf mar-s20">{{item.day}}</view>
|
2021-10-22 11:07:32 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2021-11-08 15:50:30 +08:00
|
|
|
|
<view class="mar-s20 fon28 col3 bold mar-z50">签到记录</view>
|
2021-10-22 11:07:32 +08:00
|
|
|
|
</view>
|
|
|
|
|
<!-- 获取列表,提现列表 -->
|
|
|
|
|
<view class="pad-zy30">
|
2021-11-08 15:50:30 +08:00
|
|
|
|
<view class="bacf pad-zy20 pad-x20 radius20">
|
2021-11-16 17:48:58 +08:00
|
|
|
|
<scroll-view scroll-y="true" v-if="dataList.length!=0">
|
2021-11-08 15:50:30 +08:00
|
|
|
|
<view v-for="(item,index) in dataList" :key="index" class="disjbac bbot pad-sx10">
|
|
|
|
|
<view>
|
|
|
|
|
<view class="fon26 col3">{{item.title}}</view>
|
|
|
|
|
<view class="mar-s10 fon20 col9">{{item.time}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="fon36 bold pcol">+{{item.num}}</view>
|
2021-10-22 11:07:32 +08:00
|
|
|
|
</view>
|
2021-11-08 15:50:30 +08:00
|
|
|
|
</scroll-view>
|
2021-11-16 17:48:58 +08:00
|
|
|
|
<view v-else class="fon24 col6 tc pad-s50">暂无签到记录</view>
|
2021-10-22 11:07:32 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2021-12-02 17:31:26 +08:00
|
|
|
|
<!-- 弹框授权 -->
|
|
|
|
|
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
|
|
|
|
<!-- 弹框 -->
|
|
|
|
|
<auth-phone v-if="isShowP"></auth-phone>
|
2021-10-22 11:07:32 +08:00
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
statusHNH:uni.getStorageSync('statusHNH'),
|
|
|
|
|
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
2021-11-02 18:23:53 +08:00
|
|
|
|
timeList:[],
|
2021-10-22 11:07:32 +08:00
|
|
|
|
dataList:[
|
2021-11-02 18:23:53 +08:00
|
|
|
|
// {title:'签到积分',time:'2021.09.06 10:30:10',num:'1'},
|
2021-10-22 11:07:32 +08:00
|
|
|
|
],
|
2021-11-02 18:23:53 +08:00
|
|
|
|
user_score:0,//账户余额
|
|
|
|
|
page:1,
|
|
|
|
|
size:10,
|
2021-11-08 15:50:30 +08:00
|
|
|
|
total:'',//总数
|
|
|
|
|
isZanw:true,
|
2021-11-02 18:23:53 +08:00
|
|
|
|
isSigin:0,
|
2021-12-02 17:31:26 +08:00
|
|
|
|
loading:false,
|
2021-12-20 16:02:27 +08:00
|
|
|
|
vision:false,
|
2021-12-02 17:31:26 +08:00
|
|
|
|
isShowP:false,
|
2021-10-22 11:07:32 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2021-11-08 15:50:30 +08:00
|
|
|
|
onReachBottom() {//触底事件
|
|
|
|
|
if(this.total!=this.dataList.length){
|
|
|
|
|
this.page++
|
|
|
|
|
this.checkTime()//调用自主预约列表事件
|
|
|
|
|
} else {
|
|
|
|
|
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000,'bottom')
|
|
|
|
|
this.isZanw = false
|
|
|
|
|
}
|
|
|
|
|
},
|
2021-12-02 17:31:26 +08:00
|
|
|
|
onLoad(options) {
|
|
|
|
|
if(uni.getStorageSync('is_active')!=1){this.vision = true;}
|
|
|
|
|
if(options.invite_code!='' && options.invite_code!=undefined){
|
|
|
|
|
this.loginEv(options.invite_code);
|
|
|
|
|
} else if(options.source_code!='' && options.source_code!=undefined){
|
|
|
|
|
this.loginEv('',options.source_code,options.channel);
|
|
|
|
|
}
|
2021-11-02 18:23:53 +08:00
|
|
|
|
this.$toolAll.tools.isLogin();
|
|
|
|
|
this.checkTime();
|
|
|
|
|
this.checkList();
|
2021-10-22 11:07:32 +08:00
|
|
|
|
},
|
|
|
|
|
methods: {
|
2021-12-02 17:31:26 +08:00
|
|
|
|
loginEv(invite_code='',source='',channel=''){
|
|
|
|
|
uni.login({
|
|
|
|
|
provider: 'weixin',
|
|
|
|
|
success: (res)=> {
|
|
|
|
|
if (res.code) {
|
|
|
|
|
var params = {
|
|
|
|
|
code:res.code,
|
|
|
|
|
invite_code:invite_code,//用户邀请码
|
|
|
|
|
source_code:source,
|
|
|
|
|
channel:channel
|
|
|
|
|
}
|
|
|
|
|
this.$requst.post('user/login',params).then(res => {
|
|
|
|
|
if(res.data.token!=''){
|
|
|
|
|
if(res.data.is_active==0) {
|
|
|
|
|
this.haveImg = false;
|
|
|
|
|
this.vision = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},error => {})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
buttonH(e){//授权成功
|
|
|
|
|
this.haveImg = e
|
|
|
|
|
if(e) {
|
|
|
|
|
this.vision = false
|
|
|
|
|
this.isShowP = true
|
|
|
|
|
}
|
|
|
|
|
},
|
2021-11-02 18:23:53 +08:00
|
|
|
|
siginEv(){
|
|
|
|
|
this.$toolAll.tools.showToast('正在签到...');
|
|
|
|
|
this.$requst.post('sign/online-singIn').then(res=>{
|
|
|
|
|
if(res.code==0){
|
|
|
|
|
this.$toolAll.tools.showToast('签到成功');
|
|
|
|
|
this.checkTime();
|
|
|
|
|
this.checkList();
|
|
|
|
|
} else {
|
|
|
|
|
this.$toolAll.tools.showToast(res.msg);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
checkTime(){
|
|
|
|
|
this.$requst.post('sign/online-sign-record',{page:this.page,size:this.size}).then(res=>{
|
|
|
|
|
if(res.code==0){
|
2021-11-08 15:50:30 +08:00
|
|
|
|
if(this.page==1) this.dataList = [];
|
|
|
|
|
this.total = res.data.total;
|
2021-11-02 18:23:53 +08:00
|
|
|
|
if(res.data.length!=0){
|
|
|
|
|
res.data.forEach(item=>{
|
|
|
|
|
let obj = {
|
|
|
|
|
title:'签到积分',
|
|
|
|
|
time:item.created_at,
|
|
|
|
|
num:item.score
|
|
|
|
|
}
|
|
|
|
|
this.dataList.push(obj);
|
|
|
|
|
})
|
|
|
|
|
}
|
2021-11-16 17:48:58 +08:00
|
|
|
|
}
|
2021-11-02 18:23:53 +08:00
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
checkList(){
|
|
|
|
|
this.$requst.post('sign/mini-load').then(res=>{
|
|
|
|
|
if(res.code==0){
|
|
|
|
|
this.timeList = [];
|
|
|
|
|
for (let key in res.data.sign_record) {
|
|
|
|
|
let obj = {
|
|
|
|
|
num:res.data.sign_record[key].record,
|
|
|
|
|
day:res.data.sign_record[key].key,
|
|
|
|
|
isSign:res.data.sign_record[key].is_sign
|
|
|
|
|
}
|
|
|
|
|
this.timeList.push(obj)
|
|
|
|
|
// console.log(key);
|
|
|
|
|
}
|
|
|
|
|
this.isSigin = res.data.today_sign_in;//0未签到 1已签到
|
|
|
|
|
this.user_score = res.data.user_score;
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
this.loading = true;
|
|
|
|
|
},1000)
|
|
|
|
|
}
|
|
|
|
|
// console.log(res);
|
|
|
|
|
})
|
|
|
|
|
}
|
2021-10-22 11:07:32 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
page{background-color: #FFFFFF;}
|
|
|
|
|
</style>
|