diff --git a/components.d.ts b/components.d.ts
index addf3d5..509408a 100644
--- a/components.d.ts
+++ b/components.d.ts
@@ -3,28 +3,29 @@
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
-export {}
+export { }
declare module 'vue' {
export interface GlobalComponents {
+ Breadcrumb: typeof import('./src/components/Breadcrumb/index.vue')['default']
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton']
- ElCarousel: typeof import('element-plus/es')['ElCarousel']
- ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCol: typeof import('element-plus/es')['ElCol']
- ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
- ElEmpty: typeof import('element-plus/es')['ElEmpty']
- ElForm: typeof import('element-plus/es')['ElForm']
- ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
- ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
+ ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
+ ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
+ ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
+ ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow']
+ ElSelect: typeof import('element-plus/es')['ElSelect']
+ ElTable: typeof import('element-plus/es')['ElTable']
+ ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTag: typeof import('element-plus/es')['ElTag']
EquipCard: typeof import('./src/components/equipCard.vue')['default']
EquipCardHall: typeof import('./src/components/equipCardHall/index.vue')['default']
diff --git a/env/.env.dev b/env/.env.dev
index 6b35cd2..56b9df1 100644
--- a/env/.env.dev
+++ b/env/.env.dev
@@ -8,6 +8,7 @@ VITE_API_URL = '/proxyApi'
# VITE_proxyTarget = 'http://10.40.92.74:8080' #盛旭
VITE_proxyTarget = 'http://192.168.2.246:18080' # 马帅
+# VITE_proxyTarget = 'http://192.168.2.129:18080' # 马帅
# VITE_proxyTarget = 'http://10.40.92.185:9206' # 赵福海 ( 设备类型)
# VITE_proxyTarget = 'http://10.40.92.16:9502' # 牛 (个人中心 基础信息企业申请认证)
diff --git a/src/assets/font/demo_index.html b/src/assets/font/demo_index.html
index b41ba45..3a8687e 100644
--- a/src/assets/font/demo_index.html
+++ b/src/assets/font/demo_index.html
@@ -54,6 +54,12 @@
+ -
+
+
电话
+ 
+
+
-
购物车
@@ -498,9 +504,9 @@
@font-face {
font-family: 'iconfont';
- src: url('iconfont.woff2?t=1732329564134') format('woff2'),
- url('iconfont.woff?t=1732329564134') format('woff'),
- url('iconfont.ttf?t=1732329564134') format('truetype');
+ src: url('iconfont.woff2?t=1732599020939') format('woff2'),
+ url('iconfont.woff?t=1732599020939') format('woff'),
+ url('iconfont.ttf?t=1732599020939') format('truetype');
}
第二步:定义使用 iconfont 的样式
@@ -526,6 +532,15 @@
+ -
+
+
+ 电话
+
+ .icon-dianhua
+
+
+
-
@@ -1192,6 +1207,14 @@
+ -
+
+
电话
+ #icon-dianhua
+
+
-
-
diff --git a/src/http/api/cart/index.ts b/src/http/api/cart/index.ts
index d941d23..a425474 100644
--- a/src/http/api/cart/index.ts
+++ b/src/http/api/cart/index.ts
@@ -1,5 +1,15 @@
-import { get } from '../../index'
+import { get, post } from '../../index'
+
+// 预约车列表详情接口
export const getBookCarDetailsApi = () => {
return get('/material-mall/bookCar/getBookCarDetails', {})
+}
+// 预约车列表提交
+export const submitBookCarApi = (data: any) => {
+ return post('/material-mall/order/submitBookCar', data)
+}
+// 预约车列表提交
+export const deleteCartByIdApi = (data: any) => {
+ return post('/material-mall/bookCar/deleteById', data)
}
\ No newline at end of file
diff --git a/src/http/index.ts b/src/http/index.ts
index 8676f31..6287df1 100644
--- a/src/http/index.ts
+++ b/src/http/index.ts
@@ -30,7 +30,9 @@ service.interceptors.request.use(
)
// 响应拦截
service.interceptors.response.use(
+
(res) => {
+ ElMessage.closeAll()
const { data } = res
if (data.code == '200') {
return data
@@ -40,13 +42,16 @@ service.interceptors.response.use(
} else if (data.code == '401') {
ElMessage.error(data.msg)
router.push('/login')
+ } else if (data.code == '500') {
+ ElMessage.error('请求失败')
}
else {
return data
}
},
(error) => {
-
+ ElMessage.closeAll()
+ ElMessage.error('请求失败')
console.log('error-异常', error)
}
)
diff --git a/src/router/index.ts b/src/router/index.ts
index 95dcf85..99eca13 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -95,7 +95,7 @@ const routes: Array = [
name: 'equipList',
component: () => import('views/equip/list.vue'),
meta: {
- title: '',
+ title: '装备共享大厅',
activeName: 'equipList',
}
},
diff --git a/src/views/cart/index.vue b/src/views/cart/index.vue
index 9c36c09..0ace2ce 100644
--- a/src/views/cart/index.vue
+++ b/src/views/cart/index.vue
@@ -15,7 +15,9 @@
- 全选
+
+ 全选
+
@@ -47,6 +49,7 @@
@@ -59,10 +62,14 @@
-
+
-
+
@@ -79,7 +86,9 @@
-
{{ goods.lease_date_string }}
+
+ {{ goods.rentBeginTime }}-{{ goods.rentEndTime }}
+
- {{ goods.lease_pic }}
+ {{ goods.dayLeasePrice }}
- {{ goods.lease_day }}
+ {{ goods.days }}
- {{ goods.goods_num * goods.lease_pic * goods.lease_day }}
+ {{ goods.num * goods.days * goods.dayLeasePrice }}
-
删除
-
+ -->
+
+
+
+
+ 删除
+
+
+ 取消
+
+ 确定
+
+
+
-
+
@@ -174,23 +204,33 @@
import Header from '../../components/header/index.vue'
import FooterInfo from '../../components/FooterInfo/index.vue'
import { ElMessage } from 'element-plus'
-import { getBookCarDetailsApi } from '../../http/api/cart/index'
-import moment from 'moment'
+import {
+ getBookCarDetailsApi,
+ submitBookCarApi,
+ deleteCartByIdApi,
+} from '../../http/api/cart/index'
+import moment, { max } from 'moment'
+import { InfoFilled } from '@element-plus/icons-vue'
const protocolChecked = ref
(false)
+const allKey = ref(0)
const cardList = ref([])
const getBookCarDetailsData = async () => {
const res: any = await getBookCarDetailsApi()
- console.log(res, '----')
-
- cardList.value = res.data
+ cardList.value = []
+ cardList.value = JSON.parse(JSON.stringify(res.data))
cardList.value.forEach((e: any) => {
e.isChecked = false
+
e.devInfoVoList.forEach((j: any) => {
- j.isChecked = false
+ j.days = 0
+ j.num = 1
+ j.costs = 0
+ j.rentBeginTime = ''
+ j.rentEndTime = ''
})
})
@@ -204,13 +244,30 @@ onMounted(() => {
// 日期change事件
const onLeaseDateChange = (e: any, item: any) => {
- item.lease_date_string = `${e[0]}至${e[1]}`
- item.lease_day = moment(e[1]).diff(e[0], 'day')
+ console.log(e, '*****')
+ if (!e) {
+ item.rentBeginTime = ''
+ item.rentEndTime = ''
+ item.days = 0
+ } else {
+ item.rentBeginTime = e[0]
+ item.rentEndTime = e[1]
+ item.days = moment(e[1]).diff(e[0], 'day')
+ }
}
// 删除按钮
-const onDeleteGoods = (index: number) => {
- console.log('删除---', index)
+const onDeleteGoods = async (id: number | string) => {
+ const res: any = deleteCartByIdApi({ id })
+ if (res.code === 200) {
+ ElMessage({
+ showClose: false,
+ message: '删除成功',
+ type: 'success',
+ })
+
+ getBookCarDetailsData()
+ }
}
// 全选change事件
@@ -237,21 +294,25 @@ const onChangeCompany = (e: boolean, index: number, item: any) => {
// 计算所有装备
const amountNum = computed(() => {
let amountNum = 0
- cardList.value.forEach((e) => {
+ cardList.value.forEach((e: any) => {
amountNum = e.devInfoVoList.length + amountNum
})
return amountNum
})
// 计算全选按钮的选中状态
const allChecked = computed(() => {
- return cardList.value.every((e: any) => e.isChecked === true)
+ if (cardList.value.length < 1) {
+ return false
+ } else {
+ return cardList.value.every((e: any) => e.isChecked === true)
+ }
})
-// 已勾选的所有装备
+// 已勾选的装备数量
const amountDevice = computed(() => {
let amountNum = 0
- cardList.value.forEach((e) => {
- e.devInfoVoList.forEach((g) => {
+ cardList.value.forEach((e: any) => {
+ e.devInfoVoList.forEach((g: any) => {
if (g.isChecked) {
amountNum++
}
@@ -259,14 +320,26 @@ const amountDevice = computed(() => {
})
return amountNum
})
+// 已勾选的装备数量
+const amountDeviceList = computed(() => {
+ let selectList: any = []
+ cardList.value.forEach((e: any) => {
+ e.devInfoVoList.forEach((g: any) => {
+ if (g.isChecked) {
+ selectList.push(g)
+ }
+ })
+ })
+ return selectList
+})
// 计算订单总价格
const orderAmountPice = computed(() => {
let orderAmountPice = 0
- cardList.value.forEach((e) => {
- e.devInfoVoList.forEach((g) => {
+ cardList.value.forEach((e: any) => {
+ e.devInfoVoList.forEach((g: any) => {
if (g.isChecked) {
- orderAmountPice = g.goods_num * g.lease_pic * g.lease_day + orderAmountPice
+ orderAmountPice = g.num * g.dayLeasePrice * g.days + orderAmountPice
}
})
})
@@ -274,16 +347,56 @@ const orderAmountPice = computed(() => {
})
// 提交按钮
-const onCartSubmit = () => {
+const onCartSubmit = async () => {
ElMessage.closeAll()
+ if (amountDevice.value < 1) {
+ ElMessage({
+ showClose: false,
+ message: '请选择装备',
+ type: 'error',
+ })
+ return
+ }
if (!protocolChecked.value) {
ElMessage({
showClose: false,
message: '请阅读公司合同',
type: 'error',
})
+ return
}
- console.log('提交订单')
+
+ // 组装参数
+ const detailsList = amountDeviceList.value.map((e: any) => {
+ return {
+ maId: e.maId,
+ id: e.id,
+ rentBeginTime: e.rentBeginTime + ' ' + '00:00:00',
+ rentEndTime: e.rentEndTime + ' ' + '00:00:00',
+ manageType: e.manageType,
+ days: e.days,
+ num: e.num,
+ costs: e.num * e.days * e.dayLeasePrice,
+ }
+ })
+
+ const submitParams = {
+ cost: orderAmountPice.value,
+ detailsList,
+ }
+
+ const res: any = await submitBookCarApi(submitParams)
+ if (res.code === 200) {
+ ElMessage({
+ showClose: false,
+ message: '提交成功',
+ type: 'success',
+ })
+ allKey.value++
+
+ getBookCarDetailsData()
+ }
+ // console.log(res, '预约车提交结果')
}
diff --git a/src/views/equip/detail.vue b/src/views/equip/detail.vue
index 2bfc639..67c6f49 100644
--- a/src/views/equip/detail.vue
+++ b/src/views/equip/detail.vue
@@ -1,9 +1,32 @@
-
+
+
+
+
![]()
+
+
+
+
+
+
![]()
+
+
+
+
-
浏览 100
+
浏览 {{ pageData.searchNum }}
安徽省合肥市蜀山区
@@ -44,9 +67,26 @@
-
加入预约车
-
- 立即承租
+
+ 加入预约车
+
+
+
+
+ 立即承租
+
@@ -69,10 +109,13 @@
-->
-
-
187555555
+ /> -->
+
+
+
+
{{ pageData.personPhone }}
在线聊
@@ -80,16 +123,16 @@
-

+
-

+
{{ pageData.companyName }}
{{ v.label }}:
-
{{ pageData[v.key] }}{{ v.unit }}
+
{{ pageData[v.key] }}
@@ -100,7 +143,7 @@
装备详情
-
+
{{ v.label }}:
@@ -115,12 +158,38 @@
装备外观
-
-
-
![]()
+
+
+
-
+
+
+
出租记录
+
+
+
+
+
+
+
+
+
+
+
+