Quellcode durchsuchen

```
feat(subPack-xsb): 支持扫码进入商品详情页

当页面栈长度为1时,从二维码参数中解析商品ID,
支持通过扫描二维码直接进入指定商品详情页面
```

zhangtao vor 1 Woche
Ursprung
Commit
b6ea6436a8
1 geänderte Dateien mit 6 neuen und 0 gelöschten Zeilen
  1. 6 0
      src/subPack-xsb/goods/index.vue

+ 6 - 0
src/subPack-xsb/goods/index.vue

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