Commit 9be9ce40 authored by wjf's avatar wjf

l

parent 766f0cf3
......@@ -2415,4 +2415,23 @@ export class NetManager extends ABNetManager {
};
this.send(net);
}
/**
* 查询邀请用户列表
* @param callback
*/
public getInvitedUserList(callback: Function) {
const net: INetData = {
name: "getInvitedUserList",
uri: window['duiba'] + '/activtySimpleShareCode/getInvitedUserList',
type: 'get',
dataType: 'json',
hideMsg: true,
param: {
activityId: DataManager.ins.customCfgData.actId,
count: 10
},
callback: callback
};
this.send(net);
}
}
\ No newline at end of file
......@@ -17,11 +17,16 @@ import { showShareCodePanel, CodeChannels } from "./ShareCodePanel";
import { DataManager } from "../../libs/tw/manager/DataManager";
export default class BloodPanel extends Panel {
//修改,暂时只能根据接口获取
private askForEnergyCount: number = 0
start(data) {
super.start();
this.updateData();
this.showlog();
//获取下邀请人数,
NetManager.ins.getInvitedUserList((s, res) => { if (s) this.askForEnergyCount = res.data.count })
this['price1Txt'].text = `${window['price1']}个元宝=1个体力值`;
this['resumeBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
gotoNextLevel();
......@@ -44,8 +49,8 @@ export default class BloodPanel extends Panel {
const homeData = getHomeData();
this['bloodTxt'].text = `你的可用体力值为:${homeData.remainEnargy}`;
const data = getHomeData();
this['invitTxt'].text = `(已领${data.askForEnergy}/${BloodPanel.MAX})`;
if (data.askForEnergy >= BloodPanel.MAX) {
this['invitTxt'].text = `(已领${this.askForEnergyCount /*data.askForEnergy*/}/${BloodPanel.MAX})`;
if (this.askForEnergyCount/*data.askForEnergy*/ >= BloodPanel.MAX) {
this['inviteBtn2'].visible = true;
}
if (data.remainEnargy >= BLOOD_NUMS_MAX) { //满了
......@@ -127,7 +132,7 @@ export default class BloodPanel extends Panel {
if (iswx()) {
//微信流程不变
getShareUrl(this.stage);
if (data.askForEnergy >= BloodPanel.MAX) {
if (this.askForEnergyCount/*data.askForEnergy*/ >= BloodPanel.MAX) {
showToast('对不起,索要体力的机会已经用完了~');
return;
}
......
......@@ -16,13 +16,16 @@ import { showShareCodePanel, CodeChannels } from "./ShareCodePanel";
import { DataManager } from "../../libs/tw/manager/DataManager";
export default class BloodPanel2 extends Panel {
//修改,暂时只能根据接口获取
private askForEnergyCount: number = 0
start(data) {
super.start();
this.updateData();
this.showlog();
this['price1Txt'].text = `${window['price1']}个元宝=1个体力值`;
//获取下邀请人数,
NetManager.ins.getInvitedUserList((s, res) => { if (s) this.askForEnergyCount = res.data.count })
}
showlog() {
......@@ -39,8 +42,8 @@ export default class BloodPanel2 extends Panel {
const homeData = getHomeData();
this['bloodTxt'].text = `你的可用体力值为:${homeData.remainEnargy}`;
const data = getHomeData();
this['invitTxt'].text = `(已领${data.askForEnergy}/${BloodPanel.MAX})`;
if (data.askForEnergy >= BloodPanel.MAX) {
this['invitTxt'].text = `(已领${this.askForEnergyCount/*data.askForEnergy*/}/${BloodPanel.MAX})`;
if (this.askForEnergyCount/*data.askForEnergy*/ >= BloodPanel.MAX) {
this['inviteBtn2'].visible = true;
}
if (data.remainEnargy >= BLOOD_NUMS_MAX) { //满了
......@@ -124,7 +127,7 @@ export default class BloodPanel2 extends Panel {
if (iswx()) {
getShareUrl(this.stage);
//原先微信流程不变
if (data.askForEnergy >= BloodPanel.MAX) {
if (this.askForEnergyCount/*data.askForEnergy*/ >= BloodPanel.MAX) {
showToast('对不起,索要体力的机会已经用完了~');
return;
}
......
......@@ -31,7 +31,8 @@ export default class StartPanel extends Panel {
showlog() {
}
//修改,暂时只能根据接口获取
private askForEnergyCount: number = 0
start(data) {
this.showlog()
super.start();
......@@ -40,6 +41,9 @@ export default class StartPanel extends Panel {
this['price4'].text = `-${window['price4']}元宝`;
const homedata = getHomeData();
//获取下邀请人数,
NetManager.ins.getInvitedUserList((s, res) => { if (s) this.askForEnergyCount = res.data.count })
if (data > homedata.levels.length) {
addAdComp(84, 901, this, 29);
NetManager.ins.showLog(getlogItem(29));
......@@ -85,25 +89,71 @@ export default class StartPanel extends Panel {
this['startBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this);
}
// onTap_startBtn() {
// const homeData = getHomeData();
// if (homeData.remainEnargy <= 0) {
// if (homeData.askForEnergy) {
// PanelCtrl.instance.show('blood2Panel');
// } else {
// if (iswx()) {
// getShareUrl(this.stage);
// } else
// showShare(1);
// NetManager.ins.hc_askForEnergy((success) => {
// NetManager.ins.hc_home(() => {
// SceneCtrl.instance.updateScene();
// }, window['collectRuleId']);
// wait(2000).then(() => {
// showToast('分享成功~');
// });
// })
// }
// return;
// }
// // Loading.instace.show();
// this.touchChildren = false;
// this.touchEnabled = false;
// // try {
// // if (window['getRST']) window['getRST']();
// // } catch (error) {
// // console.warn(error)
// // }
// hdGameDoDojoin(async (success) => {
// // Loading.instace.hide();
// this.touchChildren = true;
// this.touchEnabled = true;
// wait(5000).then(() => {
// updateMainTimerAfterGetData();
// });
// if (success) {
// // Loading.instace.show();
// this.hidePanel();
// try {
// const key = 'main2';
// await Promise.all([
// RES.getResAsync(`${key}_json`),
// RES.getResAsync(`${key}_png`)]);
// } catch (error) {
// }
// // Loading.instace.hide();
// SceneCtrl.instance.change(ModuleTypes.MAIN_SCENE, { chapter: this._level });
// StartPanel.currlevel = this._level
// }
// }, this._level);
// }
onTap_startBtn() {
const homeData = getHomeData();
if (homeData.remainEnargy <= 0) {
if (homeData.askForEnergy) {
if (/*homeData.askForEnergy*/this.askForEnergyCount) {
PanelCtrl.instance.show('blood2Panel');
} else {
// if(iswx()) {
// getShareUrl(this.stage);
// } else
// showShare(1);
// NetManager.ins.hc_askForEnergy((success) => {
// NetManager.ins.hc_home(() => {
// SceneCtrl.instance.updateScene();
// }, window['collectRuleId']);
// wait(2000).then(() => {
// showToast('分享成功~');
// });
// })
//0224修改,微信环境不变
if (iswx()) {
getShareUrl(this.stage);
NetManager.ins.hc_askForEnergy((success) => {
......
const path = require('path');
const config = {
'/activtySimpleShareCode/getInvitedUserList': {
data: './happyclear/getInvitedUserList.json'
},
'/crecord/getrecord': {
data: './happyclear/getrecord.json'
},
......
{
"success":true,
"code":"",
"desc":"",
"data":{
"count":5,
"userList":[
{
"consumerId":123,
"nickname":"小明",
"avatar":"//yun.duiba.com.cn/duibaManagerWeb/i6pouxupj0.png"
},
{
"consumerId":456,
"nickname":"小黄",
"avatar":"//yun.duiba.com.cn/duibaManagerWeb/i6pouxupj0.png"
},
{
"consumerId":123,
"nickname":"小明",
"avatar":"//yun.duiba.com.cn/duibaManagerWeb/i6pouxupj0.png"
}
]
}
}
\ 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