添加补卡 未完成

This commit is contained in:
@fawn-nine
2023-09-20 18:13:04 +08:00
parent 2eda927c44
commit 648117b7a6
3 changed files with 104 additions and 33 deletions

View File

@@ -11,13 +11,16 @@
<view class="fanhuiDay" @tap="backTo()" v-if="showBack">
<text>返回今天</text>
</view>
<!-- <u-icon name="checkbox-mark" color="#55aa7f" size="14" style="display: inline;"></u-icon> -->
<view class="dakaBtn" @tap="kuickSign()" v-if="signList.indexOf(currentDay) == -1">
<!-- <u-icon name="checkbox-mark" color="#55aa7f" size="14" style="display: inline;"></u-icon> -->
<view class="dakaBtn" @tap="buSign()" v-if="signList.indexOf(currentDay) == -1 && currentDay > linshiDay">
<text style="font-size: 24rpx;">补卡</text>
</view>
<view class="dakaBtn" @tap="kuickSign()" v-if="signList.indexOf(currentDay) == -1 && currentDay == linshiDay">
<text style="font-size: 24rpx;">签到</text>
</view>
<view v-else class="dakaBtn" style="border-color: #fff;">
</view>
<!-- <view v-else class="dakaBtn" style="border-color: #fff;">
<text style=" color:#a3a3a3;">今天已签到</text>
</view>
</view> -->
</view>
</view>
<swiper class="swiper scroll-view_H" @animationfinish="animationfinish" @change="swiperChange" :current='currentIndex' :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
@@ -30,7 +33,7 @@
linshiDay == item1 ? 'linshiDay':'']" @click="getInfo(item1)">
<span class="day"><em>{{item1}}</em> </span>
<u-icon v-if="signList.indexOf(item1) != -1" name="checkbox-mark" color="#fff" size="28" style="margin: 0 auto; width: 28px; text-align: center;"></u-icon>
<span v-if="signList.indexOf(item1) == -1 && currentDay > item1" class="buka">未签</span>
<span v-if="signList.indexOf(item1) == -1 && currentDay > item1" class="buka" >未签</span>
<span v-if="currentDay < item1" class="weidaka">未开始</span>
<span v-if="currentDay == item1 && signList.indexOf(item1) == -1" class="daka" @click="kuickSign()">签到</span>
</view>
@@ -357,8 +360,7 @@
title:'未来日期不可签到',
icon: 'none'
})
}else{
this.linshiDay = index
}else{
this.getTask(index)
}
},
@@ -409,6 +411,7 @@
'days': index
}
console.log(data)
this.linshiDay = index
this.$http
.post('book/task/applist', data)
.then(res => {
@@ -430,10 +433,47 @@
uni.hideLoading()
})
},
// 补卡
buSign(day){
console.log('正在补卡',this.taskInfo)
if(!this.taskInfo.id){
uni.showToast({
title:'当天未发布打卡任务',
icon:'none'
})
return
}
let data = {
"bookId": this.bookid,
"userId": this.userInfo.id,
"tid": this.taskInfo.id,
"days":this.linshiDay
}
console.log(data,'data')
$http.request({
url : 'book/clockinPunch/save',
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
}).then(res => {
if (res.code == 0) {
//console.log(res, '快捷签到')
uni.showToast({
title:'签到成功'
})
this.addTextShow = false
this.formData.content = ''
this.formData.images = []
this.getmySign()
this.getAllSign(this.taskInfo)
}
});
},
// 快捷签到
kuickSign(){
console.log()
kuickSign(){
let data = {
"bookId": this.bookid,
"userId": this.userInfo.id,
@@ -706,11 +746,12 @@
.buka {
font-size: 24rpx;
display: inline-block; padding: 0 6rpx;
display: inline-block; padding: 0 12rpx;
color: #888;
// border: 1px solid #888;
margin: 10px 0;
border-radius: 15rpx;
border-radius: 20rpx;
margin-bottom: 0; ;
}