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

something update about openanimation

parent ab640694
No preview for this file type
{
"success":true,
"message":"do amet magna",
"code":"occaecat dolore ea velit",
"data":{
"_id":"quis elit fugiat",
"itemId":-53889922.57002734,
"createTime":1600690251689,
"openId":"ea dolor eiusmod Excepteur",
"deleteStatus":-42319130.58476988,
"rule":"in",
"startTime":1604159868046,
"updateTime":1603460390561,
"endTime":1598228727513,
"title":"Ut tempor qui dolor laboris",
"awardReceiveExpiredTime":1601308120892
}
}
\ No newline at end of file
{"code":"adipisicing sunt","success":false,"message":"ea non","data":{"list":{"useUrl":"elit non labore","openId":-16899820.960220918,"_id":"Ut nulla","userNick":"in","avatar":"ullamco eu aliqua mollit eiusmod","activityId":"dolor","prizeId":"nulla enim non aliquip ipsum","type":1,"image":"https://dummyimage.com/400x400","name":"Duis nostrud dolore","drawStatus":1,"createTime":1602033015243,"updateTime":1610946860060,"addressdetail":"laboris ea tempor elit","area":"西湖区","city":"杭州市","phone":16270225970,"provice":"浙江省","receiveName":"labore magna aliquip","receiveTime":1608949355424,"expiredTime":1612654245440}}} {
\ No newline at end of file "code":"adipisicing sunt",
"success": true,
"message":"ea non",
"data":{
"list": [
{
"useUrl":"elit non labore",
"openId":-16899820.960220918,
"_id":"Ut nulla",
"userNick":"in",
"avatar":"ullamco eu aliqua mollit eiusmod",
"activityId":"dolor",
"prizeId":"nulla enim non aliquip ipsum",
"type": 3,
"image":"https://dummyimage.com/400x400",
"name":"Duis nostrud dolore",
"drawStatus": 1,
"createTime":1602033015243,
"updateTime":1610946860060,
"addressdetail":"laboris ea tempor elit",
"area":"西湖区",
"city":"杭州市",
"phone":16270225970,
"provice":"浙江省",
"receiveName":"labore magna aliquip",
"receiveTime":1608949355424,
"expiredTime":1612654245440
},
{
"useUrl":"elit non labore",
"openId":-16899820.960220918,
"_id":"Ut nulla",
"userNick":"in",
"avatar":"ullamco eu aliqua mollit eiusmod",
"activityId":"dolor",
"prizeId":"nulla enim non aliquip ipsum",
"type": 3,
"image":"https://dummyimage.com/400x400",
"name":"Duis nostrud dolore",
"drawStatus": 2,
"createTime":1602033015243,
"updateTime":1610946860060,
"addressdetail":"laboris ea tempor elit",
"area":"西湖区",
"city":"杭州市",
"phone":16270225970,
"provice":"浙江省",
"receiveName":"labore magna aliquip",
"receiveTime":1608949355424,
"expiredTime":1612654245440
},
{
"useUrl":"elit non labore",
"openId":-16899820.960220918,
"_id":"Ut nulla",
"userNick":"in",
"avatar":"ullamco eu aliqua mollit eiusmod",
"activityId":"dolor",
"prizeId":"nulla enim non aliquip ipsum",
"type": 3,
"image":"https://dummyimage.com/400x400",
"name":"Duis nostrud dolore",
"drawStatus":1,
"createTime":1602033015243,
"updateTime":1610946860060,
"addressdetail":"laboris ea tempor elit",
"area":"西湖区",
"city":"杭州市",
"phone":16270225970,
"provice":"浙江省",
"receiveName":"labore magna aliquip",
"receiveTime":1608949355424,
"expiredTime":1612654245440
},
{
"useUrl":"elit non labore",
"openId":-16899820.960220918,
"_id":"Ut nulla",
"userNick":"in",
"avatar":"ullamco eu aliqua mollit eiusmod",
"activityId":"dolor",
"prizeId":"nulla enim non aliquip ipsum",
"type": 3,
"image":"https://dummyimage.com/400x400",
"name":"Duis nostrud dolore",
"drawStatus": 3,
"createTime":1602033015243,
"updateTime":1610946860060,
"addressdetail":"laboris ea tempor elit",
"area":"西湖区",
"city":"杭州市",
"phone":16270225970,
"provice":"浙江省",
"receiveName":"labore magna aliquip",
"receiveTime":1608949355424,
"expiredTime":1612654245440
},
{
"useUrl":"elit non labore",
"openId":-16899820.960220918,
"_id":"Ut nulla",
"userNick":"in",
"avatar":"ullamco eu aliqua mollit eiusmod",
"activityId":"dolor",
"prizeId":"nulla enim non aliquip ipsum",
"type": 4,
"image":"https://dummyimage.com/400x400",
"name":"Duis nostrud dolore",
"drawStatus": 6,
"createTime":1602033015243,
"updateTime":1610946860060,
"addressdetail":"laboris ea tempor elit",
"area":"西湖区",
"city":"杭州市",
"phone":16270225970,
"provice":"浙江省",
"receiveName":"labore magna aliquip",
"receiveTime":1608949355424,
"expiredTime":1612654245440
},
{
"useUrl":"elit non labore",
"openId":-16899820.960220918,
"_id":"Ut nulla",
"userNick":"in",
"avatar":"ullamco eu aliqua mollit eiusmod",
"activityId":"dolor",
"prizeId":"nulla enim non aliquip ipsum",
"type": 1,
"image":"https://dummyimage.com/400x400",
"name":"Duis nostrud dolore",
"drawStatus": 5,
"createTime":1602033015243,
"updateTime":1610946860060,
"addressdetail":"laboris ea tempor elit",
"area":"西湖区",
"city":"杭州市",
"phone":16270225970,
"provice":"浙江省",
"receiveName":"labore magna aliquip",
"receiveTime":1608949355424,
"expiredTime":1612654245440
}
]
}
}
\ No newline at end of file
{
"code":-13061372.105427355,
"success":true,
"data":{
"isNewUser": true,
"openId": "laboris tempor",
"inviteId": "reprehenderit tempor"
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
const resCanvasListCsd = { const resCanvasListCsd = {
'63cb446e-1158-4a94-bf0c-c19ecc7d2cc6': {
name: 'openTexture',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/openTexture.4558fad0aadb7003efd6b71716816a93ad181283.png',
uuid: '63cb446e-1158-4a94-bf0c-c19ecc7d2cc6'
},
}; };
export default resCanvasListCsd; export default resCanvasListCsd;
\ No newline at end of file
var fs = require("fs");
// fs.writeFileSync(
// "./released/output.js",
// fs.readFileSync("./output.js")
// )
// var endPath = 'D:/duibaGame/测试项目0527/taobaominiTest/client/pages/index1/';
var endPath = '/Applications/DUIBA-TAOBAO/YD/new_taobao/taobao_mini/client/pages/pagecanvas/';
var version = Math.round(new Date().getTime() / 1000);
// fs.writeFileSync(endPath + "output." + version + ".js", fs.readFileSync("./released/output.js"));
fs.writeFileSync(endPath + "output.js", fs.readFileSync("./released/output.js"));
// console.log("js覆盖完成")
console.log(`版本号:
${version}`)
\ No newline at end of file
...@@ -31,6 +31,7 @@ export namespace InitLottie { ...@@ -31,6 +31,7 @@ export namespace InitLottie {
let textureJson = arr[i].json; let textureJson = arr[i].json;
FYGE.GlobalLoader.loadImage((s, image) => { FYGE.GlobalLoader.loadImage((s, image) => {
if (s) { if (s) {
// hhyy
FYGE.createTextureSheet(new FYGE.BaseTexture(image),textureJson ); FYGE.createTextureSheet(new FYGE.BaseTexture(image),textureJson );
} else { } else {
mark = false mark = false
......
...@@ -6,7 +6,9 @@ import { destroyAllCtrls, changeScene, hideWaiting } from "../module/ctrls"; ...@@ -6,7 +6,9 @@ import { destroyAllCtrls, changeScene, hideWaiting } from "../module/ctrls";
import { destroyNetData, sendTbNet, TbNetName } from "./TaoBaoNet"; import { destroyNetData, sendTbNet, TbNetName } from "./TaoBaoNet";
import resCanvasList from '../resCanvasList'; import resCanvasList_ from '../resCanvasList';
import resCanvasListCsd from '../resCanvasListCsd'
const lottieTexture = require('./openAnimation/Texture.json')
import resloadingList from '../resloadingList'; import resloadingList from '../resloadingList';
import resLottieList from '../resLottieList'; import resLottieList from '../resLottieList';
import { setStage } from "./scenes/stage"; import { setStage } from "./scenes/stage";
...@@ -15,6 +17,8 @@ import { Ins } from "./Ins"; ...@@ -15,6 +17,8 @@ import { Ins } from "./Ins";
import { InitLottie } from "./initLottie"; import { InitLottie } from "./initLottie";
import { XxlScene } from "./xiaoxiaole/XxlScene"; import { XxlScene } from "./xiaoxiaole/XxlScene";
import { CsdScene } from "./chuansongdai/MainScene"; import { CsdScene } from "./chuansongdai/MainScene";
import { OpenAni } from "./openAnimation/MainScene";
import { resolve } from "path";
/** /**
...@@ -84,6 +88,20 @@ export class Main { ...@@ -84,6 +88,20 @@ export class Main {
this.gameType = gameType this.gameType = gameType
if (gameType === 1) changeScene(CsdScene) if (gameType === 1) changeScene(CsdScene)
else if (gameType === 2) changeScene(XxlScene) else if (gameType === 2) changeScene(XxlScene)
else if (gameType === 3) changeScene(OpenAni)
else return
}
loadImageTextures (resCanvasList) {
return new Promise((resolve, reject) => {
FYGE.GlobalLoader.loadImage((s, image) => {
if (s) {
console.log('loadImageTextures')
FYGE.createTextureSheet(new FYGE.BaseTexture(image), lottieTexture );
resolve('complete')
}
}, resCanvasList['63cb446e-1158-4a94-bf0c-c19ecc7d2cc6'].url)
})
} }
private async onAddToStage() { private async onAddToStage() {
...@@ -100,15 +118,21 @@ export class Main { ...@@ -100,15 +118,21 @@ export class Main {
Ins.stageW = this.stage.viewRect.width; Ins.stageW = this.stage.viewRect.width;
Ins.stageH = this.stage.viewRect.height; Ins.stageH = this.stage.viewRect.height;
console.log("舞台宽高:",Ins.stageW,Ins.stageH) console.log("舞台宽高:",Ins.stageW,Ins.stageH)
await RES.loadSparkAssets(resCanvasList);
console.log('resloadingList 加载完毕')
// XxlScene let resCanvasList = Object.assign(resCanvasList_, resCanvasListCsd)
changeScene(CsdScene)
await RES.loadSparkAssets(resCanvasList) await RES.loadSparkAssets(resCanvasList)
console.log('resloadingList 加载完毕')
this.loadImageTextures(resCanvasList).then(res => {
changeScene(OpenAni)
})
// XxlScene
// changeScene(CsdScene)
// OpenAni
// await InitLottie.initLottieList(openLottieList);
console.log('resCanvasList 加载完毕')
await InitLottie.initLottieList(resLottieList); await InitLottie.initLottieList(resLottieList);
console.log("initLottieList完成") console.log("initLottieList完成")
FYGE.GDispatcher.dispatchEvent("loadEnd"); FYGE.GDispatcher.dispatchEvent("loadEnd");
......
import { Scene } from "../../module/views/Scene";
import { RES } from "../../module/RES";
import Root from './Root';
export class OpenAni extends Scene {
constructor(props) {
super(props)
}
initUi() {
super.initUi();
var canvas: FYGE.Container = new FYGE.Container();
canvas.position.set(0, 0);
this.addChild(canvas);
}
start() {
this.addChild(new Root())
}
}
import { RES } from "../../module/RES"
import resCanvasList from '../../resCanvasList'
import { GDispatcher } from './../Main';
import { open } from './outputTs/open'
export default class Root extends FYGE.Container {
time;
stageHeight;
backGround;
openAni;
constructor() {
super()
this.once(FYGE.Event.ADDED_TO_STAGE, this.onAddToStage, this)
// 全局-游戏开始
GDispatcher.addEventListener('animation-start', () => {}, this)
// 全局-游戏结束(外部监听)
GDispatcher.dispatchEvent('animation-over')
}
initUi () {
this.backGround = new FYGE.Sprite()
this.backGround.x = 0
this.backGround.y = 0
this.backGround.width = 750
this.backGround.height = 1624
this.backGround.texture = RES.getRes(resCanvasList['7fcd3fb3-57bd-436a-afca-989b68b6b311'].url)
this.backGround.visible = false
this.addChild(this.backGround)
this.openAni = new FYGE.Lottie(open)
this.addChild(this.openAni)
// this.openAni.visible = true
this.openAni.play(1)
}
animationStart () {
}
// 结束游戏
animationOver () {
}
// 创建倒计时
createCountdownTimer (options) {
}
onAddToStage () {
this.stageHeight = this.stage.viewRect.height
this.y = this.stage.viewRect.height / 2 - 1624 / 2
this.initUi()
}
}
This diff is collapsed.
This diff is collapsed.
No preview for this file type
...@@ -75,54 +75,53 @@ const apiList = { ...@@ -75,54 +75,53 @@ const apiList = {
isShowLoading: false isShowLoading: false
}, },
getActivityBaseInfoById: {
handle: 'getActivityBaseInfoById',
method:'get',
isShowLoading: false
},
// getActivityBaseInfoById: {
// handle: 'getActivityBaseInfoById',
// method:'get',
// isShowLoading: false
// },
// 领取实物奖品 // 领取实物奖品
// receiveObjectPrize: { receiveObjectPrize: {
// handle: 'receiveObjectPrize', handle: 'receiveObjectPrize',
// method:'get', method:'get',
// isShowLoading: false isShowLoading: false
// }, },
// 我的奖品列表 // 我的奖品列表
// getMyPrizeList: { getMyPrizeList: {
// handle: 'getMyPrizeList', handle: 'getMyPrizeList',
// method:'get', method:'get',
// isShowLoading: false isShowLoading: false
// }, },
// 发放权益 // 发放权益
// receiveEnamePrize: { receiveEnamePrize: {
// handle: 'receiveEnamePrize', handle: 'receiveEnamePrize',
// method:'get', method:'get',
// isShowLoading: false isShowLoading: false
// }, },
// 获取会员信息 // 获取会员信息
// getVipInfo: { getVipInfo: {
// handle: 'getVipInfo', handle: 'getVipInfo',
// method:'get', method:'get',
// isShowLoading: false isShowLoading: false
// }, },
// 概率抽奖 // 概率抽奖
// drawLotteryPrize: { drawLotteryPrize: {
// handle: 'getVipdrawLotteryPrizeInfo', handle: 'getVipdrawLotteryPrizeInfo',
// method:'get', method:'get',
// isShowLoading: false isShowLoading: false
// }, },
// 获取商品列表 // 获取商品列表
// getItemListByItemIds: { getItemListByItemIds: {
// handle: 'getItemListByItemIds', handle: 'getItemListByItemIds',
// method:'get', method:'get',
// isShowLoading: false isShowLoading: false
// }, }
// getActivityBaseInfoById: {
// handle: 'getActivityBaseInfoById',
// method:'get',
// isShowLoading: false
// },
}; };
// 生成API // 生成API
......
...@@ -2,7 +2,7 @@ import cloud from '@tbmp/mp-cloud-sdk'; ...@@ -2,7 +2,7 @@ import cloud from '@tbmp/mp-cloud-sdk';
import tbcc from './tbcc-sdk'; import tbcc from './tbcc-sdk';
cloud.init({ cloud.init({
env: 'online' // 云函数环境 test 测试环境 online 线上环境 env: 'test' // 云函数环境 test 测试环境 online 线上环境
}); });
App({ App({
......
{ {
"pages": [ "pages": [
"pages/myprize/myprize",
"pages/homePage/homePage", "pages/homePage/homePage",
"pages/myprize/myprize",
"pages/index/index", "pages/index/index",
"pages/pageshop/pageshop", "pages/pageshop/pageshop",
"pages/tbccDemo/tbccDemo" "pages/tbccDemo/tbccDemo"
......
...@@ -46,10 +46,6 @@ ...@@ -46,10 +46,6 @@
width: 700rpx; width: 700rpx;
height: 161rpx; height: 161rpx;
background-color: #ffffff; background-color: #ffffff;
border-color:rgb(255, 63, 38);
border-width: 1rpx;
border-style: solid;
/* box-shadow: 2rpx 3rpx 18rpx 0 rgb(255, 63, 38); */
border-radius: 10rpx; border-radius: 10rpx;
box-sizing: border-box; box-sizing: border-box;
} }
...@@ -66,6 +62,7 @@ ...@@ -66,6 +62,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 130rpx; height: 130rpx;
position: relative;
} }
.my-prize-page .my-prize-item .my-prize-subtitle { .my-prize-page .my-prize-item .my-prize-subtitle {
...@@ -77,7 +74,9 @@ ...@@ -77,7 +74,9 @@
.my-prize-page .my-prize-item .my-prize-copy { .my-prize-page .my-prize-item .my-prize-copy {
width: 20rpx; width: 20rpx;
height: 20rpx; height: 20rpx;
margin-left: 18rpx; position: absolute;
right: 26rpx;
bottom: 38rpx;
} }
.my-prize-page .my-prize-item .prize-status { .my-prize-page .my-prize-item .prize-status {
...@@ -92,6 +91,7 @@ ...@@ -92,6 +91,7 @@
.my-prize-page .my-prize-item .my-prize-name { .my-prize-page .my-prize-item .my-prize-name {
width: 100%; width: 100%;
margin-top: 20rpx;
font-size: 28rpx; font-size: 28rpx;
color: #2d2d2d; color: #2d2d2d;
letter-spacing: -1rpx; letter-spacing: -1rpx;
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
} }
.my-prize-page .my-prize-item .my-prize-tip { .my-prize-page .my-prize-item .my-prize-tip {
margin-top: 16rpx; margin-top: 2rpx;
font-size: 20rpx; font-size: 20rpx;
line-height: 20rpx; line-height: 20rpx;
letter-spacing: 0; letter-spacing: 0;
......
<view class="my-prize-page" style="{{{'background':`url(${task.image.bg}) no-repeat center top/cover`}}}"> <view class="my-prize-page" style="{{{'background':`url(${task.image.bg}) no-repeat center top/cover`}}}">
<view class="my-prize-wrap"> <view class="my-prize-wrap">
<view class="my-prize-label"></view> <view class="my-prize-label"></view>
<view class="my-prize-list" a:if="{{myPrizeList && myPrizeList.length > 0}}">
<view class="my-prize-list" a:if="{{myPrizeList && myPrizeList.length > 0}}">
<view class="my-prize-item" a:for="{{myPrizeList}}"> <view class="my-prize-item" a:for="{{myPrizeList}}">
<image class="my-prize-avatar" src="{{item.image}}"/> <image class="my-prize-avatar" src="{{item.image}}"/>
...@@ -19,7 +20,7 @@ ...@@ -19,7 +20,7 @@
<image class="my-prize-copy" data-text="{{item._id}}" onTap="handleCopyId" src="{{task.image.copyIcon}}" /> <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.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.REPEAT || (item.drawStatus === PRIZE_DRAW_STATUS_MAP.RECEIVE)}}">请于{{item.endTime}}前领取</view>
<view class="my-prize-tip" a:if="{{item.drawStatus === PRIZE_DRAW_STATUS_MAP.FINISHED }}">奖品已过期失效</view> <view class="my-prize-tip" a:if="{{item.drawStatus === PRIZE_DRAW_STATUS_MAP.FINISHED }}">奖品已过期失效</view>
</view> </view>
......
...@@ -13,15 +13,30 @@ Component({ ...@@ -13,15 +13,30 @@ Component({
}, },
props: { props: {
myPrizeList: null, //我的奖品 myPrizeList: null, //我的奖品
endTime: null,//到期时间
task: { task: {
image: {}, image: {},
logisticsImage: {}, logisticsImage: {},
btnStyle: {} btnStyle: {}
} }
}, },
didMount() { }, didMount() {
didUpdate() { }, this.setData({
myPrizeList: this.props.myPrizeList
})
},
didUpdate(prevProps, prevData) {
this.setData({
myPrizeList: this.props.myPrizeList
})
// if (this.props.myPrizeList !== prevProps.gameType) {
// this.setData({ gameType: this.props.gameType })
// // 切换游戏场景
// if (!this.main) return
// this.main.changeGameSence(this.props.gameType)
// }
},
didUnmount() { }, didUnmount() { },
onShareAppMessage() { onShareAppMessage() {
return SHARE_CONFIG; return SHARE_CONFIG;
......
...@@ -8,6 +8,21 @@ ...@@ -8,6 +8,21 @@
background: white; background: white;
} }
.homepage_animation {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
overflow: hidden;
z-index: 30;
}
.homepage_animation_canvas {
width:100%;
height:100%;
}
.homepage_pagecanvas { .homepage_pagecanvas {
position: absolute; position: absolute;
top: 0; top: 0;
......
<!-- 业务页面部分 --> <!-- 业务页面部分 -->
<view class="homepage_wrapper {{ gameShow ? 'block_opciaty0' : '' }}" hidden="{{ gameShow_timeout }}"> <view class="homepage_wrapper {{ gameShow ? 'block_opciaty0' : '' }}" hidden="{{ gameShow_timeout }}">
<!-- 主页 -->
<view class="homepage_mian"> <view class="homepage_mian">
<view class="homepage_back"> <view class="homepage_back">
<image class="bei_jing80" src="{{resList['abe2084e-ff0b-454d-ad6e-a9117e44bdaa'].url}}" /> <image class="bei_jing80" src="{{resList['abe2084e-ff0b-454d-ad6e-a9117e44bdaa'].url}}" />
...@@ -11,7 +12,7 @@ ...@@ -11,7 +12,7 @@
<view class="head"> <view class="head">
<image class="head_ruler" onTap="showRewardsModal" src="{{resList['ee8882be-4b1d-43eb-bad7-8d96318c5022'].url}}" /> <image class="head_ruler" onTap="showRewardsModal" 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="" src="{{resList['ee8882be-4b1d-43eb-bad7-8d96318c5022'].url}}" /> -->
<image class="head_rewards" onTap="showPrizesModal" src="{{resList['74a63fd3-6776-44a2-990e-fadac00fb757'].url}}" /> <image class="head_rewards" onTap="gotoMyPrizePage" src="{{resList['74a63fd3-6776-44a2-990e-fadac00fb757'].url}}" />
</view> </view>
...@@ -93,7 +94,7 @@ ...@@ -93,7 +94,7 @@
</view> </view>
<!-- 游戏部分 --> <!-- 动画 - 游戏部分 -->
<pagecanvas <pagecanvas
class="homepage_pagecanvas" class="homepage_pagecanvas"
hidden="{{ !gameShow }}" hidden="{{ !gameShow }}"
......
...@@ -48,8 +48,8 @@ Page({ ...@@ -48,8 +48,8 @@ Page({
gameShow: false, gameShow: false,
// 出现 游戏 - 具有延迟的 // 出现 游戏 - 具有延迟的
gameShow_timeout: false, gameShow_timeout: false,
// 展示游戏类型: 1 - 传送带, 2 - 消消乐, 0 - 不展示 // 展示游戏类型: 1 - 传送带, 2 - 消消乐, 3 - 开场动画, 0 - 不展示
gameType: 1, gameType: 0,
commonModalConfirm: null, commonModalConfirm: null,
commonModalVisible: false, commonModalVisible: false,
ruleModalVisible: false, ruleModalVisible: false,
...@@ -77,14 +77,21 @@ Page({ ...@@ -77,14 +77,21 @@ Page({
], ],
onLoad(query) { onLoad(query) {
// 页面加载
// this.getAuth();
console.info(`Page onLoad with query: ${JSON.stringify(query)}`); console.info(`Page onLoad with query: ${JSON.stringify(query)}`);
// 页面加载
this.openAnimation().then(res => {
// this.getAuth();
this.backToPage()
this.init()
})
}, },
init() { init() {
// todo: save data
console.log('do init') console.log('do init')
API.getActivityBaseInfoById({activityId: app.activityId}).then(res => {
console.log(res)
})
}, },
// 页面加载完成 // 页面加载完成
...@@ -154,6 +161,15 @@ Page({ ...@@ -154,6 +161,15 @@ Page({
}); });
}, },
openAnimation () {
return new Promise((resolve, reject) => {
this.setData({ gameShow: true, gameType: 3, gameShow_timeout: true })
setTimeout(() => {
resolve('complete')
}, 5000)
})
},
// 切换到游戏 // 切换到游戏
changeGameOrPage (e) { changeGameOrPage (e) {
let type = Number(e.currentTarget.dataset.gameType) let type = Number(e.currentTarget.dataset.gameType)
...@@ -164,7 +180,7 @@ Page({ ...@@ -164,7 +180,7 @@ Page({
// 从游戏 返回 到 主页 // 从游戏 返回 到 主页
backToPage () { backToPage () {
this.setData({ gameShow_timeout: false }) this.setData({ gameShow_timeout: false, gameType: 0 })
setTimeout(() => { this.setData({ gameShow: false }) }, 350) setTimeout(() => { this.setData({ gameShow: false }) }, 350)
}, },
...@@ -173,11 +189,9 @@ Page({ ...@@ -173,11 +189,9 @@ Page({
videoTurnLeft () { videoTurnLeft () {
let i = this.data.videoActiveIndex let i = this.data.videoActiveIndex
if (i > 0) { if (i > 0) {
console.log('turn left')
this.videoCtx.stop() this.videoCtx.stop()
this.videoRecord(i) this.videoRecord(i)
setTimeout(() => { setTimeout(() => {
console.log('videoTurnLeft')
i -= 1 i -= 1
let vsrc = this.videoSrcArr[i].url, let vsrc = this.videoSrcArr[i].url,
psrc = this.posterSrcArr[i] psrc = this.posterSrcArr[i]
...@@ -195,11 +209,9 @@ Page({ ...@@ -195,11 +209,9 @@ Page({
videoTurnRight () { videoTurnRight () {
let i = this.data.videoActiveIndex let i = this.data.videoActiveIndex
if (i < this.videoSrcArr.length - 1) { if (i < this.videoSrcArr.length - 1) {
console.log('turn right')
this.videoCtx.stop() this.videoCtx.stop()
this.videoRecord(i) this.videoRecord(i)
setTimeout(() => { setTimeout(() => {
console.log('videoTurnRight')
i += 1 i += 1
let vsrc = this.videoSrcArr[i].url, let vsrc = this.videoSrcArr[i].url,
psrc = this.posterSrcArr[i] psrc = this.posterSrcArr[i]
...@@ -240,23 +252,16 @@ Page({ ...@@ -240,23 +252,16 @@ Page({
}, },
// video - onPlay // video - onPlay
onPlay() { onPlay() { this.timeStampCountFlag = true },
this.timeStampCountFlag = true
console.log('---- 视频开始播放')
},
// video - onPause // video - onPause
onPause() { onPause() {
console.log('---- 视频播放暂停') console.log('---- 视频播放暂停', this.timeStamp)
console.log('timeStamp', this.timeStamp)
this.videoRecord(this.data.videoActiveIndex) this.videoRecord(this.data.videoActiveIndex)
}, },
// video - onEnded // video - onEnded
onEnded(e) { onEnded(e) { console.log('---- 视频播放结束', e) },
console.log('---- 视频播放结束', e)
// this.videoRecord(this.data.videoActiveIndex)
},
// video - onPlayError // video - onPlayError
onPlayError(err) { console.warn('---- 视频播放错误', err) }, onPlayError(err) { console.warn('---- 视频播放错误', err) },
...@@ -287,6 +292,10 @@ Page({ ...@@ -287,6 +292,10 @@ Page({
}); });
}, },
gotoMyPrizePage() {
my.navigateTo({url: '../myprize/myprize'})
},
// 跳转到天猫页面 // 跳转到天猫页面
goTmallPage() { navigateToOutside(REDIRECT_URL['tmall']); }, goTmallPage() { navigateToOutside(REDIRECT_URL['tmall']); },
......
<view class="my-prize"> <view class="my-prize">
<prize-modal <prize-modal
myPrizeList="{{myPrizeList}}" myPrizeList="{{myPrizeList}}"
task="{{task}}" task="{{task}}"
endTime="{{endTime}}" endTime="{{endTime}}"
onHandleClick="handleClick"/> onHandleClick="handleClick"/>
</view> </view>
\ No newline at end of file
...@@ -17,18 +17,20 @@ Page({ ...@@ -17,18 +17,20 @@ Page({
task: { task: {
image: { image: {
bg: '//yun.duiba.com.cn/spark/assets/bg1.d818f787351875b0982937d8bb68b0655febec3c.png', //背景图 bg: '//yun.duiba.com.cn/spark/assets/bg1.d818f787351875b0982937d8bb68b0655febec3c.png', //背景图
copyIcon: '//yun.dui88.com/duiba-components-c-myprizemyprize_copy_code.png', //复制 copyIcon: '//yun.duiba.com.cn/spark/assets/copyicon.4017db37e6be807f8b864c962beafdfeeaeb26f0.png', //复制
addressBth: '//yun.duiba.com.cn/aurora/assets/82cc3c6d8861334ebaf128c98e3341b687bdc007.png', //填写地址(实物奖品) logisticsBth: '//yun.duiba.com.cn/spark/assets/mybtn查看物流.03ea3cdd889c8f09885b24a56dc99460734bc8a6.png', //查看物流
getBth: '//yun.dui88.com/duiba-components-c-myprizeget_now.png', //立即领取(除实物奖品外) useBtn: '//yun.duiba.com.cn/spark/assets/mybtn去使用.c0276af13ecf949f4624244458dad57128641a54.png', //去使用(除实物奖品外)
logisticsBth: '//yun.duiba.com.cn/aurora/assets/661f86ff3392cb3b56922b048acf74bebc07bb23.png', //查看物流 addressBth: '//yun.duiba.com.cn/spark/assets/mybtn填写地址.ca58f849aea9c78e0290060624e1dd987ca988ae.png', //填写地址(实物奖品)
useBtn: '//yun.duiba.com.cn/aurora/assets/0829f92f771c5e9fdb05a258a46b2d038d3a9997.png', //去使用(除实物奖品外) addressPriceBth: '//yun.duiba.com.cn/spark/assets/mybtn付邮费领取.dc12fb67b913ba8dd444e800b70f4fd54d377692.png', //填写地址(实物奖品)
gotBtn: '//yun.duiba.com.cn/aurora/assets/1120dd6b6ce4abe2666e877e3ae33eb99a778009.png', //已领取(优惠券) jj: '//yun.duiba.com.cn/spark/assets/mybtn立即领取.3b85dd66efc6c18549868f543d48c9e6152d2432.png', //立即领取(除实物奖品外)
getAgainBtn: '//yun.duiba.com.cn/aurora/assets/716f0a388144945b169554a30ff4a16f7bcb95ab.png', //重新领取 gotBtn: '//yun.duiba.com.cn/spark/assets/mybtn已领取.e342f48a85fbf9421a45cab37a3eb12eec091705.png', //已领取(优惠券)
invalidBtn: '//yun.duiba.com.cn/spark/assets/914ba8643c8abb8d710a3126ec312aecf6c4daf0.png', //已失效 getAgainBtn: '//yun.duiba.com.cn/spark/assets/mybtn重新领取.aba2a7e3d9f7724bb6f1aed8ccb50cea0268d0fb.png', //重新领取
failBth: '//yun.duiba.com.cn/spark/assets/8267375232058a6d0140270b1594427fb08d6ae3.png', //领取失败 invalidBtn: '//yun.duiba.com.cn/spark/assets/mybtn已失效.2fc529b912383145770f97a6c9dd7c413e528172.png', //已失效
failBth: '//yun.duiba.com.cn/spark/assets/mybtn领取失败.3fd23d113a41180b24da14e071772e167ce13b1a.png', //领取失败
doOptions: '//yun.duiba.com.cn/spark/assets/mybtn处理中.2b580c9a13cbaf0f905461d05f7f9a567c63f340.png', //处理中
}, },
logisticsImage: { logisticsImage: {
shipped: '//yun.duiba.com.cn/aurora/assets/3a7b68ec171ee339ce619d19f6ae3f9c1e6d801a.png', // 已发货物弹窗 shipped: '//yun.duiba.com.cn/aurora/assets/3a7b68ec171ee339ce619d19f6ae3f9c1e6d801a.png', // 已发货物弹窗
notShipped: '//yun.duiba.com.cn/aurora/assets/ee0300d7b472c555ecf0b7b8d582fcf9189c2d19.png', // 待发货物流弹窗 notShipped: '//yun.duiba.com.cn/aurora/assets/ee0300d7b472c555ecf0b7b8d582fcf9189c2d19.png', // 待发货物流弹窗
copyIcon: '//yun.dui88.com/duiba-components-c-myprizemyprize_copy_code.png', //复制 copyIcon: '//yun.dui88.com/duiba-components-c-myprizemyprize_copy_code.png', //复制
}, },
...@@ -48,20 +50,25 @@ Page({ ...@@ -48,20 +50,25 @@ Page({
// 到期时间 // 到期时间
getEndTime(prizeList = []) { getEndTime(prizeList = []) {
if (!prizeList || !prizeList.length) return null if (!prizeList || !prizeList.length) return null
const endTime = prizeList[0].expiredTime prizeList.forEach(item => {
if (!endTime) return null; // + 8 * 60 * 60 * 1000
const yy = new Date(endTime).getFullYear(); const endTime = item.expiredTime
const mm = new Date(endTime).getMonth() + 1; if (!endTime) return null;
const dd = new Date(endTime).getDate(); const yy = new Date(endTime).getFullYear();
const t1 = `${yy}${mm}${dd}日`; const mm = new Date(endTime).getMonth() + 1;
// console.log(new Date(endTime).toLocaleDateString()) const dd = new Date(endTime).getDate();
// const t1 = new Date(endTime).toLocaleDateString() + '';//获取年月日 const t1 = `${yy}${mm}${dd}日`;
const t2 = new Date(endTime).getHours() + '';//获取时 // console.log(new Date(endTime).toLocaleDateString())
const t3 = new Date(endTime).getMinutes() + '';//获取分 // const t1 = new Date(endTime).toLocaleDateString() + '';//获取年月日
const t4 = new Date(endTime).getMilliseconds() + '';//获取秒 const t2 = new Date(endTime).getHours() + '';//获取时
console.log(endTime, new Date(endTime + 48 * 60 * 60 * 1000).toLocaleString(), 'endTime'); const t3 = new Date(endTime).getMinutes() + '';//获取分
const t4 = new Date(endTime).getMilliseconds() + '';//获取秒
item.endTime = t1 + ' ' + t2 + ':' + t3
console.log('endTime', endTime, t1 + ' ' + t2 + ':' + t3);
})
this.setData({ this.setData({
endTime: t1 + "" + t2.padStart(2, '0') + ":" + t3.padStart(2, '0') + ":" + t4.padStart(2, '0') myPrizeList: prizeList
}) })
}, },
...@@ -74,16 +81,18 @@ Page({ ...@@ -74,16 +81,18 @@ Page({
if (type != 'noLoading') { if (type != 'noLoading') {
my.showLoading(); my.showLoading();
} }
const { success, data, message } = await API.getMyPrizeList({ activityId }).catch(res => {
const { success, data, message } = await API.getMyPrizeList({ activityId })
.catch(res => {
this.setData({ this.setData({
myPrizeList: [] myPrizeList: []
}) })
}) || {}; }) || {};
if (success && data) { if (success && data) {
this.setData({ this.setData({
myPrizeList: data myPrizeList: data.list
}) })
this.getEndTime(data) this.getEndTime(data.list)
} }
if (type != 'noLoading') { if (type != 'noLoading') {
my.hideLoading(); my.hideLoading();
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
bottom: 0; bottom: 0;
right: 0; right: 0;
min-height: 100vh; */ min-height: 100vh; */
background: pink; background: #fff;
width:100%; width:100%;
height:100vh; height:100vh;
flex: 1; flex: 1;
......
...@@ -13,7 +13,7 @@ const checkSystem = async () => { ...@@ -13,7 +13,7 @@ const checkSystem = async () => {
Component({ Component({
data: { data: {
// 当前正在进行的游戏 // 当前正在进行的游戏
gameType: 1, gameType: 0,
// 规则弹窗 // 规则弹窗
ruleModalVisible: false, ruleModalVisible: false,
// 消息弹窗 // 消息弹窗
......
...@@ -310,6 +310,66 @@ const resList = { ...@@ -310,6 +310,66 @@ const resList = {
ext: '.png', ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/弹窗背景_奖品.dce4e3dd9a3fcae166dfbd934b714ce1bc7fa5c9.png', url: '//yun.duiba.com.cn/spark/assets/弹窗背景_奖品.dce4e3dd9a3fcae166dfbd934b714ce1bc7fa5c9.png',
uuid: '2e62917e-4616-4290-96d6-b44345488506' uuid: '2e62917e-4616-4290-96d6-b44345488506'
},
'14063684-72ca-4041-87f3-c4f29053f903': {
name: 'mybtn付邮费领取',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/mybtn付邮费领取.dc12fb67b913ba8dd444e800b70f4fd54d377692.png',
uuid: '14063684-72ca-4041-87f3-c4f29053f903'
},
'aa5ee113-8bcc-4ac3-8569-4721c104c232': {
name: 'mybtn立即领取',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/mybtn立即领取.3b85dd66efc6c18549868f543d48c9e6152d2432.png',
uuid: 'aa5ee113-8bcc-4ac3-8569-4721c104c232'
},
'5fbe734e-092e-40de-aa90-89581efb18c4': {
name: 'mybtn领取失败',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/mybtn领取失败.3fd23d113a41180b24da14e071772e167ce13b1a.png',
uuid: '5fbe734e-092e-40de-aa90-89581efb18c4'
},
'347cd0cd-00ce-4cd9-bb34-555506b20cef': {
name: 'mybtn填写地址',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/mybtn填写地址.ca58f849aea9c78e0290060624e1dd987ca988ae.png',
uuid: '347cd0cd-00ce-4cd9-bb34-555506b20cef'
},
'df32b139-bce5-4607-bf7d-db9b14741b08': {
name: 'mybtn已领取',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/mybtn已失效.2fc529b912383145770f97a6c9dd7c413e528172.png',
uuid: 'df32b139-bce5-4607-bf7d-db9b14741b08'
},
'3aa09e87-abaa-4eb5-b828-534aad0d66bd': {
name: 'mybtn已失效',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/mybtn重新领取.aba2a7e3d9f7724bb6f1aed8ccb50cea0268d0fb.png',
uuid: '3aa09e87-abaa-4eb5-b828-534aad0d66bd'
},
'cf096733-2bd6-4893-b139-e541f53fb64d': {
name: 'mybtn重新领取',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/mybtn已领取.e342f48a85fbf9421a45cab37a3eb12eec091705.png',
uuid: 'cf096733-2bd6-4893-b139-e541f53fb64d'
},
'92011b17-1c87-4ef4-950d-6181f8358b24': {
name: 'copyicon',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/copyicon.4017db37e6be807f8b864c962beafdfeeaeb26f0.png',
uuid: '92011b17-1c87-4ef4-950d-6181f8358b24'
},
'ad89f801-daeb-44c9-9702-040972a4f5a1': {
name: 'mybtn去使用',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/mybtn去使用.c0276af13ecf949f4624244458dad57128641a54.png',
uuid: 'ad89f801-daeb-44c9-9702-040972a4f5a1'
},
'a5624249-1ab0-4cc8-bdfb-6e7c68a329d8': {
name: 'mybtn查看物流',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/mybtn查看物流.03ea3cdd889c8f09885b24a56dc99460734bc8a6.png',
uuid: 'a5624249-1ab0-4cc8-bdfb-6e7c68a329d8'
} }
}; };
export default resList; export default resList;
...@@ -103,7 +103,8 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => { ...@@ -103,7 +103,8 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
// console.log('requestCloud', _cloudName, handle, params); // console.log('requestCloud', _cloudName, handle, params);
// return requestType === 'ams' ? requestAms() : requestCloud(); // return requestType === 'ams' ? requestAms() : requestCloud();
return (requestType === 'ams' || requestType === 'yapi') ? requestMock() : requestCloud(); if (requestType === 'yapi') return requestMock()
else if (requestType === 'ams') return requestCloud()
}; };
}; };
......
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