fix:多平台兼容
This commit is contained in:
+8
-178
@@ -211,26 +211,6 @@
|
||||
</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" lazy-load="true"></image>
|
||||
</view>
|
||||
<view class="popup-footer">
|
||||
<view class="save-btn" @click="saveReturnMapImage">
|
||||
{{ $t('common.saveImage') }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -327,8 +307,6 @@
|
||||
const countdownTimer = ref(null)
|
||||
const feeRuleText = ref('')
|
||||
const convertToOwnPopup = ref(null)
|
||||
const showReturnMapPopup = ref(false)
|
||||
const returnMapImageUrl = ref('')
|
||||
const lastDeviceEjectTime = ref(0) // 上次点击"宝未弹出"的时间戳
|
||||
|
||||
// 计算属性:是否显示优惠券/会员卡可用提示
|
||||
@@ -444,72 +422,22 @@
|
||||
// 快速归还
|
||||
const quickReturn = () => {
|
||||
// 检查是否有 returnMapImage 字段
|
||||
console.log(orderInfo.value.returnMapImage);
|
||||
|
||||
console.log(orderInfo.value.returnMapImage)
|
||||
|
||||
if (orderInfo.value.returnMapImage) {
|
||||
// 有值则弹窗显示图片
|
||||
returnMapImageUrl.value = orderInfo.value.returnMapImage
|
||||
showReturnMapPopup.value = true
|
||||
// 有值则跳转到新的地图页查看大图(支持放大)
|
||||
const encodedUrl = encodeURIComponent(orderInfo.value.returnMapImage)
|
||||
uni.navigateTo({
|
||||
url: `/subPackages/order/return-map?imageUrl=${encodedUrl}`
|
||||
})
|
||||
} 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'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 再次租借
|
||||
const rentAgain = () => {
|
||||
uni.reLaunch({
|
||||
@@ -1830,102 +1758,4 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* 归还地图弹窗样式 */
|
||||
.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