Commit 573469c4 authored by XieChuanJin's avatar XieChuanJin

完成

parent eb251293
{
"type": "activity",
"name": "wzms_shoot_planet"
"name": "wzms_shoot_planet_share"
}
\ No newline at end of file
......@@ -3,48 +3,20 @@
xmlns:w="http://ns.egret.com/wing" xmlns:ns1="*">
<e:Group width="750" height="1624">
<e:Image source="start_bg_jpg" />
<ns1:MButton id="btnStart" label="" y="692.36" horizontalCenter="0.5">
<ns1:MButton id="btnStart" label="" y="912.36" horizontalCenter="0.5">
<ns1:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_start_png" />
</e:Skin>
</ns1:skinName>
</ns1:MButton>
<ns1:MButton id="btnRankList" label="排行榜" y="959" left="243">
<ns1:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_rank_png" />
<e:Label id="labelDisplay" textColor="0xf64f37" size="25" horizontalCenter="0" bottom="-32" />
</e:Skin>
</ns1:skinName>
</ns1:MButton>
<ns1:MButton id="btnRule" label="规则" y="959" right="243">
<ns1:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="btn_rule_png" />
<e:Label id="labelDisplay" textColor="0xf64f37" size="25" horizontalCenter="0" bottom="-32" />
</e:Skin>
</ns1:skinName>
</ns1:MButton>
<e:Label id="labelFreeTime" text="今日剩余次数:3次" y="823" textColor="0x34a371" size="24" horizontalCenter="0" />
<ns1:MButton id="btnReward" label="" x="26" y="36">
<ns1:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_bg_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</ns1:skinName>
</ns1:MButton>
<e:ToggleButton id="toggleMusic" label="" x="665" y="21">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="btn_music_disabled_png" source.down="btn_music_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:ToggleButton>
......
......@@ -42,7 +42,10 @@ class Main extends eui.UILayer {
Net.urlReplace();
MConfigs.updateConfig();
DropBlinkMgr.init();
MBuried.init(MConfigs.appId, NetUtils.getProjectId());
let url = window.location.href;
let projectId = url.split("projectId=")[1].split("&")[0];
MBuried.init(MConfigs.appId, projectId);
//注入自定义的素材解析器
let assetAdapter = new AssetAdapter();
......@@ -68,34 +71,9 @@ class Main extends eui.UILayer {
private async runGame() {
await this.loadResource()
//判断是否是温州用户
GameMgr.instance.isWenzhouUser = this.isWenzhouUser();
this.createGameScene();
}
private isWenzhouUser(): boolean {
let location = new egret.Point();
if (isWeiXin()) {
wx.getLocation({
type: 'wgs84',
success: function (res) {
location.x = res.longitude;
location.y = res.latitude;
},
fail: function () {
location.x = -1;
location.y = -1;
}
})
} else {
location.x = 119;
location.y = 30;
}
return MConst.HangzhouLocation.contains(location.x, location.y);
}
private async loadResource() {
try {
await RES.loadConfig("default.res.json", getResPath() + "resource/");
......@@ -103,10 +81,6 @@ class Main extends eui.UILayer {
await RES.loadGroup("loading");
Loading.instace.show();
await RES.loadGroup("toast_panel");
await RES.loadGroup("game");
await RES.loadGroup("car");
await RES.loadGroup("animation");
await RES.loadGroup("sound");
Loading.instace.hide();
}
catch (e) {
......
......@@ -219,6 +219,8 @@ export namespace MConfigs {
imgUrl: "http://duiba.oss-cn-hangzhou.aliyuncs.com/db_games/activity/zhaohang_bill_2019/share.png",
url: "http://activity-2.m.duiba.com.cn/customShare/share?id=3651"
}
export const toAppUrl = "http://www.baidu.com";
}
......
......@@ -24,160 +24,12 @@ import MBuried from "../Global/MBuried";
@Decorator.ClassName("StartScene")
export default class StartScene extends Scene {
public btnStart: MButton;
public btnRankList: MButton;
public btnRule: MButton;
public labelFreeTime: eui.Label;
public btnReward: MButton;
public toggleMusic: eui.ToggleButton;
onSkinComplete() {
super.onSkinComplete();
this.btnRankList.onTap(this, () => {
if (!GameMgr.instance.isWenzhouUser) {
ToastPanel.show("只限温州地区用户可参与");
return;
}
PanelCtrl.instance.show(RankListPanel, { defaultToggle: 1 });
});
this.btnRule.onTap(this, () => {
PanelCtrl.instance.show(RulePanel);
});
this.btnReward.onTap(this, () => {
if (!GameMgr.instance.isWenzhouUser) {
ToastPanel.show("只限温州地区用户可参与");
return;
}
location.href = MConfigs.rewardRecordUrl;
});
//去掉音乐按钮
this.toggleMusic.visible = false;
/* this.toggleMusic.selected = SoundMgr.instance.enabled;
this.toggleMusic.addEventListener(eui.UIEvent.CHANGE, (evt: eui.UIEvent) => {
if (this.enabledTest() == false) return;
SoundMgr.instance.enabled = (evt.target as eui.ToggleButton).selected;
}, this); */
MBuried.doShowBuried(2);
this.btnStart.onOnceTap(this, (resume) => {
MBuried.doClickBuried(2);
if (GameMgr.instance.allPeriodEnd) {
ToastPanel.show("活动已结束");
resume();
return;
}
if (!GameMgr.instance.isWenzhouUser) {
ToastPanel.show("只限温州地区用户可参与");
resume();
return;
}
let leftTimes = GameMgr.instance.leftTimes;
if (typeof leftTimes == "number") {
if (leftTimes > 0) { //有剩余次数
Net.sendPost(Net.Url.start, undefined, (res) => {
SceneCtrl.instance.change(MainScene, {
startId: res.data.startId,
maxScore: res.data.maxScore
});
}, () => { resume() });
} else { //没有剩余次数
if (GameMgr.instance.leftShareTimes > 0) { //有分享次数
let panel = PanelCtrl.instance.show<SharePanel>(SharePanel);
panel.init({
title: "次数已用完",
content: "分享好友可增加游戏机会哦~",
btnText: "分享好友"
});
panel.context = this;
} else { //没有分享次数
PanelCtrl.instance.show(class extends CommonPanel {
onSkinComplete() {
super.onSkinComplete();
MBuried.doShowBuried(6);
this.btn.onTap(this, () => {
this.hidePanel();
});
}
}, {
title: "今天次数已用完",
content: "明天再来吧~",
btnText: "知道了"
});
}
resume();
}
}
});
this.refreshPage();
if (GameMgr.instance.allPeriodEnd) {
ToastPanel.show("活动已结束");
return;
}
if (!GameMgr.instance.isWenzhouUser) {
ToastPanel.show("只限温州地区用户可参与");
return;
}
}
public async refreshPage() {
let res = await NetUtils.visit().catch(() => {
Loading.instace.show();
});
let leftTimes = res.data.leftTimes;
this.labelFreeTime.text = leftTimes <= 0 ? "今日暂无游戏次数" : `今日剩余次数:${leftTimes}次`;
if (res.data.prevPopUpFlag) {
if (res.data.prevPopUp.prizeId == null) {
PanelCtrl.instance.show<CommonPanel>(class extends CommonPanel {
onSkinComplete() {
super.onSkinComplete();
this.btn.onTap(this, () => this.hidePanel());
}
}).init({
title: "很遗憾",
content: "上期排行榜您未获奖 再接再厉吧~",
btnText: "好的"
})
} else {
PanelCtrl.instance.show<WinningPanel>(WinningPanel).init({
rewardName: res.data.prevPopUp.prizeName,
imgUrl: res.data.prevPopUp.prizeIcon,
rank: res.data.prevPopUp.myIndex
});
}
}
}
}
class SharePanel extends CommonPanel {
context: StartScene = null;
onSkinComplete() {
super.onSkinComplete();
MBuried.doShowBuried(7)
this.btn.onOnceTap(this, (resume) => {
MBuried.doClickBuried(7);
//TODO
// window['share']();
MTimer.set(120, () => {
const timestamp = NetUtils.getTimestamp();
Net.sendPost(Net.Url.share, {
timestamp: timestamp,
token: NetUtils.md5(timestamp + "duiba4icbc")
}, () => {
ToastPanel.show("分享成功");
this.context.refreshPage();
resume();
}, () => { resume(); });
});
MBuried.doShowBuried(8);
this.btnStart.onTap(this, () => {
window.location.href = MConfigs.toAppUrl;
});
}
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>招行感恩</title>
<title>星球大作战</title>
<meta name="viewport"
content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
......@@ -13,83 +13,63 @@
<meta name="360-fullscreen" content="true" />
<script>var __startTime__ = Date.now()</script>
<meta CONTENT="no-cache">
</head>
<body>
<div style="margin: auto;width: 100%;height: 100%;" class="egret-player" data-entry-class="Main"
data-orientation="auto" data-scale-mode="showAll" data-frame-rate="60" data-content-width="750"
data-content-height="1624" data-multi-fingered="2" data-show-fps="false" data-show-log="false"
data-show-fps-style="x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9">
data-content-height="1624" data-multi-fingered="2" data-show-fps="true" data-show-log="false"
data-show-fps-style="x:11111,y:0,size:12,textColor:0xffffff,bgAlpha:0.9">
</div>
<img id="shareImg" />
<style>
html,
body {
-ms-touch-action: none;
touch-action: none;
background: #888888;
background-color: #000;
background-size: 100%;
background-position: bottom;
padding: 0;
border: 0;
overflow: hidden;
margin: 0;
height: 100%;
}
</style>
<!-- 配置 -->
<div id="annieEngine" style="line-height:0;font-size:0;"></div>
<script>
/* var oHead = document.querySelector('body');
var oScript = document.createElement('script');
oScript.type = 'text/javascript';
oScript.src = '//yun.duiba.com.cn/webapp/js/vconsole.min.js';
oHead.appendChild(oScript);
oScript.onload = function () {
var vConsole = new VConsole();
}*/
var mconfig = {
appId: "67890",
//appId: "67883",
share: {
title: "招商银行企业手机银行感恩节送壕礼 ",
desc: "华为手机、佳能相机、索尼游戏机送不停,更有海量话费券,数量有限,先到先得!",
imgUrl: "http://duiba.oss-cn-hangzhou.aliyuncs.com/db_games/activity/zhaohang_bill_2019/share.png",
url: "http://activity-3.m.duiba.com.cn/customShare/share?id=3651"
},
otherUrl: "https://u.ebank.cmbchina.com/CmbBank_MB/UI/Public/TransferPage.aspx?TPParam=fbbank://FunctionJump/http://fbclient/cloudService/%7B%22url%22:%22/UI/Business/CloudService/OpenAndTransferNew.aspx?cortyp=hangzhoujinli%22,%22hideNavbar%22:%22Y%22,%22domainType%22:%22BIZ%22%7D",
rewardUrl: "http://activity.m.duiba.com.cn/projectx/pc41f73e1/f170abd6c.html",
rule:`本活动限杭州分行企业用户参加,奖品数量有限,先到先得!
>活动时间:2019年11月15日-2019年12月31日
>奖品获取方式:您的账单生成后,成功分享至微信或朋友圈后,返回活动页面,即展示所得奖品。
注:若分享成功后,页面展示“奖品紧急补仓中“,请稍后再次点击页面,查看所获奖品;
>本次活动设定有:实物奖品与手机话费奖品。
① 实物奖品
一等奖:华为P30手机若干
二等奖:佳能数码相机若干、索尼游戏机若干
三等奖:始祖鸟休闲包若干
② 手机话费:10元、20元手机话费直充券
>若您获得实物奖品,点击“点击领取”按钮,请填写您的收货信息,您的奖品将由招商银行杭州分行后续按照中奖先后顺序进行邮寄,请您耐心等待并关注快递信息;
>若您获得手机话费,点击“点击领取”按钮,跳转至活动页面“我的奖品“中,点击”去使用“进行话费抽取,抽取后可直接在线充值抵扣。
>单个企业仅可有一次中奖机会,奖品获取后,您可以在活动页中“我的奖品“查看所获奖品明细;
声明:任何通过非法途径获得奖品的行为,主办方将有权不提供奖品。
奖品图片仅供参考,请务必以实物为准。在法律允许范围内,所有解释权归招商银行杭州分行所有。
注:活动仅限杭州、绍兴、嘉兴、湖州、衢州、金华、舟山分行企业用户参加。`
}
</script>
<script>
var resPath = "https://yun.duiba.com.cn/db_games/activity/zhaohang_bill_2019/1574049366/";
function resolve(a) {
var b = eval(a);
return b;
}
</script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script>
window["projectId"] = "p8dc18a47";
window["appId"] = "3";
var adList = [
"130****2437挑战成功,获得一支迪奥436口红",
"133****8365挑战成功,获得8.88元红包",
"188****4629挑战成功,获得一支香奈儿62口红",
"134****0025挑战成功,获得一支圣罗兰409口红",
"130****0140挑战成功,获得6.88元红包口红",
"132****1132挑战成功,获得一支香奈儿58口红",
"152****8872挑战成功,获得十支口红奖励",
"152****8872挑战成功,获得咪咕阅读30天VIP券",
]
//资源路径
var resPath = "https://yun.duiba.com.cn/db_games/activity/shoot_planet_gonghang_share/1572502744/";
var bulletNum = [1, 1, 1];
var timeDownNumArr = [18, 22, 25];
//record
var recordUrl = "/projectx/p8dc18a47/f18069374.html";
</script>
<script crossorigin="anonymous" src="//yun.duiba.com.cn/db_games/lib2_game.min.js"></script>
<script crossorigin="anonymous" src="//yun.duiba.com.cn/db_games/libs/matter_decomp.min.js"></script>
<script crossorigin="anonymous" src="//yun.duiba.com.cn/db_games/libs/zepto_security_downloadApp.min.js"></script>
<script crossorigin="anonymous" src="//yun.duiba.com.cn/db_games/libs/egret.all.js"></script>
<script crossorigin="anonymous"
src="//yun.duiba.com.cn/db_games/activity/zhaohang_bill_2019/1574313691/output.js"></script>
src="//yun.duiba.com.cn/db_games/activity/shoot_planet_gonghang_share/1572502744/output.js"></script>
<script crossorigin="anonymous"
src="//yun.duiba.com.cn/db_games/activity/zhaohang_bill_2019/1574049366/resource/default.thm.js"></script>
src="//yun.duiba.com.cn/db_games/activity/shoot_planet_gonghang_share/1572502744/resource/default.thm.js"></script>
<script>
egret.ImageLoader.crossOrigin = "anonymous";
/**
......@@ -100,6 +80,7 @@
* "calculateCanvasScaleFactor": //a function return canvas scale factor
* }
**/
egret.runEgret({
renderMode: "webgl", audioType: 0, calculateCanvasScaleFactor: function (context) {
var backingStore = context.backingStorePixelRatio ||
......
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