任务修改
This commit is contained in:
@@ -11,27 +11,32 @@
|
||||
<u-image class="task_icon2 u-relative" src="../../static/images/me/task_icon2.png"></u-image>
|
||||
</view>
|
||||
|
||||
<view class="content signIn margin-lr padding bg-white u-relative" v-if="list.length" style="margin-bottom: 32rpx;">
|
||||
<view class="content signIn margin-lr padding bg-white u-relative" v-if="isShowMoneyPay" style="margin-bottom: 32rpx;">
|
||||
<view class="title flex justify-between">
|
||||
<view>已连续签到 <text class="num">3</text> 天</view>
|
||||
<view class="dk flex">
|
||||
<view>已连续签到 <text class="num">{{signDays}}</text> 天</view>
|
||||
<!-- <view class="dk flex">
|
||||
<text style="margin-right: 20rpx;">打卡提醒</text>
|
||||
<u-switch v-model="checked" size="35" active-color="#EA9EA8 "></u-switch>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="signInList flex justify-between">
|
||||
<text class="line"></text>
|
||||
<view class="signIn-Item" v-for="(item,index) in signInList" :key="index">
|
||||
<image class="signIn_icon" src="../../static/images/signIn_icon1.png" mode="">
|
||||
<view class="signIn-Item"
|
||||
:class="{active: item.showText == '待签到'||item.showText == '未签到'||item.showText == '已签到'}"
|
||||
v-for="(item,index) in signInList" :key="index"
|
||||
>
|
||||
<image class="signIn_icon" v-if="item.showText == '未签到'" src="../../static/images/signIn_icon2.png" mode="">
|
||||
<image class="signIn_icon" v-if="item.showText == '已签到'" src="../../static/images/signIn_icon3.png" mode="">
|
||||
<image class="signIn_icon" v-if="item.showText != '未签到'&&item.showText != '已签到'" src="../../static/images/signIn_icon1.png" mode="">
|
||||
<view class="radius"></view>
|
||||
<view class="_label">{{item.name}}</view>
|
||||
<view class="_label">{{item.showText}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<viwe>连续签到7天即可享受惊喜大礼包</viwe>
|
||||
<view class="tishi">连续签到7天即可获得7元奖励</view>
|
||||
|
||||
<view class="signInBtn">
|
||||
<view>点击签到</view>
|
||||
<view class="signInBtn" @click="taskReceive(15)">
|
||||
<view>{{signInBtn}}</view>
|
||||
<view class="signInBtnBg"></view>
|
||||
</view>
|
||||
|
||||
@@ -39,7 +44,9 @@
|
||||
|
||||
<view class="content margin-lr padding bg-white u-relative" v-if="list.length">
|
||||
|
||||
<view class="cell flex justify-between" v-for="(item,index) in list" :key="index">
|
||||
<view class="cell flex justify-between" v-for="(item,index) in list" :key="index"
|
||||
v-if="(item.buttonUrl=='/me/invite/index'&&isShowMoneyPay)||item.buttonUrl!='/me/invite/index'"
|
||||
>
|
||||
<view class="cell_left flex">
|
||||
<view class="cell_title flex">
|
||||
<view class="u-font-28 text-bold title" :style="{alignSelf: item.rewardImg?'center':'flex-start'}">{{ item.title}}</view>
|
||||
@@ -72,6 +79,7 @@
|
||||
},
|
||||
list: [],
|
||||
checked:false,
|
||||
signDays: 0,
|
||||
signInList: [
|
||||
{ name: '第一天' },
|
||||
{ name: '第二天' },
|
||||
@@ -81,12 +89,50 @@
|
||||
{ name: '第六天' },
|
||||
{ name: '第七天' },
|
||||
],
|
||||
signInBtn: '点击签到',
|
||||
isShowMoneyPay: true,
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getTaskdata()
|
||||
this.getsignIn()
|
||||
this.$Request.getT("app/common/type/919", {}).then(res => {
|
||||
if (res.code == 0) {
|
||||
const sysInfo = uni.getSystemInfoSync();
|
||||
let isIos = sysInfo.platform == 'ios'
|
||||
this.isShowMoneyPay = !(res.data.value == '1' && isIos)
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getsignIn() {
|
||||
this.$Request.getT('app/userSignRecord/getUserSignData', {}).then(res => {
|
||||
if (res.code == 0 ) {
|
||||
this.signInList = res.data.recordList
|
||||
this.signDays = res.data.signDays
|
||||
this.signInList.map((item,index)=>{
|
||||
if (item.showText == '待签到'&&index>0) {
|
||||
this.signInBtn = this.signInList[index-1].status == 0 ? '重新签到' : '点击签到'
|
||||
}
|
||||
let someDate = new Date(item.signDay); // 假设这是需要判断的日期
|
||||
if (item.signDay && this.isToday(someDate)) {
|
||||
this.signInBtn = '已签到'
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
isToday (date) {
|
||||
const today = new Date();
|
||||
return date.getDate() === today.getDate() // 比较日期
|
||||
&& date.getMonth() === today.getMonth() // 比较月份
|
||||
&& date.getFullYear() === today.getFullYear(); // 比较年份
|
||||
},
|
||||
/**
|
||||
* 跳转
|
||||
* @param {Object} item
|
||||
@@ -123,16 +169,16 @@
|
||||
this.$Request.getT('app/taskCenter/taskReceive', data).then(res => {
|
||||
if (res.code == 0 ) {
|
||||
uni.showToast({
|
||||
title: '领取成功',
|
||||
title: id==15?'签到成功':'领取成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
this.getTaskdata()
|
||||
this.getsignIn()
|
||||
},1000)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
uni.switchTab({
|
||||
url: "/pages/index/index"
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -312,8 +358,20 @@
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
}
|
||||
.signIn-Item.active{
|
||||
.radius{
|
||||
background-color: #EA9EA8;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
.tishi{
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
color: #7F7F7F;
|
||||
}
|
||||
|
||||
.signInBtn{
|
||||
width: 355rpx;
|
||||
height: 64rpx;
|
||||
|
||||
Reference in New Issue
Block a user