@@ -8,7 +8,7 @@
< view class = "navTitle" >
< view > < / view >
< view class = "title" > 任务大厅 < / view >
< image @click ="goNav({jumpType:1,buttonUrl:'/pages/me/index'})" class = "navTitleIcon"
< image @click ="goNav({ jumpType: 1, buttonUrl: '/pages/me/index' })" class = "navTitleIcon"
src = "../../static/images/my.png" > < / image >
< / view >
< view class = "icon u-relative padding" >
@@ -22,7 +22,7 @@
< 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 >
style = "color: #EC6F48;margin: 0 10rpx;" > { { signDays } } < / text > 天 < / view >
< / view >
<!-- < view class = "signInList flex justify-between" >
< text class = "line" > < / text >
@@ -41,14 +41,14 @@
< / view > -- >
< view style = "margin-top: 100rpx; display: flex;align-items: center; justify-content: space-between;" >
< view class = "" v-for = "item in signInList" :key="item.id" style="position: relative;"
: style= "filterDate(item)=='已签到'? 'color:#EFA765': 'color:#999'" >
{ { filterDate ( item ) } }
: 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 ) } }
: 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"
< 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 = "" >
@@ -63,48 +63,49 @@
< / 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/yaoqing/ymf-yaoqing-home'&&isShowMoneyPay)||item.buttonUrl!='/me/yaoqing/ymf-yaoqing-home'" >
< view class = "cell flex justify-between" v-for = "(item, index) in list" :key="index" v-if="item.shows" >
< 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 >
< u-image v-if = "item.rewardImg" class="cell_icon" :src="item.rewardImg " > < / u -image >
: 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 }"
< 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 >
{{ 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 >
{ { 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-20 tip"
@click ="goNav({buttonUrl: item.buttonUnderUrl, jumpType: 1,title: item.title})" >
{{ item.buttonUnderContent }}
< view v-if = "item.buttonUnderContent && item.buttonUnderUrl" class="u-font-22 tip"
@click ="goNav({ id: item.id, buttonUrl: item.buttonUnderUrl, jumpType: 1, title: item.title, disabled: item.disabled, discNumber: item.discNumber })" >
{{ item.buttonUnderContent }}
< / view >
< / view >
< / view >
< / view >
< ! - - 激励视频广告 - - >
< ad-rewarded-video v-if = "adRewardedVideo" ref="adRewardedVideo" adpid="1531580352" :loadnext="true"
v -slot : default = "{ loading, error }" :url-callback = "urlCallback" @load ="onadload" @close ="onadclose"
@error ="onaderror" >
< view class = "ad-error" v-if = "error" > {{ error }} < / view >
< / ad -rewarded -video >
< / view >
< / template >
< script >
import {
import {
data
} from '../../tuniao-ui/libs/mixin/mixin'
} from '../../tuniao-ui/libs/mixin/mixin'
export default {
export default {
data ( ) {
return {
@@ -117,7 +118,10 @@
signDays : 0 ,
signInList : [ ] ,
signInBtn : '点击签到' ,
isShowMoneyPay : true ,
isShowMoneyPay : true , adRewardedVideo : true ,
adRewardedVideoloadNum : 0 ,
urlCallback : null ,
}
} ,
onLoad ( ) {
@@ -135,8 +139,62 @@
this . isShowMoneyPay = ! ( res . data . value == '1' && isIos )
}
} ) ;
this . $nextTick ( ( ) => {
this . adRewardedVideoloadNum = 0
this . $refs . adRewardedVideo . load ( ) ;
} )
} ,
methods : {
onadload ( e ) {
this . adRewardedVideo = true ;
console . log ( '广告数据加载成功' ) ;
} ,
/**
* 广告加载失败回调
* @param {Object} e
*/
onaderror ( e ) {
if ( this . adRewardedVideoloadNum >= 3 ) {
this . adRewardedVideo = false ;
return
}
this . adRewardedVideoloadNum ++
setTimeout ( ( ) => {
this . $refs . adRewardedVideo . load ( ) ;
} , 1000 ) ; // 10
console . log ( "广告加载失败" )
} ,
/**
* 广告播放成功回调
* @param {Object} e
*/
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 : this . urlCallback . extra
} )
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 {
// 播放中途退出
}
} ,
//乘法函数,用来得到精确的乘法结果
//说明: javascript的乘法结果会有误差, 在两个浮点数相乘的时候会比较明显。这个函数返回较为精确的乘法结果。
//调用: mul(arg1,arg2)
@@ -300,48 +358,56 @@
// jumpType (integer, optional): 跳转类型 1 内部路径 2 外部路径 ,
// type (integer, optional): 任务类型 1 普通任务 2 打卡任务 9 其它 ,
// buttonUrl
let source , buttonUrl ;
buttonUrl = item . buttonUrl
console . log ( item )
if ( item . buttonUrl == '/me/invite/index' ) {
buttonUrl = "/me/yaoqing/ymf-yaoqing-home"
}
if ( item . buttonUrl == '/me/invite/zhifubao' ) {
buttonUrl = "/me/yaoqing/zhifubao-tixain"
}
if ( item . buttonUrl == '/me/choujiang/choujiang' ) {
buttonUrl = "/me/VjgyqAzklr/VjgyqAzklr"
}
console . log ( item , '调试11111' )
if ( item . jumpType == 0 ) {
console . log ( "============" , item . buttonTitle ) ;
if ( item . buttonTitle . indexOf ( "领取" ) != - 1 ) {
this . taskReceive ( item . id )
} else if ( item . buttonTitle . indexOf ( "观看视频" ) != - 1 ) {
// 首次加载广告
this . urlCallback = {
userId : uni . getStorageSync ( 'userId' ) ,
extra : uni . getStorageSync ( 'userId' ) + "" + new Date ( ) . getTime ( ) ,
}
this . $refs . adRewardedVideo . show ( ) ;
} else {
uni . navigateTo ( {
url : ' /pages/index/index2'
uni . switchTab ( {
url : " /pages/index/index2"
} )
}
} else if ( item . jumpType == 1 ) {
console . log ( "--------------" ) ;
if ( item . title && item . title . indexOf ( '每周' ) != - 1 ) {
let source , buttonUrl ;
buttonUrl = item . buttonUrl
console . log ( item . title && item . title . indexOf ( '每周打卡奖励' ) != - 1 )
if ( item . title && item . title . indexOf ( '每周打卡奖励' ) != - 1 ) {
source = 2
buttonUrl = item . buttonUrl + '?source=' + source
}
if ( item . title && item . title . indexOf ( '每月' ) != - 1 ) {
if ( item . title && item . title . indexOf ( '每月打卡奖励1 ' ) != - 1 ) {
source = 3
buttonUrl = item . buttonUrl + '?source=' + source
}
console . log ( buttonUrl )
if ( item . title && item . title . indexOf ( '每月打卡奖励2' ) != - 1 ) {
buttonUrl = ` ${ item . buttonUrl } ?standard= ${ item . discNumber == null ? true : false } &taskId= ${ item . id } `
}
console . log ( buttonUrl , 'debug' )
if ( buttonUrl == '/me/invite/index' ) {
uni . navigateTo ( {
url : '/me/yaoqing/ymf-yaoqing-home'
} )
} else {
uni . navigateTo ( {
url : buttonUrl
} )
}
} else if ( item . jumpType == 3 ) {
uni . navigateTo ( {
url : '/pages/index/index2'
uni . switchTab ( {
url : item . buttonUrl
} )
} else if ( item . jumpType == 2 ) {
plus . runtime . openURL ( buttonUrl )
plus . runtime . openURL ( item . buttonUrl)
}
} ,
@@ -364,7 +430,7 @@
this . getsignIn ( )
} , 1000 )
} else {
uni . navigateTo ( {
uni . switchTab ( {
url : '/pages/index/index2'
} )
}
@@ -387,17 +453,17 @@
/**
* 下拉加载
*/
onPullDownRefresh : function ( ) {
onPullDownRefresh : function ( ) {
console . log ( 2 )
this . getTaskdata ( ) ;
} ,
}
}
}
< / script >
< style lang = "scss" >
. container {
. container {
width : 100 % ;
background - color : # F3F4F8 ;
@@ -641,5 +707,5 @@
margin : auto ;
}
}
}
}
< / style >