﻿================================================================================
                     UTS-Android 鍏煎鎬у紑鍙戣鑼?
================================================================================
> 浠ヤ笅涓?uni-app-x (UTS) Android 绔紑鍙戝父瑙佹敞鎰忎簨椤逛笌韪╁潙鐐癸紝寤鸿鎵€鏈夊紑鍙戞垚鍛橀伒寰細

================================================================================
涓€銆佸熀纭€璇硶瑙勮寖
================================================================================

1. 鍙橀噺澹版槑
   - 鍙兘浣跨敤 let 鍜?const锛屼笉鑳戒娇鐢?var
   - 鍙橀噺澹版槑蹇呴』鏈夋樉寮忕被鍨嬫垨鍒濆鍖栧€?
   - 涓嶆敮鎸?undefined 绫诲瀷锛屽彉閲忔湭璧嬪€煎氨鏄?null
   - 涓嶆敮鎸?undefined 鍏抽敭瀛楋紝鍒ゆ柇鏄惁瀛樺湪瑕佺敤 != null

2. 绫诲瀷瀹氫箟
   - 鍙€傚悎杞?type锛屼笉閫傚悎浣跨敤 interface锛坕nterface 鍦?kotlin/swift 涓彟鏈変笉鍚岋級
   - 涓嶆敮鎸?Intersection Type锛堜氦鍙夌被鍨嬶級
   - 涓嶆敮鎸?Index Signature锛堢储寮曠鍚嶏級
   - 绫诲瀷鎺ㄦ柇涓ユ牸锛屽繀瑕佹椂鐢?as Type 鏄庣‘绫诲瀷
   - 涓嶆敮鎸佸唴鑱斿璞＄被鍨嬶紙Object Literal Type锛夛紝闇€瑕佸崟鐙畾涔?type

3. 鍑芥暟瀹氫箟
   - 鍑芥暟蹇呴』鍦ㄤ娇鐢ㄥ墠瀹氫箟锛堜笉鏀寔鍑芥暟鎻愬崌锛?
   - 鍦?setup 妯″紡涓嬶紝璋冪敤鐨勫嚱鏁板繀椤诲湪璋冪敤涔嬪墠瀹氫箟
   - 渚濊禆鍏崇郴闇€瑕佹槑纭細琚皟鐢ㄧ殑鍑芥暟蹇呴』鍏堝畾涔?
   - 杩欎笌 JavaScript 鐨勫嚱鏁版彁鍗囪涓轰笉鍚岋紝UTS 鏇存帴杩?C/Java 鐨勭紪璇戞柟寮?

4. 寰幆
   - for 寰幆鐨?i 蹇呴』鍐欐槑绫诲瀷锛歭et i: Int = 0
   - 涓嶈鐢?forEach銆乵ap锛屾暟缁勯亶鍘嗙敤 for 寰幆
   - 宓屽鐨勬暟缁勬柟娉曡皟鐢ㄥ彲鑳藉鑷寸被鍨嬫帹鏂け璐ワ紝搴旀敼鐢?for 寰幆

================================================================================
浜屻€佺被鍨嬩笌瀵硅薄璁块棶
================================================================================

1. any 绫诲瀷璁块棶
   - 涓嶈兘鐩存帴璁块棶 any 绫诲瀷瀵硅薄鐨勫睘鎬?
   - 闇€瑕佸皢瀵硅薄杞崲涓?UTSJSONObject 绫诲瀷鍚庝娇鐢?getString()銆乬etNumber() 绛夋柟娉曡闂睘鎬?
   - any 绫诲瀷灞炴€ц闂渶杞崲涓?Record<string, any> 鍚庣敤绱㈠紩璁块棶
   - 浣跨敤绱㈠紩璁块棶灞炴€ф椂锛屾帹鑽愪娇鐢ㄦ柟鎷彿璇硶 obj['property'] 鑰岄潪鐐硅娉?obj.property
   - any 绫诲瀷涓嶆敮鎸佺储寮曡闂?obj['key']锛屽繀椤诲厛杞崲涓?UTSJSONObject

2. UTSJSONObject 浣跨敤
   - 鐢?utils/utis 涓嬬殑 UTSJSONObject 鍋氱被鍨嬭浆鎹?
   - 涓嶈鐢?safeget锛屽彧瑕?UTSJSONObject 灏卞ソ浜?
   - 闇€瑕佸垱寤哄姩鎬佸璞℃椂锛屽簲浣跨敤 new UTSJSONObject() 鐒跺悗璋冪敤 .set() 鏂规硶
   - 瀵逛簬 type 瀹氫箟鐨勫璞＄被鍨嬶紝鍚屾牱闇€瑕佷娇鐢?UTSJSONObject
   - 浣跨敤 getString()銆乬etNumber() 鏂规硶鑾峰彇灞炴€у€?

3. 鏁扮粍绫诲瀷
   - 鏁扮粍绫诲瀷寤鸿鍐欐垚 Array<Type>锛屼笉瑕佺敤 Type[] 绠€鍐?
   - 绌烘暟缁勯渶瑕佹槑纭寚瀹氱被鍨嬶紝濡?[] as string[]
   - 鏁扮粍鍏冪礌闇€瑕佹槑纭殑绫诲瀷瀹氫箟鎵嶈兘鍦ㄦā鏉夸腑姝ｇ‘璁块棶灞炴€?
   - 瀵逛簬 any[] 鎴?reactive 鏁扮粍锛岃闂厓绱犲睘鎬ф椂闇€瑕佸厛杞崲涓?Record<string, any> 鎴?any[]

4. 瀵硅薄鎿嶄綔
   - 涓嶆敮鎸?Object.keys()銆丱bject.values()銆丱bject.entries()
   - 涓嶆敮鎸?Record<K, V> 瀵硅薄瀛楅潰閲忚娉?
   - 瀵硅薄瀛楅潰閲?{...} 鍙兘鐢ㄤ簬鏋勯€犵被鍨嬶紙class锛夛紝涓嶈兘鐢ㄤ簬鎺ュ彛锛坕nterface锛?
   - reactive 瀵硅薄鍦?UTS 涓笉鏀寔绱㈠紩鍣ㄨ祴鍊兼搷浣?

================================================================================
涓夈€佹潯浠跺垽鏂笌閫昏緫杩愮畻
================================================================================

1. if 鏉′欢
   - if 鍒ゆ柇鍙帴鍙?boolean 绫诲瀷锛屼笉鑳芥槸鍏朵粬绫诲瀷鐨勫€?
   - 鍒ゆ柇绌鸿鐢?!== null锛屼笉鑳界敤 !鍙橀噺锛坲ts android 涓嶆敮鎸?!鍦ㄥ彉閲忓墠闈㈢殑鍒ゆ柇绌烘柟寮忥級
   - 妯℃澘涓殑 || 杩愮畻绗﹀乏杈瑰繀椤绘槸 boolean 绫诲瀷
   - 鍙┖绫诲瀷浣跨敤鍙€夐摼 ?. 鍜岀┖鍊煎悎骞???
   - 瀛楃涓插垽鏂┖瑕佺敤锛歷ariable != null && variable !== ''

2. 閫昏緫杩愮畻绗?
   - || 琛ㄧず閫昏緫鎴?
   - && 琛ㄧず閫昏緫涓?
   - ! 琛ㄧず閫昏緫闈烇紙浣?!鍙橀噺 涓嶆敮鎸佺敤浜庡垽鏂┖锛?
   - ?? 琛ㄧず绌哄€煎悎骞惰繍绠楃锛堝綋宸︿晶涓?null 鏃惰繑鍥炲彸渚у€硷級
   - ts 鐨勪负绌哄垯浣跨敤榛樿鍊肩殑璇硶鍦?uts 涓笉鑳界敤 ||锛岃鐢??? 鏉ヤ唬鏇?

================================================================================
鍥涖€佺粍浠朵笌妯℃澘
================================================================================

1. 琛ㄥ崟涓庤緭鍏?
   - 琛ㄥ崟浼樺厛鐢?form 缁勪欢
   - 涓嶆敮鎸?uni-easyinput锛岀敤 input 浠ｆ浛
   - 鏃堕棿閫夋嫨鐢?uni_modules/lime-date-time-picker

2. 閫夋嫨鍣?
   - uts android 涓嶆敮鎸?picker锛岀敤 picker-view 鎴?uni.showActionSheet
   - 涓€缁寸殑浼樺厛鐢?uni.showActionSheet
   - picker-view 鐨勪簨浠剁敤 UniPickerViewChangeEvent

3. 瀵艰埅涓庡竷灞€
   - 涓嶆敮鎸?uni-nav-bar锛屽厛鍒犻櫎
   - 涓嶆敮鎸?uni-data-select锛岀敤 picker-view 浠ｆ浛
   - 涓嶆敮鎸?uni-datetime-picker锛岀敤 components/picker-date 鎴?components/picker-time 浠ｆ浛
   - 涓嶆敮鎸?uni-icons

4. 妯℃澘娉ㄦ剰浜嬮」
   - 璺?template 浜や簰鐨勫彉閲忓敖閲忕敤涓€缁村彉閲忥紙涓嶈宓屽瀵硅薄锛?
   - 妯℃澘涓彲绌虹被鍨嬪繀椤讳娇鐢??. 瀹夊叏璁块棶
   - 妯℃澘涓闂彲绌虹被鍨嬪睘鎬у墠蹇呴』鍏堝垽绌?v-if="order != null"

================================================================================
浜斻€丆SS 鏍峰紡闄愬埗
================================================================================

1. 甯冨眬鏂瑰紡
   - 鍙敮鎸?display: flex
   - 涓嶆敮鎸?display: grid
   - 涓嶆敮鎸?gap
   - 涓嶆敮鎸?table銆乬rid銆乬rid-template-columns

2. 鍗曚綅涓庤绠?
   - 涓嶆敮鎸?calc()
   - 涓嶆敮鎸佺殑鍗曚綅: vh
   - property value `100%` is not supported for min-height (supported values are: number|pixel)
   - property value `calc(33.33% - 10px)` is not supported for min-width

3. 閫夋嫨鍣?
   - [APP-ANDROID] 涓嶆敮鎸佷吉绫婚€夋嫨鍣?
   - [APP-IOS] 涓嶆敮鎸佷吉绫婚€夋嫨鍣?
   - ERROR: Selector `.login-button[disabled]` is not supported. uvue only support classname selector

4. 鍏朵粬鏍峰紡
   - WARNING: `backdrop-filter` is not a standard property name
   - style property `white-space` is only supported on `<text>|<button>`
   - ERROR: property value `all` is not supported for `transition-property`

================================================================================
鍏€乻croll-view 浣跨敤
================================================================================

- scroll-view 鍦?uni-app-x 涓笉鏄敤 scroll-y=true
- 鑰屾槸瑕佺敤 direction="vertical"

================================================================================
涓冦€佸紓姝ヤ笌鍥炶皟
================================================================================

- uni.showModal 鐨?success 鍥炶皟涓嶈兘鏄?async 鍑芥暟
- 瑙ｅ喅鏂规锛氬垱寤虹嫭绔嬬殑 async 鍑芥暟锛屽湪鍥炶皟涓皟鐢?
- UTS 涓澶村嚱鏁?() => {} 鏈夋椂浼氬鑷?Parenthesized expression cannot be empty"閿欒
- 瑙ｅ喅鏂规锛氫娇鐢ㄦ櫘閫氬嚱鏁?function name(): Type {} 浠ｆ浛绠ご鍑芥暟

================================================================================
鍏€佸搷搴斿紡鏁版嵁
================================================================================

- 瀵逛簬闇€瑕佹暣浣撴浛鎹㈢殑鏁扮粍锛屾帹鑽愪娇鐢?ref 鑰岄潪 reactive
- 浣跨敤 ref 鏃讹紝閫氳繃 .value 杩涜鏁翠綋鏇挎崲鍙互姝ｇ‘瑙﹀彂鍝嶅簲寮忔洿鏂?
- ref 鏁扮粍鍏冪礌涓嶈兘鐩存帴鏁翠綋鏇挎崲锛岄渶瑕佷慨鏀瑰厓绱犲睘鎬?
- 瀵逛簬鍙兘涓?null 鐨勫弬鏁帮紝闇€瑕佹樉寮忔鏌ュ悗鍐嶄紶閫掔粰鍑芥暟

================================================================================
涔濄€佺被鍨嬪鍏?
================================================================================

- 绫诲瀷瀵煎叆闇€瑕佷娇鐢?type 鍏抽敭瀛?
- 涓€鑸儏鍐典笅锛屽敖鍙兘鐢ㄥ己绫诲瀷妯″紡
- uni_modules 鐨勬儏鍐典笅锛屽敖閲忔妸 type 瀹氫箟鍒?interface 閲岄潰
- 鏁版嵁鑾峰彇浜夊彇閮界敤寮虹被鍨嬫柟寮忥紝鏌ヨ鎴?rpc 鏌ヨ鐢?supa.from.executeAs<T>() 鏂瑰紡
- 杩斿洖鐨勬槸 result锛宺esultdata 涓€鑸彲浠?as Array<T>

================================================================================
鍗併€佸父瑙侀敊璇€熸煡
================================================================================

1. "Unresolved reference" - 鍑芥暟鏈畾涔夋垨椤哄簭閿欒
2. "Cannot create an instance of an abstract class" - Record<K,V> 涓嶈兘瀹炰緥鍖?
3. "Assignment type mismatch" - 绫诲瀷涓嶅尮閰嶏紝闇€瑕佹樉寮忕被鍨嬭浆鎹?
4. "if condition must be boolean" - if 鏉′欢蹇呴』鏄?boolean 绫诲瀷
5. "Index Signature is not supported" - 涓嶆敮鎸佺储寮曠鍚?
6. "Intersection Type is not supported" - 涓嶆敮鎸佷氦鍙夌被鍨?
7. "Parenthesized expression cannot be empty" - 绠ご鍑芥暟闂锛屾敼鐢ㄦ櫘閫氬嚱鏁?
8. "鎵句笉鍒板悕绉? - 灞炴€ц闂棶棰橈紝闇€杞崲涓?UTSJSONObject
9. "鍙傛暟绫诲瀷涓嶅尮閰? - 鍙傛暟绫诲瀷閿欒锛岄渶瑕佹樉寮忕被鍨嬭浆鎹?

================================================================================
鍗佷竴銆佺畝鏄庨€熻锛?0鏉★級
================================================================================

1.  琛ㄥ崟浼樺厛鐢?form 缁勪欢
2.  璺?template 浜や簰鐨勫彉閲忓敖閲忕敤涓€缁村彉閲?
3.  涓嶈鐢?forEach銆乵ap銆乻afeget锛屾暟缁勯亶鍘嗙敤 for 寰幆锛岀被鍨嬭浆鎹㈢敤 UTSJSONObject
4.  鏁扮粍绫诲瀷寤鸿鍐欐垚 Array<Type>锛屼笉瑕佺敤 Type[] 绠€鍐?
5.  涓嶆敮鎸?undefined锛屽彉閲忔湭璧嬪€煎氨鏄?null锛屽垽鏂敤 != null
6.  鍙橀噺澹版槑鍙兘鐢?let 鎴?const锛屼笉鑳界敤 var
7.  鍒ゆ柇绌鸿鐢?!== null锛屼笉鑳界敤 !鍙橀噺
8.  鍙敮鎸?type锛屼笉寤鸿鐢?interface
9.  for 寰幆鐨?i 蹇呴』鍐欐槑绫诲瀷锛歭et i: Int = 0
10. 閫昏緫鎴栫敤 ||锛岀┖鍊煎悎骞剁敤 ??锛屼笉鑳芥贩鐢?
11. if 鍒ゆ柇鍙兘鏄?boolean 绫诲瀷
12. 涓嶆敮鎸佺储寮曠鍚嶏紙Index Signature锛?
13. 绫诲瀷鎺ㄦ柇涓ユ牸锛屽繀瑕佹椂鐢?as Type 鏄庣‘绫诲瀷
14. 涓嶆敮鎸?Intersection Type
15. picker 鐢?picker-view 鎴?uni.showActionSheet 鏇夸唬
16. 鏍峰紡鍙敮鎸?display: flex锛屼笉鏀寔 gap銆乬rid銆乧alc()銆佷吉绫婚€夋嫨鍣?
17. scroll-view 鐢?direction="vertical"
18. 涓嶆敮鎸?table銆乬rid銆乿h 鍗曚綅銆乵in-width: 100% 绛?
19. 缁勪欢浜嬩欢濡?picker-view 鐢?UniPickerViewChangeEvent
20. 鏃堕棿閫夋嫨鐢?uni_modules/lime-date-time-picker
21. 绫诲瀷杞崲寤鸿鐢?utils/utis 涓嬬殑 UTSJSONObject
22. 鍦?uts setup 鐨?android 妯″紡涓嬶紝璋冪敤鐨勫嚱鏁板繀椤诲湪璋冪敤涔嬪墠瀹氫箟
23. 绠ご鍑芥暟涓嶆敮鎸侀粯璁ゅ弬鏁板€硷紝鏀圭敤鏄惧紡浼犲弬鎴栨櫘閫氬嚱鏁板畾涔?
24. 涓嶆敮鎸?Number()銆丼tring() 鏋勯€犲嚱鏁帮紝鐢?as 绫诲瀷杞崲
25. 涓嶆敮鎸?Object.keys()锛岀敤 JSON.stringify() 鎴?for 寰幆
26. 涓嶆敮鎸?typeof xxx === 'function'锛岀敤 try-catch 鏇夸唬
27. 涓嶆敮鎸?as unknown as 璇硶
28. parseInt() 鍙傛暟蹇呴』鏄?string 绫诲瀷
29. decodeURIComponent() 杩斿洖鍙┖绫诲瀷锛岄渶瑕佸鐞?null
30. charCodeAt() 杩斿洖鍙┖绫诲瀷锛岄渶瑕佸鐞?null
31. 涓嶆敮鎸佸唴鑱斿璞＄被鍨嬶紝闇€瑕佸湪 types 鏂囦欢涓崟鐙畾涔?
32. UTSJSONObject.get() 杩斿洖鍙┖绫诲瀷 Any?锛岄渶瑕佸鐞?null 骞惰浆鎹负鍏蜂綋绫诲瀷
33. Array<any> 鍏冪礌涓嶈兘鐩存帴璁块棶灞炴€э紝闇€杞崲涓?UTSJSONObject 鎴栧畾涔夋槑纭被鍨?
34. 绫诲瀷瀹氫箟涓睘鎬у彲鑳戒负 null 鏃讹紝蹇呴』澹版槑涓哄彲绌虹被鍨嬶紙濡?any | null锛?
35. switch 璇彞鍦ㄦ煇浜涚増鏈彲鑳芥湁闂锛屽缓璁敤 if-else 鏇夸唬
36. 妯℃澘涓彲閫夐摼 ?.length 闇€瑕佹敼涓烘樉寮忓垽鏂細v-if="arr != null && arr.length > 0"
37. 瑙ｆ瀯璧嬪€?const { data, error } 鍦?UTS 涓彲鑳芥湁闂锛屽缓璁敤 response.data 鏂瑰紡璁块棶
38. response.data 杩斿洖 Any?锛岃祴鍊煎墠闇€瑕佸垽鏂?null 骞剁被鍨嬭浆鎹?
39. 绌烘暟缁?[] 鏃犳硶鎺ㄦ柇绫诲瀷锛岄渶瑕佹樉寮忓０鏄庯細let arr: Array<any> = [] 鎴栧厛鍒ゆ柇 null 鍐嶈浆鎹?
40. ref 瀵硅薄瀛楅潰閲忛渶瑕佸畾涔夌被鍨嬶細const obj = ref<MyType>({...} as MyType)锛屽惁鍒欏睘鎬ц闂細鎶ラ敊
41. if 鏉′欢蹇呴』鏄?boolean锛屽彲绌虹被鍨嬭鐢?!= null 鍒ゆ柇锛歩f (obj != null) 鑰岄潪 if (obj)
42. throw 璇彞涓嶈兘鎶涘嚭 Any 绫诲瀷锛岄渶瑕佸鐞嗛敊璇€岄潪鎶涘嚭
43. 妯℃澘涓彲閫夐摼 ?.property 闇€瑕佹敼涓轰笁鍏冭〃杈惧紡锛歰bj != null ? obj.property : ''
44. ref<any> 鍦ㄦā鏉夸腑鏃犳硶璁块棶灞炴€э紝蹇呴』瀹氫箟鏄庣‘绫诲瀷锛歳ef<MyType | null>(null)
45. 灞曞紑杩愮畻绗?[...arr] 涓嶆敮鎸侊紝闇€瑕佹墜鍔ㄥ鍒舵暟缁?
46. Array.from(new Set()) 涓嶆敮鎸侊紝闇€瑕佹墜鍔ㄥ幓閲?
47. Promise.all 鍙兘鏈夐棶棰橈紝寤鸿鏀逛负椤哄簭鎵ц
48. .sort(() => Math.random() - 0.5) 闅忔満鎺掑簭涓嶆敮鎸侊紝闇€瑕佹墜鍔ㄥ疄鐜?
49. 鏁扮粍绱㈠紩璁块棶 arr[index] 鍙兘瓒婄晫锛屽缓璁敤 if-else 鏇夸唬鏁扮粍鏌ユ壘
50. 浜嬩欢瀵硅薄 e.detail.value 闇€瑕佽浆鎹负 UTSJSONObject 鍚庤闂?
51. String() 鏋勯€犲嚱鏁颁笉鏀寔锛岀敤 as string 绫诲瀷杞崲
52. 鏁扮粍绫诲瀷绠€鍐?string[] 闇€瑕佹敼涓?Array<string>
53. any 绫诲瀷鍙傛暟涓嶈兘鐩存帴璁块棶灞炴€э紝闇€瑕佽浆鎹负 UTSJSONObject 鍚庝娇鐢?get/getString/getNumber 鏂规硶
54. 妯℃澘涓?!鍙橀噺 鍙栧弽涓嶆敮鎸侊紝鏀逛负鏄惧紡鍒ゆ柇锛歷-if="str == ''" 鎴?v-if="bool == false"
55. 妯℃澘涓?:class="{ 'class': condition }" 瀵硅薄璇硶鍙兘鏈夐棶棰橈紝鏀逛负涓夊厓琛ㄨ揪寮忥細:class="condition ? 'class' : ''"
56. supabase .update() 鍙傛暟闇€瑕?UTSJSONObject 绫诲瀷锛岀敤 new UTSJSONObject() 鍒涘缓骞剁敤 .set() 璁剧疆灞炴€?
57. ref<Array<any>> 鍦ㄦā鏉夸腑鏃犳硶璁块棶鍏冪礌灞炴€э紝蹇呴』瀹氫箟鏄庣‘鐨勭被鍨嬪悗鎵嶈兘璁块棶
58. 鍑芥暟鍙傛暟鍙互鐢ㄨ仈鍚堢被鍨嬶細func(item: TypeA | TypeB)
59. JSON.stringify(UTSJSONObject) 鍙兘鏈夐棶棰橈紝闇€瑕佹墜鍔ㄦ嫾鎺ュ瓧绗︿覆
60. UTSJSONObject.keys() 鏂规硶涓嶅瓨鍦紝鏃犳硶鑾峰彇閿垪琛?
61. 鑱斿悎绫诲瀷鍙傛暟涓嶈兘鐩存帴璁块棶灞炴€э紝闇€瑕佸厛绫诲瀷杞崲锛歝onst id = (item as TypeA).id
62. 鏌愪簺 uni API 鍙兘涓嶅瓨鍦紙濡?navigateToMiniProgram锛夛紝闇€瑕佹鏌ユ垨鏇挎崲
63. JSON.parse(JSON.stringify(obj)) 澶嶆潅杞崲鍙兘鏈夐棶棰橈紝绠€鍖栧鐞?
64. showModal success 鍥炶皟涓嶈兘鏄?async 鍑芥暟锛岄渶瑕佹敼涓哄悓姝ユ垨浣跨敤 Promise
65. supa.auth.signOut() 绛?supabase auth 鏂规硶鍙兘涓嶆敮鎸侊紝闇€瑕佺畝鍖栧鐞?
66. 妯℃澘涓彲绌哄瓧绗︿覆鍒ゆ柇 userInfo.phone ? 鏀逛负 userInfo.phone != null && userInfo.phone != ''
67. Promise.all() 鍙兘鏈夐棶棰橈紝寤鸿鏀逛负椤哄簭鎵ц鎴?setTimeout
68. .then() 鍥炶皟鍙兘鏈夐棶棰橈紝寤鸿鐢?async/await 鎴栫洿鎺ヨ皟鐢?
69. let res: any = null 涓嶆敮鎸侊紝鏀逛负 let res: any = {} 鎴栧叾浠栭粯璁ゅ€?
70. 绫诲瀷瀹氫箟涓病鏈夌殑瀛楁涓嶈兘璧嬪€硷紝妫€鏌ョ被鍨嬪畾涔夊悗绉婚櫎澶氫綑瀛楁
71. ref<Array<any>> 鍦ㄦā鏉夸腑鏃犳硶璁块棶鍏冪礌灞炴€э紝蹇呴』瀹氫箟鏄庣‘鐨勭被鍨?
72. 妯℃澘涓鏉傝〃杈惧紡濡?parseFloat(String(x)) 涓嶆敮鎸侊紝绠€鍖栦负鐩存帴姣旇緝
73. forEach 涓嶆敮鎸侊紝鏀圭敤 for 寰幆
74. any 绫诲瀷鏁扮粍鍏冪礌涓嶈兘鐩存帴璁块棶灞炴€э紝闇€杞崲涓?UTSJSONObject
75. showModal success 鍥炶皟涓嶈兘鏄?async 鍑芥暟锛岄渶瑕佹敼涓哄悓姝ヨ皟鐢ㄧ嫭绔?async 鍑芥暟
76. 琚敓鍛藉懆鏈熼挬瀛愯皟鐢ㄧ殑鍑芥暟蹇呴』鍦ㄩ挬瀛愪箣鍓嶅畾涔夛紝鍖呮嫭 onMounted銆亀atch銆乷nUnmounted 绛?
77. 绠ご鍑芥暟涓嶆敮鎸侀粯璁ゅ弬鏁板€硷紝鏀圭敤鏄惧紡浼犲弬鎴栨櫘閫氬嚱鏁板畾涔?
78. 瀵硅薄瀛楅潰閲忚祴鍊肩粰 ref<Type> 闇€瑕佹樉寮忕被鍨嬪０鏄庯細const obj: Type = {...} as Type
79. 妯℃澘涓闂璞″睘鎬ф椂锛岀被鍨嬪畾涔夊繀椤诲寘鍚灞炴€э紝鍚﹀垯鎶?鎵句笉鍒板悕绉?閿欒
80. !variable 鍙栧弽鎿嶄綔涓嶆敮鎸侊紝鏀逛负 variable == '' 鎴?variable == false
81. supa.auth 鏂规硶涓嶆敮鎸侊紝闇€瑕佺畝鍖栧鐞嗘垨绉婚櫎
82. setInterval 鍥炶皟涓娇鐢ㄥ閮ㄥ彉閲忥紝闇€瑕佸厛澹版槑锛歭et timer: number = 0锛岀劧鍚庡湪鍥炶皟涓祴鍊?
83. $t() 鍥介檯鍖栧嚱鏁板湪妯℃澘涓彲鑳芥湁闂锛屽缓璁娇鐢ㄧ‖缂栫爜鏂囨湰鎴栬嚜瀹氫箟缈昏瘧鍑芥暟
84. profile.username ?? $t('xxx') 娣峰悎琛ㄨ揪寮忎笉鏀寔锛屾敼涓烘潯浠跺垽鏂細profile != null && profile.username != null ? profile.username : '榛樿鍊?
85. 鍙€夐摼鎿嶄綔绗??. 鍦ㄦ煇浜涘満鏅笉鏀寔锛屽 currentPage?.options锛岄渶瑕佹敼涓?if 鍒ゆ柇
86. as any[] 绫诲瀷杞崲鍚庢棤娉曡闂睘鎬э紝闇€瑕佷娇鐢ㄦ纭殑绫诲瀷濡?UTSJSONObject
87. 鍙┖绫诲瀷 string | null 浼犵粰闇€瑕?string 鐨勫嚱鏁帮紝闇€瑕佹樉寮忕被鍨嬭浆鎹細redirect as string
88. setInterval 鍥炶皟涓慨鏀瑰閮ㄥ彉閲忥紝闇€瑕佺敤 ref 鑰屼笉鏄?let 澹版槑鍙橀噺锛岄伩鍏?smart cast 闂
89. 闈炵┖鏂█鎿嶄綔绗?! 鍦ㄦ煇浜涘満鏅粛鐒舵棤娉曡В鍐崇被鍨嬮棶棰橈紝寤鸿绠€鍖栭€昏緫閬垮厤澶嶆潅绫诲瀷杞崲
90. decodeURIComponent 鍑芥暟鍙傛暟绫诲瀷涓ユ牸锛屽彲绌虹被鍨嬪嵆浣夸娇鐢?! 涔熷彲鑳芥姤閿欙紝寤鸿绠€鍖栨垨閬垮厤浣跨敤
91. getCurrentPages() 鑾峰彇椤甸潰 options 澶嶆潅涓斿鏄撳嚭閿欙紝寤鸿绠€鍖栬烦杞€昏緫
92. 妯℃澘涓唴鑱旂澶村嚱鏁颁笉鏀寔绫诲瀷娉ㄨВ锛屽 @input="(e: any) => ..." 浼氭姤閿欙紝鏀圭敤 v-model
93. :class="{ disabled: codeDisabled }" 瀵硅薄璇硶鍙兘鏈夐棶棰橈紝鏀逛负涓夊厓琛ㄨ揪寮?:class="codeDisabled ? 'disabled' : ''"
94. 浣跨敤澶栭儴绫诲瀷瀹氫箟鏃讹紝纭繚鎵€鏈夊睘鎬ч兘鏈夐粯璁ゅ€硷紝閬垮厤 null 瀵艰嚧绫诲瀷涓嶅尮閰?
95. Supabase insert/update 鍦?.uvue 鏂囦欢涓洿鎺ヨ皟鐢ㄥ彲鑳芥姤绫诲瀷閿欒锛屽缓璁皝瑁呭埌 .uts 鏈嶅姟鏂囦欢涓皟鐢?
96. 鍙┖绫诲瀷灞炴€у湪妯℃澘涓娇鐢ㄦ椂闇€瑕佸鐞?null锛歱rofile.gender ?? 'other'
97. 鍙┖鏁板瓧绫诲瀷姣旇緝鍓嶉渶瑕佸厛妫€鏌?null锛歱rofile.height_cm != null && profile.height_cm > 0
98. CSS 浼被閫夋嫨鍣?:last-child銆?first-child銆?nth-child() 涓嶆敮鎸侊紝闇€瑕佺Щ闄?
99. Supabase 鎵归噺 insert 鏁扮粍鍙傛暟绫诲瀷涓嶅尮閰嶏紝闇€瑕佹敼涓哄惊鐜€愭潯 insert
100. CSS 涓绔嬬殑灞炴€э紙娌℃湁閫夋嫨鍣級浼氬鑷寸紪璇戦敊璇細Return type mismatch: expected 'Map<String, Map<String, Map<String, Any>>>'
101. response.data as Type[] 鐩存帴绫诲瀷杞崲浼氭姤 ClassCastException锛岄渶瑕佹墜鍔ㄩ亶鍘嗘暟缁勫苟閫愪釜杞崲绫诲瀷
102. UTS110111163: 瀵硅薄瀛楅潰閲忓彧鑳借祴鍊肩粰 type 瀹氫箟鐨勭被鍨嬶紝涓嶈兘璧嬪€肩粰 interface 瀹氫箟鐨勭被鍨嬶紝
闇€瑕佸皢 interface 鏀逛负 type
103. Supabase 杩斿洖鐨勬暟鎹凡缁忔槸 UTSJSONObject 绫诲瀷锛屽彲浠ョ洿鎺?as UTSJSONObject 浣跨敤锛屼笉闇€瑕?instanceof 妫€鏌?
104. UTSJSONObject.getString() 鍦ㄥ瓧娈电被鍨嬩笉鏄?String 鏃朵細鎶?ClassCastException锛屽簲浣跨敤 get() 鏂规硶鑾峰彇鍘熷鍊煎悗鎵嬪姩绫诲瀷妫€鏌ワ細
     const val = obj.get('field')
     const str = (typeof val == 'string') ? (val as string) : ''
105. instanceof String 涓嶆敮鎸侊紝搴斾娇鐢?typeof val == 'string' 杩涜绫诲瀷妫€鏌?

================================================================================
鍗佷簩銆佹暣鐞嗘椂闂达細2026-02-25 鏂板
================================================================================

1. 鏋勯€犲嚱鏁伴檺鍒?
   - 涓嶆敮鎸?Number() 鏋勯€犲嚱鏁帮紝浣跨敤 as number 绫诲瀷杞崲
   - 涓嶆敮鎸?String() 鏋勯€犲嚱鏁帮紝浣跨敤 as string 绫诲瀷杞崲
   - 绀轰緥锛歂umber(x) 鈫?x as number锛孲tring(i) 鈫?i as string

2. 鍙栧弽鎿嶄綔绗﹂檺鍒?
   - 涓嶆敮鎸?!鍙橀噺 鐨勫彇鍙嶆搷浣滅鐢ㄤ簬鍒ゆ柇绌?
   - 瀛楃涓插垽鏂┖锛歷ariable == null || variable === ''
   - 绀轰緥锛?this.selectedSkuId 鈫?(this.selectedSkuId == null || this.selectedSkuId === '')

3. parseInt/parseFloat 闄愬埗
   - parseInt() 鍙傛暟蹇呴』鏄?string 绫诲瀷
   - 濡傛灉鍙橀噺鏄?number 绫诲瀷锛岀洿鎺ヤ娇鐢紝涓嶈璋冪敤 parseInt
   - 绀轰緥锛歱arseInt(this.quantity) 閿欒锛宷uantity 鏄?number锛岀洿鎺ョ敤 this.quantity

4. Object.keys() 涓嶆敮鎸?
   - 涓嶆敮鎸?Object.keys() 鏂规硶
   - 鏇夸唬鏂规锛氫娇鐢?JSON.stringify() 鎴?for 寰幆閬嶅巻
   - UTSJSONObject 鍙敤 .keys() 鏂规硶锛堜絾鏌愪簺鐗堟湰鍙兘涓嶆敮鎸侊級

5. typeof 鍑芥暟妫€鏌ヤ笉鏀寔
   - 涓嶆敮鎸?typeof xxx === 'function' 璇硶
   - 鏇夸唬鏂规锛氫娇鐢?try-catch 鍖呰９鏂规硶璋冪敤

6. as unknown as 璇硶涓嶆敮鎸?
   - 涓嶆敮鎸?as unknown as 鍙岄噸绫诲瀷杞崲
   - 鐩存帴浣跨敤 as 鐩爣绫诲瀷锛歰bj as UTSJSONObject

7. 鍙┖绫诲瀷鏂规硶杩斿洖鍊?
   - decodeURIComponent() 杩斿洖 String?锛岄渶瑕佸鐞?null
   - charCodeAt() 杩斿洖 Number?锛岄渶瑕佸鐞?null
   - 绀轰緥锛歝onst code = str.charCodeAt(i); if (code != null) { ... }

8. 鍐呰仈瀵硅薄绫诲瀷涓嶆敮鎸?
   - 涓嶆敮鎸?Array<{id: string, name: string}> 杩欑鍐呰仈绫诲瀷瀹氫箟
   - 闇€瑕佸湪 types 鏂囦欢涓崟鐙畾涔?type
   - 绀轰緥锛氬畾涔?type ItemType = { id: string, name: string }锛岀劧鍚庝娇鐢?Array<ItemType>

9. eventChannel 涓嶆敮鎸?
   - uni.navigateTo 鐨?success 鍥炶皟涓?res.eventChannel 涓嶆敮鎸?
   - 鏇夸唬鏂规锛氫娇鐢?Storage 鎴栧叏灞€鍙橀噺浼犻€掓暟鎹?

10. 閾惧紡璋冪敤闂
    - .map().join() 閾惧紡璋冪敤鍙兘瀵艰嚧绫诲瀷鎺ㄦ柇澶辫触
    - 鏇夸唬鏂规锛氫娇鐢?for 寰幆鎴栧垎姝ュ鐞?

11. v-model 绫诲瀷闄愬埗
    - input 鐨?v-model 鏈熸湜 string 绫诲瀷
    - 濡傛灉鍙橀噺鏄?number锛屼娇鐢?:value="variable.toString()" 鏇夸唬 v-model

================================================================================
鍗佷笁銆乻etup 妯″紡鍑芥暟瀹氫箟椤哄簭锛堥噸瑕侊級
================================================================================

鍦?<script setup lang="uts"> 涓紝鍑芥暟瀹氫箟椤哄簭鑷冲叧閲嶈锛?

1. 鍩烘湰瑙勫垯
   - 鍑芥暟蹇呴』鍦ㄨ皟鐢ㄤ箣鍓嶅畾涔夛紙涓嶆敮鎸?JavaScript 鐨勫嚱鏁版彁鍗囷級
   - 杩欎笌 JavaScript 鐨勮涓轰笉鍚岋紝UTS 鏇存帴杩?C/Java 鐨勭紪璇戞柟寮?

2. watch 鍜?onMounted 涓殑鍑芥暟璋冪敤
   - watch() 鍜?onMounted() 鏄珛鍗虫墽琛岀殑
   - 瀹冧滑鍐呴儴璋冪敤鐨勫嚱鏁板繀椤诲湪 watch/onMounted 涔嬪墠瀹氫箟
   - 閿欒绀轰緥锛?
     ```typescript
     // 閿欒锛乺esetData 鍜?loadRefunds 杩樻病瀹氫箟
     watch(activeTab, () => {
         resetData()
         loadRefunds()
     })
     
     const resetData = () => { ... }
     const loadRefunds = async () => { ... }
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     // 姝ｇ‘锛佸厛瀹氫箟鍑芥暟
     const resetData = () => { ... }
     const loadRefunds = async () => { ... }
     
     // 鍐嶈皟鐢?watch/onMounted
     watch(activeTab, () => {
         resetData()
         loadRefunds()
     })
     onMounted(() => {
         loadRefunds()
     })
     ```

3. 鎺ㄨ崘鐨勪唬鐮佺粍缁囬『搴?
   ```typescript
   <script setup lang="uts">
   // 1. 瀵煎叆璇彞
   import { ref, watch, onMounted } from 'vue'
   import { supabaseService } from '@/utils/supabaseService'
   
   // 2. 绫诲瀷瀹氫箟
   type MyType = { id: string, name: string }
   
   // 3. 鍝嶅簲寮忓彉閲忓０鏄?
   const data = ref<Array<MyType>>([])
   const loading = ref<boolean>(false)
   
   // 4. 宸ュ叿鍑芥暟锛堜笉渚濊禆鍏朵粬鍑芥暟鐨勶級
   const getUserId = (): string => { ... }
   
   // 5. 涓氬姟鍑芥暟锛堝彲鑳戒緷璧栧伐鍏峰嚱鏁帮級
   const loadData = async () => { ... }
   const resetData = () => { ... }
   
   // 6. 浜嬩欢澶勭悊鍑芥暟
   const handleClick = () => { ... }
   
   // 7. 鐢熷懡鍛ㄦ湡閽╁瓙鍜?watch锛堟斁鍦ㄦ渶鍚庯級
   watch(data, () => { ... })
   onMounted(() => { ... })
   </script>
   ```

4. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?鎵句笉鍒板悕绉?xxx"
   - 鍘熷洜锛氬嚱鏁板湪璋冪敤涔嬪悗瀹氫箟
   - 瑙ｅ喅锛氳皟鏁村嚱鏁板畾涔夐『搴忥紝纭繚琚皟鐢ㄧ殑鍑芥暟鍏堝畾涔?

================================================================================
鍗佸洓銆佺澶村嚱鏁伴檺鍒讹紙閲嶈锛?
================================================================================

1. 绠ご鍑芥暟涓嶆敮鎸侀粯璁ゅ弬鏁板€?
   - 閿欒绀轰緥锛?
     ```typescript
     const loadData = async (page: number = 1) => { ... }  // 閿欒锛?
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     // 鏂规1锛氫笉浣跨敤榛樿鍙傛暟锛岃皟鐢ㄦ椂鏄惧紡浼犲弬
     const loadData = async (page: number): Promise<void> => { ... }
     loadData(1)  // 璋冪敤鏃朵紶鍙?
     
     // 鏂规2锛氫娇鐢ㄦ櫘閫氬嚱鏁板畾涔?
     function loadData(page: number = 1): Promise<void> { ... }
     ```

2. 绠ご鍑芥暟闇€瑕佹槑纭繑鍥炵被鍨?
   - 寤鸿鏄惧紡澹版槑杩斿洖绫诲瀷锛歚: Promise<void>` 鎴?`: string` 绛?
   - 绀轰緥锛歚const getData = async (): Promise<string> => { ... }`

3. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?Anonymous functions cannot specify default values for their parameters"
   - 鍘熷洜锛氱澶村嚱鏁颁娇鐢ㄤ簡榛樿鍙傛暟
   - 瑙ｅ喅锛氱Щ闄ら粯璁ゅ弬鏁帮紝鏀圭敤鏄惧紡浼犲弬鎴栨櫘閫氬嚱鏁板畾涔?

================================================================================
鍗佷簲銆佹暟缁勫厓绱犲睘鎬ц闂紙閲嶈锛?
================================================================================

1. Array<any> 鍏冪礌灞炴€ц闂棶棰?
   - 鏁扮粍鍏冪礌绫诲瀷涓?any 鏃讹紝涓嶈兘鐩存帴璁块棶灞炴€?
   - 閿欒绀轰緥锛?
     ```typescript
     const steps: Array<any> = [...]
     steps[1].time = 'xxx'  // 閿欒锛佹壘涓嶅埌鍚嶇О "time"
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     const steps: Array<any> = [...]
     const step = steps[1] as UTSJSONObject
     step.set('time', 'xxx')
     ```

2. 鎺ㄨ崘鏂规锛氬畾涔夋槑纭殑绫诲瀷
   ```typescript
   type StepType = { status: number, title: string, time: string, desc: string }
   const steps: Array<StepType> = [...]
   steps[1].time = 'xxx'  // 姝ｇ‘锛?
   ```

3. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?鎵句笉鍒板悕绉?xxx"
   - 鍘熷洜锛歛ny 绫诲瀷鏁扮粍鍏冪礌鏃犳硶鐩存帴璁块棶灞炴€?
   - 瑙ｅ喅锛氳浆鎹负 UTSJSONObject 鎴栧畾涔夋槑纭被鍨?

================================================================================
鍗佸叚銆佺被鍨嬪畾涔変笌鍙┖绫诲瀷锛堥噸瑕侊級
================================================================================

1. 绫诲瀷瀹氫箟涓彲绌虹被鍨嬬殑澶勭悊
   - 濡傛灉灞炴€у彲鑳戒负 null锛屽繀椤绘樉寮忓０鏄庝负鍙┖绫诲瀷
   - 閿欒绀轰緥锛?
     ```typescript
     type ItemType = {
         sku_specifications: any  // 閿欒锛佸鏋滃€煎彲鑳戒负 null
     }
     const spec = getSpec()  // 杩斿洖 Any?
     item.sku_specifications = spec  // 绫诲瀷涓嶅尮閰?
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     type ItemType = {
         sku_specifications: any | null  // 姝ｇ‘锛?
     }
     const specRaw = getSpec()
     const spec = (specRaw != null) ? (specRaw as any) : null
     item.sku_specifications = spec
     ```

2. UTSJSONObject.get() 杩斿洖鍊煎鐞?
   - get() 鏂规硶杩斿洖 Any? 绫诲瀷
   - 蹇呴』鍏堝垽鏂?null锛屽啀杩涜绫诲瀷杞崲
   - 绀轰緥锛?
     ```typescript
     const raw = obj.get('field')
     const value = (raw != null) ? (raw as string) : null
     ```

3. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?鍙傛暟绫诲瀷涓嶅尮閰嶏細瀹為檯绫诲瀷涓?'Any?'锛岄鏈熺被鍨嬩负 'Any'"
   - 鍘熷洜锛氬彲绌虹被鍨嬩笉鑳界洿鎺ヨ祴鍊肩粰闈炵┖绫诲瀷
   - 瑙ｅ喅锛氫慨鏀圭被鍨嬪畾涔変负鍙┖绫诲瀷锛屾垨澶勭悊 null 鎯呭喌

================================================================================
鍗佷竷銆佹ā鏉夸腑鐨勫彲绌虹被鍨嬪鐞嗭紙閲嶈锛?
================================================================================

1. 妯℃澘涓彲閫夐摼闄愬埗
   - 妯℃澘涓??.length 绛夊彲閫夐摼鎿嶄綔鍙兘鎶ラ敊
   - 閿欒绀轰緥锛?
     ```html
     <view v-if="refund.status_history?.length > 0">
     ```
   - 姝ｇ‘绀轰緥锛?
     ```html
     <view v-if="refund.status_history != null && refund.status_history.length > 0">
     ```

2. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?Operator call is prohibited on a nullable receiver of type 'Number?'"
   - 鍘熷洜锛氬彲绌虹被鍨嬩笉鑳界洿鎺ヨ皟鐢ㄦ搷浣滅
   - 瑙ｅ喅锛氭樉寮忓垽鏂?null 鍚庡啀璁块棶灞炴€?

================================================================================
鍗佸叓銆佽В鏋勮祴鍊奸檺鍒讹紙閲嶈锛?
================================================================================

1. UTS 涓В鏋勮祴鍊煎彲鑳芥湁闂
   - 閿欒绀轰緥锛?
     ```typescript
     const { data, error } = await supa.from('table').select('*')
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     const response = await supa.from('table').select('*').execute()
     const data = response.data
     const error = response.error
     ```

2. 鎺ㄨ崘浣跨敤 .execute() 鑾峰彇瀹屾暣鍝嶅簲
   - 浣跨敤 response.data 鍜?response.error 璁块棶缁撴灉
   - 閬垮厤浣跨敤瑙ｆ瀯璧嬪€?

================================================================================
鍗佷節銆丄PI 鍝嶅簲鏁版嵁澶勭悊锛堥噸瑕侊級
================================================================================

1. response.data 杩斿洖 Any? 绫诲瀷
   - 閿欒绀轰緥锛?
     ```typescript
     order.value = orderRes.data  // 閿欒锛丄ny? 涓嶈兘璧嬪€肩粰 Any
     const itemsArray = itemsRes.data ?? []  // 閿欒锛佹棤娉曟帹鏂┖鏁扮粍绫诲瀷
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     if (orderRes.data != null) {
         order.value = orderRes.data as UTSJSONObject
     }
     
     const rawData = itemsRes.data
     let itemsArray: Array<any> = []
     if (rawData != null) {
         itemsArray = rawData as Array<any>
     }
     ```

2. 绌烘暟缁勭被鍨嬫帹鏂棶棰?
   - `[] ?? []` 鎴?`data ?? []` 鏃犳硶鎺ㄦ柇绫诲瀷
   - 蹇呴』鏄惧紡澹版槑鏁扮粍绫诲瀷
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     const arr = data ?? []
     
     // 姝ｇ‘
     let arr: Array<any> = []
     if (data != null) {
         arr = data as Array<any>
     }
     ```

3. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?Assignment type mismatch: actual type is 'Any?', but 'Any' was expected"
   - 鍘熷洜锛氬彲绌虹被鍨?Any? 涓嶈兘鐩存帴璧嬪€肩粰闈炵┖绫诲瀷
   - 瑙ｅ喅锛氬厛鍒ゆ柇 null锛屽啀杩涜绫诲瀷杞崲

   - 閿欒淇℃伅锛?Cannot infer type for this parameter" 鎴?"Not enough information to infer type"
   - 鍘熷洜锛氱┖鏁扮粍鏃犳硶鎺ㄦ柇绫诲瀷
   - 瑙ｅ喅锛氭樉寮忓０鏄庢暟缁勭被鍨?

================================================================================
浜屽崄銆乺ef 瀵硅薄瀛楅潰閲忕被鍨嬶紙閲嶈锛?
================================================================================

1. ref 瀵硅薄瀛楅潰閲忓繀椤诲畾涔夌被鍨?
   - 閿欒绀轰緥锛?
     ```typescript
     const merchantRating = ref({
         description: 5,
         logistics: 5,
         service: 5
     })
     merchantRating.value.description = rating  // 閿欒锛佹壘涓嶅埌鍚嶇О "description"
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     type MerchantRatingType = {
         description: number
         logistics: number
         service: number
     }
     
     const merchantRating = ref<MerchantRatingType>({
         description: 5,
         logistics: 5,
         service: 5
     } as MerchantRatingType)
     merchantRating.value.description = rating  // 姝ｇ‘锛?
     ```

2. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?鎵句笉鍒板悕绉?xxx"
   - 鍘熷洜锛歳ef 瀵硅薄瀛楅潰閲忔病鏈夋樉寮忕被鍨嬪畾涔?
   - 瑙ｅ喅锛氬畾涔?type 骞跺湪 ref 涓寚瀹氭硾鍨嬬被鍨?

================================================================================
浜屽崄涓€銆乮f 鏉′欢涓庡彲绌虹被鍨嬶紙閲嶈锛?
================================================================================

1. if 鏉′欢蹇呴』鏄?boolean 绫诲瀷
   - 閿欒绀轰緥锛?
     ```typescript
     if (merchant.value) { ... }  // 閿欒锛丮erchantType? 涓嶆槸 boolean
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     if (merchant.value != null) { ... }  // 姝ｇ‘锛?
     ```

2. 鍙┖绫诲瀷涓嶈兘鐩存帴鐢ㄤ簬 if 鏉′欢
   - 蹇呴』浣跨敤 != null 鎴?!== null 鍒ゆ柇
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     if (obj) { ... }
     
     // 姝ｇ‘
     if (obj != null) { ... }
     ```

3. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?Condition type mismatch: inferred type is 'XXX?' but 'Boolean' was expected"
   - 鍘熷洜锛氬彲绌虹被鍨嬩笉鑳界洿鎺ョ敤浜?if 鏉′欢
   - 瑙ｅ喅锛氫娇鐢?!= null 鍒ゆ柇

================================================================================
浜屽崄浜屻€乼hrow 璇彞闄愬埗锛堥噸瑕侊級
================================================================================

1. throw 璇彞涓嶈兘鎶涘嚭 Any 绫诲瀷
   - 閿欒绀轰緥锛?
     ```typescript
     const { error } = await supa.from('table').insert(data)
     if (error !== null) {
         throw error  // 閿欒锛丄ny 绫诲瀷涓嶈兘鎶涘嚭
     }
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     const res = await supa.from('table').insert(data).execute()
     if (res.error != null) {
         console.error('鎿嶄綔澶辫触:', res.error)
         uni.showToast({ title: '鎿嶄綔澶辫触', icon: 'none' })
         return  // 澶勭悊閿欒鑰岄潪鎶涘嚭
     }
     ```

2. 鎺ㄨ崘閿欒澶勭悊鏂瑰紡
   - 璁板綍閿欒鏃ュ織
   - 鏄剧ず鐢ㄦ埛鎻愮ず
   - 杩斿洖鎴栫粓姝㈡搷浣?

3. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?绫诲瀷涓嶅尮閰? 鎺ㄦ柇绫诲瀷鏄?Any',锛屼絾棰勬湡鐨勬槸'Throwable'"
   - 鍘熷洜锛歎TS 涓?throw 鍙兘鎶涘嚭 Throwable 绫诲瀷
   - 瑙ｅ喅锛氬鐞嗛敊璇€岄潪鎶涘嚭锛屾垨鍒涘缓 Error 瀵硅薄

================================================================================
浜屽崄涓夈€佹ā鏉夸腑鐨勫彲閫夐摼涓庡睘鎬ц闂紙閲嶈锛?
================================================================================

1. 妯℃澘涓彲閫夐摼闄愬埗
   - 閿欒绀轰緥锛?
     ```html
     <text>{{ order?.order_no }}</text>
     <text>{{ formatTime(order?.created_at) }}</text>
     ```
   - 姝ｇ‘绀轰緥锛?
     ```html
     <text>{{ order != null ? order.order_no : '' }}</text>
     <text>{{ formatTime(order != null ? order.created_at : '') }}</text>
     ```

2. ref<any> 鍦ㄦā鏉夸腑鏃犳硶璁块棶灞炴€?
   - 閿欒绀轰緥锛?
     ```typescript
     const order = ref<any>({})
     ```
     ```html
     <text>{{ order?.order_no }}</text>  <!-- 閿欒锛佹壘涓嶅埌鍚嶇О -->
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     type OrderType = {
         id: string
         order_no: string
         created_at: string
     }
     const order = ref<OrderType | null>(null)
     ```
     ```html
     <text>{{ order != null ? order.order_no : '' }}</text>
     ```

3. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?鎵句笉鍒板悕绉?xxx"
   - 鍘熷洜锛歛ny 绫诲瀷鎴栧彲閫夐摼鍦ㄦā鏉夸腑鏃犳硶姝ｇ‘鎺ㄦ柇灞炴€?
   - 瑙ｅ喅锛氬畾涔夋槑纭被鍨嬶紝浣跨敤涓夊厓琛ㄨ揪寮忔浛浠ｅ彲閫夐摼

================================================================================
浜屽崄鍥涖€佹暟缁勬搷浣滈檺鍒讹紙閲嶈锛?
================================================================================

1. 灞曞紑杩愮畻绗?[...arr] 涓嶆敮鎸?
   - 閿欒绀轰緥锛?
     ```typescript
     const shuffled = [...allGuessItems.value]
     searchResults.value.push(...newItems)
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     // 澶嶅埗鏁扮粍
     const arr: Array<any> = []
     for (let i: number = 0; i < allGuessItems.value.length; i++) {
         arr.push(allGuessItems.value[i])
     }
     // 杩藉姞鍏冪礌
     for (let i: number = 0; i < newItems.length; i++) {
         searchResults.value.push(newItems[i])
     }
     ```

2. Array.from(new Set()) 涓嶆敮鎸?
   - 閿欒绀轰緥锛?
     ```typescript
     const uniqueNames = Array.from(new Set(names))
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     // 鎵嬪姩鍘婚噸
     const uniqueNames: Array<string> = []
     for (let i: number = 0; i < names.length; i++) {
         let found = false
         for (let j: number = 0; j < uniqueNames.length; j++) {
             if (uniqueNames[j] === names[i]) {
                 found = true
                 break
             }
         }
         if (found === false) {
             uniqueNames.push(names[i])
         }
     }
     ```

3. .sort() 甯﹀洖璋冨嚱鏁颁笉鏀寔
   - 閿欒绀轰緥锛?
     ```typescript
     const shuffled = arr.sort(() => Math.random() - 0.5)
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     // Fisher-Yates 娲楃墝绠楁硶
     for (let i: number = arr.length - 1; i > 0; i--) {
         const j = Math.floor(Math.random() * (i + 1))
         const temp = arr[i]
         arr[i] = arr[j]
         arr[j] = temp
     }
     ```

================================================================================
浜屽崄浜斻€佸紓姝ユ搷浣滈檺鍒讹紙閲嶈锛?
================================================================================

1. Promise.all 鍙兘鏈夐棶棰?
   - 閿欒绀轰緥锛?
     ```typescript
     const [prodResp, shopResp] = await Promise.all([
         supabaseService.searchProducts(keyword, page, limit),
         supabaseService.searchShops(keyword)
     ])
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     const prodResp = await supabaseService.searchProducts(keyword, page, limit)
     const shopResp = await supabaseService.searchShops(keyword)
     ```

2. 瑙ｆ瀯璧嬪€煎彲鑳芥湁闂
   - 閿欒绀轰緥锛?
     ```typescript
     const [prodResp, shopResp] = await Promise.all([...])
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     const prodResp = await func1()
     const shopResp = await func2()
     ```

================================================================================
浜屽崄鍏€佷簨浠跺璞″鐞嗭紙閲嶈锛?
================================================================================

1. 浜嬩欢瀵硅薄灞炴€ц闂?
   - 閿欒绀轰緥锛?
     ```typescript
     const onInput = (e: any) => {
         const val = e.detail.value  // 閿欒锛佹壘涓嶅埌鍚嶇О "detail"
     }
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     const onInput = (e: any) => {
         const eObj = e as UTSJSONObject
         const detailRaw = eObj.get('detail')
         const detail = detailRaw != null ? (detailRaw as UTSJSONObject) : (new UTSJSONObject())
         const val = detail.getString('value') ?? ''
     }
     ```

2. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?鎵句笉鍒板悕绉?xxx"
   - 鍘熷洜锛歛ny 绫诲瀷浜嬩欢瀵硅薄鏃犳硶鐩存帴璁块棶灞炴€?
   - 瑙ｅ喅锛氳浆鎹负 UTSJSONObject 鍚庝娇鐢?get() 鏂规硶

================================================================================
浜屽崄涓冦€佹暟缁勭储寮曡闂檺鍒讹紙閲嶈锛?
================================================================================

1. 鏁扮粍绱㈠紩璁块棶鍙兘瓒婄晫
   - 閿欒绀轰緥锛?
     ```typescript
     const texts = ['闈炲父宸?, '宸?, '涓€鑸?, '濂?, '闈炲父濂?]
     return texts[rating - 1] ?? '鏈瘎浠?  // 鍙兘瓒婄晫鎴栫被鍨嬫帹鏂け璐?
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     if (rating === 1) return '闈炲父宸?
     if (rating === 2) return '宸?
     if (rating === 3) return '涓€鑸?
     if (rating === 4) return '濂?
     if (rating === 5) return '闈炲父濂?
     return '鏈瘎浠?
     ```

2. 鎺ㄨ崘浣跨敤 if-else 鎴?Map 鏇夸唬鏁扮粍绱㈠紩鏌ユ壘

================================================================================

鏂板锛?
getSpecText 鍑芥暟 - 灏?Object.keys() 鍜?.map() 鏇挎崲涓?JSON.stringify()锛孲tring() 鏇挎崲涓?as string 绫诲瀷杞崲

canSubmit 璁＄畻灞炴€?- 灏?.every() 鏇挎崲涓?for 寰幆閬嶅巻

妯℃澘涓殑鍙栧弽鎿嶄綔绗?- 灏?!canSubmit 鏇挎崲涓?canSubmit === false锛?isSubmitting 鏇挎崲涓?isSubmitting === false

璁㈠崟鍟嗗搧鏁版嵁澶勭悊 - 灏?.map() 鍜屽睍寮€杩愮畻绗?...item 鏇挎崲涓?for 寰幆鍜屾墜鍔ㄥ睘鎬ц祴鍊?

setRating 鍑芥暟 - 灏?[...ratings.value] 鏇挎崲涓烘墜鍔ㄦ暟缁勫鍒?

setMerchantRating 鍑芥暟 - 灏?{ ...merchantRating.value } 鏇挎崲涓烘墜鍔ㄥ璞″鍒讹紝鍙傛暟绫诲瀷鏀逛负 string

toggleAnonymous 鍑芥暟 - 灏?event.detail.value 鏀逛负 UTSJSONObject 璁块棶鏂瑰紡

uploadImage 鍑芥暟 - 灏?...tempFiles 鍜?[...images.value] 鏇挎崲涓?for 寰幆

deleteImage 鍑芥暟 - 灏?[...images.value] 鏇挎崲涓烘墜鍔ㄦ暟缁勫鍒?

submitReview 鍑芥暟 - 灏?.map() 鏇挎崲涓?for 寰幆鏋勫缓璇勪环鏁版嵁

OrderItemType 绫诲瀷瀹氫箟 - 娣诲姞浜?order_id 瀛楁

getCurrentUserId 鍑芥暟 - 灏嗗彲閫夐摼鏇挎崲涓烘樉寮?null 妫€鏌ュ拰 UTSJSONObject 杞崲

================================================================================
鍗佷簲銆佹暣鐞嗘椂闂达細2026-02-25 settings.uvue 淇鏂板
================================================================================

1. Storage 鏁版嵁绫诲瀷杞崲
   - uni.getStorageSync() 杩斿洖 any 绫诲瀷锛屼笉鑳界洿鎺ヨ祴鍊肩粰寮虹被鍨嬪彉閲?
   - 闇€瑕佽浆鎹负 UTSJSONObject 鍚庝娇鐢?getString()銆乬etBoolean() 绛夋柟娉?
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     const userStore = uni.getStorageSync('userInfo')
     if (userStore) {
         userInfo.value = userStore  // 绫诲瀷涓嶅尮閰?
     }
     
     // 姝ｇ‘
     const userStore = uni.getStorageSync('userInfo')
     if (userStore != null) {
         const storeObj = userStore as UTSJSONObject
         userInfo.value = {
             id: storeObj.getString('id') ?? '',
             phone: storeObj.getString('phone'),
             email: storeObj.getString('email')
         }
     }
     ```

2. 鍙€夐摼鎿嶄綔绗﹂檺鍒?
   - UTS Android 涓嶆敮鎸?obj?.property 鍙€夐摼鎿嶄綔绗︾敤浜庢潯浠跺垽鏂?
   - 闇€瑕佷娇鐢ㄦ樉寮?null 妫€鏌?
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     if (appInfo?.appVersion) { ... }
     
     // 姝ｇ‘
     if (appInfo != null) {
         const infoObj = appInfo as UTSJSONObject
         const version = infoObj.getString('appVersion')
         if (version != null) { ... }
     }
     ```

3. 甯冨皵鍊煎彇鍙嶆搷浣?
   - 涓嶆敮鎸?!variable 鍙栧弽鎿嶄綔
   - 闇€瑕佷娇鐢?variable === false 鏄惧紡鍒ゆ柇
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     notifications.value[type] = !notifications.value[type]
     
     // 姝ｇ‘
     if (type === 'order') {
         notifications.value.order = notifications.value.order === false
     }
     ```

4. keyof typeof 闄愬埗
   - 涓嶆敮鎸?keyof typeof 璇硶鐢ㄤ簬鍔ㄦ€佸睘鎬ц闂?
   - 闇€瑕佷娇鐢ㄥ瓧绗︿覆鍙傛暟鍜屾潯浠跺垽鏂?
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     const toggleNotification = (type: keyof NotificationType) => {
         notifications.value[type] = !notifications.value[type]
     }
     
     // 姝ｇ‘
     const toggleNotification = (type: string) => {
         if (type === 'order') {
             notifications.value.order = notifications.value.order === false
         } else if (type === 'promotion') {
             notifications.value.promotion = notifications.value.promotion === false
         }
     }
     ```

5. userInfo.value 灞炴€ц闂?
   - userInfo.value 鏄己绫诲瀷 UserType锛屼笉鏄?UTSJSONObject
   - 涓嶈兘浣跨敤 getString() 鏂规硶锛屽簲鐩存帴璁块棶灞炴€?
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     let userId = userInfo.value.getString('id')
     
     // 姝ｇ‘
     let userId: string | null = userInfo.value.id
     ```

================================================================================
鍗佸叚銆佹暣鐞嗘椂闂达細2026-02-25 shop-detail.uvue 淇鏂板
================================================================================

1. 椤甸潰鍙傛暟鑾峰彇
   - getCurrentPages() 杩斿洖鐨?options 闇€瑕佽浆鎹负 UTSJSONObject
   - 浣跨敤 getString() 鏂规硶鑾峰彇鍙傛暟
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     const options = pages[pages.length - 1].options as any
     const mId = options['merchantId']
     
     // 姝ｇ‘
     const options = pages[pages.length - 1].options as UTSJSONObject
     const mId = options.getString('merchantId')
     ```

2. 鏉′欢鍒ゆ柇鏄惧紡妫€鏌?
   - if (paramId) 闇€瑕佹敼涓?if (paramId != null && paramId !== '')
   - if (userId) 闇€瑕佹敼涓?if (userId != null && userId !== '')
   - !isLoading.value 闇€瑕佹敼涓?isLoading.value === false
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     if (hasMore.value && !isLoading.value && currentMerchantId.value != '')
     
     // 姝ｇ‘
     if (hasMore.value && isLoading.value === false && currentMerchantId.value != '')
     ```

3. typeof === 'function' 鏇挎崲涓?try-catch
   - 涓嶆敮鎸?typeof xxx === 'function' 妫€鏌?
   - 浣跨敤 try-catch 鍖呰９鏂规硶璋冪敤
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     if (typeof supabaseService.fetchShopCoupons === 'function') {
         coupons.value = await supabaseService.fetchShopCoupons(id)
     }
     
     // 姝ｇ‘
     try {
         // @ts-ignore
         coupons.value = await supabaseService.fetchShopCoupons(id)
     } catch(e) {
         console.warn('Method not available')
     }
     ```

4. .map() 鏇挎崲涓?for 寰幆
   - 涓嶆敮鎸?.map() 鏁扮粍鏂规硶
   - 浣跨敤 for 寰幆閬嶅巻骞舵瀯寤烘柊鏁扮粍
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     const list = rawList.map((item): ProductType => { ... })
     
     // 姝ｇ‘
     const list: ProductType[] = []
     for (let idx: number = 0; idx < rawList.length; idx++) {
         const item = rawList[idx] as UTSJSONObject
         const product: ProductType = { ... }
         list.push(product)
     }
     ```

5. 灞曞紑杩愮畻绗︽浛鎹?
   - 涓嶆敮鎸?...arr 灞曞紑杩愮畻绗?
   - 浣跨敤 for 寰幆閫愪釜娣诲姞鍏冪礌
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     images.push(...arr)
     products.value.push(...list)
     
     // 姝ｇ‘
     for (let i: number = 0; i < arr.length; i++) {
         images.push(arr[i])
     }
     for (let i: number = 0; i < list.length; i++) {
         products.value.push(list[i])
     }
     ```

6. any 绫诲瀷灞炴€ц闂?
   - any 绫诲瀷涓嶈兘鐩存帴璁块棶灞炴€?
   - 杞崲涓?UTSJSONObject 鍚庝娇鐢?getString()銆乬etNumber() 鏂规硶
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     const safeItem = item as any
     let safePrice = safeItem['base_price'] as number
     
     // 姝ｇ‘
     const item = rawList[idx] as UTSJSONObject
     let safePrice = item.getNumber('base_price')
     ```

7. typeof string 妫€鏌ユ浛鎹?
   - 涓嶆敮鎸?typeof rawUrl === 'string' 妫€鏌?
   - 鐩存帴灏濊瘯绫诲瀷杞崲鎴栦娇鐢?instanceof
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     if (typeof rawUrl === 'string') { ... }
     
     // 姝ｇ‘
     // 鐩存帴灏濊瘯浣跨敤锛屾垨浣跨敤鍏朵粬鏂瑰紡鍒ゆ柇
     const rawUrlStr = imageUrlsRaw as string
     if (rawUrlStr.startsWith('[')) { ... }
     ```

================================================================================
鍗佷竷銆佹暣鐞嗘椂闂达細2026-02-25 wallet.uvue 淇鏂板
================================================================================

1. isNaN 鍑芥暟闄愬埗
   - UTS Android 涓嶆敮鎸?isNaN() 鍑芥暟
   - 浣跨敤鏄惧紡鑼冨洿妫€鏌ユ浛浠?
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     const amount = parseFloat(rechargeAmount.value)
     return !isNaN(amount) && amount >= 10 && amount <= 5000
     
     // 姝ｇ‘
     const amount = parseFloat(rechargeAmount.value)
     if (amount == null || amount < 10 || amount > 5000) {
         return false
     }
     return true
     ```

2. Record 绫诲瀷闄愬埗
   - UTS Android 涓嶆敮鎸?Record<K, V> 绫诲瀷
   - 浣跨敤鏉′欢鍒ゆ柇鏇夸唬瀵硅薄鏌ユ壘
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     const icons: Record<string, string> = {
         recharge: '馃挸',
         consume: '馃洅'
     }
     const icon = icons[type]
     
     // 姝ｇ‘
     const getTransactionIcon = (type: string): string => {
         if (type === 'recharge') return '馃挸'
         if (type === 'consume') return '馃洅'
         return '馃挵'
     }
     ```

3. for 寰幆鍙橀噺绫诲瀷
   - for 寰幆鐨勭储寮曞彉閲忓繀椤绘樉寮忓０鏄庣被鍨?
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     for (let i = 0; i < data.length; i++) { ... }
     
     // 姝ｇ‘
     for (let i: number = 0; i < data.length; i++) { ... }
     ```

4. 灞曞紑杩愮畻绗︽浛鎹?
   - 涓嶆敮鎸?...arr 灞曞紑杩愮畻绗?
   - 浣跨敤 for 寰幆閫愪釜娣诲姞
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     transactions.value.push(...mappedData)
     
     // 姝ｇ‘
     for (let i: number = 0; i < mappedData.length; i++) {
         transactions.value.push(mappedData[i])
     }
     ```

5. 鍙€夐摼鎿嶄綔绗︽浛鎹?
   - 涓嶆敮鎸?obj?.method() 鍙€夐摼
   - 浣跨敤鏄惧紡 null 妫€鏌?
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     return userStore?.getString('id') ?? ''
     
     // 姝ｇ‘
     if (userStore == null) return ''
     const userInfo = userStore as UTSJSONObject
     return userInfo.getString('id') ?? ''
     ```

6. 妯℃澘涓殑鍙栧弽鎿嶄綔绗?
   - 妯℃澘涓笉鏀寔 !variable 鍙栧弽
   - 浣跨敤 === false 鏄惧紡鍒ゆ柇
   - 绀轰緥锛?
     ```html
     <!-- 閿欒 -->
     <view v-if="transactions.length === 0 && !isLoading">
     
     <!-- 姝ｇ‘ -->
     <view v-if="transactions.length === 0 && isLoading === false">
     ```

7. 鏉′欢鍒ゆ柇涓殑鍙栧弽鎿嶄綔绗?
   - 涓嶆敮鎸?!hasMore.value 鍙栧弽
   - 浣跨敤 hasMore.value === false 鏄惧紡鍒ゆ柇
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     if (hasMore.value && !isLoading.value) { ... }
     
     // 姝ｇ‘
     if (hasMore.value && isLoading.value === false) { ... }
     ```

================================================================================
鍗佸叓銆佹暣鐞嗘椂闂达細2026-02-25 withdraw.uvue 淇鏂板
================================================================================

1. 妯℃澘涓殑鍙€夐摼鎿嶄綔绗?
   - 妯℃澘涓笉鏀寔 obj?.property 鍙€夐摼
   - 浣跨敤 v-if 鍒ゆ柇鍚庡啀璁块棶灞炴€?
   - 绀轰緥锛?
     ```html
     <!-- 閿欒 -->
     <text>{{ selectedBank?.bank_name }}</text>
     <text v-if="selectedBank?.id == item.id">鉁?/text>
     
     <!-- 姝ｇ‘ -->
     <view v-if="selectedBank != null">
         <text>{{ selectedBank.bank_name }}</text>
     </view>
     <text v-if="selectedBank != null && selectedBank.id == item.id">鉁?/text>
     ```

2. 鎸夐挳绂佺敤鐘舵€?
   - :disabled="!isValid" 涓嶆敮鎸佸彇鍙?
   - 浣跨敤 :disabled="isValid === false"
   - 绀轰緥锛?
     ```html
     <!-- 閿欒 -->
     <button :disabled="!isValid">鎻愪氦</button>
     
     <!-- 姝ｇ‘ -->
     <button :disabled="isValid === false">鎻愪氦</button>
     ```

3. Map 绫诲瀷璁块棶闄愬埗
   - UTS Android 涓嶆敮鎸?Map<K, V> 绫诲瀷鐨?get() 鏂规硶璁块棶灞炴€?
   - 搴旂粺涓€浣跨敤 UTSJSONObject
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     const m = item as Map<string, any>
     const idVal = m.get('id')
     
     // 姝ｇ‘
     const itemObj = item as UTSJSONObject
     const id = itemObj.getString('id') ?? ''
     ```

4. 鍑芥暟鍐呭彇鍙嶆搷浣滅
   - if (!isValid.value) 涓嶆敮鎸佸彇鍙?
   - 浣跨敤 if (isValid.value === false)
   - 绀轰緥锛?
     ```typescript
     // 閿欒
     if (!isValid.value) return
     
     // 姝ｇ‘
     if (isValid.value === false) return
     ```

================================================================================
浜屽崄涓€銆?026-02-25 user 鐩綍椤甸潰淇璁板綍
================================================================================

1. change-password.uvue 淇
   - 闂锛?oldPassword.value 鍙栧弽鎿嶄綔涓嶆敮鎸?
   - 淇锛氭敼涓?oldPassword.value == '' 鏄惧紡鍒ゆ柇
   - 闂锛歝onst { error } = await ... 瑙ｆ瀯璧嬪€间笉鏀寔
   - 淇锛氭敼涓?const result = await ... 鐒跺悗 result.error 璁块棶

2. login.uvue 淇
   - 闂锛歛s unknown as number 鍙岄噸绫诲瀷杞崲涓嶆敮鎸?
   - 淇锛氭敼涓?as number 鍗曚竴绫诲瀷杞崲
   - 闂锛歵ypeof err === 'object' 涓嶆敮鎸?
   - 淇锛氫娇鐢?try-catch 鍖呰９绫诲瀷杞崲

3. forgot-password.uvue 淇
   - 闂锛?emailRegex.test(this.email) 鍙栧弽鎿嶄綔涓嶆敮鎸?
   - 淇锛氭敼涓?emailRegex.test(this.email) == false
   - 闂锛歵ypeof err === 'object' 涓嶆敮鎸?
   - 淇锛氫娇鐢?try-catch 鍖呰９绫诲瀷杞崲

4. register.uvue 淇
   - 闂锛?protocol.value 鍙栧弽鎿嶄綔涓嶆敮鎸?
   - 淇锛氭敼涓?protocol.value == false
   - 闂锛?validateEmail() 绛夊彇鍙嶆搷浣滀笉鏀寔
   - 淇锛氭敼涓?validateEmail() == false

================================================================================
浜屽崄浜屻€佸父瑙佷慨澶嶆ā寮忛€熸煡
================================================================================

1. 鍙栧弽鎿嶄綔淇妯″紡
   ```typescript
   // 閿欒
   if (!variable) { ... }
   if (!isValid.value) { ... }
   if (!validate()) { ... }
   
   // 姝ｇ‘ - 鏍规嵁绫诲瀷閫夋嫨
   if (variable == null || variable == '') { ... }  // 瀛楃涓插垽绌?
   if (isValid.value == false) { ... }              // 甯冨皵鍊煎彇鍙?
   if (validate() == false) { ... }                 // 鍑芥暟杩斿洖甯冨皵鍊煎彇鍙?
   ```

2. 瑙ｆ瀯璧嬪€间慨澶嶆ā寮?
   ```typescript
   // 閿欒
   const { data, error } = await someAsyncCall()
   
   // 姝ｇ‘
   const result = await someAsyncCall()
   const data = result.data
   const error = result.error
   ```

3. typeof 妫€鏌ヤ慨澶嶆ā寮?
   ```typescript
   // 閿欒
   if (typeof err === 'object') { ... }
   if (typeof xxx === 'function') { ... }
   
   // 姝ｇ‘
   try {
     const e = err as Error
     // 浣跨敤 e
   } catch (e2) {
     // 澶勭悊杞崲澶辫触
   }
   ```

4. as unknown as 淇妯″紡
   ```typescript
   // 閿欒
   const timer = setInterval(...) as unknown as number
   
   // 姝ｇ‘
   const timer = setInterval(...) as number
   ```

================================================================================
浜屽崄涓夈€侀敊璇鐞嗘渶浣冲疄璺?
================================================================================

1. 缁熶竴閿欒澶勭悊妯″紡
   ```typescript
   try {
     const result = await someAsyncCall()
     if (result.error != null) {
       const errorMsg = (result.error as Error).message
       uni.showToast({ title: errorMsg, icon: 'none' })
       return
     }
     // 澶勭悊鎴愬姛缁撴灉
   } catch (e) {
     console.error('鎿嶄綔澶辫触:', e)
     uni.showToast({ title: '鎿嶄綔澶辫触', icon: 'none' })
   }
   ```

2. 鍙┖绫诲瀷瀹夊叏璁块棶
   ```typescript
   // 瀹夊叏璁块棶瀵硅薄灞炴€?
   const value = obj != null ? obj.property : null
   
   // 瀹夊叏璋冪敤鏂规硶
   const result = obj != null ? obj.method() : null
   ```

3. 鏁扮粍瀹夊叏璁块棶
   ```typescript
   // 瀹夊叏璁块棶鏁扮粍鍏冪礌
   if (arr.length > index) {
     const item = arr[index]
     // 浣跨敤 item
   }
   ```

================================================================================
鏂囨。缁撴潫
================================================================================

================================================================================
浜屽崄鍥涖€?026-02-27 鍑芥暟鍙€夊弬鏁伴檺鍒讹紙閲嶈锛?
================================================================================

1. 鍙€夊弬鏁颁笉鑳借烦杩囦紶閫?
   - UTS Android 涓嶆敮鎸佽烦杩囧彲閫夊弬鏁颁紶閫?
   - 濡傛灉鍑芥暟鏈夊涓彲閫夊弬鏁帮紝蹇呴』鎸夐『搴忎紶閫掓墍鏈夊弬鏁?
   - 閿欒绀轰緥锛?
     ```typescript
     // 鍑芥暟瀹氫箟
     async addToCart(productId: string, quantity: number = 1, skuId?: string, merchantId?: string): Promise<boolean>
     
     // 閿欒璋冪敤 - 璺宠繃浜?merchantId 鍙傛暟
     await supabaseService.addToCart(productId, 1, '')
     // 缂栬瘧閿欒锛歂o value passed for parameter 'merchantId'
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     // 鏂规1锛氱粰鍙€夊弬鏁版坊鍔犻粯璁ゅ€?
     async addToCart(productId: string, quantity: number = 1, skuId: string = '', merchantId: string = ''): Promise<boolean>
     
     // 鏂规2锛氳皟鐢ㄦ椂浼犻€掓墍鏈夊弬鏁?
     await supabaseService.addToCart(productId, 1, '', '')
     ```

2. 鍙€夊弬鏁板畾涔夎鑼?
   - 鎺ㄨ崘浣跨敤 `param: Type = defaultValue` 鑰岄潪 `param?: Type`
   - `param?: Type` 鍦?Android 绔皟鐢ㄦ椂浠嶉渶浼犻€掑弬鏁?
   - `param: Type = defaultValue` 鍙互鍦ㄤ笉浼犲弬鏃朵娇鐢ㄩ粯璁ゅ€?
   - 绀轰緥锛?
     ```typescript
     // 涓嶆帹鑽?- 璋冪敤鏃朵粛闇€浼犻€掑弬鏁?
     function foo(a: string, b?: string, c?: string): void
     
     // 鎺ㄨ崘 - 鍙互璺宠繃鍙傛暟浣跨敤榛樿鍊?
     function foo(a: string, b: string = '', c: string = ''): void
     ```

3. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?No value passed for parameter 'xxx'"
   - 鍘熷洜锛氬彲閫夊弬鏁板湪 Android 绔笉鑳借烦杩?
   - 瑙ｅ喅锛?
     1. 淇敼鍑芥暟绛惧悕锛屼娇鐢ㄩ粯璁ゅ€?`param: Type = defaultValue`
     2. 璋冪敤鏃朵紶閫掓墍鏈夊弬鏁?

4. 鏈€浣冲疄璺?
   - 瀵逛簬鏈夊涓彲閫夊弬鏁扮殑鍑芥暟锛岀粺涓€浣跨敤榛樿鍊艰娉?
   - 璋冪敤鏃舵樉寮忎紶閫掓墍鏈夊弬鏁帮紝閬垮厤渚濊禆鍙€夊弬鏁拌烦杩?
   - 鍦ㄦ湇鍔″眰鍑芥暟瀹氫箟涓紝浼樺厛浣跨敤 `= ''` 鎴?`= 0` 绛夐粯璁ゅ€?

================================================================================
浜屽崄浜斻€?026-02-27 妯℃澘涓殑闈炵┖鏂█闄愬埗锛堥噸瑕侊級
================================================================================

1. 妯℃澘涓笉鏀寔闈炵┖鏂█鎿嶄綔绗?`!`
   - UTS Android 妯℃澘涓笉鑳戒娇鐢?`variable!` 闈炵┖鏂█
   - 閿欒绀轰緥锛?
     ```html
     <text v-if="product.original_price != null && product.original_price! > product.price">
     ```
   - 姝ｇ‘绀轰緥锛?
     ```html
     <text v-if="product.original_price != null && product.original_price > product.price">
     ```

2. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?鍙傛暟绫诲瀷涓嶅尮閰嶏細瀹為檯绫诲瀷涓?'Number?'锛岄鏈熺被鍨嬩负 'Number'"
   - 鍘熷洜锛氭ā鏉夸腑浣跨敤闈炵┖鏂█ `!` 涓嶈鏀寔
   - 瑙ｅ喅锛氱Щ闄ら潪绌烘柇瑷€ `!`锛岀洿鎺ヤ娇鐢ㄥ彉閲忚繘琛屾瘮杈?

3. 鏈€浣冲疄璺?
   - 鍦ㄦā鏉夸腑锛屽厛鐢?`!= null` 鍒ゆ柇鍙┖绫诲瀷锛岀劧鍚庣洿鎺ヤ娇鐢ㄥ彉閲?
   - UTS 缂栬瘧鍣ㄤ細鍦?`!= null` 鍒ゆ柇鍚庤嚜鍔ㄨ瘑鍒彉閲忎负闈炵┖绫诲瀷

================================================================================
浜屽崄鍏€?026-02-27 鏈鍏ョ被鍨嬬殑澶勭悊锛堥噸瑕侊級
================================================================================

1. 鏈鍏ョ殑绫诲瀷涓嶈兘鐩存帴浣跨敤
   - 鍦ㄩ〉闈腑浣跨敤鐨勭被鍨嬪繀椤诲厛瀵煎叆鎴栦娇鐢?UTSJSONObject 鏇夸唬
   - 閿欒绀轰緥锛?
     ```typescript
     // Shop 绫诲瀷鏈鍏?
     const s = shopRespData[i] as Shop
     const id = s.id  // 鎵句笉鍒板悕绉?"id"
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     // 浣跨敤 UTSJSONObject
     const s = shopRespData[i] as UTSJSONObject
     const id = s.getString('id') ?? ''
     const name = s.getString('shop_name') ?? ''
     ```

2. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?鎵句笉鍒板悕绉?'XXX'"
   - 鍘熷洜锛氱被鍨嬫湭瀵煎叆鎴栫被鍨嬪畾涔変笉瀛樺湪
   - 瑙ｅ喅锛?
     1. 瀵煎叆闇€瑕佺殑绫诲瀷锛歚import { Shop } from '@/utils/supabaseService.uts'`
     2. 浣跨敤 UTSJSONObject 鏇夸唬锛歚as UTSJSONObject` 鐒跺悗鐢?`getString()`銆乣getNumber()` 璁块棶灞炴€?

3. 鏈€浣冲疄璺?
   - 瀵逛簬绠€鍗曠殑鏁版嵁杞崲锛屾帹鑽愪娇鐢?UTSJSONObject
   - 閬垮厤鍦ㄥ涓枃浠朵腑閲嶅瀹氫箟鐩稿悓鐨勭被鍨?
   - 濡傛灉闇€瑕佺被鍨嬪畨鍏紝浠庢湇鍔″眰瀵煎叆绫诲瀷瀹氫箟

================================================================================
浜屽崄涓冦€?026-02-27 鏈嶅姟灞傛暟鎹瓧娈靛畬鏁存€э紙閲嶈锛?
================================================================================

1. 鏈嶅姟灞傝繑鍥炴暟鎹繀椤诲寘鍚墍鏈夊繀瑕佸瓧娈?
   - 浠庢暟鎹簱鑾峰彇鏁版嵁鏃讹紝蹇呴』姝ｇ‘鏄犲皠鎵€鏈夐渶瑕佺殑瀛楁
   - 閿欒绀轰緥锛?
     ```typescript
     const product: Product = {
       id: prodObj.getString('id') ?? '',
       name: prodObj.getString('name') ?? '',
       // 閿欒锛歮erchant_id 纭紪鐮佷负绌哄瓧绗︿覆
       merchant_id: ''
     } as Product
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     const product: Product = {
       id: prodObj.getString('id') ?? '',
       name: prodObj.getString('name') ?? '',
       // 姝ｇ‘锛氫粠鏁版嵁搴撹幏鍙?merchant_id
       merchant_id: prodObj.getString('merchant_id') ?? ''
     } as Product
     ```

2. 璋冪敤鏈嶅姟灞傛柟娉曟椂蹇呴』浼犻€掑畬鏁村弬鏁?
   - 椤甸潰璋冪敤鏈嶅姟灞傛柟娉曟椂锛岄渶瑕佷紶閫掓墍鏈夊繀瑕佸弬鏁?
   - 閿欒绀轰緥锛?
     ```typescript
     // 閿欒锛歮erchant_id 浼犵┖瀛楃涓?
     await supabaseService.addToCart(productId, 1, '', '')
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     // 姝ｇ‘锛氫粠鍟嗗搧瀵硅薄鑾峰彇 merchant_id
     const merchantId = product.merchant_id ?? ''
     await supabaseService.addToCart(productId, 1, '', merchantId)
     ```

3. 缂栬瘧閿欒鎻愮ず
   - 闂琛ㄧ幇锛氭暟鎹坊鍔犲埌鏁版嵁搴撳け璐ワ紝鎴栨坊鍔犵殑鏁版嵁涓嶅畬鏁?
   - 鍘熷洜锛氭湇鍔″眰鎴栭〉闈㈠眰缂哄皯蹇呰瀛楁鐨勪紶閫?
   - 瑙ｅ喅锛?
     1. 妫€鏌ユ湇鍔″眰鏁版嵁鏄犲皠鏄惁瀹屾暣
     2. 妫€鏌ラ〉闈㈣皟鐢ㄦ椂鏄惁浼犻€掍簡鎵€鏈夊繀瑕佸弬鏁?

4. 鏈€浣冲疄璺?
   - 鏈嶅姟灞傛柟娉曡繑鍥炵殑瀵硅薄搴斿寘鍚暟鎹簱瑙嗗浘鐨勬墍鏈夊瓧娈?
   - 椤甸潰璋冪敤鏈嶅姟灞傛柟娉曟椂锛屽簲浠庢暟鎹璞′腑鑾峰彇骞朵紶閫掓墍鏈夊弬鏁?
   - 瀵逛簬鍏宠仈鏁版嵁锛堝 merchant_id锛夛紝纭繚鍦ㄦ暟鎹姞杞芥椂涓€骞惰幏鍙?

================================================================================
浜屽崄鍏€?026-02-27 妯℃澘涓殑闈炶繍绠楃闄愬埗锛堥噸瑕侊級
================================================================================

1. 妯℃澘涓笉鏀寔 `!` 闈炶繍绠楃
   - UTS Android 妯℃澘涓笉鑳戒娇鐢?`!variable` 闈炶繍绠楃
   - 閿欒绀轰緥锛?
     ```html
     <view v-if="!brand.logo_url">
     ```
   - 姝ｇ‘绀轰緥锛?
     ```html
     <view v-if="brand.logo_url == null || brand.logo_url == ''">
     ```

2. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?鎵句笉鍒板悕绉?not'"
   - 鍘熷洜锛氭ā鏉夸腑涓嶆敮鎸侀潪杩愮畻绗?`!`
   - 瑙ｅ喅锛氫娇鐢ㄦ樉寮忕殑姣旇緝琛ㄨ揪寮忔浛浠?

3. 鏈€浣冲疄璺?
   - 浣跨敤 `== null` 鎴?`== ''` 妫€鏌ョ┖鍊?
   - 浣跨敤 `!= null && != ''` 妫€鏌ラ潪绌哄€?

================================================================================
浜屽崄涔濄€?026-02-27 绱㈠紩璁块棶闄愬埗锛堥噸瑕侊級
================================================================================

1. 涓嶆敮鎸?`(obj as any)['key']` 绱㈠紩璁块棶鏂瑰紡
   - UTS Android 涓嶆敮鎸佸 any 绫诲瀷浣跨敤绱㈠紩璁块棶
   - 閿欒绀轰緥锛?
     ```typescript
     const detail = (e as any)['detail']
     val = detail['value'] ?? ''
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     // 鏂规1锛氫娇鐢?UTSJSONObject
     const eObj = JSON.parse(JSON.stringify(e)) as UTSJSONObject
     const detail = eObj.get('detail') as UTSJSONObject
     val = detail.getString('value') ?? ''
     
     // 鏂规2锛氬厛鍒ゆ柇绫诲瀷鍐嶈浆鎹?
     if (e instanceof UTSJSONObject) {
         const eObj = e as UTSJSONObject
         const detail = eObj.get('detail') as UTSJSONObject
         val = detail.getString('value') ?? ''
     }
     ```

2. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?Unresolved reference. None of the following candidates is applicable because of a receiver type mismatch"
   - 鍘熷洜锛歛ny 绫诲瀷涓嶆敮鎸佺储寮曡闂?
   - 瑙ｅ喅锛氳浆鎹负 UTSJSONObject 鍚庝娇鐢?`.get()` 鏂规硶

3. 鏈€浣冲疄璺?
   - 缁熶竴浣跨敤 UTSJSONObject 澶勭悊鍔ㄦ€佸璞?
   - 浣跨敤 `.get()`銆乣.getString()`銆乣.getNumber()` 鏂规硶璁块棶灞炴€?
   - 瀵逛簬澶嶆潅瀵硅薄锛屽厛鐢?`JSON.parse(JSON.stringify(obj))` 杞崲

================================================================================
涓夊崄銆?026-02-27 瀛楃涓蹭笉鑳界洿鎺ヤ綔涓哄竷灏旀潯浠讹紙閲嶈锛?
================================================================================

1. 瀛楃涓蹭笉鑳界洿鎺ヤ綔涓?if 鏉′欢
   - UTS Android 涓嶆敮鎸佸皢瀛楃涓茬洿鎺ヤ綔涓哄竷灏旀潯浠跺垽鏂?
   - 閿欒绀轰緥锛?
     ```typescript
     const paramId = '123'
     if (paramId) {  // 閿欒锛氬瓧绗︿覆涓嶈兘鐩存帴浣滀负甯冨皵鏉′欢
         // ...
     }
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     const paramId = '123'
     if (paramId != null && paramId != '') {  // 姝ｇ‘锛氭樉寮忓垽鏂?
         // ...
     }
     ```

2. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?Condition type mismatch: inferred type is 'String' but 'Boolean' was expected"
   - 鍘熷洜锛氬瓧绗︿覆绫诲瀷涓嶈兘鐩存帴浣滀负甯冨皵鏉′欢
   - 瑙ｅ喅锛氫娇鐢ㄦ樉寮忕殑姣旇緝琛ㄨ揪寮?

3. 鏈€浣冲疄璺?
   - 浣跨敤 `!= null && != ''` 妫€鏌ュ瓧绗︿覆闈炵┖
   - 浣跨敤 `== null || == ''` 妫€鏌ュ瓧绗︿覆涓虹┖

================================================================================
涓夊崄涓€銆?026-02-27 鍑芥暟瀹氫箟椤哄簭锛堥噸瑕侊級
================================================================================

1. 鍑芥暟蹇呴』鍦ㄨ皟鐢ㄥ墠瀹氫箟
   - UTS Android 瑕佹眰鍑芥暟鍦ㄨ皟鐢ㄤ箣鍓嶅畬鎴愬畾涔?
   - 杩欎笌 JavaScript 鐨勫嚱鏁版彁鍗囦笉鍚?
   - 閿欒绀轰緥锛?
     ```typescript
     onMounted(() => {
         loadData()  // 閿欒锛歭oadData 杩樻湭瀹氫箟
     })
     
     const loadData = async () => {
         // ...
     }
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     const loadData = async () => {
         // ...
     }
     
     onMounted(() => {
         loadData()  // 姝ｇ‘锛歭oadData 宸插畾涔?
     })
     ```

2. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?鎵句笉鍒板悕绉?xxx'"
   - 鍘熷洜锛氬嚱鏁板湪璋冪敤鐐逛箣鍚庡畾涔?
   - 瑙ｅ喅锛氬皢鍑芥暟瀹氫箟绉诲埌璋冪敤涔嬪墠

3. 鏈€浣冲疄璺?
   - 灏嗘墍鏈夊嚱鏁板畾涔夋斁鍦ㄧ敓鍛藉懆鏈熼挬瀛愶紙onMounted銆乷nShow 绛夛級涔嬪墠
   - 鎸変緷璧栧叧绯绘帓搴忓嚱鏁板畾涔夐『搴?

================================================================================
涓夊崄浜屻€?026-02-27 鑱斿悎绫诲瀷灞炴€ц闂紙閲嶈锛?
================================================================================

1. 鑱斿悎绫诲瀷涓嶈兘鐩存帴璁块棶灞炴€?
   - 褰撳弬鏁扮被鍨嬩负鑱斿悎绫诲瀷锛堝 `A | B`锛夋椂锛屼笉鑳界洿鎺ヨ闂睘鎬?
   - 閿欒绀轰緥锛?
     ```typescript
     type A = { id: string, name: string }
     type B = { id: string, title: string }
     
     const foo = (item: A | B) => {
         const id = item.id  // 閿欒锛氳仈鍚堢被鍨嬩笉鑳界洿鎺ヨ闂睘鎬?
     }
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     const foo = (item: A | B) => {
         // 鏂规1锛氳浆鎹负 UTSJSONObject
         const obj = JSON.parse(JSON.stringify(item)) as UTSJSONObject
         const id = obj.getString('id') ?? ''
         
         // 鏂规2锛氫娇鐢ㄧ被鍨嬪畧鍗?
         if ('name' in item) {
             const id = item.id  // 姝ゆ椂绫诲瀷宸叉敹绐勪负 A
         }
     }
     ```

2. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?鎵句笉鍒板悕绉?xxx'"
   - 鍘熷洜锛氳仈鍚堢被鍨嬬殑灞炴€ц闂彈闄?
   - 瑙ｅ喅锛氳浆鎹负 UTSJSONObject 鎴栦娇鐢ㄧ被鍨嬪畧鍗?

3. 鏈€浣冲疄璺?
   - 瀵逛簬鑱斿悎绫诲瀷鍙傛暟锛岀粺涓€杞崲涓?UTSJSONObject 澶勭悊
   - 浣跨敤 `.getString()`銆乣.getNumber()` 绛夋柟娉曞畨鍏ㄨ闂睘鎬?

================================================================================
涓夊崄涓夈€?026-02-27 any 绫诲瀷鍙橀噺涓嶈兘璧嬪€间负 null锛堥噸瑕侊級
================================================================================

1. any 绫诲瀷鍙橀噺涓嶈兘璧嬪€间负 null
   - UTS Android 涓?`any` 绫诲瀷涓嶈兘璧嬪€间负 `null`
   - 閿欒绀轰緥锛?
     ```typescript
     let res: any = null  // 閿欒锛歂ull cannot be a value of a non-null type 'Any'
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     let res: any = {}  // 姝ｇ‘锛氫娇鐢ㄧ┖瀵硅薄
     // 鎴栬€?
     let res: any | null = null  // 浣跨敤鑱斿悎绫诲瀷
     ```

2. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?Null cannot be a value of a non-null type 'Any'"
   - 鍘熷洜锛歛ny 绫诲瀷涓嶅厑璁?null 鍊?
   - 瑙ｅ喅锛氫娇鐢ㄧ┖瀵硅薄 `{}` 鎴栬仈鍚堢被鍨?`any | null`

================================================================================
涓夊崄鍥涖€?026-02-27 瀵硅薄瀛楅潰閲忕被鍨嬫帹鏂棶棰橈紙閲嶈锛?
================================================================================

1. 瀵硅薄瀛楅潰閲忕洿鎺ヨ祴鍊肩粰 ref 鍙兘绫诲瀷涓嶅尮閰?
   - 褰撳璞″瓧闈㈤噺鐩存帴璧嬪€肩粰鐗瑰畾绫诲瀷鐨?ref 鏃讹紝鍙兘鎶ョ被鍨嬩笉鍖归厤閿欒
   - 閿欒绀轰緥锛?
     ```typescript
     merchant.value = {
       id: shop.id,
       user_id: shop.merchant_id,
       // ...
     }  // 閿欒锛欰ssignment type mismatch
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     // 鏂规1锛氭樉寮忓０鏄庣被鍨?
     const merchantData: MerchantType = {
       id: shop.id,
       user_id: shop.merchant_id,
       // ...
     }
     merchant.value = merchantData
     
     // 鏂规2锛氫娇鐢?as 绫诲瀷鏂█
     merchant.value = {
       id: shop.id,
       user_id: shop.merchant_id,
       // ...
     } as MerchantType
     ```

2. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?Assignment type mismatch: actual type is '<anonymous>', but 'XXX' was expected"
   - 鍘熷洜锛氬璞″瓧闈㈤噺琚帹鏂负鍖垮悕绫诲瀷
   - 瑙ｅ喅锛氭樉寮忓０鏄庣被鍨嬫垨浣跨敤绫诲瀷鏂█

================================================================================
涓夊崄浜斻€?026-02-27 any 绫诲瀷涓嶈兘鐩存帴璁块棶灞炴€э紙閲嶈锛?
================================================================================

1. any 绫诲瀷鍙傛暟涓嶈兘鐩存帴璁块棶灞炴€?
   - 鍦?map銆乫orEach 绛夊洖璋冧腑锛宎ny 绫诲瀷鐨勫弬鏁颁笉鑳界洿鎺ヨ闂睘鎬?
   - 閿欒绀轰緥锛?
     ```typescript
     const list = rawList.map((item): ProductType => {
       const id = item.id  // 閿欒锛氭壘涓嶅埌鍚嶇О"id"
       const name = item.name  // 閿欒锛氭壘涓嶅埌鍚嶇О"name"
     })
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     const list = rawList.map((item: any): ProductType => {
       // 鏂规1锛氳浆鎹负 UTSJSONObject
       const itemObj = JSON.parse(JSON.stringify(item)) as UTSJSONObject
       const id = itemObj.getString('id') ?? ''
       const name = itemObj.getString('name') ?? ''
       
       // 鏂规2锛氭樉寮忔爣娉ㄥ弬鏁扮被鍨嬪苟浣跨敤绱㈠紩
       // 娉ㄦ剰锛氳繖绉嶆柟寮忓湪 UTS Android 涓篃鍙兘鏈夐棶棰?
     })
     ```

2. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?鎵句笉鍒板悕绉?xxx'"
   - 鍘熷洜锛歛ny 绫诲瀷鐨勫睘鎬ц闂彈闄?
   - 瑙ｅ喅锛氳浆鎹负 UTSJSONObject 鍚庝娇鐢?`.getString()` 绛夋柟娉?

================================================================================
涓夊崄鍏€?026-02-27 绫诲瀷鏂█涓嶄細娣诲姞鏂规硶锛堥噸瑕侊級
================================================================================

1. `as UTSJSONObject` 涓嶄細缁欏璞℃坊鍔犳柟娉?
   - 浣跨敤 `as UTSJSONObject` 鍙槸绫诲瀷鏂█锛屼笉浼氳鏅€氬璞¤幏寰?`getString` 绛夋柟娉?
   - 閿欒绀轰緥锛?
     ```typescript
     const profileObj = profile as UTSJSONObject
     const id = profileObj.getString('user_id')  // 杩愯鏃堕敊璇細getString is not a function
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     // 蹇呴』浣跨敤 JSON.parse(JSON.stringify()) 杩涜鐪熸鐨勮浆鎹?
     const profileObj = JSON.parse(JSON.stringify(profile)) as UTSJSONObject
     const id = profileObj.getString('user_id') ?? ''
     ```

2. 杩愯鏃堕敊璇彁绀?
   - 閿欒淇℃伅锛?XXX is not a function"
   - 鍘熷洜锛氱被鍨嬫柇瑷€鍙槸缂栬瘧鏃惰涓猴紝涓嶄細鏀瑰彉杩愯鏃跺璞＄殑鏂规硶
   - 瑙ｅ喅锛氫娇鐢?`JSON.parse(JSON.stringify())` 杩涜鐪熸鐨勫璞¤浆鎹?

3. 鏈€浣冲疄璺?
   - 瀵逛簬浠?API 杩斿洖鐨勬暟鎹紝缁熶竴浣跨敤 `JSON.parse(JSON.stringify())` 杞崲
   - 浣跨敤 `instanceof UTSJSONObject` 妫€鏌ュ璞＄被鍨?
   - 涓嶈渚濊禆 `as` 绫诲瀷鏂█鏉ユ坊鍔犳柟娉?

================================================================================
涓夊崄涓冦€?026-02-27 绫诲瀷蹇呴』鍖呭惈鎵€鏈夊繀濉瓧娈碉紙閲嶈锛?
================================================================================

1. 鍒涘缓绫诲瀷瀹炰緥鏃跺繀椤诲寘鍚墍鏈夊繀濉瓧娈?
   - UTS 绫诲瀷瀹氫箟涓殑闈炲彲閫夊瓧娈碉紙涓嶅甫 `?`锛夐兘鏄繀濉殑
   - 閿欒绀轰緥锛?
     ```typescript
     export type ProductType = {
       id: string
       merchant_id: string  // 蹇呭～
       category_id: string  // 蹇呭～
       name: string
       // ...
     }
     
     // 閿欒锛氱己灏?merchant_id銆乧ategory_id 绛夊繀濉瓧娈?
     return {
       id: item.id,
       name: item.name,
       price: item.price
     } as ProductType  // 杩愯鏃堕敊璇細missing required property
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     return {
       id: itemObj.getString('id') ?? '',
       merchant_id: itemObj.getString('merchant_id') ?? '',
       category_id: itemObj.getString('category_id') ?? '',
       name: itemObj.getString('name') ?? '鏈煡鍟嗗搧',
       description: itemObj.getString('description') ?? '',
       images: images,
       price: itemObj.getNumber('base_price') ?? 0,
       original_price: itemObj.getNumber('market_price') ?? 0,
       stock: itemObj.getNumber('total_stock') ?? 0,
       sales: itemObj.getNumber('sale_count') ?? 0,
       status: 1,
       created_at: itemObj.getString('created_at') ?? ''
     } as ProductType
     ```

2. 杩愯鏃堕敊璇彁绀?
   - 閿欒淇℃伅锛?Failed to construct type, missing required property: xxx"
   - 鍘熷洜锛氱被鍨嬪畾涔変腑鏈夊繀濉瓧娈垫湭鎻愪緵
   - 瑙ｅ喅锛?
     1. 妫€鏌ョ被鍨嬪畾涔夛紝纭鎵€鏈夊繀濉瓧娈?
     2. 涓烘墍鏈夊繀濉瓧娈垫彁渚涘€硷紝鍗充娇鏄┖瀛楃涓叉垨榛樿鍊?

3. 鏈€浣冲疄璺?
   - 鏌ョ湅绫诲瀷瀹氫箟锛岀‘璁ゅ摢浜涘瓧娈垫槸蹇呭～鐨勶紙涓嶅甫 `?`锛?
   - 浣跨敤 `??` 杩愮畻绗︽彁渚涢粯璁ゅ€?
   - 瀵逛簬鍙€夊瓧娈碉紝鍙互涓嶆彁渚涙垨浣跨敤 `null`

================================================================================
涓夊崄鍏€?026-02-27 鍥炶皟鍑芥暟涓嶈兘鏄?async锛堥噸瑕侊級
================================================================================

1. API 鍥炶皟鍑芥暟涓嶈兘浣跨敤 async 淇グ
   - uni API 鐨勫洖璋冨嚱鏁帮紙濡?showModal 鐨?success锛変笉鏀寔 async 鍑芥暟
   - 閿欒绀轰緥锛?
     ```typescript
     uni.showModal({
         title: '纭',
         content: '纭畾瑕佸垹闄ゅ悧锛?,
         success: async (res) => {  // 閿欒锛氬洖璋冨嚱鏁颁笉鑳芥槸 async
             if (res.confirm) {
                 const result = await someAsyncFunction()
             }
         }
     })
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     uni.showModal({
         title: '纭',
         content: '纭畾瑕佸垹闄ゅ悧锛?,
         success: (res) => {
             if (res.confirm) {
                 // 浣跨敤 Promise.then() 浠ｆ浛 await
                 someAsyncFunction().then((result) => {
                     // 澶勭悊缁撴灉
                 })
             }
         }
     })
     ```

2. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?鍙傛暟绫诲瀷涓嶅尮閰嶏細瀹為檯绫诲瀷涓?'Function1<..., UTSPromise<Unit>>'锛岄鏈熺被鍨嬩负 'Function1<..., Unit>?'"
   - 鍘熷洜锛氬洖璋冨嚱鏁拌繑鍥?Promise 鑰岄潪 void
   - 瑙ｅ喅锛氫娇鐢?`.then()` 浠ｆ浛 `await`

3. 鏈€浣冲疄璺?
   - 鍦ㄥ洖璋冨嚱鏁颁腑浣跨敤 `.then()` 澶勭悊寮傛鎿嶄綔
   - 灏嗗紓姝ラ€昏緫灏佽涓哄崟鐙殑鍑芥暟锛屽湪鍥炶皟涓皟鐢?

================================================================================
涓夊崄涔濄€?026-02-27 绫诲瀷杞崲鍓嶅繀椤绘鏌ョ被鍨嬶紙閲嶈锛?
================================================================================

1. 浣跨敤 `as` 绫诲瀷杞崲鍓嶅繀椤绘鏌ュ疄闄呯被鍨?
   - 鐩存帴浣跨敤 `as string` 杞崲鍙兘瀵艰嚧杩愯鏃剁被鍨嬭浆鎹㈠紓甯?
   - 閿欒绀轰緥锛?
     ```typescript
     const idVal = item['id']
     const id = idVal as string  // 閿欒锛氬鏋?idVal 鏄叾浠栫被鍨嬩細宕╂簝
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     const idVal = item['id']
     const id = (idVal != null && typeof idVal == 'string') ? (idVal as string) : ''
     ```

2. 杩愯鏃堕敊璇彁绀?
   - 閿欒淇℃伅锛?null cannot be cast to non-null type kotlin.String"
   - 閿欒淇℃伅锛?java.lang.Boolean cannot be cast to java.lang.String"
   - 鍘熷洜锛氱洿鎺ョ被鍨嬭浆鎹㈡椂锛屽疄闄呯被鍨嬩笌鐩爣绫诲瀷涓嶅尮閰?
   - 瑙ｅ喅锛氫娇鐢?`typeof` 妫€鏌ョ被鍨嬪悗鍐嶈浆鎹?

3. 鏈€浣冲疄璺?
   - 浣跨敤 `typeof` 妫€鏌ョ被鍨?
   - 浣跨敤 `!= null` 妫€鏌ョ┖鍊?
   - 鎻愪緵榛樿鍊奸槻姝㈢┖鎸囬拡寮傚父

================================================================================
鍥涘崄銆?026-02-27 UTSJSONObject 蹇呴』姝ｇ‘杞崲锛堥噸瑕侊級
================================================================================

1. `as UTSJSONObject` 涓嶄細娣诲姞鏂规硶
   - 浠庢暟鎹簱杩斿洖鐨勬暟鎹渶瑕佹纭浆鎹负 UTSJSONObject
   - 閿欒绀轰緥锛?
     ```typescript
     const item = rawList[i]
     const brandObj = item as UTSJSONObject  // 閿欒锛歜randObj.getString 涓嶅瓨鍦?
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     const item = rawList[i]
     const brandObj = JSON.parse(JSON.stringify(item)) as UTSJSONObject
     const id = brandObj.getString('id') ?? ''
     ```

2. 杩愯鏃堕敊璇彁绀?
   - 閿欒淇℃伅锛?getString is not a function"
   - 鍘熷洜锛氬璞℃病鏈夋纭浆鎹负 UTSJSONObject
   - 瑙ｅ喅锛氫娇鐢?`JSON.parse(JSON.stringify())` 杩涜杞崲

3. 鏈€浣冲疄璺?
   - 瀵逛簬浠庢暟鎹簱/API 杩斿洖鐨勬暟鎹紝缁熶竴浣跨敤 `JSON.parse(JSON.stringify())` 杞崲
   - 浣跨敤 `.getString()`銆乣.getNumber()` 绛夋柟娉曞畨鍏ㄨ闂睘鎬?

================================================================================
鍥涘崄浜屻€?026-02-27 getBoolean 鏂规硶鍙兘瀵艰嚧绫诲瀷杞崲寮傚父锛堥噸瑕侊級
================================================================================

1. `UTSJSONObject.getBoolean()` 鍙兘瀵艰嚧绫诲瀷杞崲寮傚父
   - 褰撴暟鎹簱瀛楁绫诲瀷涓庨鏈熶笉绗︽椂锛宍getBoolean()` 鍙兘鎶涘嚭寮傚父
   - 閿欒绀轰緥锛?
     ```typescript
     const isFeatured = prodObj.getBoolean('is_featured') ?? false  // 鍙兘鎶涘嚭寮傚父
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     const isFeaturedVal = prodObj.get('is_featured')
     const isFeatured = (isFeaturedVal != null && typeof isFeaturedVal == 'boolean') 
         ? (isFeaturedVal as boolean) 
         : false
     ```

2. 杩愯鏃堕敊璇彁绀?
   - 閿欒淇℃伅锛?java.lang.Boolean cannot be cast to java.lang.String"
   - 鍘熷洜锛氭暟鎹簱杩斿洖鐨勫瓧娈电被鍨嬩笌 UTSJSONObject 鏂规硶鏈熸湜鐨勭被鍨嬩笉鍖归厤
   - 瑙ｅ喅锛氫娇鐢?`.get()` 鏂规硶鑾峰彇鍘熷鍊硷紝鐒跺悗鎵嬪姩妫€鏌ョ被鍨?

3. 鏈€浣冲疄璺?
   - 閬垮厤浣跨敤 `.getBoolean()`锛屾敼鐢?`.get()` + `typeof` 妫€鏌?
   - 鍦?SQL 鏌ヨ涓槑纭寚瀹氶渶瑕佺殑瀛楁锛岄伩鍏?`SELECT *`
   - 瀵逛簬甯冨皵鍊硷紝浣跨敤 `typeof val == 'boolean'` 妫€鏌ョ被鍨?

================================================================================
鍥涘崄涓夈€?026-02-27 SELECT * 鍙兘瀵艰嚧绫诲瀷杞崲闂锛堥噸瑕侊級
================================================================================

1. 閬垮厤浣跨敤 `SELECT *` 鏌ヨ鎵€鏈夊瓧娈?
   - 鏁版嵁搴撳彲鑳藉寘鍚墠绔笉闇€瑕佺殑瀛楁锛屽鑷寸被鍨嬭浆鎹㈠紓甯?
   - 閿欒绀轰緥锛?
     ```typescript
     .select('*')  // 鍙兘杩斿洖鎰忓鐨勫瓧娈电被鍨?
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     .select('id, name, description, base_price, market_price, main_image_url')
     ```

2. 鏈€浣冲疄璺?
   - 鍙煡璇㈤渶瑕佺殑瀛楁
   - 鍙傝€冩暟鎹簱鏂囨。纭瀛楁绫诲瀷
   - 瀵逛簬瑙嗗浘锛堝 `ml_products_detail_view`锛夛紝娉ㄦ剰瀛楁鍚嶅彲鑳戒笌鍩虹琛ㄤ笉鍚?

================================================================================
鍥涘崄鍥涖€?026-02-27 鍒涘缓杈呭姪鍑芥暟澶勭悊鏁版嵁杞崲锛堥噸瑕侊級
================================================================================

1. 鍒涘缓杈呭姪鍑芥暟缁熶竴澶勭悊鏁版嵁绫诲瀷杞崲
   - 閬垮厤鍦ㄦ瘡涓柟娉曚腑閲嶅鍐欑被鍨嬫鏌ヤ唬鐮?
   - 绀轰緥锛?
     ```typescript
     // 杈呭姪鍑芥暟锛氬畨鍏ㄨ幏鍙栧瓧绗︿覆鍊?
     function safeGetString(obj: UTSJSONObject, key: string): string {
       const val = obj.get(key)
       if (val == null) return ''
       if (typeof val == 'string') return val as string
       if (typeof val == 'number') return (val as number).toString()
       if (typeof val == 'boolean') return (val as boolean) ? 'true' : 'false'
       return ''
     }
     
     // 杈呭姪鍑芥暟锛氬畨鍏ㄨ幏鍙栨暟鍊?
     function safeGetNumber(obj: UTSJSONObject, key: string): number {
       const val = obj.get(key)
       if (val == null) return 0
       if (typeof val == 'number') return val as number
       if (typeof val == 'string') {
         const parsed = parseFloat(val as string)
         return isNaN(parsed) ? 0 : parsed
       }
       return 0
     }
     
     // 杈呭姪鍑芥暟锛氬畨鍏ㄨ幏鍙栧竷灏斿€?
     function safeGetBoolean(obj: UTSJSONObject, key: string): boolean {
       const val = obj.get(key)
       if (val == null) return false
       if (typeof val == 'boolean') return val as boolean
       if (typeof val == 'string') return (val as string) === 'true'
       if (typeof val == 'number') return (val as number) !== 0
       return false
     }
     
     // 杈呭姪鍑芥暟锛氫粠鍘熷鏁版嵁瑙ｆ瀽鍟嗗搧
     function parseProductFromRaw(item: any): Product {
       const prodObj = JSON.parse(JSON.stringify(item)) as UTSJSONObject
       return {
         id: safeGetString(prodObj, 'id'),
         name: safeGetString(prodObj, 'name'),
         base_price: safeGetNumber(prodObj, 'base_price'),
         is_featured: safeGetBoolean(prodObj, 'is_featured'),
         // ...
       } as Product
     }
     ```

2. 浼樼偣
   - 浠ｇ爜澶嶇敤锛屽噺灏戦噸澶?
   - 缁熶竴澶勭悊鍚勭绫诲瀷杞崲寮傚父
   - 鏄撲簬缁存姢鍜屼慨鏀?

3. 鏈€浣冲疄璺?
   - 灏嗚緟鍔╁嚱鏁版斁鍦ㄦ枃浠堕《閮?
   - 瀵规墍鏈変粠鏁版嵁搴撹幏鍙栫殑鏁版嵁浣跨敤杈呭姪鍑芥暟
   - 澶勭悊鎵€鏈夊彲鑳界殑绫诲瀷杞崲鎯呭喌

================================================================================
鍥涘崄浜斻€?026-02-27 瑙嗗浘瀛楁鍚嶅彲鑳戒笌鍩虹琛ㄤ笉鍚岋紙閲嶈锛?
================================================================================

1. 鏁版嵁搴撹鍥剧殑瀛楁鍚嶅彲鑳戒笌鍩虹琛ㄤ笉鍚?
   - `ml_products_detail_view` 瑙嗗浘涓病鏈?`image_url` 瀛楁
   - 鍙湁 `main_image_url` 鍜?`image_urls` 瀛楁
   - 閿欒绀轰緥锛?
     ```typescript
     .select('id, name, image_url')  // 閿欒锛氳鍥炬病鏈?image_url 瀛楁
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     .select('id, name, main_image_url, image_urls')  // 姝ｇ‘
     ```

2. 杩愯鏃堕敊璇彁绀?
   - 閿欒淇℃伅锛?column ml_products_detail_view.image_url does not exist"
   - 鎻愮ず锛?Perhaps you meant to reference the column 'ml_products_detail_view.image_urls'"
   - 鍘熷洜锛氭煡璇簡瑙嗗浘涓笉瀛樺湪鐨勫瓧娈?
   - 瑙ｅ喅锛氬弬鑰冩暟鎹簱鏂囨。纭瑙嗗浘瀛楁鍚?

3. 鏈€浣冲疄璺?
   - 鏌ヨ瑙嗗浘鍓嶅厛纭瀛楁鍚?
   - 鍙傝€?`CONSUMER_DB_DOC.md` 鏂囨。
   - 浣跨敤鏄庣‘瀛楁鍒楄〃鑰岄潪 `SELECT *`

================================================================================
鍥涘崄鍏€?026-02-27 杈呭姪鍑芥暟搴斾娇鐢?try-catch 鍖呰锛堥噸瑕侊級
================================================================================

1. 杈呭姪鍑芥暟搴斾娇鐢?try-catch 鍖呰闃叉宕╂簝
   - 鍦?Android 绔紝绫诲瀷杞崲鍙兘鎶涘嚭寮傚父
   - 浣跨敤 try-catch 鍖呰鍙互闃叉鏁翠釜搴旂敤宕╂簝
   - 绀轰緥锛?
     ```typescript
     function safeGetString(obj: UTSJSONObject, key: string): string {
       try {
         const val = obj.get(key)
         if (val == null) return ''
         if (typeof val == 'string') return val as string
         if (typeof val == 'number') return (val as number).toString()
         if (typeof val == 'boolean') return (val as boolean) ? 'true' : 'false'
         return ''
       } catch (e) {
         console.error('safeGetString error for key:', key, e)
         return ''
       }
     }
     
     function toUTSJSONObject(item: any): UTSJSONObject {
       if (item instanceof UTSJSONObject) {
         return item as UTSJSONObject
       }
       try {
         const str = JSON.stringify(item)
         return JSON.parse(str) as UTSJSONObject
       } catch (e) {
         console.error('toUTSJSONObject error:', e)
         return new UTSJSONObject()
       }
     }
     ```

2. 浼樼偣
   - 闃叉鍗曚釜瀛楁瑙ｆ瀽澶辫触瀵艰嚧鏁翠釜搴旂敤宕╂簝
   - 鎻愪緵璇︾粏鐨勯敊璇棩蹇椾究浜庤皟璇?
   - 杩斿洖榛樿鍊间繚璇佸簲鐢ㄧ户缁繍琛?

3. 鏈€浣冲疄璺?
   - 鎵€鏈夎緟鍔╁嚱鏁伴兘搴斾娇鐢?try-catch 鍖呰
   - 鍦?catch 涓褰曢敊璇棩蹇?
   - 杩斿洖鍚堢悊鐨勯粯璁ゅ€?

================================================================================
鍥涘崄涓冦€?026-02-27 鍟嗗搧瑙嗗浘娌℃湁 shop_id 瀛楁锛堥噸瑕侊級
================================================================================

1. `ml_products_detail_view` 瑙嗗浘娌℃湁 `shop_id` 瀛楁
   - 鍟嗗搧閫氳繃 `merchant_id` 鍏宠仈鍟嗗/搴楅摵
   - 閿欒绀轰緥锛?
     ```typescript
     .select('id, name, shop_id')  // 閿欒锛氳鍥炬病鏈?shop_id 瀛楁
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     .select('id, name, merchant_id')  // 姝ｇ‘锛氫娇鐢?merchant_id
     ```

2. 鏁版嵁搴撳瓧娈靛搴斿叧绯?
   - `ml_products` 琛細`merchant_id` 鍏宠仈鍟嗗
   - `ml_shops` 琛細`user_id` 绛変簬鍟嗗鐨?`merchant_id`
   - 瑙嗗浘涓€氳繃 `merchant_id` JOIN `ml_shops` 鑾峰彇搴楅摵淇℃伅

3. 鏈€浣冲疄璺?
   - 鏌ヨ鍟嗗搧鏃朵娇鐢?`merchant_id` 鑰岄潪 `shop_id`
   - 鍙傝€?`CONSUMER_DB_DOC.md` 纭瀛楁鍚?

================================================================================
鍥涘崄鍏€?026-02-27 any 绫诲瀷涓嶆敮鎸佺储寮曡闂紙閲嶈锛?
================================================================================

1. UTS Android 涓?`any` 绫诲瀷涓嶆敮鎸佺储寮曡闂?
   - 涓嶈兘浣跨敤 `obj[key]` 璇硶璁块棶 `any` 绫诲瀷瀵硅薄鐨勫睘鎬?
   - 閿欒绀轰緥锛?
     ```typescript
     function safeGetString(obj: any, key: string): string {
       const val = obj[key]  // 閿欒锛歎nresolved reference
     }
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     function safeGetString(obj: UTSJSONObject, key: string): string {
       const val = obj.get(key)  // 姝ｇ‘锛氫娇鐢?UTSJSONObject 鐨?get 鏂规硶
     }
     ```

2. 缂栬瘧閿欒鎻愮ず
   - 閿欒淇℃伅锛?Unresolved reference. None of the following candidates is applicable because of a receiver type mismatch"
   - 鍘熷洜锛歚any` 绫诲瀷涓嶆敮鎸佺储寮曡闂?
   - 瑙ｅ喅锛氬厛灏嗗璞¤浆鎹负 `UTSJSONObject`锛屽啀浣跨敤 `.get()` 鏂规硶

3. 鏈€浣冲疄璺?
   - 浣跨敤 `toUTSJSONObject()` 鍑芥暟灏?`any` 杞崲涓?`UTSJSONObject`
   - 浣跨敤 `.get()`銆乣.getString()`銆乣.getNumber()` 绛夋柟娉曡闂睘鎬?
   - 杈呭姪鍑芥暟鍙傛暟绫诲瀷搴斾负 `UTSJSONObject` 鑰岄潪 `any`

================================================================================
鍥涘崄涔濄€?026-02-27 浣跨敤 getString/getNumber/getBoolean 鏂规硶锛堥噸瑕侊級
================================================================================

1. UTSJSONObject 鎻愪緵浜嗙被鍨嬪畨鍏ㄧ殑璁块棶鏂规硶
   - `getString(key)` - 鐩存帴杩斿洖瀛楃涓叉垨 null
   - `getNumber(key)` - 鐩存帴杩斿洖鏁板€兼垨 null
   - `getBoolean(key)` - 鐩存帴杩斿洖甯冨皵鍊兼垨 null
   - `getArray(key)` - 鐩存帴杩斿洖鏁扮粍鎴?null
   - 杩欎簺鏂规硶姣?`.get()` 鏇村畨鍏紝浼氳嚜鍔ㄨ繘琛岀被鍨嬭浆鎹?

2. 鎺ㄨ崘鐢ㄦ硶
   ```typescript
   // 鎺ㄨ崘浣跨敤
   const name = obj.getString('name') ?? ''
   const price = obj.getNumber('price') ?? 0
   const isActive = obj.getBoolean('is_active') ?? false
   const images = obj.getArray('images') as string[] ?? []
   
   // 涓嶆帹鑽愪娇鐢?.get() 鍚庢墜鍔ㄧ被鍨嬫鏌?
   const val = obj.get('key')
   if (typeof val == 'string') { ... }
   ```

3. 鏈€浣冲疄璺?
   - 浼樺厛浣跨敤 `getString()`銆乣getNumber()`銆乣getBoolean()`銆乣getArray()`
   - 浣跨敤 `??` 鎻愪緵榛樿鍊?
   - 鍦?catch 鍧椾腑澶勭悊寮傚父

================================================================================
鍥涘崄涓€銆?026-02-27 item as UTSJSONObject 涓嶄細娣诲姞鏂规硶锛堥噸瑕侊級
================================================================================

1. `item as UTSJSONObject` 涓嶄細璁╁璞¤幏寰?`getString` 绛夋柟娉?
   - 鐩存帴浣跨敤 `as UTSJSONObject` 鍙槸绫诲瀷鏂█锛屼笉浼氭敼鍙樿繍琛屾椂瀵硅薄
   - 閿欒绀轰緥锛?
     ```typescript
     const item = rawList[i]
     const prodObj = item as UTSJSONObject  // 閿欒锛歡etString 涓嶅瓨鍦?
     const id = prodObj.getString('id')  // 杩愯鏃堕敊璇?
     ```
   - 姝ｇ‘绀轰緥锛?
     ```typescript
     const item = rawList[i]
     const prodObj = JSON.parse(JSON.stringify(item)) as UTSJSONObject
     const id = prodObj.getString('id') ?? ''  // 姝ｇ‘
     ```

2. 杩愯鏃堕敊璇彁绀?
   - 閿欒淇℃伅锛?getString is not a function"
   - 鍘熷洜锛氬璞℃病鏈夋纭浆鎹负 UTSJSONObject
   - 瑙ｅ喅锛氫娇鐢?`JSON.parse(JSON.stringify())` 杩涜杞崲

3. 鏈€浣冲疄璺?
   - 瀵逛簬浠庢暟鎹簱/API 杩斿洖鐨勬暟鎹紝缁熶竴浣跨敤 `JSON.parse(JSON.stringify())` 杞崲
   - 浣跨敤 `.getString()`銆乣.getNumber()` 绛夋柟娉曞畨鍏ㄨ闂睘鎬?

================================================================================

================================================================================
