From 2140728271733d1f9214d6a5e9eebb605fb631cc Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Sun, 1 Dec 2024 16:21:35 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 1 + env/.env.dev | 4 +- src/assets/font/demo_index.html | 75 ++++++++- src/assets/font/iconfont.css | 18 ++- src/assets/font/iconfont.js | 2 +- src/assets/font/iconfont.json | 21 +++ src/assets/font/iconfont.ttf | Bin 20092 -> 20356 bytes src/assets/font/iconfont.woff | Bin 12236 -> 12408 bytes src/assets/font/iconfont.woff2 | Bin 10352 -> 10528 bytes src/components/FooterInfo/index.vue | 2 +- src/components/Navmenu/index.vue | 20 ++- src/components/header/index.vue | 5 +- src/http/api/equip.ts | 4 +- src/http/api/home/index.ts | 6 + src/layout/header.vue | 69 +++++++-- src/router/index.ts | 26 ++-- src/store/user.ts | 4 +- src/views/cart/index.vue | 45 +++--- src/views/enterpriseZone/index.vue | 2 +- src/views/equip/detail.vue | 4 +- src/views/equip/list.vue | 212 +++++++++++++++++++------- src/views/home/index.vue | 23 ++- src/views/parity/index.vue | 138 +++++++++++------ src/views/user/sourcingNeed/index.vue | 46 +++++- 24 files changed, 554 insertions(+), 173 deletions(-) diff --git a/components.d.ts b/components.d.ts index ac3a27b..587d2ec 100644 --- a/components.d.ts +++ b/components.d.ts @@ -8,6 +8,7 @@ export {} declare module 'vue' { export interface GlobalComponents { Breadcrumb: typeof import('./src/components/Breadcrumb/index.vue')['default'] + ElBadge: typeof import('element-plus/es')['ElBadge'] ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElButton: typeof import('element-plus/es')['ElButton'] diff --git a/env/.env.dev b/env/.env.dev index 1fd9f19..b7fd2d0 100644 --- a/env/.env.dev +++ b/env/.env.dev @@ -7,8 +7,8 @@ VITE_API_URL = '/proxyApi' # 开发环境接口地址 # VITE_proxyTarget = 'http://10.40.92.74:8080' #盛旭 -# VITE_proxyTarget = 'http://192.168.2.246:28080' # 马帅 -VITE_proxyTarget = 'http://192.168.0.244:28580' # 马帅 +VITE_proxyTarget = 'http://192.168.2.246:28080' # 马帅 +# VITE_proxyTarget = 'http://192.168.0.244:28580' # 马帅 # VITE_proxyTarget = 'http://192.168.2.129:18080' # 马帅 # VITE_proxyTarget = 'http://10.40.92.185:9206' # 赵福海 ( 设备类型) diff --git a/src/assets/font/demo_index.html b/src/assets/font/demo_index.html index 3a8687e..ea1cfab 100644 --- a/src/assets/font/demo_index.html +++ b/src/assets/font/demo_index.html @@ -54,6 +54,24 @@
diff --git a/src/http/api/equip.ts b/src/http/api/equip.ts index 81e25e7..6372e55 100644 --- a/src/http/api/equip.ts +++ b/src/http/api/equip.ts @@ -1,8 +1,8 @@ import { post, get, put } from '../index' // 获取装备分类/maType/getTypeList -export const getTypeListApi = () => { - return get(`/material-mall/maType/getTypeList`, {}) +export const getTypeListApi = (data: any = {}) => { + return get(`/material-mall/maType/getTypeList`, data) } // 获取装备列表 diff --git a/src/http/api/home/index.ts b/src/http/api/home/index.ts index 8de2fe4..43d494b 100644 --- a/src/http/api/home/index.ts +++ b/src/http/api/home/index.ts @@ -12,9 +12,15 @@ export const getHotSearchListApi = () => { export const getLeaseListApi = (data: any = {}) => { return post('/material-mall/ma-lease/leaseList', data) } +export const getBookCarDetailsApi = (data: any = {}) => { + return get('/material-mall/bookCar/getBookCarDetails', data) +} export const getLeaseInfoByIdApi = (data: any = {}) => { return get('/material-mall/ma-lease/getById', data) } +export const getAreaApi = (data: any = {}) => { + return get('/material-mall/maType/getArea', data) +} // 立即接单 export const setAcceptByIdApi = (data: any = {}) => { return post('/material-mall/ma-lease/accept', data) diff --git a/src/layout/header.vue b/src/layout/header.vue index f4cefbb..5c9ada0 100644 --- a/src/layout/header.vue +++ b/src/layout/header.vue @@ -3,7 +3,7 @@ import $bus from '@/utils/bus' import { mainStore } from 'store/main' import { useStore } from 'store/user' import { ElMessage, ElMessageBox } from 'element-plus' -import { getHotSearchListApi } from '../http/api/home/index' +import { getHotSearchListApi, getBookCarDetailsApi } from 'http/api/home/index' import imgSrc from '@/assets/img/logo.png' const store: any = mainStore() const userStore = useStore() @@ -79,7 +79,11 @@ const searchKeywordBtn = () => { store.addHistoryRecord(keywordIptValue.value) if (route.path == '/equipList') { $bus.emit('search', keywordIptValue.value) - } else { + } + if (route.path == '/parity') { + $bus.emit('search', keywordIptValue.value) + } + if (route.path == '/home') { router.push({ name: 'equipList', query: { keyWord: keywordIptValue.value }, @@ -111,15 +115,26 @@ const onSelectRoles = (type: number) => { userStore.editMenuList(1) userStore.editUserMenuList(1) localStorage.setItem('rolesType', '1') + window.location.reload() } else { rolesName.value = '2' userStore.editMenuList(2) userStore.editUserMenuList(2) localStorage.setItem('rolesType', '2') + window.location.reload() } isRolesSelect.value = false } +const cartNum = ref(0) +const getBookCarDetailsData = async () => { + const res: any = await getBookCarDetailsApi() + console.log(res, '预约车数量') + + cartNum.value = res.data.length +} +getBookCarDetailsData() + // 查看预约车 const onCarts = () => { console.log('跳转预约车页面') @@ -137,6 +152,7 @@ const onCarts = () => {
{{ store.userInfo.nickName }} +
{ >注册 退出登录 +
- - {{ rolesName == 1 ? '出租方' : '承租方' }} - + + + {{ rolesName == 1 ? '出租方' : '承租方' }} + + +
+
{
+
个人中心 +
-
+
{ 扫二维码查看xxx
-
+ --> @@ -216,6 +247,7 @@ const onCarts = () => { style="width: 190px; cursor: pointer; margin-left: 60px" :src="imgSrc" fit="contain" + @click="$router.push('/home')" /> {
- - 预约车 + + + + 预约车
@@ -275,6 +309,11 @@ const onCarts = () => { color: #6d6d6d; font-size: 14px; cursor: pointer; + .line { + width: 1px; + height: 15px; + background-color: #666655; + } .user-name:hover { color: #6d6d6d; @@ -286,7 +325,7 @@ const onCarts = () => { a { padding: 0 20px; - border-right: 1px solid #666655; + // border-right: 1px solid #666655; } a:hover { @@ -372,7 +411,7 @@ const onCarts = () => { display: flex; align-items: center; background-color: #eeeff6; - padding: 30px 0; + padding: 30px 0 60px 0; img { margin-left: 38px; @@ -415,7 +454,7 @@ const onCarts = () => { .ipt-down { position: absolute; - bottom: 5px; + bottom: 25px; left: 22%; overflow: hidden; diff --git a/src/router/index.ts b/src/router/index.ts index 93d2fd1..ccc2efb 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -101,7 +101,7 @@ const routes: Array = [ }, //装备详情 { - path: '/equipDetail/:id', + path: '/equipDetail', name: 'equipDetail', component: () => import('views/equip/detail.vue'), meta: { @@ -229,17 +229,17 @@ const routes: Array = [ }, }, /* 订单管理(出租方) */ - { - path: 'orderManagementBuy', - name: 'orderManagementBuy', - component: () => import('@/views/user/orderManagementCz/index.vue'), - meta: { - title: '订单管理(求租)', - keepAlive: true, - AuthFlag: false, - isLogin: true - }, + { + path: 'orderManagementBuy', + name: 'orderManagementBuy', + component: () => import('@/views/user/orderManagementCz/index.vue'), + meta: { + title: '订单管理(求租)', + keepAlive: true, + AuthFlag: false, + isLogin: true }, + }, /* 订单管理(订单详情出租) */ { path: 'orderManagementInfoBuy', @@ -484,7 +484,7 @@ const routes: Array = [ keepAlive: false, AuthFlag: false }, - redirect: '/my-lease/orderManagementCz', + redirect: '/my-lease/goodsManagement', children: [ { path: 'orderManagementCz', @@ -502,7 +502,7 @@ const routes: Array = [ name: 'goodsManagement', component: () => import('views/user/goodsManagement/index.vue'), meta: { - title: '装备管理', + title: '商品管理', keepAlive: true, AuthFlag: false, isLogin: true diff --git a/src/store/user.ts b/src/store/user.ts index 88dc173..0a6561b 100644 --- a/src/store/user.ts +++ b/src/store/user.ts @@ -25,9 +25,9 @@ export const useStore = defineStore('myUser', { deviceTypeSunList: [], // 设备类型小类 leaseAndLesseeList: [], leaseAndLesseeUserList: [ - { title: '订单管理', name: 'orderManagementCz' }, { title: '商品管理', name: 'goodsManagement' }, - { title: '商品上下架', name: 'goodsUpdown' }, + { title: '订单管理', name: 'orderManagementCz' }, + // { title: '商品上下架', name: 'goodsUpdown' }, // { title: '机手管理', name: 'operatorManagement' }, // { title: '寻源竞价', name: 'sourcingBidding' }, // { title: '专区管理', name: 'zoneManag' }, diff --git a/src/views/cart/index.vue b/src/views/cart/index.vue index fb9662b..767c5b6 100644 --- a/src/views/cart/index.vue +++ b/src/views/cart/index.vue @@ -127,7 +127,7 @@ v-model="goods.num" style="width: 100px" :min="1" - :max="goods.deviceCount" + :max="goods.deviceCount || 1" size="small" /> @@ -232,7 +232,7 @@ const getBookCarDetailsData = async () => { const res: any = await getBookCarDetailsApi() cardList.value = [] - cardList.value = JSON.parse(JSON.stringify(res.data)) + cardList.value = res.data cardList.value.forEach((e: any) => { e.isChecked = false @@ -245,9 +245,6 @@ const getBookCarDetailsData = async () => { j.lease_date = null }) }) - - console.log(cardList.value, '***********') - // console.log(res, '购物车详情') } onMounted(() => { @@ -268,18 +265,32 @@ onMounted(() => { // } // } const onLeaseDateChange = (value: any, companyIndex: number, goodsIndex: number) => { - if (!value) { - cardList.value[companyIndex].devInfoVoList[goodsIndex].rentBeginTime = '' - cardList.value[companyIndex].devInfoVoList[goodsIndex].rentEndTime = '' - cardList.value[companyIndex].devInfoVoList[goodsIndex].days = 0 - } else { - cardList.value[companyIndex].devInfoVoList[goodsIndex].rentBeginTime = value[0] - cardList.value[companyIndex].devInfoVoList[goodsIndex].rentEndTime = value[1] - cardList.value[companyIndex].devInfoVoList[goodsIndex].days = moment(value[1]).diff( - value[0], - 'day', - ) - } + // if (!value) { + // cardList.value[companyIndex].devInfoVoList[goodsIndex].rentBeginTime = '' + // cardList.value[companyIndex].devInfoVoList[goodsIndex].rentEndTime = '' + // cardList.value[companyIndex].devInfoVoList[goodsIndex].days = 0 + // } else { + // cardList.value[companyIndex].devInfoVoList[goodsIndex].rentBeginTime = value[0] + // cardList.value[companyIndex].devInfoVoList[goodsIndex].rentEndTime = value[1] + // cardList.value[companyIndex].devInfoVoList[goodsIndex].days = moment(value[1]).diff( + // value[0], + // 'day', + // ) + // } + + cardList.value.forEach((e: any) => { + e.devInfoVoList.forEach((j: any) => { + if (!value) { + j.rentBeginTime = '' + j.rentEndTime = '' + j.days = 0 + } else { + j.rentBeginTime = value[0] + j.rentEndTime = value[1] + j.days = moment(value[1]).diff(value[0], 'day') + } + }) + }) } // 删除按钮 diff --git a/src/views/enterpriseZone/index.vue b/src/views/enterpriseZone/index.vue index 731a94c..0594d9b 100644 --- a/src/views/enterpriseZone/index.vue +++ b/src/views/enterpriseZone/index.vue @@ -1,5 +1,5 @@