Commit 9bb65f02 authored by wildfirecode's avatar wildfirecode

1

parents 717ed2b5 70c865fa
......@@ -33,7 +33,7 @@ export default class Utils {
* @param num 数字
* @param length 位数
*/
prefixInteger(num, length) {
public static prefixInteger(num, length) {
return (Array(length).join('0') + num).slice(-length);
}
}
\ No newline at end of file
......@@ -19,6 +19,7 @@ import { loadSvga } from "../loadSvga";
import getResPath from "../../libs/new_tc/getResPath";
import CountDown from "./CountDown";
import AvatarComp from "./AvatarComp";
import Utils from "../Utils";
export default class MapScene extends Scene {
......@@ -34,7 +35,7 @@ export default class MapScene extends Scene {
sendInvite(){
const dojoin = DataManager.ins.getData('hc_doJoin');
if(!dojoin)return;
NetManager.ins.doHelp(()=>{},1,dojoin.data);
NetManager.ins.doHelp(()=>{},Utils.getRequestByKey("shareCode"),dojoin.data);
}
// 邀请有礼角标倒计时
......@@ -462,16 +463,12 @@ export default class MapScene extends Scene {
let sec = ~~((time - hour * 3600000 - min * 60000) / 1000); // 秒
return {
hour: this.prefixInteger(hour, 2),
min: this.prefixInteger(min, 2),
sec: this.prefixInteger(sec, 2)
hour: Utils.prefixInteger(hour, 2),
min: Utils.prefixInteger(min, 2),
sec: Utils.prefixInteger(sec, 2)
}
}
// 截取数字补0
prefixInteger(num, length) {
return (Array(length).join('0') + num).slice(-length);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
onTap_friendBtn() {
......
......@@ -3,6 +3,7 @@ import { changeMapScene } from "../startScene/StartScene";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
import getHomeData from "../getHomeData";
import { ModuleTypes } from "../../libs/new_wx/types/sceneTypes";
import Utils from "../Utils";
/**
* 邀请规则面板
......@@ -69,16 +70,12 @@ export default class InviteCutTimePanel extends Panel {
let sec = ~~((time - hour * 3600000 - min * 60000) / 1000); // 秒
return {
hour: this.prefixInteger(hour, 2),
min: this.prefixInteger(min, 2),
sec: this.prefixInteger(sec, 2)
hour: Utils.prefixInteger(hour, 2),
min: Utils.prefixInteger(min, 2),
sec: Utils.prefixInteger(sec, 2)
}
}
prefixInteger(num, length) {
return (Array(length).join('0') + num).slice(-length);
}
protected get closeBtns(): eui.Button[] {
return [this['closeBtn']]
}
......
......@@ -3,6 +3,7 @@ import { iswx } from "../iswx";
import getSkinPath from "../../libs/new_wx/utils/getSkinPath";
import InviteRulePanel from "./InviteRulePanel";
import { NetManager } from "../../libs/tw/manager/NetManager";
import Utils from "../Utils";
export default class InvitePanel extends Panel {
public prizeImg: eui.Image;
......@@ -114,16 +115,12 @@ export default class InvitePanel extends Panel {
let sec = ~~((time - hour * 3600000 - min * 60000) / 1000); // 秒
return {
hour: this.prefixInteger(hour, 2),
min: this.prefixInteger(min, 2),
sec: this.prefixInteger(sec, 2)
hour: Utils.prefixInteger(hour, 2),
min: Utils.prefixInteger(min, 2),
sec: Utils.prefixInteger(sec, 2)
}
}
prefixInteger(num, length) {
return (Array(length).join('0') + num).slice(-length);
}
private setWXShareTip() {
this.wxShareTip.visible = false;
this.wxShareTip.width = this.width / window.innerWidth * window.innerWidth;
......
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