ios 首页 任务 我的 修改

This commit is contained in:
duan
2024-12-30 22:30:10 +08:00
parent 9a52daeffe
commit c978fab954
33 changed files with 3400 additions and 696 deletions

View File

@@ -17,15 +17,14 @@
<image class="task_icon2 u-relative" src="../../static/images/me/task_icon2.png"></image>
</view>
<view class="content signIn margin-lr padding bg-white u-relative" style="margin-bottom: 32rpx;">
<view class="title flex justify-between">
<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 class="content signIn margin-lr bg-white u-relative" style="margin-bottom: 32rpx;">
<view class="">
<image src="../../static/dwbimgs/renwubg.png"
style="width: 100%;height: 78rpx;position: absolute;left: 0;top: 0;z-index:1" mode=""></image>
<view style="z-index: 9999;position: absolute;text-align: center;width: 98%;">已连续签到 <text class="num"
style="color: #EC6F48;margin: 0 10rpx;">{{signDays}}</text> </view>
</view>
<view class="signInList flex justify-between">
<!-- <view class="signInList flex justify-between">
<text class="line"></text>
<view class="signIn-Item"
:class="{active: item.showText == '待签到'||item.showText == '未签到'||item.showText == '已签到'}"
@@ -39,9 +38,24 @@
<view class="radius"></view>
<view class="_label">{{item.showText}}</view>
</view>
</view> -->
<view style="margin-top: 100rpx; display: flex;align-items: center; justify-content: space-between;">
<view class="" v-for="item in signInList" :key="item" style="position: relative;"
:style="filterDate(item)=='已签到'?'color:#EFA765':'color:#999'">
{{filterDate(item)}}
<view
style="margin-top: 20rpx;;width: 80rpx;height: 94rpx;background: linear-gradient( 180deg, #FFF7E3 0%, #FFFFFF 100%);border-radius: 14rpx 14rpx 0rpx 0rpx;"
:style="filterDate(item)=='已签到'?'color:#999':'color:#EFA765'">
{{item.signDay.substr(5,8)}}
</view>
<image v-if="item.status==0" src="../../static/dwbimgs/xing (1).png"
style="width: 52rpx;height: 48rpx;position: absolute;top: 100rpx;left: 14rpx;" mode=""></image>
<image v-else src="../../static/dwbimgs/xing (2).png"
style="width: 52rpx;height: 48rpx;position: absolute;top: 100rpx;left: 14rpx;" mode="">
</image>
</view>
</view>
<view class="tishi">连续签到7天即可获得7元奖励</view>
<!-- <view class="tishi">连续签到7天即可获得7元奖励</view> -->
<!-- <view class="signInBtn" @click="goNav({jumpType: 0, id:15, buttonTitle: '去领取'})">
<view>{{signInBtn}}</view>
@@ -86,6 +100,10 @@
</template>
<script>
import {
data
} from '../../tuniao-ui/libs/mixin/mixin'
export default {
data() {
@@ -97,28 +115,7 @@
list: [],
checked: false,
signDays: 0,
signInList: [{
name: '第一天'
},
{
name: '第二天'
},
{
name: '第三天'
},
{
name: '第四天'
},
{
name: '第五天'
},
{
name: '第六天'
},
{
name: '第七天'
},
],
signInList: [],
signInBtn: '点击签到',
isShowMoneyPay: true,
}
@@ -131,7 +128,7 @@
onShow() {
this.getTaskdata()
this.getsignIn()
this.$Request.getT("app/common/type/919", {}).then(res => {
this.$Request.getT("/app/common/type/919", {}).then(res => {
if (res.code == 0) {
const sysInfo = uni.getSystemInfoSync();
let isIos = sysInfo.platform == 'ios'
@@ -144,7 +141,24 @@
//说明javascript的乘法结果会有误差在两个浮点数相乘的时候会比较明显。这个函数返回较为精确的乘法结果。
//调用mul(arg1,arg2)
//返回值arg1乘以arg2的精确结果
filterDate(d) {
// 获取当前时间
// 循环比较,返回字段
if (d.status == 1) {
return '已签到'
} else {
return '待签到'
// let time1 = d.signDay
// let date1 = new Date(time1);
// let date2 = new Date().getTime() + 8 * 60 * 60;
// if (date1.getTime() < date2) {
// return '未签到'
// } else if (date1.getTime() > date2) {
// return '待签到'
// }
}
},
mul(arg1, arg2) {
var m = 0,
s1 = arg1.toString(),
@@ -217,7 +231,7 @@
}
r1 = Number(arg1.toString().replace(".", ""));
r2 = Number(arg2.toString().replace(".", ""));
},
/**
* 保留小数n位不进行四舍五入
@@ -249,19 +263,19 @@
getsignIn() {
this.$Request.getT('app/userSignRecord/getUserSignData', {}).then(res => {
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.signDate && this.isToday(someDate)) {
this.signInBtn = '已签到'
}
})
// 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.signDate && this.isToday(someDate)) {
// this.signInBtn = '已签到'
// }
// })
} else {
// uni.showToast({
// title: res.msg,
@@ -339,7 +353,7 @@
let data = {
id: id
}
this.$Request.getT('app/taskCenter/taskReceive', data).then(res => {
this.$Request.getT('/app/taskCenter/taskReceive', data).then(res => {
if (res.code == 0) {
uni.showToast({
title: id == 15 ? '签到成功' : '领取成功',
@@ -362,7 +376,7 @@
*/
getTaskdata() {
this.$Request.getT('app/taskCenter/selectTaskCenter', {}).then(res => {
this.$Request.getT('/app/taskCenter/selectTaskCenter', {}).then(res => {
if (res.code == 0) {
this.list = res.data
}
@@ -596,6 +610,7 @@
font-weight: 400;
font-size: 20rpx;
color: #7F7F7F;
margin-top: 20rpx;
}
.signInBtn {