提交移动端代码
This commit is contained in:
1 parent
441b47da1a
commit
4b9dbe40fb
113 files changed
+1093
-22121
No files matched your search
@@ -553,6 +553,37 @@ class WeChatSDK {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取微信JS-SDK版本信息
|
||||
* @returns {String} 版本号
|
||||
*/
|
||||
getVersion() {
|
||||
if (typeof wx !== 'undefined' && wx.getWxVersion && typeof wx.getWxVersion === 'function') {
|
||||
try {
|
||||
return wx.getWxVersion();
|
||||
} catch (error) {
|
||||
console.warn('获取微信版本失败:', error);
|
||||
return '无法获取版本';
|
||||
}
|
||||
}
|
||||
return typeof wx !== 'undefined' ? '1.6.0 (推测)' : '未加载';
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取可用的API列表
|
||||
* @returns {String} 可用API的描述
|
||||
*/
|
||||
getAvailableApis() {
|
||||
if (!this.isInitialized) {
|
||||
return '未初始化';
|
||||
}
|
||||
|
||||
// 返回当前配置的API列表
|
||||
const availableCount = this.jsApiList.length;
|
||||
const mainApis = ['分享', '扫码', '图片选择', '地理位置', '网络状态'];
|
||||
return `${availableCount}个API (${mainApis.join('、')}等)`;
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一的SDK加载器 - 供其他页面直接使用(简化版)
|
||||
* @returns {Promise<boolean>} 加载结果
|
||||
|
||||
Reference in new issue
Block a user