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

something 02

parent ab88cd1d
......@@ -14,4 +14,3 @@ yarn-error.log
yarn.lock
.cache
packages/**/package-lock.json
scripts/copyJs.js
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
import { RES } from "../module/RES";
import resCanvasList from "../resCanvasList"
import resCanvasListXxl from "../resCanvasList"
import resCanvasListCsd from "../resCanvasListCsd"
const resCanvasList = Object.assign(resCanvasListXxl, resCanvasListCsd)
/**记录全局信息与全局方法 */
export class Ins {
/**舞台宽高 */
......
......@@ -14,6 +14,7 @@ import { LoadingScene } from "./scenes/LoadingScene";
import { Ins } from "./Ins";
import { InitLottie } from "./initLottie";
import { XxlScene } from "./xiaoxiaole/XxlScene";
import { CsdScene } from "./chuansongdai/MainScene";
/**
......@@ -25,6 +26,14 @@ export const GDispatcher = new FYGE.EventDispatcher();
export class Main {
//主舞台
stage: FYGE.Stage;
// 游戏类型: 1 - 传送带, 2 - 消消乐
private gameType;
// 传送带 - 游戏
private CsdScene: CsdScene;
// 消消乐 - 游戏
private XxlScene: XxlScene;
private requestID;
private _pause: boolean;
constructor(canvas: HTMLCanvasElement) {
......@@ -70,6 +79,13 @@ export class Main {
}
}
// 切换游戏
changeGameSence (gameType) {
this.gameType = gameType
if (gameType === 1) changeScene(CsdScene)
else if (gameType === 2) changeScene(XxlScene)
}
private async onAddToStage() {
//初始化层级
layers.init(this.stage);
......@@ -86,7 +102,9 @@ export class Main {
console.log("舞台宽高:",Ins.stageW,Ins.stageH)
await RES.loadSparkAssets(resCanvasList);
console.log('resloadingList 加载完毕')
changeScene(XxlScene);
// XxlScene
changeScene(CsdScene)
await RES.loadSparkAssets(resCanvasList)
......@@ -116,7 +134,7 @@ export class Main {
})
console.log('准备打开弹窗')
setTimeout(() => {
sendTbNet(TbNetName.showModal, {name:'ruleModal'}, (s, res) => {
sendTbNet(TbNetName.showModal, {name: 'test'}, (s, res) => {
console.log('showModal ruleModal, success,res',s,res)
})
}, 3000);
......
import { Scene } from "../../module/views/Scene";
import { RES } from "../../module/RES";
// import res from "../../test/output.json"
import resCanvasList from "../../../game/resCanvasList"
import { Ins } from "../Ins";
import { showPanel } from "../../module/ctrls";
import { SelectCatPanel } from "../panels/selectcatpanel/SelectCatPanel";
export class CsdScene extends Scene {
initUi() {
super.initUi();
var sceneBg = Ins.initSprite("b3c8c187-e5c9-4968-9a00-a118d18ab2fc");
this.addChild(sceneBg);
this.x = (Ins.stageW - 750)>>1;
this.y = (Ins.stageH - 1624)>>1;
showPanel(SelectCatPanel);
// this.addChild(new MainScene());
}
start() {
this.initUi()
}
}
......@@ -4,7 +4,7 @@ import { Ins } from "../Ins";
import resloadingList from "../../../game/resloadingList";
import { changeScene } from "../../module/ctrls";
import { XxlScene } from "../xiaoxiaole/XxlScene";
import { CsdScene } from "../chuansongdai/StartScene";
import { CsdScene } from "../chuansongdai/MainScene";
export class LoadingScene extends Scene {
......
......@@ -17,7 +17,7 @@ export class XxlScene extends Scene {
// showPanel(SelectCatPanel);
// this.addChild(new MainScene());
changeScene(MainScene);
// changeScene(MainScene);
}
......
......@@ -12,31 +12,117 @@ const request = tbccRequest({
// api handle 列表
const apiList = {
...capi,
receiveObjectPrize: {
handle: 'receiveObjectPrize',
// 登陆
login: {
handle: 'login',
method:'get',
isShowLoading: false
isShowLoading: true
},
receiveEnamePrize: {
handle: 'receiveEnamePrize',
method:'get',
// 获取游戏信息
getGameInfo: {
handle: 'getGameInfo',
method: 'get',
isShowLoading: true
},
// 埋点接口
clickStat: {
handle: 'clickStat',
method: 'get',
isShowLoading: false
},
getMyPrizeList: {
handle: 'getMyPrizeList',
method:'get',
// 大转盘抽奖
lottery: {
handle: 'lottery',
method: 'get',
isShowLoading: true
},
// 获取大转盘所有奖品信息
getLotteryPrizeList: {
handle: 'getLotteryPrizeList',
method: 'get',
isShowLoading: false
},
getActivityBaseInfoById: {
handle: 'getActivityBaseInfoById',
method:'get',
// 参与游戏
doJoin: {
handle: 'doJoin',
method: 'get',
isShowLoading: true
},
// 完成游戏
gameOver: {
handle: 'gameOver',
method: 'get',
isShowLoading: true
},
// 观看视频发放雅顿币
sendCoinsByWatch: {
handle: 'sendCoinsByWatch',
method: 'get',
isShowLoading: false
},
login: {
handle: 'login',
method:'get',
// 助力
doHelp: {
handle: 'doHelp',
method: 'get',
isShowLoading: false
}
},
// getActivityBaseInfoById: {
// handle: 'getActivityBaseInfoById',
// method:'get',
// isShowLoading: false
// },
// 领取实物奖品
// receiveObjectPrize: {
// handle: 'receiveObjectPrize',
// method:'get',
// isShowLoading: false
// },
// 我的奖品列表
// getMyPrizeList: {
// handle: 'getMyPrizeList',
// method:'get',
// isShowLoading: false
// },
// 发放权益
// receiveEnamePrize: {
// handle: 'receiveEnamePrize',
// method:'get',
// isShowLoading: false
// },
// 获取会员信息
// getVipInfo: {
// handle: 'getVipInfo',
// method:'get',
// isShowLoading: false
// },
// 概率抽奖
// drawLotteryPrize: {
// handle: 'getVipdrawLotteryPrizeInfo',
// method:'get',
// isShowLoading: false
// },
// 获取商品列表
// getItemListByItemIds: {
// handle: 'getItemListByItemIds',
// method:'get',
// isShowLoading: false
// },
// getActivityBaseInfoById: {
// handle: 'getActivityBaseInfoById',
// method:'get',
// isShowLoading: false
// },
};
// 生成API
......
......@@ -6,16 +6,14 @@ cloud.init({
});
App({
requestType: 'cloud', // yapi,cloud: 云函数
// requestType: 'cloud', // yapi,cloud: 云函数
requestType: 'yapi', // yapi,cloud: 云函数
cloudName: 'floor', // 主云函数项目名 base clientTemplate2C
cloudName: 'yd', // 主云函数项目名 base clientTemplate2C
cloud,
tbcc,
// 全局可用数据
globalData: {
},
// 全局数据
globalData: {},
onLaunch(options) {
this.handleQuery(options.query || {});
......
{
"pages": [
"pages/myprize/myprize",
"pages/homePage/homePage",
"pages/index/index",
"pages/pagecanvas/pagecanvas",
"pages/pageshop/pageshop",
"pages/myprize/myprize",
"pages/tbccDemo/tbccDemo"
],
"window": {
......
'use strict';
import React, { Component } from 'react';
import resList from '../../resconfig/resList';
import './comren_wu_dan_chuangwrapper.less';
class Comren_wu_dan_chuangwrapper extends Component {
constructor(props) {
super(props);
this.state = this.state || { resList: resList };
}
render() {
return (
<div className="ren_wu_dan_chuangwrapper">
<div className="ju_xing7000" />
<div className="ren_wu_dan_chuang">
<img
className="ren_wu_dan_chuang_bei_jingbg"
src={this.state.resList['e0c8c1ea-bfa2-4ac6-a70a-1b21f516af10'].url}
/>
<div className="zuo_ren_wu_men_piao5">
<img
className="yuan_jiao_ju_xing86022"
src={this.state.resList['c83262a8-7557-4321-8460-c23b712ce634'].url}
/>
<img className="ren_wuicon05" src={this.state.resList['7b839a18-3277-41aa-9f41-0c3876651bdd'].url} />
<div className="zu85">
<span className="jia_ru_dian_pu_hui_yuan">加入店铺会员</span>
<span className="le_yuan_men_piao121">乐园门票 +1</span>
</div>
<img className="yi_guan_zhu02" src={this.state.resList['01cb5ef0-2181-44f4-92ad-a2b7bc5cd224'].url} />
<span className="yi_guan_zhu20">已关注</span>
</div>
<div className="zuo_ren_wu_men_piao4">
<img
className="yuan_jiao_ju_xing86019"
src={this.state.resList['c83262a8-7557-4321-8460-c23b712ce634'].url}
/>
<div className="ju_xing118" />
<img className="ren_wuicon04" src={this.state.resList['2eb24d59-d131-4dfb-9dfe-7b9f61bd4293'].url} />
<div className="zu84">
<span className="guan_zhu_dian_pu">关注店铺</span>
<span className="le_yuan_men_piao117">乐园门票 +1</span>
</div>
<img className="yi_guan_zhubg" src={this.state.resList['120d6fd3-a52d-4e8e-9064-160f112ff0da'].url} />
<span className="yi_guan_zhu16">已关注</span>
</div>
<div className="zuo_ren_wu_men_piao3">
<img
className="yuan_jiao_ju_xing86015"
src={this.state.resList['c83262a8-7557-4321-8460-c23b712ce634'].url}
/>
<div className="ju_xing114" />
<img className="ren_wuicon03" src={this.state.resList['56f68e31-8eba-42ce-aafa-0ad9b0bf9f68'].url} />
<div className="zu83">
<span className="wan_cheng_xia_dan_ding_dan">完成下单订单</span>
<span className="le_yuan_men_piao113">乐园门票 +1</span>
</div>
<img className="qu_xia_dan12" src={this.state.resList['23000075-9bcf-461b-80a9-527340b1d242'].url} />
<span className="qu_xia_dan11">去下单</span>
</div>
<div className="zuo_ren_wu_men_piao2">
<img
className="yuan_jiao_ju_xing86010"
src={this.state.resList['c83262a8-7557-4321-8460-c23b712ce634'].url}
/>
<div className="ju_xing19" />
<img className="ren_wuicon02" src={this.state.resList['d2f81084-e23b-47f0-a016-eb590b6b7af2'].url} />
<div className="zu81">
<span className="guan_kan_zhi_bo1_fen_zhong">观看直播1分钟</span>
<span className="le_yuan_men_piao18">乐园门票 +1</span>
</div>
<img className="qu_guan_kan7" src={this.state.resList['ac35b4f9-b90b-4464-84be-fe14cf873dcc'].url} />
<span className="qu_guan_kan6">去观看</span>
</div>
<div className="zuo_ren_wu_men_piao1">
<img
className="yuan_jiao_ju_xing8605"
src={this.state.resList['c83262a8-7557-4321-8460-c23b712ce634'].url}
/>
<div className="ju_xing14" />
<img className="ren_wuicon01" src={this.state.resList['95dc5f5a-d1b2-4994-b1bb-e45ba9e53914'].url} />
<div className="zu82">
<span className="liu_lan_zhi_ding_shang_pin30s">浏览制定商品30s</span>
<span className="le_yuan_men_piao13">乐园门票 +1</span>
</div>
<img className="qu_liu_lanbg" src={this.state.resList['e4530dc3-a3c7-4992-8553-2be55e6407b0'].url} />
<span className="qu_liu_lan">去浏览</span>
</div>
<img
className="an_niu_guan_bi_dan_chuang_kao_bei2"
src={this.state.resList['4abc8bb6-5779-49ad-84b4-b4ade4f51fcb'].url}
/>
</div>
</div>
);
}
}
export default Comren_wu_dan_chuangwrapper;
......@@ -17,10 +17,10 @@
}
.my-prize-page .my-prize-label {
width: 286rpx;
height: 49rpx;
margin: 140rpx auto 40rpx;
background: url('//yun.duiba.com.cn/aurora/assets/a15fe07a819f3f6deb271725b37468030523dc05.png') no-repeat;
width: 400rpx;
height: 38rpx;
margin: 130rpx auto 36rpx;
background: url('//yun.duiba.com.cn/spark/assets/ca2933049f707ac6849c5c964fec12891574b60f.png') no-repeat;
background-size: 100% 100%;
}
......
......@@ -2,20 +2,29 @@
<view class="my-prize-wrap">
<view class="my-prize-label"></view>
<view class="my-prize-list" a:if="{{myPrizeList && myPrizeList.length > 0}}">
<view class="my-prize-item" a:for="{{myPrizeList}}">
<image class="my-prize-avatar" src="{{item.image}}"/>
<view class="my-prize-content">
<label class="my-prize-name">{{item.name}}</label>
<!-- <view class="my-prize-subtitle"> -->
<!-- <label class="my-prize-code">奖品编码:{{item._id}}</label> -->
<!-- 复制按钮 -->
<!-- <image class="my-prize-copy" data-text="{{item._id}}" onTap="handleCopyId" src="{{task.image.copyIcon}}" /> -->
<!-- </view> -->
<!-- 复制按钮 -->
<image class="my-prize-copy" data-text="{{item._id}}" onTap="handleCopyId" src="{{task.image.copyIcon}}" />
<view class="my-prize-tip" a:if="{{item.drawStatus === PRIZE_DRAW_STATUS_MAP.FAILURE}}">{{item.remark}}</view>
<view class="my-prize-tip" a:if="{{item.drawStatus === PRIZE_DRAW_STATUS_MAP.REPEAT || (item.drawStatus === PRIZE_DRAW_STATUS_MAP.RECEIVE)}}">请于{{endTime}}前领取</view>
<view class="my-prize-tip" a:if="{{item.drawStatus === PRIZE_DRAW_STATUS_MAP.FINISHED }}">奖品已过期失效</view>
</view>
<view class="prize-status" style="{{task.btnStyle}}">
<!-- 未领取 -->
<block a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.RECEIVE}}">
<!-- 实物填写地址 -->
......@@ -23,6 +32,7 @@
<!-- 优惠券立即领取 -->
<image a:else onTap="handleClick" data-item="{{item}}" src="{{task.image.getBth}}" />
</block>
<!-- 已领取 -->
<block a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.SUCCESS}}">
<!-- 实物查看物流 -->
......@@ -31,15 +41,21 @@
<image a:else data-item="{{item}}" src="{{task.image.gotBtn}}" />
<!-- <image a:else onTap="handleTouse" data-item="{{item}}" src="{{task.image.useBtn}}" /> -->
</block>
<!-- 重新领取 -->
<image a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.REPEAT}}" onTap="handleClick" data-item="{{item}}" src="{{task.image.getAgainBtn}}" />
<!-- 已失效 -->
<image a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.FINISHED}}" src="{{task.image.invalidBtn}}" />
<!-- 领取失败 -->
<image a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.FAILURE}}" src="{{task.image.failBth}}" />
</view>
</view>
</view>
<view a:if="{{myPrizeList && myPrizeList.length === 0}}" class="my-prize-empty">暂无奖品</view>
</view>
<logistics-modal a:if="{{isLogistic}}" prizeItem="{{currentPrize}}" onCloseModal="closeLogisticModal" task="{{task.logisticsImage}}"/>
......
......@@ -3,9 +3,20 @@
height: 100%;
top: 0;
left: 0rpx;
display: block;
position: absolute;
z-index: 2;
background: white;
}
.homepage_pagecanvas {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
}
.homepage_mian {
width: 100%;
height: 100%;
......@@ -60,7 +71,7 @@
position: absolute;
z-index: 5;
}
.turntable_block {
.bottom_turntable_block {
width: 194rpx;
height: 211rpx;
opacity: 1;
......@@ -68,7 +79,7 @@
top: 67rpx;
position: absolute;
}
.turntable_block_image {
.bottom_turntable_block_image {
width: 194rpx;
height: 211rpx;
opacity: 1;
......@@ -122,20 +133,20 @@
.ydgame_block {
.bottom_ydgame_block {
width: 267rpx;
height: 312rpx;
opacity: 1;
left: 200rpx;
position: absolute;
}
.ydgame_block_image {
.bottom_ydgame_block_image {
width: 267rpx;
height: 260rpx;
opacity: 1;
position: absolute;
}
.ydgame_block_coin {
.bottom_ydgame_block_coin {
width: 199rpx;
height: 44rpx;
line-height: 44rpx;
......@@ -151,14 +162,14 @@
}
.mission_block {
.bottom_mission_block {
width: 194rpx;
height: 235rpx;
opacity: 1;
top: 67rpx;
position: absolute;
}
.mission_block_freenum {
.bottom_mission_block_freenum {
width: 100%;
height: 40rpx;
line-height: 40rpx;
......@@ -171,7 +182,7 @@
color: rgba(200, 82, 73, 1);
text-align: center;
}
.mission_block_image {
.bottom_mission_block_image {
width: 194rpx;
height: 211rpx;
opacity: 1;
......@@ -252,11 +263,11 @@
}
.video_block_text_opciaty0 {
.block_opciaty0 {
opacity: 0;
transition: opacity .2s linear;
}
.video_block_text_opciaty1 {
.block_opciaty1 {
opacity: 1;
transition: opacity .2s linear;
}
......
<view class="homepage_wrapper">
<!-- 业务页面部分 -->
<view class="homepage_wrapper {{ gameShow ? 'block_opciaty0' : '' }}" hidden="{{ gameShow_timeout }}">
<view class="homepage_mian">
<view class="homepage_back">
<image class="bei_jing80" src="{{resList['abe2084e-ff0b-454d-ad6e-a9117e44bdaa'].url}}" />
......@@ -16,8 +16,7 @@
<!-- 视频部分 -->
<view hidden="{{videoBottom_timeout}}" class="video_block {{ videoBottom ? 'video_block_text_opciaty0' : ''}}">
<view hidden="{{videoBottom_timeout}}" class="video_block {{ videoBottom ? 'block_opciaty0' : ''}}">
<view class="video_block_wrapper">
<video
......@@ -56,7 +55,7 @@
</view>
<view hidden="{{!videoBottom_timeout}}" onTap="onVideoTurnBig" class="video_block_s {{ !videoBottom ? 'video_block_text_opciaty0' : ''}}" >
<view hidden="{{!videoBottom_timeout}}" onTap="onVideoTurnBig" class="video_block_s {{ !videoBottom ? 'block_opciaty0' : ''}}" >
<!-- <image class='video_s' src='' /> -->
<view class='video_s'></view>
<image class="bo_fang_an_niu" src="{{resList['8d5b83a6-59d9-484c-a74e-99f13ba20b02'].url}}" />
......@@ -67,26 +66,25 @@
<!-- 底部 门票-乐园-抽奖 -->
<view class="bottom">
<view class="turntable_block">
<image class="turntable_block_image" src="{{resList['44b8923b-c9f9-4246-a4ff-4093ff97ca33'].url}}" />
<view class="bottom_turntable_block">
<image class="bottom_turntable_block_image" src="{{resList['44b8923b-c9f9-4246-a4ff-4093ff97ca33'].url}}" />
</view>
<view class="ydgame_block" onTap="openShowChooseGame">
<image class="ydgame_block_image" src="{{resList['23d2db92-a7a2-48a2-a34e-a7c1ec02fc2f'].url}}" />
<view class="ydgame_block_coin"> 雅顿币:XXX </view>
<view class="bottom_ydgame_block" onTap="openShowChooseGame">
<image class="bottom_ydgame_block_image" src="{{resList['23d2db92-a7a2-48a2-a34e-a7c1ec02fc2f'].url}}" />
<view class="bottom_ydgame_block_coin"> 雅顿币:XXX </view>
</view>
<view class="mission_block">
<image class="mission_block_image" src="{{resList['db8bff60-3223-428b-81a8-27c4742a6469'].url}}" />
<view class="mission_block_freenum">免费次数X2</view>
<view class="bottom_mission_block" onTap="showMissionModal">
<image class="bottom_mission_block_image" src="{{resList['db8bff60-3223-428b-81a8-27c4742a6469'].url}}" />
<view class="bottom_mission_block_freenum">免费次数X2</view>
</view>
<!-- 选择游戏 -->
<view class="gamechoose_block" a:if='{{ showChooseGame }}'>
<image class="gamechoose_block_back" src="{{resList['22c949b8-84af-4a22-bb21-70088d1eafad'].url}}" />
<image class="gamechoose_block_sc" src="{{resList['f2915694-4e09-4776-8f38-9ddb285e4d17'].url}}" />
<image class="gamechoose_block_xxl" src="{{resList['7aafb158-7fec-4ae1-a83e-496779c4a107'].url}}" />
<image data-gameType='1' onTap="changeGameOrPage" class="gamechoose_block_sc" 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}}" />
<view class="gameChoose_mask" onTap="closeShowChooseGame"></view>
</view>
</view>
......@@ -94,6 +92,19 @@
</view>
</view>
<!-- 游戏部分 -->
<pagecanvas
class="homepage_pagecanvas"
hidden="{{ !gameShow }}"
onBackPage="backToPage"
gameType="{{ gameType }}"
>
</pagecanvas>
<!-- 弹窗部分 -->
<rule-modal a:if="{{ruleModalVisible}}" onModalClose="closeRuleModal"><text>{{rule}}</text></rule-modal>
<rewards-modal a:if="{{rewardsModalVisible}}" onModalClose="closeRewardsModal"></rewards-modal>
<prizes-modal a:if="{{prizesModalVisible}}" onModalClose="closePrizesModal"></prizes-modal>
<mission-modal a:if="{{missionModalVisible}}" onModalClose="closeMissionModal"></mission-modal>
const app = getApp();
import API from '../../api';
import resList from '../../resconfig/resList.js'
// const { tbcc } = app;
// const { SHARE_CONFIG, REDIRECT_URL } = tbcc.constants;
// const { commonToast, getAuthUserInfo, navigateToOutside } = tbcc.tb;
const { tbcc } = app;
const { SHARE_CONFIG, REDIRECT_URL } = tbcc.constants;
const { commonToast, getAuthUserInfo, navigateToOutside } = tbcc.tb;
Page({
doExchange: () => {
......@@ -42,13 +42,20 @@ Page({
videoActiveIndex: 0,
// ------ 视频 配置 ------ //
// 出现选择游戏控制
// 出现 选择游戏弹窗
showChooseGame: false,
// 出现 游戏
gameShow: false,
// 出现 游戏 - 具有延迟的
gameShow_timeout: false,
// 展示游戏类型: 1 - 传送带, 2 - 消消乐, 0 - 不展示
gameType: 1,
commonModalConfirm: null,
commonModalVisible: false,
ruleModalVisible: false,
rewardsModalVisible: false,
prizesModalVisible: false
prizesModalVisible: false,
missionModalVisible: false
},
// 视频地址列表 - 存储播放时常
videoSrcArr: [
......@@ -68,12 +75,15 @@ Page({
'https://yun.duiba.com.cn/spark/assets/弹窗背景_奖品.dce4e3dd9a3fcae166dfbd934b714ce1bc7fa5c9.png',
'https://yun.duiba.com.cn/spark/assets/7191ae57140b4937ae42500e76aa533693326ef9.png',
],
onLoad(query) {
// 页面加载
// this.getAuth();
console.info(`Page onLoad with query: ${JSON.stringify(query)}`);
},
init() {
// todo: save data
console.log('do init')
},
......@@ -117,7 +127,7 @@ Page({
// 登录接口
async login() {
const { nickName, avatar } = app;
const { success } = await API.login({ userNick: nickName, avatar }).catch(res => {
const { success } = await API.login({ activityId: app.activityId, userNick: nickName, avatar }).catch(res => {
commonToast(res && res.message);
}) || {};
......@@ -144,13 +154,28 @@ Page({
});
},
// 切换到游戏
changeGameOrPage (e) {
let type = Number(e.currentTarget.dataset.gameType)
this.videoCtx.pause()
this.setData({ gameShow: true, gameType: type })
setTimeout(() => { this.setData({ gameShow_timeout: true }) }, 350)
},
// 从游戏 返回 到 主页
backToPage () {
this.setData({ gameShow_timeout: false })
setTimeout(() => { this.setData({ gameShow: false }) }, 350)
},
// video - turn left
videoTurnLeft () {
let i = this.data.videoActiveIndex
if (i > 0) {
console.log('turn left')
this.videoCtx.stop()
this.videoRecord(i - 1)
this.videoRecord(i)
setTimeout(() => {
console.log('videoTurnLeft')
i -= 1
......@@ -172,7 +197,7 @@ Page({
if (i < this.videoSrcArr.length - 1) {
console.log('turn right')
this.videoCtx.stop()
this.videoRecord(i + 1)
this.videoRecord(i)
setTimeout(() => {
console.log('videoTurnRight')
i += 1
......@@ -207,6 +232,7 @@ Page({
// video - change to another video
videoRecord (index) {
this.videoSrcArr[index].timeStamp = this.timeStamp
// if (this.timeStamp) return
this.timeStamp = 0
this.timeStampCountFlag = false
this.timeStampRecord = 0
......@@ -223,13 +249,13 @@ Page({
onPause() {
console.log('---- 视频播放暂停')
console.log('timeStamp', this.timeStamp)
this.videoRecord(this.videoActiveIndex)
this.videoRecord(this.data.videoActiveIndex)
},
// video - onEnded
onEnded(e) {
console.log('---- 视频播放结束', e)
this.videoRecord(this.videoActiveIndex)
// this.videoRecord(this.data.videoActiveIndex)
},
// video - onPlayError
......@@ -246,9 +272,7 @@ Page({
},
// video - onLoading
onLoading (e) {
console.log(e)
},
onLoading (e) { console.log(e) },
// 页面隐藏
onHide() {
......@@ -274,11 +298,14 @@ Page({
showRuleModal() { this.setData({ ruleModalVisible: true }) },
showRewardsModal() { this.setData({ rewardsModalVisible: true }) },
showPrizesModal() { this.setData({ prizesModalVisible: true }) },
showMissionModal () { this.setData({ missionModalVisible: true}) },
// 弹窗控制 - 关闭
closeRuleModal() { this.setData({ ruleModalVisible: false }) },
closeRewardsModal () { this.setData({ rewardsModalVisible: false}) },
closePrizesModal () { this.setData({ prizesModalVisible: false}) },
closeMissionModal () { this.setData({ missionModalVisible: false}) },
// 通用弹层 - 开启
confirmCommonModal() {
......
{
"usingComponents": {
"pagecanvas": "/pages/pagecanvas/pagecanvas",
"rule-modal": "/components/ruleModal/ruleModal",
"rewards-modal": "/components/comRewardsModal/comRewardsModal",
"prizes-modal": "/components/comPrizesModal/comPrizesModal",
"common-modal": "/components/commonModal/commonModal",
"mission-modal": "/components/comMissionModal/comMissionModal",
"end-modal": "/components/endModal/endModal"
}
}
\ No newline at end of file
......@@ -16,7 +16,7 @@ Page({
endTime: null,//到期时间
task: {
image: {
bg: '//yun.duiba.com.cn/aurora/assets/7283d715cc5c7d13a5f498d15f5f5b9f4d9c29e5.jpg', //背景图
bg: '//yun.duiba.com.cn/spark/assets/bg1.d818f787351875b0982937d8bb68b0655febec3c.png', //背景图
copyIcon: '//yun.dui88.com/duiba-components-c-myprizemyprize_copy_code.png', //复制
addressBth: '//yun.duiba.com.cn/aurora/assets/82cc3c6d8861334ebaf128c98e3341b687bdc007.png', //填写地址(实物奖品)
getBth: '//yun.dui88.com/duiba-components-c-myprizeget_now.png', //立即领取(除实物奖品外)
......
......@@ -9,6 +9,7 @@
bottom: 0;
right: 0;
min-height: 100vh; */
background: pink;
width:100%;
height:100vh;
flex: 1;
......
<view disable-scroll="true" class="page-game">
<view disable-scroll="true" class="page-game" onTap="testBack">
<canvas disable-scroll="true" id="canvas" type="2d" class="canvas" onTouchStart="onMouseEvent" onTouchMove="onMouseEvent" onTouchEnd="onMouseEvent" onReady="onCanvasReady">
</canvas>
</view>
<rule-modal a:if="{{ruleModalVisible}}" onModalClose="closeRuleModal"><text>{{rule}}</text></rule-modal>
\ No newline at end of file
<!-- <rule-modal a:if="{{ruleModalVisible}}" onModalClose="closeRuleModal"><text>{{rule}}</text></rule-modal> -->
\ No newline at end of file
'use strict';
import { Main } from './output';
import API from '../../api';
const app = getApp();
......@@ -12,29 +10,37 @@ const checkSystem = async () => {
return tbcc.utils.versionCompare(version, '9.8.0');
}
Page({
Component({
data: {
ruleModalVisible: false
// 当前正在进行的游戏
gameType: 1,
// 规则弹窗
ruleModalVisible: false,
// 消息弹窗
messageMadalData: {},
messageMadalVisble: false,
},
onLoad(props) {
this.setData({});
didMount() {
this.setData({
gameType: this.props.gameType
})
this.init()
},
checkSystem().then(r => {
if (!r) {
my.showToast({
content: "请升级最新版本的淘宝",
duration: 5000
});
didUpdate(prevProps, prevData) {
console.warn('gameType', this.props.gameType)
if (this.props.gameType !== prevProps.gameType) {
this.setData({ gameType: this.props.gameType })
// 切换游戏场景
if (!this.main) return
this.main.changeGameSence(this.props.gameType)
}
});
},
onReady() {
console.log('on ready')
//授权和登录先搞
// this.getAuth();
methods: {
testBack () {
this.props.onBackPage()
},
init() {
......@@ -45,7 +51,6 @@ Page({
spark_startEngine() {
console.log('spark_startEngine')
var self = this;
console.log(my.createCanvas)
my.createCanvas({
id: 'canvas',
success: ccc => {
......@@ -69,6 +74,7 @@ Page({
onCanvasReady() {
console.log('onCanvasReady')
this.changeGameSence(this.props.gameType)
//授权和登录先搞
checkSystem().then(r => {
if (r) {
......@@ -109,17 +115,19 @@ Page({
}
};
break;
case "mine.navigateToPage": //切换page
case "mine.navigateToPage": // 切换page
data = { success: true, data: {} };
my.navigateTo({
url: `/pages/${parameter.name}/${parameter.name}`
});
break;
case "mine.showModal": //切换page
case "mine.showModal": // 展示弹窗
data = { success: true, data: {} };
const key = `${parameter.name}Visible`;
const dataKey = `${parameter.name}Data`;
const toSetData = {};
toSetData[key]=true;
toSetData[key] = true;
toSetData[dataKey] = parameter.data;
this.setData(toSetData);
break;
case 'test':
......@@ -196,4 +204,6 @@ Page({
});
}
}
});
\ No newline at end of file
{
"usingComponents": {
"rule-modal": "/components/ruleModal/ruleModal"
}
"component": true,
"usingComponents": {}
}
\ 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