Commit 3938c669255551ca7f281de471e1af6c7f576a1e
1 parent
c2ebfa51
Exists in
zfb_waibu_linshi
and in
1 other branch
玩一玩V2
Showing
4 changed files
with
57 additions
and
1 deletions
Show diff stats
sdk/SDKTools.ts
... | ... | @@ -351,6 +351,20 @@ export class SDKTools { |
351 | 351 | |
352 | 352 | } |
353 | 353 | |
354 | + //阿里增量任务v2 | |
355 | + static incrementGameactionV2(action_code, success: Function, fail: Function) { | |
356 | + if (this.uid) { | |
357 | + AlipayApi.I.incrementGameactionV2(action_code).then((res) => { | |
358 | + success(); | |
359 | + }).catch((res) => { | |
360 | + fail && fail(); | |
361 | + }); | |
362 | + } else { | |
363 | + //登录状态过期,重进登录 | |
364 | + fail(); | |
365 | + } | |
366 | + } | |
367 | + | |
354 | 368 | } |
355 | 369 | |
356 | 370 | /** | ... | ... |
wxsdk/alipay/AlipayApi.ts
... | ... | @@ -543,6 +543,45 @@ export default class AlipayApi { |
543 | 543 | }) |
544 | 544 | }) |
545 | 545 | } |
546 | + | |
547 | + /** | |
548 | + * 玩一玩增量行为v2 | |
549 | + */ | |
550 | + incrementGameactionV2(action_code: string) { | |
551 | + return new Promise((resolve, reject) => { | |
552 | + if (window['my'] == undefined) return reject(null); | |
553 | + let channel = 'other'; | |
554 | + let info = my.getLaunchOptionsSync(); | |
555 | + if (info.query.channel == undefined) { | |
556 | + channel = 'other'; | |
557 | + } else { | |
558 | + if (info.query.channel.length <= 0 || info.query.channel == null) { | |
559 | + channel = 'other'; | |
560 | + } else { | |
561 | + channel = info.query.channel; | |
562 | + } | |
563 | + } | |
564 | + // my.alert({ | |
565 | + // title: '增加量行为', | |
566 | + // content:`${action_code}` | |
567 | + // }); | |
568 | + let uid = DataService.I.UserId; | |
569 | + let token = DataService.I.Token; | |
570 | + let openid = DataService.I.OpenId; | |
571 | + let action_finish_channel = channel | |
572 | + let params = { | |
573 | + uid, | |
574 | + token, | |
575 | + openid, | |
576 | + action_code, | |
577 | + action_finish_channel | |
578 | + }; | |
579 | + return SDKApi.aliMissionV2(params).then(() => { | |
580 | + resolve(null) | |
581 | + }) | |
582 | + }) | |
583 | + } | |
584 | + | |
546 | 585 | //段位 |
547 | 586 | setRankSegmentData(rankKey: string, segment: number, segmentName: string) { |
548 | 587 | return new Promise((resolve, reject) => { | ... | ... |
wxsdk/base/SDKConst.ts
... | ... | @@ -29,7 +29,7 @@ export const GAMEDATA = { |
29 | 29 | } |
30 | 30 | |
31 | 31 | // sdk版本 |
32 | -export const SDKVersion = 'v1.0.8'; | |
32 | +export const SDKVersion = 'v1.0.9'; | |
33 | 33 | // 是否打印 |
34 | 34 | export const __LOG__ = false; |
35 | 35 | // 是否mock |
... | ... | @@ -122,6 +122,8 @@ export const HostKeys = { |
122 | 122 | alipayIntergralAuth: 'api/ali/point/auth',//支付宝会员积分授权 |
123 | 123 | alipayIntergralQuery: 'api/ali/point/query',//支付宝会员积分查询 |
124 | 124 | isAddHomePage: 'api/ali/homepage/consult',//玩一玩小程序是否已加首咨询 |
125 | + | |
126 | + aliMissionV2: 'api/ali/incrementgameaction/submit',//阿里玩一玩增量任务v2 | |
125 | 127 | }; |
126 | 128 | |
127 | 129 | // 本地存储keys | ... | ... |
wxsdk/http/SDKApi.ts
... | ... | @@ -89,6 +89,7 @@ export class SDKApi { |
89 | 89 | |
90 | 90 | //阿里增量任务 |
91 | 91 | public static aliMission = (...args) => SDKHttp.httpPost(DataService.I.GameApi, HostKeys.aliMission, ...args); |
92 | + public static aliMissionV2 = (...args) => SDKHttp.httpPost(DataService.I.GameApi, HostKeys.aliMissionV2, ...args); | |
92 | 93 | |
93 | 94 | //支付宝会员授权查询 |
94 | 95 | public static alipayIntergralAuth = (...args) => SDKHttp.httpPost(DataService.I.GameApi, HostKeys.alipayIntergralAuth, ...args); | ... | ... |