Commit df429dad by Sweet Zhang

没有customerId的普通分享bug修复

parent b0bac0e5
...@@ -12,6 +12,11 @@ export class AppComponent implements OnInit { ...@@ -12,6 +12,11 @@ export class AppComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
if (!this.commonService.getQueryString('t_reload')) {
let {search, href} = window.location;
href = href.replace(/&?t_reload=(\d+)/g, '');
window.location.href = href + (search ? '&' : '?') + 't_reload=' + new Date().getTime();
}
let customerId = this.commonService.getQueryString('customerId'); let customerId = this.commonService.getQueryString('customerId');
const double12_customerInfo = localStorage.getItem('double12_customerInfo') ? JSON.parse(localStorage.getItem('double12_customerInfo')) : null; const double12_customerInfo = localStorage.getItem('double12_customerInfo') ? JSON.parse(localStorage.getItem('double12_customerInfo')) : null;
if (double12_customerInfo) { if (double12_customerInfo) {
......
...@@ -65,9 +65,9 @@ export class TransitComponent implements OnInit { ...@@ -65,9 +65,9 @@ export class TransitComponent implements OnInit {
let _this = this; let _this = this;
// 默认的分享信息 // 默认的分享信息
const shareData = { const shareData = {
title: '分享标题', title: 'AI智能保险顾问',
link: `${environment.hostName}/questionnaire/#/index?campaign=AIRobot&task=AItask1`, link: `${environment.hostName}/questionnaire/#/index?campaign=AIRobot&task=AItask1`,
desc: '分享描述', desc: 'AI智能家庭风险评测 、实时保障方案推荐。一分钟、搞定家庭保险。',
imgUrl: 'https://ajb-images.oss-cn-shanghai-finance-1-pub.aliyuncs.com/9/ydshare.jpg', imgUrl: 'https://ajb-images.oss-cn-shanghai-finance-1-pub.aliyuncs.com/9/ydshare.jpg',
success: function () { success: function () {
_this.wxShareFlag = false; _this.wxShareFlag = false;
...@@ -94,6 +94,8 @@ export class TransitComponent implements OnInit { ...@@ -94,6 +94,8 @@ export class TransitComponent implements OnInit {
}); });
}); });
} else {
this.defaultWxShare();
} }
} }
...@@ -114,6 +116,36 @@ export class TransitComponent implements OnInit { ...@@ -114,6 +116,36 @@ export class TransitComponent implements OnInit {
}); });
} }
// 分享
defaultWxShare() {
const _this = this;
// 默认的分享信息
const shareData = {
title: 'AI智能保险顾问',
link: `${environment.hostName}/questionnaire/#/index?campaign=AIRobot&task=AItask1`,
desc: 'AI智能家庭风险评测 、实时保障方案推荐。一分钟、搞定家庭保险。',
imgUrl: 'https://ajb-images.oss-cn-shanghai-finance-1-pub.aliyuncs.com/9/ydshare.jpg',
success: function () {
_this.wxShareFlag = false;
_this.alertFlag = true;
_this.dialogTips = '分享成功';
setTimeout(() => {
_this.alertFlag = false;
_this.changeDetectorRef.markForCheck();
_this.changeDetectorRef.detectChanges();
}, 500)
_this.changeDetectorRef.markForCheck();
_this.changeDetectorRef.detectChanges();
}
};
wx.ready(function () {
wx.onMenuShareAppMessage(shareData); // 分享微信
wx.onMenuShareTimeline(shareData); // 分享到朋友圈
wx.onMenuShareQQ(shareData); // 分享到QQ
wx.onMenuShareQZone(shareData); // 分享到QQ空间
});
}
/** /**
* 检测操作系统 * 检测操作系统
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment