|
@@ -19,6 +19,7 @@
|
|
|
|
|
|
<script setup>
|
|
|
defineOptions({ name: 'mall-goods-item'})
|
|
|
+import { useRouter } from 'vue-router'
|
|
|
import { fen2yuan } from '@/hooks/web/useGoods'
|
|
|
|
|
|
defineProps({
|
|
@@ -40,9 +41,12 @@ defineProps({
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+const router = useRouter()
|
|
|
+
|
|
|
const handleDetail = (val) => {
|
|
|
const spuId = val.spuId || val.id // 商品id
|
|
|
- window.open(`/mall/goodsDetail/${spuId}`)
|
|
|
+ // window.open(`/mall/goodsDetail/${spuId}`)
|
|
|
+ if (spuId) router.push(`/mall/goodsDetail/${spuId}`)
|
|
|
}
|
|
|
</script>
|
|
|
|