Commit c2ebfa519c5f208b4e558100bdfb686443d6fe0a
1 parent
a44d725c
Exists in
zfb_waibu_linshi
and in
1 other branch
x
Showing
1 changed file
with
11 additions
and
55 deletions
Show diff stats
sdk/shareTools.ts
| ... | ... | @@ -40,64 +40,20 @@ export class ShareTools { |
| 40 | 40 | WXSDK.share.share(shareKey.toString(), params, opts).then(async res => { |
| 41 | 41 | this.onShowAd = false; |
| 42 | 42 | params && params.success && params.success(res); |
| 43 | - }).catch(async videoErr => { | |
| 44 | - console.log(JSON.stringify(videoErr)); | |
| 45 | - let showShare = !(videoErr.code == ShareVideoError.VideoPlaying.code || videoErr.code == ShareVideoError.VideoQuit.code); | |
| 46 | - if (showShare && SDKUtils.compareVersion(my.env.clientVersion, '10.1.75') > 0) { | |
| 47 | - SDKShare.I.share(shareKey, params, opts).then(success => { | |
| 48 | - params && params.success && params.success(success); | |
| 49 | - Analytics.I.dot('videoFail', { "from": 'share_success' }); | |
| 50 | - }).catch(shareErr => { | |
| 51 | - console.log(`share fail${JSON.stringify(shareErr)}`) | |
| 52 | - Analytics.I.dot('videoFail', { "from": 'share_fail' }); | |
| 53 | - self.onShowAd = false; | |
| 54 | - if (!params || !params.fail) { | |
| 55 | - if (cc.sys.platform === cc.sys.WECHAT_GAME) { | |
| 56 | - wx.showToast({ | |
| 57 | - title: shareErr.msg, | |
| 58 | - icon: 'none', | |
| 59 | - duration: time | |
| 60 | - }) | |
| 61 | - } else if (cc.sys.platform === cc.sys.ALIPAY_GAME) { | |
| 62 | - Analytics.I.dot('videoFail', { "from": 'other3_' + shareErr.code }); | |
| 63 | - my.showToast({ | |
| 64 | - content: shareErr.msg, | |
| 65 | - type: 'none', | |
| 66 | - duration: 1500 | |
| 67 | - }) | |
| 68 | - } | |
| 69 | - } else { | |
| 70 | - Analytics.I.dot('videoFail', { "from": 'other4_' + shareErr.code }); | |
| 71 | - params && params.fail && params.fail(shareErr); | |
| 72 | - } | |
| 73 | - }) | |
| 43 | + }).catch(async err => { | |
| 44 | + console.log("err", err) | |
| 45 | + if (err && err.code && err.code === 1006) { | |
| 46 | + // 分享失败 按需处理 | |
| 47 | + } | |
| 48 | + this.onShowAd = false; | |
| 49 | + if (!params || !params.fail) { | |
| 50 | + // WxHelper.showToast(err.msg); | |
| 51 | + // 分享失败 按需处理 | |
| 52 | + console.log("err", err) | |
| 74 | 53 | } else { |
| 75 | - Analytics.I.dot('videoFail', { "from": 'share_versionLow' }); | |
| 76 | - this.onShowAd = false; | |
| 77 | - if (!params || !params.fail) { | |
| 78 | - if (cc.sys.platform === cc.sys.WECHAT_GAME) { | |
| 79 | - wx.showToast({ | |
| 80 | - title: videoErr.msg, | |
| 81 | - icon: 'none', | |
| 82 | - duration: time | |
| 83 | - }) | |
| 84 | - } else if (cc.sys.platform === cc.sys.ALIPAY_GAME) { | |
| 85 | - Analytics.I.dot('videoFail', { "from": 'other1_' + videoErr.code }); | |
| 86 | - my.showToast({ | |
| 87 | - content: videoErr.msg, | |
| 88 | - type: 'none', | |
| 89 | - duration: 1500 | |
| 90 | - }) | |
| 91 | - } | |
| 92 | - } else { | |
| 93 | - Analytics.I.dot('videoFail', { "from": 'other2_' + videoErr.code }); | |
| 94 | - params && params.fail && params.fail(videoErr); | |
| 95 | - } | |
| 54 | + params && params.fail && params.fail(err); | |
| 96 | 55 | } |
| 97 | 56 | |
| 98 | - | |
| 99 | - | |
| 100 | - | |
| 101 | 57 | })//this.buildParams(params) |
| 102 | 58 | } |
| 103 | 59 | /** | ... | ... |