提交 dba55cbf 编写于 作者: KK's avatar KK

第三方服务调整

上级 eb89f9dd
...@@ -17,6 +17,7 @@ export class ThirdPartyService { ...@@ -17,6 +17,7 @@ export class ThirdPartyService {
* @memberof ThirdPartyService * @memberof ThirdPartyService
*/ */
private static readonly instance: ThirdPartyService = new ThirdPartyService(); private static readonly instance: ThirdPartyService = new ThirdPartyService();
/** /**
* 当前搭载平台 * 当前搭载平台
* *
...@@ -25,6 +26,7 @@ export class ThirdPartyService { ...@@ -25,6 +26,7 @@ export class ThirdPartyService {
* @memberof ThirdPartyService * @memberof ThirdPartyService
*/ */
public platform: 'WeChat' | 'DingTalk' | null = null; public platform: 'WeChat' | 'DingTalk' | null = null;
/** /**
* 钉钉服务 * 钉钉服务
* *
...@@ -32,6 +34,7 @@ export class ThirdPartyService { ...@@ -32,6 +34,7 @@ export class ThirdPartyService {
* @memberof ThirdPartyService * @memberof ThirdPartyService
*/ */
public dd: DingTalkService = DingTalkService.getInstance(); public dd: DingTalkService = DingTalkService.getInstance();
/** /**
* 企业微信服务 * 企业微信服务
* *
...@@ -40,9 +43,22 @@ export class ThirdPartyService { ...@@ -40,9 +43,22 @@ export class ThirdPartyService {
*/ */
public weChat: WeChatService = WeChatService.getInstance(); public weChat: WeChatService = WeChatService.getInstance();
/**
* 第三方导航返回事件
*
* @type {WeChatService}
* @memberof ThirdPartyService
*/
private backEvent:Array<Function> = []; private backEvent:Array<Function> = [];
/**
* 第三方导航标题
*
* @type {WeChatService}
* @memberof ThirdPartyService
*/
private navTitle:Array<string> = [];
/** /**
* 是否已经初始化 * 是否已经初始化
* *
...@@ -165,6 +181,7 @@ export class ThirdPartyService { ...@@ -165,6 +181,7 @@ export class ThirdPartyService {
* @memberof DingTalkService * @memberof DingTalkService
*/ */
public setTitle(title:string){ public setTitle(title:string){
this.navTitle.push(title);
if (this.isDingTalk()) { if (this.isDingTalk()) {
this.dd.setTitle(title); this.dd.setTitle(title);
} else if (this.isWeChat()) { } else if (this.isWeChat()) {
...@@ -193,14 +210,16 @@ export class ThirdPartyService { ...@@ -193,14 +210,16 @@ export class ThirdPartyService {
* 第三方容器导航销毁返回事件 * 第三方容器导航销毁返回事件
*/ */
public destroyBackEvent() { public destroyBackEvent() {
this.backEvent = (this.backEvent.slice(0,-1) as any); this.backEvent = this.backEvent.slice(0,-1);
alert(this.backEvent.length); this.navTitle = this.navTitle.slice(0,-1);
if(!this.backEvent){ if(!this.backEvent){
return return
} }
if (this.isDingTalk()) { if (this.isDingTalk()) {
this.dd.setTitle(this.navTitle[this.navTitle.length -1]);
this.dd.setBackEvent(this.backEvent); this.dd.setBackEvent(this.backEvent);
} else if (this.isWeChat()) { } else if (this.isWeChat()) {
this.weChat.setTitle(this.navTitle[this.navTitle.length -1]);
this.weChat.setBackEvent(this.backEvent); this.weChat.setBackEvent(this.backEvent);
} }
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册