添加补卡 未完成
This commit is contained in:
@@ -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; ;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user