fix
This commit is contained in:
@@ -4,7 +4,9 @@ import CommodityList from "./commodity-list.vue";
|
||||
import MerchantInfo from "./merchant-info.vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import myEvent from '@/utils/myEvent'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { getDesignerDetail } from '@/api/brand'
|
||||
import { AddShoppingCart } from '@/api/shoppingCart'
|
||||
|
||||
//const props = defineProps({
|
||||
//})
|
||||
@@ -25,10 +27,14 @@ const designerDetail = ref({
|
||||
})
|
||||
|
||||
const addShopping = (item) => {
|
||||
myEvent.emit('addShopping', item)
|
||||
if(!item.price) return ElMessage.warning('Please log in first.')
|
||||
AddShoppingCart({listingIds:[item.id]}).then((res)=>{
|
||||
item.shopName = designerDetail.value.shopName
|
||||
myEvent.emit('addShopping', item)
|
||||
})
|
||||
}
|
||||
const openDetail = (item) => {
|
||||
router.push({name: 'digitalDetail', params: {id: item.id}})
|
||||
router.push({name: 'digitalItemDetail', params: {id: item.id}})
|
||||
}
|
||||
const getDetail = ()=>{
|
||||
let data = {
|
||||
@@ -55,7 +61,7 @@ defineExpose({})
|
||||
<MerchantInfo :designerDetail="designerDetail"></MerchantInfo>
|
||||
</div>
|
||||
<div class="commodity-list">
|
||||
<CommodityList @addShopping="addShopping" @openDetail="openDetail"></CommodityList>
|
||||
<CommodityList :id="route.params.id" @addShopping="addShopping" @openDetail="openDetail"></CommodityList>
|
||||
</div>
|
||||
</div>
|
||||
<Footer></Footer>
|
||||
@@ -76,7 +82,7 @@ defineExpose({})
|
||||
.content{
|
||||
display: flex;
|
||||
height: auto;
|
||||
align-items: flex-start;
|
||||
// align-items: flex-start;
|
||||
.merchant-info{
|
||||
width: 40rem;
|
||||
padding-left: 12.7rem;
|
||||
|
||||
Reference in New Issue
Block a user