|
|
@@ -18,7 +18,7 @@
|
|
|
<image class="room-image" v-if="item.h_type.indexOf('标准') !== -1" src="../../static/index/std.jpg"></image>
|
|
|
<image class="room-image" v-if="item.h_type.indexOf('高级') !== -1" src="../../static/index/adv.jpg"></image>
|
|
|
<image class="room-image" v-if="item.h_type.indexOf('豪华') !== -1" src="../../static/index/lux.jpg"></image>
|
|
|
- <view class="room-name">{{item.h_type}}</view>
|
|
|
+ <view class="room-name">{{ item.h_type }}</view>
|
|
|
<view class="room-time">{{item.live_time|snippet}}~{{item.end_time|snippet}}</view>
|
|
|
<view class="room-order">订单号:{{item.order_num}}</view>
|
|
|
<view class="room-type">
|
|
|
@@ -42,7 +42,7 @@
|
|
|
<!-- <text v-else-if="item.status == 3" @click="navigateToXuzhu">续住</text> -->
|
|
|
</view>
|
|
|
<view :class="{'room-button3': item.status == 1}">
|
|
|
- <text v-if="item.status == 1" @click="getOrderPay(item.id)">支付</text>
|
|
|
+ <text v-if="item.status == 1" @click="getOrderPay(item.h_type, item.live_time, item.end_time)">支付</text>
|
|
|
<!-- <text v-else-if="item.status == 0" @click="navigateToZaici(item.enableStartTime,item.enableEndTime,item.roomTypeId)">再次预定</text>
|
|
|
<text v-else-if="item.status == 4" @click="navigateToJiezhang(item.id)">去处理</text>
|
|
|
<text v-else-if="item.status == 5" @click="navigateToWanchengZaici(item.roomTypeId)">再次预定</text>
|
|
|
@@ -171,6 +171,91 @@
|
|
|
}, 2000)
|
|
|
},
|
|
|
methods: {
|
|
|
+ /**
|
|
|
+ * 调起支付
|
|
|
+ */
|
|
|
+ onBridgeReady() {
|
|
|
+ var that = this;
|
|
|
+ // 在这里可以使用WeixinJSBridge对象进行支付调用等操作
|
|
|
+ // 调用支付接口
|
|
|
+ if (typeof WeixinJSBridge !== 'undefined') {
|
|
|
+ WeixinJSBridge.invoke('getBrandWCPayRequest', that.payData,
|
|
|
+ function(res) {
|
|
|
+ if (res.err_msg == "get_brand_wcpay_request:ok") {
|
|
|
+ // 使用以上方式判断前端返回,微信团队郑重提示:
|
|
|
+ //res.errMsg将在用户支付成功后返回ok,但并不保证它绝对可靠。
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '支付成功',
|
|
|
+ showCancel: false,
|
|
|
+ success: (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "../my_orderlist/my_orderlist?Inv=2"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else if (res.err_msg == "get_brand_wcpay_request:cancel") {
|
|
|
+ uni.showToast({
|
|
|
+ title: '支付取消',
|
|
|
+ icon: 'success'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: res.errMsg,
|
|
|
+ showCancel: false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 支付订单
|
|
|
+ getOrderPay(hType, stime, etime) {
|
|
|
+ let that = this
|
|
|
+ that.$myRequest({
|
|
|
+ method: 'POST',
|
|
|
+ url: '/hotelReservation/zhotel2/apporder_pay.action',
|
|
|
+ data: {
|
|
|
+ 'card_number': that.cardNumber,
|
|
|
+ 'h_type': hType,
|
|
|
+ 'live_time': stime.substring(0, 10),
|
|
|
+ 'end_time': etime.substring(0, 10)
|
|
|
+ },
|
|
|
+ headers: {
|
|
|
+ 'Content-Type': 'application/json'
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ let data = res.data
|
|
|
+ if (data.code === 200) {
|
|
|
+ let d = data.data;
|
|
|
+ that.payData = {
|
|
|
+ "appId": d.appId,
|
|
|
+ "nonceStr": d.nonceStr,
|
|
|
+ "paySign": d.paySign,
|
|
|
+ "package": "prepay_id=" + d.prepay_id,
|
|
|
+ "signType": d.signType,
|
|
|
+ "timeStamp": d.timeStamp
|
|
|
+ }
|
|
|
+
|
|
|
+ if (typeof WeixinJSBridge === 'undefined') {
|
|
|
+ if (document.addEventListener) {
|
|
|
+ document.addEventListener('WeixinJSBridgeReady', that.onBridgeReady, false);
|
|
|
+ } else if (document.attachEvent) {
|
|
|
+ document.attachEvent('WeixinJSBridgeReady', that.onBridgeReady);
|
|
|
+ document.attachEvent('onWeixinJSBridgeReady', ththatis.onBridgeReady);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ that.onBridgeReady();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ that.msgType = 'warn'
|
|
|
+ that.order_txt = data.message
|
|
|
+ that.$refs.popup_order.open()
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
// 获取用户信息
|
|
|
getUserInfo() {
|
|
|
var tempCardNumber = this.$utils.getEncryptedData('cardNumber')
|
|
|
@@ -193,7 +278,7 @@
|
|
|
// Inv2 = 0
|
|
|
// }
|
|
|
that.$myRequest({
|
|
|
- url: '/hotelReservation/zhotel/appqueryOrder.action?card_number=02090&state=' + Inv2
|
|
|
+ url: '/hotelReservation/zhotel2/appqueryOrder.action?card_number=' + that.cardNumber + '&state=' + Inv2
|
|
|
}).then(res => {
|
|
|
var data = res.data
|
|
|
if (data.code === 200) {
|
|
|
@@ -251,41 +336,19 @@
|
|
|
},
|
|
|
// 取消订单弹框
|
|
|
openQu(id, type) {
|
|
|
- this.order_txt_id = id
|
|
|
- this.msgType2 = type
|
|
|
- this.order_txt2 = '确定取消订单?'
|
|
|
- this.$refs.popup_order2.open()
|
|
|
- },
|
|
|
- // 支付订单
|
|
|
- getOrderPay(id) {
|
|
|
- let _self = this
|
|
|
- this.$axios.get(`/hotelReservation/zhotel/ihotel/hotelOrder/user/order/pay/${id}`, {
|
|
|
- headers: {
|
|
|
- 'user_token': localStorage.getItem('token')
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- res = res.data
|
|
|
- if (res.success) {
|
|
|
- if (res.data.payAmount == 0) {
|
|
|
- uni.navigateTo({
|
|
|
- url: '../zhifuchenggong/zhifuchenggong?orderId=' + res.data.orderId
|
|
|
- })
|
|
|
- } else {
|
|
|
- window.location.href = res.data.payUrl;
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- this.order_txt = res.message
|
|
|
- this.$refs.popup_order.open()
|
|
|
- console.log('支付失败')
|
|
|
- }
|
|
|
- });
|
|
|
+ uni.showToast({
|
|
|
+ title: '接口未完成'
|
|
|
+ })
|
|
|
+ // this.order_txt_id = id
|
|
|
+ // this.msgType2 = type
|
|
|
+ // this.order_txt2 = '确定取消订单?'
|
|
|
+ // this.$refs.popup_order2.open()
|
|
|
},
|
|
|
// 办理退房
|
|
|
getOrderReturn(order_txt_id) {
|
|
|
let _self = this
|
|
|
this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
|
|
|
- this.$axios.put(`/hotelReservation/zhotel/ihotel/hotelOrder/user/order/return/${this.order_txt_id}`, ).then(res => {
|
|
|
+ this.$axios.put(`/hotelReservation/zhotel2/ihotel/hotelOrder/user/order/return/${this.order_txt_id}`, ).then(res => {
|
|
|
res = res.data
|
|
|
if (res.success) {
|
|
|
this.order_txt = '退房成功'
|
|
|
@@ -303,7 +366,7 @@
|
|
|
getOrderHold(order_txt_id) {
|
|
|
let _self = this
|
|
|
this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
|
|
|
- this.$axios.put(`/hotelReservation/zhotel/ihotel/hotelOrder/user/order/hold/${this.order_txt_id}`, ).then(res => {
|
|
|
+ this.$axios.put(`/hotelReservation/zhotel2/ihotel/hotelOrder/user/order/hold/${this.order_txt_id}`, ).then(res => {
|
|
|
res = res.data
|
|
|
if (res.success) {
|
|
|
this.order_txt = '办理入住成功'
|
|
|
@@ -319,7 +382,7 @@
|
|
|
getOrderDelete(order_txt_id) {
|
|
|
let _self = this
|
|
|
this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
|
|
|
- this.$axios.delete(`/hotelReservation/zhotel/ihotel/hotelOrder/user/order/${this.order_txt_id}`, ).then(res => {
|
|
|
+ this.$axios.delete(`/hotelReservation/zhotel2/ihotel/hotelOrder/user/order/${this.order_txt_id}`, ).then(res => {
|
|
|
res = res.data
|
|
|
if (res.success) {
|
|
|
this.order_txt = '删除订单成功'
|
|
|
@@ -337,7 +400,7 @@
|
|
|
let that = this
|
|
|
// that.$axios.defaults.headers.common['user_token'] = that.$utils.getEncryptedData('token');
|
|
|
that.$myRequest({
|
|
|
- url: '/hotelReservation/zhotel/ihotel/hotelOrder/user/order/cancel/' + that.order_txt_id
|
|
|
+ url: '/hotelReservation/zhotel2/ihotel/hotelOrder/user/order/cancel/' + that.order_txt_id
|
|
|
}).then(res => {
|
|
|
alert(JSON.stringify(res.data))
|
|
|
if (res.data.code === 200) {
|