+
{{ cart.productInfo.storeName }}
@@ -183,7 +237,7 @@
-
+
{{ order.createTime }}
@@ -208,7 +262,7 @@
入住时间: {{ order.travelGroupOrderInfo.orderStartDate }}
-
+
等待商家确认时间,剩余
@@ -216,7 +270,27 @@
+ 联系商家
+ 去使用
+ 删除订单
+
+
{{ '申请退款' }}
+ 修改地址
-
+
{{ Number(order.status) === 0 ? '待支付' : getGiftTips(order.giftCardInfo) }}
@@ -366,6 +445,7 @@
+
+ 修改地址正在审核中,请耐心等待
+ 修改地址审核未通过,{{ order.addressUpdateReason }}
+
{
if(success.confirm) {
uni.showLoading()
- editAddress({
+ applyEditAddress({
addressId,
orderId: _this._orderId
}).then(res => {
uni.showToast({
icon: 'success',
- title: '修改成功!'
+ title: '已提交审核'
})
- uni.setStorageSync('sourceAddress', chooseAddress)
_this.changeType()
}).finally(() => {
uni.hideLoading()
@@ -572,11 +669,19 @@ export default {
_this._orderId = ''
}
})
+ } else if (needRefreshOrderList) {
+ uni.removeStorageSync('needRefreshMyOrderList')
+ this.changeType()
}
},
onLoad() {
this.type = this.type || parseInt(this.$yroute.query.type) || 0
- this.changeType(this.type)
+ this.orderTypeTabIndex = parseInt(this.$yroute.query.tabIndex) || 0
+ this.initUserLocation()
+ this.orderTypeTabChange({
+ ...this.orderTypeTabList[this.orderTypeTabIndex],
+ index: this.orderTypeTabIndex
+ })
},
onShareAppMessage() {
uni.updateShareMenu({
@@ -590,6 +695,113 @@ export default {
}
},
methods: {
+ isRefundFlow(order) {
+ if (!order) {
+ return false
+ }
+ const statusType = Number(order._status && order._status._type)
+ return statusType < 0
+ },
+ canShowModifyAddress(order) {
+ if (this.isRefundFlow(order)) {
+ return false
+ }
+ if (!order || order.isTravelGroup === 1 || order.isTickets === 1) {
+ return false
+ }
+ const type = parseInt(order._status && order._status._type)
+ if (type !== 1) {
+ return false
+ }
+ const isAddressUpdate = Number(order.isAddressUpdate || 0)
+ const addressUpdateStatus = Number(order.addressUpdateStatus || 0)
+ if (isAddressUpdate === 0) {
+ return true
+ }
+ return false
+ },
+ initUserLocation() {
+ uni.getLocation({
+ type: 'gcj02',
+ success: res => {
+ this.userLatitude = Number(res.latitude)
+ this.userLongitude = Number(res.longitude)
+ this.updateOrderDistances()
+ }
+ })
+ },
+ getOrderLocation(order) {
+ const info = order
+ const latitude = Number(info.merLatitude || 0)
+ const longitude = Number( info.merLongitude || 0)
+ if (!Number.isFinite(latitude) || !Number.isFinite(longitude) || latitude === 0 || longitude === 0) {
+ return null
+ }
+ return { latitude, longitude }
+ },
+ hasValidDistance(distance) {
+ if (distance == null) {
+ return false
+ }
+ const text = String(distance).trim().toLowerCase()
+ if (!text || text === '0' || text === '0km' || text === '0.0km') {
+ return false
+ }
+ return true
+ },
+ calculateDistance(lat1, lon1, lat2, lon2) {
+ if (!lat1 || !lon1 || !lat2 || !lon2) {
+ return ''
+ }
+ const R = 6371
+ const dLat = (lat2 - lat1) * Math.PI / 180
+ const dLon = (lon2 - lon1) * Math.PI / 180
+ const a =
+ Math.sin(dLat / 2) * Math.sin(dLat / 2) +
+ Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) *
+ Math.sin(dLon / 2) * Math.sin(dLon / 2)
+ const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))
+ const d = R * c
+ return d.toFixed(1) + 'km'
+ },
+ updateOrderDistances() {
+ if (!this.orderList.length || this.userLatitude == null || this.userLongitude == null) {
+ return
+ }
+ this.orderList = this.orderList.map(order => {
+ if (!order.experienceOrderInfo) {
+ return order
+ }
+ const oldDistance = order.distance || (order.experienceOrderInfo && order.experienceOrderInfo.distance)
+ if (this.hasValidDistance(oldDistance)) {
+ return order
+ }
+ const location = this.getOrderLocation(order)
+ if (!location) {
+ return order
+ }
+ const distance = this.calculateDistance(
+ this.userLatitude,
+ this.userLongitude,
+ location.latitude,
+ location.longitude
+ )
+ if (!distance) {
+ return order
+ }
+ const experienceOrderInfo = order.experienceOrderInfo
+ ? {
+ ...order.experienceOrderInfo,
+ distance
+ }
+ : order.experienceOrderInfo
+ return {
+ ...order,
+ distance,
+ experienceOrderInfo
+ }
+ })
+ },
handleDateSelected(dateRange) {
const params = {
@@ -674,10 +886,52 @@ export default {
})
},
goStore(order) {
- if(order.isTravelGroup === 1) {
- // uni.showToast({
- // title: '该订单为团体订单,无法查看店铺信息!'
- // })
+ if (!order) {
+ return
+ }
+
+ if (order.experienceOrderInfo) {
+ const experienceMerchantId =
+ order.merId ||
+ order.merchantId ||
+ order.hotelId ||
+ (order.experienceOrderInfo && order.experienceOrderInfo.merId) ||
+ (order.experienceOrderInfo && order.experienceOrderInfo.merchantId)
+ if (!experienceMerchantId) {
+ uni.showToast({
+ title: '未找到体验店信息',
+ icon: 'none'
+ })
+ return
+ }
+ this.$yrouter.push({
+ path: "/pkg_product/views/experienceProjectDetail",
+ query: {
+ experienceMerchantId
+ }
+ })
+ return
+ }
+ if (order.isTravelGroup === 1) {
+ const travelStoreId =
+ order.merId ||
+ order.hotelId ||
+ order.travelMerchantId ||
+ (order.travelGroupOrderInfo && order.travelGroupOrderInfo.travelMerchantId) ||
+ (order.travelGroupOrderInfo && order.travelGroupOrderInfo.travelGroupProduct && order.travelGroupOrderInfo.travelGroupProduct.travelMerchantId)
+ if (!travelStoreId) {
+ uni.showToast({
+ title: '未找到旅居店铺信息',
+ icon: 'none'
+ })
+ return
+ }
+ this.$yrouter.push({
+ path: "/pkg_product/views/sojoumStore",
+ query: {
+ id: travelStoreId
+ }
+ })
return
}
if(!order.hotelId) {
@@ -721,10 +975,16 @@ export default {
},
addressTap(order) {
this._orderId = order.orderId
+ uni.setStorageSync('updateOrderSourceAddress', {
+ id: order.addressId || order.userAddressId || '',
+ realName: order.realName || '',
+ phone: order.userPhone || '',
+ userAddress: order.userAddress || ''
+ })
this.$yrouter.push({
path: "/pages/user/address/AddressManagement/index",
query: {
- choosMode: 1
+ choosMode: 4
}
})
},
@@ -733,6 +993,17 @@ export default {
},
goRoom(order) {
console.log(order);
+ if (order.experienceOrderInfo) {
+ const phone = order.merchantPhone || order.merPhone || order.experienceOrderInfo.phone || order.companyTel;
+ if (phone) {
+ uni.makePhoneCall({
+ phoneNumber: phone
+ })
+ } else {
+ uni.showToast({ title: '暂无商家电话', icon: 'none' })
+ }
+ return
+ }
if(order.isTravelGroup === 1) {
// 拨打商家电话
uni.makePhoneCall({
@@ -785,6 +1056,15 @@ export default {
});
},
goOrderDetails(order) {
+ if (order.experienceOrderInfo) {
+ this.$yrouter.push({
+ path: "/pkg_product/views/experienceCouponOrderDetail",
+ query: {
+ orderId: order.orderId
+ }
+ });
+ return
+ }
if(order.isTravelGroup === 1) {
this.$yrouter.push({
path: "/pkg_product/views/sojoumOrderDetails",
@@ -871,7 +1151,7 @@ export default {
this.orderTypeTabIndex = item.index
this.orderType = item.orderType
this.updateTabListByOrderType()
- this.changeType()
+ this.changeType(this.type)
},
updateTabListByOrderType() {
if (this.orderType === 'travel') {
@@ -896,6 +1176,11 @@ export default {
]
}
},
+ goUserCenter() {
+ this.$yrouter.switchTab({
+ path: '/pages/user/User/index'
+ })
+ },
changeType() {
this.orderList = []
this.page = 1
@@ -935,6 +1220,7 @@ export default {
item.showMore = false;
})
}
+ this.updateOrderDistances()
this.page++;
this.loaded = res.data.length < this.limit
this.loading = false
@@ -1107,6 +1393,7 @@ page {
.title {
border-bottom: none;
+ height: 70rpx !important
}
.item-info {
@@ -1155,7 +1442,17 @@ page {
overflow: hidden;
margin: 0.7 * 100rpx auto 0.5 * 100rpx auto;
}
-
+.ssj.pictrue{
+ width: 160rpx !important;
+ height: 160rpx !important;
+ border-radius: 16rpx !important;
+}
+.my-order .list .item .item-info .text {
+ width: 448rpx !important;
+ font-size: 28rpx;
+ color: #999;
+ margin-top: 6rpx;
+}
.noCart .pictrue image {
width: 408rpx;
height: 414rpx;
@@ -1208,7 +1505,7 @@ page {
margin: 10rpx 0 0 0;
}
.my-order .list .item .item-info .text .name {
- width: calc(100% - 160rpx);
+ width: calc(100% - 120rpx);
}
.tips-text{
padding: 0 12rpx;
diff --git a/pages/order/OrderDetails/index.vue b/pages/order/OrderDetails/index.vue
index 3d30e70..1487b6b 100644
--- a/pages/order/OrderDetails/index.vue
+++ b/pages/order/OrderDetails/index.vue
@@ -35,14 +35,51 @@
剩余订单将自动取消
-
- {{ orderInfo.realName }}
- {{ orderInfo.userPhone }}
-
-
- {{ orderInfo.userAddress }}
- 修改地址
-
+
+
+ {{ orderInfo.oldRealName }}
+ {{ orderInfo.oldUserPhone }}
+ 原地址
+
+
+ {{ orderInfo.oldUserAddress }}
+
+
+
+ {{ orderInfo.realName }}
+ {{ orderInfo.userPhone }}
+ 新地址
+
+
+ {{ orderInfo.userAddress }}
+
+
+
+
+ {{ orderInfo.realName }}
+ {{ orderInfo.userPhone }}
+
+
+ {{ orderInfo.userAddress }}
+ 修改地址
+
+
+
+
+ 修改地址正在审核中,请耐心等待
+ 修改地址审核未通过,{{ orderInfo.addressUpdateReason }}
+