This commit is contained in:
YeMingfei666 2024-12-24 14:36:12 +08:00
commit 43722d9b00
5 changed files with 278 additions and 139 deletions

View File

@ -85,14 +85,15 @@
},
"oauth" : {
"apple" : {},
"univerify" : {},
"weixin" : {
"appid" : "wxeaffcaea958472d3",
"appsecret" : "32f6f3ce599abff2fa0191a36780c66c",
"UniversalLinks" : "https://maxiong.xianmxkj.com/"
}
},
"univerify" : {}
},
"ad" : {
"gdt" : {}
},
"ad" : {},
"push" : {
"unipush" : {}
}

View File

@ -530,15 +530,15 @@
goMsg() {
let kefu = uni.getStorageSync('kefu'); // 1 2
let kefuPhone = uni.getStorageSync('kefuPhone');
if (kefu === 1) {
if (kefu == 1) {
uni.navigateTo({
url: '/me/setting/kefu'
})
} else if (kefu === 3) {
} else if (kefu == 3) {
uni.makePhoneCall({
phoneNumber: kefuPhone //
});
} else if (kefu === 2) {
} else if (kefu == 2) {
// #ifdef MP-WEIXIN
let that = this
try {

View File

@ -1,81 +1,98 @@
<!-- 任务中心 -->
<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>
<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" src="../../static/images/my.png" ></image>
<image @click="goNav({jumpType:1,buttonUrl:'/pages/me/index'})" class="navTitleIcon"
src="../../static/images/my.png"></image>
</view>
<view class="icon u-relative padding">
<image class="task_icon1 u-relative" src="../../static/images/me/task_icon1.png"></image>
<view class="icon_title u-font-32 text-bold u-relative">新人好礼送不停</view>
<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">
<!-- <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"
: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.showText}}</view>
<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.showText}}</view>
</view>
</view>
<view class="tishi">连续签到7天即可获得7元奖励</view>
<!-- <view class="signInBtn" @click="goNav({jumpType: 0, id:15, buttonTitle: '去领取'})">
<view>{{signInBtn}}</view>
<view class="signInBtnBg"></view>
</view> -->
</view>
<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'"
>
<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')||(isAndroid&&item.title =='观看视频奖励')">
<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>
<view class="u-font-28 text-bold title"
:style="{alignSelf: item.rewardImg?'center':'flex-start'}">{{ item.title}}</view>
<u-image v-if="item.rewardImg" class="cell_icon" :src="item.rewardImg "></u-image>
<view class="u-font-24 tip">{{ item.rewardDetail }}</view>
</view>
<view class="subhead u-font-24">{{ item.detail }}</view>
</view>
<view class="cell_right flex">
<view v-if=" item.disabled " class="btn u-font-24 text-bold" :style="{backgroundColor: item.buttonBgColor,color: item.buttonFontColor }" @click="goNav(item)">{{ item.type == 1 ? item.buttonTitle : item.number ? `${item.discNumber}/${item.number}` : ( item.discNumber <= 0 ? item.buttonTitle : `剩余${item.discNumber}`) }}</view>
<view v-else class="btn u-font-24 text-bold disabled">{{ item.type == 1 ? item.buttonTitle : item.number ? `${item.discNumber}/${item.number}` : ( item.discNumber <= 0 ? item.buttonTitle : `剩余${item.discNumber}`) }}</view>
<view v-if=" item.disabled " class="btn u-font-24 text-bold"
:style="{backgroundColor: item.buttonBgColor,color: item.buttonFontColor }"
@click="goNav(item)">
{{ item.type == 1 ? item.buttonTitle : item.number ? `${item.discNumber}/${item.number}` : ( item.discNumber <= 0 ? item.buttonTitle : `剩余${item.discNumber}`) }}
</view>
<view v-else class="btn u-font-24 text-bold disabled">
{{ item.type == 1 ? item.buttonTitle : item.number ? `${item.discNumber}/${item.number}` : ( item.discNumber <= 0 ? item.buttonTitle : `剩余${item.discNumber}`) }}
</view>
<!-- <view v-else class="btn u-font-24 text-bold" @click="goNav(item)">{{ item.buttonTitle }}</view> -->
<view v-if=" item.buttonUnderContent && item.buttonUnderUrl " class="u-font-22 tip" @click="goNav({buttonUrl: item.buttonUnderUrl, jumpType: 1,title: item.title})">{{ item.buttonUnderContent}}</view>
<view v-if=" item.buttonUnderContent && item.buttonUnderUrl " class="u-font-22 tip"
@click="goNav({buttonUrl: item.buttonUnderUrl, jumpType: 1,title: item.title})">
{{ item.buttonUnderContent}}
</view>
</view>
</view>
<!-- 激励视频广告 -->
<ad-rewarded-video ref="adRewardedVideo" adpid="1531580352" :preload="false" :loadnext="false"
:disabled="true" v-slot:default="{loading, error}" @load="onadload" @close="onadclose"
@error="onaderror">
<view class="ad-error" v-if="error">{{error}}</view>
</ad-rewarded-video>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: '',
@ -83,41 +100,122 @@
backgroundImage: 'linear-gradient(to right, #FFE5EA 0%, #E4F5FB 49%, #FFF0EE 100%)'
},
list: [],
checked:false,
checked: false,
signDays: 0,
signInList: [
{ name: '第一天' },
{ name: '第二天' },
{ name: '第三天' },
{ name: '第四天' },
{ name: '第五天' },
{ name: '第六天' },
{ name: '第七天' },
signInList: [{
name: '第一天'
},
{
name: '第二天'
},
{
name: '第三天'
},
{
name: '第四天'
},
{
name: '第五天'
},
{
name: '第六天'
},
{
name: '第七天'
},
],
signInBtn: '点击签到',
isShowMoneyPay: true,
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();
}, 1000)
},
methods: {
showAd() {
console.log(this.isLoading)
if (this.isLoading) {
return
}
this.$refs.adRewardedVideo.show();
},
onadload(e) {
this.isLoading = false;
console.log(2)
console.log('广告数据加载成功');
},
async onadclose(e) {
const detail = e.detail
if (detail && detail.isEnded) {
//
// /sqx_fast/app/ad/state
let res = await this.$Request.getT('app/ad/state', {
extraKey: 1
})
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 {
// 退
}
//this.isLoading = true;
//this.$refs.adRewardedVideo.load();
},
onaderror(e) {
// 广
console.log("广告加载失败")
this.isLoading = false;
},
/**
* 获取签到数据
*/
getsignIn() {
this.$Request.getT('app/userSignRecord/getUserSignData', {}).then(res => {
if (res.code == 0 ) {
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 ? '重新签到' : '点击签到'
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)) {
@ -132,54 +230,64 @@
}
})
},
isToday (date) {
/**
* 校验是否为当天
* @param date
*/
isToday(date) {
const today = new Date();
return date.getDate() === today.getDate() //
&& date.getMonth() === today.getMonth() //
&& date.getFullYear() === today.getFullYear(); //
return date.getDate() === today.getDate() //
&&
date.getMonth() === today.getMonth() //
&&
date.getFullYear() === today.getFullYear(); //
},
/**
* 跳转
* @param {Object} item
*/
goNav( item ) {
goNav(item) {
// jumpType (integer, optional): 1 2 ,
// type (integer, optional): 1 2 9 ,
// buttonUrl
console.log(item)
if ( item.jumpType == 0) {
if ( item.buttonTitle.indexOf("领取") != -1) {
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"
})
}
} else if ( item.jumpType == 1) {
let source,buttonUrl;
} else if (item.jumpType == 1) {
let source, buttonUrl;
buttonUrl = item.buttonUrl
if ( item.title && item.title.indexOf('每周') != -1 ) {
if (item.title && item.title.indexOf('每周') != -1) {
source = 2
buttonUrl = item.buttonUrl+'?source='+source
buttonUrl = item.buttonUrl + '?source=' + source
}
if ( item.title && item.title.indexOf('每月') != -1 ) {
if (item.title && item.title.indexOf('每月') != -1) {
source = 3
buttonUrl = item.buttonUrl+'?source='+source
buttonUrl = item.buttonUrl + '?source=' + source
}
console.log(buttonUrl)
uni.navigateTo({
url: buttonUrl
})
} else if( item.jumpType == 3) {
} else if (item.jumpType == 3) {
uni.switchTab({
url: item.buttonUrl
})
} else if( item.jumpType == 2) {
} else if (item.jumpType == 2) {
plus.runtime.openURL(item.buttonUrl)
}
},
/**
* 领取
*/
@ -188,15 +296,15 @@
id: id
}
this.$Request.getT('app/taskCenter/taskReceive', data).then(res => {
if (res.code == 0 ) {
if (res.code == 0) {
uni.showToast({
title: id==15?'签到成功':'领取成功',
title: id == 15 ? '签到成功' : '领取成功',
icon: 'none'
})
setTimeout(()=>{
setTimeout(() => {
this.getTaskdata()
this.getsignIn()
},1000)
}, 1000)
} else {
uni.switchTab({
url: "/pages/index/index"
@ -204,20 +312,20 @@
}
})
},
/**
* 获取任务列表
*/
getTaskdata() {
this.$Request.getT('app/taskCenter/selectTaskCenter', {}).then(res => {
if (res.code == 0 ) {
if (res.code == 0) {
this.list = res.data
}
uni.stopPullDownRefresh();
})
},
/**
* 下拉加载
*/
@ -225,38 +333,42 @@
console.log(2)
this.getTaskdata();
},
}
}
</script>
<style lang="scss">
.container{
.container {
width: 100%;
background-color: #F3F4F8;
.task_bg{
width: 100%!important;
height: 494rpx!important;
.task_bg {
width: 100% !important;
height: 494rpx !important;
}
.icon{
.icon_title{
.icon {
.icon_title {
color: #000000;
margin-left: 28rpx;
top: -20rpx;
}
.task_icon1{
width: 74rpx!important;
height: 78rpx!important;
.task_icon1 {
width: 74rpx !important;
height: 78rpx !important;
margin-left: 235rpx;
}
.task_icon2{
width: 126rpx!important;
height: 120rpx!important;
.task_icon2 {
width: 126rpx !important;
height: 120rpx !important;
top: -40rpx;
}
}
.navTitle{
.navTitle {
width: 100%;
position: relative;
z-index: 9;
@ -264,56 +376,67 @@
align-items: center;
justify-content: space-between;
padding: 106rpx 28rpx 0 28rpx;
.title{
.title {
font-weight: bold;
font-size: 40rpx;
color: #000000;
}
.navTitleIcon{
width: 40.48rpx!important;
height: 46rpx!important;
.navTitleIcon {
width: 40.48rpx !important;
height: 46rpx !important;
align-self: flex-end;
}
}
.content{
.content {
border-radius: 16rpx;
top: -115rpx;
padding: 28rpx;
.cell{
.cell {
align-items: center;
padding: 32rpx 0;
border-bottom: 2rpx solid #EBEBEB;
.cell_left{
.cell_left {
flex-direction: column;
.cell_title{
.cell_title {
align-items: center;
margin-bottom: 12rpx;
color: #333;
.title{
.title {
flex-shrink: 0;
}
.cell_icon{
width: 34rpx!important;
height: 34rpx!important;
.cell_icon {
width: 34rpx !important;
height: 34rpx !important;
margin-left: 16rpx;
}
.tip{
.tip {
margin-left: 22rpx;
color: #FC5B67;
}
}
.subhead{
.subhead {
color: #999;
}
}
.cell_right{
.cell_right {
flex-direction: column;
align-items: center;
flex-shrink: 0;
margin-left: 20rpx;
.btn{
.btn {
width: 148rpx;
height: 56rpx;
line-height: 56rpx;
@ -322,49 +445,58 @@
color: #FFFFFF;
border-radius: 12rpx 12rpx 12rpx 12rpx;
}
.tip{
.tip {
color: #EC6F48;
height: 44rpx;
line-height: 44rpx;
margin-top: 5rpx;
}
.opt{
.opt {
color: #D39B7E;
background-color: #FBF3EB;
}
.disabled{
.disabled {
color: #999999;
background-color: #E2E2E2;
}
}
}
.cell:last-child{
.cell:last-child {
border-bottom: none;
}
}
.signIn{
>.title{
.signIn {
>.title {
font-weight: 400;
font-size: 32rpx;
color: #666666;
.num{
.num {
font-weight: bold;
color: #EC6F48;
margin: 0 10rpx;
}
.dk{
.dk {
font-weight: 400;
font-size: 24rpx;
color: #333333;
align-items: center;
}
}
.signInList{
.signInList {
margin-top: 24rpx;
margin-bottom: 26rpx;
position: relative;
.line{
.line {
width: 92%;
height: 0rpx;
border-radius: 0rpx 0rpx 0rpx 0rpx;
@ -375,46 +507,53 @@
bottom: 57rpx;
margin: auto;
}
.signIn-Item{
.signIn-Item {
display: flex;
flex-direction: column;
align-items: center;
position: relative;
z-index: 5;
.signIn_icon{
.signIn_icon {
width: 52.33rpx;
height: 51.68rpx;
margin-bottom: 32rpx;
}
.radius{
.radius {
width: 26rpx;
height: 26rpx;
border-radius: 10rpx;
background-color: #D8D5D5;
}
._label{
._label {
font-weight: 400;
font-size: 18rpx;
color: #333333;
margin-top: 24rpx;
}
}
.signIn-Item.active{
.radius{
.signIn-Item.active {
.radius {
background-color: #EA9EA8;
}
}
}
.tishi{
.tishi {
width: 100%;
text-align: center;
font-weight: 400;
font-size: 20rpx;
color: #7F7F7F;
}
.signInBtn{
.signInBtn {
width: 355rpx;
height: 64rpx;
line-height: 64rpx;
@ -425,13 +564,14 @@
background: #EA9EA8;
border-radius: 14rpx 14rpx 14rpx 14rpx;
margin: 32rpx auto;
box-shadow: 0 0 0 rgba(234,158,168,0.75);
box-shadow: 0 0 0 rgba(234, 158, 168, 0.75);
position: relative;
}
.signInBtnBg{
.signInBtnBg {
width: 327rpx;
height: 52rpx;
background: rgba(234,158,168,0.75);
background: rgba(234, 158, 168, 0.75);
border-radius: 14rpx 14rpx 14rpx 14rpx;
opacity: 0.31;
position: absolute;
@ -442,6 +582,4 @@
}
}
}
</style>

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,