diff --git a/sub-operation-service/src/components/common/leftMenu.vue b/sub-operation-service/src/components/common/leftMenu.vue index ba30022..22c780f 100644 --- a/sub-operation-service/src/components/common/leftMenu.vue +++ b/sub-operation-service/src/components/common/leftMenu.vue @@ -43,6 +43,11 @@ import { ref, reactive, onMounted, watch } from 'vue'; import { isEmpty, getAssetsFile } from '@/utils'; import { useRoute, useRouter } from 'vue-router'; +import { useGetCommonData } from '../../store/modules/common'; +import { productFactory } from './modul'; + +const store = useGetCommonData(); + const route = useRoute(); const router = useRouter(); @@ -68,8 +73,8 @@ let currentIndex = ref(0); let currentCIndex = ref(''); const toLink = (index) => { + productFactory(props.menus[index].title); currentIndex.value = index; - console.log(leftMenu); if (leftMenu.value[index].children.length > 0) { window.sessionStorage.setItem('currentOpen', index); } diff --git a/sub-operation-service/src/components/common/modul.js b/sub-operation-service/src/components/common/modul.js new file mode 100644 index 0000000..bf86846 --- /dev/null +++ b/sub-operation-service/src/components/common/modul.js @@ -0,0 +1,27 @@ +import { useGetCommonData } from '../../store/modules/common'; +const store = useGetCommonData(); + +// 仓储 +function createProductA() { + store.getData({ title: '仓储' }); +} + +// 物流 +function createProductB() { + store.getData1({ title: '物流' }); +} + +// 工厂函数 +export function productFactory(title) { + switch (title) { + case '仓储': + return createProductA(); + case '物流': + return createProductB(); + default: + throw new Error('未知产品类型'); + } +} + +// 可选:直接导出具体产品构造函数 +export { createProductA, createProductB }; diff --git a/sub-operation-service/src/store/modules/common.js b/sub-operation-service/src/store/modules/common.js new file mode 100644 index 0000000..5e8a1a1 --- /dev/null +++ b/sub-operation-service/src/store/modules/common.js @@ -0,0 +1,22 @@ +import { defineStore } from 'pinia'; +import { constantRoutes, notFoundRouter } from '@/router'; +import { createAsyncRoutes, filterAsyncRoutes, filterKeepAlive } from '@/utils/router'; +import { useUserStore } from '@/store/modules/user'; +import { getTree } from '@/utils'; + +export const useGetCommonData = defineStore('commonData', { + state: () => ({ + data: {}, + }), + actions: { + //仓储调用方法 + getData(res) { + useGetCommonData().$state.data = res; + }, + //物流调用方法 + getData1(res) { + useGetCommonData().$state.data = res; + }, + }, + getters: {}, +}); diff --git a/sub-operation-service/src/views/packaging/components/common.vue b/sub-operation-service/src/views/packaging/components/common.vue new file mode 100644 index 0000000..847afce --- /dev/null +++ b/sub-operation-service/src/views/packaging/components/common.vue @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + diff --git a/sub-operation-service/src/views/packaging/components/leftMenu.vue b/sub-operation-service/src/views/packaging/components/leftMenu.vue new file mode 100644 index 0000000..a644a56 --- /dev/null +++ b/sub-operation-service/src/views/packaging/components/leftMenu.vue @@ -0,0 +1,192 @@ + + + + + + + + + {{ n.title }} + + + + + + + + + {{ item.title }} + + + + + + + + + + diff --git a/sub-operation-service/src/views/packaging/sorting.vue b/sub-operation-service/src/views/packaging/sorting.vue index 6e85919..1583740 100644 --- a/sub-operation-service/src/views/packaging/sorting.vue +++ b/sub-operation-service/src/views/packaging/sorting.vue @@ -1,19 +1,256 @@ - 131 + + + + + + + 仓储分类 + 普通仓库 + 恒温仓库 + 冷库 + 气调仓库 + + + + + + + + + + + {{ item.title }} + + {{ item.description }} + + + + + 延长仓储 + 保鲜储存 + + + + {{ item.location }} + + + + + + 报价 + ¥{{ item.price }}/间/月 + + + + 联系卖家 + + + + + + + + + + + + + + + + + gap: 16px; + &-top { + @include flex-row; + + align-items: center; + } +} +.storage-image { + margin-right: 16px; + width: 120px; + height: 120px; + border-radius: 8px; + object-fit: cover; +} +.storage-info { + padding-right: 50px; + flex: 1; + cursor: pointer; +} +.storage-title, +.storage-desc, +.storage-tags, +.storage-location { + overflow: hidden; + margin: 10px 0; + width: 100%; +} +.storage-title { + font-size: 20px; + font-weight: 700; + color: #000000; + @include ellipsis; +} +.storage-desc { + font-size: 16px; + color: #999999; + @include ellipsis; + i { + display: inline-block; + width: 20px; + height: 20px; + } +} +.storage-tags { + span { + margin-right: 10px; + } +} +.storage-location { + display: flex; + align-items: center; + font-size: 16px; + font-weight: 400; + color: #000000; +} +.storage-price { + display: flex; + align-items: center; + &-left { + flex: 1; + } +} +.price-label { + margin-right: 10px; + font-size: 16px; + color: #999999; +} +.price-amount { + font-size: 20px; + font-weight: 700; + color: $color-primary; +} +.contact-btn { + width: 152px; + height: 48px; + font-size: 20px; + border-radius: 8px; + background: #25bf82 !important; + :deep(.el-icon) { + margin-right: 10px; + } +} +.rank-badge { + position: absolute; + top: 0; + right: 20px; + width: 80px; + height: 80px; +} + diff --git a/sub-operation-service/src/views/warehouseLogistics/warehouse/index.vue b/sub-operation-service/src/views/warehouseLogistics/warehouse/index.vue index c5dfab6..7e957d7 100644 --- a/sub-operation-service/src/views/warehouseLogistics/warehouse/index.vue +++ b/sub-operation-service/src/views/warehouseLogistics/warehouse/index.vue @@ -5,7 +5,7 @@ - 仓储分类 + 仓储分类({{ data.title }}) 普通仓库 恒温仓库 冷库 @@ -65,6 +65,10 @@ import { getAssetsFile } from '@/utils'; import { useRoute, useRouter } from 'vue-router'; import warehouseLogisticsRoutes from '@/router/modules/warehouseLogistics'; import Common from '../components/common.vue'; +import { useGetCommonData } from '../../../store/modules/common'; +import { storeToRefs } from 'pinia'; +const store = useGetCommonData(); +const { data } = storeToRefs(store); const route = useRoute(); const router = useRouter();