From a854312c1b03d90b38f14faf7791dd0ba3eb9c05 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Mon, 16 Dec 2024 15:45:48 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E6=B8=85=E5=8D=95=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 2 - src/views/cart/index.vue | 83 +++++ src/views/equip/detail.vue | 4 +- src/views/equip/list.vue | 12 +- src/views/order/index.vue | 83 +++-- src/views/user/goodsManagement/index.vue | 49 ++- .../components/order-details.vue | 319 ++++++++++-------- .../orderManagement/components/order-home.vue | 2 +- .../components/cost-settlement-model.vue | 2 +- .../components/order-details.vue | 319 ++++++++++-------- .../components/order-home.vue | 8 +- .../components/rent-termination-model.vue | 2 +- 12 files changed, 550 insertions(+), 335 deletions(-) diff --git a/components.d.ts b/components.d.ts index 2f7d243..81ac0e1 100644 --- a/components.d.ts +++ b/components.d.ts @@ -26,7 +26,6 @@ declare module 'vue' { ElEmpty: typeof import('element-plus/es')['ElEmpty'] ElForm: typeof import('element-plus/es')['ElForm'] ElFormItem: typeof import('element-plus/es')['ElFormItem'] - ElHeader: typeof import('element-plus/es')['ElHeader'] ElIcon: typeof import('element-plus/es')['ElIcon'] ElImage: typeof import('element-plus/es')['ElImage'] ElInput: typeof import('element-plus/es')['ElInput'] @@ -34,7 +33,6 @@ declare module 'vue' { ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElOption: typeof import('element-plus/es')['ElOption'] - ElPageHeader: typeof import('element-plus/es')['ElPageHeader'] ElPagination: typeof import('element-plus/es')['ElPagination'] ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm'] ElProgress: typeof import('element-plus/es')['ElProgress'] diff --git a/src/views/cart/index.vue b/src/views/cart/index.vue index 0048e89..fe25106 100644 --- a/src/views/cart/index.vue +++ b/src/views/cart/index.vue @@ -173,6 +173,41 @@
+ + + + + + + + + + +
@@ -229,6 +264,7 @@ import { import moment, { max } from 'moment' import { InfoFilled } from '@element-plus/icons-vue' import CustomDatePickerButton from './components/date-picker-button.vue' +import { getAddressListApi } from 'http/api/address-manage/index' import { useRoute, useRouter } from 'vue-router' import { useStore } from '../../store/user' const userStore = useStore() @@ -236,6 +272,9 @@ const router = useRouter() const protocolChecked = ref(false) const allKey = ref(0) const cardList = ref([]) +const activeNames = ref('') +const addressTitle = ref('请选择收货地址') +const addressList = ref([]) const getBookCarDetailsData = async () => { const res: any = await getBookCarDetailsApi() @@ -410,6 +449,14 @@ const onCartSubmit = async () => { }) return } + if (addressTitle.value === '请选择收货地址') { + ElMessage({ + showClose: false, + message: '请选择收货地址', + type: 'error', + }) + return + } let isDays = false try { @@ -461,6 +508,7 @@ const onCartSubmit = async () => { }) paramsList[index] = { cost: 0, + address: addressTitle.value.split(':')[1], detailsList: itemsArray, } }) @@ -495,6 +543,32 @@ const onCartSubmit = async () => { } // console.log(res, '预约车提交结果') } + +// 获取收货地址 +const getReceiptGoodsAddress = async () => { + const res: any = await getAddressListApi({}) + addressList.value = res.rows.map((e: any) => { + return { + addressName: `${e.provinceName}${e.cityName}${e.areaName}${e.address}`, + } + }) +} +// 选择收货地址 +const onSelectAddress = (address: any) => { + addressTitle.value = '收货地址:' + address + activeNames.value = '' +} +// 去往地址管理 +const onAddAddress = () => { + userStore.editcurrentMenuItem('address-manage') + setTimeout(() => { + router.push({ + name: 'my-user', + }) + }, 500) +} + +getReceiptGoodsAddress() diff --git a/src/views/equip/detail.vue b/src/views/equip/detail.vue index c89b82b..0ec05ec 100644 --- a/src/views/equip/detail.vue +++ b/src/views/equip/detail.vue @@ -206,7 +206,7 @@ :preview-src-list="[item.fileUrl]" :initial-index="0" fit="cover" - z-index="9999999999" + :z-index="9999999999" :preview-teleported="true" />
@@ -230,7 +230,7 @@ :preview-src-list="[item.fileUrl]" :initial-index="0" fit="cover" - z-index="9999999999" + :z-index="9999999999" :preview-teleported="true" />
diff --git a/src/views/equip/list.vue b/src/views/equip/list.vue index 608519e..0bb27ec 100644 --- a/src/views/equip/list.vue +++ b/src/views/equip/list.vue @@ -35,7 +35,17 @@ active: val.isChecked, }" > - {{ val.name }} + {{ val.name }} + + {{ val.name }} + {{ + index == 0 + ? '' + : val.maCount + ? `(${val.maCount})` + : '(0)' + }} + diff --git a/src/views/order/index.vue b/src/views/order/index.vue index a9e0c76..a6294e7 100644 --- a/src/views/order/index.vue +++ b/src/views/order/index.vue @@ -148,23 +148,35 @@
- - -
- {{ item.addressName }} -
+ + +
@@ -215,6 +227,7 @@ import FooterInfo from '../../components/FooterInfo/index.vue' import { ElMessage } from 'element-plus' import { getBookCarDetailByMaId, submitBookCarApi } from '../../http/api/order/index' import CustomDatePickerButton from '../cart/components/date-picker-button.vue' +import { getAddressListApi } from 'http/api/address-manage/index' import { getDetail } from 'http/api/equip' import moment from 'moment' import { useRoute, useRouter } from 'vue-router' @@ -229,12 +242,7 @@ const activeNames = ref('') const protocolChecked = ref(false) const orderList = ref([]) const addressTitle = ref('请选择收货地址') -const addressList = ref([ - { addressName: '安徽省合肥市蜀山区---' }, - { addressName: '安徽省合肥市庐阳区---' }, - { addressName: '安徽省合肥市滨湖区---' }, - { addressName: '安徽省合肥市瑶海区---' }, -]) +const addressList = ref([]) const getOrderListData = async () => { const addParams = { @@ -396,6 +404,15 @@ const onCartSubmit = async () => { return } + if (addressTitle.value === '请选择收货地址') { + ElMessage({ + showClose: false, + message: '请选择收货地址', + type: 'error', + }) + return + } + const orderInfo = orderList.value[0] const submitInfo = { maId: orderInfo.maId, @@ -410,6 +427,7 @@ const onCartSubmit = async () => { const submitParams = { cost: orderAmountPice.value, + address: addressTitle.value.split(':')[1], detailsList: [submitInfo], } // console.log('submitParams', submitParams) @@ -433,11 +451,32 @@ const onCartSubmit = async () => { } } +// 获取收货地址 +const getReceiptGoodsAddress = async () => { + const res: any = await getAddressListApi({}) + addressList.value = res.rows.map((e: any) => { + return { + addressName: `${e.provinceName}${e.cityName}${e.areaName}${e.address}`, + } + }) +} + +// 去往地址管理 +const onAddAddress = () => { + userStore.editcurrentMenuItem('address-manage') + setTimeout(() => { + router.push({ + name: 'my-user', + }) + }, 500) +} // 选择收货地址 const onSelectAddress = (address: any) => { - addressTitle.value = address + addressTitle.value = '收货地址:' + address activeNames.value = '' } + +getReceiptGoodsAddress()