Skip to content

Commit a2ed5b3

Browse files
committed
feat(index): 添加微信 Skyline 和 AI 引擎版本信息
- 在 index.js 中获取 Skyline 渲染引擎版本和通用 AI 推理引擎版本信息 - 更新 index.wxml,在"关于微信"列表中添加 Skyline 和 AI 引擎版本项 - 优化微信版本信息复制功能,支持选择性复制特定信息
1 parent 1904dd7 commit a2ed5b3

File tree

2 files changed

+39
-7
lines changed

2 files changed

+39
-7
lines changed

source/pages/index/index.js

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ Page({
112112
const accountInfo = wx.getAccountInfoSync();
113113
const appBaseInfo = wx.getAppBaseInfo()
114114
const deviceInfo = wx.getDeviceInfo()
115+
const skylineInfo = wx.getSkylineInfoSync();
115116

116117
this.setData({
117118
theme: wx.getAppBaseInfo().theme || 'light',
@@ -131,9 +132,18 @@ Page({
131132
weixinLocalSDKVersion: appBaseInfo.SDKVersion,
132133
weixinLocalSystem: deviceInfo.system,
133134
weixinLocalPlatform: deviceInfo.platform,
134-
weixinLocalABI: deviceInfo.abi
135+
weixinLocalABI: deviceInfo.abi,
136+
weixinLocalSkyline: skylineInfo.version
135137
});
136138

139+
wx.getInferenceEnvInfo({
140+
complete: (res) => {
141+
this.setData({
142+
weixinLocalAI: res.ver
143+
})
144+
},
145+
})
146+
137147
const suffixKeys = ['suffix64HB', 'suffixHB64', 'suffix64HB1', 'suffixHB164', 'suffix64HB2', 'suffixHB264', 'suffix64HB3', 'suffixHB364', 'suffix64HD', 'suffixHD64', 'suffix64HD1', 'suffixHD164', 'suffix64HD2', 'suffixHD264', 'suffix64HD3', 'suffixHD364', 'suffix64HD1HB', 'suffixHD1HB64', 'suffixTest'];
138148
suffixKeys.forEach(suffixKey => {
139149
if (wx.getStorageSync(suffixKey) === '') wx.setStorageSync(suffixKey, true);
@@ -1760,16 +1770,33 @@ Page({
17601770
this.setData({
17611771
localWeixinDetailVisible: false
17621772
})
1773+
}, copyWeixinInfo(type = 'all') {
1774+
const infoMap = {
1775+
version: `微信版本:${this.data.weixinLocalVersion}`,
1776+
sdk: `微信小程序基础库版本:${this.data.weixinLocalSDKVersion}`,
1777+
skyline: `Skyline 渲染引擎版本:${this.data.weixinLocalSkyline}`,
1778+
ai: this.data.weixinLocalAI !== '' ? `通用 AI 推理引擎版本:${this.data.weixinLocalAI}` : '',
1779+
platform: `微信客户端平台:${this.data.weixinLocalPlatform}${this.data.weixinLocalSystem})`,
1780+
abi: this.data.weixinLocalABI !== undefined ? `ABI:${this.data.weixinLocalABI}` : '',
1781+
};
1782+
if (type === 'all') {
1783+
const filteredValues = Object.values(infoMap).filter(value => value !== '');
1784+
this.copyUtil(filteredValues.join('\n'));
1785+
} else if (infoMap[type]) this.copyUtil(infoMap[type]);
17631786
}, copyLocalWeixin() {
1764-
this.copyUtil(`微信版本:${this.data.weixinLocalVersion}\n微信小程序基础库版本:${this.data.weixinLocalSDKVersion}\n微信客户端平台:${this.data.weixinLocalPlatform}${this.data.weixinLocalSystem})` + (this.data.weixinLocalABI !== undefined ? `\nABI:${this.data.weixinLocalABI}` : ''))
1787+
this.copyWeixinInfo()
17651788
}, clickLocalWeixinVersionCell() {
1766-
this.copyUtil(`微信版本:${this.data.weixinLocalVersion}`)
1789+
this.copyWeixinInfo('version')
17671790
}, clickLocalWeixinSDKVersionCell() {
1768-
this.copyUtil(`微信小程序基础库版本:${this.data.weixinLocalSDKVersion}`)
1791+
this.copyWeixinInfo('sdk')
17691792
}, clickLocalWeixinPlatformCell() {
1770-
this.copyUtil(`微信客户端平台:${this.data.weixinLocalPlatform}${this.data.weixinLocalSystem})`)
1793+
this.copyWeixinInfo('platform')
17711794
}, clickLocalWeixinABICell() {
1772-
this.copyUtil(`ABI:${this.data.weixinLocalABI}`)
1795+
this.copyWeixinInfo('abi')
1796+
}, clickLocalWeixinSkylineCell() {
1797+
this.copyWeixinInfo('skyline')
1798+
}, clickLocalWeixinAICell() {
1799+
this.copyWeixinInfo('ai')
17731800
}, updateWeixin() {
17741801
wx.updateWeChatApp()
17751802
}, showErrPopup(err) {

source/pages/index/index.wxml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,8 @@ See the Mulan PubL v2 for more details.
599599
<t-cell bordered title="QQ 版本卡片显示额定包大小占比历史最大包指示条">
600600
<t-switch bind:change="handlePerProChange" class="ml-48rpx" slot="note" value="{{PerProSwitch}}"/>
601601
</t-cell>
602-
<t-cell arrow bordered="{{false}}" bind:click="onVersionListFontPicker" hover note="{{versionListFontText}}" title="版本号字体"/>
602+
<t-cell arrow bind:click="onVersionListFontPicker" bordered="{{false}}" hover note="{{versionListFontText}}"
603+
title="版本号字体"/>
603604
<view class="flex mt-16rpx mx-32rpx mb-32rpx">
604605
<t-button bind:tap="closePersonalizationSetting" block size="large" theme="light">返回
605606
</t-button>
@@ -781,6 +782,10 @@ See the Mulan PubL v2 for more details.
781782
title="微信版本"/>
782783
<t-cell arrow bind:tap="clickLocalWeixinSDKVersionCell" bordered description="{{weixinLocalSDKVersion}}" hover
783784
title="微信小程序基础库版本"/>
785+
<t-cell arrow bind:tap="clickLocalWeixinSkylineCell" bordered description="{{weixinLocalSkyline}}" hover
786+
title="Skyline 渲染引擎版本"/>
787+
<t-cell arrow bind:tap="clickLocalWeixinAICell" bordered description="{{weixinLocalAI}}" hover
788+
title="通用 AI 推理引擎版本" wx:if="{{weixinLocalAI!==''}}"/>
784789
<t-cell arrow bind:tap="clickLocalWeixinPlatformCell" bordered="{{weixinLocalABI!==undefined}}"
785790
description="{{weixinLocalPlatform+'('+weixinLocalSystem+')'}}" hover title="微信客户端平台"/>
786791
<t-cell arrow bind:tap="clickLocalWeixinABICell" bordered="{{false}}" description="{{weixinLocalABI}}" hover

0 commit comments

Comments
 (0)