Commit f7d5ecd8 authored by wjf's avatar wjf

l

parent 73a07ec1
...@@ -57,6 +57,8 @@ ...@@ -57,6 +57,8 @@
<script src="libs/svga.egret.min2.js"></script> <script src="libs/svga.egret.min2.js"></script>
<script src="libs/aes.js"></script> <script src="libs/aes.js"></script>
<script src="libs/pad-zeropadding.js"></script> <script src="libs/pad-zeropadding.js"></script>
<!-- 复制口令苏宁提供的js,线上需要添加 -->
<script src="https://yun.dui88.com/DS-tech/dtt_tech/suning/snShare.min.js"></script>
<!-- //线上不需要 --> <!-- //线上不需要 -->
<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;"/>
......
...@@ -231,6 +231,10 @@ ...@@ -231,6 +231,10 @@
{ {
"keys": "backindex_png", "keys": "backindex_png",
"name": "backindex" "name": "backindex"
},
{
"keys": "lijiqianwang_png,copyCodeBg_png",
"name": "sharecodepanel"
} }
], ],
"resources": [ "resources": [
...@@ -4488,6 +4492,16 @@ ...@@ -4488,6 +4492,16 @@
"url": "assets/map/iconnow.png", "url": "assets/map/iconnow.png",
"type": "image", "type": "image",
"name": "iconnow_png" "name": "iconnow_png"
},
{
"url": "assets/shareCodePanel/copyCodeBg.png",
"type": "image",
"name": "copyCodeBg_png"
},
{
"url": "assets/shareCodePanel/lijiqianwang.png",
"type": "image",
"name": "lijiqianwang_png"
} }
] ]
} }
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="ShareCodePanelSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="16cd6d4c8ff"/>
<e:Rect width="750" height="1624" fillAlpha="0.7"/>
<e:Group id="pic1" y="46" horizontalCenter="0">
<e:Image source="share3_jpg" y="0" x="0"/>
</e:Group>
<e:Group id="inviteGroup" x="0" bottom="0">
<e:Image source="朋友圈中间分享蒙层1_jpg" y="0" x="0"/>
<e:Group y="66" x="261">
<e:Button id="btn1" label="" x="0" y="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="share_btn1_png" source.down="share_btn1_png" source.disabled="share_btn1_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="btn2" label="" x="152">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="share_btn2_png" source.down="share_btn2_png" source.disabled="share_btn2_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
</e:Group>
</e:Group>
</e:Skin>
\ No newline at end of file
import { NetManager } from "../libs/tw/manager/NetManager";
// &snactCode&sceneCode&token
export enum CodeChannels {
/**
* 分享加体力
*/
AddBlood = "0",
/**
* 个人中心排行榜邀请好友一起玩
*/
RankPlay = "1",
/**
* 刮刮卡邀请
*/
Scratch = "2",
/**
* 邀请有礼
*/
InvitePrize = "3"
}
/**
* 生成口令
* @param channel
* @param shareCode 分享加体力暂时没有分享码(27号版本要加上),排行榜邀请一起玩也没有分享码,默认传0
*/
export function generateCode(callback: Function, channel: CodeChannels, shareCode: string = "0") {
var activityCode = getParamString("snactCode") || "ACT0000002863";
var sceneCode = channel;
var token = shareCode;
window['$'].ajax({
type: "post",
url: "https://gameapi.suning.com/sngame-web/api/getShareGameInfo.do",
dataType: "json",
data: {
activityCode,
sceneCode,
token
},
async: true,
success: (result) => {
callback(true, result)
},
error: (message) => {
callback(false, message)
}
});
}
/**
* 复制口令
*/
export function copyPassword(code: string, callback: Function) {
window["snShare"].passwordShare({
ele: '#kouling',
txt: code + "",
success: function (e) {
callback(true, e);
// console.log(e,e.text)
// alert('复制口令内容:'+e.text,function(){window.location.href='weixin://';});
},
error: function (e) {
callback(false, e);
// console.log(e)
// alert('复制失败')
}
})
}
/**
* 唤起微信客户端
*/
export function linkWx() {
var locatUrl = "weixin://";
if (/ipad|iphone|mac/i.test(navigator.userAgent)) {
var ifr = document.createElement("iframe");
ifr.src = locatUrl;
ifr.style.display = "none";
document.body.appendChild(ifr);
} else {
window.location.href = locatUrl;
}
}
/**
* 唤起微信朋友圈
* 暂未实现
*/
export function linkWxpyq() {
}
/**
* 获取链接字段信息
* @param name 字段名
*/
function getParamString(name) {
var paramUrl = window.location.search.substr(1);
var paramStrs = paramUrl.split('&');
var params = {};
for (var index = 0; index < paramStrs.length; index++) {
params[paramStrs[index].split('=')[0]] = decodeURIComponent(paramStrs[index].split('=')[1]);
}
return params[name];
}
import Panel from "../../libs/new_wx/components/Panel";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { getlogItem } from "../Main";
export class ShareCodePanel extends Panel {
public closeBtn: eui.Button;
public btn: eui.Image;
public inviteGroup: eui.Group;
start(data) {
super.start();
this.data = data;
this.inviteGroup.bottom = this.stage.stageHeight - this.height
}
public onTouchTap_closeBtn() {
super.onTouchTap_closeBtn();
}
initEvents() {
super.initEvents();
this.btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchBtn, this);
}
onTouchBtn() {
}
removeEvents() {
super.removeEvents();
this.btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchBtn, this);
}
get skinKey() {
return 'ShareCodePanel'
}
}
\ 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