Comparing version 0.0.6 to 0.0.7
@@ -47,2 +47,4 @@ (function (global, factory) { | ||
const eventList = []; | ||
/** | ||
@@ -64,3 +66,3 @@ * | ||
if (this.wx) { | ||
if (this._wx) { | ||
console.warn('【XFB-SDK】Jweixin 重复调用'); | ||
@@ -74,3 +76,3 @@ return | ||
scriptEle.onload = () => { | ||
this.wx = window.wx; | ||
this._wx = window.wx; | ||
window.wx.config({ | ||
@@ -86,7 +88,8 @@ debug, | ||
console.log('Jweixin is ready.'); | ||
this.wxReady = true; | ||
this._wxReady = true; | ||
eventList.forEach(fn => fn()); | ||
}); | ||
window.wx.error(error => { | ||
console.log(error); | ||
this.wxReady = false; | ||
this._wxReady = false; | ||
}); | ||
@@ -97,11 +100,4 @@ }; | ||
// wx.updateAppMessageShareData({ | ||
// title: "分享标题", // 分享标题 | ||
// desc: "分享描述", // 分享描述 | ||
// link: 'xxx', // 分享链接 | ||
// imgUrl: "xxx", // 分享图标 | ||
// }) | ||
function updateAppMessageShareData({ title, desc, link, imgUrl }) { | ||
if (!this.wx) { | ||
if (!this._wx) { | ||
console.warn('【XFB-SDK】Jweixin 未初始化'); | ||
@@ -111,8 +107,16 @@ return | ||
if (!this.wxReady) { | ||
if (!this._wxReady) { | ||
console.warn('【XFB-SDK】Jweixin 未准备好'); | ||
eventList.push(() => | ||
updateAppMessageShareData({ | ||
title: '消费保 - 您身边的消费服务管家', | ||
desc: '消费保是中国电子商会旗下的消费服务保障平台。通过免费处理投诉建立消费者与企业之间的信任。是一家依托互联网大数据技术,以消费服务分析为基础,构建从选购、售后到回收一站式消费保障服务,通过消费服务管家、企业客服SaaS系统、消费舆情监测三大系统,服务于政府、企业、消费者的平台型企业。 ', | ||
link: 'https://www.xfb315.com', | ||
imgUrl: 'https://xfb.oss-cn-shenzhen.aliyuncs.com/2023-05/logo.jpg', | ||
}) | ||
); | ||
return | ||
} | ||
this.wx.updateAppMessageShareData({ | ||
this._wx.updateAppMessageShareData({ | ||
title, | ||
@@ -123,2 +127,8 @@ desc, | ||
}); | ||
this._wx.updateTimelineShareData({ | ||
title, | ||
desc, | ||
link, | ||
imgUrl, | ||
}); | ||
} | ||
@@ -125,0 +135,0 @@ |
{ | ||
"name": "xfb-sdk", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"author": "wangfei", | ||
@@ -5,0 +5,0 @@ "description": "", |
4539
124