up修复数量问题
This commit is contained in:
@@ -27,16 +27,30 @@
|
||||
|
||||
|
||||
|
||||
<!-- ===== 分组:关于 ===== -->
|
||||
<view class="group">
|
||||
<text class="group-title">关于</text>
|
||||
<view class="group-body">
|
||||
<view class="cell">
|
||||
<text class="cell-label">版本号</text>
|
||||
<text class="cell-value">{{ version }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref,onMounted } from 'vue'
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { isUrl } from '@/utils/index.js'
|
||||
import { useConfigStore } from '../../stores/config'
|
||||
|
||||
const useConfig=useConfigStore()
|
||||
|
||||
// ---- 版本号 ----
|
||||
const version = ref('')
|
||||
|
||||
// ---- 响应式状态 ----
|
||||
const isTested=ref(false)//是否点了测试
|
||||
const isTesting=ref(false)//是否正在测试
|
||||
@@ -100,8 +114,26 @@ function onEditApiUrl() {
|
||||
}
|
||||
|
||||
|
||||
onMounted(()=>{
|
||||
onMounted(() => {
|
||||
// 真机/打包环境:通过 plus.runtime 获取
|
||||
// #ifndef H5
|
||||
version.value = plus.runtime.version || ''
|
||||
// #endif
|
||||
|
||||
// H5 端:从 manifest.json 读取
|
||||
// #ifdef H5
|
||||
fetch('/manifest.json')
|
||||
.then(r => r.text())
|
||||
.then(text => {
|
||||
// manifest.json 可能含 JS 注释,需先去除再解析
|
||||
const cleaned = text.replace(/\/\*[\s\S]*?\*\/|\/\/.*$/gm, '')
|
||||
const m = JSON.parse(cleaned)
|
||||
version.value = (m.versionName || '') + ' (' + (m.versionCode || '') + ')'
|
||||
})
|
||||
.catch(() => {
|
||||
version.value = ''
|
||||
})
|
||||
// #endif
|
||||
})
|
||||
|
||||
</script>
|
||||
@@ -145,6 +177,12 @@ onMounted(()=>{
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
/* 左侧标签 */
|
||||
.cell-label {
|
||||
font-size: 30rpx;
|
||||
color: #1c1c1e;
|
||||
}
|
||||
|
||||
/* 点击高亮(uni-app 用 hover-class 实现,这里仅演示结构) */
|
||||
.cell:active {
|
||||
background-color: #f2f2f7;
|
||||
|
||||
Reference in New Issue
Block a user