修改任务带签到字体

This commit is contained in:
duan
2025-01-13 11:28:15 +08:00
parent 4638a4a30d
commit ffac79fcdf

View File

@@ -18,7 +18,9 @@
<view> <view>
<view v-for="item in datas.signInList" :key="item.id" <view v-for="item in datas.signInList" :key="item.id"
:style="item.status == 1 ? 'color:#EFA765' : 'color:#999'"> :style="item.status == 1 ? 'color:#EFA765' : 'color:#999'">
<text class="" style="font-size: 28rpx;">
{{ item.status == 1 ? '已签到' : '待签到' }} {{ item.status == 1 ? '已签到' : '待签到' }}
</text>
<view :style="item.status == 1 ? 'color:#999' : 'color:#EFA765'"> <view :style="item.status == 1 ? 'color:#999' : 'color:#EFA765'">
{{ item.signDay.substr(5, 8) }} {{ item.signDay.substr(5, 8) }}
</view> </view>
@@ -44,11 +46,12 @@
:style="{ backgroundColor: item.buttonBgColor, color: item.buttonFontColor }" :style="{ backgroundColor: item.buttonBgColor, color: item.buttonFontColor }"
@tap="goNav(item)"> @tap="goNav(item)">
{{ item.type == 1 ? item.buttonTitle : item.number ? `${item.discNumber}/${item.number}` : ( {{ item.type == 1 ? item.buttonTitle : item.number ? `${item.discNumber}/${item.number}` : (
item.discNumber <= 0 ? item.buttonTitle : `剩余${item.discNumber}`) }} </view> item.discNumber <= 0 ? item.buttonTitle : `剩余${item.discNumber}`) }}
</view>
<view v-else class="btn disabled"> <view v-else class="btn disabled">
{{ item.type == 1 ? item.buttonTitle : item.number ? `${item.discNumber}/${item.number}` {{ item.type == 1 ? item.buttonTitle : item.number ? `${item.discNumber}/${item.number}`
: (item.discNumber <= 0 ? item.buttonTitle : `剩余${item.discNumber}`) }} <view : (item.discNumber <= 0 ? item.buttonTitle : `剩余${item.discNumber}`) }}
v-if="item.buttonUnderContent && item.buttonUnderUrl" class=" tip" <view v-if="item.buttonUnderContent && item.buttonUnderUrl" class=" tip"
@tap="goNav(item, item.buttonUnderUrl)"> @tap="goNav(item, item.buttonUnderUrl)">
{{ item.buttonUnderContent }} {{ item.buttonUnderContent }}
</view> </view>
@@ -66,16 +69,22 @@
</template> </template>
<script setup> <script setup>
import { import {
reactive, reactive,
getCurrentInstance, nextTick getCurrentInstance,
} from "vue"; nextTick
import { } from "vue";
onShow, onReachBottom import {
} from '@dcloudio/uni-app' onShow,
import { getUserSignData, selectTaskCenter, taskReceive } from '@/api/task/index.js' onReachBottom
const currentInstance = getCurrentInstance() } from '@dcloudio/uni-app'
let datas = reactive({ import {
getUserSignData,
selectTaskCenter,
taskReceive
} from '@/api/task/index.js'
const currentInstance = getCurrentInstance()
let datas = reactive({
signDays: 0, signDays: 0,
signInList: [], signInList: [],
list: [], list: [],
@@ -84,17 +93,17 @@ let datas = reactive({
urlCallback: {}, urlCallback: {},
adRewardedVideo: true, adRewardedVideo: true,
}) })
onShow(() => { onShow(() => {
getTaskdata() getTaskdata()
getsignIn() getsignIn()
// nextTick(() => { // nextTick(() => {
// currentInstance.ctx.$refs.adRewardedVideo.load(); // currentInstance.ctx.$refs.adRewardedVideo.load();
// }) // })
}) })
//广告播放成功回调 //广告播放成功回调
async function onadclose(e) { async function onadclose(e) {
const detail = e.detail const detail = e.detail
if (detail && detail.isEnded) { if (detail && detail.isEnded) {
// 正常播放结束 // 正常播放结束
@@ -114,8 +123,8 @@ async function onadclose(e) {
} else { } else {
// 播放中途退出 // 播放中途退出
} }
} }
async function goNav(item, url) { async function goNav(item, url) {
// jumpType (integer, optional): 跳转类型 1 内部路径 2 外部路径 , // jumpType (integer, optional): 跳转类型 1 内部路径 2 外部路径 ,
// type (integer, optional): 任务类型 1 普通任务 2 打卡任务 9 其它 , // type (integer, optional): 任务类型 1 普通任务 2 打卡任务 9 其它 ,
if (url) { if (url) {
@@ -133,7 +142,9 @@ async function goNav(item, url) {
} else { } else {
if (item.jumpType == 0) { if (item.jumpType == 0) {
if (item.title.indexOf("新人福利") != -1) { if (item.title.indexOf("新人福利") != -1) {
let res = await taskReceive({ id: item.id }) let res = await taskReceive({
id: item.id
})
if (res.code == 0) { if (res.code == 0) {
uni.showToast({ uni.showToast({
title: res.id == 15 ? '签到成功' : '领取成功', title: res.id == 15 ? '签到成功' : '领取成功',
@@ -170,7 +181,8 @@ async function goNav(item, url) {
buttonUrl = item.buttonUrl + '?source=3' buttonUrl = item.buttonUrl + '?source=3'
} }
if (item.title && item.title.indexOf('每月打卡奖励2') != -1) { if (item.title && item.title.indexOf('每月打卡奖励2') != -1) {
buttonUrl = `${item.buttonUrl}?standard=${item.discNumber == null ? true : false}&taskId=${item.id}` buttonUrl =
`${item.buttonUrl}?standard=${item.discNumber == null ? true : false}&taskId=${item.id}`
} }
uni.navigateTo({ uni.navigateTo({
@@ -184,18 +196,19 @@ async function goNav(item, url) {
} }
} }
} }
function onadload(e) {
function onadload(e) {
datas.adRewardedVideo = true; datas.adRewardedVideo = true;
} }
// 获得签到 // 获得签到
async function getsignIn() { async function getsignIn() {
let res = await getUserSignData() let res = await getUserSignData()
datas.signInList = res.recordList datas.signInList = res.recordList
datas.signDays = res.signDays datas.signDays = res.signDays
} }
// 获取任务列表 // 获取任务列表
async function getTaskdata() { async function getTaskdata() {
let res = await selectTaskCenter() let res = await selectTaskCenter()
if (!datas.isExamine) { if (!datas.isExamine) {
let arrData = [] let arrData = []
@@ -209,21 +222,20 @@ async function getTaskdata() {
} else { } else {
datas.list = res datas.list = res
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.u-absolute { .u-absolute {
position: absolute; position: absolute;
} }
.task_bg { .task_bg {
width: 100% !important; width: 100% !important;
height: 494rpx !important; height: 494rpx !important;
} }
.icon { .icon {
position: relative; position: relative;
padding: 32rpx; padding: 32rpx;
@@ -249,20 +261,17 @@ async function getTaskdata() {
top: -40rpx; top: -40rpx;
position: relative; position: relative;
} }
} }
.contentTop { .contentTop {
border-radius: 16rpx; border-radius: 16rpx;
top: -115rpx; top: -115rpx;
padding: 28rpx; padding: 20rpx;
margin-bottom: 32rpx; margin-bottom: 32rpx;
position: relative; position: relative;
background-color: #ffffff; background-color: #ffffff;
color: #666666; color: #666666;
margin-left: 32rpx; margin: 32rpx;
margin-right: 32rpx;
>view:first-child { >view:first-child {
>image { >image {
@@ -313,9 +322,9 @@ async function getTaskdata() {
} }
} }
} }
} }
.content { .content {
border-radius: 16rpx; border-radius: 16rpx;
top: -115rpx; top: -115rpx;
padding: 28rpx; padding: 28rpx;
@@ -411,5 +420,5 @@ async function getTaskdata() {
.cell:last-child { .cell:last-child {
border-bottom: none; border-bottom: none;
} }
} }
</style> </style>