Commit b40b44ea authored by wjf's avatar wjf

l

parent 2e2ca461
......@@ -32,9 +32,9 @@
height: 100%;
overflow: hidden;
position: absolute;
/* background-color: #000000; */
background-color: #f5cccd;
/* background: linear-gradient(#93dbb7,#ff0,#b5d89a); */
background: linear-gradient(#93dbb7,#b5d89a);
/* background: linear-gradient(#93dbb7,#b5d89a); */
}
</style>
</head>
......
{
"code": "000000",
"data": 1,
"success": true,
"message": "成功"
}
\ No newline at end of file
{
"code": "000000",
"data": {
"tools": {
"HAMMERS": 1,
"STEPS": 0,
"BOOMS": 0
}
},
"success": true,
"message": "成功"
}
\ No newline at end of file
{
"code": "000000",
"data": {
"power": 3
},
"success": true,
"message": "成功"
}
\ No newline at end of file
{
"code": "530001",
"data": {
"isvip": false,
"url": "//market.m.taobao.com/apps/market/shopmember/index.html?wh_weex=true&sellerId=2207623078795&extraInfo=%7B%22source%22%3A%22isvapp%22%2C%22entrance%22%3A%22duiba%22%7D"
},
"success": false,
"message": "需要成为会员"
}
\ No newline at end of file
{
"code": "000000",
"data": {
"currentLevel": 11,
"prize": {},
"isPrizeLevel": false,
"tool": {}
},
"success": true,
"message": "成功"
}
\ No newline at end of file
{
"code": "000000",
"data": {
"currentLevel": 11,
"visitors": [
{
"activityId": "5f08084ec3ad3494b9201c0e",
"score": 10000,
"level": 120,
"createTime": 1594370024407,
"openId": "AAHuCvE-ALiIWXYsJuTb5S4W",
"isVisitSuccess": true,
"updateTime": 1594370024407,
"_id": "5f0827e89da67191b6b29261",
"stars": 3,
"isPrizeLevel": false,
"sendAwardType": true
},
{
"activityId": "5f08084ec3ad3494b9201c0e",
"score": 10000,
"level": 10,
"createTime": 1594370106090,
"openId": "AAHuCvE-ALiIWXYsJuTb5S4W",
"isVisitSuccess": true,
"updateTime": 1594370106090,
"_id": "5f08283a75cfb693ea1b3d5b",
"stars": 3,
"isPrizeLevel": true,
"sendAwardType": "prize"
},
{
"activityId": "5f08084ec3ad3494b9201c0e",
"score": 10000,
"level": 1,
"createTime": 1594369315957,
"openId": "AAHuCvE-ALiIWXYsJuTb5S4W",
"isVisitSuccess": true,
"updateTime": 1594369868256,
"_id": "5f082523c3ad3494b92036bf",
"stars": 3,
"isPrizeLevel": false,
"sendAwardType": true
}
],
"prizes": [
{
"receiveTime": "",
"level": 120,
"isReceive": false
}
],
"power": 3,
"tools": {
"HAMMERS": 1,
"STEPS": 0,
"BOOMS": 0
},
"topAward": ""
},
"success": true,
"message": "成功"
}
\ No newline at end of file
......@@ -4,7 +4,7 @@
"message": "OK",
"data": {
"power": 100,
"currentLevel": 1,
"currentLevel": 120,
"tools": {
"STEPS": 1,
"BOOMS": 2,
......
{
"code": "000000",
"data": [
{
"switchStock": 1,
"image": "https://img.alicdn.com/imgextra/i2/2275046294/O1CN01c4rCs11wMhRrsjEep_!!2275046294-2-miniprogram.png",
"isBackUp": false,
"properiodto": 1600,
"level": 1,
"probability": "16",
"openId": "AAFwCvE-ALiIWXYsJuTQVRpH",
"prizeType": 60,
"updateTime": 1594623032191,
"type": 3,
"properiodfrom": 1,
"activityId": "5f08084ec3ad3494b9201c0e",
"ename": "",
"lockStatus": 1,
"credits": "",
"createTime": 1594361933509,
"deleteStatus": 1,
"name": "60关奖品3",
"useStock": 1,
"rank": "",
"_id": "5f08084e0cb7338a0a377c8e",
"id": "",
"stock": 200
},
{
"isBackUp": true,
"properiodto": 10000,
"level": 2,
"probability": "84",
"prizeType": 60,
"updateTime": 1594623032197,
"type": 5,
"properiodfrom": 1601,
"activityId": "5f08084ec3ad3494b9201c0e",
"lockStatus": 1,
"createTime": 1594623032197,
"deleteStatus": 1,
"name": "谢谢参与",
"useStock": 0,
"_id": "5f0c043852bbde91d1ca5682"
}
],
"success": true,
"message": "成功"
}
\ No newline at end of file
{
"code": "000000",
"data": [
{
"taskType": "member",
"times": 1,
"todayCompleteTimes": 0,
"waitReceive": 0,
"rewards": 65
},
{
"taskType": "invites",
"times": 3,
"todayCompleteTimes": 0,
"waitReceive": 0,
"value": "",
"rewards": 10
},
{
"taskType": "follow",
"times": 1,
"todayCompleteTimes": 0,
"waitReceive": 0,
"value": "",
"rewards": 7
},
{
"taskType": "browseGoods",
"times": 3,
"todayCompleteTimes": 0,
"waitReceive": 0,
"value": "",
"rewards": 10
}
],
"success": true,
"message": "成功"
}
\ No newline at end of file
{
"success": false,
"message": "您还不是会员",
"data": {
"isvip": false,
"url": "xxx",
"credits": 1111
}
}
\ No newline at end of file
{
"code":"000000",
"data":1,
"success":true,
"message":"成功"
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -9,9 +9,61 @@ export enum TbNetName {
* activityId params elemType
*/
trackingReport = "squirrelsAdoptRest2c.trackingReport",
/**
* 进入活动调用, 刷新数据不调用该接口
* activityId userNick avatar follow inviteId
*/
getIndex = "babycare.getIndex",
/**
* 获取游戏信息
* activityId
*/
getGameInfo = "babycare.getGameInfo",
/**
* 消耗道具 ,会返回剩余所有道具数量
* activityId type
*/
consumerTools = "babycare.consumerTools",
/**
* 提交分数
* activityId level score stars isVisitSuccess(是否通关)
*/
gameOver = "babycare.gameOver",
/**
* 领取任务奖励
* activityId taskType
*/
receiveTaskRewards = "babycare.receiveTaskRewards",
/**
* 积分兑换道具和体力
* activityId type credits
*/
exchange = "babycare.exchange",
/**
* 根据等级获取奖品列表
* activityId level
*/
getPrizesByLevel = "babycare.getPrizesByLevel",
/**
* 查询用户积分
* activityId
*/
queryCredits = "babycare.queryCredits",
/**
* 开始闯关,会返回体力值
* activityId level
*/
dojoin = "babycare.dojoin",
/**
* 完成任务(浏览商品详情页, 关注店铺)
* activityId taskType
*/
completeTask = "babycare.completeTask",
/**
* 任务列表
* activityId
*/
getTaskList = "babycare.getTaskList",
///////////////////前端调用接口都加个mine
......@@ -35,7 +87,7 @@ export enum TbNetName {
*/
getAdoptName = "mine.getAdoptName",
//基本都是前端同步方法
///////////////////////////基本都是前端同步方法
/**
* 获取参数
*/
......
......@@ -4,6 +4,7 @@ import Tween = FYGE.Tween;
import DisplayObject = FYGE.DisplayObject;
import Ease = FYGE.Ease;
import { sendTbNet, TbNetName } from "./TaoBaoNet";
import { PropType } from "./something/enum/PropType";
/**
* 定制,记录一些全局量和方法
......@@ -28,7 +29,99 @@ export class Tools {
"inviteId": string,
"isFollow": boolean
}
/**
* 游戏数据,需要根据接口维护
*/
public static gameData: {
"currentLevel": number,
"visitors": {
"score": number,
"level": number,
"isVisitSuccess": boolean,
"stars": number,
}[],
"prizes": {
"receiveTime": string,//number
"level": number,
"isReceive": boolean
}[],
"power": number,
"tools": {
"HAMMERS": number,
"STEPS": number,
"BOOMS": number
},
"isFristLogin": boolean,//是否是首次
"topAward": any//120关自动开奖
}
/**
* 首页数据,loading页面执行一次
*/
public static getIndex() {
return new Promise((r) => {
sendTbNet(TbNetName.getIndex, {
userNick: this.globalData.nickName,
avatar: this.globalData.avatar,
follow: this.globalData.isFollow,
inviteId: this.globalData.inviteId,
}, (s, res) => {
if (s) this.gameData = res.data;
r(s);
})
})
}
/**
* 进入地图页面刷新
*/
public static getGameInfo() {
return new Promise((r) => {
sendTbNet(TbNetName.getGameInfo, (s, res) => {
if (s) this.gameData = res.data;
r(s);
})
})
}
/**
* 消耗道具
*/
public static consumerTools(type: PropType): Promise<boolean> {
return new Promise((resolve, reject) => {
sendTbNet(TbNetName.consumerTools, { type }, (s, res) => {
if (s) {
//修改道具数量
this.gameData.tools = res.data.tools;
// resolve(res);//数据按照gameData的更新,不返回
resolve(true)
} else {
reject()
}
})
})
}
/**
* 兑换道具,根据返回参数判断
*/
public static async exchange(type: PropType): Promise<boolean | string> {
//先获取积分,判断是否有积分
var creditsData = await sendTbNet(TbNetName.queryCredits)
//接口失败,没数据时,返回false
if (!creditsData || !creditsData.data) {
return false
}
//非会员,返回会员路径
if (creditsData && !creditsData.success && !creditsData.data.isvip) {
return creditsData.data.url
}
const res = await sendTbNet(TbNetName.exchange, { type, credits: creditsData.data.credits })
if (res.success) {
//修改道具数量和体力
this.gameData.power = res.data.power;
this.gameData.tools = res.data.tools;
return true;//可根据gameData修改视图
} else {
return false;
}
}
/**
* 询问权限用
*/
......
import { Panel } from "../../module/views/Panel";
import { PropType } from "../something/enum/PropType";
export class ToolsOutPanel extends Panel {
get groupNames() { return ["ToolsOutPanel"] }
get skinName() { return "ToolsOutPanel" }
consideBtn:FYGE.Button;
sureBtn:FYGE.Button;
closeBtn:FYGE.Button;
msgTxt:FYGE.TextField;
consideBtn: FYGE.Button;
sureBtn: FYGE.Button;
closeBtn: FYGE.Button;
msgTxt: FYGE.TextField;
data: {
type: PropType;
}
initUi() {
......
This diff is collapsed.
......@@ -23,12 +23,12 @@ const chapters: ChapterData[] = [].concat(
Chapters4,
Chapters5,
Chapters6,
Chapters7,
Chapters8,
Chapters9,
Chapters10,
Chapters11,
Chapters12,
// Chapters7,
// Chapters8,
// Chapters9,
// Chapters10,
// Chapters11,
// Chapters12,
)
/**
* 获取关卡数据,返回关卡数据
......
......@@ -5,4 +5,5 @@ export enum PropType {
STEPS = "STEPS",
BOOMS = "BOOMS",
HAMMERS = "HAMMERS",
POWER = "POWER",
}
\ 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