brand对接接口
This commit is contained in:
@@ -2,36 +2,57 @@
|
||||
import { ref, onMounted, onUnmounted, reactive, toRefs } from "vue";
|
||||
import CommodityList from "./commodity-list.vue";
|
||||
import MerchantInfo from "./merchant-info.vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import myEvent from '@/utils/myEvent'
|
||||
import { getDesignerDetail } from '@/api/brand'
|
||||
|
||||
//const props = defineProps({
|
||||
//})
|
||||
//const emit = defineEmits([
|
||||
//])
|
||||
const router = useRouter()
|
||||
let data = reactive({
|
||||
const route = useRoute()
|
||||
|
||||
const designerDetail = ref({
|
||||
avatar: '',
|
||||
brandBanner: '',
|
||||
description: '',
|
||||
email: '',
|
||||
mobile: '',
|
||||
ownerName: '',
|
||||
shopName: '',
|
||||
socialLinks: '[]',
|
||||
})
|
||||
|
||||
const addShopping = (item) => {
|
||||
myEvent.emit('addShopping', item)
|
||||
}
|
||||
const openDetail = (item) => {
|
||||
router.push({name: 'digitalDetail', params: {id: item.id}})
|
||||
}
|
||||
const getDetail = ()=>{
|
||||
let data = {
|
||||
sellerId: route.params.id,
|
||||
}
|
||||
getDesignerDetail(data,true).then((res)=>{
|
||||
designerDetail.value = res
|
||||
})
|
||||
}
|
||||
onMounted(()=>{
|
||||
getDetail()
|
||||
})
|
||||
onUnmounted(()=>{
|
||||
})
|
||||
defineExpose({})
|
||||
const {} = toRefs(data);
|
||||
</script>
|
||||
<template>
|
||||
<div class="brand">
|
||||
<div class="header-img">
|
||||
<img src="@/assets/images/brand/brandDetailBg.png" alt="">
|
||||
<img :src="designerDetail.brandBanner || '@/assets/images/brand/brandDetailBg.png'" alt="">
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="merchant-info">
|
||||
<MerchantInfo></MerchantInfo>
|
||||
<MerchantInfo :designerDetail="designerDetail"></MerchantInfo>
|
||||
</div>
|
||||
<div class="commodity-list">
|
||||
<CommodityList @addShopping="addShopping" @openDetail="openDetail"></CommodityList>
|
||||
|
||||
Reference in New Issue
Block a user