|
@@ -34,7 +34,6 @@
|
|
:class="{ 'bg-amber-200': i >= todayIndex || day.status, 'bg-gray-200': i < todayIndex }"
|
|
:class="{ 'bg-amber-200': i >= todayIndex || day.status, 'bg-gray-200': i < todayIndex }"
|
|
class="flex justify-center items-center rounded-full"
|
|
class="flex justify-center items-center rounded-full"
|
|
v-for="(day, i) in signList"
|
|
v-for="(day, i) in signList"
|
|
- @click="sign(i)"
|
|
|
|
>
|
|
>
|
|
<div
|
|
<div
|
|
style="width: 45rpx; height: 45rpx"
|
|
style="width: 45rpx; height: 45rpx"
|
|
@@ -56,6 +55,9 @@
|
|
<span v-else="day.status" class="fs12 text-grey-500">未签到</span>
|
|
<span v-else="day.status" class="fs12 text-grey-500">未签到</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="signInButton" @click="sign()">
|
|
|
|
+ {{ signList[todayIndex].status ? '今日已签到' : '立即签到' }}
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<div class="card rounded-md shadow-sm mx-auto mt-4 py-2">
|
|
<div class="card rounded-md shadow-sm mx-auto mt-4 py-2">
|
|
<div class="fs16 bold italic text-gray-900 pl-3 my-2">消费领优惠券</div>
|
|
<div class="fs16 bold italic text-gray-900 pl-3 my-2">消费领优惠券</div>
|
|
@@ -169,13 +171,20 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
sign(i) {
|
|
sign(i) {
|
|
- console.log(this.signList[i].status)
|
|
|
|
- if (i == this.todayIndex && !this.signList[i].status) {
|
|
|
|
|
|
+ // console.log(this.signList[i].status)
|
|
|
|
+ // if (i == this.todayIndex && !this.signList[i].status) {
|
|
|
|
+ // }
|
|
|
|
+ if (!this.signList[this.todayIndex].status) {
|
|
signToday().then(this.getList)
|
|
signToday().then(this.getList)
|
|
wx.showToast({
|
|
wx.showToast({
|
|
title: '签到成功',
|
|
title: '签到成功',
|
|
icon: 'sucess',
|
|
icon: 'sucess',
|
|
})
|
|
})
|
|
|
|
+ } else {
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: '今日已签到',
|
|
|
|
+ icon: 'none',
|
|
|
|
+ })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
getSafeAreaTop() {
|
|
getSafeAreaTop() {
|
|
@@ -200,4 +209,15 @@ export default {
|
|
color: #969696;
|
|
color: #969696;
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
}
|
|
}
|
|
|
|
+.signInButton {
|
|
|
|
+ margin: 10px auto;
|
|
|
|
+ background: #ff9235;
|
|
|
|
+ width: 20vw;
|
|
|
|
+ height: 30px;
|
|
|
|
+ color: #fff;
|
|
|
|
+ border-radius: 15px;
|
|
|
|
+ line-height: 30px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|