Commit a7923cce authored by spc's avatar spc

Merge branch 'yd11_20200922' of gitlab2.dui88.com:wanghongyuan/new_taobao into yd11_20200922

parents a13386be 7aa323bf
...@@ -33,7 +33,7 @@ const apiList = { ...@@ -33,7 +33,7 @@ const apiList = {
}, },
// 大转盘抽奖 // 大转盘抽奖
lottery: { drawLotteryPrize: {
handle: 'lottery', handle: 'lottery',
method: 'get', method: 'get',
isShowLoading: true isShowLoading: true
......
...@@ -17,6 +17,10 @@ App({ ...@@ -17,6 +17,10 @@ App({
vipUrl: '', vipUrl: '',
// 直播间页面 // 直播间页面
liveUrl: '', liveUrl: '',
// 游戏胜率 - 消消乐
xxlWinRate: 0.7,
// 游戏胜率 - 传送带
csdWinRate: 0.7,
// 全局数据 // 全局数据
globalData: {}, globalData: {},
......
...@@ -22,6 +22,11 @@ ...@@ -22,6 +22,11 @@
<text a:if="{{item.status === 2}}" class="mission_btn_text">待领取</text> <text a:if="{{item.status === 2}}" class="mission_btn_text">待领取</text>
<text a:if="{{item.status === 3}}" class="mission_btn_text">已完成</text> <text a:if="{{item.status === 3}}" class="mission_btn_text">已完成</text>
<!-- 如果测试 这里 关注店铺 任务有bug
<text a:if="{{item.status === 2 && item.type === 'follow'}}" class="mission_btn_text">待领取</text>
<text a:if="{{item.status === 3 && item.type !== 'follow'}}" class="mission_btn_text">已完成</text>
-->
<view a:if="{{item.taskType === 'invites'}}" class="mission_invite_tips">{{item.completeTimes}}个好友为你助力成功</view> <view a:if="{{item.taskType === 'invites'}}" class="mission_invite_tips">{{item.completeTimes}}个好友为你助力成功</view>
</view> </view>
</view> </view>
......
...@@ -95,6 +95,11 @@ Component({ ...@@ -95,6 +95,11 @@ Component({
.catch(res => { console.warn(res); commonToast(res && res.message); }) || {}; .catch(res => { console.warn(res); commonToast(res && res.message); }) || {};
}, },
onRefreshGameInfo () {
const { onRefreshGameInfo } = this.props;
onRefreshGameInfo && onRefreshGameInfo();
},
onModalClose() { onModalClose() {
const { onModalClose } = this.props; const { onModalClose } = this.props;
onModalClose && onModalClose(); onModalClose && onModalClose();
...@@ -129,6 +134,8 @@ Component({ ...@@ -129,6 +134,8 @@ Component({
break; break;
} }
} else if (ds.status === 2) { } else if (ds.status === 2) {
// 如果测试 这里 关注店铺 任务有bug
// } else if (ds.status === 2 || (ds.status === 3 && ds.type === 'follow')) {
API.receiveTaskRewards({activityId: app.activityId, taskType: ds.type}) API.receiveTaskRewards({activityId: app.activityId, taskType: ds.type})
.then(res => { .then(res => {
const { success, message, data } = res const { success, message, data } = res
...@@ -136,12 +143,14 @@ Component({ ...@@ -136,12 +143,14 @@ Component({
else { else {
console.log('%c--------领取成功\n' + '-----yd.receiveTaskRewards\n', ConsoleStyle, data) console.log('%c--------领取成功\n' + '-----yd.receiveTaskRewards\n', ConsoleStyle, data)
this.getMissionList() this.getMissionList()
this.onRefreshGameInfo()
} }
}) })
.catch(res => { console.warn(res); commonToast(res && res.message); }) || {}; .catch(res => { console.warn(res); commonToast(res && res.message); }) || {};
} else if (ds.status === 3) { } else if (ds.status === 3) {
commonToast('该任务您已经完成了哦') commonToast('该任务您已经完成了哦')
this.onRefreshGameInfo()
} }
}, },
......
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
isBackFlag="{{isBackFlag}}" isBackFlag="{{isBackFlag}}"
goodsList="{{goodsList}}" goodsList="{{goodsList}}"
task="{{task}}" task="{{task}}"
onCompleteTask="onCompleteTask" /> onCompleteTask="onCompleteTaskHandle" />
</view> </view>
\ No newline at end of file
...@@ -18,6 +18,7 @@ const app = getApp(); ...@@ -18,6 +18,7 @@ const app = getApp();
const { tbcc } = app; const { tbcc } = app;
const { openDetail, collectGoods, checkGoodsCollectedStatus, commonToast, ConsoleStyle } = tbcc.tb; const { openDetail, collectGoods, checkGoodsCollectedStatus, commonToast, ConsoleStyle } = tbcc.tb;
import API from '../../api'; import API from '../../api';
import { debounce } from '../../tbcc-sdk/lib/tb';
Page({ Page({
data: { data: {
...@@ -84,6 +85,13 @@ Page({ ...@@ -84,6 +85,13 @@ Page({
// this.setData({ goodsList: data || [] }) // this.setData({ goodsList: data || [] })
// } // }
}, },
// 完成任务 防抖
onCompleteTaskHandle (taskType,itemId) {
debounce(this.onCompleteTask(taskType,itemId), 300)
},
//任务完成 //任务完成
async onCompleteTask(taskType,itemId) { async onCompleteTask(taskType,itemId) {
console.log(taskType,itemId) console.log(taskType,itemId)
......
...@@ -267,15 +267,25 @@ ...@@ -267,15 +267,25 @@
background-color: #fff; background-color: #fff;
border-radius: 12rpx; border-radius: 12rpx;
overflow: hidden; overflow: hidden;
position: relative;
box-shadow: 0 0 24rpx rgba(159, 87, 85, .46); box-shadow: 0 0 24rpx rgba(159, 87, 85, .46);
} }
.an_niu { .video_block_wrapper_playicon {
width: 95rpx; width: 95rpx;
height: 94rpx; height: 94rpx;
opacity: 1; opacity: 1;
left: 170rpx; left: 170rpx;
top: 87rpx; top: 84rpx;
position: absolute; position: absolute;
z-index: 10;
}
.video_block_wrapper_postersmall {
width: 400rpx;
height: 180rpx;
left: 15rpx;
top: 15rpx;
position: absolute;
z-index: 8;
} }
.video_block_text { .video_block_text {
width: 100%; width: 100%;
......
...@@ -48,8 +48,10 @@ ...@@ -48,8 +48,10 @@
<!-- 视频部分 --> <!-- 视频部分 -->
<view hidden="{{videoBottom_timeout}}" class="video_block {{ videoBottom ? 'block_opciaty0' : ''}}"> <view hidden="{{videoBottom_timeout}}" class="video_block {{ videoBottom ? 'block_opciaty0' : ''}}">
<view class="video_block_wrapper" onTap="videoShowFunc" > <view class="video_block_wrapper" onTap="videoShowFunc" >
<!-- 视频播放按钮 -->
<image class="video_block_wrapper_playicon" src="" mode="aspectFill" />
<image class="video_block_wrapper_postersmall" src="{{videoImgSrcSmall}}" mode="aspectFill" />
<view class="video_block_text"> <view class="video_block_text">
<image src="{{videoImgSrcSmall}}" mode="aspectFill" />
<view>观看XXXXX视频</view> <view>观看XXXXX视频</view>
<view>赢惊喜抽奖次数</view> <view>赢惊喜抽奖次数</view>
</view> </view>
...@@ -80,7 +82,7 @@ ...@@ -80,7 +82,7 @@
<view class="bottom_ydgame_block" onTap="openShowChooseGame"> <view class="bottom_ydgame_block" onTap="openShowChooseGame">
<image class="bottom_ydgame_block_image" src="{{resList['81a085b2-ce9c-4a8f-bdcc-d08f10083134'].url}}" /> <image class="bottom_ydgame_block_image" src="{{resList['81a085b2-ce9c-4a8f-bdcc-d08f10083134'].url}}" />
<view class="bottom_mission_block_freenum">免费抽奖次数 X{{drawNum}}</view> <view class="bottom_mission_block_freenum">抽奖次数 X{{drawNum}}</view>
</view> </view>
<view class="bottom_mission_block" onTap="showMissionModal"> <view class="bottom_mission_block" onTap="showMissionModal">
...@@ -91,8 +93,8 @@ ...@@ -91,8 +93,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 {{ ticketNum ? '' : 'opciaty05' }}" src="{{resList['f2915694-4e09-4776-8f38-9ddb285e4d17'].url}}" /> <image data-gameType='1' onTap="handleClickGame" class="gamechoose_block_sc {{ ticketNum ? '' : 'opciaty05' }}" src="{{resList['f2915694-4e09-4776-8f38-9ddb285e4d17'].url}}" />
<image data-gameType='2' onTap="changeGameOrPage" class="gamechoose_block_xxl {{ ticketNum ? '' : 'opciaty05' }}" src="{{resList['7aafb158-7fec-4ae1-a83e-496779c4a107'].url}}" /> <image data-gameType='2' onTap="handleClickGame" 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>
...@@ -106,6 +108,8 @@ ...@@ -106,6 +108,8 @@
class="homepage_pagecanvas" class="homepage_pagecanvas"
onBackPage="backToPage" onBackPage="backToPage"
gameType="{{ gameType }}" gameType="{{ gameType }}"
gameData="{{ gameData }}"
gamePrize="{{ gamePrize }}"
> >
</pagecanvas> </pagecanvas>
...@@ -117,4 +121,4 @@ ...@@ -117,4 +121,4 @@
<rule-modal a:if="{{ruleModalVisible}}" onModalClose="closeRuleModal" text="{{rule}}"></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" onRefreshGameInfo="getGameInfo"></mission-modal>
...@@ -20,6 +20,7 @@ Component({ ...@@ -20,6 +20,7 @@ Component({
messageMadalData: {}, messageMadalData: {},
messageMadalVisble: false, messageMadalVisble: false,
}, },
gameData: null,
didMount() { didMount() {
this.setData({ this.setData({
...@@ -35,13 +36,19 @@ Component({ ...@@ -35,13 +36,19 @@ Component({
// 切换游戏场景 // 切换游戏场景
if (!this.main) return if (!this.main) return
this.main.changeGameSence(this.props.gameType) this.main.changeGameSence(this.props.gameType)
setTimeout(() => {
if (this.props.gameType === 2) this.postMessage('xxlGameData', this.props.gameData)
else if (this.props.gameType === 1) this.postMessage('csdGameData', this.props.gameData)
}, 60)
}
if (this.props.gamePrize !== prevProps.gamePrize && this.props.gamePrize !== null) {
if (this.props.gameType === 2) this.postMessage('xxlGamePrize', this.props.gamePrize)
else if (this.props.gameType === 1) this.postMessage('csdGamePrize', this.props.gamePrize)
} }
}, },
methods: { methods: {
back () { back () { this.props.onBackPage() },
this.props.onBackPage()
},
init() { init() {
console.log('do init'); console.log('do init');
...@@ -75,7 +82,7 @@ Component({ ...@@ -75,7 +82,7 @@ Component({
onCanvasReady() { onCanvasReady() {
console.log('onCanvasReady') console.log('onCanvasReady')
this.changeGameSence(this.props.gameType) this.changeGameSence(this.props.gameType)
//授权和登录先搞 // 授权和登录先搞
checkSystem().then(r => { checkSystem().then(r => {
if (r) { if (r) {
this.getAuth(); this.getAuth();
...@@ -172,10 +179,7 @@ Component({ ...@@ -172,10 +179,7 @@ Component({
this.main.dispatchGlobalEvent("onHide"); this.main.dispatchGlobalEvent("onHide");
} }
}, },
/**
* 获取用户授权信息
*/
async getAuth() { async getAuth() {
const userInfo = await getAuthUserInfo().catch(err => { const userInfo = await getAuthUserInfo().catch(err => {
console.log('未授权成功', err); console.log('未授权成功', err);
...@@ -188,9 +192,7 @@ Component({ ...@@ -188,9 +192,7 @@ Component({
this.login(); this.login();
} }
}, },
/**
* 登录接口
*/
async login() { async login() {
const { nickName, avatar } = app; const { nickName, avatar } = app;
const { success } = await API.login({ userNick: nickName, avatar }).catch(res => { const { success } = await API.login({ userNick: nickName, avatar }).catch(res => {
...@@ -201,11 +203,10 @@ Component({ ...@@ -201,11 +203,10 @@ Component({
this.init(); this.init();
} }
}, },
closeRuleModal() { closeRuleModal() {
this.setData({ this.setData({ ruleModalVisible: false })
ruleModalVisible: false },
});
}
} }
......
...@@ -49,7 +49,10 @@ ...@@ -49,7 +49,10 @@
<!-- 弹窗-奖品信息 --> <!-- 弹窗-奖品信息 -->
<rewards-modal a:if='{{rewardsModalShow}}' modalData='{{rewardsModalData}}' onModalClose='onModalClose' onModalConfirm='onModalConfirm' data-modalType='rewards' /> <rewards-modal a:if='{{rewardsModalShow}}' modalData='{{rewardsModalData}}' onModalClose='onModalClose' onModalConfirm='onModalConfirm' data-modalType='rewards' />
<!-- 弹窗部分 -->
<common-modal-t1 a:if="{{commonModalVisibleT1}}" data="{{commonModalDataT1}}" onModalClose="closeCommonModalT1" onModalConfirm="confirmCommonModalT1" />
<common-modal-t2 a:if="{{commonModalVisibleT2}}" data="{{commonModalDataT2}}" onModalClose="closeCommonModalT2" onModalOne="onModalT2One" onModalTwo="onModalT2Two"/>
<!-- 抽奖次数不足,快去雅顿乐园玩游戏赢抽奖次数吧 -->
<!-- 弹窗-抽奖结果 --> <!-- 弹窗-抽奖结果 -->
<!-- <draw-modal a:if='{{drawModalShow}}' modalData='{{drawModalData}}' onModalClose='onModalClose' onModalConfirm='onModalConfirm' data-modalType='draw' /> --> <!-- <draw-modal a:if='{{drawModalShow}}' modalData='{{drawModalData}}' onModalClose='onModalClose' onModalConfirm='onModalConfirm' data-modalType='draw' /> -->
...@@ -8,6 +8,18 @@ const { commonToast, getAuthUserInfo, navigateToOutside, ConsoleStyle, checkShop ...@@ -8,6 +8,18 @@ const { commonToast, getAuthUserInfo, navigateToOutside, ConsoleStyle, checkShop
Page({ Page({
data: { data: {
commonModalConfirmT1: null,
commonModalVisibleT1: false,
onModalT2One: null,
onModalT2Two: null,
commonModalVisibleT2: false,
ruleModalVisible: false,
rewardsModalVisible: false,
prizesModalVisible: false,
missionModalVisible: false,
resList: resList, resList: resList,
listTurnTable_test: [1, 2, 3, 4, 5], // 转盘奖品信息_测试 listTurnTable_test: [1, 2, 3, 4, 5], // 转盘奖品信息_测试
listTurnTable: [], // 转盘奖品信息 listTurnTable: [], // 转盘奖品信息
...@@ -253,54 +265,46 @@ Page({ ...@@ -253,54 +265,46 @@ Page({
const { commonModalConfirm } = this.data const { commonModalConfirm } = this.data
commonModalConfirm && commonModalConfirm() commonModalConfirm && commonModalConfirm()
}, },
/**
* 执行开始 // 显示通用弹层
*/ showCommonMoadalT1 ({
doStart() { title = 'test- title',
this.showCommonModal({ content = 'test- content',
content: '活动还未开始\n请稍后', confirmCallback = () => {},
btnText: '我知道了', btnImg = '//yun.duiba.com.cn/spark/assets/32d8536184c3539c0d9655d03c1b60f3d5e1f60a.png' }) {
commonModalVisible: true, this.setData({
confirmCallback: () => { commonModalVisibleT1: true,
this.closeCommonModal() commonModalDataT1: { title, content, btnImg },
confirmCommonModalT1: () => {
confirmCallback()
this.closeCommonModalT1()
} }
}) })
}, },
/**
* 显示通用弹层 // 显示通用弹层
* @param {object} options content: 通用弹层内容 btnText:按钮文案 confirmCallback: 按钮确认回调 showCommonMoadalT2 (obj) {
*/ let { title, content, confirmCallback1, confirmCallback2, btnImg1, btnImg2, rewardsImg } = obj
showCommonModal({ content, btnText, confirmCallback }) {
this.setData({ this.setData({
commonModalConfirm: confirmCallback || null, commonModalVisibleT2: true,
commonModalVisible: true, commonModalDataT2: { title, content, btnImg1, btnImg2, rewardsImg },
commonModalData: { content, btnText } onModalT2One: () => { confirmCallback1() },
onModalT2Two: () => { confirmCallback2() }
}) })
}, },
onModalT2One () { this.data.onModalT2One() },
onModalT2Two () { this.data.onModalT2Two() },
confirmCommonModalT1 () { this.data.confirmCommonModalT1() },
/** /**
* 跳转到天猫页面 * 跳转到天猫页面
*/ */
goTmallPage() { goTmallPage() {
navigateToOutside(REDIRECT_URL['tmall']) navigateToOutside(REDIRECT_URL['tmall'])
}, },
/**
* 关闭通用弹层
*/
closeCommonModal() {
this.setData({
commonModalVisible: false
})
},
/**
* 关闭活动规则弹层
*/
closeRuleModal() {
this.setData({
ruleModalVisible: false
})
},
onShareAppMessage() { onShareAppMessage() {
// 返回自定义分享信息 // 返回自定义分享信息
return SHARE_CONFIG // return SHARE_CONFIG
}, },
}) })
{ {
"usingComponents": { "usingComponents": {
"common-modal-t1": "/components/commonModalT1/commonModalT1",
"common-modal-t2": "/components/commonModalT2/commonModalT2"
} }
} }
\ No newline at end of file
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