Commit 57504044 authored by wildfirecode13's avatar wildfirecode13

1

parent 0adcf906
{
"code": null,
"data": {
"needPop":1,
"activityOver": false,
"surplusCount": 1,
"credits": 0,
......
{
"success": false,
"message": "",
"data": {
"inviteCode":123
}
}
\ No newline at end of file
{
"success": true,
"message": "",
"data": {
"inviteCode":123
}
}
\ No newline at end of file
import { changeScene, destroyAllCtrls } from "../module/ctrls";
import { changeScene, destroyAllCtrls, showPanel } from "../module/ctrls";
import { RES } from "../module/RES";
import { getUrlParams } from "../module/tools/WebTool";
import { destroyLayers, layers } from "../module/views/layers";
import { IndexScene } from "../src/scenes/IndexScene";
import getQueryParams from "./common/getQueryParams";
import { getSearch } from "./getSearch";
import { getUnionid } from "./getUnionid";
import "./monitor";
import { ResJson } from "./ResJson";
import { startShare } from "./share";
import { SkinJson } from "./SkinJson";
import { destroyWebNetData, sendWebNet } from "./WebNet";
import { WebNetName } from "./WebNetName";
import {accessLog} from 'duiba-utils'
import { getUnionid } from "./getUnionid";
import "./monitor"
import {SharePanel} from "./panels/share"
/**
* 全局事件,为了和小程序交互
......@@ -51,22 +50,22 @@ export class Main {
}
private async onAddToStage() {
if(getQueryParams().iscustom) {
sendWebNet(WebNetName.login,{
appId:getUrlParams("appID"),
unionid: getUnionid()||'oIbvOt3D_z7AfHz9lI6VmDEeYDIk',
redirectUrl:`https://85337.activity-11.m.duiba.com.cn/projectx/p24ddb854/index.html?appID=85337&appKey=43em3uUH9vthEvNA59Zsk8dE1igv&openBs=openbs&issharepage=${getQueryParams().issharepage}&code=${getQueryParams().code}`
if (getQueryParams().iscustom) {
sendWebNet(WebNetName.login, {
appId: getUrlParams("appID"),
unionid: getUnionid() || 'oIbvOt3D_z7AfHz9lI6VmDEeYDIk',
redirectUrl: `https://85337.activity-11.m.duiba.com.cn/projectx/p24ddb854/index.html?appID=85337&appKey=43em3uUH9vthEvNA59Zsk8dE1igv&openBs=openbs&issharepage=${getQueryParams().issharepage}&code=${getQueryParams().code}`
// redirectUrl:`http://activity.saas.duibatest.com.cn/projectx/p34906fbc/index.html?appKey=2vv47nLE1y47qqMMeD8P52ycudDU&openBs=openbs&appID=19493&issharepage=${getQueryParams().issharepage}`
}).then(res=>{
let url= res.data;
}).then(res => {
let url = res.data;
location.replace(url);
});
return;
}
if(getQueryParams().issharepage == 1) {
if (getQueryParams().issharepage == 1) {
console.log('分享进入')
}else{
} else {
console.log('主动进入')
}
......@@ -82,15 +81,20 @@ export class Main {
//皮肤配置加载
RES.loadSkinConfig(SkinJson);
console.log("初始化皮肤配置完成")
//加载通用资源
//加载通用资源FF
await RES.loadGroup("common");
await RES.loadGroup("svga");
await sendWebNet(WebNetName.index,{isShare:getQueryParams().issharepage=='1' ? 1:0});
await sendWebNet(WebNetName.index, { isShare: getQueryParams().issharepage == '1' ? 1 : 0 });
console.log("通用资源加载完成")
//h5环境时,隐藏加载中
if (FYGE.getEnv() == "web" && document.getElementById("__loading__")) document.getElementById("__loading__").style.display = "none";
//显示场景
changeScene(IndexScene);
sendWebNet(WebNetName.getInviteCode, {}, null, true);
sendWebNet(WebNetName.doAssist, { inviteCode: getQueryParams().inviteCode }, null, true);
// setTimeout(() => {
// showPanel(SharePanel);
// }, 4000);
}
/**
......@@ -143,5 +147,4 @@ export class Main {
//网络数据记录清空
destroyWebNetData();
}
}
}
\ No newline at end of file
......@@ -831,5 +831,5 @@ export const ResJson = {
}
}
],
"path": "https://yun.duiba.com.cn/db_games/activity/template/1631780630/resource/"
"path": "https://yun.duiba.com.cn/db_games/activity/template/1631957256/resource/"
}
\ No newline at end of file
......@@ -5,19 +5,22 @@
export enum WebNetName {
login = "/customActivity/disu/login",
/**
* 获取规则
*/
projectRule = "/projectx/{projectId}/projectRule.query",
/**
* 获取首页数据
* 获取首页数据s
*/
index = "/projectx/{projectId}/dazzle/index.do",
/**
* 获取奖品信息
*/
drawPrize = "/projectx/{projectId}/dazzle/drawPrize.do",
getInviteCode = "/projectx/{projectId}/dazzle_assist/getInviteCode.do",
doAssist = "/projectx/{projectId}/dazzle_assist/doAssist.do",
/**
* 分享获得免费次数
*/
......
......@@ -9,6 +9,7 @@ import TestButton from "../common/TestButton";
import { isMember } from "../isMember";
import { getTimesPanel } from "../panels/getTimes";
import { RulePanel } from "../panels/RulePanel";
import { SharePanel } from "../panels/share";
import { timesNotEnoughPanel } from "../panels/timesNotEnough";
import { getWebData, sendLog, sendWebNet } from "../WebNet";
import { WebNetName } from "../WebNetName";
......@@ -122,6 +123,12 @@ export class IndexScene extends Scene {
this.stage.addEventListener('updateIndexData', this.getIndex, this);
this.stage.addEventListener('handleShare', this.handleShare, this);
if(result.data.needPop){
setTimeout(() => {
showPanel(SharePanel);
}, 4000);
}
}
initContainer() {
......
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