Commit e9d86996 authored by haiyoucuv's avatar haiyoucuv

fk

parent 6ab30f55
This diff is collapsed.
...@@ -36,7 +36,7 @@ export class Tools { ...@@ -36,7 +36,7 @@ export class Tools {
} }
public static async getAppData() { public static async getAppData() {
const { data } = await sendTbNet(TbNetName.getAppData); const {data} = await sendTbNet(TbNetName.getAppData);
Tools.globalData = data; Tools.globalData = data;
} }
...@@ -110,13 +110,16 @@ export class Tools { ...@@ -110,13 +110,16 @@ export class Tools {
this.propInfo[type] -= 1; this.propInfo[type] -= 1;
sendTbNet(TbNetName.getToolsInfo, {}, sendTbNet(TbNetName.getToolsInfo, {},
(st, rt) => { (st, rt) => {
if (!st) return; if (!st) {
this.propInfo.booms = +rt.data.tools.booms; resolve(true);
this.propInfo.steps = +rt.data.tools.steps; return;
this.propInfo.hammers = +rt.data.tools.hammers; }
this.propInfo.booms = Tools.propInfo.booms = +rt.data.tools.booms;
this.propInfo.steps = Tools.propInfo.steps = +rt.data.tools.steps;
this.propInfo.hammers = Tools.propInfo.hammers = +rt.data.tools.hammers;
resolve(true);
} }
); );
resolve(true)
} else { } else {
// reject() // reject()
resolve(false) resolve(false)
...@@ -146,11 +149,11 @@ export class Tools { ...@@ -146,11 +149,11 @@ export class Tools {
var tbMy = my var tbMy = my
if (!tbMy) return; if (!tbMy) return;
//@ts-ignore //@ts-ignore
const { cloud } = getApp(); const {cloud} = getApp();
//测试地址//到时云存储传一个小json,,改路径 //测试地址//到时云存储传一个小json,,改路径
var url = "cloud://B4F0300E5148F478B506DEDC26EA4C6C//butterfly0.svga"; var url = "cloud://B4F0300E5148F478B506DEDC26EA4C6C//butterfly0.svga";
//获取临时地址 //获取临时地址
var urls = await cloud.file.getTempFileURL({ fileId: [url] }) var urls = await cloud.file.getTempFileURL({fileId: [url]})
url = urls[0].url.replace('-internal', ''); url = urls[0].url.replace('-internal', '');
tbMy.downloadFile({ tbMy.downloadFile({
url: url, url: url,
...@@ -159,10 +162,10 @@ export class Tools { ...@@ -159,10 +162,10 @@ export class Tools {
tbMy.getFileSystemManager().readFile({ tbMy.getFileSystemManager().readFile({
filePath: i, filePath: i,
// encoding: "utf8", // encoding: "utf8",
success: function (r) { success: function(r) {
}, },
fail: function (res) { fail: function(res) {
} }
}) })
...@@ -306,11 +309,11 @@ export class Tools { ...@@ -306,11 +309,11 @@ export class Tools {
showTime: number = 300 showTime: number = 300
) { ) {
Tween.get(target) Tween.get(target)
.set({ alpha: 0, visible: true }) .set({alpha: 0, visible: true})
.to({ alpha: 1 }, showTime, Ease.quadIn) .to({alpha: 1}, showTime, Ease.quadIn)
.wait(time) .wait(time)
.to({ alpha: 0 }, showTime, Ease.quadOut) .to({alpha: 0}, showTime, Ease.quadOut)
.set({ alpha: 0, visible: false }) .set({alpha: 0, visible: false})
.call(() => { .call(() => {
call(); call();
}); });
......
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