From 01cdc5581ca0ff3468aad465eecd2ec3a6a8192a Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Tue, 21 Jan 2025 16:10:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- env/.env.dev | 4 ++-- src/App.vue | 7 +++++-- src/layout/header.vue | 7 ++++++- src/views/cart/index.vue | 6 ++---- src/views/equip/detail.vue | 2 +- src/views/message/index.vue | 16 +++++++++++++--- src/views/order/index.vue | 2 +- 7 files changed, 30 insertions(+), 14 deletions(-) diff --git a/env/.env.dev b/env/.env.dev index 5e37dcb..02d021f 100644 --- a/env/.env.dev +++ b/env/.env.dev @@ -8,9 +8,9 @@ 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.2.122:28080' # 梁超 +VITE_proxyTarget = 'http://192.168.2.122:28080' # 梁超 # VITE_proxyTarget = 'http://36.33.26.201:17788/proxyApi' # 测试服务 -VITE_proxyTarget = 'http://192.168.0.244:28580' # 测试服务 +# VITE_proxyTarget = 'http://192.168.0.244:28580' # 测试服务 # VITE_proxyTarget = 'http://192.168.2.75:28080' # 盛旭 # VITE_proxyTarget = 'http://10.40.92.185:9206' # 赵福海 ( 设备类型) diff --git a/src/App.vue b/src/App.vue index 037fc4f..9de85b6 100644 --- a/src/App.vue +++ b/src/App.vue @@ -7,8 +7,11 @@ onMounted(async () => { console.log(origin.split('ticket=')[1], 'origin') if (origin.indexOf('ticket') != -1) { - console.log('origin.split爱玩送ticket') - const res = await loginNewApi({ ticket: origin.split('ticket=')[1],sysType:0 }) + // console.log('origin.split爱玩送ticket') + const res = await loginNewApi({ + ticket: origin.split('ticket=')[1].split('#/')[0], + sysType: 0, + }) console.log(res, '登录结果') } }) diff --git a/src/layout/header.vue b/src/layout/header.vue index be52767..525b676 100644 --- a/src/layout/header.vue +++ b/src/layout/header.vue @@ -253,7 +253,12 @@ const onJumpUser = () => { if (host.indexOf('sgwpdm.ah.sgcc.com.cn') > -1) { window.open(`${host}/iws/glweb/login?token@${store.token}@`) } else { - window.open(`${host}/glweb/?token@${store.token}@`) + // window.open(`${host}/glweb/?token@${store.token}@`) + if (import.meta.env.VITE_ENV === 'production') { + window.open(`${host}/glweb/?token@${store.token}@`) + } else { + window.open(`${host}/iws/glweb/?token@${store.token}@`) + } } } else { router.push({ name: 'my-user' }) diff --git a/src/views/cart/index.vue b/src/views/cart/index.vue index 8cf18ee..6692cc5 100644 --- a/src/views/cart/index.vue +++ b/src/views/cart/index.vue @@ -367,10 +367,8 @@ const onLeaseDateChange = (value: any, companyIndex: number, goodsIndex: number) } 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[companyIndex].devInfoVoList[goodsIndex].days = + moment(value[1]).diff(value[0], 'day') + 1 } // cardList.value.forEach((e: any) => { diff --git a/src/views/equip/detail.vue b/src/views/equip/detail.vue index 67c2b59..03f639b 100644 --- a/src/views/equip/detail.vue +++ b/src/views/equip/detail.vue @@ -32,7 +32,6 @@ @@ -1200,6 +1199,7 @@ onMounted(() => { display: flex; height: 80%; justify-content: space-around; + overflow: hidden; .img-item { // width: calc((100% - 30px) / 4); diff --git a/src/views/message/index.vue b/src/views/message/index.vue index 3cb7c4c..aaa507c 100644 --- a/src/views/message/index.vue +++ b/src/views/message/index.vue @@ -136,7 +136,12 @@ const sendParams = ref({ // 消息列表 const getMessageListData = async () => { const { data: res }: any = await getMessageListApi() - messageList.value = [...new Set([...messageListAll.value, ...res])] + // messageList.value = [...new Set([...messageListAll.value, ...res])] + const uniqueMessages = [ + ...new Map([...res, ...messageListAll.value].map((item) => [item.uuid, item])).values(), + ] + + messageList.value = uniqueMessages } const getMessageListAllData = async () => { @@ -182,7 +187,7 @@ const onClickMessage = async (item: any) => { fromCompany: queryDetailsCompanyId.value, }) - console.log(res, '已读结果--') + // console.log(res, '已读结果--') getMessageInfoData(queryDetailsCompanyId.value) @@ -200,6 +205,11 @@ const onSendMessage = debounce(async () => { const res: any = await sendMessageApi(sendParams.value) if (res.code == 200) { sendParams.value.messageContent = '' + + const result: any = await messageIsReadApi({ + toCompany: myCompanyId.value, + fromCompany: queryDetailsCompanyId.value, + }) } }, 500) const errorHandler = () => true @@ -215,7 +225,6 @@ onMounted(() => { sendParams.value.toCompany = companyId sendParams.value.toCompanyName = companyName queryDetailsCompanyId.value = companyId - getMessageInfoData(queryDetailsCompanyId.value) setTimeout(() => { @@ -228,6 +237,7 @@ onMounted(() => { setTimeout(() => { messageListInterval.value = setInterval(() => { + getMessageListAllData() getMessageListData() }, 5000) }, 3000) diff --git a/src/views/order/index.vue b/src/views/order/index.vue index 510c47e..e79e69d 100644 --- a/src/views/order/index.vue +++ b/src/views/order/index.vue @@ -329,7 +329,7 @@ const onLeaseDateChange = (value: any, companyIndex: number, goodsIndex: number) } else { e.rentBeginTime = value[0] e.rentEndTime = value[1] - e.days = moment(value[1]).diff(value[0], 'day') + e.days = moment(value[1]).diff(value[0], 'day') + 1 } }) }