fix:修复bug
This commit is contained in:
+246
-34
@@ -48,9 +48,10 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="fee-rule">
|
||||
{{ feeRuleText }}
|
||||
</view> -->
|
||||
<!-- 计费规则图片 -->
|
||||
<view class="fee-rule-image">
|
||||
<image :src="getFeeRuleImageUrl()" mode="widthFix" class="rule-image"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 租借信息卡片 -->
|
||||
@@ -209,6 +210,27 @@
|
||||
</view>
|
||||
</view>
|
||||
</uv-popup>
|
||||
|
||||
<!-- 归还地图弹窗 -->
|
||||
<view class="return-map-popup" v-if="showReturnMapPopup" @click.self="closeReturnMapPopup">
|
||||
<view class="popup-mask"></view>
|
||||
<view class="popup-content">
|
||||
<view class="popup-header">
|
||||
<text class="popup-title">{{ $t('order.returnLocationMap') }}</text>
|
||||
<view class="close-btn" @click="closeReturnMapPopup">
|
||||
<text class="close-icon">×</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup-body">
|
||||
<image :src="returnMapImageUrl" mode="widthFix" class="map-image"></image>
|
||||
</view>
|
||||
<view class="popup-footer">
|
||||
<view class="save-btn" @click="saveReturnMapImage">
|
||||
{{ $t('common.saveImage') }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -288,7 +310,8 @@
|
||||
userPurchaseId: '',
|
||||
discountTypeName: '',
|
||||
originalFee:'',
|
||||
discountAmount:''
|
||||
discountAmount:'',
|
||||
returnMapImage: ''
|
||||
})
|
||||
const timer = ref(null)
|
||||
const statusCheckTimer = ref(null)
|
||||
@@ -303,6 +326,8 @@
|
||||
const countdownTimer = ref(null)
|
||||
const feeRuleText = ref('')
|
||||
const convertToOwnPopup = ref(null)
|
||||
const showReturnMapPopup = ref(false)
|
||||
const returnMapImageUrl = ref('')
|
||||
|
||||
// 计算属性:是否显示优惠券/会员卡可用提示
|
||||
const canUsePromotionTag = computed(() => {
|
||||
@@ -400,14 +425,86 @@
|
||||
// 联系客服
|
||||
const contactService = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/help/index'
|
||||
url: '/subPackages/service/help/index'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取计费规则图片URL
|
||||
const getFeeRuleImageUrl = () => {
|
||||
const locale = instance?.proxy?.$i18n?.locale || 'en_US'
|
||||
// 如果是中文环境,显示中文图片,否则显示英文图片
|
||||
if (locale === 'zh_CN' || locale === 'zh-CN' || locale === 'zh') {
|
||||
return 'https://static.fdzpower.com/order_notice/notice_CN.png'
|
||||
}
|
||||
return 'https://static.fdzpower.com/order_notice/notice_EN.png'
|
||||
}
|
||||
|
||||
// 快速归还
|
||||
const quickReturn = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/search/index'
|
||||
// 检查是否有 returnMapImage 字段
|
||||
console.log(orderInfo.value.returnMapImage);
|
||||
|
||||
if (orderInfo.value.returnMapImage) {
|
||||
// 有值则弹窗显示图片
|
||||
returnMapImageUrl.value = orderInfo.value.returnMapImage
|
||||
showReturnMapPopup.value = true
|
||||
} else {
|
||||
// 没有值则继续执行跳转流程
|
||||
uni.navigateTo({
|
||||
url: '/pages/search/index'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 关闭归还地图弹窗
|
||||
const closeReturnMapPopup = () => {
|
||||
showReturnMapPopup.value = false
|
||||
}
|
||||
|
||||
// 保存归还地图图片
|
||||
const saveReturnMapImage = () => {
|
||||
uni.showLoading({
|
||||
title: t('common.saving')
|
||||
})
|
||||
|
||||
uni.downloadFile({
|
||||
url: returnMapImageUrl.value,
|
||||
success: (res) => {
|
||||
if (res.statusCode === 200) {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: res.tempFilePath,
|
||||
success: () => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: t('common.saveSuccess'),
|
||||
icon: 'success'
|
||||
})
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.hideLoading()
|
||||
console.error('保存图片失败:', err)
|
||||
uni.showToast({
|
||||
title: t('common.saveFailed'),
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: t('common.downloadFailed'),
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.hideLoading()
|
||||
console.error('下载图片失败:', err)
|
||||
uni.showToast({
|
||||
title: t('common.downloadFailed'),
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -781,6 +878,7 @@
|
||||
orderInfo.value.userPurchaseId = orderData.userPurchaseId || ''
|
||||
orderInfo.value.discountTypeName = orderData.discountTypeName || ''
|
||||
orderInfo.value.originalFee = orderData.originalFee||''
|
||||
orderInfo.value.returnMapImage = orderData.returnMapImage||''
|
||||
|
||||
// 保存快递归还开始时间(小时为单位)
|
||||
orderInfo.value.expressReturnStart = orderData.expressReturnStart || null
|
||||
@@ -997,37 +1095,40 @@
|
||||
|
||||
// 申请退款
|
||||
const handleWithdraw = async () => {
|
||||
try {
|
||||
uni.showLoading({
|
||||
title: t('common.processing')
|
||||
})
|
||||
uni.navigateTo({
|
||||
url:'/subPackages/service/feedback/index'
|
||||
})
|
||||
// try {
|
||||
// uni.showLoading({
|
||||
// title: t('common.processing')
|
||||
// })
|
||||
|
||||
const res = await withdrawDeposit(orderInfo.value.orderNo)
|
||||
// const res = await withdrawDeposit(orderInfo.value.orderNo)
|
||||
|
||||
if (res && res.code === 200) {
|
||||
uni.showToast({
|
||||
title: t('order.refundSuccess'),
|
||||
icon: 'success'
|
||||
})
|
||||
// if (res && res.code === 200) {
|
||||
// uni.showToast({
|
||||
// title: t('order.refundSuccess'),
|
||||
// icon: 'success'
|
||||
// })
|
||||
|
||||
orderInfo.value.withdrawStatus = 'processing'
|
||||
orderInfo.value.isWithdrawn = true
|
||||
// orderInfo.value.withdrawStatus = 'processing'
|
||||
// orderInfo.value.isWithdrawn = true
|
||||
|
||||
setTimeout(() => {
|
||||
getOrderDetails()
|
||||
}, 1500)
|
||||
} else {
|
||||
throw new Error(res?.msg || t('order.refundFailed'))
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('退款申请失败:', error)
|
||||
uni.showToast({
|
||||
title: error.message || t('order.refundFailed'),
|
||||
icon: 'none'
|
||||
})
|
||||
} finally {
|
||||
uni.hideLoading()
|
||||
}
|
||||
// setTimeout(() => {
|
||||
// getOrderDetails()
|
||||
// }, 1500)
|
||||
// } else {
|
||||
// throw new Error(res?.msg || t('order.refundFailed'))
|
||||
// }
|
||||
// } catch (error) {
|
||||
// console.error('退款申请失败:', error)
|
||||
// uni.showToast({
|
||||
// title: error.message || t('order.refundFailed'),
|
||||
// icon: 'none'
|
||||
// })
|
||||
// } finally {
|
||||
// uni.hideLoading()
|
||||
// }
|
||||
}
|
||||
|
||||
// 返回首页
|
||||
@@ -1381,6 +1482,18 @@
|
||||
color: #4CAF50;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.fee-rule-image {
|
||||
margin-top: 20rpx;
|
||||
width: 100%;
|
||||
|
||||
.rule-image {
|
||||
// height: 100%;
|
||||
width: 100%;
|
||||
display: block;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 转为自用提示
|
||||
@@ -1655,4 +1768,103 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 归还地图弹窗样式 */
|
||||
.return-map-popup {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 9999;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.popup-mask {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
|
||||
.popup-content {
|
||||
position: relative;
|
||||
width: 90%;
|
||||
max-width: 600rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 24rpx;
|
||||
overflow: hidden;
|
||||
z-index: 10000;
|
||||
|
||||
.popup-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
|
||||
.popup-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.close-btn {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
background: #f5f5f5;
|
||||
|
||||
.close-icon {
|
||||
font-size: 40rpx;
|
||||
color: #666;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
&:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.popup-body {
|
||||
padding: 30rpx;
|
||||
max-height: 60vh;
|
||||
overflow-y: auto;
|
||||
|
||||
.map-image {
|
||||
width: 100%;
|
||||
display: block;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.popup-footer {
|
||||
padding: 20rpx 30rpx 30rpx;
|
||||
|
||||
.save-btn {
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
background: linear-gradient(135deg, #07c160, #10d673);
|
||||
border-radius: 44rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
|
||||
&:active {
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user