|
@@ -119,8 +119,8 @@ export class SdkUtil {
|
|
|
if(sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
|
|
|
tt.showLoading({
|
|
|
title: title,
|
|
|
- // success(res) { console.log(`${res}`);},
|
|
|
- // fail(err) { console.log(`showLoading调用失败`,err);},
|
|
|
+ success(res) { console.log(`${res}`);},
|
|
|
+ fail(err) { console.log(`showLoading调用失败`,err);},
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -135,16 +135,18 @@ export class SdkUtil {
|
|
|
}
|
|
|
|
|
|
// 展示toast
|
|
|
- public static showToast(title:string,duration=2000) {
|
|
|
+ public static showToast(title:string,duration=2000,success_cb=null, fail_cb=null) {
|
|
|
if(sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
|
|
|
tt.showToast({
|
|
|
title: title,
|
|
|
duration: duration,
|
|
|
success(res) {
|
|
|
console.log(`${res}`);
|
|
|
+ if(success_cb){ success_cb() }
|
|
|
},
|
|
|
fail(res) {
|
|
|
console.log(`showToast调用失败`);
|
|
|
+ if(fail_cb) { fail_cb() }
|
|
|
},
|
|
|
});
|
|
|
}
|
|
@@ -192,12 +194,12 @@ export class SdkUtil {
|
|
|
desc: desc,
|
|
|
success() {
|
|
|
console.log("分享成功")
|
|
|
- // SdkUtil.showToast('分享成功')
|
|
|
+ // this.showToast('分享成功')
|
|
|
call_back(true)
|
|
|
},
|
|
|
fail(e) {
|
|
|
console.log("分享失败",e)
|
|
|
- SdkUtil.showToast('分享失败')
|
|
|
+ this.showToast('分享失败')
|
|
|
call_back(false)
|
|
|
},
|
|
|
});
|