consumer模块完成度95%,能编译在安卓端运行,在解决数据获取和页面布局问题

This commit is contained in:
cyh666666
2026-02-26 17:27:15 +08:00
parent e606c597ca
commit b34f960624
1412 changed files with 3304 additions and 804 deletions

View File

@@ -28,6 +28,17 @@
- 使用可选链 `?.` 和空值合并 `??` 处理可空类型
- `uni.showModal` 的 `success` 回调不能是 `async` 函数
- 函数必须在使用前定义
- Promise.all 需要显式指定类型参数,如 Promise.all<any>([...])
- CSS 伪类选择器 :nth-child() 不支持,需要移除
- 如果函数 A 调用了函数 B则函数 B 必须在函数 A 之前定义(不仅是调用顺序,而是定义顺序)
- 不支持 Record<K, V> 对象字面量语法,需要改用 if-else 或 Map
- Promise.all 在某些情况下类型推断失败,可以改用顺序执行 await
- onLoad 的 options 参数是 any 类型,需要转换为 UTSJSONObject 后使用 getString() 方法访问属性
- decodeURIComponent 返回 String? 类型,需要检查 null 后再赋值
- 条件判断必须使用布尔类型,字符串要用 `!= ''` 代替 truthy 判断
- 数组元素类型要明确,不要用 any[],否则模板中无法访问元素属性
- 可空数组类型调用方法需要使用 `!` 非空断言,如 `arr!.join(',')`
- v-model 绑定的变量需要明确类型,如 `quantity: 1 as number`
- 不支持 `Record<K, V>` 对象字面量语法
- 模板中可空类型必须使用 `?.` 安全访问
- `uni.showModal` 的 `success` 回调不能是 `async` 函数