|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <view class="container">
|
|
|
+ <view class="container" v-if="orderInfo">
|
|
|
<!-- 顶部订单状态信息区域 -->
|
|
|
<view class="header">
|
|
|
<!-- 背景图片区域 -->
|
|
|
@@ -9,27 +9,17 @@
|
|
|
<!-- 返回图标区域 -->
|
|
|
<img class="header_icon" src="../../static/index/left.png" @click="handleBack" />
|
|
|
|
|
|
- <view class="header_type">已支付</view>
|
|
|
- <view class="header_info">订单号:2307311449380724</view>
|
|
|
-
|
|
|
- <view class="header_type" v-if="type === '1'">代付款</view>
|
|
|
- <view class="header_info" v-if="type === '1'">超时后,订单将会自动取消</view>
|
|
|
- <view class="header_type" v-if="type === '2'">支付超时</view>
|
|
|
- <view class="header_info" v-if="type === '2'">订单已超过可支付时间,请重新下单</view>
|
|
|
- <view class="header_type" v-if="type === '3'">已支付</view>
|
|
|
- <view class="header_info" v-if="type === '3'">订单已支付,请等待商家接单</view>
|
|
|
- <view class="header_type" v-if="type === '4'">已取消</view>
|
|
|
- <view class="header_info" v-if="type === '4'">订单已取消,请重新下单</view>
|
|
|
- <view class="header_type" v-if="type === '5'">已退单</view>
|
|
|
- <view class="header_info" v-if="type === '5'">订单已被商家退单,请重新下单</view>
|
|
|
- <view class="header_type" v-if="type === '6'">待入住</view>
|
|
|
- <view class="header_info" v-if="type === '6'">订单已被商家接单,请前往办理入住</view>
|
|
|
- <view class="header_type" v-if="type === '7'">已入住</view>
|
|
|
- <view class="header_info" v-if="type === '7'">订单已办理入住</view>
|
|
|
- <view class="header_type" v-if="type === '8'">已退款</view>
|
|
|
- <view class="header_info" v-if="type === '8'">订单已退款</view>
|
|
|
- <view class="header_type" v-if="type === '9'">已消费</view>
|
|
|
- <view class="header_info" v-if="type === '9'">您的订单已消费,期待您再次预定哦</view>
|
|
|
+ <view class="header_type" v-if="orderInfo.orderStatus === '1'">待支付</view>
|
|
|
+ <view class="header_type" v-if="orderInfo.orderStatus === '2'">已支付</view>
|
|
|
+ <view class="header_type" v-if="orderInfo.orderStatus === '3'">待入住</view>
|
|
|
+ <view class="header_type" v-if="orderInfo.orderStatus === '4'">已入住</view>
|
|
|
+ <view class="header_type" v-if="orderInfo.orderStatus === '5'">已消费</view>
|
|
|
+ <view class="header_type" v-if="orderInfo.orderStatus === '6'">支付超时</view>
|
|
|
+ <view class="header_type" v-if="orderInfo.orderStatus === '7'">已取消</view>
|
|
|
+ <view class="header_type" v-if="orderInfo.orderStatus === '8'">已退单</view>
|
|
|
+ <view class="header_type" v-if="orderInfo.orderStatus === '9'">已退款</view>
|
|
|
+ <view class="header_type" v-if="orderInfo.orderStatus === '10'">退款中</view>
|
|
|
+ <view class="header_info">订单号:{{ orderInfo.orderNum }}</view>
|
|
|
</view>
|
|
|
|
|
|
<!-- 主体内容区域 -->
|
|
|
@@ -37,32 +27,30 @@
|
|
|
<!-- 房型信息和用户信息区域 -->
|
|
|
<view class="body_box2">
|
|
|
<view class="info_time">
|
|
|
- 7月26日
|
|
|
- <text class="gap">今天</text>
|
|
|
+ {{ getTime((orderInfo.orderStartTime || '').slice(0, 19)) }}
|
|
|
+ <text class="gap">{{ getWeek((orderInfo.orderStartTime || '').slice(0, 19)) }}</text>
|
|
|
<view class="time_line"></view>
|
|
|
- <view class="time_num">1晚</view>
|
|
|
+ <view class="time_num">{{ orderInfo.orderLiveTime }}</view>
|
|
|
<view class="time_line"></view>
|
|
|
- <view class="gap">7月26日</view>
|
|
|
- <text>明天</text>
|
|
|
+ <view class="gap">{{ getTime((orderInfo.orderEndTime || '').slice(0, 19)) }}</view>
|
|
|
+ <text>{{ getWeek((orderInfo.orderEndTime || '').slice(0, 19)) }}</text>
|
|
|
</view>
|
|
|
- <view class="info_msg">大床房</view>
|
|
|
+ <view class="info_msg">{{ orderInfo.houseName }}</view>
|
|
|
<view class="info_type">
|
|
|
- <view class="type_item">包吃住型</view>
|
|
|
- <view class="type_item">包吃住型</view>
|
|
|
- <view class="type_item">包吃住型</view>
|
|
|
+ <view class="type_item">{{ orderInfo.hotelType }}型</view>
|
|
|
</view>
|
|
|
<view class="info_tag">
|
|
|
- <view class="tag_item">16-20㎡</view>
|
|
|
+ <view class="tag_item" v-if="orderInfo.houseAreas">{{ orderInfo.houseAreas }}㎡</view>
|
|
|
<view class="tag_item">双人床</view>
|
|
|
<view class="tag_item">窗户位于走廊/窗户较小</view>
|
|
|
</view>
|
|
|
<view class="info_box">
|
|
|
<view class="box_key">住客姓名</view>
|
|
|
- <view class="box_value">张三</view>
|
|
|
+ <view class="box_value">{{ orderInfo.userName }}</view>
|
|
|
</view>
|
|
|
<view class="info_box">
|
|
|
<view class="box_key">联系电话</view>
|
|
|
- <view class="box_value">13677985689</view>
|
|
|
+ <view class="box_value">{{ orderInfo.userPhone }}</view>
|
|
|
</view>
|
|
|
<view class="info_box">
|
|
|
<view class="box_key">预计到店</view>
|
|
|
@@ -75,7 +63,7 @@
|
|
|
<view class="box_title">费用信息</view>
|
|
|
<view class="box_container">
|
|
|
<view class="container_key">在线支付</view>
|
|
|
- <view class="container_value price">¥280</view>
|
|
|
+ <view class="container_value price">¥{{ orderInfo.houseTotalPrice }}</view>
|
|
|
</view>
|
|
|
<view class="box_container">
|
|
|
<view class="container_key">发票报销</view>
|
|
|
@@ -86,8 +74,8 @@
|
|
|
<!-- 按钮区域 -->
|
|
|
|
|
|
<view class="body_btn">
|
|
|
- <view class="btn_item type">退单</view>
|
|
|
- <view class="btn_item type2">接单</view>
|
|
|
+ <view class="btn_item type" @click="handleOrder(4)">退单</view>
|
|
|
+ <view class="btn_item type2" v-if="orderInfo.hotelIsCanorder === '2'" @click="handleOrder(1)">接单</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -97,91 +85,115 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- // 订单类型
|
|
|
- type: null
|
|
|
+ // 订单id
|
|
|
+ id: '',
|
|
|
+ // 订单信息
|
|
|
+ orderInfo: null
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- this.type = options.type
|
|
|
+ this.id = options.id
|
|
|
+ this.getData()
|
|
|
},
|
|
|
methods: {
|
|
|
- // 点击复制文字回调
|
|
|
- handleCopy(text) {
|
|
|
- uni.setClipboardData({
|
|
|
- data: text,
|
|
|
- success: () => {}
|
|
|
- })
|
|
|
- },
|
|
|
- handleBack() {
|
|
|
- uni.navigateBack(1)
|
|
|
- },
|
|
|
- // 点击地图/导航文字回调
|
|
|
- handleMap() {
|
|
|
- uni.openLocation({
|
|
|
- latitude: 28.86054,
|
|
|
- longitude: 115.361744,
|
|
|
- name: '',
|
|
|
- address: '靖安县---详细地址',
|
|
|
- success: () => {}
|
|
|
- })
|
|
|
- },
|
|
|
- // 点击联系商家文字回调
|
|
|
- handlePhone(phone) {
|
|
|
- uni.makePhoneCall({
|
|
|
- phoneNumber: phone
|
|
|
- })
|
|
|
- },
|
|
|
- // 点击去支付按钮回调
|
|
|
- handlePay() {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/pay/pay'
|
|
|
+ async getData() {
|
|
|
+ const res = await this.$myRequest({
|
|
|
+ url: '/mhotel/ampgetBookingById.action',
|
|
|
+ data: {
|
|
|
+ bookingId: this.id
|
|
|
+ }
|
|
|
})
|
|
|
+ // console.log(res)
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.orderInfo = res.data
|
|
|
+ }
|
|
|
},
|
|
|
- // 点击取消订单按钮回调
|
|
|
- handleCancel() {
|
|
|
+ // 点击 退单 接单 按钮回调
|
|
|
+ handleOrder(type) {
|
|
|
+ // 1 接单 4 退单
|
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
|
- content: '确定取消该订单吗?',
|
|
|
+ content: `确定${type === 1 ? '接单' : '退单'}吗?`,
|
|
|
success: (res) => {
|
|
|
if (res.confirm) {
|
|
|
- uni.showToast({
|
|
|
- title: '取消成功',
|
|
|
- icon: 'success'
|
|
|
- })
|
|
|
- setTimeout(() => {
|
|
|
- uni.redirectTo({
|
|
|
- url: '/pages/orderManage/orderManage'
|
|
|
- })
|
|
|
- }, 1500)
|
|
|
+ if (type === 1) {
|
|
|
+ // 接单请求
|
|
|
+ this.receiving()
|
|
|
+ } else {
|
|
|
+ // 退单请求
|
|
|
+ this.chargeback()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 点击再次预定按钮回调
|
|
|
- handleAgain() {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/detail/detail'
|
|
|
+ async receiving() {
|
|
|
+ const res = await this.$myRequest({
|
|
|
+ url: '/mhotel/bookupdateBookStatus.action',
|
|
|
+ data: {
|
|
|
+ id: this.id,
|
|
|
+ type: 1
|
|
|
+ }
|
|
|
})
|
|
|
+ // console.log(res)
|
|
|
+ if (res.code === 200) {
|
|
|
+ uni.showToast({
|
|
|
+ title: `接单成功`,
|
|
|
+ icon: 'success',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.switchTab({
|
|
|
+ url: '/pages/home/home'
|
|
|
+ })
|
|
|
+ }, 1500)
|
|
|
+ }
|
|
|
},
|
|
|
- // 点击删除订单按钮回调
|
|
|
- handleDelete() {
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '确定删除该订单吗?',
|
|
|
- success: (res) => {
|
|
|
- if (res.confirm) {
|
|
|
- uni.showToast({
|
|
|
- title: '删除成功',
|
|
|
- icon: 'success'
|
|
|
- })
|
|
|
- setTimeout(() => {
|
|
|
- uni.redirectTo({
|
|
|
- url: '/pages/orderManage/orderManage'
|
|
|
- })
|
|
|
- }, 1500)
|
|
|
- }
|
|
|
+ async chargeback() {
|
|
|
+ const res = await this.$myRequest({
|
|
|
+ url: '/mhotel/abkchargeback.action',
|
|
|
+ data: {
|
|
|
+ bookingId: this.id
|
|
|
}
|
|
|
})
|
|
|
+ // console.log(res)
|
|
|
+ if (res.code === 200) {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.message,
|
|
|
+ icon: 'none',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.switchTab({
|
|
|
+ url: '/pages/home/home'
|
|
|
+ })
|
|
|
+ }, 1500)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 点击左上角返回按钮回调
|
|
|
+ handleBack() {
|
|
|
+ uni.switchTab({
|
|
|
+ url: '/pages/home/home'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getWeek(time) {
|
|
|
+ let date = new Date(time)
|
|
|
+ // 获取星期
|
|
|
+ let week = date.getDay()
|
|
|
+ let weekList = ['日', '一', '二', '三', '四', '五', '六']
|
|
|
+
|
|
|
+ let res = '周' + weekList[week]
|
|
|
+ return res
|
|
|
+ },
|
|
|
+ getTime(time) {
|
|
|
+ let date = new Date(time)
|
|
|
+ // 获取月份
|
|
|
+ let M = date.getMonth() + 1
|
|
|
+ // 获取日期
|
|
|
+ let D = date.getDate()
|
|
|
+
|
|
|
+ let res = M + '月' + D + '日'
|
|
|
+ return res
|
|
|
}
|
|
|
}
|
|
|
}
|