diff --git a/sdk/shareTools.ts b/sdk/shareTools.ts index 372bbc6..d5d93f7 100644 --- a/sdk/shareTools.ts +++ b/sdk/shareTools.ts @@ -40,64 +40,20 @@ export class ShareTools { WXSDK.share.share(shareKey.toString(), params, opts).then(async res => { this.onShowAd = false; params && params.success && params.success(res); - }).catch(async videoErr => { - console.log(JSON.stringify(videoErr)); - let showShare = !(videoErr.code == ShareVideoError.VideoPlaying.code || videoErr.code == ShareVideoError.VideoQuit.code); - if (showShare && SDKUtils.compareVersion(my.env.clientVersion, '10.1.75') > 0) { - SDKShare.I.share(shareKey, params, opts).then(success => { - params && params.success && params.success(success); - Analytics.I.dot('videoFail', { "from": 'share_success' }); - }).catch(shareErr => { - console.log(`share fail${JSON.stringify(shareErr)}`) - Analytics.I.dot('videoFail', { "from": 'share_fail' }); - self.onShowAd = false; - if (!params || !params.fail) { - if (cc.sys.platform === cc.sys.WECHAT_GAME) { - wx.showToast({ - title: shareErr.msg, - icon: 'none', - duration: time - }) - } else if (cc.sys.platform === cc.sys.ALIPAY_GAME) { - Analytics.I.dot('videoFail', { "from": 'other3_' + shareErr.code }); - my.showToast({ - content: shareErr.msg, - type: 'none', - duration: 1500 - }) - } - } else { - Analytics.I.dot('videoFail', { "from": 'other4_' + shareErr.code }); - params && params.fail && params.fail(shareErr); - } - }) + }).catch(async err => { + console.log("err", err) + if (err && err.code && err.code === 1006) { + // 分享失败 按需处理 + } + this.onShowAd = false; + if (!params || !params.fail) { + // WxHelper.showToast(err.msg); + // 分享失败 按需处理 + console.log("err", err) } else { - Analytics.I.dot('videoFail', { "from": 'share_versionLow' }); - this.onShowAd = false; - if (!params || !params.fail) { - if (cc.sys.platform === cc.sys.WECHAT_GAME) { - wx.showToast({ - title: videoErr.msg, - icon: 'none', - duration: time - }) - } else if (cc.sys.platform === cc.sys.ALIPAY_GAME) { - Analytics.I.dot('videoFail', { "from": 'other1_' + videoErr.code }); - my.showToast({ - content: videoErr.msg, - type: 'none', - duration: 1500 - }) - } - } else { - Analytics.I.dot('videoFail', { "from": 'other2_' + videoErr.code }); - params && params.fail && params.fail(videoErr); - } + params && params.fail && params.fail(err); } - - - })//this.buildParams(params) } /** -- libgit2 0.21.0