Commit a1b69f27 authored by haiyoucuv's avatar haiyoucuv

guide

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