Commit b2e8d66b authored by wildfirecode's avatar wildfirecode

1

parent eedf494c
......@@ -48,7 +48,7 @@
<script src="libs/pad-zeropadding.js"></script>
<img id="pic" style="width:100%;position: absolute;z-index: 999;display: none;" />
<script>
// localStorage.clear();
localStorage.clear();
window['total_level'] = 18 + 13 * 4;
window['last_level'] = 69;//必须大于等于total_level
......
......@@ -86,7 +86,7 @@
},
{
"name": "preload",
"keys": "signicon_blood_png,signprize_numsbg_png,singprize体力_png,signprize元宝_png"
"keys": "signicon_blood_png,signprize_numsbg_png,singprize体力_png,signprize元宝_png,signicon6_png"
}
],
"resources": [
......@@ -1854,6 +1854,11 @@
"name": "signprize元宝_png",
"type": "image",
"url": "assets/signprize/signprize元宝.png"
},
{
"name": "signicon6_png",
"type": "image",
"url": "assets/sign/signicon6.png"
}
]
}
\ No newline at end of file
......@@ -11,9 +11,9 @@
<e:Image id="hammer" source="signicon3_png" x="96" y="53.23" visible="false"/>
<e:Image id="boom" source="signicon4_png" x="103" y="55" visible="false"/>
<e:Image id="steps" source="signicon5_png" x="104" y="57" visible="false"/>
<e:Image id="blood" x="98.04" y="60.35" source="signicon_blood_png"/>
<e:Image id="random" x="98.73" y="58.38" source="signicon_blood_png"/>
<e:Button id="btn1" label="" x="364" y="65" visible="false">
<e:Image id="blood" x="98.04" y="60.35" source="signicon_blood_png" visible="false"/>
<e:Image id="random" x="98.73" y="50.4" source="signicon6_png"/>
<e:Button id="btn1" label="" x="364" y="65">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="signbtn1_png" source.down="signbtn1_png" source.disabled="signbtn1_png"/>
......
......@@ -2,10 +2,10 @@
<e:Skin class="SignPrizeSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="16d5c2563cb"/>
<e:Image source="singprizebg_png" y="20" horizontalCenter="0"/>
<e:Image id="img0" y="297" touchEnabled="true" source="{data.img}" width="512" height="240" scaleX="1" scaleY="1" horizontalCenter="0" visible="false"/>
<e:Image id="img" y="297" touchEnabled="true" source="{data.img}" width="512" height="240" scaleX="1" scaleY="1" horizontalCenter="0" visible="false"/>
<e:Image id="money" source="signprize元宝_png" y="234.88" horizontalCenter="0" visible="false"/>
<e:Image id="blood" source="singprize体力_png" y="233.8" horizontalCenter="0"/>
<e:Group id="numsgroup" x="400.38" y="282.24" visible="false">
<e:Group id="numsgroup" x="400.38" y="282.24">
<e:Image id="numsbg" source="signprize_numsbg_png" x="0" y="0"/>
<e:Label id="nums" text="X8" size="22" horizontalCenter="0" verticalCenter="0" verticalAlign="middle" textAlign="center"/>
</e:Group>
......
......@@ -13,6 +13,9 @@ export default class SignItem extends eui.ItemRenderer {
this['hammer'].visible=false;
this['boom'].visible=false;
this['steps'].visible=false;
this['blood'].visible=false;
this['random'].visible=false;
this['btn1'].visible=false;
this['btn2'].visible=false;
this['btn3'].visible=false;
......@@ -24,6 +27,8 @@ export default class SignItem extends eui.ItemRenderer {
this['title'].text = `第${this.data.index+1}天`;
this['amount'].text = this.data.config.nums;
if(this.data.config.nums<=0)
this['amount'].text = '';
this[this.data.config.type].visible=true;
this['btn'+this.data.btn].visible=true;
......
......@@ -6,14 +6,7 @@ import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import { updateMainTimer } from "../../libs/new_wx/MainBase";
import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import wait from "../../libs/new_tc/wait";
// export const getSignInfo = ()=> {
// return new Promise((r) => {
// NetManager.ins.getSignInfo(() => {
// r();
// }, window['signActivityId']);
// })
// }
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
export default class SignPanel extends Panel {
......@@ -22,19 +15,8 @@ export default class SignPanel extends Panel {
async start(data) {
super.start();
// console.log(DataManager.ins.getData('getSignInfo'))
const { signInfoVO } = DataManager.ins.getData('getSignInfo');
// for (let i = 1; i <= 7; i++) {
// if (i <= signInfoVO.continueDay)
// this.view['mask' + i].visible = true;
// }
// this.view.signBtn.visible = !signInfoVO.todaySigned;
// this.view.signBtn2.visible = signInfoVO.todaySigned;
// //如果今天签到过了
// if (signInfoVO.todaySigned)
// this.setGray();
let todayIndex = signInfoVO.continueDay - 1;
if (!signInfoVO.todaySigned) {
todayIndex = signInfoVO.continueDay;
......@@ -55,13 +37,14 @@ export default class SignPanel extends Panel {
{ nums: 4, type: 'boom' },
{ nums: 5, type: 'steps' },
{ nums: 6, type: 'blood' }, //体力
{ nums: 7, type: 'random' } //随机
{ nums: '随机奖励', type: 'random' } //随机
];
const func = (data,item:SignItem) => {
NetManager.ins.doSign((s)=>{
if(s) {
item.setSinged();
showToast('签到成功!快去闯关吧~');
// showToast('签到成功!快去闯关吧~');
PanelCtrl.instance.show('signPrize');
wait(200).then(()=>{
NetManager.ins.hc_home(() => {
updateMainTimer();
......
import wait from "../../libs/new_tc/wait";
import Panel from "../../libs/new_wx/components/Panel";
import { DataManager } from "../../libs/tw/manager/DataManager";
import { NetManager } from "../../libs/tw/manager/NetManager";
import getShowOffPic from "../getShowOffPic";
import { iswx } from "../iswx";
import { getlogItem } from "../Main";
import setGray from "../setGray";
import { showShare } from "../shareCtrl";
import { changeMapScene } from "../startScene/StartScene";
export default class SignPrizePanel extends Panel {
_level;
start(data) {
super.start();
//体力,元宝,道具,大牌券
setGray(this['pica']);
setGray(this['picb']);
setGray(this['picc']);
this._level = parseInt(data.level + '');
const submitdata = DataManager.ins.getData('hc_submit').data;
this['tips'].text = `${submitdata.prizeResponse.changeMoney}元宝`;
this['shareBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(15));
if (iswx()) {
getShowOffPic(this.stage, this);
} else
showShare(2);
}, this);
this['money'].visible=false;
this['blood'].visible=false;
this['numsgroup'].visible=false;
//奖品类型,none无奖励, object实物,virtual虚拟商品,coupon券,道具prop,元宝coin,体力times,
const {customInfo} =DataManager.ins.getData(['dosign']);
const prizeType= customInfo.prizeType ;
if(customInfo.itemId)
this['img'].source = `http://yun.duiba.com.cn/db_games/0916/${customInfo.itemId}.png`;
this['goBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
this.hidePanel();
if (this._level + 1 <= window['total_level'])
changeMapScene({ level: this._level + 1 });
else
changeMapScene();
}, this);
this['nums'].text ='x'+ customInfo.prizeCount;
this.showlog();
NetManager.ins.hc_home(() => { }, window['collectRuleId']);
const hc_submitData = DataManager.ins.getData('hc_submit').data;
this.setStar(hc_submitData.stars);
this['img'].visible = prizeType!= 'times' && prizeType!= 'coin';
this['numsgroup'].visible = customInfo.prizeCount;
this['money'].visible = prizeType=='coin';
this['blood'].visible = prizeType=='times';
}
showlog() {
NetManager.ins.showLog(getlogItem(15));
}
async setStar(nums: number) {
this['pic1'].visible = this['pic2'].visible = this['pic3'].visible = false;
this['light'].visible = false;
await wait(500);
if (nums == 1) {
this['pic1'].visible = true;
await this.playAni1();
}
if (nums == 2) {
this['pic1'].visible = true;
await this.playAni1();
this['pic2'].visible = true;
await this.playAni2();
}
if (nums == 3) {
this['pic1'].visible = true;
await this.playAni1();
this['pic2'].visible = true;
await this.playAni2();
this['pic3'].visible = true;
await this.playAni3();
}
if (nums >= 1) {
this['light'].visible = true;
egret.Tween.get(this['light']).set({ scaleX: 0, scaleY: 0, alpha: 0, }).to({ scaleX: 1, scaleY: 1, alpha: 1 }, 300).call(() => {
egret.Tween.get(this['light'], { loop: true }).to({ rotation: 360 }, 3000);
});
}
}
async playAni1() {
return new Promise(r => {
egret.Tween.get(this['pic1']).set({ scaleX: 0, scaleY: 0 }).to({ scaleX: 1, scaleY: 1 }, 400, egret.Ease.getBackOut(1)).call(r)
})
}
async playAni2() {
return new Promise(r => {
egret.Tween.get(this['pic2']).set({ scaleX: 0, scaleY: 0 }).to({ scaleX: 1, scaleY: 1 }, 400, egret.Ease.getBackOut(1)).call(r)
})
}
async playAni3() {
return new Promise(r => {
egret.Tween.get(this['pic3']).set({ scaleX: 0, scaleY: 0 }).to({ scaleX: -1, scaleY: 1 }, 400, egret.Ease.getBackOut(1)).call(r)
})
}
destroy() {
super.destroy();
egret.Tween.removeTweens(this['light']);
}
onTouchTap_closeBtn(): any {
super.onTouchTap_closeBtn();
changeMapScene();
}
get picBigWidth() { return 510 };
get bigPicRatio() { return 640 / 300 }
useBtn: eui.Button;
get skinKey() { return 'SignPrize' }
protected get closeBtns(): eui.Button[] { return [this['closeBtn']] }
protected get closeBtns(): eui.Button[] { return [this['closeBtn'],this['close2Btn']] }
}
\ No newline at end of file
{
"signInfoVO": {
"acmDay": 1,
"acmDays": 1,
"activityCount": 0,
"activityCountTomorrow": 0,
"continueDay": 1,
"credits": 11,
"creditsTomorrow": 12,
"cusCirDays": 31,
"firstSignDate": 1557902703000,
"hasAcmReward": false,
"lastDays": 1,
"maxContinueDay": 1,
"monthResignedMap": {},
"monthSignedMap": {
"2019-05-15": true
},
"prizeChance": 0,
"prizeChanceTomorrow": 0,
"redCount": 0,
"redCountTomorrow": 0,
"resignCount": -1,
"rewardMap": {
"CONTINUE": {
"activityCount": 0,
"credits": 11,
"rwType": "CONTINUE"
}
},
"todaySigned": true,
"totalCredits": 0
},
"success": true,
"logId": 99003235848145,
"customInfo1": {
"count": 1,
"propsType": "ADD_100"
},
"customInfo": {
"itemUrl": "//activity.m.duibadev.com.cn/activity/takePrizeNew?recordId=30033656",
"orderNum": "989045616311520016",
"prizeName": "zyj测试商品",
"prizeType": "object",
"propsType": "COUPON_2",
"smallImage": "//yun.dui88.com/images/201901/5p8g3g5juc.jpg"
}
}
\ No newline at end of file
{
"signInfoVO": {
"acmDay": 1,
"acmDays": 1,
"activityCount": 0,
"activityCountTomorrow": 0,
"continueDay": 1,
"credits": 11,
"creditsTomorrow": 12,
"cusCirDays": 31,
"firstSignDate": 1557902703000,
"hasAcmReward": false,
"lastDays": 1,
"maxContinueDay": 1,
"monthResignedMap": {},
"monthSignedMap": {
"2019-05-15": true
},
"prizeChance": 0,
"prizeChanceTomorrow": 0,
"redCount": 0,
"redCountTomorrow": 0,
"resignCount": -1,
"rewardMap": {
"CONTINUE": {
"activityCount": 0,
"credits": 11,
"rwType": "CONTINUE"
}
},
"todaySigned": true,
"totalCredits": 0
},
"success": true,
"logId": 99003235848145,
"customInfo1": {
"count": 1,
"propsType": "ADD_100"
},
"customInfo": {
"itemUrl": "//activity.m.duibadev.com.cn/activity/takePrizeNew?recordId=30033656",
"orderNum": "989045616311520016",
"prizeName": "zyj测试商品",
"prizeType": "object",
"propsType": "COUPON_2",
"smallImage": "//yun.dui88.com/images/201901/5p8g3g5juc.jpg"
"customInfo":{
"success":true,
"errorMsg":null,
"code":"000000",
"prizeType":"",
"prizeName":"奖品名称",
"logo":"奖品图片",
"prizeCount":10,
"itemId":59521
}
}
\ No newline at end of file
{
"success": true,
"signInfoVO": {
"continueDay": 7,
"todaySigned": 1
"continueDay": 1,
"todaySigned": 0
}
}
\ No newline at end of file
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