Commit 2903b311 authored by wjf's avatar wjf

l

parent 0eded96c
......@@ -27,6 +27,43 @@
"stock": 200
},
{
"image": "https://img.alicdn.com/imgextra/i2/2275046294/O1CN01c4rCs11wMhRrsjEep_!!2275046294-2-miniprogram.png",
"isBackUp": true,
"properiodto": 10000,
"level": 2,
"probability": "84",
"prizeType": 60,
"updateTime": 1594623032197,
"type": 5,
"properiodfrom": 1601,
"activityId": "5f08084ec3ad3494b9201c0e",
"lockStatus": 1,
"createTime": 1594623032197,
"deleteStatus": 1,
"name": "谢谢参与",
"useStock": 0,
"_id": "5f0c043852bbde91d1ca5682"
},
{
"image": "https://img.alicdn.com/imgextra/i2/2275046294/O1CN01c4rCs11wMhRrsjEep_!!2275046294-2-miniprogram.png",
"isBackUp": true,
"properiodto": 10000,
"level": 2,
"probability": "84",
"prizeType": 60,
"updateTime": 1594623032197,
"type": 5,
"properiodfrom": 1601,
"activityId": "5f08084ec3ad3494b9201c0e",
"lockStatus": 1,
"createTime": 1594623032197,
"deleteStatus": 1,
"name": "谢谢参与",
"useStock": 0,
"_id": "5f0c043852bbde91d1ca5682"
},
{
"image": "https://img.alicdn.com/imgextra/i2/2275046294/O1CN01c4rCs11wMhRrsjEep_!!2275046294-2-miniprogram.png",
"isBackUp": true,
"properiodto": 10000,
"level": 2,
......
......@@ -88,6 +88,7 @@ class Toast extends FYGE.Container {
}
destroy() {
FYGE.Tween.removeTweens(this);
super.destroy();
this.msg = null
this.bg = null;
......
This diff is collapsed.
This diff is collapsed.
......@@ -4,4 +4,19 @@ sendTbNet里 dispatchEvent({ type: "onMessage" }需要放在addEvent之后
taobaomini里的onMessage 里的var app =getApp();
本地缓存方式修改
\ No newline at end of file
本地缓存方式修改
Main里的循环,暂时不去FYGE里的,小程序用传入的canvas的,浏览器用window的
Main的run和pause必须执行了,因为小程序canvas的循环动画帧在页面隐藏后会停止,
//TODO
RES修改成与FYGE独立的贴图缓存,否则FYGE多页面应该会有同名资源覆盖问题
多page上的canvas,存在资源干扰的情况,考虑RES单独缓存,不进TextureCache缓存,createTextureSheet也不缓存进TextureCache
多page上的canvas,destroy最好别执行removeAllTweens,
多page上的canvas,对于相同资源是否考虑,还有公用弹框,(还是不考虑吧,多page只在活动相互独立的情况下使用)
\ No newline at end of file
This diff is collapsed.
......@@ -6,7 +6,7 @@ var fs = require("fs");
// fs.readFileSync("./output.js")
// )
// var endPath = 'D:/duibaGame/测试项目0527/taobaominiTest/client/pages/index1/';
var endPath = 'D:/duibaGame/淘宝项目/babycareXiaoxiaoleTBminiTry/client/pages/index/';
var endPath = 'D:/duibaGame/淘宝项目/taobao_mini/babycare_xiaoxiaole/babycare_c_client/client/pages/index/';
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"));
......
......@@ -13,6 +13,8 @@ import { PlayScene } from "./scene/PlayScene";
import { LoadingScene } from "./scene/LoadingScene";
import { JoinPanel } from "./panels/JoinPanel";
import { NoStepPanel } from "./panels/NoStepPanel";
import { NoPrizePanel } from "./panels/NoPrizePanel";
import { LotteryScene } from "./scene/LotteryScene";
/**
* 全局事件,为了和小程序交互
......@@ -86,13 +88,12 @@ export class Main {
//隐藏加载中
// if (document.getElementById("__loading__")) document.getElementById("__loading__").style.display = "none";
//打开开始场景
// changeScene(MapScene);
changeScene(LoadingScene);
// changeScene(SStartScene);
// changeScene(StoryScene);
// changeScene(AdoptScene);
// console.log("恶趣味去")
// showPanel(NoStepPanel)
// showPanel(NoPrizePanel)
//测试
// sendTbNet(TbNetName.aaa, {}, (s, res) => {
// console.log(res)
......
This diff is collapsed.
import { Panel } from "../../module/views/Panel";
import { RES } from "../../module/RES";
export class NoPrizePanel extends Panel {
get groupNames(){return ["NoPrizePanel"]}
initUi() {
this.addChild(new FYGE.Sprite(RES.getRes("noPrizeBg.png")))
this.addChild(new FYGE.Button(RES.getRes("关闭按钮.png")))
.addEventListener(FYGE.MouseEvent.CLICK, this.hidePanel, this)
.position.set(633,468);
this.addChild(new FYGE.Button(RES.getRes("知道了.png")))
.addEventListener(FYGE.MouseEvent.CLICK, this.hidePanel, this)
.position.set(165,759);
}
}
\ No newline at end of file
......@@ -220,7 +220,7 @@ class CusButton extends Button {
case TaskType.browseGoods:
sendTbNet(
TbNetName.navigateTo,
{ url: '/pages/collectGoods/collectGoods' },//TODO,路径
{ url: '/pages/browseProductList/browseProductList' },
() => { },
true
);
......
......@@ -9,6 +9,7 @@ import { layers } from "../../module/views/layers";
import { GTool } from "../../module/tools/GTool";
import { Lottie } from "../Lottie";
import { loading_animal } from "../lotties/loading_animal";
import { LotteryScene } from "./LotteryScene";
export class LoadingScene extends Scene {
get groupNames() {
......@@ -144,7 +145,8 @@ export class LoadingScene extends Scene {
.call(() => {
if (pro >= 1) {
this.removeEventListener(FYGE.Event.PROGRESS, this.progressEvent, this);
changeScene(MapScene, { from: "loading" })
// changeScene(MapScene, { from: "loading" })
changeScene(LotteryScene,{level:1});
}
})
// this.lastP=p
......
import { Scene } from "../../module/views/Scene";
import { RES } from "../../module/RES";
import { layers } from "../../module/views/layers";
import { Tools } from "../Tools";
import { showWaiting } from "../../module/ctrls";
import { sendTbNet, TbNetName } from "../TaoBaoNet";
/**
* 摇奖机弹框
*/
export class LotteryScene extends Scene {
get groupNames() { return ["lotteryScene"] }
data: {
level: number,
}
initUi() {
//适配
this.y = -layers.stageOffsetY;
//背景
this.addChild(new FYGE.Sprite(RES.getRes("lotteryMachineBg.jpg")))
//计算下一关的关数
let upLevel: number = 120;
let dLevel: number = 120;
Tools.baseInfo.prizeLevels.forEach((value, index) => {
const d: number = value - this.data.level;
if (this.data.level <= value && d >= 0 && d <= dLevel) {
upLevel = value;
dLevel = d + 1;
}
});
//标题文案
this.addChild(Tools.getText(
this.data.level + "关抽奖奖励",
53.19,
"#ffffff",
FYGE.TEXT_ALIGN.CENTER,
488,
(750 - 488) / 2,
360
)).bold = true;
//下一次抽奖文案
this.addChild(Tools.getText(
"下一奖励关卡:" + upLevel + "关",
32.54,
"#ffffff",
FYGE.TEXT_ALIGN.CENTER,
488,
(750 - 488) / 2,
360
))
//抽奖按钮
this.addChild(new FYGE.Button(RES.getRes("lotteryBtn.png")))
.addEventListener(FYGE.MouseEvent.CLICK, this.lottery, this)
.position.set((750 - RES.getRes("lotteryBtn.png").width) / 2, 797);
//刷新奖品列表和摇奖列表
this.updatePrizes();
}
async updatePrizes() {
showWaiting();
const { data: prizeList } = await sendTbNet(TbNetName.getPrizesByLevel, { level: this.data.level });
//滚动列表
console.log(prizeList)
var scroll = this.addChild(new FYGE.ScrollList(PrizeItem, 122, 140, 345, 152, false))
scroll.position.set(195, 1013);
scroll.updateData(prizeList || [])
//摇奖部分
}
lottery() {
}
}
interface PrizeInt {
image: string,
name: string,
_id: string
}
class PrizeItem extends FYGE.Container implements FYGE.IScrollListItem {
private prizeImage: FYGE.Sprite;
private nameTxt: FYGE.TextField;
constructor() {
super();
this.addChild(new FYGE.Sprite(RES.getRes("prizeItemBg.png")))
this.prizeImage = this.addChild(new FYGE.Sprite());
this.prizeImage.width = this.prizeImage.height = 101;
this.prizeImage.position.set(4, 4);
//名字
this.nameTxt = this.addChild(Tools.getText(
"",
19.23,
"#317f7f",
FYGE.TEXT_ALIGN.CENTER,
109,
0, 112
))
}
initData(id: number, data: PrizeInt) {
if (id < 0 || !data) return;
this.prizeImage.texture = FYGE.Texture.from(data.image);
this.nameTxt.text = data.name;
}
id;
data: number;
}
class LotteryItem extends FYGE.Container {
private showImage: FYGE.Sprite;
private cusPosition: number;
constructor(tex?: FYGE.Texture) {
super();
this.addChild(new FYGE.Sprite(RES.getRes("lotteryItemBg.png")));
this.showImage = this.addChild(new FYGE.Sprite(tex));
this.showImage.width = this.showImage.height = 88;
this.showImage.position.set((103 - 88) / 2, 6);
}
changeShowImage(tex: FYGE.Texture) {
this.showImage.texture = tex;
}
}
/**
* 滚动条
* 功能可以滚动到指定的图
*/
class LotteryScroll extends FYGE.Container {
private currentIndex: number;
constructor(textures: FYGE.Texture[]) {
super();
textures.forEach((t, i) => {
this.addChild(new LotteryItem(t))
.position.set(0, i * 123)
})
//修改位置
this.addEventListener(FYGE.Event.ENTER_FRAME, () => {
this.children.forEach((c) => {
// if () { }
})
}, this)
}
scrollTo(index: number, time: number, callback: () => void) {
}
reset() {
}
updatePosition() {
this.children.forEach((c) => {
// if () { }
})
}
}
\ No newline at end of file
......@@ -50,10 +50,14 @@ export default class MapUI extends Container {
console.log('规则');
showPanel(RulePanel);
break;
case this.myPrizeBtn:
/// TODO 我的奖品
console.log('我的奖品');
sendTbNet(
TbNetName.navigateTo,
{ url: '/pages/myPrize/myPrize' },
() => { },
true
);
break;
case this.prizeBox:
......@@ -183,12 +187,9 @@ class CreditsBox extends Container {
const creditsData = await sendTbNet(TbNetName.queryCredits, {}, () => {
}, true);
let jfLabel = '积分:0';
if (!creditsData || !creditsData.data) {
jfLabel = '积分:0';
} else {
if (creditsData.success && creditsData.data && creditsData.data.credits) {
jfLabel = `积分:${creditsData.data.credits}`;
}
this.countLabel.text = jfLabel;
}
}
......
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