|
@@ -34,13 +34,17 @@ defineOptions({name: 'wares-details'})
|
|
|
import { getProductDetail } from '@/api/mall'
|
|
|
import selectSku from './detailsComponents/s-select-sku.vue'
|
|
|
import { ref } from 'vue'
|
|
|
+import { useRouter } from 'vue-router'
|
|
|
+
|
|
|
+const router = useRouter()
|
|
|
+const { id } = router.currentRoute.value.params
|
|
|
|
|
|
const carouselHover = ref(false)
|
|
|
const goodsInfo = ref({})
|
|
|
const skus = ref([])
|
|
|
// 获取商品详情
|
|
|
const getData = async () => {
|
|
|
- const obj = await getProductDetail({ id: 646 })
|
|
|
+ const obj = await getProductDetail({ id })
|
|
|
obj.sliderPicUrls = obj.sliderPicUrls || []
|
|
|
skus.value = obj.skus || []
|
|
|
goodsInfo.value = obj
|