Commit 9299fc02 authored by AU-Pro-mac's avatar AU-Pro-mac

add new code --03

parent 4bfd7253
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -5,6 +5,18 @@ const resCanvasListCsd = {
url: '//yun.duiba.com.cn/spark/assets/openTexture.4558fad0aadb7003efd6b71716816a93ad181283.png',
uuid: '63cb446e-1158-4a94-bf0c-c19ecc7d2cc6'
},
'bdb3cbec-1af5-49e9-89ba-2c2ecd90f760': {
name: 'guangTexture',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/guangTexture.dadeebd0dd913c91d75a6bdab7810fa6a77b8b37.png',
uuid: 'bdb3cbec-1af5-49e9-89ba-2c2ecd90f760'
},
'e2adae2c-ac89-49cc-a200-8daec42da146': {
name: 'lightTexture',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/lightTexture.dae8dbc3cb6445863531557ca3b90b1b185eb995.png',
uuid: 'e2adae2c-ac89-49cc-a200-8daec42da146'
},
'334aff33-1a9e-4277-aafe-3d9f22eab3d5': {
name: '传送带返回',
ext: '.png',
......
......@@ -9,6 +9,8 @@ import { destroyNetData, sendTbNet, TbNetName } from "./TaoBaoNet";
import resCanvasList_ from '../resCanvasList';
import resCanvasListCsd from '../resCanvasListCsd'
const lottieTexture = require('./openAnimation/Texture.json')
const lottieTextureCsd_smoke = require('./chuansongdai/lottie/smoke/smokeTexture.json')
const lottieTextureCsd_light = require('./chuansongdai/lottie/light/lightTexture.json')
import resloadingList from '../resloadingList';
import resLottieList from '../resLottieList';
// import { setStage } from "./scenes/stage";
......@@ -93,16 +95,45 @@ export class Main {
loadImageTextures(resCanvasList) {
return new Promise((resolve, reject) => {
FYGE.GlobalLoader.loadImage((s, image) => {
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)
// [
// resCanvasList['bdb3cbec-1af5-49e9-89ba-2c2ecd90f760'].url,
// resCanvasList['e2adae2c-ac89-49cc-a200-8daec42da146'].url
// ]
})
}
loadImageTexturesCsd01(resCanvasList) {
return new Promise((resolve, reject) => {
FYGE.GlobalLoader.loadImage(
(s, image) => {
if (s) {
FYGE.createTextureSheet(new FYGE.BaseTexture(image), lottieTextureCsd_light);
resolve('complete')
}
}, resCanvasList['bdb3cbec-1af5-49e9-89ba-2c2ecd90f760'].url)
})
}
loadImageTexturesCsd02(resCanvasList) {
return new Promise((resolve, reject) => {
FYGE.GlobalLoader.loadImage(
(s, image) => {
if (s) {
FYGE.createTextureSheet(new FYGE.BaseTexture(image), lottieTextureCsd_smoke);
resolve('complete')
}
}, resCanvasList['e2adae2c-ac89-49cc-a200-8daec42da146'].url)
})
}
private async onAddToStage() {
//初始化层级
layers.init(this.stage);
......@@ -122,10 +153,12 @@ export class Main {
await RES.loadSparkAssets(resCanvasList)
console.log('resloadingList 加载完毕')
this.loadImageTextures(resCanvasList).then(async res => {
await this.loadImageTexturesCsd01(resCanvasList)
await this.loadImageTexturesCsd02(resCanvasList)
this.loadImageTextures(resCanvasList).then(res => {
// changeScene(OpenAni)
changeScene(XxlScene)
changeScene(CsdScene)
// changeScene(XxlScene)
})
await InitLottie.initLottieList(resLottieList);
......
......@@ -2,6 +2,8 @@ import { RES } from "../../module/RES"
import resCanvasList from '../../resCanvasList'
import { GDispatcher, Main } from './../Main';
import ScoreBoard from './game/ScoreBoard'
import { changeScene, showPanel } from "../../module/ctrls";
import { MatchingPanel } from "../com/MatchingPanel";
import GoodsContainer from './game/goodsContainer'
import { Tools } from "../Tools"
import { destroyNetData, sendTbNet, TbNetName } from "../TaoBaoNet";
......@@ -26,35 +28,28 @@ export default class Root extends FYGE.Container {
stageHeight: number
// 计时器
timerNumer: number
// 比拼的用户信息
userInfo
// 记录触摸先后坐标位置
touchXEnd: number
touchYEnd: number
touchXStart: number
touchYStart: number
score: number = 0
time: number = 0 // 游戏时间 倒计时 时长
// 比拼的用户信息 和 自己的信息
userInfo
constructor(options) {
super()
// Main
this.baseOption = options
this.time = options.gameParm.time
setTimeout(() => {
this.gameStart()
}, 1000)
this.once(FYGE.Event.ADDED_TO_STAGE, this.onAddToStage, this)
// 全局-游戏开始
GDispatcher.addEventListener('game-start', this.gameStart, this)
}
initUi () {
async initUi () {
this.backGround = new FYGE.Sprite()
this.backGround.x = 0
this.backGround.y = 0
......@@ -63,11 +58,6 @@ export default class Root extends FYGE.Container {
this.backGround.texture = RES.getRes(resCanvasList['217e095b-5c92-4c79-a8b2-a13730815d1d'].url)
this.addChild(this.backGround)
this.backBtn = Tools.getSprite(resCanvasList['334aff33-1a9e-4277-aafe-3d9f22eab3d5'].url, 0, 40 + 1624 / 2 - this.stage.viewRect.height / 2)
this.backBtn.mouseEnable = true
this.backBtn.addEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.backToPage, this)
this.addChild(this.backBtn)
let leftCsd = Tools.getSprite(resCanvasList['01def08f-119f-463d-bc75-1c7ab44b55d5'].url, 0, 1160)
leftCsd.width = 370
leftCsd.height = 230
......@@ -76,36 +66,74 @@ export default class Root extends FYGE.Container {
this.goodsContainer = new GoodsContainer(this)
this.addChild(this.goodsContainer)
this.scoreBoard = new ScoreBoard(this, this.userInfo)
this.addChild(this.scoreBoard)
const userInfoRes = await sendTbNet(TbNetName.getUserInfo, {})
this.userInfo = userInfoRes.data
console.log('CSD-GAME this.userInfo:', userInfoRes.data)
showPanel(MatchingPanel, this.userInfo)
// this.gameStart()
GDispatcher.addEventListener('MatchCompelete', this.gameStart, this)
// -- 取消
// this.backBtn = Tools.getSprite(resCanvasList['334aff33-1a9e-4277-aafe-3d9f22eab3d5'].url, 0, 40 + 1624 / 2 - this.stage.viewRect.height / 2)
// this.backBtn.mouseEnable = true
// this.backBtn.addEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.backToPage, this)
// this.addChild(this.backBtn)
// -- 取消
this.createTouchRect()
setTimeout(() => {
this.gameStartFlag = true
}, 1000)
// const prizeInfoRes = sendTbNet(TbNetName.getPrizeInfo, {})
// this.gameStartFlag = true
}
// 开始游戏
gameStart () {
this.scoreBoard = new ScoreBoard(this, this.userInfo)
this.addChild(this.scoreBoard)
this.scoreBoard.start(this.time)
this.goodsContainer.startGoods()
GDispatcher.removeEventListener('MatchCompelete', this.gameStart, this)
this.gameStartFlag = true
}
// 结束游戏
gameOver () {
let score = this.score
async gameOver () {
this.time = 60
this.gameStartFlag = false
if (!this.userInfo.win) this.scoreBoard.scoreRight += 3
this.goodsContainer.removeAllGoods()
GDispatcher.dispatchEvent('gameOver-csd', {score: score})
this.scoreBoard.stopTime()
if (this.userInfo.win && this.scoreBoard.scoreLeft) {
console.log('user win')
// 用户出了结果,请求开奖,并展示相应弹窗
// const gamePrizeRes = await sendTbNet(TbNetName.getPrizeInfo, {})
// let res = gamePrizeRes.data
// console.log('CSD-GAME over data:', res)
// showPanel(MatchingPanel, res)
} else {
console.log('user fail')
// 用户出了结果,请求开奖,并展示相应弹窗
// const gamePrizeRes = await sendTbNet(TbNetName.getPrizeInfo, {})
// let res = gamePrizeRes.data
// console.log('CSD-GAME over data:', res)
// showPanel(MatchingPanel, res)
}
// GDispatcher.dispatchEvent('gameOver-csd', {score: score})
}
// 分数变动
gameScoreChange (score) {
this.score += score
this.scoreBoard.updateScore(score)
}
......
......@@ -5,7 +5,7 @@ import { Tools } from "../../Tools"
export default class Catecher extends FYGE.Container {
_root;
// 用户信息
userInfo;
dataInfo;
// 左用户分
scoreLeft;
// 右用户分
......@@ -30,11 +30,12 @@ export default class Catecher extends FYGE.Container {
// 文案
text;
constructor (root, userInfo) {
constructor (root, dataInfo) {
super()
this.timerNumer = 60
this.userInfo = userInfo
this.dataInfo = dataInfo
this._root = root
this.create()
}
......@@ -45,15 +46,14 @@ export default class Catecher extends FYGE.Container {
this.width = 750
this.height = 220
this.userBoard_left = Tools.getSprite(resCanvasList['9df91df7-fc44-4d31-9f52-88d1ff65c9ba'].url, 0, 16)
this.userBoard_left = Tools.getSprite(resCanvasList['9df91df7-fc44-4d31-9f52-88d1ff65c9ba'].url, -326, 16)
this.userBoard_left.width = 326
this.userBoard_left.height = 158
this.userBoard_right = Tools.getSprite(resCanvasList['9606b410-5d79-4759-a3f6-026dbb6fad0b'].url, 424, 0)
this.userBoard_right = Tools.getSprite(resCanvasList['9606b410-5d79-4759-a3f6-026dbb6fad0b'].url, 1076, 0)
this.userBoard_right.width = 326
this.userBoard_right.height = 158
this.addChild(this.userBoard_left)
this.addChild(this.userBoard_right)
this.userBoard_right.alpha = this.userBoard_left.alpha = 0.2
this.timeText = Tools.getText(this.timerNumer + 'S', 50, '#904f5e', FYGE.TEXT_ALIGN.CENTER)
this.timeText.textWidth = 750
......@@ -72,16 +72,26 @@ export default class Catecher extends FYGE.Container {
this.addChild(this.text)
this.userAvatar_left = this.createAvatar('left', '//yun.duiba.com.cn/spark/assets/炸弹.67df66e9cf5e166c8cf6d340886ef094a84954c9.png')
this.userAvatar_right = this.createAvatar('right', '//yun.duiba.com.cn/spark/assets/炸弹.67df66e9cf5e166c8cf6d340886ef094a84954c9.png')
this.addChild(this.userAvatar_left)
this.addChild(this.userAvatar_right)
this.userAvatar_left = this.createAvatar('left', this.dataInfo.userImgUrl)
this.userAvatar_right = this.createAvatar('right', this.dataInfo.fakeUserImgUrl)
this.userBoard_left.addChild(this.userAvatar_left)
this.userBoard_right.addChild(this.userAvatar_right)
this.userScore_left = this.createScore('left')
this.userScore_right = this.createScore('right')
this.addChild(this.userScore_left)
this.addChild(this.userScore_right)
this.userBoard_left.addChild(this.userScore_left)
this.userBoard_right.addChild(this.userScore_right)
this.addChild(this.userBoard_left)
this.addChild(this.userBoard_right)
FYGE.Tween.get(this.userBoard_left)
.to({ x: 0, alpha: 1 }, 100)
FYGE.Tween.get(this.userBoard_right)
.to({ x: 424, alpha: 1 }, 100)
}
// 销毁 事件和循环
......@@ -90,11 +100,66 @@ export default class Catecher extends FYGE.Container {
this.timerFunc = null
}
// 分数更新
updateScore(score) {
this.scoreLeft += score
let scoreNow = score + this.scoreLeft
// 胜
if (this.dataInfo.win) {
// 加分
if (scoreNow > this.scoreLeft) {
// 分数大于 3
if (scoreNow !== 0 && scoreNow > 3) {
console.log(scoreNow - this.scoreLeft)
// 随机 加 3分 或 1分
if (scoreNow - this.scoreLeft >= 3) {
if (scoreNow - this.scoreRight <= 30) {
if (this.sum(1, 100) >= 25) { this.scoreRight += (this.sum(1, 100) >= 30 ? 3 : 1) }
} else {
this.scoreRight += 3
}
}
}
this.scoreLeft = scoreNow
// 减分
} else {
// 用户减分
if (scoreNow <= 0) this.scoreLeft = 0
else this.scoreLeft = scoreNow
if (this.scoreRight <= 4) this.scoreRight = 0
else this.scoreRight -= 3
}
// 负
} else {
// 加分
if (scoreNow > this.scoreLeft) {
this.scoreLeft = scoreNow
if (this.scoreRight - scoreNow <= 30) this.scoreRight += (this.sum(1, 100) >= 50 ? 4 : 3)
// 减分
} else {
if (scoreNow <= 0) this.scoreLeft = 0
else this.scoreLeft = scoreNow
// 随机减分
if (this.sum(1, 100) >= 50) {
this.scoreRight -= (this.sum(1, 100) >= 10 ? 1 : 0)
}
}
}
this.userScore_left.updateScore(this.scoreLeft)
this.userScore_right.updateScore(this.scoreRight)
}
stopTime () {
clearInterval(this.timerFunc)
this.timerFunc = null
}
start (time) {
this.scoreLeft = 0
......@@ -136,9 +201,9 @@ export default class Catecher extends FYGE.Container {
}
if (type === 'left') {
t.x = 170
t.y = 108
t.y = 92
} else if (type === 'right') {
t.x = 470
t.x = 30
t.y = 92
}
t.addChild(text)
......@@ -149,7 +214,7 @@ export default class Catecher extends FYGE.Container {
let c = new FYGE.Container()
c.width = 120
c.height = 120
let a = Tools.getCircle(60, 0xffe2eb, 1, 60, 60)
let a = Tools.getCircle(60, 0x000000, 1, 60, 60)
let p = Tools.getSprite(avatar, 0, 0)
p.width = 120
p.height = 120
......@@ -160,13 +225,19 @@ export default class Catecher extends FYGE.Container {
if (type === 'left') {
c.x = 26
c.y = 28
c.y = 12
} else if (type === 'right') {
c.x = 604
c.x = 180
c.y = 12
}
return c
}
// 取 随机数
sum = (m: number, n: number) => {
var num = Math.floor(Math.random() * (m - n) + n)
return num
}
}
\ No newline at end of file
import { RES } from "../../../module/RES"
import resCanvasList from '../../../resCanvasList'
import { Tools } from "../../Tools"
import { light } from '../lottie/light/light'
import { smoke } from '../lottie/smoke/smoke'
// import { getStage } from '../../scenes/stage'
export default class GoodsContainer extends FYGE.Container {
......@@ -44,12 +46,12 @@ export default class GoodsContainer extends FYGE.Container {
this._root = root
this.goodsDeepIndex = 1000
this.goodsTextures = [
{ texture: resCanvasList['d1379fca-f21e-40f0-b0f0-06c188d4b4dc'].url, score: 2, dir: 'left', wrong: -2, width: 92, height: 220, aX: -4 },
{ texture: resCanvasList['0bd734c1-9c1a-428e-8a9c-cef373baed9d'].url, score: 5, dir: 'left', wrong: -2, width: 102, height: 224, aX: -2 },
{ texture: resCanvasList['f455b42a-0e67-43d8-b7c5-520760160631'].url, score: 1, dir: 'right', wrong: 'endGame', width: 122, height: 120, aX: -12 },
{ texture: resCanvasList['9e512c7f-88e2-4b85-a2f0-afd2062247e1'].url, score: 4, dir: 'left', wrong: -2, width: 126, height: 141, aX: 0 },
{ texture: resCanvasList['30ac266d-0388-4659-9c3e-e741f3c671c7'].url, score: 3, dir: 'left', wrong: -2, width: 80, height: 206, aX: 0 },
{ texture: resCanvasList['f455b42a-0e67-43d8-b7c5-520760160631'].url, score: 1, dir: 'right', wrong: 'endGame', width: 123, height: 120, aX: -12 }
{ texture: resCanvasList['d1379fca-f21e-40f0-b0f0-06c188d4b4dc'].url, score: 3, dir: 'left', wrong: -2, width: 92, height: 220, aX: -4, lot: 'light' },
{ texture: resCanvasList['0bd734c1-9c1a-428e-8a9c-cef373baed9d'].url, score: 3, dir: 'left', wrong: -2, width: 102, height: 224, aX: -2, lot: 'light' },
{ texture: resCanvasList['f455b42a-0e67-43d8-b7c5-520760160631'].url, score: 1, dir: 'right', wrong: 'endGame', width: 122, height: 120, aX: -12, lot: 'smoke' },
{ texture: resCanvasList['9e512c7f-88e2-4b85-a2f0-afd2062247e1'].url, score: 3, dir: 'left', wrong: -2, width: 126, height: 141, aX: 0, lot: 'light' },
{ texture: resCanvasList['30ac266d-0388-4659-9c3e-e741f3c671c7'].url, score: 3, dir: 'left', wrong: -2, width: 80, height: 206, aX: 0, lot: 'light' },
{ texture: resCanvasList['f455b42a-0e67-43d8-b7c5-520760160631'].url, score: 1, dir: 'right', wrong: 'endGame', width: 123, height: 120, aX: -12, lot: 'smoke' }
]
this.create()
}
......@@ -118,14 +120,36 @@ export default class GoodsContainer extends FYGE.Container {
if (g.wrong === 'endGame') {
g.turnDirection(direction, 'gameOver')
} else {
this._root.gameScoreChange(g.score)
this._root.gameScoreChange(g.wrong)
this.floatScore(direction, g.wrong)
}
} else {
this._root.gameScoreChange(g.score)
this.floatScore(direction, g.score)
}
}
}
floatScore(dir, s) {
s = s > 0 ? '+' + s : s
let sc = Tools.getText(s, 80, '#904f5e', FYGE.TEXT_ALIGN.CENTER)
sc.textWidth = 140
sc.textHeight = 100
sc.y = 360
if (dir === 'left') sc.x = 40
if (dir === 'right') sc.x = 600
sc.alpha = 1
sc.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE
this.addChild(sc)
FYGE.Tween.get(sc, null, null)
.to({alpha: .62, y: 200}, 400)
.to({alpha: 0}, 200)
.call(() => {
this.removeChild(sc)
})
}
// 销毁 事件和循环
destroy () {
this.removeEventListener(
......@@ -179,6 +203,7 @@ export default class GoodsContainer extends FYGE.Container {
g['turn'] = false
g['into'] = false
g['speed'] = this.speed + 0.06
g['lot'] = arr[idx].lot
g['turnDirection'] = (direction, cb = '') => {
if (direction === 'left') {
// this.goodsArr.splice(index, 1)
......@@ -189,9 +214,12 @@ export default class GoodsContainer extends FYGE.Container {
y: 620,
alpha: .75
}, 200)
.call(() => {
g['lottiePlay']()
})
.to({
alpha: 0
}, 580)
}, 750)
.call(() => {
if (cb === 'gameOver') {
this.removeAllGoods()
......@@ -208,9 +236,12 @@ export default class GoodsContainer extends FYGE.Container {
y: 620,
alpha: .75
}, 200)
.call(() => {
g['lottiePlay']()
})
.to({
alpha: 0
}, 580)
}, 750)
.call(() => {
if (cb === 'gameOver') {
this.removeAllGoods()
......@@ -219,6 +250,23 @@ export default class GoodsContainer extends FYGE.Container {
})
}
}
g['lottiePlay'] = () => {
let gl
if (g['lot'] === 'light') {
gl = new FYGE.Lottie(light)
gl.x = -144
gl.y = -150
gl.scaleX = gl.scaleY = 0.88
}
else if (g['lot'] === 'smoke') {
gl = new FYGE.Lottie(smoke)
gl.x = -115
gl.y = -145
gl.width = gl.height = 460
}
gt.addChildAt(gl, 1)
gl.play(1)
}
g['fadeOut'] = (index) => {
FYGE.Tween.removeTweens(g)
FYGE.Tween.get(g, null, null)
......
This diff is collapsed.
{
"5b12df5c-e51e-44be-b51a-596d922e9af5.png": {
"x": 2,
"y": 2,
"w": 333,
"h": 334,
"ox": 84,
"oy": 83,
"sw": 500,
"sh": 500,
"ro": false
},
"93686883-3e25-45ae-82a4-f1f44102e21b.png": {
"x": 337,
"y": 2,
"w": 331,
"h": 330,
"ox": 85,
"oy": 85,
"sw": 500,
"sh": 500,
"ro": true
},
"b1f05b66-3ec0-47c9-bb11-ff42172a6197.png": {
"x": 669,
"y": 2,
"w": 331,
"h": 330,
"ox": 85,
"oy": 85,
"sw": 500,
"sh": 500,
"ro": false
},
"2eb60cc0-aa7c-4b2d-9252-48d384e7d2ec.png": {
"x": 669,
"y": 334,
"w": 325,
"h": 324,
"ox": 88,
"oy": 88,
"sw": 500,
"sh": 500,
"ro": false
},
"9f2a3165-fdd9-401e-a90d-f787c305dec9.png": {
"x": 337,
"y": 335,
"w": 322,
"h": 324,
"ox": 89,
"oy": 88,
"sw": 500,
"sh": 500,
"ro": true
},
"ee3e61d7-672f-494b-80c8-569f5a48acfa.png": {
"x": 2,
"y": 338,
"w": 314,
"h": 314,
"ox": 93,
"oy": 93,
"sw": 500,
"sh": 500,
"ro": false
},
"0314ae41-70f8-4a0e-8dcd-225ea49ae56f.png": {
"x": 2,
"y": 654,
"w": 310,
"h": 310,
"ox": 95,
"oy": 95,
"sw": 500,
"sh": 500,
"ro": false
},
"27c0770b-5433-428b-88e6-ce4582a735aa.png": {
"x": 314,
"y": 659,
"w": 310,
"h": 310,
"ox": 95,
"oy": 95,
"sw": 500,
"sh": 500,
"ro": false
},
"22c8aa28-cb3d-4bf2-b4f4-033a30dda40e.png": {
"x": 626,
"y": 660,
"w": 309,
"h": 308,
"ox": 96,
"oy": 96,
"sw": 500,
"sh": 500,
"ro": true
},
"bae8d555-8423-4b88-9ff4-57e229d71905.png": {
"x": 936,
"y": 660,
"w": 309,
"h": 308,
"ox": 96,
"oy": 96,
"sw": 500,
"sh": 500,
"ro": true
},
"e983d6d6-7272-4037-bfe3-63fd3a510a67.png": {
"x": 996,
"y": 334,
"w": 305,
"h": 304,
"ox": 98,
"oy": 98,
"sw": 500,
"sh": 500,
"ro": true
},
"9da48128-2e5c-410d-9feb-482395e1194d.png": {
"x": 1002,
"y": 2,
"w": 303,
"h": 302,
"ox": 99,
"oy": 99,
"sw": 500,
"sh": 500,
"ro": true
},
"0f1783bd-21db-458c-ba71-8c22b7f13082.png": {
"x": 1246,
"y": 641,
"w": 302,
"h": 302,
"ox": 99,
"oy": 99,
"sw": 500,
"sh": 500,
"ro": false
},
"b9c519c1-0dbb-420e-96cd-ad9b1714fbd8.png": {
"x": 1302,
"y": 307,
"w": 299,
"h": 298,
"ox": 101,
"oy": 101,
"sw": 500,
"sh": 500,
"ro": true
},
"018e019e-ea1a-47d5-b8fe-af043909cd69.png": {
"x": 1306,
"y": 2,
"w": 286,
"h": 284,
"ox": 107,
"oy": 108,
"sw": 500,
"sh": 500,
"ro": true
},
"49a3a0dd-5f6d-410b-95d2-afe3a5afc897.png": {
"x": 1592,
"y": 2,
"w": 267,
"h": 264,
"ox": 117,
"oy": 118,
"sw": 500,
"sh": 500,
"ro": true
},
"2a2620b2-db19-4dae-a5ff-ea5e2f8818be.png": {
"x": 1550,
"y": 608,
"w": 243,
"h": 242,
"ox": 129,
"oy": 129,
"sw": 500,
"sh": 500,
"ro": true
},
"e5d45b30-3bcc-46ef-b934-989d42f1203a.png": {
"x": 1794,
"y": 271,
"w": 214,
"h": 214,
"ox": 143,
"oy": 143,
"sw": 500,
"sh": 500,
"ro": false
},
"f9af07e5-3885-4226-aab1-fd84ff08ef97.png": {
"x": 1858,
"y": 2,
"w": 180,
"h": 178,
"ox": 160,
"oy": 161,
"sw": 500,
"sh": 500,
"ro": false
},
"d35b7183-9dfe-4cc0-9946-2be26f9633b1.png": {
"x": 1550,
"y": 853,
"w": 127,
"h": 124,
"ox": 187,
"oy": 188,
"sw": 500,
"sh": 500,
"ro": true
},
"450f058c-5ade-4761-91f7-69b920d16875.png": {
"x": 314,
"y": 654,
"w": 1,
"h": 1,
"ox": 0,
"oy": 0,
"sw": 500,
"sh": 500,
"ro": false
}
}
\ No newline at end of file
export const smoke = {
"v": "5.6.10",
"fr": 30,
"ip": 0,
"op": 17,
"w": 500,
"h": 500,
"nm": "光效",
"layers": [
{
"ind": 1,
"ty": 2,
"nm": "光效_00000.png",
"refId": "7909f194-4ba2-452c-9402-aeca2df585ce",
"ks": {
"o": {
"a": 0,
"k": 100
},
"r": {
"a": 0,
"k": 0
},
"p": {
"a": 0,
"k": [
250,
250,
0
]
},
"a": {
"a": 0,
"k": [
250,
250,
0
]
},
"s": {
"a": 0,
"k": [
100,
100,
100
]
}
},
"ip": 0,
"op": 1
},
{
"ind": 2,
"ty": 2,
"nm": "光效_00001.png",
"refId": "9e59d392-9c37-4355-b00e-3568010c3add",
"ks": {
"o": {
"a": 0,
"k": 100
},
"r": {
"a": 0,
"k": 0
},
"p": {
"a": 0,
"k": [
250,
250,
0
]
},
"a": {
"a": 0,
"k": [
250,
250,
0
]
},
"s": {
"a": 0,
"k": [
100,
100,
100
]
}
},
"ip": 1,
"op": 2
},
{
"ind": 3,
"ty": 2,
"nm": "光效_00002.png",
"refId": "8488d536-9e46-44da-919e-e89a5af1eb7a",
"ks": {
"o": {
"a": 0,
"k": 100
},
"r": {
"a": 0,
"k": 0
},
"p": {
"a": 0,
"k": [
250,
250,
0
]
},
"a": {
"a": 0,
"k": [
250,
250,
0
]
},
"s": {
"a": 0,
"k": [
100,
100,
100
]
}
},
"ip": 2,
"op": 3
},
{
"ind": 4,
"ty": 2,
"nm": "光效_00003.png",
"refId": "953374da-816d-4ed6-8bac-1c04567db072",
"ks": {
"o": {
"a": 0,
"k": 100
},
"r": {
"a": 0,
"k": 0
},
"p": {
"a": 0,
"k": [
250,
250,
0
]
},
"a": {
"a": 0,
"k": [
250,
250,
0
]
},
"s": {
"a": 0,
"k": [
100,
100,
100
]
}
},
"ip": 3,
"op": 4
},
{
"ind": 5,
"ty": 2,
"nm": "光效_00004.png",
"refId": "053667d9-2ed2-4904-b301-b2f5de0efdae",
"ks": {
"o": {
"a": 0,
"k": 100
},
"r": {
"a": 0,
"k": 0
},
"p": {
"a": 0,
"k": [
250,
250,
0
]
},
"a": {
"a": 0,
"k": [
250,
250,
0
]
},
"s": {
"a": 0,
"k": [
100,
100,
100
]
}
},
"ip": 4,
"op": 5
},
{
"ind": 6,
"ty": 2,
"nm": "光效_00005.png",
"refId": "162c3be4-336c-49ca-8379-7fdf4a10e23e",
"ks": {
"o": {
"a": 0,
"k": 100
},
"r": {
"a": 0,
"k": 0
},
"p": {
"a": 0,
"k": [
250,
250,
0
]
},
"a": {
"a": 0,
"k": [
250,
250,
0
]
},
"s": {
"a": 0,
"k": [
100,
100,
100
]
}
},
"ip": 5,
"op": 6
},
{
"ind": 7,
"ty": 2,
"nm": "光效_00006.png",
"refId": "b1e882e1-f38e-4763-a57c-46391416f424",
"ks": {
"o": {
"a": 0,
"k": 100
},
"r": {
"a": 0,
"k": 0
},
"p": {
"a": 0,
"k": [
250,
250,
0
]
},
"a": {
"a": 0,
"k": [
250,
250,
0
]
},
"s": {
"a": 0,
"k": [
100,
100,
100
]
}
},
"ip": 6,
"op": 7
},
{
"ind": 8,
"ty": 2,
"nm": "光效_00007.png",
"refId": "9f286912-00c4-4223-bc30-cfbe5b71ca34",
"ks": {
"o": {
"a": 0,
"k": 100
},
"r": {
"a": 0,
"k": 0
},
"p": {
"a": 0,
"k": [
250,
250,
0
]
},
"a": {
"a": 0,
"k": [
250,
250,
0
]
},
"s": {
"a": 0,
"k": [
100,
100,
100
]
}
},
"ip": 7,
"op": 8
},
{
"ind": 9,
"ty": 2,
"nm": "光效_00008.png",
"refId": "b6183a46-9d87-4cff-9a23-835afd98c530",
"ks": {
"o": {
"a": 0,
"k": 100
},
"r": {
"a": 0,
"k": 0
},
"p": {
"a": 0,
"k": [
250,
250,
0
]
},
"a": {
"a": 0,
"k": [
250,
250,
0
]
},
"s": {
"a": 0,
"k": [
100,
100,
100
]
}
},
"ip": 8,
"op": 9
},
{
"ind": 10,
"ty": 2,
"nm": "光效_00009.png",
"refId": "2e47ed27-0a53-4e63-93f0-21240e564dd3",
"ks": {
"o": {
"a": 0,
"k": 100
},
"r": {
"a": 0,
"k": 0
},
"p": {
"a": 0,
"k": [
250,
250,
0
]
},
"a": {
"a": 0,
"k": [
250,
250,
0
]
},
"s": {
"a": 0,
"k": [
100,
100,
100
]
}
},
"ip": 9,
"op": 10
},
{
"ind": 11,
"ty": 2,
"nm": "光效_00010.png",
"refId": "29261a22-d781-49c8-b831-84778bcdb16d",
"ks": {
"o": {
"a": 0,
"k": 100
},
"r": {
"a": 0,
"k": 0
},
"p": {
"a": 0,
"k": [
250,
250,
0
]
},
"a": {
"a": 0,
"k": [
250,
250,
0
]
},
"s": {
"a": 0,
"k": [
100,
100,
100
]
}
},
"ip": 10,
"op": 11
},
{
"ind": 12,
"ty": 2,
"nm": "光效_00011.png",
"refId": "473d3eba-50a8-44ae-a077-9869f42d2c4c",
"ks": {
"o": {
"a": 0,
"k": 100
},
"r": {
"a": 0,
"k": 0
},
"p": {
"a": 0,
"k": [
250,
250,
0
]
},
"a": {
"a": 0,
"k": [
250,
250,
0
]
},
"s": {
"a": 0,
"k": [
100,
100,
100
]
}
},
"ip": 11,
"op": 12
},
{
"ind": 13,
"ty": 2,
"nm": "光效_00012.png",
"refId": "6b15e867-5f62-4263-b614-6ca0f212afb6",
"ks": {
"o": {
"a": 0,
"k": 100
},
"r": {
"a": 0,
"k": 0
},
"p": {
"a": 0,
"k": [
250,
250,
0
]
},
"a": {
"a": 0,
"k": [
250,
250,
0
]
},
"s": {
"a": 0,
"k": [
100,
100,
100
]
}
},
"ip": 12,
"op": 13
},
{
"ind": 14,
"ty": 2,
"nm": "光效_00013.png",
"refId": "4ddeed91-efcc-4e9f-9535-b47bf9cc8cc7",
"ks": {
"o": {
"a": 0,
"k": 100
},
"r": {
"a": 0,
"k": 0
},
"p": {
"a": 0,
"k": [
250,
250,
0
]
},
"a": {
"a": 0,
"k": [
250,
250,
0
]
},
"s": {
"a": 0,
"k": [
100,
100,
100
]
}
},
"ip": 13,
"op": 14
},
{
"ind": 15,
"ty": 2,
"nm": "光效_00014.png",
"refId": "815ec047-0668-48fc-9299-5330683cebe8",
"ks": {
"o": {
"a": 0,
"k": 100
},
"r": {
"a": 0,
"k": 0
},
"p": {
"a": 0,
"k": [
250,
250,
0
]
},
"a": {
"a": 0,
"k": [
250,
250,
0
]
},
"s": {
"a": 0,
"k": [
100,
100,
100
]
}
},
"ip": 14,
"op": 15
},
{
"ind": 16,
"ty": 2,
"nm": "光效_00015.png",
"refId": "80ce130d-d032-49b7-b5ad-f7bdb675fbb4",
"ks": {
"o": {
"a": 0,
"k": 100
},
"r": {
"a": 0,
"k": 0
},
"p": {
"a": 0,
"k": [
250,
250,
0
]
},
"a": {
"a": 0,
"k": [
250,
250,
0
]
},
"s": {
"a": 0,
"k": [
100,
100,
100
]
}
},
"ip": 15,
"op": 16
},
{
"ind": 17,
"ty": 2,
"nm": "光效_00016.png",
"refId": "3aa8de78-0759-4c6d-b73c-50960aaff81b",
"ks": {
"o": {
"a": 0,
"k": 100
},
"r": {
"a": 0,
"k": 0
},
"p": {
"a": 0,
"k": [
250,
250,
0
]
},
"a": {
"a": 0,
"k": [
250,
250,
0
]
},
"s": {
"a": 0,
"k": [
100,
100,
100
]
}
},
"ip": 16,
"op": 17
}
],
"markers": []
}
\ No newline at end of file
{
"3aa8de78-0759-4c6d-b73c-50960aaff81b.png": {
"x": 2,
"y": 2,
"w": 271,
"h": 247,
"ox": 106,
"oy": 134,
"sw": 500,
"sh": 500,
"ro": false
},
"4ddeed91-efcc-4e9f-9535-b47bf9cc8cc7.png": {
"x": 2,
"y": 251,
"w": 270,
"h": 262,
"ox": 107,
"oy": 125,
"sw": 500,
"sh": 500,
"ro": false
},
"80ce130d-d032-49b7-b5ad-f7bdb675fbb4.png": {
"x": 2,
"y": 515,
"w": 270,
"h": 260,
"ox": 106,
"oy": 128,
"sw": 500,
"sh": 500,
"ro": true
},
"815ec047-0668-48fc-9299-5330683cebe8.png": {
"x": 264,
"y": 515,
"w": 270,
"h": 263,
"ox": 106,
"oy": 124,
"sw": 500,
"sh": 500,
"ro": true
},
"473d3eba-50a8-44ae-a077-9869f42d2c4c.png": {
"x": 274,
"y": 251,
"w": 269,
"h": 259,
"ox": 108,
"oy": 127,
"sw": 500,
"sh": 500,
"ro": false
},
"6b15e867-5f62-4263-b614-6ca0f212afb6.png": {
"x": 545,
"y": 2,
"w": 269,
"h": 260,
"ox": 108,
"oy": 126,
"sw": 500,
"sh": 500,
"ro": false
},
"29261a22-d781-49c8-b831-84778bcdb16d.png": {
"x": 545,
"y": 264,
"w": 266,
"h": 257,
"ox": 109,
"oy": 128,
"sw": 500,
"sh": 500,
"ro": false
},
"2e47ed27-0a53-4e63-93f0-21240e564dd3.png": {
"x": 529,
"y": 523,
"w": 262,
"h": 253,
"ox": 111,
"oy": 130,
"sw": 500,
"sh": 500,
"ro": false
},
"b6183a46-9d87-4cff-9a23-835afd98c530.png": {
"x": 793,
"y": 523,
"w": 259,
"h": 251,
"ox": 112,
"oy": 131,
"sw": 500,
"sh": 500,
"ro": true
},
"9f286912-00c4-4223-bc30-cfbe5b71ca34.png": {
"x": 275,
"y": 2,
"w": 254,
"h": 246,
"ox": 115,
"oy": 134,
"sw": 500,
"sh": 500,
"ro": false
},
"b1e882e1-f38e-4763-a57c-46391416f424.png": {
"x": 529,
"y": 778,
"w": 251,
"h": 242,
"ox": 117,
"oy": 136,
"sw": 500,
"sh": 500,
"ro": false
},
"162c3be4-336c-49ca-8379-7fdf4a10e23e.png": {
"x": 2,
"y": 787,
"w": 231,
"h": 220,
"ox": 125,
"oy": 146,
"sw": 500,
"sh": 500,
"ro": true
},
"053667d9-2ed2-4904-b301-b2f5de0efdae.png": {
"x": 224,
"y": 787,
"w": 209,
"h": 198,
"ox": 133,
"oy": 161,
"sw": 500,
"sh": 500,
"ro": true
},
"953374da-816d-4ed6-8bac-1c04567db072.png": {
"x": 782,
"y": 784,
"w": 191,
"h": 178,
"ox": 140,
"oy": 171,
"sw": 500,
"sh": 500,
"ro": true
},
"8488d536-9e46-44da-919e-e89a5af1eb7a.png": {
"x": 424,
"y": 787,
"w": 117,
"h": 95,
"ox": 171,
"oy": 210,
"sw": 500,
"sh": 500,
"ro": true
},
"9e59d392-9c37-4355-b00e-3568010c3add.png": {
"x": 424,
"y": 906,
"w": 67,
"h": 52,
"ox": 203,
"oy": 234,
"sw": 500,
"sh": 500,
"ro": false
},
"7909f194-4ba2-452c-9402-aeca2df585ce.png": {
"x": 224,
"y": 998,
"w": 24,
"h": 22,
"ox": 224,
"oy": 249,
"sw": 500,
"sh": 500,
"ro": true
}
}
\ No newline at end of file
......@@ -41,7 +41,7 @@ App({
*/
handleQuery(query) {
const { activityId } = query;
this.activityId = activityId || '5f7294e28e6a08456786b14e';
this.activityId = activityId || '5f73f1b09da6718132be23d1';
}
});
......@@ -14,7 +14,13 @@
<image class="mission_icon" src="{{item.iconUrl}}" />
<view class="mission_content">
<view class="mission_title">{{item.taskNameActiv}}</view>
<view class="mission_describe">乐园门票 <text class="mission_describe_hightlight">+{{item.rewards}}</text></view>
<view a:if="{{item.type === 'moneyGoods'}}" class="">每支付1笔定金乐园门票<text class="mission_describe_hightlight">+{{item.rewards}}</text></view>
<view a:if="{{item.type === 'invites'}}" class="">每邀请1名好友入会乐园门票<text class="mission_describe_hightlight">+{{item.rewards}}</text></view>
<view a:if="{{item.type === 'orderGoods'}}" class="">每完成1笔下单乐园门票<text class="mission_describe_hightlight">+{{item.rewards}}</text></view>
<view a:if="{{item.type === 'moneyGoods' && item.type !== 'invites' && item.type !== 'orderGoods'}}"
class="mission_describe">乐园门票<text class="mission_describe_hightlight">+{{item.rewards}}</text></view>
</view>
<view class="mission_btn {{ item.status === 1 ? 'mission_btn_active' : '' }}"
data-type="{{item.taskType}}" data-status="{{item.status}}" data-itemIds="{{item.itemIds}}" data-info="{{item}}" onTap="doTaskByType">
......
.commonT1-modal {
.commonT1-modal_T1 {
position: fixed;
top: 0;
left: 0;
......@@ -7,7 +7,7 @@
z-index: 20;
}
.commonT1-modal__shade {
.commonT1-modal__shade_T1 {
position: absolute;
top: 0;
left: 0;
......@@ -16,7 +16,7 @@
background-color: rgba(0, 0, 0, 0.75);
}
.jiang_li_dan_chuang {
.jiang_li_dan_chuang_T1 {
width: 500rpx;
height: 523rpx;
opacity: 1;
......@@ -25,7 +25,7 @@
position: absolute;
}
.dan_chuang_bei_jing2 {
.dan_chuang_bei_jing2_T1 {
width: 100%;
height: 100%;
opacity: 1;
......@@ -33,7 +33,7 @@
left: 0;
position: absolute;
}
.qu_chou_jiang {
.qu_chou_jiang_T1 {
width: 209rpx;
height: 88rpx;
opacity: 1;
......@@ -41,7 +41,7 @@
bottom: 36rpx;
position: absolute;
}
.ji_xu_guan_kan {
.ji_xu_guan_kan_T1 {
width: 209rpx;
height: 88rpx;
opacity: 1;
......@@ -49,7 +49,7 @@
bottom: 36rpx;
position: absolute;
}
.kan_shi_pin_jiang_li {
.kan_shi_pin_jiang_li_T1 {
width: 100%;
height: 56rpx;
line-height: 56rpx;
......@@ -65,7 +65,7 @@
-webkit-background-clip: text;
font-weight: 700;
}
.huo_de_ya_dun_bi {
.huo_de_ya_dun_bi_T1 {
width: 100%;
height: 32rpx;
line-height: 42rpx;
......@@ -78,7 +78,7 @@
color: rgba(200, 82, 73, 1);
font-weight: 500;
}
.tu_ceng40 {
.tu_ceng40_T1 {
width: 100%;
height: 60rpx;
line-height: 60rpx;
......@@ -92,7 +92,7 @@
font-weight: 500;
}
.commonT1_btn {
.commonT1_btn_T1 {
width: 300rpx;
height: 88rpx;
position: absolute;
......@@ -100,7 +100,7 @@
left: 100rpx;
}
.an_niu_guan_bi_dan_chuang_kao_bei23 {
.an_niu_guan_bi_dan_chuang_kao_bei23_T1 {
width: 50rpx;
height: 50rpx;
opacity: 0.5;
......
<view class="commonT1-modal">
<view class="commonT1-modal__shade modal-animate-fade-in">
<view class="commonT1-modal_T1">
<view class="commonT1-modal__shade_T1 modal-animate-fade-in_T1">
<view class="jiang_li_dan_chuang">
<image class="dan_chuang_bei_jing2" src="{{resList['7203516e-8791-4974-955e-c8a044e16c80'].url}}"/>
<text class="kan_shi_pin_jiang_li">{{title}}</text>
<view class="jiang_li_dan_chuang_T1">
<image class="dan_chuang_bei_jing2_T1" src="{{resList['7203516e-8791-4974-955e-c8a044e16c80'].url}}"/>
<text class="kan_shi_pin_jiang_li_T1">{{title}}</text>
<view class="flex_content">
<view class="huo_de_ya_dun_bi">
<view class="flex_content_T1">
<view class="huo_de_ya_dun_bi_T1">
<text decode="{{true}}">{{content}}</text>
</view>
</view>
<image class="commonT1_btn" src="{{btnImg}}" mode="aspectFill" onTap="onModalConfirm"/>
<image class="commonT1_btn_T1" src="{{btnImg}}" mode="aspectFill" onTap="onModalConfirm"/>
<image
class="an_niu_guan_bi_dan_chuang_kao_bei23" onTap="onModalClose"
class="an_niu_guan_bi_dan_chuang_kao_bei23_T1" onTap="onModalClose"
src="{{resList['4abc8bb6-5779-49ad-84b4-b4ade4f51fcb'].url}}"
/>
</view>
......
.homepage_wrapper {
width: 100%;
height: 100%;
.transMask-end {
top: 0;
left: 0rpx;
left: 0;
right: 0;
bottom: 0;
position: fixed;
z-index: 98;
}
.transMask-noStart {
top: 0;
left: 0;
right: 0;
bottom: 0;
position: fixed;
z-index: 100;
}
.noStartToast {
width: 300rpx;
height: 68rpx;
line-height: 68rpx;
text-align: center;
font-size: 28rpx;
color: white;
position: absolute;
top: calc(50% - 34rpx);
left: calc(50% - 150rpx);
z-index: 101;
background-color: rgba(0,0,0,5);
border-radius: 6rpx;
}
.homepage_wrapper {
top: 0;
left: 0;
right: 0;
bottom: 0;
position: fixed;
z-index: 2;
background: white;
background: pink;
}
.homepage_animation {
......@@ -66,6 +99,7 @@
justify-content: space-between;
display: flex;
position: absolute;
z-index: 99;
}
.head_ruler {
width: 141rpx;
......@@ -211,7 +245,7 @@
.video_wrapper{
position: absolute;
z-index: 30;
z-index: 119;
top: 0;
left: 0;
right: 0;
......@@ -238,18 +272,18 @@
}
.video_hide {
position: absolute;
position: fixed;
z-index: 40;
width: 140rpx;
height: 100rpx;
top: 0;
left: 100rpx;
background: rgba(255, 255, 255, .9);
color: rgb(0, 0, 0);
font-size: 22rpx;
width: 48rpx;
height: 48rpx;
top: 60rpx;
right: 30rpx;
overflow: hidden;
text-align: center;
line-height: 100rpx;
}
.video_hide_img {
width: 100%;
height: 100%;
}
.video_block {
......@@ -281,12 +315,21 @@
}
.video_block_wrapper_postersmall {
width: 400rpx;
height: 180rpx;
height: 230rpx;
left: 15rpx;
top: 15rpx;
position: absolute;
z-index: 8;
}
.video_block_wrapper_postersmall_mask {
width: 400rpx;
height: 230rpx;
left: 15rpx;
top: 15rpx;
position: absolute;
z-index: 9;
background-color: rgba(0,0,0,.45);
}
.video_block_text {
width: 100%;
height: 64rpx;
......
......@@ -8,6 +8,9 @@
</view>
<view class="noStartToast" a:if="{{noStartToast}}">活动未开始</view>
<view class="transMask-noStart" a:if="{{noStart}}"></view>
<view class="transMask-end" a:if="{{end}}"></view>
<!-- 头部 规则-奖品 按钮 -->
<view class="head">
<image class="head_ruler" onTap="showRuleModal" src="{{resList['ee8882be-4b1d-43eb-bad7-8d96318c5022'].url}}" />
......@@ -16,14 +19,15 @@
</view>
<view class="video_wrapper" a:if="{{videoShow}}">
<view class="video_wrapper_mask"></view>
<!--
poster="{{resList[''].url}}"
-->
<video
id="videoCtx"
class="video"
src="{{videoSrc}}"
poster="{{posterSrc}}"
controls="{{false}}"
loop="{{isLooping}}"
muted="{{muteWhenPlaying}}"
......@@ -43,13 +47,16 @@
/>
</view>
<view class="video_hide" onTap="videoHideFunc"> 缩小视频 </view>
<view a:if="{{videoShow}}" class="video_hide" onTap="videoHideFunc">
<image class="video_hide_img" src="{{resList['70d07de0-4fc3-4802-bc56-c5cb57a28b91'].url}}" mode="aspectFill" />
</view>
<!-- 视频部分 -->
<view hidden="{{videoBottom_timeout}}" class="video_block {{ videoBottom ? 'block_opciaty0' : ''}}">
<view class="video_block_wrapper" onTap="videoShowFunc" >
<!-- 视频播放按钮 -->
<image class="video_block_wrapper_playicon" src="" mode="aspectFill" />
<image class="video_block_wrapper_playicon" src="{{resList['1a37baca-db9c-4e06-8bd3-e8bd78c72b1d'].url}}" mode="aspectFill" />
<view class="video_block_wrapper_postersmall_mask"></view>
<image class="video_block_wrapper_postersmall" src="{{videoImgSrcSmall}}" mode="aspectFill" />
<view class="video_block_text">
<view>观看XXXXX视频</view>
......@@ -61,8 +68,8 @@
</view>
<!-- 按钮组 左-右 -->
<image class="video_btn_left" onTap="videoTurnLeft" src="{{resList['70006ad9-e7aa-4121-8493-c3c0afa94608'].url}}" />
<image class="video_btn_right" onTap="videoTurnRight" src="{{resList['cf73af84-5751-4aee-a754-9106162786d9'].url}}" />
<image a:if="{{videoActiveIndex > 0}}" class="video_btn_left" onTap="videoTurnLeft" src="{{resList['70006ad9-e7aa-4121-8493-c3c0afa94608'].url}}" />
<image a:if="{{videoActiveIndex < videoSrcArrLength - 2}}" class="video_btn_right" onTap="videoTurnRight" src="{{resList['cf73af84-5751-4aee-a754-9106162786d9'].url}}" />
</view>
<!--
......
......@@ -2,6 +2,19 @@
width:100%;
height:100%;
}
.page-game-cover {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
width:100%;
height:100%;
z-index: 1;
background: pink;
}
.page-game {
/* position: absolute;
top: 0;
......
<view disable-scroll="true" class="page-game">
<view a:if="{{gameType === 0}}" class="page-game-cover"></view>
<canvas disable-scroll="true" id="canvas" type="2d" class="canvas" onTouchStart="onMouseEvent" onTouchMove="onMouseEvent" onTouchEnd="onMouseEvent" onReady="onCanvasReady">
</canvas>
</view>
......
......@@ -3,6 +3,9 @@ import API from '../../api';
const app = getApp();
const { tbcc } = app;
const { commonToast, getAuthUserInfo, navigateToOutside, getSystemInfo, ConsoleStyle } = tbcc.tb;
import UnicodeFont from './unicode.js'
import resList from '../../resconfig/resList'
import resListAvatar from '../../resconfig/resListAvatar'
const checkSystem = async () => {
const { version } = await getSystemInfo();
......@@ -25,10 +28,9 @@ Component({
gameData: null,
didMount() {
this.setData({
gameType: this.props.gameType
})
this.setData({ gameType: this.props.gameType })
this.init()
this.getFakeAvatar()
},
didUpdate(prevProps, prevData) {
......@@ -73,7 +75,7 @@ Component({
onCanvasReady() {
console.log('onCanvasReady')
this.changeGameSence(this.props.gameType)
// this.changeGameSence(this.props.gameType)
},
postMessage(netName, data) {
......@@ -93,6 +95,7 @@ Component({
// 获取信息
case "mine.getUserInfo":
// 开始游戏
console.warn('mine.getUserInfo')
this.gameStartInfo()
break;
case "mine.backToPage":
......@@ -106,7 +109,6 @@ Component({
console.warn('监听时间名 没有对应处理函数')
break;
}
},
// 从游戏中返回
......@@ -114,16 +116,37 @@ Component({
this.props.onBackPage()
this.gameData = null
this.gamePrize = null
this.setData({gameType: 0})
},
// 游戏开始 获取用户信息
gameStartInfo () {
// -- test code --
let win = this.countWinRange(this.data.gameType)
this.isWin = win
let fname = this.getFakeUserName()
let favatar = this.getFakeAvatar()
this.gameData = {
win: win,
fakeUserName: fname,
fakeUserImgUrl: '//yun.duiba.com.cn/spark/assets/43081f4ee9aed1c4d89d9e0882b2b5210a93ef17.png',
userName: app.nickName,
userImgUrl: app.avatar,
isNewUser: this.data.gameType === 1 ? app.isNewUser_csd : app.isNewUser_xxl
}
console.log('%cgameData:', ConsoleStyle, this.gameData)
this.postMessage('mine.getUserInfo', {data: this.gameData})
return
// -- test code --
API.doJoin({activityId: app.activityId, type: this.data.gameType === 1 ? 'slide' : 'timeline'})
.then(res => {
const { data, success } = res
console.log('%c-----开始游戏\n' + '-----yd.doJoin\n', ConsoleStyle, data)
if (success) {
// 计算胜负
let win = this.countWinRange()
let win = this.countWinRange(this.data.gameType)
this.isWin = win
let fname = this.getFakeUserName()
let favatar = this.getFakeAvatar()
......@@ -136,9 +159,8 @@ Component({
// 是否是新用户
isNewUser: this.data.gameType === 1 ? app.isNewUser_csd : app.isNewUser_xxl
}
this.postMessage('mine.getUserInfo', this.gameData)
// this.postMessage('csdGameData', this.gameData)
console.log('%cgameData:', ConsoleStyle, this.gameData)
this.postMessage('mine.getUserInfo', {data:this.gameData})
} else {
commonToast(res.message)
}
......@@ -148,23 +170,38 @@ Component({
// 游戏结束 获取开奖
getGameOverPrize () {
API.gameOver({activityId: app.activityId, type: this.data.gameType === 1 ? 'slide' : 'timeline', isWin: this.win})
// -- test code --
this.gamePrize = {
name: '一碗热翔',
image: '//yun.duiba.com.cn/spark/assets/43081f4ee9aed1c4d89d9e0882b2b5210a93ef17.png',
type: 2
}
console.log('%cgamePrize:', ConsoleStyle, this.gamePrize)
this.postMessage('mine.getPrizeInfo', {data:this.gamePrize})
return
// -- test code --
API.gameOver({activityId: app.activityId, type: this.data.gameType === 1 ? 'slide' : 'timeline', isWin: this.isWin})
.then(res => {
const { data, success} = res
console.log('%c-----游戏结束 获取开奖\n' + '-----yd.gameOver\n', ConsoleStyle, data)
if (success) {
this.gamePrize = {
name: data.prize.name,
image: data.prize.image,
type: data.prize.type
}
this.postMessage('mine.getPrizeInfo', this.gamePrize)
console.log('%cgamePrize:', ConsoleStyle, this.gamePrize)
this.postMessage('mine.getPrizeInfo', {data:this.gamePrize})
} else {
this.gamePrize ={
name: '谢谢参与',
image: '',
type: 5
}
this.postMessage('mine.getPrizeInfo', this.gamePrize)
console.log('%cgamePrize:', ConsoleStyle, this.gamePrize)
this.postMessage('mine.getPrizeInfo', {data:this.gamePrize})
}
})
.catch(err => {
......@@ -174,6 +211,7 @@ Component({
image: '',
type: 5
}
console.log('%cgamePrize:', ConsoleStyle, this.gamePrize)
this.postMessage('mine.getPrizeInfo', this.gamePrize)
})
},
......@@ -194,17 +232,19 @@ Component({
// 生成假用户名
getFakeUserName () {
var _rsl1 = '',
_rsl2 = ''
var _randomUniCode = Math.floor(Math.random() * (40870 - 19968) + 19968).toString(16);
eval("_rsl1=" + '"\\u' + _randomUniCode + '"')
eval("_rsl2=" + '"\\u' + _randomUniCode + '"')
let str = UnicodeFont
let str_ = str.split('/-')
// console.log(unescape(str_))
let _rsl1 = unescape(str_[this.sum(0, str_.length - 1)])
let _rsl2 = unescape(str_[this.sum(0, str_.length - 1)])
return _rsl1 + 'XXXXXX' + _rsl2
},
// 生成假用户头像
getFakeAvatar () {
return 'FakeAvatar'
let avatarArr = Object.keys(resListAvatar)
let avatar = resListAvatar[avatarArr[this.sum(0, avatarArr.length - 1)]].url
return avatar
},
//鼠标事件
......@@ -228,34 +268,40 @@ Component({
}
},
async getAuth() {
const userInfo = await getAuthUserInfo().catch(err => {
console.log('未授权成功', err);
});
if (userInfo) {
console.log('userInfo', userInfo);
const { nickName, avatar } = userInfo;
app.nickName = nickName;
app.avatar = avatar;
this.login();
}
},
// async getAuth() {
// const userInfo = await getAuthUserInfo().catch(err => {
// console.log('未授权成功', err);
// });
// if (userInfo) {
// console.log('userInfo', userInfo);
// const { nickName, avatar } = userInfo;
// app.nickName = nickName;
// app.avatar = avatar;
// this.login();
// }
// },
async login() {
const { nickName, avatar } = app;
const { success } = await API.login({ userNick: nickName, avatar }).catch(res => {
commonToast(res && res.message);
}) || {};
// async login() {
// const { nickName, avatar } = app;
// const { success } = await API.login({ userNick: nickName, avatar }).catch(res => {
// commonToast(res && res.message);
// }) || {};
if (success) {
this.init();
}
},
// if (success) {
// this.init();
// }
// },
closeRuleModal() {
this.setData({ ruleModalVisible: false })
},
// 取 随机数
sum (m, n) {
var num = Math.floor(Math.random() * (m - n) + n)
return num
}
}
});
\ No newline at end of file
const UnicodeFont = "%u7684/-%u4e00/-%u4e86/-%u662f/-%u6211/-%u4e0d/-%u5728/-%u4eba/-%u4eec/-%u6709/-%u6765/-%u4ed6/-%u8fd9/-%u4e0a/-%u7740/-%u4e2a/-%u5730/-%u5230/-%u5927/-%u91cc/-%u8bf4/-%u5c31/-%u53bb/-%u5b50/-%u5f97/-%u4e5f/-%u548c/-%u90a3/-%u8981/-%u4e0b/-%u770b/-%u5929/-%u65f6/-%u8fc7/-%u51fa/-%u5c0f/-%u4e48/-%u8d77/-%u4f60/-%u90fd/-%u628a/-%u597d/-%u8fd8/-%u591a/-%u6ca1/-%u4e3a/-%u53c8/-%u53ef/-%u5bb6/-%u5b66/-%u53ea/-%u4ee5/-%u4e3b/-%u4f1a/-%u6837/-%u5e74/-%u60f3/-%u751f/-%u540c/-%u8001/-%u4e2d/-%u5341/-%u4ece/-%u81ea/-%u9762/-%u524d/-%u5934/-%u9053/-%u5b83/-%u540e/-%u7136/-%u8d70/-%u5f88/-%u50cf/-%u89c1/-%u4e24/-%u7528/-%u5979/-%u56fd/-%u52a8/-%u8fdb/-%u6210/-%u56de/-%u4ec0/-%u8fb9/-%u4f5c/-%u5bf9/-%u5f00/-%u800c/-%u5df1/-%u4e9b/-%u73b0/-%u5c71/-%u6c11/-%u5019/-%u7ecf/-%u53d1/-%u5de5/-%u5411/-%u4e8b/-%u547d/-%u7ed9/-%u957f/-%u6c34/-%u51e0/-%u4e49/-%u4e09/-%u58f0/-%u4e8e/-%u9ad8/-%u624b/-%u77e5/-%u7406/-%u773c/-%u5fd7/-%u70b9/-%u5fc3/-%u6218/-%u4e8c/-%u95ee/-%u4f46/-%u8eab/-%u65b9/-%u5b9e/-%u5403/-%u505a/-%u53eb/-%u5f53/-%u4f4f/-%u542c/-%u9769/-%u6253/-%u5462/-%u771f/-%u5168/-%u624d/-%u56db/-%u5df2/-%u6240/-%u654c/-%u4e4b/-%u6700/-%u5149/-%u4ea7/-%u60c5/-%u8def/-%u5206/-%u603b/-%u6761/-%u767d/-%u8bdd/-%u4e1c/-%u5e2d/-%u6b21/-%u4eb2/-%u5982/-%u88ab/-%u82b1/-%u53e3/-%u653e/-%u513f/-%u5e38/-%u6c14/-%u4e94/-%u7b2c/-%u4f7f/-%u5199/-%u519b/-%u5427/-%u6587/-%u8fd0/-%u518d/-%u679c/-%u600e/-%u5b9a/-%u8bb8/-%u5feb/-%u660e/-%u884c/-%u56e0/-%u522b/-%u98de/-%u5916/-%u6811/-%u7269/-%u6d3b/-%u90e8/-%u95e8/-%u65e0/-%u5f80/-%u8239/-%u671b/-%u65b0/-%u5e26/-%u961f/-%u5148/-%u529b/-%u5b8c/-%u5374/-%u7ad9/-%u4ee3/-%u5458/-%u673a/-%u66f4/-%u4e5d/-%u60a8/-%u6bcf/-%u98ce/-%u7ea7/-%u8ddf/-%u7b11/-%u554a/-%u5b69/-%u4e07/-%u5c11/-%u76f4/-%u610f/-%u591c/-%u6bd4/-%u9636/-%u8fde/-%u8f66/-%u91cd/-%u4fbf/-%u6597/-%u9a6c/-%u54ea/-%u5316/-%u592a/-%u6307/-%u53d8/-%u793e/-%u4f3c/-%u58eb/-%u8005/-%u5e72/-%u77f3/-%u6ee1/-%u65e5/-%u51b3/-%u767e/-%u539f/-%u62ff/-%u7fa4/-%u7a76/-%u5404/-%u516d/-%u672c/-%u601d/-%u89e3/-%u7acb/-%u6cb3/-%u6751/-%u516b/-%u96be/-%u65e9/-%u8bba/-%u5417/-%u6839/-%u5171/-%u8ba9/-%u76f8/-%u7814/-%u4eca/-%u5176/-%u4e66/-%u5750/-%u63a5/-%u5e94/-%u5173/-%u4fe1/-%u89c9/-%u6b65/-%u53cd/-%u5904/-%u8bb0/-%u5c06/-%u5343/-%u627e/-%u4e89/-%u9886/-%u6216/-%u5e08/-%u7ed3/-%u5757/-%u8dd1/-%u8c01/-%u8349/-%u8d8a/-%u5b57/-%u52a0/-%u811a/-%u7d27/-%u7231/-%u7b49/-%u4e60/-%u9635/-%u6015/-%u6708/-%u9752/-%u534a/-%u706b/-%u6cd5/-%u9898/-%u5efa/-%u8d76/-%u4f4d/-%u5531/-%u6d77/-%u4e03/-%u5973/-%u4efb/-%u4ef6/-%u611f/-%u51c6/-%u5f20/-%u56e2/-%u5c4b/-%u79bb/-%u8272/-%u8138/-%u7247/-%u79d1/-%u5012/-%u775b/-%u5229/-%u4e16/-%u521a/-%u4e14/-%u7531/-%u9001/-%u5207/-%u661f/-%u5bfc/-%u665a/-%u8868/-%u591f/-%u6574/-%u8ba4/-%u54cd/-%u96ea/-%u6d41/-%u672a/-%u573a/-%u8be5/-%u5e76/-%u5e95/-%u6df1/-%u523b/-%u5e73/-%u4f1f/-%u5fd9/-%u63d0/-%u786e/-%u8fd1/-%u4eae/-%u8f7b/-%u8bb2/-%u519c/-%u53e4/-%u9ed1/-%u544a/-%u754c/-%u62c9/-%u540d/-%u5440/-%u571f/-%u6e05/-%u9633/-%u7167/-%u529e/-%u53f2/-%u6539/-%u5386/-%u8f6c/-%u753b/-%u9020/-%u5634/-%u6b64/-%u6cbb/-%u5317/-%u5fc5/-%u670d/-%u96e8/-%u7a7f/-%u5185/-%u8bc6/-%u9a8c/-%u4f20/-%u4e1a/-%u83dc/-%u722c/-%u7761/-%u5174/-%u5f62/-%u91cf/-%u54b1/-%u89c2/-%u82e6/-%u4f53/-%u4f17/-%u901a/-%u51b2/-%u5408/-%u7834/-%u53cb/-%u5ea6/-%u672f/-%u996d/-%u516c/-%u65c1/-%u623f/-%u6781/-%u5357/-%u67aa/-%u8bfb/-%u6c99/-%u5c81/-%u7ebf/-%u91ce/-%u575a/-%u7a7a/-%u6536/-%u7b97/-%u81f3/-%u653f/-%u57ce/-%u52b3/-%u843d/-%u94b1/-%u7279/-%u56f4/-%u5f1f/-%u80dc/-%u6559/-%u70ed/-%u5c55/-%u5305/-%u6b4c/-%u7c7b/-%u6e10/-%u5f3a/-%u6570/-%u4e61/-%u547c/-%u6027/-%u97f3/-%u7b54/-%u54e5/-%u9645/-%u65e7/-%u795e/-%u5ea7/-%u7ae0/-%u5e2e/-%u5566/-%u53d7/-%u7cfb/-%u4ee4/-%u8df3/-%u975e/-%u4f55/-%u725b/-%u53d6/-%u5165/-%u5cb8/-%u6562/-%u6389/-%u5ffd/-%u79cd/-%u88c5/-%u9876/-%u6025/-%u6797/-%u505c/-%u606f/-%u53e5/-%u533a/-%u8863/-%u822c/-%u62a5/-%u53f6/-%u538b/-%u6162/-%u53d4/-%u80cc/-%u7ec6"
export default UnicodeFont
\ No newline at end of file
......@@ -622,6 +622,18 @@ const resList = {
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/时空传送.53c4af1a66a461812b8f3a502b14cddf4daed9b3.png',
uuid: 'b23ce750-11e2-45f9-b3af-a0a7dedddcfd'
},
'70d07de0-4fc3-4802-bc56-c5cb57a28b91': {
name: '按钮关闭弹窗3',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/按钮关闭弹窗3.1e74a9322a7b04a4e57041a7a733789d2f2fc113.png',
uuid: '70d07de0-4fc3-4802-bc56-c5cb57a28b91'
},
'1a37baca-db9c-4e06-8bd3-e8bd78c72b1d': {
name: '视频暂停按钮',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/视频暂停按钮.b02345a3f9a24464df94a1f8bd4bcfe4182ad40c.png',
uuid: '1a37baca-db9c-4e06-8bd3-e8bd78c72b1d'
}
};
export default resList;
\ No newline at end of file
This diff is collapsed.
......@@ -69,7 +69,7 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
dataType: 'json'
}).then(({ data: res }) => {
hideMyLoading();
// console.log(`mock res,${url}=>`, res)
console.log(`mock res,${url}=>`, res)
if (res && res.success) {
resolve(res);
} else {
......@@ -86,7 +86,7 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
return new Promise((resolve, reject) => {
// console.log('requestCloud', handle, params);
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();
if (res && res.success) {
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