xinyan hai 6 meses
pai
achega
88824f9f02

+ 1 - 1
src/utils/menu.ts

@@ -62,7 +62,7 @@ export const handleMenu = (menuData: Array<any>) => {
     })
     const dynamicRoutes = [
         {
-            path: '/home', name: 'home', component: '/shop-information/index', meta: {
+            path: '/home', name: 'home', component: '/shop-information/components/Home.vue', meta: {
                 title: 'message.router.home',
                 isLink: '',
                 isHide: false,

+ 47 - 0
src/views/shop-information/components/Home.vue

@@ -0,0 +1,47 @@
+<script lang="ts" setup>
+/**
+ * @Name: index.vue
+ * @Description: 店铺信息页面
+ * @Author: Cheney
+ */
+
+import InfoCard from '/@/views/shop-information/components/InfoCard.vue';
+import * as api from '/@/views/shop-information/api';
+import { useResponse } from '/@/utils/useResponse';
+
+const cardData = ref();
+provide('cardData', cardData);
+
+const loading = ref(false);
+
+const isShow = ref(false);
+provide('isShow', isShow);
+
+
+onBeforeMount(() => {
+  initData();
+});
+
+async function initData() {
+  const res = await useResponse({}, api.getCardData, loading);
+  cardData.value = res.data;
+}
+</script>
+
+<template>
+  <div class="flex flex-col px-5">
+    <el-divider content-position="left">
+      <div class="font-bold text-xl">店铺信息概览</div>
+    </el-divider>
+    <!-- 添加 flex-grow 类,确保 el-card 占据剩余空间 -->
+    <el-card v-loading="loading" class="flex-grow" shadow="never">
+          <InfoCard />
+    </el-card>
+  </div>
+</template>
+
+<style scoped>
+:deep(.el-divider__text.is-left) {
+  background-color: #F5F5F5;
+}
+</style>

+ 2 - 1
src/views/shop-information/components/InfoCard.vue

@@ -12,6 +12,7 @@ import { GoodsFilled, Picture as IconPicture, Search, Shop } from '@element-plus
 
 const router = useRouter();
 const cardData = inject<Ref>('cardData', ref({}));
+const isShow = inject<Ref>('isShow', ref({}));
 
 function handleNavigate(item: any) {
   router.push({
@@ -68,7 +69,7 @@ function getImageSrc(platform: string) {
         </div>
         <template #footer>
           <div style="text-align: center; padding: 0 10px">
-            <el-button :icon="Search" plain round style="width: 100%" type="primary" @click="handleNavigate(item)">
+            <el-button :icon="Search" plain round style="width: 100%" type="primary" @click="handleNavigate(item)" v-if="isShow">
               查看详情
             </el-button>
           </div>