Commit b916b3b6 authored by wildfirecode13's avatar wildfirecode13

update

parent d39a24c1
......@@ -15,6 +15,22 @@ let mergeData = {
* web接口枚举,mock 文件名类似aaa/homeInfo.do
*/
export enum WebNetName {
/**
* 获取规则
*/
projectRule = "/projectx/{projectId}/projectRule.query",
carouselInfo = "/projectx/{projectId}/carousel/carouselInfo.do",
acquireExperienceAmount = "/projectx/{projectId}/wallet/acquireExperienceAmount.do",
myWallet = "/projectx/{projectId}/wallet/myWallet.do",
withDraw = "/projectx/{projectId}/wallet/withDraw.do",
alreadyAcquired = "/projectx/{projectId}/wallet/alreadyAcquired.do",
acquireOtherExperienceAmount = "/projectx/{projectId}/wallet/acquireOtherExperienceAmount.do",
createItem = "/projectx/{projectId}/shareAssist/createItem.do",
assist = "/projectx/{projectId}/shareAssist/assist.do",
/**
* 首页
*/
......@@ -24,7 +40,7 @@ export enum WebNetName {
*/
canshare = "/projectx/{projectId}/game/canshare.do",
carouselInfo = "/projectx/{projectId}/carousel/carouselInfo.do",
/**
* 参与
*/
......@@ -34,10 +50,7 @@ export enum WebNetName {
*/
queryResult = "/projectx/{projectId}/game/queryResult.do",
/**
* 获取规则
*/
projectRule = "/projectx/{projectId}/projectRule.query"
}
//返回数据类型
......
......@@ -2,6 +2,7 @@ import { unwatchPageVisibility, watchPageVisibility } from '@spark/utils';
import { closeCurrentPanel, showPanel } from "../../module/ctrls";
import PanelCtrl from '../../module/ctrls/panelCtrl';
import { Scene } from "../../module/views/Scene";
import Marquee from '../common/Marquee';
import { DrawPanel } from '../panels/draw';
import { ShareFailPanel } from '../panels/share_fail';
import { ShareSuccessPanel } from '../panels/share_success';
......@@ -26,6 +27,21 @@ export class IndexScene extends Scene {
showPanel(DrawPanel, data);
}, this);
sendWebNet(WebNetName.carouselInfo).then(res => {
console.log('carouselInfo ', res);
const template = '{phone}邀请了{friend}位好友,获得了{amount}体验金';
const datas = res.data.map(item=>{
let str = template.replace('{phone}',item.nickname);
str = str.replace('{friend}',item.friend);
str = str.replace('{amount}',item.amount);
return str
});
const q = this.addChild(new Marquee(datas));
q.y = 50;
q.x = 50;
});
}
async showSharePanel() {
......
import { showPanel } from "../../module/ctrls";
import { Scene } from "../../module/views/Scene";
import Marquee from "../common/Marquee";
import getObject from "../getObject";
import { PrizePanel } from "../panels/prize";
import { sendWebNet, WebNetName } from "../WebNet";
export class ShareScene extends Scene {
get groupNames() { return ["share"] }
get skinName() { return "share" }
......@@ -13,7 +15,22 @@ export class ShareScene extends Scene {
async start(data) {
super.start();
console.log('ShareScene query>>',JSON.stringify(data.query))
console.log('ShareScene query>>',JSON.stringify(data.query));
sendWebNet(WebNetName.carouselInfo).then(res => {
console.log('carouselInfo ', res);
const template = '{phone}邀请了{friend}位好友,获得了{amount}体验金';
const datas = res.data.map(item=>{
let str = template.replace('{phone}',item.nickname);
str = str.replace('{friend}',item.friend);
str = str.replace('{amount}',item.amount);
return str
});
const q = this.addChild(new Marquee(datas));
q.y = 50;
q.x = 50;
});
}
initEvents() {
......
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