refactor(globalConfig&member): 重构多端按钮显示逻辑

1. 新增全局配置方法getAppType用于获取当前平台类型,对齐服务端$app_type
2. 将会员页按钮显示判断改为基于当前平台的配置校验
3. 简化模板中的条件判断代码
This commit is contained in:
2026-06-18 17:09:34 +08:00
parent 17864427c1
commit 06e3a4d796
2 changed files with 17 additions and 2 deletions

View File

@@ -1,3 +1,5 @@
import { Platform } from './platform.js';
// 内部 helper:获取当前页面实例
const _getCurrentPage = () => {
const pages = getCurrentPages();
@@ -186,6 +188,13 @@ export default {
}
},
methods: {
/**
* 当前平台类型(多端翻译隔离)
* 复用 Platform.getAppType(),与服务端 /api/BaseApi 的 $app_type 对齐
*/
getAppType() {
try { return Platform.getAppType() || '*'; } catch (e) { return '*'; }
},
// 颜色变浅(>0)、变深函数(<0)
lightenDarkenColor(color, amount) {