Commit 28af48db authored by haiyoucuv's avatar haiyoucuv
parents 2ffb8f37 681b143e
......@@ -108,7 +108,7 @@ export class Tools {
*/
public static consumerTools(type: PropType): Promise<boolean> {
return new Promise((resolve, reject) => {
sendTbNet(TbNetName.consumerTools, {type}, (s, res) => {
sendTbNet(TbNetName.consumerTools, { type }, (s, res) => {
if (s) {
//修改道具数量
this.gameData.tools = res.data.tools;
......@@ -153,8 +153,8 @@ export class Tools {
this.gameData.tools = res.data.tools;
return true;//可根据gameData修改视图
} else {
//如果code积分不足,弹出赚积分弹窗 待写code TODO
if (res.code == "") {
//如果code积分不足,弹出赚积分弹窗
if (res.code == "730005") {
showPanel(CreditsOutPanel)
} else {
showToast(res.message || "网络开小差了,请重试")
......@@ -171,11 +171,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,
......@@ -184,10 +184,10 @@ export class Tools {
tbMy.getFileSystemManager().readFile({
filePath: i,
// encoding: "utf8",
success: function(r) {
success: function (r) {
},
fail: function(res) {
fail: function (res) {
}
})
......@@ -331,11 +331,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();
});
......
......@@ -17,7 +17,7 @@ export class CreditsOutPanel extends Panel {
super.initEvents();
this.earnBtn.addEventListener(FYGE.MouseEvent.CLICK, () => {
Tools.btnDelay(this);
sendTbNet(TbNetName.navigateToOutside, { url: "" })//TODO 路径待写
sendTbNet(TbNetName.navigateToOutside, { url: "" })//TODO 赚积分路径待写
}, this)
}
removeEvents() {
......
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