This commit is contained in:
GaoHao 2024-12-24 14:01:03 +08:00
commit a787c014cb
4 changed files with 55 additions and 15 deletions

View File

@ -27,7 +27,8 @@
"VideoPlayer" : {},
"Camera" : {},
"Record" : {},
"OAuth" : {}
"OAuth" : {},
"Push" : {}
},
/* */
"distribute" : {

View File

@ -1,11 +1,11 @@
<!-- 任务中心 -->
<template>
<view class="container">
<!-- <u-navbar :background="background" :is-back="false" :title="title" :border-bottom="false"></u-navbar> -->
<view class="task_bg u-absolute">
<image class="task_bg" src="../../static/images/me/task_bg.png"></image>
</view>
<view class="navTitle">
<u-navbar v-if="!isIos" :background="background" :is-back="false" :title="title" :border-bottom="false"></u-navbar>
<view class="navTitle" v-else>
<view></view>
<view class="title">任务大厅</view>
<image @click="goNav({jumpType:1,buttonUrl:'/pages/me/index'})" class="navTitleIcon"
@ -31,11 +31,11 @@
: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="">
mode="" />
<image class="signIn_icon" v-if="item.showText == '已签到'"
src="../../static/images/signIn_icon3.png" mode="">
src="../../static/images/signIn_icon3.png" mode="" />
<image class="signIn_icon" v-if="item.showText != '未签到'&&item.showText != '已签到'"
src="../../static/images/signIn_icon1.png" mode="">
src="../../static/images/signIn_icon1.png" mode="" />
<view class="radius"></view>
<view class="_label">{{item.showText}}</view>
</view>
@ -53,7 +53,7 @@
<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"
v-if="(item.buttonUrl=='/me/invite/index'&&isShowMoneyPay)||item.buttonUrl!='/me/invite/index'">
v-if="((item.buttonUrl=='/me/invite/index'&&isShowMoneyPay)||item.buttonUrl!='/me/invite/index')||(isAndroid&&item.title =='观看视频奖励')">
<view class="cell_left flex">
<view class="cell_title flex">
<view class="u-font-28 text-bold title"
@ -126,22 +126,32 @@
],
signInBtn: '点击签到',
isShowMoneyPay: true,
isLoading: false
isIos: false,
isLoading: false,
isAndroid: false,
}
},
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.isIos = /iOS/.test(sysInfo.platform);
//
// #ifdef APP
this.isAndroid = sysInfo.platform === 'android'
// #endif
this.isShowMoneyPay = !(res.data.value == '1' && isIos)
}
});
},
async onReady() {
this.isLoading = true;
console.log(1)
// 广
setTimeout(() => {
this.$refs.adRewardedVideo.load();
@ -149,6 +159,7 @@
},
methods: {
showAd() {
console.log(this.isLoading)
if (this.isLoading) {
return
}
@ -156,6 +167,7 @@
},
onadload(e) {
this.isLoading = false;
console.log(2)
console.log('广告数据加载成功');
},
async onadclose(e) {
@ -163,10 +175,25 @@
if (detail && detail.isEnded) {
//
// /sqx_fast/app/ad/state
let res = this.$Request.getT('app/ad/state', {
let res = await this.$Request.getT('app/ad/state', {
extraKey: 1
})
console.log(res)
this.$Request.get('/app/common/type/813').then(res => {
if (res.code == 0 && res.data.value) {
if (res.data.value == '是') {
this.getActivitys()
}
}
})
this.$Request.getT('/app/common/type/921').then(res => {
if (res.code == 0) {
console.log(res)
uni.showToast({
title: '获得'+res.data.value+'分钟免费时长',
icon: 'none'
})
}
})
} else {
// 退
}
@ -175,8 +202,12 @@
},
onaderror(e) {
// 广
console.log("广告加载失败")
this.isLoading = false;
},
/**
* 获取签到数据
*/
getsignIn() {
this.$Request.getT('app/userSignRecord/getUserSignData', {}).then(res => {
if (res.code == 0) {
@ -199,6 +230,11 @@
}
})
},
/**
* 校验是否为当天
* @param date
*/
isToday(date) {
const today = new Date();
return date.getDate() === today.getDate() //
@ -207,6 +243,7 @@
&&
date.getFullYear() === today.getFullYear(); //
},
/**
* 跳转
* @param {Object} item
@ -215,10 +252,12 @@
// jumpType (integer, optional): 1 2 ,
// type (integer, optional): 1 2 9 ,
// buttonUrl
console.log(item)
if (item.jumpType == 0) {
if (item.buttonTitle.indexOf("领取") != -1) {
this.taskReceive(item.id)
}if (item.buttonTitle.indexOf("观看视频") != -1) {
this.showAd()
} else {
uni.switchTab({
url: "/pages/index/index"

View File

@ -1,7 +1,7 @@
<!-- 任务中心 -->
<template>
<view class="container">
<!-- <u-navbar :background="background" :is-back="false" :title="title" :border-bottom="false"></u-navbar> -->
<u-navbar :background="background" :is-back="true" :title="title" :border-bottom="false"></u-navbar>
<view class="task_bg u-relative"></view>
@ -24,7 +24,7 @@
return {
title: '',
background: {
backgroundImage: 'linear-gradient(to right, #DDEAFC 0%, #C8DBFA 49%, #AFC9F6 100%)'
backgroundImage: 'transparent'
},
list: [],
source: null

View File

@ -1,7 +1,7 @@
<!-- 任务中心 -->
<template>
<view class="container">
<!-- <u-navbar :background="background" :is-back="false" :title="title" :border-bottom="false"></u-navbar> -->
<u-navbar :background="background" :is-back="true" :title="title" :border-bottom="false"></u-navbar>
<view class="task_bg u-relative">
<u-image class="task_bg" src="../../static/images/task/member_bg.png" ></u-image>
<view class="title ">每月打卡免费领</view>
@ -35,7 +35,7 @@
return {
title: '',
background: {
backgroundImage: 'linear-gradient(to right, #DDEAFC 0%, #C8DBFA 49%, #AFC9F6 100%)'
backgroundImage: 'transparent',
},
list: [],
source: null,