Commit 361efa8a authored by Master Q's avatar Master Q

233

parent 87765894
# Details
Date : 2021-11-23 16:28:15
Directory /Users/faguangdexiaoxianyu/work/taobao/nike/Game/src
Total : 43 files, 29968 codes, 900 comments, 613 blanks, all 31481 lines
[summary](results.md)
## Files
| filename | language | code | comment | blank | total |
| :--- | :--- | ---: | ---: | ---: | ---: |
| [src/Clock.ts](/src/Clock.ts) | TypeScript | 43 | 2 | 28 | 73 |
| [src/Main.ts](/src/Main.ts) | TypeScript | 108 | 87 | 24 | 219 |
| [src/ResJson.ts](/src/ResJson.ts) | TypeScript | 3,830 | 0 | 0 | 3,830 |
| [src/SkinJson.ts](/src/SkinJson.ts) | TypeScript | 1,104 | 0 | 1 | 1,105 |
| [src/SoundWeb.ts](/src/SoundWeb.ts) | TypeScript | 55 | 50 | 26 | 131 |
| [src/TaoBaoNet.ts](/src/TaoBaoNet.ts) | TypeScript | 205 | 127 | 40 | 372 |
| [src/Tools.ts](/src/Tools.ts) | TypeScript | 253 | 83 | 40 | 376 |
| [src/UI.ts](/src/UI.ts) | TypeScript | 105 | 50 | 9 | 164 |
| [src/WebNet.ts](/src/WebNet.ts) | TypeScript | 292 | 92 | 28 | 412 |
| [src/common/CircleProgressBar.ts](/src/common/CircleProgressBar.ts) | TypeScript | 94 | 1 | 15 | 110 |
| [src/common/G_EVENT.ts](/src/common/G_EVENT.ts) | TypeScript | 6 | 0 | 1 | 7 |
| [src/common/IConfirmPanel.ts](/src/common/IConfirmPanel.ts) | TypeScript | 13 | 9 | 5 | 27 |
| [src/common/Light.ts](/src/common/Light.ts) | TypeScript | 57 | 20 | 4 | 81 |
| [src/common/MusicBtn.ts](/src/common/MusicBtn.ts) | TypeScript | 46 | 11 | 24 | 81 |
| [src/common/ProgressBar.ts](/src/common/ProgressBar.ts) | TypeScript | 71 | 6 | 14 | 91 |
| [src/common/ProgressBarS.ts](/src/common/ProgressBarS.ts) | TypeScript | 36 | 10 | 11 | 57 |
| [src/common/RichText.ts](/src/common/RichText.ts) | TypeScript | 97 | 46 | 16 | 159 |
| [src/common/SoundWeb.ts](/src/common/SoundWeb.ts) | TypeScript | 67 | 24 | 23 | 114 |
| [src/common/addBreathing.ts](/src/common/addBreathing.ts) | TypeScript | 9 | 5 | 1 | 15 |
| [src/common/addClickZoom.ts](/src/common/addClickZoom.ts) | TypeScript | 19 | 5 | 2 | 26 |
| [src/common/countDown.ts](/src/common/countDown.ts) | TypeScript | 14 | 15 | 2 | 31 |
| [src/common/getLightBgTexture.ts](/src/common/getLightBgTexture.ts) | TypeScript | 40 | 14 | 2 | 56 |
| [src/components/CountDownComp.ts](/src/components/CountDownComp.ts) | TypeScript | 78 | 8 | 22 | 108 |
| [src/lotties/balance_guidance.ts](/src/lotties/balance_guidance.ts) | TypeScript | 789 | 0 | 0 | 789 |
| [src/lotties/blank_shoe.ts](/src/lotties/blank_shoe.ts) | TypeScript | 6,335 | 0 | 0 | 6,335 |
| [src/lotties/excellent_icon.ts](/src/lotties/excellent_icon.ts) | TypeScript | 136 | 0 | 0 | 136 |
| [src/lotties/guidan_360.ts](/src/lotties/guidan_360.ts) | TypeScript | 1,787 | 0 | 0 | 1,787 |
| [src/lotties/red_shoe.ts](/src/lotties/red_shoe.ts) | TypeScript | 6,335 | 0 | 0 | 6,335 |
| [src/lotties/white_shoe.ts](/src/lotties/white_shoe.ts) | TypeScript | 6,335 | 0 | 0 | 6,335 |
| [src/lotties/yoga_fail.ts](/src/lotties/yoga_fail.ts) | TypeScript | 108 | 0 | 0 | 108 |
| [src/panels/GameOverPanel.ts](/src/panels/GameOverPanel.ts) | TypeScript | 143 | 7 | 16 | 166 |
| [src/panels/NewCompletePanel.ts](/src/panels/NewCompletePanel.ts) | TypeScript | 28 | 0 | 4 | 32 |
| [src/panels/PrizeShowPanel.ts](/src/panels/PrizeShowPanel.ts) | TypeScript | 49 | 2 | 6 | 57 |
| [src/scenes/GameOverScene/GameOverScene.ts](/src/scenes/GameOverScene/GameOverScene.ts) | TypeScript | 129 | 8 | 21 | 158 |
| [src/scenes/GameScene/DeviceMotion.ts](/src/scenes/GameScene/DeviceMotion.ts) | TypeScript | 99 | 11 | 18 | 128 |
| [src/scenes/GameScene/GameConfig.ts](/src/scenes/GameScene/GameConfig.ts) | TypeScript | 86 | 1 | 18 | 105 |
| [src/scenes/GameScene/GameScene.ts](/src/scenes/GameScene/GameScene.ts) | TypeScript | 409 | 41 | 83 | 533 |
| [src/scenes/GameScene/MotionInit.ts](/src/scenes/GameScene/MotionInit.ts) | TypeScript | 333 | 103 | 74 | 510 |
| [src/scenes/NewGuyScene/NewGuyScene.ts](/src/scenes/NewGuyScene/NewGuyScene.ts) | TypeScript | 52 | 5 | 14 | 71 |
| [src/soundCtrl.ts](/src/soundCtrl.ts) | TypeScript | 35 | 0 | 2 | 37 |
| [src/svgaTb.ts](/src/svgaTb.ts) | TypeScript | 51 | 23 | 9 | 83 |
| [src/utils/test.js](/src/utils/test.js) | JavaScript | 5 | 0 | 2 | 7 |
| [src/utils/utils.ts](/src/utils/utils.ts) | TypeScript | 82 | 34 | 8 | 124 |
[summary](results.md)
\ No newline at end of file
"filename", "language", "TypeScript", "JavaScript", "comment", "blank", "total"
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/Clock.ts", "TypeScript", 43, 0, 2, 28, 73
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/Main.ts", "TypeScript", 108, 0, 87, 24, 219
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/ResJson.ts", "TypeScript", 3830, 0, 0, 0, 3830
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/SkinJson.ts", "TypeScript", 1104, 0, 0, 1, 1105
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/SoundWeb.ts", "TypeScript", 55, 0, 50, 26, 131
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/TaoBaoNet.ts", "TypeScript", 205, 0, 127, 40, 372
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/Tools.ts", "TypeScript", 253, 0, 83, 40, 376
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/UI.ts", "TypeScript", 105, 0, 50, 9, 164
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/WebNet.ts", "TypeScript", 292, 0, 92, 28, 412
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/common/CircleProgressBar.ts", "TypeScript", 94, 0, 1, 15, 110
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/common/G_EVENT.ts", "TypeScript", 6, 0, 0, 1, 7
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/common/IConfirmPanel.ts", "TypeScript", 13, 0, 9, 5, 27
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/common/Light.ts", "TypeScript", 57, 0, 20, 4, 81
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/common/MusicBtn.ts", "TypeScript", 46, 0, 11, 24, 81
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/common/ProgressBar.ts", "TypeScript", 71, 0, 6, 14, 91
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/common/ProgressBarS.ts", "TypeScript", 36, 0, 10, 11, 57
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/common/RichText.ts", "TypeScript", 97, 0, 46, 16, 159
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/common/SoundWeb.ts", "TypeScript", 67, 0, 24, 23, 114
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/common/addBreathing.ts", "TypeScript", 9, 0, 5, 1, 15
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/common/addClickZoom.ts", "TypeScript", 19, 0, 5, 2, 26
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/common/countDown.ts", "TypeScript", 14, 0, 15, 2, 31
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/common/getLightBgTexture.ts", "TypeScript", 40, 0, 14, 2, 56
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/components/CountDownComp.ts", "TypeScript", 78, 0, 8, 22, 108
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/lotties/balance_guidance.ts", "TypeScript", 789, 0, 0, 0, 789
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/lotties/blank_shoe.ts", "TypeScript", 6335, 0, 0, 0, 6335
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/lotties/excellent_icon.ts", "TypeScript", 136, 0, 0, 0, 136
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/lotties/guidan_360.ts", "TypeScript", 1787, 0, 0, 0, 1787
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/lotties/red_shoe.ts", "TypeScript", 6335, 0, 0, 0, 6335
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/lotties/white_shoe.ts", "TypeScript", 6335, 0, 0, 0, 6335
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/lotties/yoga_fail.ts", "TypeScript", 108, 0, 0, 0, 108
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/panels/GameOverPanel.ts", "TypeScript", 143, 0, 7, 16, 166
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/panels/NewCompletePanel.ts", "TypeScript", 28, 0, 0, 4, 32
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/panels/PrizeShowPanel.ts", "TypeScript", 49, 0, 2, 6, 57
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/scenes/GameOverScene/GameOverScene.ts", "TypeScript", 129, 0, 8, 21, 158
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/scenes/GameScene/DeviceMotion.ts", "TypeScript", 99, 0, 11, 18, 128
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/scenes/GameScene/GameConfig.ts", "TypeScript", 86, 0, 1, 18, 105
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/scenes/GameScene/GameScene.ts", "TypeScript", 409, 0, 41, 83, 533
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/scenes/GameScene/MotionInit.ts", "TypeScript", 333, 0, 103, 74, 510
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/scenes/NewGuyScene/NewGuyScene.ts", "TypeScript", 52, 0, 5, 14, 71
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/soundCtrl.ts", "TypeScript", 35, 0, 0, 2, 37
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/svgaTb.ts", "TypeScript", 51, 0, 23, 9, 83
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/utils/test.js", "JavaScript", 0, 5, 0, 2, 7
"/Users/faguangdexiaoxianyu/work/taobao/nike/Game/src/utils/utils.ts", "TypeScript", 82, 0, 34, 8, 124
"Total", "-", 29963, 5, 900, 613, 31481
\ No newline at end of file
# Summary
Date : 2021-11-23 16:28:15
Directory /Users/faguangdexiaoxianyu/work/taobao/nike/Game/src
Total : 43 files, 29968 codes, 900 comments, 613 blanks, all 31481 lines
[details](details.md)
## Languages
| language | files | code | comment | blank | total |
| :--- | ---: | ---: | ---: | ---: | ---: |
| TypeScript | 42 | 29,963 | 900 | 611 | 31,474 |
| JavaScript | 1 | 5 | 0 | 2 | 7 |
## Directories
| path | files | code | comment | blank | total |
| :--- | ---: | ---: | ---: | ---: | ---: |
| . | 43 | 29,968 | 900 | 613 | 31,481 |
| common | 13 | 569 | 166 | 120 | 855 |
| components | 1 | 78 | 8 | 22 | 108 |
| lotties | 7 | 21,825 | 0 | 0 | 21,825 |
| panels | 3 | 220 | 9 | 26 | 255 |
| scenes | 6 | 1,108 | 169 | 228 | 1,505 |
| scenes/GameOverScene | 1 | 129 | 8 | 21 | 158 |
| scenes/GameScene | 4 | 927 | 156 | 193 | 1,276 |
| scenes/NewGuyScene | 1 | 52 | 5 | 14 | 71 |
| utils | 2 | 87 | 34 | 10 | 131 |
[details](details.md)
\ No newline at end of file
This diff is collapsed.
{
"success": true
}
\ No newline at end of file
const MouseEvent = FYGE.MouseEvent
const Container = FYGE.Container
const Tween = FYGE.Tween
export class FButton extends FYGE.Container {
clicked: boolean
constructor(...args:any) {
super()
this.addEventListener("onMouseDown", this.mouseEvent);
this.addEventListener("onMouseUp", this.mouseEvent);
this.addEventListener("onMouseOut", this.mouseEvent);
setTimeout(() => {
this.anchorX = this.width / 2
this.anchorY = this.height / 2
}, 500)
}
mouseEvent(e: any) {
let s = this;
if (e.type == MouseEvent.MOUSE_DOWN) {
Tween.removeTweens(this);
Tween.get(this).to({ scaleX: 0.95, scaleY: 0.95 }, 50);
} else {
Tween.removeTweens(this);
Tween.get(this).to({ scaleX: 1, scaleY: 1 }, 50);
}
}
}
......@@ -202,7 +202,8 @@ export class Main {
// (function() {
// showPanel(GameOverPanel, {
// score: '1',
// level: 3
// level: 3,
// isWinPrize: true
// })
// })()
}
......
......@@ -3826,5 +3826,5 @@ export const ResJson = {
}
}
],
"path": "https://yun.duiba.com.cn/db_games/activity/template/1632831758/resource/"
"path": "https://yun.duiba.com.cn/db_games/activity/template/1640762928/resource/"
}
\ No newline at end of file
......@@ -8,30 +8,31 @@ export enum TbNetName {
* 埋点统计
* activityId type
*/
addData = "yoga.addStat",
addData = "yogaV1.addStat",
/**
* 活动基本信息
* activityId
*/
getActivityBaseInfoById = "yoga.getActivityBaseInfoById",
getActivityBaseInfoById = "yogaV1.getActivityBaseInfoById",
getGameInfo = "xunzai.getGameInfo",
receiveInvitePrize = "xunzai.receiveInvitePrize",
startGame = "yoga.startGame",
startGame = "yogaV1.startGame",
submitGame = "yoga.submitGame",
submitGame = "yogaV1.submitGame",
drawLotteryPrize = "yoga.drawLotteryPrize",
drawLotteryPrize = "yogaV1.drawLotteryPrize",
doHelp = "xunzai.doHelp",
getVipInfo = "xunzai.getVipInfo",
receiveEnamePrize = "xunzai.receiveEnamePrize",
receiveEnamePrize = "yogaV1.receiveEnamePrize",
openMember = "mine.openMember",
applyMemberBenefit = "mine.applyMemberBenefit",
openTask = "mine.openTask",
......@@ -98,7 +99,7 @@ export enum TbNetName {
*/
openMusic = "mine.openMusic",
complteGuidance = 'yoga.complateGuide',
complteGuidance = 'yogaV1.complateGuide',
/**
* 添加 生命周期 事件
......@@ -108,7 +109,7 @@ export enum TbNetName {
// 显示 小程序的loading 记得注视下 自带的 菊花图
showCustomLoading = 'mine.showCustomLoading',
closeCustomLoading = 'mine.closeCustomLoading',
addTrack = 'yoga.addTrack'
addTrack = 'yogaV1.addTrack'
}
export enum TBBgm {
......
......@@ -6,6 +6,18 @@ import { sendTbNet, TbNetName } from "./TaoBaoNet";
import Tween = FYGE.Tween;
import Ease = FYGE.Ease;
export function throttle(func: Function, delay:number=2000) {
let flag = false
return function(...args) {
if (flag)return
flag = true
setTimeout(() => {
flag = false
}, delay)
func.apply(this, args)
}
}
export function goMyPrize() {
sendTbNet(
TbNetName.navigateTo,
......
......@@ -4,6 +4,7 @@
* Copyright © 2021 haiyoucuv. All rights reserved.
*/
import { RES } from "../module/RES";
import { FButton } from "./FUI";
import Container = FYGE.Container;
import Button = FYGE.Button;
import MouseEvent = FYGE.MouseEvent;
......@@ -160,4 +161,14 @@ export default class UI {
parent && parent.addChild(lottie);
return lottie;
}
public static Fbtn(
parent: Container,
x: number = 0, y: number = 0
): Container {
const ctn = new FButton();
ctn.position.set(x, y);
ctn && parent.addChild(ctn);
return ctn;
}
}
import { changeScene } from './../../module/ctrls/index';
import { changeScene, showPanel } from './../../module/ctrls/index';
import { showToast } from '../../module/ctrls';
import { layers } from '../../module/views/layers';
import UI from '../UI';
......@@ -6,6 +6,7 @@ import { Panel } from './../../module/views/Panel';
import { GameOverScene } from '../scenes/GameOverScene/GameOverScene';
import { sendTbNet, TBBgm, TbNetName } from '../TaoBaoNet';
import { GDispatcher } from '../Main';
import { RewardFailPanel } from './RewardFailpanel';
export class PrizeShowPanel extends Panel {
get groupNames(): string[] {
......@@ -31,6 +32,7 @@ export class PrizeShowPanel extends Panel {
UI.Btn(panelCtn, 'confirm-btn.png', async function() {
this.btnDelay(this)
console.log(this.data)
if (this.data.type == 3) {
this.hidePanel()
sendTbNet(TbNetName.addLifiCycleEvent, {
......@@ -47,10 +49,31 @@ export class PrizeShowPanel extends Panel {
})
} else {
console.log('cnmcnmcnmcnm:', this.data)
sendTbNet(TbNetName.showCustomLoading)
const { prizeId, id, type, ename } = this.data
console.log('cnmcnmcnmcnm:', this.data)
const res = await sendTbNet(TbNetName.applyMemberBenefit, { prizeId, id, ename }, null, null, true)
if (res.success) {
this.hidePanel()
await sendTbNet(TbNetName.receiveEnamePrize, { id, drawStatus: 3, receiveMsg: '领取成功' }, null, null)
changeScene(GameOverScene, this.data)
showToast("奖品已为您发放至淘宝卡券~")
} else {
showToast('领取失败,请重试')
this.hidePanel()
changeScene(GameOverScene, this.data)
// showPanel(RewardFailPanel, {
// ...res,
// onCancel: () => {
// changeScene(GameOverScene, this.data)
// }
// })
}
// @ts-ignore
showToast('奖品已为您发放至淘宝卡券~')
this.hidePanel()
changeScene(GameOverScene, this.data)
// showToast('奖品已为您发放至淘宝卡券~')
// this.hidePanel()
// changeScene(GameOverScene, this.data)
}
}, this, 40, 575)
}
......
import { showToast } from "../../module/ctrls";
import { layers } from "../../module/views/layers";
import { Panel } from "../../module/views/Panel";
import { FButton } from "../FUI";
import { getTbData, sendTbNet, TbNetName } from "../TaoBaoNet";
import { throttle } from "../Tools";
import UI from "../UI";
export class RewardFailPanel extends Panel {
mWidth: number = 586
mHeight: number = 500
cancelText: FYGE.TextField
cardTxt: FYGE.TextField
initUi() {
const ModalContainer = UI.Ctn(this, layers.stageCenterX - this.mWidth / 2, layers.stageCenterY - this.mHeight / 2)
UI.Rect(ModalContainer, this.mWidth, this.mHeight, 0xf1ebdc, 30)
UI.Txt(ModalContainer, '领取失败', 40, '#111111', FYGE.TEXT_ALIGN.CENTER, this.mWidth, 0, 60, true)
this.cardTxt = UI.Txt(ModalContainer, '来晚了,已经领完啦,请联系你的\n专属客服咨询', 28, '#111111', FYGE.TEXT_ALIGN.CENTER, this.mWidth, 0, 130)
const btn1 = UI.Fbtn(ModalContainer, 45, 250)
UI.Rect(btn1, 500, 90, 0x111111, 45)
const t = UI.Txt(btn1, '知道了', 30, '#f1ebdb', FYGE.TEXT_ALIGN.CENTER, 500)
t.textHeight = 90
t.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE
btn1.addEventListener(FYGE.MouseEvent.CLICK, this.onCancel, this)
const btn2 = UI.Fbtn(ModalContainer, 45, 365)
btn2.addChild(new FYGE.Shape())
.beginStroke(0x111111, 2)
.drawRoundedRect(0, 0, 500, 90, 45)
.endStroke()
const t2 = this.cancelText = UI.Txt(btn2, '联系客服', 30, '#111111', FYGE.TEXT_ALIGN.CENTER, 500)
t2.textHeight = 90
t2.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE
btn2.addEventListener(FYGE.MouseEvent.CLICK, this.onContact, this)
}
start(data) {
super.start()
//TODO 根据错误信息提示
this.cardTxt.text = `来晚了,已经领完啦,请联系你的\n专属客服咨询`// TODO
this.cardTxt.x = 0
}
onConfirmRevive = throttle(async () => {
let success = await this.data.onJoinTime()
this.hidePanel()
if (success) {
this.data.onRevive()
} else {
this.flag = true
this.data.onCancel()
}
})
// 联系客服
onContact = throttle(async () => {
//TODO 跳转客服地址
sendTbNet(TbNetName.navigateToOutside, { url: "https://market.m.taobao.com/app/sj/shop-membership-center-h5/private-service/index.html?sellerId=" + getApp().sellerId })
})
flag = false
onCancel = () => {
if (this.flag) {
return
}
this.flag = true
this.hidePanel()
this.data.onCancel()
}
}
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