Browse Source

系统bug修复; 新增店铺信息页面和平台详情页面

WanGxC 8 tháng trước cách đây
mục cha
commit
e5fcc734d7

+ 1 - 1
src/layout/footer/index.vue

@@ -2,7 +2,7 @@
 	<div class="layout-footer pb5 pt2">
 		<div class="layout-footer-warp">
 			<!--<div>❤️ Powered by Django-Vue3-Admin Copyright © DVAdmin团队 ❤️</div>-->
-			<div>Designed by Ansjer front end</div>
+			<!--<div>Designed by Ansjer front end</div>-->
 		</div>
 	</div>
 </template>

+ 2 - 0
src/layout/routerView/parent.vue

@@ -3,7 +3,9 @@
 		<router-view v-slot="{ Component }">
 			<transition :name="setTransitionName" mode="out-in">
 				<keep-alive :include="getKeepAliveNames" v-if="showView">
+          <div class="flex flex-1"> <!-- flex-1 避免 layout main 的内容不能全屏 -->
 						<component :is="Component" :key="state.refreshRouterViewKey" class="w100" v-show="!isIframePage" />
+          </div>
 				</keep-alive>
 			</transition>
 		</router-view>

+ 2 - 1
src/stores/themeConfig.ts

@@ -18,7 +18,8 @@ export const useThemeConfig = defineStore('themeConfig', {
 			 * 全局主题
 			 */
 			// 默认 primary 主题颜色
-			primary: '#409eff',
+			// primary: '#409eff',
+			primary: '#3875F6',
 			// 是否开启深色模式
 			isIsDark: false,
 

+ 2 - 1
src/theme/app.scss

@@ -75,7 +75,8 @@ body,
 		padding: 0 !important;
 		overflow: hidden;
 		width: 100%;
-		background-color: var(--next-bg-main-color);
+		//background-color: var(--next-bg-main-color);
+		background-color: #f5f5f5;
 		display: flex;
 		flex-direction: column;
 		// 内层 el-scrollbar样式,用于界面高度自适应(main.vue)

+ 7 - 0
src/utils/useResponse.ts

@@ -0,0 +1,7 @@
+export async function useResponse(parameter: any = {}, requestApi: any) {
+  try {
+    return await requestApi(parameter);
+  } catch (error) {
+    console.log('Error==>', error);
+  }
+}

+ 16 - 0
src/views/company-information/index.vue

@@ -0,0 +1,16 @@
+<script setup lang="ts">
+/**
+ * @Name: index.vue
+ * @Description: 公司信息页面
+ * @Author: Cheney
+ */
+
+</script>
+
+<template>
+
+</template>
+
+<style scoped>
+
+</style>

+ 16 - 0
src/views/computer-information/index.vue

@@ -0,0 +1,16 @@
+<script setup lang="ts">
+/**
+ * @Name: index.vue
+ * @Description: 电脑信息页面
+ * @Author: Cheney
+ */
+
+</script>
+
+<template>
+
+</template>
+
+<style scoped>
+
+</style>

+ 16 - 0
src/views/employee-information/index.vue

@@ -0,0 +1,16 @@
+<script setup lang="ts">
+/**
+ * @Name: index.vue
+ * @Description: 员工信息页面
+ * @Author: Cheney
+ */
+
+</script>
+
+<template>
+
+</template>
+
+<style scoped>
+
+</style>

+ 20 - 0
src/views/shop-information/api.ts

@@ -0,0 +1,20 @@
+import { request } from '/@/utils/service';
+
+
+const apiPrefix = '/api/assets/shop/';
+
+export function getCardData(query: any) {
+  return request({
+    url: apiPrefix + 'card/',
+    method: 'GET',
+    params: query,
+  });
+}
+
+export function getPlatformDetail(query: any) {
+  return request({
+    url: apiPrefix,
+    method: 'GET',
+    params: query,
+  });
+}

+ 51 - 0
src/views/shop-information/components/InfoCard.vue

@@ -0,0 +1,51 @@
+<script lang="ts" setup>
+/**
+ * @Name: InfoCard.vue
+ * @Description:
+ * @Author: Cheney
+ */
+
+const router = useRouter();
+const cardData = inject<Ref>('cardData', ref({}));
+
+function handleJump(item: any) {
+  console.log('router=> ', router);
+
+  router.push({
+    path: '/shop/platform/detail',
+    query: { platform: item.platform } // 将 platform 作为查询参数传递
+  });
+}
+</script>
+
+<template>
+  <el-row :gutter="10">
+    <el-col v-for="(item, index) in cardData" :key="index" :lg="6" :md="6" :sm="8" :xl="4" :xs="12" class="mt-2.5">
+      <el-card>
+        <el-descriptions>
+          <template #title>
+            <el-link :underline="false" style="font-size: 1.25rem; font-weight: 500" type="primary"
+                     @click="handleJump(item)">
+              {{ item.platform }}
+            </el-link>
+          </template>
+          <el-descriptions-item label="店铺">
+            <span class="font-bold">
+              {{ item.countShop }}
+            </span>
+          </el-descriptions-item>
+          <el-descriptions-item label="公司">
+            <span class="font-bold">
+              
+            {{ item.countCompany }}
+            </span>
+          </el-descriptions-item>
+        </el-descriptions>
+      </el-card>
+    </el-col>
+  </el-row>
+</template>
+
+<style scoped>
+
+</style>

+ 35 - 0
src/views/shop-information/components/PlatformDetail.vue

@@ -0,0 +1,35 @@
+<script lang="ts" setup>/**
+ * @Name: PlatformDetail.vue
+ * @Description: 平台详情页
+ * @Author: Cheney
+ */
+
+import { useResponse } from '/@/utils/useResponse';
+import * as api from '../api';
+
+
+const route = useRoute();
+const platform = route.query.platform;
+
+onBeforeMount(() => {
+  fetchPlatformDetail();
+});
+
+async function fetchPlatformDetail() {
+  const res = await useResponse({ platform: platform }, api.getPlatformDetail);
+  console.log('(PlatformDetail.vue: 21)=> res', res);
+}
+</script>
+
+<template>
+  <div class="mb-2">
+    <el-card class="m-2 h-full" shadow="never" style="border: none">
+      <el-card class="w-fit">{{ platform }} 的详细信息</el-card>
+    </el-card>
+  </div>
+
+</template>
+
+<style scoped>
+
+</style>

+ 37 - 0
src/views/shop-information/index.vue

@@ -0,0 +1,37 @@
+<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);
+
+onBeforeMount(() => {
+  initData();
+});
+
+async function initData() {
+  const res = await useResponse({}, api.getCardData);
+  cardData.value = res.data;
+}
+</script>
+
+<template>
+  <div class="mb-2.5">
+    <el-card class="m-2 h-full" shadow="never" style="border: none;">
+      <InfoCard></InfoCard>
+    </el-card>
+  </div>
+
+</template>
+
+<style scoped>
+
+</style>