feat: 优化了若干接口,可用性存疑

This commit is contained in:
李琦
2026-08-12 08:57:35 +08:00
parent 929d6f1af6
commit 09db7705e8
92 changed files with 4573 additions and 9472 deletions

View File

@@ -0,0 +1,23 @@
/**
* 工作台功能卡片形态偏好(长卡/短卡)
* 存本地 storage(已确认不入库):用户在「我的」页切换后,各工作台首页 onShow 时读取生效
* short = 双列短卡(默认);long = 整行长卡
*/
const STORAGE_KEY = 'wb_card_style'
/**
* 读取卡片形态偏好,异常值一律回落 short,保证布局不会因脏数据坏掉
*/
export function getCardStyle() {
const value = uni.getStorageSync(STORAGE_KEY)
return value === 'long' ? 'long' : 'short'
}
/**
* 写入卡片形态偏好
* @param {'short'|'long'} style
*/
export function setCardStyle(style) {
uni.setStorageSync(STORAGE_KEY, style === 'long' ? 'long' : 'short')
}