Commit a1b69f27 authored by haiyoucuv's avatar haiyoucuv

guide

parent 33a30a7c
This diff is collapsed.
{
"success": true,
"code": "000000",
"data": {
"index": 2,
"plants": [
{
"level": "",
"waterRestCount": "",
"plant": false,
"waterTime": "",
"index": 1,
"plantType": ""
},
{
"level": 1,
"waterRestCount": 0,
"totalTime": 60000,
"plant": true,
"level": 2,
"plantType": "CASHEWNUT",
"waterTime": 10,
"totalTime": 3000,
"waterRestCount": 0
"waterTime": 1,
"index": 2,
"plantType": "PECAN"
},
{
"level": "",
"waterRestCount": "",
"plant": false,
"waterTime": "",
"index": 3,
"plantType": ""
},
{
"level": "",
"waterRestCount": "",
"plant": false,
"waterTime": "",
"index": 4,
"plantType": ""
}
],
"waterDrops": 2
},
"success": true,
"message": "成功"
}
{
"success": true,
"code": "000000",
"data": {
"guideIsEnd": false,
"guideStep": 1,
"waterDrops": 100,
"guideStep": 8,
"guideIsEnd": true,
"waterDrops": 999,
"plants": [
{
"index": 1,
"level": "",
"waterRestCount": "",
"plant": false,
"level": 3,
"plantType": "PEANUT",
"waterTime": 1591891173326,
"totalTime": 300000000,
"waterRestCount": 0
"waterTime": "",
"index": 1,
"plantType": ""
},
{
"level": 2,
"waterRestCount": 0,
"totalTime": 120000,
"plant": true,
"waterTime": 1591881517849,
"index": 2,
"plant": false,
"level": 1,
"plantType": "CASHEWNUT",
"waterTime": 1591891173326,
"totalTime": 3000,
"waterRestCount": 0
"plantType": "PECAN"
},
{
"index": 3,
"level": "",
"waterRestCount": "",
"plant": false,
"level": 1,
"plantType": "PECAN",
"waterTime": 1591891173326,
"totalTime": 300000000,
"waterRestCount": 0
"waterTime": "",
"index": 3,
"plantType": ""
},
{
"level": 2,
"waterRestCount": 0,
"totalTime": 120000,
"plant": true,
"waterTime": 1591882423283,
"index": 4,
"plant": false,
"level": "",
"plantType": "",
"waterTime": "",
"totalTime": "",
"waterRestCount": ""
"plantType": "CHESTNUT"
}
]
}
},
"success": true,
"message": "成功"
}
{
"success": true,
"code": "000000",
"data": {
"storages": {
"CASHEWNUT": 0,
"PISTACHIONUT": 2,
"CHESTNUT": 1,
"PECAN": 1,
"MELON": 3,
"PISTACHIONUT": 0,
"CHESTNUT": 0,
"PECAN": 0,
"MELON": 0,
"PEANUT": 0
}
}
},
"success": true,
"message": "成功"
}
This diff is collapsed.
This diff is collapsed.
......@@ -6,8 +6,9 @@ var fs = require("fs");
// fs.readFileSync("./output.js")
// )
var endPath = '/Users/haiyoucuv/Documents/Web/淘宝恰恰/taobaominiDemo/client/pages/index/';
var version = Math.round(new Date().getTime() / 1000);
fs.writeFileSync(endPath + "output." + version + ".js", fs.readFileSync("./released/output.js"));
// var version = Math.round(new Date().getTime() / 1000);
// fs.writeFileSync(endPath + "output." + version + ".js", fs.readFileSync("./released/output.js"));
fs.writeFileSync(endPath + "output.js", fs.readFileSync("./released/output.js"));
// console.log("js覆盖完成")
console.log(`版本号:
${version}`)
// console.log(`版本号:
// ${version}`)
......@@ -7104,5 +7104,5 @@ export const ResJson = {
}
}
],
"path": "https://yun.duiba.com.cn/db_games/activity/anything/1591876100/resource/"
"path": "https://yun.duiba.com.cn/db_games/activity/anything/1591879548/resource/"
}
\ No newline at end of file
......@@ -90,6 +90,7 @@ export function sendTbNet(netName: TbNetName, parameter: any, callback: Function
let invoke = (query.length >= 2) ? query[0] : 'qiaqiaHome';
let route = (query.length >= 2) ? query[1] : query[0];
parameter.activityId = activityId;
//网络超时
let waitObj = wait(() => {
if (!hideMsg) showToast("网络超时")
......@@ -142,6 +143,18 @@ export function sendTbNet(netName: TbNetName, parameter: any, callback: Function
if (!hideMsg && !res.success) showToast(codeMsg[res.code] || res.message || "网络异常")
//回调
callback(res.success, res);
console.log(
`\n%c[ mock ]\n`
+ `NAME : ${netName} \n`
+ `STATE : %o \n`
+ `PARAM : %o \n`
+ `%cDATA : %o \n`
, `${res.success ? 'color:green' : 'color:red'}`
, res.success
, parameter
, `${res.success ? 'color:green' : 'color:red'}`
, res
);
})
}
......
......@@ -86,8 +86,9 @@ export class Tool {
return;
}
// const src = "cloud://A8673B47AAA58993A24A6718E203B967//dice.svga";
const src = `../resource/svga/${name}.svga`; /// TODO 线上替换
const src = `cloud://21DC968488CF65B20EC98D34D07B7B9D//${name}.svga`;
// cloud://21DC968488CF65B20EC98D34D07B7B9D//浇水动效.svga
// const src = `../resource/svga/${name}.svga`; /// TODO 线上替换
SvgaParser.loadSvga(src, (v) => {
Tool.svgaCache[name] = v; // 做一个缓存
const mv = new MovieClip(v);
......
......@@ -135,8 +135,8 @@ class WareHouseItem
nameLabel.position.set((this.width - nameLabel.textWidth) / 2, 212);
this.countLabel = this.addChild(Tool.getText('数量:0', 22, '#9a9a9a'));
this.countLabel.position.set(111, 258);
this.countLabel.textWidth = this.width;
this.countLabel.position.set(0, 258);
this.count = 0;
this.type = type;
......
......@@ -14,7 +14,6 @@ import { showToast } from "../../../module/ctrls";
import { OPTION_TYPE } from "../../const/staticData";
import { Tool } from "../../Tools";
import { getAdjustBottomHeight } from "../../const/myLab";
import PanelCtrl from "../../../module/ctrls/panelCtrl";
import { GameScene } from "../../scenes/GameScene";
import SceneCtrl from "../../../module/ctrls/sceneCtrl";
......@@ -46,10 +45,6 @@ export default class GuideLayer extends Container {
private guide8Text: TextField;
private storeBtn: Sprite;
private guide9: Container;
private guide10: Container;
private bg;
private curGuide: Container;
......@@ -163,7 +158,6 @@ export default class GuideLayer extends Container {
// 种
private showGuide2() {
console.warn(1);
this.curGuide = this.guide2;
this.showBg();
......
......@@ -131,7 +131,7 @@ export class Land extends Container {
this.waterRestCount = +data.waterRestCount;
// 收获和浇水?
if (data.waterTime <= 0) {
if (data.waterTime <= 0 || data.waterTime <= Date.now()) {
if (this.waterRestCount <= 0) {
this.addOption(this.plant.state == PLANT_STATE.STATE3
? OPTION_TYPE.GET
......@@ -166,7 +166,7 @@ export class Land extends Container {
this.waterRestCount = +data.waterRestCount;
// 收获和浇水?
if (data.waterTime <= 0) {
if (data.waterTime <= 0 || data.waterTime <= Date.now()) {
if (this.waterRestCount <= 0) {
this.addOption(this.plant.state == PLANT_STATE.STATE3
? OPTION_TYPE.GET
......@@ -232,7 +232,9 @@ export class Land extends Container {
console.log("浇水");
// 浇水了浇水了
sendTbNet(TbNetName.water, {}, (success, res) => {
sendTbNet(TbNetName.water, {
index: this.id
}, (success, res) => {
if (!success) return;
Tool.getSvga('浇水动效').then((mv: MovieClip) => {
this.addChild(mv);
......@@ -241,7 +243,12 @@ export class Land extends Container {
mv.stop();
this.removeChild(mv);
this.updatePlant(res.data);
for (let i = 0; i < res.data.plants.length; i++) {
if (res.data.plants[i].index == this.id) {
this.updatePlant(res.data.plants[i]);
break;
}
}
});
GDispatcher.dispatchEvent('getWater');
......
......@@ -62,7 +62,7 @@ export default class ProgressBar extends Container {
this.visible = false;
return;
}
if(data.timestamp <= 0){
if(data.timestamp <= 0 || data.timestamp <= Date.now()){
this.dispatchEvent('endTime');
return;
}
......
......@@ -44,6 +44,7 @@ export class UserInfoGroup extends Container {
this.numLabel.position.set(200, 68);
this.numLabel.size = 28;
this.numLabel.fillColor = '#a65310';
this.numLabel.textWidth = 200;
// 更新信息
userInfo && this.updateInfo(userInfo);
......
......@@ -32,13 +32,14 @@ export class GameScene extends Scene {
});
// UI层
this.uiLayer = this.addChild(new UILayer());
// 游戏层
GameLayer.kill();
this.gameLayer = this.addChild(GameLayer.ins);
// UI层
this.uiLayer = this.addChild(new UILayer());
console.log(this.uiLayer)
// 广告按钮
this.adBtn = this.addChild(Tool.getSprite('广告.png'));
......
......@@ -19,11 +19,12 @@ export class GuideScene extends Scene {
// 游戏层
private gameLayer: GameLayer; // 游戏层
// 引导层
private guideLayer: GuideLayer;
// UI层
private uiLayer: UILayer;
// 引导层
private guideLayer: GuideLayer;
initUi() {
// 背景图
......
......@@ -8,7 +8,7 @@ import OptionPool from "../const/OptionPool";
import PlantEffectPool from "../const/PlantEffectPool";
import { RES } from "../../module/RES";
import { gameResource } from "../const/staticData";
import { checkShopFavoredStatus, getAuthUserInfo } from "../utils";
import { getAuthUserInfo } from "../utils";
import Container = FYGE.Container;
import Sprite = FYGE.Sprite;
import Tween = FYGE.Tween;
......@@ -32,20 +32,25 @@ export class LoadingScene extends Scene {
private tips: TextField;
async initUi() {
console.log(1);
setActiveId()
console.log(2);
gameResource.forEach((v) => {
RES.loadGroup(v);
});
Tool.getSvga('浇水动效');
console.log(3);
Tool.getSvga('浇水动效');
console.log(4);
// 游戏信息
await sendTbNet(TbNetName.baseInfo, {}, (success, res) => {
await sendTbNet(TbNetName.baseInfo, {
activityId: activityId
}, (success, res) => {
console.log(success, res);
});
console.log(5);
// 用户信息
var userInfo: any = await getAuthUserInfo().catch(() => {
})
......@@ -55,16 +60,16 @@ export class LoadingScene extends Scene {
data: userInfo
});
var isFollow = false;
var isFollow = true;
// @ts-ignore
isFollow = await checkShopFavoredStatus(sellerId).catch((err) => {
console.log(err);
isFollow = false;
});
// isFollow = await checkShopFavoredStatus(sellerId).catch((err) => {
// console.log(err);
// isFollow = false;
// });
console.log('isFollow', isFollow);
if (!isFollow === undefined || !isFollow === null) {
if (isFollow !== undefined || isFollow !== null) {
console.log('isFollow1', isFollow);
setTbData(TbNetName.isFollow, {
data: isFollow
......@@ -136,7 +141,7 @@ export class LoadingScene extends Scene {
this.titleEffect().call(() => {
this.startLoading().call(() => {
const gameInfo: any = getTbData(TbNetName.gameInfo);
const gameInfo: any = getTbData(TbNetName.gameInfo).data;
SceneCtrl.instance.change(gameInfo.guideIsEnd ? GameScene : GuideScene);
});
});
......
......@@ -4,12 +4,13 @@ const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const webpack = require('webpack');
module.exports = merge(common, {
mode: "production",
mode: "development",
devtool: 'source-map',
plugins: [
new UglifyJSPlugin(
{ sourceMap: false }
), new webpack.DefinePlugin({
// new UglifyJSPlugin(
// { sourceMap: false }
// ),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
})
]
......
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