Commit d7d3265a authored by haiyoucuv's avatar haiyoucuv

fixProgress

parent c8927989
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{
"success": true,
"message": "",
"data": true
}
...@@ -3,39 +3,41 @@ ...@@ -3,39 +3,41 @@
"data": { "data": {
"guideStep": 8, "guideStep": 8,
"guideIsEnd": true, "guideIsEnd": true,
"waterDrops": 999, "waterDrops": 94,
"plants": [ "plants": [
{ {
"level": "", "level": 2,
"waterRestCount": "", "waterRestCount": 1,
"plant": false, "totalTime": 3000,
"waterTime": "", "plant": true,
"waterTime": 1591954069560,
"index": 1, "index": 1,
"plantType": "" "plantType": "CHESTNUT"
}, },
{ {
"level": 2, "level": 3,
"waterRestCount": 0, "waterRestCount": 0,
"totalTime": 120000, "totalTime": 0,
"plant": true, "plant": false,
"waterTime": 1591881517849, "waterTime": "",
"index": 2, "index": 2,
"plantType": "PECAN" "plantType": "CHESTNUT"
}, },
{ {
"level": "", "level": 3,
"waterRestCount": "", "waterRestCount": 0,
"totalTime": 0,
"plant": false, "plant": false,
"waterTime": "", "waterTime": "",
"index": 3, "index": 3,
"plantType": "" "plantType": "CHESTNUT"
}, },
{ {
"level": 2, "level": 3,
"waterRestCount": 0, "waterRestCount": 0,
"totalTime": 120000, "totalTime": 0,
"plant": true, "plant": false,
"waterTime": 1591882423283, "waterTime": "",
"index": 4, "index": 4,
"plantType": "CHESTNUT" "plantType": "CHESTNUT"
} }
......
{ {
"code": "000000",
"data": true,
"success": true, "success": true,
"data": true "message": "成功"
} }
This diff is collapsed.
This diff is collapsed.
...@@ -113,11 +113,7 @@ ...@@ -113,11 +113,7 @@
"name": "shopPanel" "name": "shopPanel"
}, },
{ {
"keys": "浇水动效.svga", "keys": "task_browseGoods_icon.png,task_btn_bg.png,task_done.png,task_follow_icon.png,task_get.png,task_go.png,task_icon.png,task_invites_icon.png,task_item_bg.png,task_joinGroup_icon.png,task_member_icon.png,task_order_icon.png,task_sign_icon.png",
"name": "svga"
},
{
"keys": "task_browseGoods_icon.png,task_done.png,task_follow_icon.png,task_go.png,task_icon.png,task_invites_icon.png,task_item_bg.png,task_joinGroup_icon.png,task_member_icon.png,task_order_icon.png,task_sign_icon.png",
"name": "taskPanel" "name": "taskPanel"
}, },
{ {
......
...@@ -6879,16 +6879,12 @@ export const ResJson = { ...@@ -6879,16 +6879,12 @@ export const ResJson = {
} }
}, },
{ {
"keys": "浇水动效.svga", "keys": "task_browseGoods_icon.png,task_btn_bg.png,task_done.png,task_follow_icon.png,task_get.png,task_go.png,task_icon.png,task_invites_icon.png,task_item_bg.png,task_joinGroup_icon.png,task_member_icon.png,task_order_icon.png,task_sign_icon.png",
"name": "svga"
},
{
"keys": "task_browseGoods_icon.png,task_done.png,task_follow_icon.png,task_go.png,task_icon.png,task_invites_icon.png,task_item_bg.png,task_joinGroup_icon.png,task_member_icon.png,task_order_icon.png,task_sign_icon.png",
"name": "taskPanel", "name": "taskPanel",
"atlas": { "atlas": {
"task_browseGoods_icon.png": { "task_browseGoods_icon.png": {
"x": 790, "x": 697,
"y": 141, "y": 176,
"w": 137, "w": 137,
"h": 137, "h": 137,
"ox": 0, "ox": 0,
...@@ -6897,9 +6893,20 @@ export const ResJson = { ...@@ -6897,9 +6893,20 @@ export const ResJson = {
"sh": 137, "sh": 137,
"ro": false "ro": false
}, },
"task_btn_bg.png": {
"x": 836,
"y": 141,
"w": 129,
"h": 66,
"ox": 0,
"oy": 0,
"sw": 129,
"sh": 66,
"ro": true
},
"task_done.png": { "task_done.png": {
"x": 765, "x": 836,
"y": 280, "y": 272,
"w": 71, "w": 71,
"h": 24, "h": 24,
"ox": 29, "ox": 29,
...@@ -6919,9 +6926,20 @@ export const ResJson = { ...@@ -6919,9 +6926,20 @@ export const ResJson = {
"sh": 137, "sh": 137,
"ro": false "ro": false
}, },
"task_get.png": {
"x": 929,
"y": 133,
"w": 129,
"h": 66,
"ox": 0,
"oy": 0,
"sw": 129,
"sh": 66,
"ro": true
},
"task_go.png": { "task_go.png": {
"x": 697, "x": 929,
"y": 176, "y": 2,
"w": 129, "w": 129,
"h": 66, "h": 66,
"ox": 0, "ox": 0,
...@@ -7104,5 +7122,5 @@ export const ResJson = { ...@@ -7104,5 +7122,5 @@ export const ResJson = {
} }
} }
], ],
"path": "https://yun.duiba.com.cn/db_games/activity/anything/1591879548/resource/" "path": "https://yun.duiba.com.cn/db_games/activity/anything/1591954961/resource/"
} }
\ No newline at end of file
import { showToast, wait, clearWait } from "../module/ctrls"; import { showToast, wait, clearWait } from "../module/ctrls";
import { commonToast, getUserAddress } from "./utils";
// @ts-ignore // @ts-ignore
...@@ -47,6 +48,8 @@ export enum TbNetName { ...@@ -47,6 +48,8 @@ export enum TbNetName {
guide = 'qiaqiaHome.doNoviceGuide', guide = 'qiaqiaHome.doNoviceGuide',
receiveTaskRewards = 'qiaqia2.receiveTaskRewards',
// 游戏信息 // 游戏信息
gameInfo = 'qiaqiaHome.getGameInfo', gameInfo = 'qiaqiaHome.getGameInfo',
...@@ -86,6 +89,7 @@ export function setTbData(key: TbNetName, data) { ...@@ -86,6 +89,7 @@ export function setTbData(key: TbNetName, data) {
* @param hideMsg * @param hideMsg
*/ */
export function sendTbNet(netName: TbNetName, parameter: any, callback: Function, hideMsg: boolean = false) { export function sendTbNet(netName: TbNetName, parameter: any, callback: Function, hideMsg: boolean = false) {
return new Promise((resolve, reject) => {
let query = netName.split('.'); let query = netName.split('.');
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];
...@@ -94,6 +98,7 @@ export function sendTbNet(netName: TbNetName, parameter: any, callback: Function ...@@ -94,6 +98,7 @@ export function sendTbNet(netName: TbNetName, parameter: any, callback: Function
//网络超时 //网络超时
let waitObj = wait(() => { let waitObj = wait(() => {
if (!hideMsg) showToast("网络超时") if (!hideMsg) showToast("网络超时")
resolve();
callback(false) callback(false)
}, 5000) }, 5000)
//@ts-ignore 本地开发,直接取数据 //@ts-ignore 本地开发,直接取数据
...@@ -108,6 +113,7 @@ export function sendTbNet(netName: TbNetName, parameter: any, callback: Function ...@@ -108,6 +113,7 @@ export function sendTbNet(netName: TbNetName, parameter: any, callback: Function
//统一错误信息提示 //统一错误信息提示
if (!hideMsg && !data.success) showToast(data.message || "网络异常") if (!hideMsg && !data.success) showToast(data.message || "网络异常")
//回调 //回调
resolve(data);
callback(data.success, data); callback(data.success, data);
...@@ -142,6 +148,7 @@ export function sendTbNet(netName: TbNetName, parameter: any, callback: Function ...@@ -142,6 +148,7 @@ 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 || "网络异常")
//回调 //回调
resolve(res);
callback(res.success, res); callback(res.success, res);
console.log( console.log(
`\n%c[ mock ]\n` `\n%c[ mock ]\n`
...@@ -156,6 +163,56 @@ export function sendTbNet(netName: TbNetName, parameter: any, callback: Function ...@@ -156,6 +163,56 @@ export function sendTbNet(netName: TbNetName, parameter: any, callback: Function
, res , res
); );
}) })
})
}
export async function getUserAddress11(prizeId) {
const userAddress = await getUserAddress().catch(res => {
commonToast(res.errorMessage)
})
if (userAddress) {
// @ts-ignore
const {error, provinceName, countyName, cityName, streetName, detailInfo, name, telNumber, cityCode} = userAddress;
let address = [provinceName, cityName, countyName, streetName, detailInfo].join('');
//@ts-ignore
my.confirm({
title: '提示',
content: '确认使用该收货地址:' + name + telNumber + address,
confirmButtonText: '确定',
cancelButtonText: '取消',
success: (result) => {
const {confirm} = result
if (confirm) {
//发接口提交地址
// @ts-ignore
const {cloud, activityId} = my && getApp()
cloud.function.invoke('qiaqia2', {
activityId,
_id: prizeId,
address,
name,
telNumber,
cityCode
// address: JSON.stringify(userAddress.duibaAddress)
}, "receiveObjectPrize")
.then(res => {
if (res && res.success) {
console.log("提交成功");
} else {
console.log("提交失败1");
}
})
.catch(() => {
console.log("云函数调用失败");
})
} else {
console.log("用户取消");
}
},
})
}
} }
/** /**
......
...@@ -86,9 +86,9 @@ export class Tool { ...@@ -86,9 +86,9 @@ export class Tool {
return; return;
} }
const src = `cloud://21DC968488CF65B20EC98D34D07B7B9D//${name}.svga`;
// cloud://21DC968488CF65B20EC98D34D07B7B9D//浇水动效.svga // cloud://21DC968488CF65B20EC98D34D07B7B9D//浇水动效.svga
// const src = `../resource/svga/${name}.svga`; /// TODO 线上替换 const src = `cloud://21DC968488CF65B20EC98D34D07B7B9D//${name}.svga`;
// const src = `../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);
......
...@@ -67,7 +67,6 @@ export default class PlantEffectPool { ...@@ -67,7 +67,6 @@ export default class PlantEffectPool {
// this.seed[type] = [new SeedEffect(type)]; // this.seed[type] = [new SeedEffect(type)];
this.seed[type] = []; this.seed[type] = [];
} }
console.log(this.plant);
} }
/** /**
......
import { Panel } from "../../module/views/Panel"; import { Panel } from "../../module/views/Panel";
import { Tool } from "../Tools"; import { Tool } from "../Tools";
import { layers } from "../../module/views/layers"; import { layers } from "../../module/views/layers";
import { activityId, sendTbNet, TbNetName } from "../TaoBaoNet"; import { activityId, getUserAddress11, sendTbNet, TbNetName } from "../TaoBaoNet";
import { RES } from "../../module/RES"; import { RES } from "../../module/RES";
import Sprite = FYGE.Sprite; import Sprite = FYGE.Sprite;
import Tween = FYGE.Tween; import Tween = FYGE.Tween;
...@@ -51,7 +51,7 @@ export default class ExRecordPanel extends Panel { ...@@ -51,7 +51,7 @@ export default class ExRecordPanel extends Panel {
activityId: activityId activityId: activityId
}, (success, res) => { }, (success, res) => {
if (!success) return; if (!success) return;
this.scroll.updateData(res.data); this.scroll.updateData(res.data, true);
}); });
} }
...@@ -123,7 +123,7 @@ class RecordItem extends Container implements IScrollListItem { ...@@ -123,7 +123,7 @@ class RecordItem extends Container implements IScrollListItem {
this.btn.texture = RES.getRes('record_en.png'); this.btn.texture = RES.getRes('record_en.png');
this.btn.addEventListener(MouseEvent.CLICK, () => { this.btn.addEventListener(MouseEvent.CLICK, () => {
if (this.data.type == 1) { if (this.data.type == 1) {
/// todo 权益 // 权益
sendTbNet(TbNetName.receiveEname, { sendTbNet(TbNetName.receiveEname, {
_id: this.data._id, _id: this.data._id,
activityId: activityId activityId: activityId
...@@ -135,7 +135,10 @@ class RecordItem extends Container implements IScrollListItem { ...@@ -135,7 +135,10 @@ class RecordItem extends Container implements IScrollListItem {
GDispatcher.dispatchEvent(G_EVENT.GET_MY_PRIZE_LIST); GDispatcher.dispatchEvent(G_EVENT.GET_MY_PRIZE_LIST);
}); });
} else if (this.data.type == 3) { } else if (this.data.type == 3) {
// todo 实物 // 实物
getUserAddress11(this.data._id).then(() => {
GDispatcher.dispatchEvent(G_EVENT.GET_MY_PRIZE_LIST);
});
} }
}, this); }, this);
} else { } else {
......
...@@ -6,6 +6,7 @@ import TextField = FYGE.TextField; ...@@ -6,6 +6,7 @@ import TextField = FYGE.TextField;
import Texture = FYGE.Texture; import Texture = FYGE.Texture;
import { showToast } from "../../module/ctrls"; import { showToast } from "../../module/ctrls";
import PanelCtrl from "../../module/ctrls/panelCtrl"; import PanelCtrl from "../../module/ctrls/panelCtrl";
import { getUserAddress11 } from "../TaoBaoNet";
export default class ExSuccessPanel extends Panel { export default class ExSuccessPanel extends Panel {
get groupNames() { get groupNames() {
...@@ -27,7 +28,7 @@ export default class ExSuccessPanel extends Panel { ...@@ -27,7 +28,7 @@ export default class ExSuccessPanel extends Panel {
// 图片 // 图片
this.prizeImg = this.addChild(new Sprite()); this.prizeImg = this.addChild(new Sprite());
this.prizeImg.texture = Texture.fromUrl(this.data.image); this.prizeImg.texture = Texture.fromUrl(this.data.image);
this.prizeImg.width = 427; this.prizeImg.width = 200;//427;
this.prizeImg.height = 200; this.prizeImg.height = 200;
this.prizeImg.position.set((this.width - this.prizeImg.width) / 2, 677); this.prizeImg.position.set((this.width - this.prizeImg.width) / 2, 677);
...@@ -44,12 +45,14 @@ export default class ExSuccessPanel extends Panel { ...@@ -44,12 +45,14 @@ export default class ExSuccessPanel extends Panel {
} }
private clickBtn() { private clickBtn() {
if (+this.data.type == 1 && (this.data.drawStatus == 4 || this.data.drawStatus == 6)) { if (+this.data.type == 1 && (+this.data.drawStatus == 4)) {
showToast('奖品发放失败\n请前往我的奖品处进行处理'); showToast('奖品发放失败\n请前往我的奖品处进行处理');
this.hideAll();
} else if (+this.data.type == 3) { } else if (+this.data.type == 3) {
/// TODO 淘宝地址选择页? getUserAddress11(this.data._id).then(() => {
}
this.hideAll(); this.hideAll();
});
}
} }
private hideAll() { private hideAll() {
......
...@@ -42,12 +42,10 @@ export class ExchangePanel extends Panel { ...@@ -42,12 +42,10 @@ export class ExchangePanel extends Panel {
prizeImg.mask = imgMask; prizeImg.mask = imgMask;
let enough = true; let enough = true;
'exchange_btn_en.png';
for (let i = 0; i < this.data.exchangeInfo.length; i++) { for (let i = 0; i < this.data.exchangeInfo.length; i++) {
let d = this.data.exchangeInfo[i]; let d = this.data.exchangeInfo[i];
if (d.value > d.storage) { if (d.value > d.storage) {
enough = false; enough = false;
'exchange_btn_dis.png';
break; break;
} }
} }
...@@ -63,7 +61,7 @@ export class ExchangePanel extends Panel { ...@@ -63,7 +61,7 @@ export class ExchangePanel extends Panel {
introduction.textAlign = TEXT_ALIGN.LEFT; introduction.textAlign = TEXT_ALIGN.LEFT;
introduction.position.set(139, 980); introduction.position.set(139, 980);
// if (this.data.type == 1) { // if (+this.data.type == 1) {
// // let sDate = new Date(this.data.startTime); // // let sDate = new Date(this.data.startTime);
// let eDate = new Date(this.data.endTime); // let eDate = new Date(this.data.endTime);
// // let sLabel = `${sDate.getFullYear()}/${sDate.getMonth() + 1}/${sDate.getDate()}`; // // let sLabel = `${sDate.getFullYear()}/${sDate.getMonth() + 1}/${sDate.getDate()}`;
...@@ -75,9 +73,9 @@ export class ExchangePanel extends Panel { ...@@ -75,9 +73,9 @@ export class ExchangePanel extends Panel {
if (this.data.isLimitStock) { if (this.data.isLimitStock) {
// 库存剩余label // 库存剩余label
let stock = this.addChild(Tool.getText(`剩余数量:${this.data.restStock}/${this.data.stock}份`, 20, '#dbd2ca')); let stock = this.addChild(Tool.getText(`剩余数量:${this.data.restStock}/${this.data.stock}份`, 20, '#dbd2ca'));
introduction.textWidth = 470; stock.textWidth = 470;
introduction.lineType = TEXT_lINETYPE.MULTI; stock.lineType = TEXT_lINETYPE.MULTI;
introduction.textAlign = TEXT_ALIGN.LEFT; stock.textAlign = TEXT_ALIGN.LEFT;
stock.position.set(137, introduction.y + introduction.textHeight + 5); stock.position.set(137, introduction.y + introduction.textHeight + 5);
} }
...@@ -92,6 +90,10 @@ export class ExchangePanel extends Panel { ...@@ -92,6 +90,10 @@ export class ExchangePanel extends Panel {
return; return;
} }
let data = res.data; let data = res.data;
if (+data.drawStatus == 6) {
showToast('今日兑换已达上限');
return;
}
PanelCtrl.instance.show(ExSuccessPanel, data); PanelCtrl.instance.show(ExSuccessPanel, data);
}); });
}); });
......
...@@ -43,6 +43,7 @@ export default class GuidePanel extends Panel { ...@@ -43,6 +43,7 @@ export default class GuidePanel extends Panel {
if (!res.data) { if (!res.data) {
showToast('请稍后再试'); showToast('请稍后再试');
} }
GDispatcher.dispatchEvent('getWater');
GDispatcher.dispatchEvent(G_EVENT.GUIDE2); GDispatcher.dispatchEvent(G_EVENT.GUIDE2);
this.hidePanel(); this.hidePanel();
}); });
......
...@@ -6,6 +6,7 @@ import { ExchangePanel } from "./ExchangePanel"; ...@@ -6,6 +6,7 @@ import { ExchangePanel } from "./ExchangePanel";
import { GDispatcher } from "../Main"; import { GDispatcher } from "../Main";
import { G_EVENT } from "../const/GEVENT"; import { G_EVENT } from "../const/GEVENT";
import { activityId, sendTbNet, TbNetName } from "../TaoBaoNet"; import { activityId, sendTbNet, TbNetName } from "../TaoBaoNet";
import { s_PlantData } from "../const/staticData";
import Sprite = FYGE.Sprite; import Sprite = FYGE.Sprite;
import Tween = FYGE.Tween; import Tween = FYGE.Tween;
import Container = FYGE.Container; import Container = FYGE.Container;
...@@ -16,7 +17,7 @@ import Graphics = FYGE.Graphics; ...@@ -16,7 +17,7 @@ import Graphics = FYGE.Graphics;
import TextField = FYGE.TextField; import TextField = FYGE.TextField;
import Ease = FYGE.Ease; import Ease = FYGE.Ease;
import MouseEvent = FYGE.MouseEvent; import MouseEvent = FYGE.MouseEvent;
import { s_PlantData } from "../const/staticData"; import TEXT_ALIGN = FYGE.TEXT_ALIGN;
export default class ShopPanel extends Panel { export default class ShopPanel extends Panel {
get groupNames() { get groupNames() {
...@@ -74,7 +75,7 @@ export default class ShopPanel extends Panel { ...@@ -74,7 +75,7 @@ export default class ShopPanel extends Panel {
activityId: activityId activityId: activityId
}, (success, res) => { }, (success, res) => {
if (!success) return; if (!success) return;
this.scroll.updateData(res.data); this.scroll.updateData(res.data, true);
}); });
} }
...@@ -141,10 +142,14 @@ class ShopItem extends Container implements IScrollListItem { ...@@ -141,10 +142,14 @@ class ShopItem extends Container implements IScrollListItem {
let n = exchangeInfoRoot.addChild(new Container()) let n = exchangeInfoRoot.addChild(new Container())
let img = n.addChild(Tool.getSprite(`种植框_${s_PlantData[v.type].name}.png`)); let img = n.addChild(Tool.getSprite(`种植框_${s_PlantData[v.type].name}.png`));
let textNode = n.addChild(new Container()); let textNode = n.addChild(new Container());
let leftText = textNode.addChild(Tool.getText(`${v.storage}`, 22, v.storage >= v.value ? '#8b572b' : '#ff0000')); let leftText = textNode.addChild(Tool.getText(`${v.storage}`, 22, v.storage >= v.value ? '#8b572b' : '#ff0000'));
textNode.addChild(Tool.getText(`/${v.value}`, 22, '#8b572b')) leftText.textAlign = TEXT_ALIGN.LEFT;
.position.set(leftText.x + leftText.textWidth, leftText.y);
let rightText = textNode.addChild(Tool.getText(`/${v.value}`, 22, '#8b572b'));
rightText.position.set(leftText.x + leftText.textWidth, leftText.y);
rightText.textAlign = TEXT_ALIGN.LEFT;
if (textNode.width > img.width) { if (textNode.width > img.width) {
img.x = (textNode.width - img.width); img.x = (textNode.width - img.width);
...@@ -182,8 +187,10 @@ class ShopItem extends Container implements IScrollListItem { ...@@ -182,8 +187,10 @@ class ShopItem extends Container implements IScrollListItem {
this.itemName = this.addChild(Tool.getText('', 26, '#4a4a4a')); this.itemName = this.addChild(Tool.getText('', 26, '#4a4a4a'));
this.itemName.position.set(185, 24); this.itemName.position.set(185, 24);
this.itemName.textAlign = TEXT_ALIGN.LEFT;
this.itemNum = this.addChild(Tool.getText('剩余0份', 18, '#f94c2a')); this.itemNum = this.addChild(Tool.getText('剩余0份', 18, '#f94c2a'));
this.itemNum.textWidth = 400;
this.itemNum.position.set((this.width - this.itemNum.textWidth) / 2, 176); this.itemNum.position.set((this.width - this.itemNum.textWidth) / 2, 176);
} }
......
This diff is collapsed.
...@@ -8,6 +8,7 @@ import { Tool } from "../../Tools"; ...@@ -8,6 +8,7 @@ import { Tool } from "../../Tools";
import { layers } from "../../../module/views/layers"; import { layers } from "../../../module/views/layers";
import { G_wareHouseEffect } from "../UI/UILayer"; import { G_wareHouseEffect } from "../UI/UILayer";
import { activityId, getTbData, sendTbNet, TbNetName } from "../../TaoBaoNet"; import { activityId, getTbData, sendTbNet, TbNetName } from "../../TaoBaoNet";
import { getAdjustBottomHeight } from "../../const/myLab";
/** /**
...@@ -115,14 +116,14 @@ export default class GameLayer extends Container { ...@@ -115,14 +116,14 @@ export default class GameLayer extends Container {
getEffect.mouseEnable = false; getEffect.mouseEnable = false;
getEffect.position.set(this.landList[id].x + 185, this.landList[id].y + 55); getEffect.position.set(this.landList[id].x + 185, this.landList[id].y + 55);
let _x = 375 - getEffect.width / 2; let _x = 375 - getEffect.width / 2;
let _y = layers.stageHeight - layers.stageOffsetY - 205; let _y = layers.stageHeight - layers.stageHeight * (1624 - 1382 - 133) / 1624 - 133 + layers.stageOffsetY;
let __y = getEffect.y; let __y = getEffect.y;
Tween.get(getEffect) Tween.get(getEffect)
.to({y: __y - 15}, 200) .to({y: __y - 15}, 200)
.to({y: __y}, 200) .to({y: __y}, 200)
.to({y: __y - 15}, 200) .to({y: __y - 15}, 200)
.to({y: __y}, 200) .to({y: __y}, 200)
.to({x: _x, y: _y, scaleX: 1.2, scaleY: 1.2}, 1000, Ease.quadInOut) .to({x: _x, y: _y, scaleX: 1.2, scaleY: 1.2}, 700, Ease.quadInOut)
.call(() => { .call(() => {
Tween.get(getEffect) Tween.get(getEffect)
.to({alpha: 0}, 300) .to({alpha: 0}, 300)
......
...@@ -284,7 +284,7 @@ export default class GuideLayer extends Container { ...@@ -284,7 +284,7 @@ export default class GuideLayer extends Container {
Tween.get(this.guide6) Tween.get(this.guide6)
.set({visible: true, alpha: 0}) .set({visible: true, alpha: 0})
.to({alpha: 1}, 350); .to({alpha: 1}, 350);
this.taskBtn.once(MouseEvent.CLICK, () => { this.stage.once(MouseEvent.CLICK, () => {
sendTbNet(TbNetName.guide, { sendTbNet(TbNetName.guide, {
activityId: activityId, activityId: activityId,
index: 6 index: 6
...@@ -304,7 +304,7 @@ export default class GuideLayer extends Container { ...@@ -304,7 +304,7 @@ export default class GuideLayer extends Container {
Tween.get(this.guide7) Tween.get(this.guide7)
.set({visible: true, alpha: 0}) .set({visible: true, alpha: 0})
.to({alpha: 1}, 350); .to({alpha: 1}, 350);
this.wareHouseBtn.once(MouseEvent.CLICK, () => { this.stage.once(MouseEvent.CLICK, () => {
sendTbNet(TbNetName.guide, { sendTbNet(TbNetName.guide, {
activityId: activityId, activityId: activityId,
index: 7 index: 7
...@@ -324,7 +324,7 @@ export default class GuideLayer extends Container { ...@@ -324,7 +324,7 @@ export default class GuideLayer extends Container {
Tween.get(this.guide8) Tween.get(this.guide8)
.set({visible: true, alpha: 0}) .set({visible: true, alpha: 0})
.to({alpha: 1}, 350); .to({alpha: 1}, 350);
this.storeBtn.once(MouseEvent.CLICK, () => { this.stage.once(MouseEvent.CLICK, () => {
sendTbNet(TbNetName.guide, { sendTbNet(TbNetName.guide, {
activityId: activityId, activityId: activityId,
index: 8 index: 8
......
...@@ -82,6 +82,7 @@ export class Land extends Container { ...@@ -82,6 +82,7 @@ export class Land extends Container {
timestamp: -1, timestamp: -1,
fullTime: 3, fullTime: 3,
}); });
this.progressBar.position.set(80, 130);
// 添加事件 // 添加事件
this.addEvent(); this.addEvent();
...@@ -182,6 +183,8 @@ export class Land extends Container { ...@@ -182,6 +183,8 @@ export class Land extends Container {
type: data.plantType, type: data.plantType,
timestamp: +data.waterTime, timestamp: +data.waterTime,
fullTime: +data.totalTime, fullTime: +data.totalTime,
// timestamp: Date.now()+3000,
// fullTime: 3000,
}); });
this.progressBar.show(); this.progressBar.show();
......
import { PLANT_TYPE, s_PlantData } from "../../const/staticData"; import { PLANT_TYPE, s_PlantData } from "../../const/staticData";
import { Tool } from "../../Tools"; import { Tool } from "../../Tools";
import { RES } from "../../../module/RES";
import GameLayer from "./GameLayer";
import { Land } from "./Land";
import { GDispatcher } from "../../Main";
import { G_EVENT } from "../../const/GEVENT";
import Container = FYGE.Container; import Container = FYGE.Container;
import IScrollListItem = FYGE.IScrollListItem; import IScrollListItem = FYGE.IScrollListItem;
import ScrollList = FYGE.ScrollList; import ScrollList = FYGE.ScrollList;
import TextField = FYGE.TextField; import TextField = FYGE.TextField;
import TEXT_ALIGN = FYGE.TEXT_ALIGN;
import VERTICAL_ALIGN = FYGE.VERTICAL_ALIGN; import VERTICAL_ALIGN = FYGE.VERTICAL_ALIGN;
import Sprite = FYGE.Sprite; import Sprite = FYGE.Sprite;
import { RES } from "../../../module/RES";
import Tween = FYGE.Tween; import Tween = FYGE.Tween;
import Ease = FYGE.Ease; import Ease = FYGE.Ease;
import GameLayer from "./GameLayer";
import MouseEvent = FYGE.MouseEvent; import MouseEvent = FYGE.MouseEvent;
import { Land } from "./Land"; import TEXT_ALIGN = FYGE.TEXT_ALIGN;
import { activityId, sendTbNet, TbNetName } from "../../TaoBaoNet";
import { showToast } from "../../../module/ctrls";
import { GDispatcher } from "../../Main";
import { G_EVENT } from "../../const/GEVENT";
export default class PlantList extends Container { export default class PlantList extends Container {
...@@ -50,7 +48,7 @@ export default class PlantList extends Container { ...@@ -50,7 +48,7 @@ export default class PlantList extends Container {
isGuide: isGuide isGuide: isGuide
}); });
} }
this.scrollList.updateData(data); this.scrollList.updateData(data, true);
this.scrollList.x = (this.width - 500) / 2; this.scrollList.x = (this.width - 500) / 2;
...@@ -126,7 +124,7 @@ class ListPlant extends Container implements IScrollListItem { ...@@ -126,7 +124,7 @@ class ListPlant extends Container implements IScrollListItem {
this.timeLabel.text = s_PlantData[key].time + 'h'; this.timeLabel.text = s_PlantData[key].time + 'h';
this.nameLabel.x = (this.width - this.nameLabel.textWidth) / 2; this.nameLabel.x = (this.width - this.nameLabel.textWidth) / 2;
this.timeLabel.x = 72 + (35 - this.timeLabel.textWidth) / 2; // this.timeLabel.x = 72 + (35 - this.timeLabel.textWidth) / 2;
} }
private nameLabel: TextField; private nameLabel: TextField;
...@@ -154,10 +152,11 @@ class ListPlant extends Container implements IScrollListItem { ...@@ -154,10 +152,11 @@ class ListPlant extends Container implements IScrollListItem {
// 需要时间的label // 需要时间的label
this.timeLabel = this.addChild(new TextField()); this.timeLabel = this.addChild(new TextField());
this.timeLabel.position.set(75, 85); this.timeLabel.position.set(73, 85);
this.timeLabel.size = 17; this.timeLabel.size = 17;
this.timeLabel.textAlign = TEXT_ALIGN.CENTER; this.timeLabel.textAlign = TEXT_ALIGN.CENTER;
this.timeLabel.verticalAlign = VERTICAL_ALIGN.MIDDLE; this.timeLabel.verticalAlign = VERTICAL_ALIGN.MIDDLE;
this.timeLabel.textWidth = 34;
this.img = this.addChild(new Sprite()); this.img = this.addChild(new Sprite());
......
...@@ -6,6 +6,7 @@ import Graphics = FYGE.Graphics; ...@@ -6,6 +6,7 @@ import Graphics = FYGE.Graphics;
import Tween = FYGE.Tween; import Tween = FYGE.Tween;
import Ease = FYGE.Ease; import Ease = FYGE.Ease;
import { PLANT_TYPE, s_PlantData } from "../../const/staticData"; import { PLANT_TYPE, s_PlantData } from "../../const/staticData";
import VERTICAL_ALIGN = FYGE.VERTICAL_ALIGN;
export default class ProgressBar extends Container { export default class ProgressBar extends Container {
...@@ -18,14 +19,14 @@ export default class ProgressBar extends Container { ...@@ -18,14 +19,14 @@ export default class ProgressBar extends Container {
super(); super();
this.addChild(Tool.getSprite('进度_bg.png')) this.addChild(Tool.getSprite('进度_bg.png'))
.position.set(80, 130); .position.set(0, 0);
// 进度 // 进度
this.fill = this.addChild(Tool.getSprite('进度_fill.png')); this.fill = this.addChild(Tool.getSprite('进度_fill.png'));
this.fill.position.set(136, 131); this.fill.position.set(56, 1);
// mask // mask
const mask = this.addChild(new Graphics()); const mask = this.addChild(new Graphics());
mask.drawRect(136, 131, 139, 29); mask.drawRect(56, 1, 139, 29);
this.fill.mask = mask; this.fill.mask = mask;
this.fill.x = -59; this.fill.x = -59;
...@@ -35,14 +36,19 @@ export default class ProgressBar extends Container { ...@@ -35,14 +36,19 @@ export default class ProgressBar extends Container {
this.nameLabel.size = 16; this.nameLabel.size = 16;
this.nameLabel.fillColor = '#333333'; this.nameLabel.fillColor = '#333333';
this.nameLabel.text = '山核桃'; this.nameLabel.text = '山核桃';
this.nameLabel.position.set(80 + (56 - this.nameLabel.textWidth) / 2, 139); this.nameLabel.position.set((56 - this.nameLabel.textWidth) / 2, 0);
this.nameLabel.textHeight = 31;
this.nameLabel.verticalAlign = VERTICAL_ALIGN.MIDDLE;
// timeLabel // timeLabel
this.timeLabel = this.addChild(new TextField()); this.timeLabel = this.addChild(new TextField());
this.timeLabel.size = 16; this.timeLabel.size = 16;
this.timeLabel.fillColor = '#fffefe'; this.timeLabel.fillColor = '#fffefe';
this.timeLabel.text = '0时0分后浇水'; this.timeLabel.text = '0时0分后浇水';
this.timeLabel.position.set(136 + (136 - this.timeLabel.textWidth) / 2, 139); this.timeLabel.position.set(56 + (56 - this.timeLabel.textWidth) / 2, 0);
this.timeLabel.textHeight = 31;
this.timeLabel.verticalAlign = VERTICAL_ALIGN.MIDDLE;
this.visible = false; this.visible = false;
} }
...@@ -62,18 +68,18 @@ export default class ProgressBar extends Container { ...@@ -62,18 +68,18 @@ export default class ProgressBar extends Container {
this.visible = false; this.visible = false;
return; return;
} }
if(data.timestamp <= 0 || data.timestamp <= Date.now()){ if (data.timestamp <= 0 || data.timestamp <= Date.now()) {
this.dispatchEvent('endTime'); this.dispatchEvent('endTime');
return; return;
} }
this.nameLabel.text = s_PlantData[data.type].name; this.nameLabel.text = s_PlantData[data.type].name;
this.nameLabel.position.set(80 + (56 - this.nameLabel.textWidth) / 2, 139); this.nameLabel.position.set((56 - this.nameLabel.textWidth) / 2, 0);
this.fullTime = data.fullTime / 1000; this.fullTime = data.fullTime / 1000;
this.cutTime = (data.timestamp - Date.now()) / 1000 + 3; this.cutTime = (data.timestamp - Date.now()) / 1000 + 1;
if (this.cutTime <= 3) { if (this.cutTime <= 1) {
this.cutTime = 3; this.cutTime = 1;
} }
this.setTime(); this.setTime();
this.interval && clearInterval(this.interval); this.interval && clearInterval(this.interval);
...@@ -98,10 +104,10 @@ export default class ProgressBar extends Container { ...@@ -98,10 +104,10 @@ export default class ProgressBar extends Container {
const hour = ~~(this.cutTime / 3600); const hour = ~~(this.cutTime / 3600);
const min = ~~((this.cutTime - hour * 3600 + 59) / 60); const min = ~~((this.cutTime - hour * 3600 + 59) / 60);
this.timeLabel.text = `${hour}${min}分后浇水`; this.timeLabel.text = `${hour}${min}分后浇水`;
this.timeLabel.position.set(136 + (136 - this.timeLabel.textWidth) / 2, 139); this.timeLabel.position.set(56 + (136 - this.timeLabel.textWidth) / 2, 0);
const progress = 1 - this.cutTime / this.fullTime; const progress = 1 - this.cutTime / this.fullTime;
this.fill.x = (195 - 59) * progress; this.fill.x = (this.width - 56) * progress - this.fill.width + 49;
} }
/** /**
......
...@@ -6,12 +6,12 @@ import { UserInfoGroup } from "./UserInfoGroup"; ...@@ -6,12 +6,12 @@ import { UserInfoGroup } from "./UserInfoGroup";
import { Tool } from "../../Tools"; import { Tool } from "../../Tools";
import { getAdjustBottomHeight, getAdjustTopHeight } from "../../const/myLab"; import { getAdjustBottomHeight, getAdjustTopHeight } from "../../const/myLab";
import PanelCtrl from "../../../module/ctrls/panelCtrl"; import PanelCtrl from "../../../module/ctrls/panelCtrl";
import TaskPanel from "../../panels/TaskPanel";
import WareHousePanel from "../../panels/WareHousePanel"; import WareHousePanel from "../../panels/WareHousePanel";
import ShopPanel from "../../panels/ShopPanel"; import ShopPanel from "../../panels/ShopPanel";
import RulePanel from "../../panels/RulePanel"; import RulePanel from "../../panels/RulePanel";
import { getTbData, TbNetName } from "../../TaoBaoNet"; import { getTbData, TbNetName } from "../../TaoBaoNet";
import ExRecordPanel from "../../panels/ExRecordPanel"; import ExRecordPanel from "../../panels/ExRecordPanel";
import TaskPanel from "../../panels/TaskPanel";
export let G_wareHouseEffect = () => { export let G_wareHouseEffect = () => {
}; };
......
...@@ -38,13 +38,12 @@ export class GameScene extends Scene { ...@@ -38,13 +38,12 @@ export class GameScene extends Scene {
// UI层 // UI层
this.uiLayer = this.addChild(new UILayer()); this.uiLayer = this.addChild(new UILayer());
console.log(this.uiLayer)
// 广告按钮 // 广告按钮
this.adBtn = this.addChild(Tool.getSprite('广告.png')); this.adBtn = this.addChild(Tool.getSprite('广告.png'));
this.adBtn.position.set(30, (1624 - this.adBtn.height) / 2); this.adBtn.position.set(30, (1624 - this.adBtn.height) / 2);
this.adBtn.name = '广告'; this.adBtn.name = '广告';
this.adBtn.visible = false;
} }
......
...@@ -32,25 +32,18 @@ export class LoadingScene extends Scene { ...@@ -32,25 +32,18 @@ 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);
}); });
console.log(3);
Tool.getSvga('浇水动效'); Tool.getSvga('浇水动效');
console.log(4);
// 游戏信息 // 游戏信息
await sendTbNet(TbNetName.baseInfo, { await sendTbNet(TbNetName.baseInfo, {
activityId: activityId activityId: activityId
}, (success, res) => { }, (success, res) => {
console.log(success, res);
}); });
console.log(5);
// 用户信息 // 用户信息
var userInfo: any = await getAuthUserInfo().catch(() => { var userInfo: any = await getAuthUserInfo().catch(() => {
}) })
...@@ -60,8 +53,8 @@ export class LoadingScene extends Scene { ...@@ -60,8 +53,8 @@ export class LoadingScene extends Scene {
data: userInfo data: userInfo
}); });
/// test
var isFollow = true; 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);
...@@ -69,30 +62,35 @@ export class LoadingScene extends Scene { ...@@ -69,30 +62,35 @@ export class LoadingScene extends Scene {
// }); // });
console.log('isFollow', isFollow); console.log('isFollow', isFollow);
if (isFollow !== undefined || isFollow !== null) {
console.log('isFollow1', isFollow);
setTbData(TbNetName.isFollow, { setTbData(TbNetName.isFollow, {
data: isFollow data: isFollow
}); });
// 登陆接口 // 登陆接口
// @ts-ignore
let inviteId = undefined;
// @ts-ignore
if(my){
// @ts-ignore
inviteId = getApp.inviteId;
}
await sendTbNet(TbNetName.login, { await sendTbNet(TbNetName.login, {
activityId: activityId, activityId: activityId,
userNick: userInfo.nickName, userNick: userInfo.nickName,
avatar: userInfo.avatar, avatar: userInfo.avatar,
isFollow: isFollow isFollow: isFollow,
}, (success, res) => { inviteId: inviteId
console.log(success, res); }, async (success, res) => {
// 游戏信息
// @ts-ignore
getApp()['openId'] = res.data.openId;
}); });
}
}
// 游戏信息
await sendTbNet(TbNetName.gameInfo, { await sendTbNet(TbNetName.gameInfo, {
activityId: activityId activityId: activityId
}, (success, res) => { }, (success, res) => {
console.log(success, res);
}); });
}
// bg // bg
this.addChild(Tool.getSprite('loading_bg.jpg')); this.addChild(Tool.getSprite('loading_bg.jpg'));
......
...@@ -19,8 +19,6 @@ export const commonToast = (content, duration = 3000) => { ...@@ -19,8 +19,6 @@ export const commonToast = (content, duration = 3000) => {
*/ */
export const getAuthUserInfo = () => { export const getAuthUserInfo = () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// @ts-ignore
console.log(11111, my);
// @ts-ignore // @ts-ignore
if (!my) { if (!my) {
resolve({ resolve({
...@@ -290,24 +288,28 @@ export const getUserAddress = (opts = {}) => { ...@@ -290,24 +288,28 @@ export const getUserAddress = (opts = {}) => {
searchAddress, searchAddress,
locateAddress locateAddress
}, res => { }, res => {
const {error, provinceName, countyName, cityName, streetName, detailInfo, name, telNumber} = res; // const {error, provinceName, countyName, cityName, streetName, detailInfo, name, telNumber} = res;
// 如果有error为用户取消操作不做操作 // 如果有error为用户取消操作不做操作
if (error) { if (res.error) {
resolve(false); resolve(false);
} else { } else {
resolve({ resolve({
...res, ...res
duibaAddress: { // ,
name, // duibaAddress: {
phone: telNumber, // name,
address: [provinceName, cityName, countyName, streetName, detailInfo].join(joinTag) // phone: telNumber,
} // address: [provinceName, cityName, countyName, streetName, detailInfo].join(joinTag)
// }
}); });
} }
}, res => { }, res => {
reject(res); reject(res);
}) })
}, },
fail:(err)=>{
console.log(err);
}
}); });
}); });
}; };
......
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