Skip to content

Commit

Permalink
fix: Wechat
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Apr 1, 2019
1 parent 8a875dc commit 6732b09
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/Wechat.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { EventBus } from './EventBus'
import { isBoolean } from './isBoolean'
import { promiseSeries } from './promiseSeries'

declare const wx: any

Expand Down Expand Up @@ -225,17 +224,13 @@ export class Wechat {
...params,
}
this.prevShareParams = params
// 必须顺序调用分享接口,否则会失败!
return promiseSeries([
// 兼容低版本微信
() => this.invoke('onMenuShareAppMessage', params),
() => this.invoke('onMenuShareTimeline', params),
() => this.invoke('onMenuShareQQ', params),
() => this.invoke('onMenuShareQZone', params),
// 最新的接口
() => this.invoke('updateAppMessageShareData', params),
() => this.invoke('updateTimelineShareData', params),
])
this.invoke('onMenuShareAppMessage', params)
this.invoke('onMenuShareTimeline', params)
this.invoke('onMenuShareQQ', params)
this.invoke('onMenuShareQZone', params)
this.invoke('updateAppMessageShareData', params)
this.invoke('updateTimelineShareData', params)
return Promise.resolve()
}

chooseImage(params?: WechatChooseImageParams): Promise<string[]> {
Expand Down

0 comments on commit 6732b09

Please sign in to comment.