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

change

parent 0ebe8c4a
...@@ -104,7 +104,7 @@ Component({ ...@@ -104,7 +104,7 @@ Component({
let ds = e.currentTarget.dataset let ds = e.currentTarget.dataset
if (ds.status === 1) { if (ds.status === 1) {
switch (ds.type) { switch (ds.type) {
case "frontOrderGoods": case "moneyGoods":
this.gotoFrontOrderGoods(ds.itemIds) this.gotoFrontOrderGoods(ds.itemIds)
break; break;
case "invites": case "invites":
...@@ -147,6 +147,7 @@ Component({ ...@@ -147,6 +147,7 @@ Component({
// 支付定金 // 支付定金
gotoFrontOrderGoods(itemIds) { gotoFrontOrderGoods(itemIds) {
console.log(itemIds)
my.navigateTo({url: `../../pages/goodsPage/goodsPage?taskType=frontOrderGoods&itemIds=${itemIds}`}) my.navigateTo({url: `../../pages/goodsPage/goodsPage?taskType=frontOrderGoods&itemIds=${itemIds}`})
}, },
...@@ -180,6 +181,7 @@ Component({ ...@@ -180,6 +181,7 @@ Component({
if (!success) { console.warn(res); commonToast(res && res.message) } if (!success) { console.warn(res); commonToast(res && res.message) }
else { else {
console.log('%c--------完成关注店铺\n' + '-----yd.doFollowTask\n', ConsoleStyle, data) console.log('%c--------完成关注店铺\n' + '-----yd.doFollowTask\n', ConsoleStyle, data)
commonToast('完成关注店铺')
this.getMissionList() this.getMissionList()
} }
}) })
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
.huo_de_ya_dun_bi { .huo_de_ya_dun_bi {
width: 100%; width: 100%;
height: 32rpx; height: 32rpx;
line-height: 32rpx; line-height: 42rpx;
opacity: 1; opacity: 1;
left: 0; left: 0;
top: 230rpx; top: 230rpx;
......
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
<text class="kan_shi_pin_jiang_li">{{title}}</text> <text class="kan_shi_pin_jiang_li">{{title}}</text>
<view class="flex_content"> <view class="flex_content">
<view class="huo_de_ya_dun_bi">{{content}}</view> <view class="huo_de_ya_dun_bi">
<text decode="{{true}}">{{content}}</text>
</view>
</view> </view>
<image class="commonT1_btn" src="{{btnImg}}" mode="aspectFill" onTap="onModalConfirm"/> <image class="commonT1_btn" src="{{btnImg}}" mode="aspectFill" onTap="onModalConfirm"/>
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
} }
.huo_de_ya_dun_bi { .huo_de_ya_dun_bi {
width: 100%; width: 100%;
height: 32rpx; height: 42rpx;
line-height: 32rpx; line-height: 32rpx;
opacity: 1; opacity: 1;
left: 0; left: 0;
......
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
<text class="kan_shi_pin_jiang_li">{{title}}</text> <text class="kan_shi_pin_jiang_li">{{title}}</text>
<view class="flex_content"> <view class="flex_content">
<view class="huo_de_ya_dun_bi">{{detail}}</view> <view class="huo_de_ya_dun_bi">
<text decode="{{true}}">{{detail}}</text>
</view>
<view class="tu_ceng40" a:if="{{}}"> <view class="tu_ceng40" a:if="{{}}">
<image class="flex_content_image" src="{{}}" /> <image class="flex_content_image" src="{{}}" />
<text>+{{coins}}</text> <text>+{{coins}}</text>
......
...@@ -39,8 +39,14 @@ ...@@ -39,8 +39,14 @@
.my-prize-page .my-prize-empty { .my-prize-page .my-prize-empty {
text-align: center; text-align: center;
color: #fff; color: gray;
margin-top: 30rpx; margin-top: 60rpx;
font-size: 36rpx;
font-weight: bold;
position: absolute;
z-index: 100;
width: 100%;
text-align: center;
} }
.my-prize-page .my-prize-item { .my-prize-page .my-prize-item {
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
</view> </view>
<view a:if="{{myPrizeList && myPrizeList.length === 0}}" class="my-prize-empty">暂无奖品</view> <view a:if="{{!myPrizeList.length}}" class="my-prize-empty">暂无奖品</view>
</view> </view>
<logistics-modal a:if="{{isLogistic}}" prizeItem="{{currentPrize}}" onCloseModal="closeLogisticModal" task="{{task.logisticsImage}}"/> <logistics-modal a:if="{{isLogistic}}" prizeItem="{{currentPrize}}" onCloseModal="closeLogisticModal" task="{{task.logisticsImage}}"/>
</view> </view>
\ No newline at end of file
...@@ -18,14 +18,20 @@ ...@@ -18,14 +18,20 @@
.rule-modal__container { .rule-modal__container {
position: absolute; position: absolute;
width: 500rpx; width: 470rpx;
height: 600rpx; height: 524rpx;
background: #4eafd7;
background-size: 100% 100%; background-size: 100% 100%;
left: 50%; left: calc(50% - 235rpx);
top: 50%; top: calc(50% - 262rpx);
margin-left: -250rpx; }
margin-top: -300rpx;
.rule-modal__container_bgimage {
width: 100%;
left: 0;
top: 0;
height: 100%;
position: absolute;
z-index: 0;
} }
.rule-modal__bd { .rule-modal__bd {
...@@ -38,15 +44,42 @@ ...@@ -38,15 +44,42 @@
font-size: 24rpx; font-size: 24rpx;
color: #fff; color: #fff;
line-height: 1.5; line-height: 1.5;
z-index: 10;
overflow: hidden;
}
.rule-modal__bd_title {
color: #f26267;
font-size: 32rpx;
font-weight: bold;
text-align: center;
width: 100%;
margin-top: 44rpx;
line-height: 66rpx;
height: 66rpx;
} }
.rule-modal__bd_content {
color: #c85249;
font-size: 24rpx;
margin-top: 16rpx;
line-height: 1.26em;
height: 330rpx;
overflow: scroll;
}
.rule-modal__close { .rule-modal__close {
position: absolute; position: absolute;
right: -20rpx; right: -20rpx;
top: -80rpx; top: -40rpx;
height: 86rpx; height: 60rpx;
width: 86rpx; width: 60rpx;
background: url('../../assets/modal_close_btn.png') center center no-repeat;
background-size: 48rpx 48rpx; background-size: 48rpx 48rpx;
z-index: 9; z-index: 9;
} }
.rule-modal__close_image {
width: 60rpx;
height: 60rpx;
}
<view class="rule-modal"> <view class="rule-modal">
<view class="rule-modal__shade modal-animate-fade-in" /> <view class="rule-modal__shade modal-animate-fade-in" />
<view class="rule-modal__container modal-animate-zoom-in"> <view class="rule-modal__container modal-animate-zoom-in">
<view class="rule-modal__close" onTap="onModalClose" /> <image class="rule-modal__container_bgimage" src="//yun.duiba.com.cn/spark/assets/弹窗规则.10abd02fedc22a876f44f383a250c86f9b4466d6.png" mode="aspectFill" />
<view class="rule-modal__close" onTap="onModalClose">
<image class="rule-modal__close_image" src="//yun.duiba.com.cn/spark/assets/弹窗2关闭.478515dc464257d3f3e7c09b760b30e35d439a20.png" mode="aspectFill" />
</view>
<view class="rule-modal__bd"> <view class="rule-modal__bd">
<slot /> <view class="rule-modal__bd_title">活动规则</view>
<view class="rule-modal__bd_content">
<text decode="{{true}}">{{text}}</text>
</view>
</view> </view>
</view> </view>
</view> </view>
Component({ Component({
data: {
text: ''
},
props: {
text: ''
},
didMount () {
this.setData({text: this.props.text})
},
didUpdate() {
this.setData({text: this.props.text})
},
methods: { methods: {
onModalClose() { onModalClose() {
const { onModalClose } = this.props; const { onModalClose } = this.props;
......
...@@ -105,7 +105,7 @@ Page({ ...@@ -105,7 +105,7 @@ Page({
}) || {} }) || {}
console.log(browsResult) console.log(browsResult)
if(browsResult.success) { if(browsResult.success) {
commonToast('任务完成,请到任务中心查看奖励') commonToast('任务完成')
} }
break; break;
} }
......
...@@ -146,6 +146,9 @@ ...@@ -146,6 +146,9 @@
z-index: 0; z-index: 0;
} }
.opciaty05 {
opacity: 0.5;
}
.bottom_ydgame_block { .bottom_ydgame_block {
...@@ -239,8 +242,8 @@ ...@@ -239,8 +242,8 @@
z-index: 40; z-index: 40;
width: 140rpx; width: 140rpx;
height: 100rpx; height: 100rpx;
top: 30; top: 0;
right: 30; left: 100rpx;
background: rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .9);
color: rgb(0, 0, 0); color: rgb(0, 0, 0);
font-size: 22rpx; font-size: 22rpx;
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
<!-- 头部 规则-奖品 按钮 --> <!-- 头部 规则-奖品 按钮 -->
<view class="head"> <view class="head">
<image class="head_ruler" onTap="showCommonMoadalT1" src="{{resList['ee8882be-4b1d-43eb-bad7-8d96318c5022'].url}}" /> <image class="head_ruler" onTap="showRuleModal" src="{{resList['ee8882be-4b1d-43eb-bad7-8d96318c5022'].url}}" />
<!-- <image class="head_ruler" onTap="" src="{{resList['ee8882be-4b1d-43eb-bad7-8d96318c5022'].url}}" /> --> <!-- <image class="head_ruler" onTap="showCommonMoadalT1" src="{{resList['ee8882be-4b1d-43eb-bad7-8d96318c5022'].url}}" /> -->
<image class="head_rewards" onTap="gotoMyPrizePage" src="{{resList['74a63fd3-6776-44a2-990e-fadac00fb757'].url}}" /> <image class="head_rewards" onTap="gotoMyPrizePage" src="{{resList['74a63fd3-6776-44a2-990e-fadac00fb757'].url}}" />
</view> </view>
...@@ -52,7 +52,9 @@ ...@@ -52,7 +52,9 @@
<view>观看XXXXX视频</view> <view>观看XXXXX视频</view>
<view>赢惊喜抽奖次数</view> <view>赢惊喜抽奖次数</view>
</view> </view>
<!--
<view class="video_block_up" onTap="onVideoTurnSmall">收起视频</view> <view class="video_block_up" onTap="onVideoTurnSmall">收起视频</view>
-->
</view> </view>
<!-- 按钮组 左-右 --> <!-- 按钮组 左-右 -->
...@@ -60,14 +62,13 @@ ...@@ -60,14 +62,13 @@
<image class="video_btn_right" onTap="videoTurnRight" src="{{resList['cf73af84-5751-4aee-a754-9106162786d9'].url}}" /> <image class="video_btn_right" onTap="videoTurnRight" src="{{resList['cf73af84-5751-4aee-a754-9106162786d9'].url}}" />
</view> </view>
<!--
<view hidden="{{!videoBottom_timeout}}" onTap="onVideoTurnBig" class="video_block_s {{ !videoBottom ? 'block_opciaty0' : ''}}" > <view hidden="{{!videoBottom_timeout}}" onTap="onVideoTurnBig" class="video_block_s {{ !videoBottom ? 'block_opciaty0' : ''}}" >
<!-- <image class='video_s' src='' /> -->
<view class='video_s'></view> <view class='video_s'></view>
<image class="bo_fang_an_niu" src="{{resList['8d5b83a6-59d9-484c-a74e-99f13ba20b02'].url}}" /> <image class="bo_fang_an_niu" src="{{resList['8d5b83a6-59d9-484c-a74e-99f13ba20b02'].url}}" />
<view class="video_block_tips">看视频 赢金币</view> <view class="video_block_tips">看视频 赢金币</view>
</view> </view>
-->
<!-- 底部 门票-乐园-抽奖 --> <!-- 底部 门票-乐园-抽奖 -->
...@@ -89,8 +90,8 @@ ...@@ -89,8 +90,8 @@
<!-- 选择游戏 --> <!-- 选择游戏 -->
<view class="gamechoose_block" a:if='{{ showChooseGame }}'> <view class="gamechoose_block" a:if='{{ showChooseGame }}'>
<image class="gamechoose_block_back" src="{{resList['22c949b8-84af-4a22-bb21-70088d1eafad'].url}}" /> <image class="gamechoose_block_back" src="{{resList['22c949b8-84af-4a22-bb21-70088d1eafad'].url}}" />
<image data-gameType='1' onTap="changeGameOrPage" class="gamechoose_block_sc" src="{{resList['f2915694-4e09-4776-8f38-9ddb285e4d17'].url}}" /> <image data-gameType='1' onTap="changeGameOrPage" class="gamechoose_block_sc {{ ticketNum ? '' : 'opciaty05' }}" src="{{resList['f2915694-4e09-4776-8f38-9ddb285e4d17'].url}}" />
<image data-gameType='2' onTap="changeGameOrPage" class="gamechoose_block_xxl" src="{{resList['7aafb158-7fec-4ae1-a83e-496779c4a107'].url}}" /> <image data-gameType='2' onTap="changeGameOrPage" class="gamechoose_block_xxl {{ ticketNum ? '' : 'opciaty05' }}" src="{{resList['7aafb158-7fec-4ae1-a83e-496779c4a107'].url}}" />
<view class="gameChoose_mask" onTap="closeShowChooseGame"></view> <view class="gameChoose_mask" onTap="closeShowChooseGame"></view>
</view> </view>
</view> </view>
...@@ -112,7 +113,7 @@ ...@@ -112,7 +113,7 @@
<common-modal-t1 a:if="{{commonModalVisibleT1}}" data="{{commonModalDataT1}}" onModalClose="closeCommonModalT1" onModalConfirm="confirmCommonModalT1" /> <common-modal-t1 a:if="{{commonModalVisibleT1}}" data="{{commonModalDataT1}}" onModalClose="closeCommonModalT1" onModalConfirm="confirmCommonModalT1" />
<common-modal-t2 a:if="{{commonModalVisibleT2}}" data="{{commonModalDataT2}}" onModalClose="closeCommonModalT2" onModalConfirm="confirmCommonModalT2" /> <common-modal-t2 a:if="{{commonModalVisibleT2}}" data="{{commonModalDataT2}}" onModalClose="closeCommonModalT2" onModalConfirm="confirmCommonModalT2" />
<rule-modal a:if="{{ruleModalVisible}}" onModalClose="closeRuleModal"><text>{{rule}}</text></rule-modal> <rule-modal a:if="{{ruleModalVisible}}" onModalClose="closeRuleModal" text="{{rule}}"></rule-modal>
<rewards-modal a:if="{{rewardsModalVisible}}" onModalClose="closeRewardsModal"></rewards-modal> <rewards-modal a:if="{{rewardsModalVisible}}" onModalClose="closeRewardsModal"></rewards-modal>
<prizes-modal a:if="{{prizesModalVisible}}" onModalClose="closePrizesModal"></prizes-modal> <prizes-modal a:if="{{prizesModalVisible}}" onModalClose="closePrizesModal"></prizes-modal>
<mission-modal a:if="{{missionModalVisible}}" onModalClose="closeMissionModal"></mission-modal> <mission-modal a:if="{{missionModalVisible}}" onModalClose="closeMissionModal"></mission-modal>
...@@ -15,9 +15,9 @@ Page({ ...@@ -15,9 +15,9 @@ Page({
// 视频地址列表 - 存储播放时常 // 视频地址列表 - 存储播放时常
videoSrcArr: [ videoSrcArr: [
{ url: 'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4', timeStamp: 0, totalTime: 0 }, // { url: 'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4', timeStamp: 0, totalTime: 0, completed: false },
{ url: 'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4', timeStamp: 0, totalTime: 0 }, // { url: 'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4', timeStamp: 0, totalTime: 0, completed: false },
{ url: 'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4', timeStamp: 0, totalTime: 0 } // { url: 'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4', timeStamp: 0, totalTime: 0, completed: false }
], ],
// 视频记录 flag // 视频记录 flag
timeStampCountFlag: false, timeStampCountFlag: false,
...@@ -27,15 +27,18 @@ Page({ ...@@ -27,15 +27,18 @@ Page({
timeStampRecord: 0, timeStampRecord: 0,
// 视频预览图列表 // 视频预览图列表
posterSrcArr: [ posterSrcArr: [
'https://yun.duiba.com.cn/spark/assets/bg1.d818f787351875b0982937d8bb68b0655febec3c.png', // 'https://yun.duiba.com.cn/spark/assets/bg1.d818f787351875b0982937d8bb68b0655febec3c.png',
'https://yun.duiba.com.cn/spark/assets/弹窗背景_奖品.dce4e3dd9a3fcae166dfbd934b714ce1bc7fa5c9.png', // 'https://yun.duiba.com.cn/spark/assets/弹窗背景_奖品.dce4e3dd9a3fcae166dfbd934b714ce1bc7fa5c9.png',
'https://yun.duiba.com.cn/spark/assets/7191ae57140b4937ae42500e76aa533693326ef9.png', // 'https://yun.duiba.com.cn/spark/assets/7191ae57140b4937ae42500e76aa533693326ef9.png',
], ],
// 是否是会员
isVip: false,
// 是否关注店铺 // 是否关注店铺
isFollow: false, isFollow: false,
// 进入时获取 邀请码 // 进入时获取 邀请码
inviteId: '', inviteId: '',
// 用户是否登陆
userLogin: false,
data: { data: {
resList: resList, resList: resList,
title: '', title: '',
...@@ -49,8 +52,6 @@ Page({ ...@@ -49,8 +52,6 @@ Page({
videoBottom: false, videoBottom: false,
// 具有延迟的 视频收起 - flag // 具有延迟的 视频收起 - flag
videoBottom_timeout: false, videoBottom_timeout: false,
// 视频地址
videoSrc: '',
// 封面图地址 // 封面图地址
posterSrc: '', posterSrc: '',
// 视频变大 // 视频变大
...@@ -88,11 +89,17 @@ Page({ ...@@ -88,11 +89,17 @@ Page({
ticketNum: 0, ticketNum: 0,
drawNum: 0, drawNum: 0,
todayFirstLogin: true
}, },
async onLoad (query) { async onLoad (query) {
console.info(`%cPage onLoad with query: ${JSON.stringify(query)}`, ConsoleStyle) console.info(`%cPage onLoad with query: ${JSON.stringify(query)}`, ConsoleStyle)
if (query.inviteId) this.inviteId = query.inviteId if (query.inviteId) {
app.inviteId = query.inviteId
this.inviteId = query.inviteId
console.log('%c该用户是 通过邀请链接 进入', 'color:green; font-size:16px; font-weight:bold;')
}
// 页面加载 // 页面加载
// 开场动画 // 开场动画
// this.openAnimation().then(async res_ => { // this.openAnimation().then(async res_ => {
...@@ -132,8 +139,14 @@ Page({ ...@@ -132,8 +139,14 @@ Page({
const { success, message, data } = await API.login(param) const { success, message, data } = await API.login(param)
.catch(res => { commonToast(res && res.message); }) || {}; .catch(res => { commonToast(res && res.message); }) || {};
if (success) { if (success) {
this.userLogin = true
console.log('%c-----用户登陆信息\n' + '-----yd.login\n', ConsoleStyle, data) console.log('%c-----用户登陆信息\n' + '-----yd.login\n', ConsoleStyle, data)
app.openId = data.openId app.openId = data.openId
this.isNewUser = data.isNewUser
this.hasNewUserAndInvited()
this.getGameInfo()
this.init(data); this.init(data);
} }
}, },
...@@ -146,47 +159,111 @@ Page({ ...@@ -146,47 +159,111 @@ Page({
if (!success) { console.warn(res); commonToast(res && res.message) } if (!success) { console.warn(res); commonToast(res && res.message) }
else { else {
console.log('%c-----活动基本信息\n' + '-----yd.getActivityBaseInfoById\n', ConsoleStyle, data) console.log('%c-----活动基本信息\n' + '-----yd.getActivityBaseInfoById\n', ConsoleStyle, data)
data.videoUrlArr.forEach((item, index) => {
this.videoSrcArr[index] = {
url: item, timeStamp: 0, totalTime: 0, completed: false
}
// this.posterSrcArr
})
this.setData({
rule: data.rule,
videoSrc: this.videoSrcArr[0]
})
} }
}) })
.catch(res => { console.warn(res); commonToast(res && res.message); }) || {}; .catch(res => { console.warn(res); commonToast(res && res.message); }) || {};
}, },
// 新用户/被邀请的 逻辑
hasNewUserAndInvited () {
API.getVipInfo({ activityId: app.activityId, inviteId: app.inviteId })
.then(res => {
const { success, data, message } = res
console.log('%c-----用户vip信息\n' + '-----yd.getVipInfo\n', ConsoleStyle, data)
if (success && data) {
app.isVip = (data && data.isVip) || false;
app.vipUrl = (data && data.url) || '';
this.isVip = (data && data.isVip) || false;
} else {
commonToast(message)
}
})
.catch(res => { console.warn(res); commonToast(res && res.message) }) || {};
// 新用户 助力链接
if (this.isNewUser && this.inviteId) {
this.showCommonMoadalT1({
title: '温馨提示',
content: '成为会员 才能为他助力哦~',
confirmCallback: () => {
navigateToOutside(app.vipUrl)
},
btnImg: '//yun.duiba.com.cn/spark/assets/一秒成为会员.10be8a8ede8f6c62eadb005744dc54ae182911d9.png' })
// //yun.duiba.com.cn/spark/assets/为他助力.bc57a24aecb04934067712c76186d800343dabd5.png
}
// 新用户 不是助力链接
else if (this.isNewUser && !this.inviteId) console.log('isNewUser')
// 老用户 助力链接
else if (!this.isNewUser && this.inviteId) {
this.showCommonMoadalT1({
title: '很遗憾',
content: '新会员才能助力哦~',
confirmCallback: () => {
this.closeCommonModalT1()
},
btnImg: '//yun.duiba.com.cn/spark/assets/我也要赢大奖.a22bebbd5be4a6e557ee4ef611216ba73b729d10.png' })
}
},
// 用户今日首次进入
userFirstInToday () {
// 自动播放视频
this.videoShowFunc()
},
// 分享 // 分享
onShareAppMessage() { onShareAppMessage() {
// 返回自定义分享信息 // 返回自定义分享信息
SHARE_CONFIG.imageUrl = '' SHARE_CONFIG.imageUrl = ''
SHARE_CONFIG.path = this.changeURLArg('/pages/homePage/homePage', 'shareId', app.openId) SHARE_CONFIG.path = this.changeURLArg('/pages/homePage/homePage&', 'inviteId', app.openId)
console.log('SHARE_CONFIG.path',SHARE_CONFIG.path)
return SHARE_CONFIG; return SHARE_CONFIG;
}, },
// 新用户 被邀请的 逻辑
hasBeenInvited () {
console.log('%c该用户是被 邀请 进入', 'color:green; font-size:16px; font-weight:bold;')
},
// 页面加载完成 // 页面加载完成
onReady() { onReady() {
this.videoCtx = my.createVideoContext('videoCtx') this.videoCtx = my.createVideoContext('videoCtx')
this.setData({ videoSrc: this.videoSrcArr[0].url, posterSrc: this.posterSrcArr[0] })
this.videoCtx.play() this.videoCtx.play()
// this.setData({ videoSrc: this.videoSrcArr[0].url, posterSrc: this.posterSrcArr[0] })
}, },
// 页面显示 // 页面显示
onShow() { onShow() {
if (this.userLogin) this.getGameInfo()
if (this.isNewUser && this.inviteId && this.isVip) {
}
}, },
// start // 获取 游戏门票 抽奖次数 今日是否首次登陆
doStart() { getGameInfo () {
this.showCommonModal({ API.getGameInfo({ activityId: app.activityId })
content: '活动还未开始\n请稍后', .then(res => {
btnText: '我知道了', const { success, message, data } = res
commonModalVisibleT1: true, if (!success) { console.warn(res); commonToast(res && res.message) }
confirmCallback: () => { else {
this.closeCommonModal(); console.log('%c-----获取游戏信息\n' + '-----yd.getGameInfo\n', ConsoleStyle, data)
} this.setData({
}); ticketNum: data.gameTimes,
drawNum: data.lotteryTimes,
todayFirstLogin: data.todayFirstLogin
})
if (this.data.todayFirstLogin) this.userFirstInToday()
}
})
.catch(res => { console.warn(res); commonToast(res && res.message); }) || {};
}, },
// 开场动画 // 开场动画
...@@ -201,10 +278,21 @@ Page({ ...@@ -201,10 +278,21 @@ Page({
// 切换到游戏 // 切换到游戏
changeGameOrPage (e) { changeGameOrPage (e) {
let type = Number(e.currentTarget.dataset.gameType) if (this.data.ticketNum == 0 && e.currentTarget.dataset.gameType != 3) {
this.videoCtx.pause() this.showCommonMoadalT1({
this.setData({ gameShow: true, gameType: type }) title: '门票不足',
setTimeout(() => { this.setData({ gameShow_timeout: true }) }, 350) content: '门票消耗完了!\n快去做任务吧~',
confirmCallback: () => {
this.showMissionModal()
},
btnImg: '//yun.duiba.com.cn/spark/assets/赚门票.21d8c2fd01dffd454116bb6c1189ba6bb74306f4.png' })
return
} else {
let type = Number(e.currentTarget.dataset.gameType)
this.videoCtx.pause()
this.setData({ gameShow: true, gameType: type })
setTimeout(() => { this.setData({ gameShow_timeout: true }) }, 350)
}
}, },
// 从游戏 返回 到 主页 // 从游戏 返回 到 主页
...@@ -258,22 +346,6 @@ Page({ ...@@ -258,22 +346,6 @@ Page({
} }
}, },
// video - turn small
onVideoTurnSmall () {
this.videoCtx.pause()
this.setData({ videoBottom: true })
setTimeout(() => { this.setData({ videoBottom_timeout: true }) }, 350)
},
// video - turn big
onVideoTurnBig () {
this.setData({ videoBottom_timeout: false })
setTimeout(() => {
this.setData({ videoBottom: false })
this.videoCtx.play()
}, 350)
},
// video - change to another video // video - change to another video
videoRecord (index) { videoRecord (index) {
this.videoSrcArr[index].timeStamp = this.timeStamp this.videoSrcArr[index].timeStamp = this.timeStamp
...@@ -325,11 +397,6 @@ Page({ ...@@ -325,11 +397,6 @@ Page({
// video - onLoading // video - onLoading
onLoading (e) { console.log(e) }, onLoading (e) { console.log(e) },
// 页面隐藏
onHide() {
},
gotoMyPrizePage() { gotoMyPrizePage() {
my.navigateTo({url: '../myprize/myprize'}) my.navigateTo({url: '../myprize/myprize'})
}, },
...@@ -402,7 +469,9 @@ Page({ ...@@ -402,7 +469,9 @@ Page({
onReachBottom() { onReachBottom() {
// 页面被拉到底部 // 页面被拉到底部
}, },
// 页面隐藏
onHide() {
},
// 获取主接口 // 获取主接口
async getIndex() { async getIndex() {
...@@ -432,4 +501,20 @@ Page({ ...@@ -432,4 +501,20 @@ Page({
} }
} }
} }
// // video - turn small
// onVideoTurnSmall () {
// this.videoCtx.pause()
// this.setData({ videoBottom: true })
// setTimeout(() => { this.setData({ videoBottom_timeout: true }) }, 350)
// },
// // video - turn big
// onVideoTurnBig () {
// this.setData({ videoBottom_timeout: false })
// setTimeout(() => {
// this.setData({ videoBottom: false })
// this.videoCtx.play()
// }, 350)
// },
}); });
...@@ -210,11 +210,11 @@ Page({ ...@@ -210,11 +210,11 @@ Page({
flag = true; flag = true;
// 判断是否为会员 // 判断是否为会员
await this.getUserInfo() await this.getUserInfo()
const { isVip, vipLink } = app; const { isVip, vipUrl } = app;
if (!isVip) { if (!isVip) {
commonToast('立即加入会员,即可领取奖品', 2000); commonToast('立即加入会员,即可领取奖品', 2000);
setTimeout(() => { setTimeout(() => {
navigateToOutside(vipLink) navigateToOutside(vipUrl)
}, 1000) }, 1000)
flag = false flag = false
return return
...@@ -241,14 +241,14 @@ Page({ ...@@ -241,14 +241,14 @@ Page({
//获取用户vip信息 //获取用户vip信息
async getUserInfo() { async getUserInfo() {
const { activityId } = app; const { activityId, inviteId } = app;
API.getVipInfo({ activityId }) API.getVipInfo({ activityId, inviteId })
.then(res => { .then(res => {
const { success, data, message } = res const { success, data, message } = res
console.log('%c-----用户vip信息\n' + '-----yd.getVipInfo\n', ConsoleStyle, data) console.log('%c-----用户vip信息\n' + '-----yd.getVipInfo\n', ConsoleStyle, data)
if (success && data) { if (success && data) {
app.isVip = (data && data.isVip) || false; app.isVip = (data && data.isVip) || false;
app.vipLink = (data && data.url) || ''; app.vipUrl = (data && data.url) || '';
flag = false flag = false
this.getMyPrize() this.getMyPrize()
} else { } else {
......
...@@ -45,7 +45,7 @@ Page({ ...@@ -45,7 +45,7 @@ Page({
if (!success) { console.warn(res); commonToast(res && res.message) } if (!success) { console.warn(res); commonToast(res && res.message) }
else { else {
console.log('%c-----获取游戏信息\n' + '-----yd.getGameInfo\n', ConsoleStyle, data) console.log('%c-----获取游戏信息\n' + '-----yd.getGameInfo\n', ConsoleStyle, data)
this.setData({ leftTimes: data.gameTimes }) this.setData({ leftTimes: data.lotteryTimes })
} }
}) })
.catch(res => { console.warn(res); commonToast(res && res.message); }) || {}; .catch(res => { console.warn(res); commonToast(res && res.message); }) || {};
......
...@@ -592,6 +592,24 @@ const resList = { ...@@ -592,6 +592,24 @@ const resList = {
ext: '.png', ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/谢谢参与.f0ecf9469bcf589fe2b61017631ef8e507a8cf24.png', url: '//yun.duiba.com.cn/spark/assets/谢谢参与.f0ecf9469bcf589fe2b61017631ef8e507a8cf24.png',
uuid: '2a5c22ac-2449-4e2a-af33-8e3a837e20fe' uuid: '2a5c22ac-2449-4e2a-af33-8e3a837e20fe'
},
'3ef613f7-698f-41e1-b81d-da9e44f13fca': {
name: '为他助力',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/为他助力.bc57a24aecb04934067712c76186d800343dabd5.png',
uuid: '3ef613f7-698f-41e1-b81d-da9e44f13fca'
},
'2e06aa38-3dff-4f72-8662-417614669d43': {
name: '我也要赢大奖',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/一秒成为会员.10be8a8ede8f6c62eadb005744dc54ae182911d9.png',
uuid: '2e06aa38-3dff-4f72-8662-417614669d43'
},
'fd8a805e-e2e3-49c6-8236-1f181177a313': {
name: '一秒成为会员',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/我也要赢大奖.a22bebbd5be4a6e557ee4ef611216ba73b729d10.png',
uuid: 'fd8a805e-e2e3-49c6-8236-1f181177a313'
} }
}; };
export default resList; export default resList;
\ No newline at end of file
...@@ -84,9 +84,9 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => { ...@@ -84,9 +84,9 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
const requestCloud = () => { const requestCloud = () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
console.log('requestCloud', handle, params); // console.log('requestCloud', handle, params);
cloud.function.invoke(_cloudName, params, handle).then(res => { cloud.function.invoke(_cloudName, params, handle).then(res => {
console.log('request Cloud callback=>', handle, res, JSON.stringify(res)); // console.log('request Cloud callback=>', handle, res, JSON.stringify(res));
hideMyLoading(); hideMyLoading();
if (res && res.success) { if (res && res.success) {
resolve(res); resolve(res);
......
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