Przeglądaj źródła

```
fix(goods): 修复商品页面参数获取逻辑

当通过扫码进入页面时,使用option.q参数解析商品ID,
而不是依赖页面栈长度判断,确保商品详情正确加载
```

zhangtao 1 tydzień temu
rodzic
commit
05ad07ebdc
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      src/subPack-xsb/goods/index.vue

+ 1 - 1
src/subPack-xsb/goods/index.vue

@@ -37,7 +37,7 @@ const isShowTab = ref(false)
 const goodsId = ref()
 onLoad((option: any) => {
   goodsId.value = option.id
-  if (getCurrentPages().length === 1) {
+  if (option.q) {
     const urls = decodeURIComponent(option.q)
     const id = urls.split('?id=')[1]
     goodsId.value = id