|
@@ -27,7 +27,9 @@ import { useMallStore } from '@/store/mall'
|
|
|
import { getProductByIds } from '@/api/mall/index'
|
|
|
import { formatSales, fen2yuan } from '@/hooks/web/useGoods'
|
|
|
import { isArray } from 'lodash-es'
|
|
|
+import { useRouter } from 'vue-router'
|
|
|
|
|
|
+const router = useRouter()
|
|
|
let template = ref(JSON.parse(localStorage.getItem('mallTemplate')) || {})
|
|
|
useMallStore().$subscribe((mutation, state) => {
|
|
|
if (state.template && Object.keys(state.template).length) template.value = state?.template
|
|
@@ -53,7 +55,8 @@ const salesAndStock = computed(() => (data) => {
|
|
|
|
|
|
// 商品详情
|
|
|
const handleClickGood = (val) => {
|
|
|
- console.log(val, 'click-val')
|
|
|
+ if (!val.id) return
|
|
|
+ router.push(`/wareDetails/${val.id}`)
|
|
|
}
|
|
|
</script>
|
|
|
|