Commit 8fb9fb12 authored by wildfirecode's avatar wildfirecode

1

parent 0ccf3ac4
...@@ -40,61 +40,61 @@ ...@@ -40,61 +40,61 @@
</head> </head>
<body> <body>
<div style="margin: auto;width: 100%;height: 100%;" class="egret-player" data-entry-class="Main" <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-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="true" data-content-height="1624" data-multi-fingered="2" data-show-fps="false" data-show-log="true"
data-show-fps-style="x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9"> data-show-fps-style="x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9">
</div> </div>
<script src="libs/modules/egret/egret.js"></script> <script src="libs/modules/egret/egret.js"></script>
<script src="libs/modules/egret/egret.web.js"></script> <script src="libs/modules/egret/egret.web.js"></script>
<script src="libs/modules/eui/eui.js"></script> <script src="libs/modules/eui/eui.js"></script>
<script src="libs/modules/assetsmanager/assetsmanager.js"></script> <script src="libs/modules/assetsmanager/assetsmanager.js"></script>
<script src="libs/modules/tween/tween.js"></script> <script src="libs/modules/tween/tween.js"></script>
<script src="libs/zepto.min.js"></script> <script src="libs/zepto.min.js"></script>
<script src="libs/security.js"></script> <script src="libs/security.js"></script>
<script src="libs/downloadApp.js"></script> <script src="libs/downloadApp.js"></script>
<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,线上需要添加 --> <!-- 复制口令苏宁提供的js,线上需要添加 -->
<script src="https://yun.dui88.com/DS-tech/dtt_tech/suning/snShare.min.js"></script> <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;" />
<script> <script>
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';
window['hbRainTime'] = 30; // 红包雨倒计时 window['hbRainTime'] = 30; // 红包雨倒计时
window['plugs'] = [1, 2, 3]; window['plugs'] = [1, 2, 3];
// localStorage.clear(); // localStorage.clear();
window['isInvitePage'] = 0; window['isInvitePage'] = 0;
var targetUrl = 'https://gameact.suning.com/sngame-web/api/duiba/private/v1/getLoginUrl.do?appCode=duiba&activityCode=3651404'; var targetUrl = 'https://gameact.suning.com/sngame-web/api/duiba/private/v1/getLoginUrl.do?appCode=duiba&activityCode=3651404';
/* /*
* 邀请有礼分享 * 邀请有礼分享
*/ */
function inviteShare(shareCode) { function inviteShare(shareCode) {
let title = "求求你可以帮我点一下吗?还差一点点就可以领红包了~"; let title = "求求你可以帮我点一下吗?还差一点点就可以领红包了~";
let content = "我在狮狮连萌等你,一起天天领福利哦"; let content = "我在狮狮连萌等你,一起天天领福利哦";
let targetUrl = "https://gameact.suning.com/duiba/customShare/share?id=3531" + "&shareCode=" + shareCode; // 待修改 let targetUrl = "https://gameact.suning.com/duiba/customShare/share?id=3531" + "&shareCode=" + shareCode; // 待修改
let iconUrl = "http://yun.duiba.com.cn/db_games/xiaoxiaole2.jpg"; let iconUrl = "http://yun.duiba.com.cn/db_games/xiaoxiaole2.jpg";
let shareWays = "1,2"; let shareWays = "1,2";
console.log("AppReady"); console.log("AppReady");
if (isIphone()) { if (isIphone()) {
console.log("IOS"); console.log("IOS");
console.log(window.SNNativeClient); console.log(window.SNNativeClient);
window.callNativeShareResult = function () { window.callNativeShareResult = function () {
}; };
window.SNNativeClient.callNativeShare(title, content, targetUrl, iconUrl, shareWays); window.SNNativeClient.callNativeShare(title, content, targetUrl, iconUrl, shareWays);
} else { } else {
console.log("安卓"); console.log("安卓");
console.log(shareApi); console.log(shareApi);
console.log(shareApi.callMediaShare); console.log(shareApi.callMediaShare);
shareApi.callNativeShare(title, content, targetUrl, iconUrl, shareWays); shareApi.callNativeShare(title, content, targetUrl, iconUrl, shareWays);
}
} }
}
function isIphone() { function isIphone() {
var ua = navigator.userAgent.toLocaleLowerCase(); var ua = navigator.userAgent.toLocaleLowerCase();
if (ua.match(/iphone|ipad/)) { if (ua.match(/iphone|ipad/)) {
...@@ -209,8 +209,10 @@ ...@@ -209,8 +209,10 @@
<script src="output.js"></script> <script src="output.js"></script>
<script> <script>
const SAUP = () => { window['SAUP'] = {
sendLogData: (click,p) => {
console.log('发送买点',p.sapmodid,p.eleid)
}
} }
</script> </script>
</body> </body>
......
...@@ -10,6 +10,8 @@ import { IExposureData } from '../data/common/IExposureData'; ...@@ -10,6 +10,8 @@ import { IExposureData } from '../data/common/IExposureData';
import { GDispatcher } from '../../tc/util/GDispatcher'; import { GDispatcher } from '../../tc/util/GDispatcher';
import onNotSuccess from '../../new_wx/onNotSuccess'; import onNotSuccess from '../../new_wx/onNotSuccess';
import { showToast } from '../../new_wx/ctrls/toastCtrl'; import { showToast } from '../../new_wx/ctrls/toastCtrl';
import SAUP_sendLogData from '../../../src/SAUP_sendLogData';
import SAMap from '../../../src/SAMap';
// import { IExposureData } from '..'; // import { IExposureData } from '..';
...@@ -17,7 +19,7 @@ export class NetManager extends ABNetManager { ...@@ -17,7 +19,7 @@ export class NetManager extends ABNetManager {
private static instance: NetManager; private static instance: NetManager;
public static get ins(): NetManager { public static get ins(): NetManager {
if(!this.instance) { if (!this.instance) {
this.instance = new NetManager(); this.instance = new NetManager();
} }
return this.instance; return this.instance;
...@@ -27,7 +29,7 @@ export class NetManager extends ABNetManager { ...@@ -27,7 +29,7 @@ export class NetManager extends ABNetManager {
constructor() { constructor() {
super(); super();
if(this.isInit) { if (this.isInit) {
throw Error(TwLang.lang_001); throw Error(TwLang.lang_001);
} }
this.isInit = true; this.isInit = true;
...@@ -98,7 +100,7 @@ export class NetManager extends ABNetManager { ...@@ -98,7 +100,7 @@ export class NetManager extends ABNetManager {
*/ */
public addTimesForActivity(callback: Function, type: number, count: number, validType: number): void { public addTimesForActivity(callback: Function, type: number, count: number, validType: number): void {
let activityId: number; let activityId: number;
if(type == 1) { if (type == 1) {
activityId = DataManager.ins.gameCfgData.gameInfo.oaId; activityId = DataManager.ins.gameCfgData.gameInfo.oaId;
} else { } else {
activityId = DataManager.ins.customCfgData.oaId; activityId = DataManager.ins.customCfgData.oaId;
...@@ -108,7 +110,7 @@ export class NetManager extends ABNetManager { ...@@ -108,7 +110,7 @@ export class NetManager extends ABNetManager {
addCount: count, addCount: count,
activityId: activityId activityId: activityId
}; };
if(validType) { if (validType) {
param.validType = validType; param.validType = validType;
} }
...@@ -149,15 +151,15 @@ export class NetManager extends ABNetManager { ...@@ -149,15 +151,15 @@ export class NetManager extends ABNetManager {
public openCollectGoodsPrize(callback: Function, collectRuleId: number, type?: number): void { public openCollectGoodsPrize(callback: Function, collectRuleId: number, type?: number): void {
let actId: number; let actId: number;
let param: any; let param: any;
if(type == 1) { if (type == 1) {
actId = DataManager.ins.gameCfgData.gameInfo.oaId; actId = DataManager.ins.gameCfgData.gameInfo.oaId;
} else if(type == 2) { } else if (type == 2) {
actId = DataManager.ins.customCfgData.oaId; actId = DataManager.ins.customCfgData.oaId;
} }
if(type) { if (type) {
param = {collectRuleId: collectRuleId, actId: actId} param = { collectRuleId: collectRuleId, actId: actId }
} else { } else {
param = {collectRuleId: collectRuleId}; param = { collectRuleId: collectRuleId };
} }
const net: INetData = { const net: INetData = {
name: NetName.OPEN_COLLECT, name: NetName.OPEN_COLLECT,
...@@ -238,7 +240,7 @@ export class NetManager extends ABNetManager { ...@@ -238,7 +240,7 @@ export class NetManager extends ABNetManager {
uri: '/summer/getToyInfo', uri: '/summer/getToyInfo',
type: 'get', type: 'get',
dataType: 'json', dataType: 'json',
param: {operatingActivityId: operatingActivityId}, param: { operatingActivityId: operatingActivityId },
callback: callback callback: callback
}; };
this.send(net); this.send(net);
...@@ -254,7 +256,7 @@ export class NetManager extends ABNetManager { ...@@ -254,7 +256,7 @@ export class NetManager extends ABNetManager {
public doStart(callback: Function, isAgain: boolean, credits?: number, customizedType?: number): void { public doStart(callback: Function, isAgain: boolean, credits?: number, customizedType?: number): void {
let addUrl = ''; let addUrl = '';
if(isAgain) { if (isAgain) {
addUrl += '?dpm=' + DataManager.ins.gameGetSubmitResultData.againExposure.dpm; addUrl += '?dpm=' + DataManager.ins.gameGetSubmitResultData.againExposure.dpm;
} }
...@@ -263,11 +265,11 @@ export class NetManager extends ABNetManager { ...@@ -263,11 +265,11 @@ export class NetManager extends ABNetManager {
oaId: DataManager.ins.gameCfgData.gameInfo.oaId oaId: DataManager.ins.gameCfgData.gameInfo.oaId
}; };
if(credits) { if (credits) {
param.credits = credits; param.credits = credits;
} }
if(customizedType) { if (customizedType) {
param.customizedType = customizedType; param.customizedType = customizedType;
} }
...@@ -294,7 +296,7 @@ export class NetManager extends ABNetManager { ...@@ -294,7 +296,7 @@ export class NetManager extends ABNetManager {
const param: any = { const param: any = {
ticketId: ticketId ticketId: ticketId
}; };
if(customizedType) { if (customizedType) {
param.customizedType = customizedType param.customizedType = customizedType
} }
...@@ -421,7 +423,7 @@ export class NetManager extends ABNetManager { ...@@ -421,7 +423,7 @@ export class NetManager extends ABNetManager {
sgin: sign, sgin: sign,
dynamicData: JSON.stringify(dynamicData) dynamicData: JSON.stringify(dynamicData)
}; };
if(rankId) { if (rankId) {
param.rankId = rankId; param.rankId = rankId;
} }
const net: INetData = { const net: INetData = {
...@@ -441,7 +443,7 @@ export class NetManager extends ABNetManager { ...@@ -441,7 +443,7 @@ export class NetManager extends ABNetManager {
kk = kk.substring(0, 16); kk = kk.substring(0, 16);
//补0; //补0;
var len = kk.length; var len = kk.length;
while(len < 16) { while (len < 16) {
kk = kk + "0"; kk = kk + "0";
len++; len++;
} }
...@@ -476,7 +478,7 @@ export class NetManager extends ABNetManager { ...@@ -476,7 +478,7 @@ export class NetManager extends ABNetManager {
deviceSessionId: window['_device_session_id'], deviceSessionId: window['_device_session_id'],
score: score score: score
}; };
if(relatedTaskType) { if (relatedTaskType) {
data['relatedTaskType'] = relatedTaskType; data['relatedTaskType'] = relatedTaskType;
} }
var sgin = this.encrypt(JSON.stringify(data)); var sgin = this.encrypt(JSON.stringify(data));
...@@ -557,13 +559,13 @@ export class NetManager extends ABNetManager { ...@@ -557,13 +559,13 @@ export class NetManager extends ABNetManager {
* @param {number} customizedType * @param {number} customizedType
*/ */
public gameSubmit(callback: Function, public gameSubmit(callback: Function,
ticketId: number, ticketId: number,
score: number, score: number,
gameData: any, gameData: any,
submitToken: string, submitToken: string,
dynamicData: string, dynamicData: string,
checkScore?: boolean, checkScore?: boolean,
customizedType?: number): void { customizedType?: number): void {
const sign = this.createSgin(ticketId, score, gameData, submitToken); const sign = this.createSgin(ticketId, score, gameData, submitToken);
const param: any = { const param: any = {
ticketId: ticketId, ticketId: ticketId,
...@@ -572,10 +574,10 @@ export class NetManager extends ABNetManager { ...@@ -572,10 +574,10 @@ export class NetManager extends ABNetManager {
sgin: sign, sgin: sign,
dynamicData: dynamicData dynamicData: dynamicData
}; };
if(checkScore) { if (checkScore) {
param.checkScore = checkScore; param.checkScore = checkScore;
} }
if(customizedType) { if (customizedType) {
param.customizedType = customizedType; param.customizedType = customizedType;
} }
...@@ -833,7 +835,7 @@ export class NetManager extends ABNetManager { ...@@ -833,7 +835,7 @@ export class NetManager extends ABNetManager {
this.send(net); this.send(net);
} }
public getShareInfo(callback: Function,): void { public getShareInfo(callback: Function, ): void {
const net: INetData = { const net: INetData = {
name: 'getShareInfo', name: 'getShareInfo',
uri: window['duiba'] + '/wechatShare/getShareInfo/v2', uri: window['duiba'] + '/wechatShare/getShareInfo/v2',
...@@ -932,7 +934,7 @@ export class NetManager extends ABNetManager { ...@@ -932,7 +934,7 @@ export class NetManager extends ABNetManager {
activityId: DataManager.ins.customCfgData.actId activityId: DataManager.ins.customCfgData.actId
}; };
if(propType) { if (propType) {
d.propType = propType; d.propType = propType;
} }
const net: INetData = { const net: INetData = {
...@@ -993,7 +995,7 @@ export class NetManager extends ABNetManager { ...@@ -993,7 +995,7 @@ export class NetManager extends ABNetManager {
uri: window['duiba'] + '/customActivity/happyclear/getBackReward', uri: window['duiba'] + '/customActivity/happyclear/getBackReward',
type: 'get', type: 'get',
dataType: 'json', dataType: 'json',
hideMsg:true, hideMsg: true,
param: d, param: d,
callback: callback callback: callback
}; };
...@@ -1006,7 +1008,7 @@ export class NetManager extends ABNetManager { ...@@ -1006,7 +1008,7 @@ export class NetManager extends ABNetManager {
uri: window['duiba'] + '/customActivity/happyclear/hasBackReward', uri: window['duiba'] + '/customActivity/happyclear/hasBackReward',
type: 'get', type: 'get',
dataType: 'json', dataType: 'json',
hideMsg:true, hideMsg: true,
param: d, param: d,
callback: callback callback: callback
}; };
...@@ -1061,9 +1063,9 @@ export class NetManager extends ABNetManager { ...@@ -1061,9 +1063,9 @@ export class NetManager extends ABNetManager {
public getMusicCategory(callback: Function, categoryID?: number, categoryCode?, liteVersion?): void { public getMusicCategory(callback: Function, categoryID?: number, categoryCode?, liteVersion?): void {
const data: any = {}; const data: any = {};
if(categoryID) data.categoryID = categoryID; if (categoryID) data.categoryID = categoryID;
if(categoryCode) data.categoryCode = categoryCode; if (categoryCode) data.categoryCode = categoryCode;
if(liteVersion) data.liteVersion = liteVersion; if (liteVersion) data.liteVersion = liteVersion;
const net: INetData = { const net: INetData = {
name: 'getMusicCategory', name: 'getMusicCategory',
uri: '/aaw/music/category', uri: '/aaw/music/category',
...@@ -1098,8 +1100,8 @@ export class NetManager extends ABNetManager { ...@@ -1098,8 +1100,8 @@ export class NetManager extends ABNetManager {
public getMusicItem(callback: Function, songListId, itemId): void { public getMusicItem(callback: Function, songListId, itemId): void {
const data: any = {}; const data: any = {};
if(itemId) data.itemId = itemId; if (itemId) data.itemId = itemId;
if(songListId) data.songListId = songListId; if (songListId) data.songListId = songListId;
const net: INetData = { const net: INetData = {
name: 'getMusicItem', name: 'getMusicItem',
uri: '/aaw/music/item', uri: '/aaw/music/item',
...@@ -1154,10 +1156,10 @@ export class NetManager extends ABNetManager { ...@@ -1154,10 +1156,10 @@ export class NetManager extends ABNetManager {
activityType: 'hdtool', activityType: 'hdtool',
consumerId: window['CFG'].consumerId consumerId: window['CFG'].consumerId
}; };
if(credits) { if (credits) {
param.credits = credits; param.credits = credits;
} }
if(collectRuleId) { if (collectRuleId) {
param.collectRuleId = collectRuleId; param.collectRuleId = collectRuleId;
} }
const net: INetData = { const net: INetData = {
...@@ -1554,13 +1556,13 @@ export class NetManager extends ABNetManager { ...@@ -1554,13 +1556,13 @@ export class NetManager extends ABNetManager {
* @param {number} petId 宠物id * @param {number} petId 宠物id
*/ */
public collect(callback: Function, public collect(callback: Function,
giftId: number, giftId: number,
giftNum: number, giftNum: number,
giftName: string, giftName: string,
giftDesc: string, giftDesc: string,
giftType: number, giftType: number,
giftLink: string, giftLink: string,
petId: number): void { petId: number): void {
const net: INetData = { const net: INetData = {
name: NetName.PET_COLLECT, name: NetName.PET_COLLECT,
uri: '/signpet/addition/collect', uri: '/signpet/addition/collect',
...@@ -1851,7 +1853,7 @@ export class NetManager extends ABNetManager { ...@@ -1851,7 +1853,7 @@ export class NetManager extends ABNetManager {
* @param net * @param net
*/ */
public getToken(net: INetData): void { public getToken(net: INetData): void {
if(window['getDuibaToken']) { if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => { window['getDuibaToken']((tokenObj: any) => {
net.param.token = tokenObj.token; net.param.token = tokenObj.token;
this.send(net); this.send(net);
...@@ -1882,12 +1884,12 @@ export class NetManager extends ABNetManager { ...@@ -1882,12 +1884,12 @@ export class NetManager extends ABNetManager {
let gTime: string = '?_=' + GTime.getTimestamp(); let gTime: string = '?_=' + GTime.getTimestamp();
let realUrl: string = net.uri; let realUrl: string = net.uri;
if(realUrl.indexOf('?') != -1) { if (realUrl.indexOf('?') != -1) {
gTime = '&_=' + GTime.getTimestamp(); gTime = '&_=' + GTime.getTimestamp();
} }
//url加参数等特殊需求(例如再玩一次需要在dostart接口的url上加埋点) //url加参数等特殊需求(例如再玩一次需要在dostart接口的url上加埋点)
if(net.addUrl) { if (net.addUrl) {
realUrl += net.addUrl; realUrl += net.addUrl;
} }
...@@ -1953,6 +1955,8 @@ export class NetManager extends ABNetManager { ...@@ -1953,6 +1955,8 @@ export class NetManager extends ABNetManager {
* @param {IExposureData} exposure * @param {IExposureData} exposure
*/ */
public clickLog(exposure: IExposureData): void { public clickLog(exposure: IExposureData): void {
const __area__ = exposure['__area__'];
delete exposure['__area__'];
const net: INetData = { const net: INetData = {
name: 'clickLog', name: 'clickLog',
uri: window['duiba'] + '/log/click', uri: window['duiba'] + '/log/click',
...@@ -1963,6 +1967,11 @@ export class NetManager extends ABNetManager { ...@@ -1963,6 +1967,11 @@ export class NetManager extends ABNetManager {
hideMsg: true hideMsg: true
}; };
this.send(net); this.send(net);
if (SAMap[__area__])
SAUP_sendLogData(SAMap[__area__]);
else
console.warn('苏宁埋点未配置')
} }
/** /**
...@@ -2009,33 +2018,33 @@ export class NetManager extends ABNetManager { ...@@ -2009,33 +2018,33 @@ export class NetManager extends ABNetManager {
* @param result 结果 * @param result 结果
*/ */
protected onResponse(net: INetData, result: any): void { protected onResponse(net: INetData, result: any): void {
if(net.name == 'hc_home') { if (net.name == 'hc_home') {
// if(result.data.refectionCountdown==null) // if(result.data.refectionCountdown==null)
// result.data.refectionCountdown==0; // result.data.refectionCountdown==0;
if(result.data.refectionCountdown == 0) if (result.data.refectionCountdown == 0)
result.data.refectionCountdown = 5; result.data.refectionCountdown = 5;
result.data.refectionCountdown += Math.floor(new Date().getTime() / 1000); result.data.refectionCountdown += Math.floor(new Date().getTime() / 1000);
} }
//数据处理 //数据处理
const data: Data = DataManager.ins.updateData(net.name, result, net.param); const data: Data = DataManager.ins.updateData(net.name, result, net.param);
//接口成功 //接口成功
if(net.pollingCount && net.pollingCheck(data)) { if (net.pollingCount && net.pollingCheck(data)) {
net.pollingCount -= 1; net.pollingCount -= 1;
//轮询接口特殊处理 //轮询接口特殊处理
setTimeout(() => { setTimeout(() => {
this.send(net); this.send(net);
}, 500); }, 500);
} else if(net.callback) { } else if (net.callback) {
if(net.pollingCheck && net.pollingCount == 0 && net.pollingCheck(data)) { if (net.pollingCheck && net.pollingCount == 0 && net.pollingCheck(data)) {
result.message = '系统异常,请稍后再试。'; result.message = '系统异常,请稍后再试。';
data['success'] = false; data['success'] = false;
} }
net.callback(data.success, data || result); net.callback(data.success, data || result);
} }
if(!data.success && !net.hideMsg) { if (!data.success && !net.hideMsg) {
GDispatcher.dispatchEvent(ABNetManager.ERROR, net, result.message || result.desc || result.msg); GDispatcher.dispatchEvent(ABNetManager.ERROR, net, result.message || result.desc || result.msg);
} }
if(!data.success && !net.hideMsg) { if (!data.success && !net.hideMsg) {
onNotSuccess(data, net.name) onNotSuccess(data, net.name)
} }
} }
...@@ -2048,11 +2057,11 @@ export class NetManager extends ABNetManager { ...@@ -2048,11 +2057,11 @@ export class NetManager extends ABNetManager {
* @param message * @param message
*/ */
protected onError(net: INetData): void { protected onError(net: INetData): void {
if(net.callback) { if (net.callback) {
net.callback(false); net.callback(false);
} }
if(!net.hideMsg) { if (!net.hideMsg) {
GDispatcher.dispatchEvent(ABNetManager.ERROR, net); GDispatcher.dispatchEvent(ABNetManager.ERROR, net);
showToast('网络开小差了,再试一次吧'); showToast('网络开小差了,再试一次吧');
console.log('接口错误', net.uri) console.log('接口错误', net.uri)
......
...@@ -7,7 +7,9 @@ class Main extends MainBase { ...@@ -7,7 +7,9 @@ class Main extends MainBase {
export const getlogItem = (i) =>{ export const getlogItem = (i) =>{
const Dpm = Buried.connectDpm(110, i, 1); // 点击埋点 const Dpm = Buried.connectDpm(110, i, 1); // 点击埋点
const Dcm = Buried.connectDcm(202, 0, 0); // 曝光埋点 const Dcm = Buried.connectDcm(202, 0, 0); // 曝光埋点
return Buried.createExposure(Dpm, Dcm); const obj = Buried.createExposure(Dpm, Dcm);
obj['__area__'] = i;
return obj;
} }
window['Main'] = Main; window['Main'] = Main;
......
export default () => {
try {
window['SAUP'].sendLogData("click", {
tag: '',   // 必传;如果需要传拓展的信息,在tag中加一个sa-data,将需要传的内容用json格式传到sa-data
sapmodid: "请写入产品提供的 modid",    // 必传;区块编码
eleid: "请写入产品提供的 eleid"        // 必传;坑位编码
});
//这里的this必须传dom节点
} catch (e) { }
}
export default {
'1': ['bingoMapIndex', 'bingoBox'],
'2': ['bingoMapIndex', 'bingoLife'],
'5': ['bingoMapIndex', 'bingoProp'],
'19': ['bingoMapIndex', 'bingoLevel'],
'32': ['bingoMapIndex', 'bingoIndexAd'],
'33': ['bingoMapIndex', 'bingoInvite'],
'67': ['bingoMapIndex', 'bingoCoin'],
'62': ['bingoMapIndex', 'bingoGetCoin'],
'77': ['bingoMapIndex', 'bingoRedBattle'],
'57': ['bingoMapIndex', 'bingoRedPacket'],
'74': ['bingoMapIndex', 'bingoRedBoom'],
'888001': ['bingoMapIndex', 'bingoLottery'],
'888006': ['bingoMapIndex', 'bingoGetRed'],
'30': ['bingoDialog', 'bingoLifeBuy'],
'4': ['bingoDialog', 'bingoLifeAsk'],
'6': ['bingoDialog', 'bingoBoomBuy'],
'8': ['bingoDialog', 'bingoBoomCfm'],
'9': ['bingoDialog', 'bingoHammerBuy'],
'12': ['bingoDialog', 'bingoStepBuy'],
'14': ['bingoDialog', 'bingoStepCfm'],
}
\ No newline at end of file
import { elementMonsterResMap } from "./something/enum/ElementType";
const elem = document.createElement('div');
/**
* @param sapmodid 区块编码
* @param eleid 坑位编码
*/
export default ([sapmodid, eleid], saData = {}) => {
try {
elem.setAttribute('sa-data', JSON.stringify(saData));
if (window['SAUP'] && window['SAUP'].sendLogData) {
window['SAUP'].sendLogData("click", {
tag: elem,   // 必传;如果需要传拓展的信息,在tag中加一个sa-data,将需要传的内容用json格式传到sa-data
sapmodid: sapmodid,    // 必传;区块编码
eleid: eleid       // 必传;坑位编码
});
}else {
console.warn('苏宁买点api错误')
}
elem.setAttribute('sa-data', '{}');
} catch (e) { }
}
...@@ -296,7 +296,7 @@ export default class MapScene extends Scene { ...@@ -296,7 +296,7 @@ export default class MapScene extends Scene {
console.log('必须通关前面的关卡才能开启本关'); console.log('必须通关前面的关卡才能开启本关');
} else } else
PanelCtrl.instance.show('StartPanel', key); PanelCtrl.instance.show('StartPanel', key);
NetManager.ins.clickLog(getlogItem(19)) NetManager.ins.clickLog(getlogItem(19));
}, this); }, this);
} }
} }
...@@ -988,6 +988,7 @@ export default class MapScene extends Scene { ...@@ -988,6 +988,7 @@ export default class MapScene extends Scene {
this['musicBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_music, this); this['musicBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_music, this);
this['recordBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this['recordBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
PanelCtrl.instance.show('bag'); PanelCtrl.instance.show('bag');
NetManager.ins.clickLog(getlogItem(5));
}, this); }, this);
// 消消乐查询信息 // 消消乐查询信息
...@@ -1115,7 +1116,7 @@ export default class MapScene extends Scene { ...@@ -1115,7 +1116,7 @@ export default class MapScene extends Scene {
onTap_shopBtn() { onTap_shopBtn() {
PanelCtrl.instance.show('Shop'); PanelCtrl.instance.show('Shop');
NetManager.ins.clickLog(getlogItem(5)); // NetManager.ins.clickLog(getlogItem(5));
} }
toggleSettings() { toggleSettings() {
......
...@@ -71,6 +71,7 @@ export default class ScratchIcon extends IconBase { ...@@ -71,6 +71,7 @@ export default class ScratchIcon extends IconBase {
*/ */
protected onTouchBtn(e: egret.TouchEvent) { protected onTouchBtn(e: egret.TouchEvent) {
super.onTouchBtn(e); super.onTouchBtn(e);
NetManager.ins.clickLog(getlogItem(888006));
NetManager.ins.showLog(getlogItem(49)); NetManager.ins.showLog(getlogItem(49));
NetManager.ins.scratchGetTaskInfo((success, res) => { NetManager.ins.scratchGetTaskInfo((success, res) => {
if(!success) { if(!success) {
......
...@@ -58,7 +58,8 @@ export default class TurntableIcon extends IconBase { ...@@ -58,7 +58,8 @@ export default class TurntableIcon extends IconBase {
super.onTouchBtn(e); super.onTouchBtn(e);
loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga').then(async (mv: any) => { loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga').then(async (mv: any) => {
// await wait(100); // await wait(100);
PanelCtrl.instance.show('turnTable', {mv:mv}) PanelCtrl.instance.show('turnTable', {mv:mv});
NetManager.ins.clickLog(getlogItem(888001));
}) })
} }
......
...@@ -5,8 +5,18 @@ ...@@ -5,8 +5,18 @@
"timestamp": 1573210800000, "timestamp": 1573210800000,
"data": { "data": {
"currentRemainTimes": 0, "currentRemainTimes": 0,
"currentSession": null, "currentSession": {
"nextSession": null, "sessionIndex": 6,
"canJoin": false "startTime": 1573210800000,
"endTime": 1573299903000,
"limitScore": 10
},
"nextSession": {
"sessionIndex": 10,
"startTime": 1573440915952,
"endTime": 1573299903000,
"limitScore": 10
},
"canJoin": true
} }
} }
\ 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