From 2a180c72db03f84b863f605c3e0962a0a18b7d03 Mon Sep 17 00:00:00 2001 From: YOGO <1587218160@qq.com> Date: Thu, 26 Mar 2026 09:48:28 +0800 Subject: [PATCH] =?UTF-8?q?326=E5=8F=91=E7=89=88=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Apis/order.js | 7 + App.vue | 2 +- .../components/uv-picker/uv-picker.vue | 4 +- pages/index/index.vue | 49 +++--- pages/unlock/index.vue | 157 +++++++++++++++--- static/home/close2.svg | 11 ++ 6 files changed, 185 insertions(+), 45 deletions(-) create mode 100644 static/home/close2.svg diff --git a/Apis/order.js b/Apis/order.js index 513c15c..3168bc7 100644 --- a/Apis/order.js +++ b/Apis/order.js @@ -167,6 +167,13 @@ export function useOrderApi() { method: 'get', data }); + }, + GetCancelOrder: (data) => { + return request.request({ + url: '/ClientOrder/GetCancelOrder', + method: 'get', + data + }) } } } \ No newline at end of file diff --git a/App.vue b/App.vue index 8ed9f82..cf377ab 100644 --- a/App.vue +++ b/App.vue @@ -85,7 +85,7 @@ export default { this.globalData.navbarHeight = (barHeight || 40) + statusBarHeight; this.globalData.statusBarHeight = statusBarHeight || 20; // #endif - // authCode 存在 就直接登陆 + // authCode url 存在 就直接登陆 const authCode = getQueryParam('authCode'); if(authCode){ let source = window.sf.isSfApp() ? 2 : 1; diff --git a/components/uv-pickerself/components/uv-picker/uv-picker.vue b/components/uv-pickerself/components/uv-picker/uv-picker.vue index b300987..163ca39 100644 --- a/components/uv-pickerself/components/uv-picker/uv-picker.vue +++ b/components/uv-pickerself/components/uv-picker/uv-picker.vue @@ -8,7 +8,7 @@ > - {{ title }} + {{ title }} + + 详情 + 取消退仓申请 + }" color="#FB322E" plain shape="circle" @click="cancelMoveOutRqt(item)">取消退仓申请 {{ $t("unlock.details") }} {{ $t("unlock.details") }} - + + 取消订单 取消订单 + }" color="#FB322E" @click="handlePay(item)">去支付 + 详情 @@ -153,6 +162,7 @@ ? `(${$t("unlock.overdue")})` : '' }} + @@ -171,20 +181,30 @@ - {{ $t("detail.deposit") }}: + 租金月费: + {{ currency }} {{ state.orderData.discountData?.[0]?.unitPrice }} + + + + 租期优惠: + {{ state.orderData.discountData?.[0]?.month }}个月长租(-{{ currency }} {{ state.orderData.discountData?.[0]?.leaseDiscount }}) + + + + 订单押金: {{ currency }} {{ state.orderData.deposit }} - + - {{ $t("detail.total") }}: + 租金总价: {{ currency }} {{ state.orderData.actualPay }} - {{ $t("unlock.moveout") }} @@ -229,7 +249,7 @@ {{ lockPwd }}# - 输入密码即可开锁或一键开锁 + 输入密码即可开锁{{ [3, 7].includes(Number(state.selectItem?.lockTypeId)) ? "或一键开锁" : "" }} - {{ $t("unlock.confirmOut") }} + 取消订单 @@ -567,6 +587,7 @@ const state = ref({ selfMonth: 1, refundLoading: false, current:0, + cancelOrderList:[], }); const list = [{ name: '在租', @@ -580,7 +601,7 @@ const currentOrderList = computed(() => { const isType1 = (item) => !(item.orderStartStatus == 2 && item.refundLockerStatus === 0) - && item.refundLockerStatus === 4 + && (item.refundLockerStatus === 2) const isType2 = (item) => item.orderStatus == 2 @@ -593,7 +614,7 @@ const currentOrderList = computed(() => { } if (state.value.current == 1) { - return state.value.orderList.filter(isType1) + return state.value.orderList.filter(isType1).concat(state.value.cancelOrderList) } if (state.value.current == 2) { @@ -612,6 +633,9 @@ const showImage = (url) => { const handleChange = (e) => { state.value.current = e.index GetOrderList() + if(state.value.current == 1){ + GetCancelOrder() + } } const copyOrderOn = (item) => { @@ -627,6 +651,74 @@ const copyOrderOn = (item) => { }); } +const handlePay = (item) => { + uni.showLoading({ + 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; + if (!path.endsWith('/')) { + path = path + '/'; + } + const returnUrl = `${window.location.origin}${path}#/pages/unlock/index`; + if (window.sf.isSfApp()) { + window.sf.goPay({ + partnerId: res.data.partnerId, //商户id + prepayId: res.data.package, // 预支付id + nonceStr: res.data.nonceStr, //随机字符串 + timeStamp: res.data.timeStamp, //时间戳 + sign: res.data.paySign, //签名 + package: `prepay_id=${res.data.package}`, + payChannel: 'payByWeChat' // app微信支付 + }).then(res => { + const { channelType, status, message, channelResult } = res && res.result || {} + if (status === 0) { + uni.showToast({ + title: '支付成功', + icon: 'none', + duration: 3000 + }) + hidePayPopup(); + state.value.current = 0; + GetOrderList(); + } else { + uni.showToast({ + title: '支付失败', + icon: 'none', + duration: 3000 + }) + } + }).catch(err => console.log(err)) + } else { + uni.showLoading({ + title: '支付中', + mask: true + }) + window.sf.goPay({ + timeStamp: res.data.timeStamp, // 从服务器获取的时间戳 + nonceStr: res.data.nonceStr, // 从服务器获取的随机字符串 + package: `prepay_id=${res.data.package}`, // 从服务器获取的预支付交易会话标识 + signType: res.data.signType, // 签名方式 + paySign: res.data.paySign, // 从服务器获取的签名 + successUrl: returnUrl, + failUrl: returnUrl + }).then(res => { }).catch(err => console.log(err)) + } + + } else { + } + }); +} + + const goOrder = async () => { if (!state.value.selectItem?.orderId) { @@ -741,7 +833,9 @@ const cancelOrder = () => { uni.hideLoading() if (res.code === 200) { closeCancelOrder(); + state.value.current = 1 GetOrderList(); + GetCancelOrder() } else { uni.showToast({ title: res.msg, @@ -1009,7 +1103,6 @@ const QRCode = ref('') const ifShow = ref(false) // 获取二维码 function GetQRCode() { - ifShow.value = false uni.showLoading({ mask: true }) getLockApi.GetAccesscontrolQRCodeBySite({ siteId: state.value.selectItem.siteId, orderId: state.value.selectItem.orderId }).then(res => { if (res.code === 200) { @@ -1031,6 +1124,16 @@ const GetOrderById = () => { } }) } +const GetCancelOrder = () => { + uni.showLoading() + getApi.GetCancelOrder().then(res => { + state.value.cancelOrderList = [] + if (res.code === 200) { + state.value.cancelOrderList = res.data + } + uni.hideLoading(); + }) +} const GetOrderList = () => { uni.showLoading() @@ -1052,10 +1155,12 @@ onShareAppMessage((res) => { } return shareParam; }); -onLoad(() => { - // GetOrderList() - +onLoad((params) => { + // GetOrderList()unpaid + if (params?.type == "unpaid") { + state.value.current = 2 + } }) onHide(() => { @@ -1078,6 +1183,9 @@ onShow(() => { token.value = uni.getStorageSync('token') onShowRerequestByIsLogin(() => { GetOrderList(); + if(state.value.current === 2){ + GetCancelOrder() + } }, (err) => { state.value.orderList = [] }) @@ -1531,8 +1639,12 @@ onShow(() => { line-height: 60rpx; color: #6f6f6f; font-weight: bold; - border-width: 1px !important; + // border-color: #A8AAAC !important; + border-width: 1.5px !important; } + :deep(.uv-button--info){ + border-color: #A8AAAC !important; + } } } @@ -1686,7 +1798,10 @@ onShow(() => { line-height: 60rpx; color: #6f6f6f; font-weight: bold; - border-width: 1px !important; + border-width: 1.5px !important; + } + :deep(.uv-button--info){ + border-color: #A8AAAC !important; } } } diff --git a/static/home/close2.svg b/static/home/close2.svg new file mode 100644 index 0000000..0aef4d4 --- /dev/null +++ b/static/home/close2.svg @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file