Commit 4875fcbf authored by 邱旭's avatar 邱旭

1

parent 96ed04f1
...@@ -2107,6 +2107,11 @@ export class NetManager extends ABNetManager { ...@@ -2107,6 +2107,11 @@ export class NetManager extends ABNetManager {
this.send(net); this.send(net);
} }
/**
* 获取邀请码
* @param callback
* @param scratchCardTaskId 刮刮卡任务id
*/
public scratchGetShareCode(callback: Function, scratchCardTaskId): void { public scratchGetShareCode(callback: Function, scratchCardTaskId): void {
const net: INetData = { const net: INetData = {
name: NetName.SCRATCH_GET_SHARECODE, name: NetName.SCRATCH_GET_SHARECODE,
...@@ -2123,6 +2128,11 @@ export class NetManager extends ABNetManager { ...@@ -2123,6 +2128,11 @@ export class NetManager extends ABNetManager {
this.send(net); this.send(net);
} }
/**
* 助力
* @param callback
* @param shareCode 分享码
*/
public scratchDoHelp(callback: Function, shareCode): void { public scratchDoHelp(callback: Function, shareCode): void {
const net: INetData = { const net: INetData = {
name: NetName.SCRATCH_DOHELP, name: NetName.SCRATCH_DOHELP,
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
</e:skinName> </e:skinName>
</e:Button> </e:Button>
<e:Label id="cutTimeLabel" text="将在23:43:21后失效" y="895.33" size="28" textColor="0xffffff" horizontalCenter="0.5"/> <e:Label id="cutTimeLabel" text="将在23:43:21后失效" y="895.33" size="28" textColor="0xffffff" horizontalCenter="0.5"/>
<e:Label text="帮刮\n记录" y="805" size="28" textColor="0xFFFFFF" horizontalCenter="-248"/>
<e:Scroller width="487" height="90" y="783" anchorOffsetX="0" anchorOffsetY="0" horizontalCenter="32.5"> <e:Scroller width="487" height="90" y="783" anchorOffsetX="0" anchorOffsetY="0" horizontalCenter="32.5">
<e:Group anchorOffsetX="0" y="2"> <e:Group anchorOffsetX="0" y="2">
<e:List id="list" x="0" y="0" anchorOffsetX="0"> <e:List id="list" x="0" y="0" anchorOffsetX="0">
......
...@@ -32,16 +32,21 @@ export default class Turntable extends Panel { ...@@ -32,16 +32,21 @@ export default class Turntable extends Panel {
super(); super();
this.data = data; this.data = data;
} }
hand; hand;
async start(data?) { async start(data?) {
super.start(); super.start();
console.log(data.onceAgain) console.log(data.onceAgain)
this['container'].addChild(this.data.mv); this['container'].addChild(this.data.mv);
this.hand = await loadSvga(getResPath() + 'resource/assets/svgas/hand.svga', this['container2']) this.hand = await loadSvga(getResPath() + 'resource/assets/svgas/hand.svga', this['container2'])
this['container2'].touchEnabled=false; this['container2'].touchEnabled = false;
this['container2'].touchChildren=false; this['container2'].touchChildren = false;
this.initUI();
} }
rulebtn; rulebtn;
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
this["closeBtn"].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this); this["closeBtn"].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this);
...@@ -66,6 +71,7 @@ export default class Turntable extends Panel { ...@@ -66,6 +71,7 @@ export default class Turntable extends Panel {
onTapRulebtn() { onTapRulebtn() {
PanelCtrl.instance.show('TurnRulePanel') PanelCtrl.instance.show('TurnRulePanel')
} }
onTapStart() { onTapStart() {
// this.setBtnTouch(false); // 锁定按钮 // this.setBtnTouch(false); // 锁定按钮
// Loading.instace.show(); // Loading.instace.show();
...@@ -77,11 +83,11 @@ export default class Turntable extends Panel { ...@@ -77,11 +83,11 @@ export default class Turntable extends Panel {
this.updateIcon(); this.updateIcon();
loadSvga(getResPath() + 'resource/assets/svgas/turnprize.svga').then(async (mv: any) => { loadSvga(getResPath() + 'resource/assets/svgas/turnprize.svga').then(async (mv: any) => {
// await wait(100); // await wait(100);
PanelCtrl.instance.show('TurnPrize2Panel', {mv:mv }); PanelCtrl.instance.show('TurnPrize2Panel', {mv: mv});
}); });
} }
updateIcon(){ updateIcon() {
GDispatcher.dispatchEvent("updateScratchTips"); GDispatcher.dispatchEvent("updateScratchTips");
} }
...@@ -158,16 +164,11 @@ export default class Turntable extends Panel { ...@@ -158,16 +164,11 @@ export default class Turntable extends Panel {
*/ */
private rotate(rotation: number, time: number, callFun: Function) { private rotate(rotation: number, time: number, callFun: Function) {
let tw = egret.Tween.get(this.panel); let tw = egret.Tween.get(this.panel);
tw.to({ rotation: rotation }, time, egret.Ease.cubicInOut).wait(500).call(callFun); tw.to({rotation: rotation}, time, egret.Ease.cubicInOut).wait(500).call(callFun);
} }
protected onSkinComplete(): void { protected onSkinComplete(): void {
super.onSkinComplete(); super.onSkinComplete();
this.onLoad();
}
protected onLoad(): void {
this.initUI();
} }
private initUI(): void { private initUI(): void {
...@@ -180,14 +181,14 @@ export default class Turntable extends Panel { ...@@ -180,14 +181,14 @@ export default class Turntable extends Panel {
} }
private panelEffect() { private panelEffect() {
egret.Tween.get(this.panel).to({ rotation: 360 }, 20000).call(() => { egret.Tween.get(this.panel).to({rotation: 360}, 20000).call(() => {
this.panelEffect(); this.panelEffect();
}); });
} }
protected async preLoadRes() { protected async preLoadRes() {
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
resolve(); resolve();
}); });
} }
...@@ -196,22 +197,57 @@ export default class Turntable extends Panel { ...@@ -196,22 +197,57 @@ export default class Turntable extends Panel {
* 获得所有奖品信息 * 获得所有奖品信息
*/ */
private getPrizeInfo() { private getPrizeInfo() {
/////////////////////////////////////////// 查询奖品加入转盘数据 /////////////////////////////////////////// NetManager.ins.hc_turnableBaseInfo((success, res) => {
// let data = DataManager.ins.ajaxElementData.options; if(!success) {
// let options = Utils.deepClone(data); return;
// for(let i = 0; i < options.length; i++) { }
// let v = options[i]; let prizeList = Utils.deepClone(res.data.prizeList);
// if(v.scoreArea == "1,1") { prizeList.push({
// options.splice(i--, 1); categoryType: 'thanks',
// } }, {
// } categoryType: 'scratch',
// for(let i = 0; i < options.length; i++) { });
// let v = options[i]; for(let i = 0; i < prizeList.length; i++) {
// RotaryData.key.push(v.id); let v = prizeList[i];
// RotaryData.data[v.id] = [{start: i * 40 - 15, end: i * 40 + 15}]; let prizeImg = "";
// this[`img${i}`].source = v.logo; switch(v.categoryType) {
// this[`lab${i}`].text = v.name; case "scratch":
// } prizeImg = "//yun.duiba.com.cn/developer/img/activityTool/slotMachine/object.png";
break;
case "thanks":
prizeImg = "//yun.duiba.com.cn/upload/uP99F1462438316972.png";
break;
case 1:
prizeImg = "//yun.duiba.com.cn/developer/img/activityTool/slotMachine/alipay.png";
break;
case 2:
prizeImg = "//yun.duiba.com.cn/developer/img/activityTool/slotMachine/qb.png";
break;
case 3:
prizeImg = "//yun.duiba.com.cn/developer/img/activityTool/slotMachine/phonebill.png";
break;
case 4:
prizeImg = "//yun.duiba.com.cn/developer/img/activityTool/slotMachine/object.png";
break;
case 5:
prizeImg = "//yun.duiba.com.cn/developer/img/activityTool/slotMachine/alipay.png";
break;
case 6:
prizeImg = "//yun.duiba.com.cn/developer/img/activityTool/slotMachine/qb.png";
break;
case 7:
prizeImg = "//yun.duiba.com.cn/developer/img/activityTool/slotMachine/phonebill.png";
break;
default:
break;
}
v.prizeImg = prizeImg;
RotaryData.key.push(v.categoryType);
RotaryData.data[v.categoryType] = [{start: i * 60 - 20, end: i * 60 + 20}];
this[`img${i}`].source = v.prizeImg;
}
});
console.log(RotaryData); console.log(RotaryData);
} }
} }
\ No newline at end of file
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
}, },
{ {
"appItemId":2099, "appItemId":2099,
"categoryType":7, "categoryType":6,
"img":"虚拟商品图片", "img":"虚拟商品图片",
"name":"虚拟商品名称", "name":"虚拟商品名称",
"rate":"30", "rate":"30",
...@@ -30,7 +30,14 @@ ...@@ -30,7 +30,14 @@
"propType":2, "propType":2,
"rate":"30", "rate":"30",
"title":"奖品信息" "title":"奖品信息"
} },
{
"categoryType":8,
"num":10,
"propType":2,
"rate":"30",
"title":"奖品信息"
},
] ]
}, },
"remainTimes":1, "remainTimes":1,
......
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