Commit adb72aee authored by AU-Pro-mac's avatar AU-Pro-mac

add new code --22

parent 6b9f4a37
......@@ -95,6 +95,13 @@ const apiList = {
isShowLoading: false
},
// 完成跳转链接 任务
doJumpLinkTask: {
handle: 'doJumpLinkTask',
method:'get',
isShowLoading: false
},
// 我的奖品列表
getMyPrizeList: {
handle: 'getMyPrizeList',
......
......@@ -17,7 +17,7 @@ const TASK_ENUM = {
"btnText": "去邀请"
},
"browseGoods": {
"title": "浏览指定商品30s",
"title": "浏览指定商品15s",
"iconUrl": "//yun.duiba.com.cn/spark/assets/43081f4ee9aed1c4d89d9e0882b2b5210a93ef17.png",
"btnText": "去浏览"
},
......@@ -55,6 +55,7 @@ Component({
didMount() {
// if (this.props.missionsList.length) this.setData({ missionsList: this.props.missionsList })
this.getMissionList()
// commonToast('testtesttesttest')
},
didUpdate(prevProps, prevData) {
......@@ -143,10 +144,23 @@ Component({
if (!success) { console.warn(res); commonToast(res && res.message) }
else {
console.log('%c--------领取成功\n' + '-----yd.receiveTaskRewards\n', ConsoleStyle, data)
console.log(`%c--------任务类型\n-----${ds.taskType}\n`, ConsoleStyle)
if (ds.taskType === 'invites') {
commonToast(`已有${ds.info.todayCompleteTimes}位还有为你助力,获得次数,乐园门票+${Number(ds.info.todayCompleteTimes) * Number(ds.info.rewards)}`)
} else if (ds.taskType === 'follow') {
commonToast(`成功关注店铺,乐园门票+${Number(ds.info.rewards)}`)
} else if (ds.taskType === 'member') {
commonToast(`成功入会,乐园门票+${Number(ds.info.rewards)}`)
} else if (ds.taskType === 'browseGoods') {
commonToast(`任务完成,乐园门票+${Number(ds.info.rewards)}`)
} else if (ds.taskType === 'jumpLink') {
commonToast(`任务完成,乐园门票+${Number(ds.info.rewards)}`)
} else if (ds.taskType === 'moneyGoods') {
commonToast(`成功下单,乐园门票+${Number(ds.info.rewards)}`)
} else if (ds.taskType === 'orderGoods') {
commonToast(`任务完成,乐园门票+${Number(ds.info.rewards)}`)
} else {
commonToast('领取成功')
commonToast(`成功下单,乐园门票+${Number(ds.info.rewards)}`)
}
this.getMissionList()
this.onRefreshGameInfo()
......@@ -155,8 +169,8 @@ Component({
.catch(res => { console.warn(res); commonToast(res && res.message); }) || {};
} else if (ds.status === 3) {
commonToast('该任务您已经完成了哦')
this.onRefreshGameInfo()
// commonToast('该任务您已经完成了哦')
// this.onRefreshGameInfo()
}
},
......@@ -178,7 +192,18 @@ Component({
// 看直播
gotoJumpLink(url) {
navigateToOutside(url)
API.doJumpLinkTask({activityId: app.activityId})
.then(res => {
const { success, message, data } = res
if (!success) { console.warn(res); commonToast(res && res.message) }
else {
console.log('%c--------完成看直播\n' + '-----yd.doJumpLinkTask\n', ConsoleStyle, data)
navigateToOutside(url)
}
this.getMissionList()
})
.catch(res => { console.warn(res); commonToast(res && res.message); }) || {};
},
// 完成下单商品
......@@ -196,7 +221,7 @@ Component({
if (!success) { console.warn(res); commonToast(res && res.message) }
else {
console.log('%c--------完成关注店铺\n' + '-----yd.doFollowTask\n', ConsoleStyle, data)
commonToast('完成关注店铺')
// commonToast('完成关注店铺')
this.getMissionList()
}
})
......
......@@ -98,8 +98,16 @@ Page({
this.setData({ rotateFlag: true })
console.log('%cstartDraw run', ConsoleStyle)
if (!this.data.leftTimes > 0) {
commonToast('您还没有抽奖次数')
setTimeout(() => { this.setData({ rotateFlag: false }) }, 300)
// commonToast('您还没有抽奖次数')
this.showCommonMoadalT1({
title: '抽奖次数不足',
content: `快去雅顿乐园\n玩游戏赢抽奖次数吧~`,
confirmCallback: async () => {
this.setData({ rotateFlag: false })
this.closeCommonModalT1()
},
btnImg: resList['8aa6d279-6105-430a-8b5a-2132a983fa8a'].url
})
return
}
......@@ -148,7 +156,7 @@ Page({
this.timerCount += 1
// 开始动画
setTimeout(() => {
this.animateRotation(360 * (this.timerCount * 2) + rotateDeg, 1000 * (rotateDeg / 360) + 40)
this.animateRotation(360 * (this.timerCount * 4) + rotateDeg, 2000 * (rotateDeg / 360) + 40)
}, 300)
await this.getGameInfo()
// 更改 rotateFlag - 弹窗 结果弹窗
......@@ -173,18 +181,18 @@ Page({
} else {
this.showCommonMoadalT1({
title: '很遗憾',
content: `快去雅顿乐园\n玩游戏赢抽奖次数吧~`,
content: `奖励与您擦家而过\n再接再厉哦~`,
confirmCallback: async () => {
this.setData({ rotateFlag: false })
this.closeCommonModalT1()
},
btnImg: resList['8aa6d279-6105-430a-8b5a-2132a983fa8a'].url
btnImg: resList['fd0d94ef-fe1a-4771-8ba2-ad7aadacafc0'].url
})
}
}, 1000 * (rotateDeg / 360) + 1000 + 100)
let time = this.data.leftTimes - 1
this.setData({ leftTimes: time })
// let time = this.data.leftTimes - 1
// this.setData({ leftTimes: time })
} else {
commonToast('网络拥堵,请稍后再试')
this.setData({ rotateFlag: false })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment