From a3278f95ba536defe88752018725d1e46fdbedfa Mon Sep 17 00:00:00 2001
From: hejianhao <15708179461@qq.com>
Date: 星期五, 28 八月 2026 11:46:23 +0800
Subject: [PATCH] fix0806: GX
---
/dev/null | 279 ----------------------------------------------
traditionalApp/pages/mine/mine.vue | 59 ---------
traditionalApp/pages/articleDetail/articleDetail.vue | 3
traditionalApp/pages/good/projectDetail.vue | 4
traditionalApp/App.vue | 8 -
traditionalApp/manifest.json | 4
traditionalApp/config/index.js | 1
7 files changed, 5 insertions(+), 353 deletions(-)
diff --git a/traditionalApp/App.vue b/traditionalApp/App.vue
index b0e150a..b8d3dfa 100644
--- a/traditionalApp/App.vue
+++ b/traditionalApp/App.vue
@@ -11,10 +11,6 @@
import { cacheInviteCode } from '@/utils/invite-cache.js'
import { initJPushLifecycle } from '@/utils/push.js'
import {
- checkAppVersionUpdate,
- resumeForceUpdatePrompt
- } from '@/utils/app-version.js'
- import {
getOpeninstallInstallData,
initOpeninstall,
registerOpeninstallWakeUp
@@ -30,7 +26,6 @@
initOpeninstall()
registerOpeninstallWakeUp(handleOpeninstallPayload)
getOpeninstallInstallData(handleOpeninstallPayload)
- checkAppVersionUpdate()
// #endif
})
@@ -39,9 +34,6 @@
*/
onShow(() => {
handleOpenByScheme()
- // #ifdef APP-PLUS
- resumeForceUpdatePrompt()
- // #endif
})
/**
diff --git a/traditionalApp/config/index.js b/traditionalApp/config/index.js
index 5c925dd..d89ad39 100644
--- a/traditionalApp/config/index.js
+++ b/traditionalApp/config/index.js
@@ -2,7 +2,6 @@
// BASE_URL: 'http://221.182.45.100:48080',
BASE_URL: 'https://haizhentong.com',
OPENINSTALL_URL: 'https://m.malink.cn/s/7bIzeu',
- APP_STORE_URL: 'https://apps.apple.com/cn/app/%E6%B5%B7%E8%AF%8A%E5%BA%B7%E9%81%93/id6762694057',
uploadUrl: "https://haizhentong.com/api/open/file/upload",
imageUrl: 'http://221.182.45.100:11224/images/'
};
diff --git a/traditionalApp/manifest.json b/traditionalApp/manifest.json
index 216a56a..e9d19f7 100644
--- a/traditionalApp/manifest.json
+++ b/traditionalApp/manifest.json
@@ -3,8 +3,8 @@
"name" : "海诊康道",
"appid" : "__UNI__7B5B0CA",
"description" : "",
- "versionName" : "1.0.23",
- "versionCode" : 122,
+ "versionName" : "1.0.0",
+ "versionCode" : 100,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
diff --git a/traditionalApp/pages/articleDetail/articleDetail.vue b/traditionalApp/pages/articleDetail/articleDetail.vue
index 90597c9..8028439 100644
--- a/traditionalApp/pages/articleDetail/articleDetail.vue
+++ b/traditionalApp/pages/articleDetail/articleDetail.vue
@@ -21,7 +21,7 @@
<!-- 内容区域 -->
<view class="content-area">
- <text class="content-title">{{ detail.title || '健康科普详情' }}</text>
+ <text v-if="isVideoType" class="content-title">{{ detail.title || '健康科普详情' }}</text>
<text v-if="isVideoType && videoSubtitle" class="content-subtitle">{{ videoSubtitle }}</text>
<rich-text v-if="!isVideoType" :nodes="contentNodes" class="rich-content"></rich-text>
<view v-if="loading" class="status-text">加载中...</view>
@@ -288,7 +288,6 @@
}
.rich-content {
- margin-top: 24rpx;
width: 100%;
font-size: 28rpx;
line-height: 1.8;
diff --git a/traditionalApp/pages/good/projectDetail.vue b/traditionalApp/pages/good/projectDetail.vue
index dfd2943..dac4129 100644
--- a/traditionalApp/pages/good/projectDetail.vue
+++ b/traditionalApp/pages/good/projectDetail.vue
@@ -6,7 +6,7 @@
<!-- 导航栏 -->
<view class="nav-bar">
<image class="back-icon" src="/static/image/home/left.png" mode="aspectFit" @tap="goBack"></image>
- <text class="nav-title">{{ detail.title || '详情' }}</text>
+ <text class="nav-title">详情</text>
<view class="nav-right-placeholder"></view>
</view>
@@ -34,8 +34,6 @@
<!-- 图文内容 -->
<view v-if="detail.contentType === 1">
- <!-- 标题 -->
- <view class="detail-title">{{ detail.title }}</view>
<!-- 内容 -->
<view v-if="detail.content" class="html-content">
<rich-text :nodes="detail.content"></rich-text>
diff --git a/traditionalApp/pages/mine/mine.vue b/traditionalApp/pages/mine/mine.vue
index 956d038..fd05866 100644
--- a/traditionalApp/pages/mine/mine.vue
+++ b/traditionalApp/pages/mine/mine.vue
@@ -43,14 +43,6 @@
</view>
<u-icon name="arrow-right" color="#999" size="16"></u-icon>
</view>
- <view class="list-item" @tap="handleAppUpdateClick">
- <view class="list-left">
- <image class="list-icon icon-update" src="/static/image/mine/refish.png" mode="aspectFit"></image>
- <text class="list-title">更新版本</text>
- <view v-if="hasAppUpdate" class="update-dot"></view>
- </view>
- <u-icon name="arrow-right" color="#999" size="16"></u-icon>
- </view>
</view>
<view class="app-version-text">海诊康道 版本{{ appVersionText }}</view>
<view class="icp-text">ICP备案号:琼ICP备2025059220号-3A</view>
@@ -63,7 +55,6 @@
import { onLoad, onShow } from '@dcloudio/uni-app'
import { getNoticeList } from '../notice/service'
import { getUserCenter } from './service'
-import { getRuntimeVersionName, promptAppVersionUpdate, queryAppVersionUpdate } from '@/utils/app-version.js'
import { hasStoredSession } from '@/utils/auth-session.js'
import manifestConfig from '../../manifest.json'
@@ -112,9 +103,7 @@
const statusBarHeight = ref(0)
const unreadNoticeTotal = ref(0)
const manifestVersionName = String(manifestConfig.versionName || '')
-const appVersionText = ref(manifestVersionName)
-const hasAppUpdate = ref(false)
-const appUpdateInfo = ref<any>(null)
+const appVersionText = manifestVersionName
const userCenter = ref<UserCenterData>(createDefaultUserCenter())
const userRole = computed<UserRole>(() => {
return isDoctorLikeUser(userCenter.value) ? 'doctor' : 'personal'
@@ -226,7 +215,6 @@
onLoad(() => {
const systemInfo = uni.getSystemInfoSync()
statusBarHeight.value = systemInfo.statusBarHeight || 20
- resolveAppVersion()
syncCachedUserInfo()
})
@@ -237,21 +225,7 @@
syncCachedUserInfo()
loadUserCenter()
loadUnreadNoticeTotal()
- loadAppUpdateStatus()
})
-
-/**
- * 静默检查版本更新,仅用于控制更新入口红点。
- */
-async function loadAppUpdateStatus() {
- try {
- appUpdateInfo.value = await queryAppVersionUpdate()
- hasAppUpdate.value = !!appUpdateInfo.value
- } catch {
- appUpdateInfo.value = null
- hasAppUpdate.value = false
- }
-}
/**
* 拉取当前登录用户的通知未读总数。
@@ -415,19 +389,6 @@
}
/**
- * 有新版本时展示更新弹窗,无更新时保持静默。
- */
-async function handleAppUpdateClick() {
- if (!appUpdateInfo.value) {
- await loadAppUpdateStatus()
- }
- if (!appUpdateInfo.value) {
- return
- }
- promptAppVersionUpdate(appUpdateInfo.value)
-}
-
-/**
* 统一跳转个人中心相关页面。
*/
function goPage(target: string | MenuItem) {
@@ -457,17 +418,6 @@
url: '/pages/login/login',
})
}, 200)
-}
-
-/**
- * APP 环境读取当前安装包版本,非 APP 环境使用 manifest 版本兜底。
- */
-function resolveAppVersion() {
- getRuntimeVersionName(manifestVersionName).then((versionName) => {
- appVersionText.value = versionName || manifestVersionName
- }).catch(() => {
- appVersionText.value = manifestVersionName
- })
}
/**
@@ -755,13 +705,6 @@
margin-left: 22rpx;
}
- .update-dot {
- width: 16rpx;
- height: 16rpx;
- margin-left: 12rpx;
- border-radius: 50%;
- background: #E64340;
- }
}
}
}
diff --git a/traditionalApp/utils/app-version.js b/traditionalApp/utils/app-version.js
deleted file mode 100644
index 528fd5c..0000000
--- a/traditionalApp/utils/app-version.js
+++ /dev/null
@@ -1,279 +0,0 @@
-import config from '@/config/index.js'
-
-const CHECK_VERSION_URL = '/api/app/version/check'
-let checkingVersion = false
-let updatePopupVisible = false
-let latestUpdateInfo = null
-
-/**
- * 检查 APP 是否存在管理后台配置的新版本。
- */
-export function checkAppVersionUpdate() {
- // #ifndef APP-PLUS
- return
- // #endif
- if (checkingVersion) {
- return
- }
- checkingVersion = true
- resolveRuntimeVersionInfo()
- .then((runtimeInfo) => requestVersionCheck(runtimeInfo))
- .then((payload) => {
- const updateInfo = payload && payload.code === 0 ? payload.data : null
- if (!updateInfo || updateInfo.hasUpdate !== true) {
- return
- }
- const downloadUrl = resolveUpdateUrl(updateInfo)
- if (!downloadUrl) {
- return
- }
- showUpdateModal(Object.assign({}, updateInfo, {
- downloadUrl
- }))
- })
- .catch(() => {
- })
- .finally(() => {
- checkingVersion = false
- })
-}
-
-/**
- * 读取 APP 原生版本信息,优先使用 manifest 中的 versionCode。
- */
-function resolveRuntimeVersionInfo() {
- return new Promise((resolve) => {
- const fallbackInfo = {
- platform: resolvePlatform(),
- versionCode: 0,
- versionName: ''
- }
- if (typeof plus === 'undefined' || !plus.runtime || typeof plus.runtime.getProperty !== 'function') {
- console.log('[APP版本] 系统版本信息', fallbackInfo)
- resolve(fallbackInfo)
- return
- }
- plus.runtime.getProperty(plus.runtime.appid, (info) => {
- const runtimeInfo = {
- platform: resolvePlatform(),
- versionCode: normalizeVersionCode(info && info.versionCode),
- versionName: normalizeText(info && info.version)
- }
- console.log('[APP版本] 系统版本信息', runtimeInfo)
- resolve(runtimeInfo)
- })
- })
-}
-
-/**
- * 读取当前安装 APP 的展示版本号。
- */
-export function getRuntimeVersionName(fallbackVersionName = '') {
- return resolveRuntimeVersionInfo().then((runtimeInfo) => {
- return normalizeText(runtimeInfo.versionName) || normalizeText(fallbackVersionName)
- })
-}
-
-/**
- * 将当前运行平台转换为后端版本检查平台值。
- */
-function resolvePlatform() {
- const platform = normalizeText(uni.getSystemInfoSync().platform).toLowerCase()
- return platform === 'ios' ? 'IOS' : 'ANDROID'
-}
-
-/**
- * 请求后端版本检查接口。
- */
-function requestVersionCheck(runtimeInfo) {
- return new Promise((resolve, reject) => {
- uni.request({
- url: `${config.BASE_URL}${CHECK_VERSION_URL}`,
- method: 'GET',
- data: {
- platform: runtimeInfo.platform,
- currentVersionCode: runtimeInfo.versionCode,
- currentVersionNo: runtimeInfo.versionName
- },
- header: {
- 'content-type': 'application/json'
- },
- success: (res) => {
- console.log('[APP版本] 后台接口数据', JSON.stringify(res.data || {}))
- resolve(res.data || {})
- },
- fail: reject
- })
- })
-}
-
-/**
- * 解析当前平台可用的更新地址,iOS 只允许跳转 App Store。
- */
-function resolveUpdateUrl(updateInfo) {
- if (isIosPlatform()) {
- return normalizeText(config.APP_STORE_URL)
- }
- return normalizeText(updateInfo.downloadUrl)
-}
-
-/**
- * 展示版本更新弹窗,强制更新时禁止跳过。
- */
-function showUpdateModal(updateInfo) {
- latestUpdateInfo = updateInfo
- if (updatePopupVisible) {
- return
- }
- updatePopupVisible = true
- const forceUpdate = updateInfo.forceUpdate === true
- let confirmed = false
- uni.showModal({
- title: forceUpdate ? '发现新版本,请立即更新' : '发现新版本',
- content: buildUpdateContent(updateInfo),
- showCancel: !forceUpdate,
- cancelText: '暂不更新',
- confirmText: '立即更新',
- success: (modalResult) => {
- if (modalResult.confirm) {
- confirmed = true
- startAppUpdate(updateInfo.downloadUrl)
- return
- }
- },
- complete: () => {
- updatePopupVisible = false
- if (forceUpdate && !confirmed) {
- setTimeout(() => {
- showUpdateModal(updateInfo)
- }, 100)
- }
- }
- })
-}
-
-/**
- * 拼接更新提示内容,确保后台更新说明能直接展示给用户。
- */
-function buildUpdateContent(updateInfo) {
- const versionNo = normalizeText(updateInfo.latestVersionNo)
- const updateNotice = normalizeText(updateInfo.updateNotice) || '请更新到最新版本后继续使用。'
- return versionNo ? `最新版本:${versionNo}\n${updateNotice}` : updateNotice
-}
-
-/**
- * iOS 跳转 App Store;Android 下载完整 APK 后拉起系统安装界面。
- */
-function startAppUpdate(downloadUrl) {
- if (!downloadUrl) {
- return
- }
- if (isIosPlatform()) {
- plus.runtime.openURL(downloadUrl)
- return
- }
- let lastProgress = -1
- const downloadWaiting = plus.nativeUI.showWaiting('正在下载 0%', {
- modal: true,
- back: 'none'
- })
- const downloadTask = plus.downloader.createDownload(downloadUrl, {}, (download, status) => {
- downloadWaiting.close()
- if (status !== 200 || !download.filename) {
- handleUpdateFailure('安装包下载失败,请重试')
- return
- }
- const apkPath = plus.io.convertLocalFileSystemURL(download.filename)
- plus.runtime.install(apkPath, {}, () => {
- }, () => {
- handleUpdateFailure('安装失败,请重试')
- })
- })
- downloadTask.addEventListener('statechanged', (download) => {
- const totalSize = Number(download.totalSize || 0)
- if (totalSize <= 0) {
- return
- }
- const progress = Math.min(100, Math.floor(Number(download.downloadedSize || 0) * 100 / totalSize))
- if (progress === lastProgress) {
- return
- }
- lastProgress = progress
- downloadWaiting.setTitle(`正在下载 ${progress}%`)
- })
- downloadTask.start()
-}
-
-/**
- * 静默查询当前 APP 是否存在可用更新,供页面展示更新状态。
- */
-export function queryAppVersionUpdate() {
- // #ifndef APP-PLUS
- return Promise.resolve(null)
- // #endif
- return resolveRuntimeVersionInfo()
- .then((runtimeInfo) => requestVersionCheck(runtimeInfo))
- .then((payload) => {
- const updateInfo = payload && payload.code === 0 ? payload.data : null
- if (!updateInfo || updateInfo.hasUpdate !== true) {
- return null
- }
- const downloadUrl = resolveUpdateUrl(updateInfo)
- return downloadUrl ? Object.assign({}, updateInfo, { downloadUrl }) : null
- })
-}
-
-/**
- * 使用统一更新弹窗展示指定版本信息。
- */
-export function promptAppVersionUpdate(updateInfo) {
- if (updateInfo && updateInfo.hasUpdate === true) {
- showUpdateModal(updateInfo)
- }
-}
-
-/**
- * 下载或安装失败后重新开放更新入口。
- */
-function handleUpdateFailure(title) {
- uni.showToast({
- title,
- icon: 'none'
- })
- if (latestUpdateInfo) {
- setTimeout(() => {
- showUpdateModal(latestUpdateInfo)
- }, 1500)
- }
-}
-
-/**
- * APP 回到前台时,强制更新场景需要继续拦截用户使用旧版本。
- */
-export function resumeForceUpdatePrompt() {
- if (latestUpdateInfo && latestUpdateInfo.forceUpdate === true && !updatePopupVisible) {
- showUpdateModal(latestUpdateInfo)
- }
-}
-
-/**
- * 判断当前是否为 iOS APP。
- */
-function isIosPlatform() {
- return resolvePlatform() === 'IOS'
-}
-
-/**
- * 规范化可选字符串。
- */
-function normalizeText(value) {
- return String(value || '').trim()
-}
-
-/**
- * 规范化原生 versionCode,避免异常值传到后端。
- */
-function normalizeVersionCode(value) {
- const versionCode = Number(value || 0)
- return Number.isFinite(versionCode) && versionCode >= 0 ? versionCode : 0
-}
--
Gitblit v1.7.1