From c4629781dad70d6bf968b4984498c2c9c346e61c Mon Sep 17 00:00:00 2001 From: YOGO <1587218160@qq.com> Date: Thu, 26 Mar 2026 16:25:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/myModal.vue | 4 +- locale/zh-Hans.json | 2 +- pages/index/index.vue | 91 ++++++++++-------- pages/unlock/index.vue | 204 +++++++++++++++++++++++------------------ 4 files changed, 172 insertions(+), 129 deletions(-) diff --git a/components/myModal.vue b/components/myModal.vue index 8df7b1b..781f949 100644 --- a/components/myModal.vue +++ b/components/myModal.vue @@ -1,6 +1,6 @@ @@ -385,8 +389,8 @@ import { ref, computed, nextTick, watch } from "vue"; import { onTabItemTap, getDistance, makePhoneCall, mergeFiveGoatStores, parseUrlParams } from "/utils/common.js"; import myCustomtTabBar from "@/components/myCustomtTabBar.vue"; -import wxNavbar from "@/components/wxNavbar.vue"; -import siteDetail from '@/components/siteDetail.vue'; +// import wxNavbar from "@/components/wxNavbar.vue"; +// import siteDetail from '@/components/siteDetail.vue'; import { onLoad, onShow, onShareAppMessage, onUnload } from "@dcloudio/uni-app"; import { baseImageUrl, projectInfo, isKingKong, setOrderDays } from "@/config/index.js"; import { useLoginApi } from "/Apis/home.js"; @@ -395,6 +399,7 @@ import { navigateTo } from '@/utils/navigateTo'; // 主题色配置 import { useMainStore } from "@/store/index.js"; import { navbarHeightAndStatusBarHeight, shareParam } from "@/utils/common.js"; +import myModal from "@/components/myModal.vue"; import { couponApi } from "@/Apis/coupon.js"; import { useLocation } from "@/hooks/useLocation"; import { useLoginApi as useLoginApi2 } from "@/Apis/login"; @@ -459,6 +464,8 @@ const state = ref({ zhuangxiuzhong: false, priceData: {}, hasVerify: false, + showhasOrderModal:false, + showhasunpaidOrderModal:false, }); const goOrder = async () => { @@ -559,11 +566,12 @@ const goOrder = async () => { } else { if(res.code === 206){ reset(); - uni.showToast({ - title: '仓位已出租,请重新选择其他仓位!', - icon: 'none', - duration: 5000 - }) + // uni.showToast({ + // title: '仓位已出租,请重新选择其他仓位!', + // icon: 'none', + // duration: 5000 + // }) + state.value.showhasOrderModal = true; // uni.showModal({ // title: t('common.title'), @@ -575,21 +583,18 @@ const goOrder = async () => { // }) } if (res.code === 1001) { - uni.showToast({ - title: t('common.unpaidOrderTips'), - icon: 'none', - duration: 5000 - }) - setTimeout(() => { - uni.switchTab({ - url: '/pages/unlock/index?type=unpaid', - }) - },3000) + state.value.showhasunpaidOrderModal = true; return } } }); } +const unpaidOrder = async () => { + getApp().globalData.tabParams = { type: 'unpaid' } + uni.switchTab({ + url: '/pages/unlock/index', + }) +} const reset = () => { state.value.lockerId = null; state.value.priceData = {}; @@ -774,6 +779,7 @@ const goSite = () => { }); }; const goUnlock = () => { + getApp().globalData.tabParams = { type: 'paid' } uni.navigateTo({ url: "/pages/unlock/index", }); @@ -787,7 +793,7 @@ const getLockerBySiteId = () => { mask: true }) getSiteApi - .GetLockerBySiteId({ siteId: state.value.siteId, unitTypeId: state.value.unitTypeId }) + .GetLockerBySiteId({ siteId: state.value.siteId, unitTypeId: state.value.unitTypeId,month: state.value.month }) .then((res) => { if (res.code == 200) { LockerList.value = res.data; @@ -924,22 +930,24 @@ const getLockerById = () => { // res.data == null 找不到订单 isPlaceOrder 等于订单不可以租用 if (!res.data || !res.data?.isPlaceOrder) { // 支付回调 会触发onshow 这个会优先出来 所有 支付成功就不弹窗 会有一个支付成功的弹窗显示 - uni.showModal({ - title: t("common.title"), - content: t("common.cantUselocker"), - showCancel: false, - success: function () { - reset(); - }, - }); + state.value.showhasOrderModal = true + reset(); + // uni.showModal({ + // title: t("common.title"), + // content: t("common.cantUselocker"), + // showCancel: false, + // success: function () { + // reset(); + // }, + // }); uni.hideLoading(); return; } getLockerExpense(); } else { - uni.reLaunch({ - url: "/pages/index/index", - }); + // uni.reLaunch({ + // url: "/pages/index/index", + // }); } }).finally(() => { uni.hideLoading(); @@ -1252,12 +1260,13 @@ function changeMove(event) { .agreement-top { display: flex; justify-content: space-between; - padding: 20rpx 30rpx; + padding: 20rpx 0rpx; margin-bottom: 20rpx; font-size:36rpx; font-weight: 600; .name { - font-size: 32rpx; + font-size: 40rpx; + font-weight: 600; } } @@ -1302,10 +1311,13 @@ function changeMove(event) { .check-wrap { pointer-events: none; - margin-right: 10rpx; + margin-right: 8rpx; :deep(.uv-radio-group){ flex-direction: column-reverse; } + :deep(.uv-radio__label-wrap){ + display: none; + } // min-width: 40rpx; // height: 40rpx; // border: 6rpx solid #242a37; @@ -1336,7 +1348,10 @@ function changeMove(event) { .check-wrap { display: flex; align-items: center; - margin-right: 10rpx; + margin-right: 8rpx; + :deep(.uv-radio__label-wrap){ + display: none; + } // :deep(.uv-radio){ // zoom: 1.0; // } diff --git a/pages/unlock/index.vue b/pages/unlock/index.vue index 0975dd7..cd33783 100644 --- a/pages/unlock/index.vue +++ b/pages/unlock/index.vue @@ -1,7 +1,8 @@ - + @@ -182,12 +181,15 @@ 租金月费: - {{ currency }} {{ state.orderData.discountData?.[0]?.unitPrice }} + {{ currency }} {{ + state.orderData.discountData?.[0]?.unitPrice + }} 租期优惠: - {{ state.orderData.discountData?.[0]?.month }}个月长租(-{{ currency }} {{ state.orderData.discountData?.[0]?.leaseDiscount }}) + {{ state.orderData.discountData?.[0]?.month }}个月长租(-{{ + currency }} {{ state.orderData.discountData?.[0]?.leaseDiscount }}) @@ -249,7 +251,9 @@ {{ lockPwd }}# - 输入密码即可开锁{{ [3, 7].includes(Number(state.selectItem?.lockTypeId)) ? "或一键开锁" : "" }} + 输入密码即可开锁{{ [3, 7].includes(Number(state.selectItem?.lockTypeId)) ? + "或一键开锁" : + "" }} 取消 - - + + 一键开锁 @@ -330,14 +336,21 @@ 优惠信息 -¥ {{ state.priceData.favorable }} - - 租期优惠({{state.month}}个月长租)-¥ {{ state.priceData.leaseDiscount }} + + 租期优惠({{ state.month }}个月长租)-¥ {{ + state.priceData.leaseDiscount + }} - {{ state.priceData.expense ? `¥${state.priceData.expense}` - :'--'}} - ¥{{ state.priceData.leaseOriginalPrice }} + + {{ + state.priceData.expense ? `¥${state.priceData.expense}` + : '--' }} + ¥{{ state.priceData.leaseOriginalPrice }} - + {{ $t("unlock.moveoutReminder") }} @@ -482,8 +495,8 @@ - + {{ $t("unlock.moveoutReminder") }} @@ -502,12 +515,12 @@ - + {{ $t("common.cancelOrder") }} - {{ $t("common.cancelOrderTips") }} + {{ $t("common.cancelOrderTips") }} @@ -586,8 +599,8 @@ const state = ref({ month: 24, selfMonth: 1, refundLoading: false, - current:0, - cancelOrderList:[], + current: 0, + cancelOrderList: [], }); const list = [{ name: '在租', @@ -599,11 +612,11 @@ const list = [{ ] const currentOrderList = computed(() => { - const isType1 = (item) => - !(item.orderStartStatus == 2 && item.refundLockerStatus === 0) + const isType1 = (item) => + !(item.orderStartStatus == 2 && item.refundLockerStatus === 0) && (item.refundLockerStatus === 2) - const isType2 = (item) => + const isType2 = (item) => item.orderStatus == 2 if (state.value.current == 0) { @@ -633,7 +646,7 @@ const showImage = (url) => { const handleChange = (e) => { state.value.current = e.index GetOrderList() - if(state.value.current == 1){ + if (state.value.current == 1) { GetCancelOrder() } } @@ -656,15 +669,15 @@ const handlePay = (item) => { mask: true, }); let source = window.sf.isSfApp() ? 2 : 1; - getApi - .ContinueOrderPay({ - orderId:item.orderId, - source - }) - .then((res) => { - uni.hideLoading(); - if (res.code === 200) { - let path = window.location.pathname; + getApi + .ContinueOrderPay({ + orderId: item.orderId, + source + }) + .then((res) => { + uni.hideLoading(); + if (res.code === 200) { + let path = window.location.pathname; if (!path.endsWith('/')) { path = path + '/'; } @@ -712,10 +725,10 @@ const handlePay = (item) => { failUrl: returnUrl }).then(res => { }).catch(err => console.log(err)) } - - } else { - } - }); + + } else { + } + }); } @@ -819,10 +832,10 @@ const goOrder = async () => { const openCancelOrder = (item) => { state.value.selectItem = item; - cancelOrderPopupRef.value.open(); + cancelOrderPopupRef.value.open(); } const closeCancelOrder = () => { - cancelOrderPopupRef.value.close(); + cancelOrderPopupRef.value.close(); } const cancelOrder = () => { @@ -833,7 +846,7 @@ const cancelOrder = () => { uni.hideLoading() if (res.code === 200) { closeCancelOrder(); - state.value.current = 1 + state.value.current = 1 GetOrderList(); GetCancelOrder() } else { @@ -1057,26 +1070,26 @@ const cancelMoveOutRqt = (item) => { // 获取锁的密码 function RemoteOpen() { - uni.showLoading({mask:true}) - getLockApi.RemoteOpen({ lockMac: state.value.selectItem.lockMac,input: '',siteId:state.value.selectItem.siteId }).then(res => { - state.tryPWDCount++ - if(res.data.isSuccess) { - uni.showToast({ - title:t('door.UnlockSuccessful'), - duration:3000, - icon:'none' - }) - uni.hideLoading() - } else { - uni.hideLoading() - uni.showToast({ - title:res.data.message, - duration:3000, - icon:'none' - }) - - } - }) + uni.showLoading({ mask: true }) + getLockApi.RemoteOpen({ lockMac: state.value.selectItem.lockMac, input: '', siteId: state.value.selectItem.siteId }).then(res => { + state.tryPWDCount++ + if (res.data.isSuccess) { + uni.showToast({ + title: t('door.UnlockSuccessful'), + duration: 3000, + icon: 'none' + }) + uni.hideLoading() + } else { + uni.hideLoading() + uni.showToast({ + title: res.data.message, + duration: 3000, + icon: 'none' + }) + + } + }) } const lockPwd = ref('') // 获取锁的密码 @@ -1127,7 +1140,7 @@ const GetOrderById = () => { const GetCancelOrder = () => { uni.showLoading() getApi.GetCancelOrder().then(res => { - state.value.cancelOrderList = [] + state.value.cancelOrderList = [] if (res.code === 200) { state.value.cancelOrderList = res.data } @@ -1158,9 +1171,6 @@ onShareAppMessage((res) => { onLoad((params) => { // GetOrderList()unpaid - if (params?.type == "unpaid") { - state.value.current = 2 - } }) onHide(() => { @@ -1181,9 +1191,22 @@ const token = ref(uni.getStorageSync('token')) onShow(() => { uni.hideTabBar() token.value = uni.getStorageSync('token') + + const app = getApp() + const type = app.globalData?.tabParams?.type + + if (type === "unpaid") { + state.value.current = 2 + } else if (type === "paid") { + state.value.current = 0 + } + + if (type) { + app.globalData.tabParams = {} + } onShowRerequestByIsLogin(() => { GetOrderList(); - if(state.value.current === 2){ + if (state.value.current === 2) { GetCancelOrder() } }, (err) => { @@ -1338,11 +1361,12 @@ onShow(() => { display: flex; align-items: center; font-size: 38rpx; - .price { - &.overMaxFont{ - font-size: 32rpx; + + .price { + &.overMaxFont { + font-size: 32rpx; + } } - } .detail { display: flex; @@ -1350,9 +1374,11 @@ onShow(() => { margin-left: 20rpx; color: #FFFFFF; font-size: 28rpx; - .overMaxFont{ + + .overMaxFont { font-size: 24rpx; } + image { margin-left: 10rpx; } @@ -1642,9 +1668,10 @@ onShow(() => { // border-color: #A8AAAC !important; border-width: 1.5px !important; } - :deep(.uv-button--info){ - border-color: #A8AAAC !important; - } + + :deep(.uv-button--info) { + border-color: #A8AAAC !important; + } } } @@ -1800,7 +1827,8 @@ onShow(() => { font-weight: bold; border-width: 1.5px !important; } - :deep(.uv-button--info){ + + :deep(.uv-button--info) { border-color: #A8AAAC !important; } }