Commit e9d86996 authored by haiyoucuv's avatar haiyoucuv

fk

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