Commit a4693fa2 authored by wjf's avatar wjf

l

parent f9cbf6be
...@@ -63,6 +63,15 @@ ...@@ -63,6 +63,15 @@
<script src="libs/fileSave.js"></script> <script src="libs/fileSave.js"></script>
<img id="pic" style="width:100%;position: absolute;z-index: 999;display: none;" /> <img id="pic" style="width:100%;position: absolute;z-index: 999;display: none;" />
<script> <script>
//分享口令复制文案头部
window["shareCodeHead"]="复制口令";
//分享口令文案后部
window["shareCodeEnds"]=[
"打开苏宁易购App,一起消消消消消!",//快去请好友助力加体力吧
"打开苏宁APP快来和我一起玩游戏",//排行榜分享好友,不用了
"我正在苏宁易购APP领现金,快来助我一臂之力",//刮刮卡分享
"打开苏宁易购App,玩赚钱消消乐,迈出人生巅峰第一步!"//邀请有礼
];
window.fresp = 0.00001; window.fresp = 0.00001;
// localStorage.clear(); // localStorage.clear();
window['testUrl'] = 'http://cuxiaoprexg.m.cnsuning.com/scms/cx521.html?activityId=SL446689024459878400&subactivityId=SUB446689681678090240&businessid=cx521'; window['testUrl'] = 'http://cuxiaoprexg.m.cnsuning.com/scms/cx521.html?activityId=SL446689024459878400&subactivityId=SUB446689681678090240&businessid=cx521';
......
...@@ -5,6 +5,7 @@ class Layers extends eui.UILayer { ...@@ -5,6 +5,7 @@ class Layers extends eui.UILayer {
private _bottomLayer: egret.Sprite; private _bottomLayer: egret.Sprite;
private _toastLayer: egret.Sprite; private _toastLayer: egret.Sprite;
private _shareLayer: egret.Sprite; private _shareLayer: egret.Sprite;
private _shareCodeLayer: egret.Sprite;
init(root: eui.UILayer) { init(root: eui.UILayer) {
root.addChild(this); root.addChild(this);
this._topLayer = new egret.Sprite(); this._topLayer = new egret.Sprite();
...@@ -14,12 +15,14 @@ class Layers extends eui.UILayer { ...@@ -14,12 +15,14 @@ class Layers extends eui.UILayer {
this._bottomLayer = new egret.Sprite(); this._bottomLayer = new egret.Sprite();
this._toastLayer = new egret.Sprite(); this._toastLayer = new egret.Sprite();
this._shareLayer = new egret.Sprite(); this._shareLayer = new egret.Sprite();
this._shareCodeLayer = new egret.Sprite();
this.addChild(this._bottomLayer); this.addChild(this._bottomLayer);
this.addChild(this._sceneLayer); this.addChild(this._sceneLayer);
this.addChild(this._popupLayer); this.addChild(this._popupLayer);//弹框
this.addChild(this._topLayer); this.addChild(this._topLayer);//loading所在的层级
this.addChild(this._shareLayer);//toast和share替换下层级 this.addChild(this._shareCodeLayer);//0224新加,因为需要在弹框上弹出,而原先的shareLayer在shareCtrl3还要用
this.addChild(this._toastLayer); this.addChild(this._toastLayer);//toast
this.addChild(this._shareLayer);//分享层,目前就排行榜的还在用
} }
// _bg: egret.Bitmap; // _bg: egret.Bitmap;
...@@ -34,7 +37,7 @@ class Layers extends eui.UILayer { ...@@ -34,7 +37,7 @@ class Layers extends eui.UILayer {
// this._bg = null; // this._bg = null;
// }) // })
// } // }
get shareCodeLayer() { return this._shareCodeLayer }
get shareLayer() { return this._shareLayer } get shareLayer() { return this._shareLayer }
get topLayer() { return this._topLayer } get topLayer() { return this._topLayer }
get popupLayer() { return this._popupLayer } get popupLayer() { return this._popupLayer }
......
...@@ -233,7 +233,7 @@ ...@@ -233,7 +233,7 @@
"name": "backindex" "name": "backindex"
}, },
{ {
"keys": "lijiqianwang_png,copyCodeBg_png,shareWxpyqIcon_png,shareWxIcon_png,shareQqIcon_png,shareWeiboIcon_png", "keys": "lijiqianwang_png,copyCodeBg_png,shareWxpyqIcon_png,shareWxIcon_png,shareQqIcon_png,shareWeiboIcon_png,zhantiegeihaoyou_png",
"name": "sharecodepanel" "name": "sharecodepanel"
} }
], ],
...@@ -4537,6 +4537,11 @@ ...@@ -4537,6 +4537,11 @@
"url": "assets/shareCodePanel/shareWxpyqIcon.png", "url": "assets/shareCodePanel/shareWxpyqIcon.png",
"type": "image", "type": "image",
"name": "shareWxpyqIcon_png" "name": "shareWxpyqIcon_png"
},
{
"url": "assets/shareCodePanel/zhantiegeihaoyou.png",
"type": "image",
"name": "zhantiegeihaoyou_png"
} }
] ]
} }
\ No newline at end of file
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<e:Rect width="750" height="1624" fillAlpha="0.7"/> <e:Rect width="750" height="1624" fillAlpha="0.7"/>
<e:Image y="294" source="copyCodeBg_png" horizontalCenter="0.5"/> <e:Image y="294" source="copyCodeBg_png" horizontalCenter="0.5"/>
<e:Label id="msg" text="" lineSpacing="10" size="32" multiline="true" y="613" textColor="0xf54500" fontFamily="FZY4JW" horizontalCenter="3.5" textAlign="center"/> <e:Label id="msg" text="" lineSpacing="10" size="32" multiline="true" y="613" textColor="0xf54500" fontFamily="FZY4JW" horizontalCenter="3.5" textAlign="center"/>
<e:Image id="goBtn" y="682" source="lijiqianwang_png" horizontalCenter="0"/> <e:Image id="goBtn" y="682" horizontalCenter="0" source="zhantiegeihaoyou_png"/>
<e:Button id="closeBtn" label="" x="625" y="291"> <e:Button id="closeBtn" label="" x="625" y="291">
<e:skinName> <e:skinName>
<e:Skin states="up,down,disabled"> <e:Skin states="up,down,disabled">
......
...@@ -63,26 +63,30 @@ export default class MapScene extends Scene { ...@@ -63,26 +63,30 @@ export default class MapScene extends Scene {
if (window["test0228"]) {//测试助力,到时失败code再和后端对接 if (window["test0228"]) {//测试助力,到时失败code再和后端对接
NetManager.ins.doHelpNew((s, res) => { NetManager.ins.doHelpNew((s, res) => {
if (s) { if (s) {
showToast("助力成功!") NetManager.ins.showLog(getlogItem(83))
showToast("助力成功!一起闯关赢现金吧")
} }
else if (res) { else if (res) {
if (res.code == "0000") { if (res.code == "0000") {//code再和后端对接
} else if (res.code == "00001") { } showToast("已经给好友助力过了哦~")
} else if (res.code == "00001") { //code再和后端对接
showToast("今日助力次数已达上限啦!")
} else { showToast("助力失败") }
} else { } else {
showToast("助力失败") showToast("助力失败")
} }
}, code) }, code)
} else { } else {
showToast("欢迎加入游戏,去闯关吧"); showToast("欢迎小主,闯关就能拿现金~");
} }
} }
else if (sceneCode == CodeChannels.RankPlay) {//排行榜邀请好友的, else if (sceneCode == CodeChannels.RankPlay) {//排行榜邀请好友的,不需要了
showToast("欢迎加入游戏,去闯关吧"); showToast("欢迎加入游戏,去闯关吧");
}//剩下的就是邀请有礼和刮刮卡了,本身code上有区分 }//剩下的就是邀请有礼和刮刮卡了,本身code上有区分
else if (code.indexOf("12345678") == -1) { // 邀请有礼 else if (code.indexOf("12345678") == -1) { // 邀请有礼
const dojoin = DataManager.ins.getData('hc_doJoin'); const dojoin = DataManager.ins.getData('hc_doJoin');
if (!dojoin) { if (!dojoin) {
showToast("立即闯关赢现金!") showToast("开启消除之旅")
return; return;
} }
NetManager.ins.doHelp((success, res) => { NetManager.ins.doHelp((success, res) => {
...@@ -126,7 +130,7 @@ export default class MapScene extends Scene { ...@@ -126,7 +130,7 @@ export default class MapScene extends Scene {
if (!success) { if (!success) {
return; return;
} }
showToast("帮刮成功!"); showToast("助力成功,参与闯关赢现金"/*"帮刮成功!"*/);
NetManager.ins.showLog(getlogItem(52)); NetManager.ins.showLog(getlogItem(52));
NetManager.ins.showLog(getlogItem(36)); NetManager.ins.showLog(getlogItem(36));
}, _code); }, _code);
......
...@@ -157,11 +157,19 @@ export default class BloodPanel extends Panel { ...@@ -157,11 +157,19 @@ export default class BloodPanel extends Panel {
if (!s) { if (!s) {
showToast("获取分享信息失败,请重试") showToast("获取分享信息失败,请重试")
} else { } else {
showShareCodePanel(CodeChannels.AddBlood, res.data) showShareCodePanel(
CodeChannels.AddBlood,
res.data,
() => { wait(2000).then(() => { showToast('分享成功'); }); }
)
} }
}) })
} else { } else {
showShareCodePanel(CodeChannels.AddBlood, DataManager.ins.getData("getUserShareCode").data); showShareCodePanel(
CodeChannels.AddBlood,
DataManager.ins.getData("getUserShareCode").data,
() => { wait(2000).then(() => { showToast('分享成功'); }); }
);
} }
} else { } else {
showShareCodePanel(CodeChannels.AddBlood, null, () => { showShareCodePanel(CodeChannels.AddBlood, null, () => {
...@@ -177,7 +185,7 @@ export default class BloodPanel extends Panel { ...@@ -177,7 +185,7 @@ export default class BloodPanel extends Panel {
SceneCtrl.instance.updateScene(); SceneCtrl.instance.updateScene();
}, window['collectRuleId']); }, window['collectRuleId']);
wait(2000).then(() => { wait(2000).then(() => {
showToast('分享成功~'); showToast('分享成功');
}); });
}) })
} }
......
...@@ -155,11 +155,19 @@ export default class BloodPanel2 extends Panel { ...@@ -155,11 +155,19 @@ export default class BloodPanel2 extends Panel {
if (!s) { if (!s) {
showToast("获取分享信息失败,请重试") showToast("获取分享信息失败,请重试")
} else { } else {
showShareCodePanel(CodeChannels.AddBlood, res.data) showShareCodePanel(
CodeChannels.AddBlood,
res.data,
() => { wait(2000).then(() => { showToast('分享成功'); }); }
)
} }
}) })
} else { } else {
showShareCodePanel(CodeChannels.AddBlood, DataManager.ins.getData("getUserShareCode").data); showShareCodePanel(
CodeChannels.AddBlood,
DataManager.ins.getData("getUserShareCode").data,
() => { wait(2000).then(() => { showToast('分享成功'); }); }
);
} }
} else { } else {
showShareCodePanel(CodeChannels.AddBlood, null, () => { showShareCodePanel(CodeChannels.AddBlood, null, () => {
...@@ -175,7 +183,7 @@ export default class BloodPanel2 extends Panel { ...@@ -175,7 +183,7 @@ export default class BloodPanel2 extends Panel {
SceneCtrl.instance.updateScene(); SceneCtrl.instance.updateScene();
}, window['collectRuleId']); }, window['collectRuleId']);
wait(2000).then(() => { wait(2000).then(() => {
showToast('分享成功~'); showToast('分享成功');
}); });
}) })
} }
......
...@@ -93,8 +93,8 @@ export default class FriendPanel extends Panel { ...@@ -93,8 +93,8 @@ export default class FriendPanel extends Panel {
if (iswx()) { if (iswx()) {
getFriendShareUrl(this.stage); getFriendShareUrl(this.stage);
} else } else
// showShare3(); showShare3();
showShareCodePanel(CodeChannels.RankPlay); // showShareCodePanel(CodeChannels.RankPlay);//mmp,排行榜的分享又不要口令了
} }
protected get closeBtns(): eui.Button[] { return [this['closeBtn']] } protected get closeBtns(): eui.Button[] { return [this['closeBtn']] }
......
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl"; import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import ComponentBase from "../../libs/new_wx/components/ComponentBase"; import ComponentBase from "../../libs/new_wx/components/ComponentBase";
import layers from "../../libs/new_wx/views/layers"; import layers from "../../libs/new_wx/views/layers";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { getlogItem } from "../Main";
export enum CodeChannels { export enum CodeChannels {
/** /**
...@@ -8,7 +10,7 @@ export enum CodeChannels { ...@@ -8,7 +10,7 @@ export enum CodeChannels {
*/ */
AddBlood = "0", AddBlood = "0",
/** /**
* 个人中心排行榜邀请好友一起玩 * 个人中心排行榜邀请好友一起玩,不用了
*/ */
RankPlay = "1", RankPlay = "1",
/** /**
...@@ -20,18 +22,29 @@ export enum CodeChannels { ...@@ -20,18 +22,29 @@ export enum CodeChannels {
*/ */
InvitePrize = "3" InvitePrize = "3"
} }
//口令文案
const shareMsg = { const shareMsg = {
"0": "打开苏宁APP快来和我一起玩游戏",//打开苏宁APP帮我助力赢体力 "0": "打开苏宁易购App,一起消消消消消!",//打开苏宁APP帮我助力赢体力
"1": "打开苏宁APP快来和我一起玩游戏", "1": "打开苏宁APP快来和我一起玩游戏",
"2": "打开苏宁APP帮我刮卡赢现金", "2": "我正在苏宁易购APP领现金,快来助我一臂之力~",
"3": "打开苏宁APP帮我闯一关赢现金" "3": "打开苏宁易购App,玩赚钱消消乐,迈出人生巅峰第一步!"
} }
//弹框文案
const panelMsg = { const panelMsg = {
"0": "快去分享好友加体力吧",//快去请好友助力加体力吧 "0": "邀请好友助力加体力",//快去请好友助力加体力吧
"1": "快去分享好友一起玩吧", "1": "快去分享好友一起玩吧",
"2": "快去邀请好友帮你刮卡", "2": "邀请好友助力领现金",
"3": "快去邀请好友闯关赢现金" "3": "邀请好友闯关领现金"
} }
//四个埋点号
const buridNums = {
"0": 78,
"1": null,//不用了
"2": 80,
"3": 81
}
interface ShareData { interface ShareData {
channel: CodeChannels, channel: CodeChannels,
shareCode?: string,//0224期加体力和排行榜分享好友没有分享码 shareCode?: string,//0224期加体力和排行榜分享好友没有分享码
...@@ -131,13 +144,28 @@ class ShareCodePanel extends ComponentBase { ...@@ -131,13 +144,28 @@ class ShareCodePanel extends ComponentBase {
} }
onTouchGoBtn() { onTouchGoBtn() {
//跳转 this.goBtn.touchEnabled = false;
jumpFun[this.mark]() //点击埋点
NetManager.ins.clickLog(getlogItem(buridNums[this.data.channel]))
//有回调执行 //有回调执行
this.data.addFun && this.data.addFun(); if (this.data.addFun) {
this.data.addFun();
//跳转,考虑到要发接口,0228版本就没有接口要发了,可以只保留点击埋点延时1秒
setTimeout(() => {
this.goBtn.touchEnabled = true;
jumpFun[this.mark]()
}, 2000)
} else {
//跳转,考虑到要发接口
setTimeout(() => {
this.goBtn.touchEnabled = true;
jumpFun[this.mark]()
}, 1000)
}
} }
onTouchClickBg() { onTouchClickBg() {
layers.shareLayer.visible = false; layers.shareCodeLayer.visible = false;
//关闭后要置null,因为不同渠道进来要获取不同的code //关闭后要置null,因为不同渠道进来要获取不同的code
this.code = null this.code = null
} }
...@@ -167,14 +195,21 @@ class ShareCodePanel extends ComponentBase { ...@@ -167,14 +195,21 @@ class ShareCodePanel extends ComponentBase {
} }
private copyCodeOpr() { private copyCodeOpr() {
copyPassword((ss) => { copyPassword(
(ss) => {
this.enableMouseEvent(true) this.enableMouseEvent(true)
if (ss) { if (ss) {
this.panelGroup.visible = true; this.panelGroup.visible = true;
//曝光埋点
NetManager.ins.showLog(getlogItem(buridNums[this.data.channel]))
} else { } else {
showToast("口令生成失败,请重试") showToast("口令生成失败,请重试")
} }
}, "复制口令" + this.code + shareMsg[this.data.channel]) },
(window["shareCodeHead"] || "复制口令") +
this.code +
(window["shareCodeEnds"][this.data.channel] || shareMsg[this.data.channel])
)
} }
private enableMouseEvent(b: boolean) { private enableMouseEvent(b: boolean) {
...@@ -200,7 +235,7 @@ class ShareCodePanel extends ComponentBase { ...@@ -200,7 +235,7 @@ class ShareCodePanel extends ComponentBase {
let inited = false; let inited = false;
let _share: ShareCodePanel; let _share: ShareCodePanel;
const initShare = () => { const initShare = () => {
const layer = layers.shareLayer; const layer = layers.shareCodeLayer;
const share = new ShareCodePanel(); const share = new ShareCodePanel();
share.loadSkin(); share.loadSkin();
layer.addChild(share); layer.addChild(share);
...@@ -213,7 +248,7 @@ export const showShareCodePanel = (channel: CodeChannels, shareCode?: string, ad ...@@ -213,7 +248,7 @@ export const showShareCodePanel = (channel: CodeChannels, shareCode?: string, ad
inited = true; inited = true;
} }
_share.setData({ channel, shareCode, addFun }); _share.setData({ channel, shareCode, addFun });
layers.shareLayer.visible = true; layers.shareCodeLayer.visible = true;
} }
......
...@@ -128,11 +128,19 @@ export default class StartPanel extends Panel { ...@@ -128,11 +128,19 @@ export default class StartPanel extends Panel {
if (!s) { if (!s) {
showToast("获取分享信息失败,请重试") showToast("获取分享信息失败,请重试")
} else { } else {
showShareCodePanel(CodeChannels.AddBlood, res.data) showShareCodePanel(
CodeChannels.AddBlood,
res.data,
() => { wait(2000).then(() => { showToast('分享成功'); }); }
)
} }
}) })
} else { } else {
showShareCodePanel(CodeChannels.AddBlood, DataManager.ins.getData("getUserShareCode").data); showShareCodePanel(
CodeChannels.AddBlood,
DataManager.ins.getData("getUserShareCode").data,
() => { wait(2000).then(() => { showToast('分享成功'); }); }
);
} }
} else { } else {
showShareCodePanel(CodeChannels.AddBlood, null, () => { showShareCodePanel(CodeChannels.AddBlood, null, () => {
...@@ -141,7 +149,7 @@ export default class StartPanel extends Panel { ...@@ -141,7 +149,7 @@ export default class StartPanel extends Panel {
SceneCtrl.instance.updateScene(); SceneCtrl.instance.updateScene();
}, window['collectRuleId']); }, window['collectRuleId']);
wait(2000).then(() => { wait(2000).then(() => {
showToast('分享成功~'); showToast('分享成功');
}); });
}) })
}); });
......
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