|
|
@@ -53,6 +53,7 @@
|
|
|
<uni-popup-dialog :type="msgType" cancelText="关闭" confirmText="确定" content="请先订房!" @confirm="dialogConfirm"
|
|
|
@close="dialogClose"></uni-popup-dialog>
|
|
|
</uni-popup>
|
|
|
+
|
|
|
<!-- 切换全日房和钟点房 -->
|
|
|
<view class="select-type" v-if="roomtype==1" @click="changeType">
|
|
|
<view class="allday">全日房</view>
|
|
|
@@ -84,8 +85,8 @@
|
|
|
<!-- 钟点房 -->
|
|
|
<view class="select-time" v-else>
|
|
|
<view class="hourtime">
|
|
|
- <uni-datetime-picker type="date" v-model="hourruzhu" @change="changezhong" :start="mindate">
|
|
|
- 入住时段
|
|
|
+ <uni-datetime-picker type="date" v-model="hourruzhu" @change="changezhong" :start="mindate" :end="info.endDate">
|
|
|
+ 入住时间
|
|
|
<text class="select-list-time" style="margin-left: 26rpx;">{{hourruzhu}}</text>
|
|
|
<image class="hour_right" src="../../static/index/hour_right.png"></image>
|
|
|
</uni-datetime-picker>
|
|
|
@@ -95,35 +96,54 @@
|
|
|
</view>
|
|
|
<!-- 全日房选择时间 -->
|
|
|
<uni-popup ref="popup_picker" :mask-click="true">
|
|
|
- <view class=popup_bg_picker>
|
|
|
- <!-- <text class="popup_title">取消</text>
|
|
|
- <text class="popup_error" style="margin-left: 272px;" @click="popup_pickerClose">确定</text> -->
|
|
|
+ <!-- <view class=popup_bg_picker> -->
|
|
|
+ <!-- <text class="popup_title">取消</text> -->
|
|
|
+
|
|
|
<uni-calendar :selected="info.selected" class="uni-calendar--hook" :clear-date="true" :date="info.date" :insert="info.insert" :lunar="info.lunar" :startDate="info.startDate"
|
|
|
:endDate="info.endDate" :range="info.range" @change="change"/>
|
|
|
+ <view style="height: 60px; background-color: #fff;">
|
|
|
+ <view class="riliQueren" @click="popup_pickerClose">确定{{ruzhu_num}}晚</view>
|
|
|
</view>
|
|
|
+ <!-- </view> -->
|
|
|
</uni-popup>
|
|
|
<!-- 房型列表-->
|
|
|
<view class="room-kuang">
|
|
|
<view class="room-xinxi" v-for="(item,index) in roomType" :key="index">
|
|
|
<image class="room-image" :src="item.roomPicture" @click="inputDialogToggle(item.id)"></image>
|
|
|
- <view class="room-name">{{item.roomName}}</view>
|
|
|
- <view class="room-mark" v-if="item.roomConfiguration.length>11">{{item.roomConfiguration.substring(0,11)}}...</view>
|
|
|
- <view class="room-mark" v-else>{{item.roomConfiguration}}</view>
|
|
|
- <view class="room-time2" v-if="item.roomType==2">{{apartList.hourTime}}</view>
|
|
|
- <view class="room-time3" v-if="item.roomType==2">{{item.roomLiveTime}}小时</view>
|
|
|
- <view class="room-icon">
|
|
|
- <image src="../../static/index/index_wifi.svg" style="width: 30rpx;height: 30rpx;"></image>
|
|
|
- <image src="../../static/index/index_kongtiao.svg" style="width: 26rpx;height: 26rpx;margin-left: 10rpx;"></image>
|
|
|
- <image src="../../static/index/index_nosmoking.svg" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;"></image>
|
|
|
- <image src="../../static/index/index_lock.svg" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;"></image>
|
|
|
+ <view style="padding-top: 10px;display: grid;width: 47%;">
|
|
|
+ <text class="room-name">
|
|
|
+ {{item.roomName}}
|
|
|
+ <view class="room-time3" v-if="item.roomType==2">{{item.roomLiveTime}}小时</view>
|
|
|
+ </text>
|
|
|
+ <view class="room-icon">
|
|
|
+ <image :src="item2.iconPath" v-for="(item2,index2) in item.roomConfigurationPicture" :key="index2" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;"></image>
|
|
|
+ <!-- <image src="../../static/index/index_kongtiao.svg" style="width: 26rpx;height: 26rpx;margin-left: 10rpx;"></image>
|
|
|
+ <image src="../../static/index/index_nosmoking.svg" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;"></image>
|
|
|
+ <image src="../../static/index/index_lock.svg" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;"></image>
|
|
|
+ <image src="../../static/index/index_wifi.svg" style="width: 30rpx;height: 30rpx;"></image>
|
|
|
+ <image src="../../static/index/index_kongtiao.svg" style="width: 26rpx;height: 26rpx;margin-left: 10rpx;"></image> -->
|
|
|
+ </view>
|
|
|
+ <view class="room-time2" v-if="item.roomType==2">
|
|
|
+ <text class="zhongtime" v-for="(item3,index3) in apartList.hourTime.split(',')" :key="index3">{{item3}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="shengyu-jian">剩余{{item.surplusCount}}间</view>
|
|
|
+ </view>
|
|
|
+ <view style="display: flex;align-items: end;flex: 1;margin-right: 5px;" v-if="item.roomType==1">
|
|
|
+ <view class="room-price">¥{{item.roomPrice}}</view>
|
|
|
+ <view class="room-button" :class="{'room-button2': item.houseStatus == 2}">
|
|
|
+ <text v-if="item.houseStatus==2">已满</text>
|
|
|
+ <text v-else-if="item.houseStatus==1" @click="navigateToOrderRoom(item.houseStatus,item.id,item.roomName,item)">订</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <!-- <view class="before-price"><strike>¥{{item.usualPrice}}</strike></view> -->
|
|
|
- <view class="room-price">¥{{item.roomPrice}}</view>
|
|
|
- <view class="room-button" :class="{'room-button2': item.houseStatus == 2}">
|
|
|
- <text v-if="item.houseStatus==2">已满</text>
|
|
|
- <text v-else-if="item.houseStatus==1" @click="navigateToOrderRoom(item.houseStatus,item.id,item.roomName,item)">订</text>
|
|
|
+
|
|
|
+ <view v-if="item.roomType==2" style="display: grid;align-items: end;flex: 1;margin-right: 5px;">
|
|
|
+ <view class="room-price2">¥{{item.roomPrice}}</view>
|
|
|
+ <view class="room-buttonZ" :class="{'room-button2Z': item.houseStatus == 2}">
|
|
|
+ <text v-if="item.houseStatus==2">已满</text>
|
|
|
+ <text v-else-if="item.houseStatus==1" @click="navigateToOrderRoom(item.houseStatus,item.id,item.roomName,item)">订</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view class="room-line" v-if="index<(roomType.length-1)"></view>
|
|
|
+ <view class="room-line" v-if="index<(roomType.length) && index>0"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -194,6 +214,26 @@
|
|
|
<uni-popup-dialog cancelText="关闭" confirmText="确定" content="请先订房"
|
|
|
@close="dialogClose"></uni-popup-dialog>
|
|
|
</uni-popup>
|
|
|
+
|
|
|
+ <!-- 预订时判断是否有入住资格弹框 -->
|
|
|
+ <uni-popup ref="popupRuzhu" :mask-click="false">
|
|
|
+ <view class="popup-content">
|
|
|
+ <view class="popup-zige">免费入住资格筛选</view>
|
|
|
+ <!-- 多选框组 -->
|
|
|
+ <!--" -->
|
|
|
+ <radio-group v-model="selectedValue" @change="radioChange">
|
|
|
+ <radio v-for="(item, index) in options" :key="index" :value="item.name" :disabled="item.count == 0">
|
|
|
+ {{ item.name }}
|
|
|
+ <text style="margin-left: 30px;">{{item.count}}间</text>
|
|
|
+ </radio>
|
|
|
+ </radio-group>
|
|
|
+ <!-- 确认和取消按钮 -->
|
|
|
+ <button @click="confirmSelection" class="xuanzesuccess">选择完成</button>
|
|
|
+ <!-- <button class="xuanzesuccess2" v-else>选择完成</button> -->
|
|
|
+ <!-- <button @click="quxiaoyuding" class="xuanzesuccess">取消</button> -->
|
|
|
+ <view style="height: 20px;"></view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -238,7 +278,9 @@
|
|
|
getroomtype,
|
|
|
getroomtypeinfo,
|
|
|
getorderpage,
|
|
|
- apartSet
|
|
|
+ apartSet,
|
|
|
+ getpayOpenId,
|
|
|
+ ifyuding
|
|
|
} from '../../utils/api_hotel.js'
|
|
|
// 导入图片
|
|
|
import AMap from "../../lib/qqmap-wx-jssdk.js"
|
|
|
@@ -281,51 +323,6 @@
|
|
|
endDate:''
|
|
|
},
|
|
|
roomType:[
|
|
|
- {
|
|
|
- "id": 1,
|
|
|
- "roomName": "标准房",
|
|
|
- "roomType": 1,
|
|
|
- "roomPrice": 250,
|
|
|
- "number": 3,
|
|
|
- "roomArea": "25",
|
|
|
- "roomLiveTime": "1",
|
|
|
- "receivingTime": "15:08-16:08",
|
|
|
- "visible": "1,2",
|
|
|
- "roomConfiguration": "1,浴室,投影机",
|
|
|
- "roomPicture": "http://192.168.161.224:12345/6/f/5/6f51cacb44f94ef09acd08ad65135371.jpg",
|
|
|
- "houseStatus": "1",
|
|
|
- "surplusCount": 1
|
|
|
- },
|
|
|
- {
|
|
|
- "id": 4,
|
|
|
- "roomName": "豪华别墅",
|
|
|
- "roomType": 1,
|
|
|
- "roomPrice": 2500,
|
|
|
- "number": 6,
|
|
|
- "roomArea": "100",
|
|
|
- "roomLiveTime": "1",
|
|
|
- "receivingTime": "16:31-17:31",
|
|
|
- "visible": "1,2,3",
|
|
|
- "roomConfiguration": "2",
|
|
|
- "roomPicture": "http://192.168.161.224:12345/1/b/3/1b38ab1658724de0875fd575f6533c42.jpg",
|
|
|
- "houseStatus": "1",
|
|
|
- "surplusCount": 6
|
|
|
- },
|
|
|
- {
|
|
|
- "id": 5,
|
|
|
- "roomName": "豪华单间",
|
|
|
- "roomType": 1,
|
|
|
- "roomPrice": 800,
|
|
|
- "number": 2,
|
|
|
- "roomArea": "50",
|
|
|
- "roomLiveTime": "1",
|
|
|
- "receivingTime": "16:52-17:52",
|
|
|
- "visible": "1,2",
|
|
|
- "roomConfiguration": "2",
|
|
|
- "roomPicture": "http://192.168.161.224:12345/f/6/4/f64bd3ee73ef4c03a1d266bba3ac4a0f.jpg",
|
|
|
- "houseStatus": "1",
|
|
|
- "surplusCount": 2
|
|
|
- }
|
|
|
],
|
|
|
typeText:'',//房型详细描述
|
|
|
indicatorDots: true,//滚动图片提示条默认出现
|
|
|
@@ -351,14 +348,22 @@
|
|
|
totalCount: 0,
|
|
|
apartList:{},
|
|
|
hourTime:'',//钟点房营业时间
|
|
|
+
|
|
|
+ selectedValue: '', // 选中的值
|
|
|
+ sourceId:'',
|
|
|
+ options: [],
|
|
|
+ xuanId:'',
|
|
|
+ xuanroomName:'',
|
|
|
+ itenxuan:{},//选中的数据
|
|
|
}
|
|
|
},
|
|
|
+ onShow() {
|
|
|
+ this.getLocationInfo()
|
|
|
+ this.getAllset()
|
|
|
+ },
|
|
|
onLoad() {
|
|
|
this.getAllset()
|
|
|
this.handleUrlCode()
|
|
|
- // uni.showToast({
|
|
|
- // title: 'openId'+localStorage.getItem('openId')
|
|
|
- // })
|
|
|
},
|
|
|
|
|
|
mounted() {
|
|
|
@@ -375,17 +380,17 @@
|
|
|
// console.log('endDate:'+getDate(new Date(),6).fullDate)
|
|
|
this.info.date = getDate(new Date()).fullDate
|
|
|
this.info.startDate = getDate(new Date()).fullDate
|
|
|
- this.info.endDate = getDate(new Date(),6).fullDate
|
|
|
+ this.info.endDate = getDate(new Date(),8).fullDate
|
|
|
this.infoXu.date = getDate(new Date()).fullDate
|
|
|
this.infoXu.startDate = getDate(new Date()).fullDate
|
|
|
- this.infoXu.endDate = getDate(new Date(),6).fullDate
|
|
|
+ this.infoXu.endDate = getDate(new Date(),8).fullDate
|
|
|
this.startTime = getDate(new Date()).fullTime
|
|
|
this.endTime = getDate(new Date(),1).fullTime
|
|
|
this.hourruzhu= getDate(new Date()).fullDate
|
|
|
this.startWeek = getDate(new Date()).sWeek
|
|
|
this.endWeek = getDate(new Date(),1).eWeek
|
|
|
}, 1)
|
|
|
-
|
|
|
+ this.getLocationInfo()
|
|
|
// wx请求获取位置权限
|
|
|
this.getAuthorize()
|
|
|
.then(() => {
|
|
|
@@ -397,6 +402,7 @@
|
|
|
uni.getLocation({
|
|
|
type: "gcj02",
|
|
|
success: function(res) {
|
|
|
+ // alert(res.latitude)
|
|
|
// 暂时
|
|
|
that.longitude = res.longitude;
|
|
|
that.latitude = res.latitude;
|
|
|
@@ -459,6 +465,29 @@
|
|
|
|
|
|
}
|
|
|
},
|
|
|
+ //获取支付openId
|
|
|
+ getOpenId(){
|
|
|
+ let _self = this
|
|
|
+ // alert('p'+localStorage.getItem('code'))
|
|
|
+ var data='?wxcode='+localStorage.getItem('code')
|
|
|
+ // {
|
|
|
+ // 'wxcode':'061NSw100t8LAS1pXH0004UsUs1NSw1c'//
|
|
|
+ // }
|
|
|
+ getpayOpenId(data).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ localStorage.setItem('openId2',res.message)
|
|
|
+ // alert('openid时'+localStorage.getItem('openId2'))
|
|
|
+ } else if(res.code=='500'){
|
|
|
+ // uni.showModal({
|
|
|
+ // content:res.message
|
|
|
+ // })
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ // uni.showModal({
|
|
|
+ // content:err.message
|
|
|
+ // })
|
|
|
+ });
|
|
|
+ },
|
|
|
//公寓整体配置
|
|
|
getAllset(){
|
|
|
let _self = this
|
|
|
@@ -471,7 +500,18 @@
|
|
|
localStorage.setItem('leaveTime',this.apartList.leaveTime)
|
|
|
this.startDate = getDate(new Date()).fullDate+" "+this.apartList.liveTime
|
|
|
this.endDate = getDate(new Date(),1).fullDate+" "+this.apartList.leaveTime
|
|
|
+
|
|
|
+ this.startTime = getDate(new Date()).fullTime
|
|
|
+ this.endTime = getDate(new Date(),1).fullTime
|
|
|
+ this.ruzhu_num=1
|
|
|
+ this.startWeek = getDate(new Date()).sWeek
|
|
|
+ this.endWeek = getDate(new Date(),1).eWeek
|
|
|
+ this.hourruzhu= getDate(new Date()).fullDate
|
|
|
+
|
|
|
this.hourTime=this.apartList.hourTime
|
|
|
+ // alert('8')
|
|
|
+ this.selectedValue=''
|
|
|
+ this.sourceId=''
|
|
|
this.getRoomType()
|
|
|
return;
|
|
|
} else {
|
|
|
@@ -480,9 +520,9 @@
|
|
|
})
|
|
|
}
|
|
|
}).catch((err) => {
|
|
|
- uni.showModal({
|
|
|
- content:err.message
|
|
|
- })
|
|
|
+ // uni.showModal({
|
|
|
+ // content:err.message
|
|
|
+ // })
|
|
|
});
|
|
|
},
|
|
|
onReachBottom: function() {
|
|
|
@@ -508,7 +548,7 @@
|
|
|
this.page = 1;
|
|
|
this.startDate = getDate(new Date()).fullDate+" "+getDate(new Date()).fullDate2.substring(11,19)
|
|
|
this.endDate = getDate(new Date()).fullDate+" "+"23:59:00"
|
|
|
- this.startTime = getDate(new Date()).fullDate.substring(5,7)+'月'+getDate(new Date()).fullDate.substring(8,10)+'日'
|
|
|
+ this.hourruzhu = getDate(new Date()).fullDate.substring(5,7)+'月'+getDate(new Date()).fullDate.substring(8,10)+'日'
|
|
|
this.getRoomType();
|
|
|
}else if(this.roomtype==2){
|
|
|
this.roomtype=1
|
|
|
@@ -517,6 +557,12 @@
|
|
|
this.endDate = getDate(new Date(),1).fullDate+" "+this.apartList.leaveTime
|
|
|
this.getRoomType();
|
|
|
}
|
|
|
+ this.startTime = getDate(new Date()).fullTime
|
|
|
+ this.endTime = getDate(new Date(),1).fullTime
|
|
|
+ this.ruzhu_num=1
|
|
|
+ this.startWeek = getDate(new Date()).sWeek
|
|
|
+ this.endWeek = getDate(new Date(),1).eWeek
|
|
|
+ this.hourruzhu= getDate(new Date()).fullDate
|
|
|
},
|
|
|
//钟点房选择日期
|
|
|
changezhong(e){
|
|
|
@@ -529,13 +575,12 @@
|
|
|
this.startDate = e+" "+getDate(new Date()).fullDate2.substring(11,19)
|
|
|
this.endDate = e+" "+"23:59:00"
|
|
|
}
|
|
|
- this.startTime = e.substring(5,7)+'月'+e.substring(8,10)+'日'
|
|
|
+ this.hourruzhu = e.substring(5,7)+'月'+e.substring(8,10)+'日'
|
|
|
this.getRoomType();
|
|
|
},
|
|
|
// 房型接口
|
|
|
getRoomType() {
|
|
|
let _self = this
|
|
|
- _self.roomType = []
|
|
|
var data="?page="+_self.page+"&size="+_self.size+"&type="+_self.roomtype+"&startTime="+_self.startDate+"&endTime="+_self.endDate
|
|
|
getroomtype(data).then((res) => {
|
|
|
if (res.success) {
|
|
|
@@ -559,9 +604,9 @@
|
|
|
// this.$message.warning('没有符合条件的数据!')
|
|
|
}
|
|
|
}).catch((err) => {
|
|
|
- uni.showModal({
|
|
|
- content:err.message
|
|
|
- })
|
|
|
+ // uni.showModal({
|
|
|
+ // content:err.message
|
|
|
+ // })
|
|
|
// this.$message.error(err.message)
|
|
|
});
|
|
|
},
|
|
|
@@ -633,28 +678,204 @@
|
|
|
// 跳转到入住须知
|
|
|
navigateToXuzhi(){
|
|
|
uni.navigateTo({
|
|
|
- url: "../ruzhuxuzhi/ruzhuxuzhi",
|
|
|
+ url: "/pages/ruzhuxuzhi/ruzhuxuzhi",
|
|
|
});
|
|
|
},
|
|
|
// 跳转到公寓详情
|
|
|
navigateToXiangqing(){
|
|
|
uni.navigateTo({
|
|
|
- url: "../gongyuxiangqing/gongyuxiangqing",
|
|
|
+ url: "/pages/gongyuxiangqing/gongyuxiangqing",
|
|
|
});
|
|
|
},
|
|
|
// 订房间
|
|
|
navigateToOrderRoom(houseStatus,id,roomName,item) {
|
|
|
+ this.xuanId=id
|
|
|
+ this.xuanroomName=roomName
|
|
|
+ this.itenxuan=item
|
|
|
+ this.ifRuzhu()
|
|
|
+ // let _self = this
|
|
|
+ // _self.roomType = []
|
|
|
+ // if (houseStatus==1){
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url: "/pages/order_room/order_room?roomTypeId="+id +"&enableStartTime="+this.startDate+"&enableEndTime="+this.endDate+"&startTime="+this.startTime+"&endTime="+this.endTime+"&typeName="+roomName+"&ruzhu_num="+this.ruzhu_num+"&roomArea="
|
|
|
+ // +item.roomArea+"&roomType="+item.roomType+"&roomConfiguration="+item.roomConfiguration+"&roomPrice="+item.roomPrice+'&surplusCount='+item.surplusCount+'&zhongTime='+this.apartList.hourTime+'&zhongshi='+item.roomLiveTime+'&source='+this.selectedValue,
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // this.getRoomType()
|
|
|
+ },
|
|
|
+ //订房前判断是否有入住资格
|
|
|
+ ifRuzhu(){
|
|
|
+ // alert('订房')
|
|
|
+ this.options=[]
|
|
|
let _self = this
|
|
|
- _self.roomType = []
|
|
|
- if (houseStatus==1){
|
|
|
- uni.navigateTo({
|
|
|
- url: "../order_room/order_room?roomTypeId="+id +"&enableStartTime="+this.startDate+"&enableEndTime="+this.endDate+"&startTime="+this.startTime+"&endTime="+this.endTime+"&typeName="+roomName+"&ruzhu_num="+this.ruzhu_num+"&roomArea="
|
|
|
- +item.roomArea+"&roomType="+item.roomType+"&roomConfiguration="+item.roomConfiguration+"&roomPrice="+item.roomPrice+'&surplusCount='+item.surplusCount+'&zhongTime='+this.apartList.hourTime+'&zhongshi='+item.roomLiveTime,
|
|
|
- });
|
|
|
+ var data='?userId='+localStorage.getItem('usersId')+
|
|
|
+ '&liveTime='+_self.startDate+'&leaveTime='+_self.endDate
|
|
|
+ ifyuding(data).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ _self.options=res.data
|
|
|
+ console.log(_self.options,'iii')
|
|
|
+ if(_self.options.length>0){
|
|
|
+ _self.$refs.popupRuzhu.open();
|
|
|
+ }else{
|
|
|
+ _self.selectedValue=''
|
|
|
+ _self.sourceId=''
|
|
|
+ let temporaryObj = {
|
|
|
+ roomTypeId:_self.xuanId,
|
|
|
+ enableStartTime:_self.startDate,
|
|
|
+ enableEndTime:_self.endDate,
|
|
|
+ startTime:_self.startTime,
|
|
|
+ endTime:_self.endTime,
|
|
|
+ typeName:_self.xuanroomName,
|
|
|
+ ruzhu_num:_self.ruzhu_num,
|
|
|
+ roomArea:_self.itenxuan.roomArea,
|
|
|
+ roomType:_self.itenxuan.roomType,
|
|
|
+ roomConfiguration:_self.itenxuan.roomConfiguration,
|
|
|
+ roomPrice:_self.itenxuan.roomPrice,
|
|
|
+ surplusCount:_self.itenxuan.surplusCount,
|
|
|
+ zhongTime:_self.apartList.hourTime,
|
|
|
+ zhongshi:_self.itenxuan.roomLiveTime,
|
|
|
+ source:_self.selectedValue,
|
|
|
+ sourceId:_self.sourceId
|
|
|
+ }
|
|
|
+ //传参对象,使用encodeURIComponent编码
|
|
|
+ let str = JSON.stringify(temporaryObj)
|
|
|
+ //注意这里——————————————————————
|
|
|
+ str = str.replace(/%/g, '%25')
|
|
|
+ //这里———————————————————————————
|
|
|
+ let query = encodeURIComponent(str)
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/order_room/order_room?data="+query
|
|
|
+ // url: "/pages/order_room/order_room?roomTypeId="+_self.xuanId +"&enableStartTime="+_self.startDate+"&enableEndTime="+_self.endDate+"&startTime="+_self.startTime+"&endTime="+_self.endTime+"&typeName="+_self.xuanroomName+"&ruzhu_num="+_self.ruzhu_num+"&roomArea="
|
|
|
+ // +_self.itenxuan.roomArea+"&roomType="+_self.itenxuan.roomType+"&roomConfiguration="+_self.itenxuan.roomConfiguration+"&roomPrice="+_self.itenxuan.roomPrice+'&surplusCount='+_self.itenxuan.surplusCount+'&zhongTime='+_self.apartList.hourTime+'&zhongshi='+_self.itenxuan.roomLiveTime
|
|
|
+ // +'&source='+_self.selectedValue+'&sourceId='+_self.sourceId,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else if(res.code=='500'){
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: res.message,
|
|
|
+ success: function (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ _self.selectedValue=''
|
|
|
+ _self.sourceId=''
|
|
|
+ let temporaryObj = {
|
|
|
+ roomTypeId:_self.xuanId,
|
|
|
+ enableStartTime:_self.startDate,
|
|
|
+ enableEndTime:_self.endDate,
|
|
|
+ startTime:_self.startTime,
|
|
|
+ endTime:_self.endTime,
|
|
|
+ typeName:_self.xuanroomName,
|
|
|
+ ruzhu_num:_self.ruzhu_num,
|
|
|
+ roomArea:_self.itenxuan.roomArea,
|
|
|
+ roomType:_self.itenxuan.roomType,
|
|
|
+ roomConfiguration:_self.itenxuan.roomConfiguration,
|
|
|
+ roomPrice:_self.itenxuan.roomPrice,
|
|
|
+ surplusCount:_self.itenxuan.surplusCount,
|
|
|
+ zhongTime:_self.apartList.hourTime,
|
|
|
+ zhongshi:_self.itenxuan.roomLiveTime,
|
|
|
+ source:_self.selectedValue,
|
|
|
+ sourceId:_self.sourceId
|
|
|
+ }
|
|
|
+ //传参对象,使用encodeURIComponent编码
|
|
|
+ let str = JSON.stringify(temporaryObj)
|
|
|
+ //注意这里——————————————————————
|
|
|
+ str = str.replace(/%/g, '%25')
|
|
|
+ //这里———————————————————————————
|
|
|
+ let query = encodeURIComponent(str)
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/order_room/order_room?data="+query
|
|
|
+ });
|
|
|
+ } else if (res.cancel) {
|
|
|
+ _self.selectedValue=''
|
|
|
+ _self.sourceId=''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ // alert(err)
|
|
|
+ uni.showModal({
|
|
|
+ content:err
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ radioChange(e){
|
|
|
+ // console.log(e,'ll')
|
|
|
+ for (let i = 0; i < this.options.length; i++) {
|
|
|
+ if (this.options[i].name === e.detail.value) {
|
|
|
+ this.selectedValue=this.options[i].source
|
|
|
+ this.sourceId=this.options[i].sourceId
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
- // this.getRoomType()
|
|
|
-
|
|
|
-
|
|
|
+ },
|
|
|
+ //订房选中流程
|
|
|
+ confirmSelection() {
|
|
|
+ console.log('选中的值:', this.selectedValue);
|
|
|
+ this.$refs.popupRuzhu.close()
|
|
|
+ // alert('跳转')
|
|
|
+ let temporaryObj = {
|
|
|
+ roomTypeId:this.xuanId,
|
|
|
+ enableStartTime:this.startDate,
|
|
|
+ enableEndTime:this.endDate,
|
|
|
+ startTime:this.startTime,
|
|
|
+ endTime:this.endTime,
|
|
|
+ typeName:this.xuanroomName,
|
|
|
+ ruzhu_num:this.ruzhu_num,
|
|
|
+ roomArea:this.itenxuan.roomArea,
|
|
|
+ roomType:this.itenxuan.roomType,
|
|
|
+ roomConfiguration:this.itenxuan.roomConfiguration,
|
|
|
+ roomPrice:this.itenxuan.roomPrice,
|
|
|
+ surplusCount:this.itenxuan.surplusCount,
|
|
|
+ zhongTime:this.apartList.hourTime,
|
|
|
+ zhongshi:this.itenxuan.roomLiveTime,
|
|
|
+ source:this.selectedValue,
|
|
|
+ sourceId:this.sourceId
|
|
|
+ }
|
|
|
+ //传参对象,使用encodeURIComponent编码
|
|
|
+ let str = JSON.stringify(temporaryObj)
|
|
|
+ //注意这里——————————————————————
|
|
|
+ str = str.replace(/%/g, '%25')
|
|
|
+ //这里———————————————————————————
|
|
|
+ let query = encodeURIComponent(str)
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/order_room/order_room?data="+query,
|
|
|
+ // url: "/pages/order_room/order_room?roomTypeId="+this.xuanId +"&enableStartTime="+this.startDate+"&enableEndTime="+this.endDate+"&startTime="+this.startTime+"&endTime="+this.endTime+"&typeName="+this.xuanroomName+"&ruzhu_num="+this.ruzhu_num+"&roomArea="
|
|
|
+ // +this.itenxuan.roomArea+"&roomType="+this.itenxuan.roomType+"&roomConfiguration="+this.itenxuan.roomConfiguration+"&roomPrice="+this.itenxuan.roomPrice+'&surplusCount='+this.itenxuan.surplusCount+'&zhongTime='+this.apartList.hourTime+'&zhongshi='+this.itenxuan.roomLiveTime+'&source='+this.selectedValue+'&sourceId='+_self.sourceId,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //取消预订
|
|
|
+ quxiaoyuding(){
|
|
|
+ this.selectedValue=''
|
|
|
+ this.sourceId=''
|
|
|
+ this.$refs.popupRuzhu.close()
|
|
|
+ let temporaryObj = {
|
|
|
+ roomTypeId:this.xuanId,
|
|
|
+ enableStartTime:this.startDate,
|
|
|
+ enableEndTime:this.endDate,
|
|
|
+ startTime:this.startTime,
|
|
|
+ endTime:this.endTime,
|
|
|
+ typeName:this.xuanroomName,
|
|
|
+ ruzhu_num:this.ruzhu_num,
|
|
|
+ roomArea:this.itenxuan.roomArea,
|
|
|
+ roomType:this.itenxuan.roomType,
|
|
|
+ roomConfiguration:this.itenxuan.roomConfiguration,
|
|
|
+ roomPrice:this.itenxuan.roomPrice,
|
|
|
+ surplusCount:this.itenxuan.surplusCount,
|
|
|
+ zhongTime:this.apartList.hourTime,
|
|
|
+ zhongshi:this.itenxuan.roomLiveTime,
|
|
|
+ source:this.selectedValue,
|
|
|
+ sourceId:this.sourceId
|
|
|
+ }
|
|
|
+ //传参对象,使用encodeURIComponent编码
|
|
|
+ let str = JSON.stringify(temporaryObj)
|
|
|
+ //注意这里——————————————————————
|
|
|
+ str = str.replace(/%/g, '%25')
|
|
|
+ //这里———————————————————————————
|
|
|
+ let query = encodeURIComponent(str)
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/order_room/order_room?data="+query
|
|
|
+ });
|
|
|
},
|
|
|
//办理入住跳转
|
|
|
navigateToDairuzhu(type){
|
|
|
@@ -672,7 +893,7 @@
|
|
|
}
|
|
|
if(this.dai_panduan.length>=1) {
|
|
|
uni.navigateTo({
|
|
|
- url:"../my_orderlist/my_orderlist?Inv=2"
|
|
|
+ url:"/pages/my_orderlist/my_orderlist?Inv=2"
|
|
|
})
|
|
|
}else if(this.dai_panduan.length<1) {
|
|
|
this.msgType = type
|
|
|
@@ -697,7 +918,7 @@
|
|
|
}
|
|
|
if(this.tui_panduan.length>=1) {
|
|
|
uni.navigateTo({
|
|
|
- url:"../my_orderlist/my_orderlist?Inv=3"
|
|
|
+ url:"/pages/my_orderlist/my_orderlist?Inv=3"
|
|
|
})
|
|
|
}else if(this.tui_panduan.length<1) {
|
|
|
this.msgType = type
|
|
|
@@ -730,7 +951,7 @@
|
|
|
console.log(this.xuzhu_panduan)
|
|
|
if(this.xuzhu_panduan.length>1) {
|
|
|
uni.navigateTo({
|
|
|
- url:"../my_orderlist/my_orderlist?Inv=3"
|
|
|
+ url:"/pages/my_orderlist/my_orderlist?Inv=3"
|
|
|
})
|
|
|
}else if(this.xuzhu_panduan.length==1) {
|
|
|
this.$refs.popup_xuzhu.open()
|
|
|
@@ -750,6 +971,10 @@
|
|
|
openCalendar() {
|
|
|
this.$refs.popup_picker.open()
|
|
|
},
|
|
|
+ // 关闭全日房日历
|
|
|
+ popup_pickerClose(){
|
|
|
+ this.$refs.popup_picker.close()
|
|
|
+ },
|
|
|
change(e) {
|
|
|
this.info.selected=[
|
|
|
{
|
|
|
@@ -767,6 +992,23 @@
|
|
|
if((new Date(e.range.after).getTime())<(new Date(e.range.before).getTime())) {
|
|
|
this.order_txt='离店日期不能小于到店日期'
|
|
|
this.$refs.popup_order.open()
|
|
|
+ this.info.selected=[]
|
|
|
+ }else if(parseInt(((new Date(e.range.after).getTime())-(new Date(e.range.before).getTime()))/1000/60/60/24)>2){
|
|
|
+ this.order_txt='预订时间不能超过两晚'
|
|
|
+ this.$refs.popup_order.open()
|
|
|
+ this.info.selected=[]
|
|
|
+ }else if(parseInt(((new Date(e.range.after).getTime())-(new Date(e.range.before).getTime()))/1000/60/60/24)==2){
|
|
|
+ this.order_txt='您此次申请了两晚,请注意若只住一晚可能会导致流程管理次数失效。'
|
|
|
+ this.$refs.popup_order.open()
|
|
|
+ this.endWeek='周'+e.lunar.ncWeek.substring(2,3)
|
|
|
+ this.startTime=e.range.before.substring(5,7)+'月'+e.range.before.substring(8,10)+'日'
|
|
|
+ this.endTime=e.range.after.substring(5,7)+'月'+e.range.after.substring(8,10)+'日'
|
|
|
+ this.startDate = e.range.before +' '+this.apartList.liveTime
|
|
|
+ this.endDate = e.range.after +' '+this.apartList.leaveTime
|
|
|
+ this.ruzhu_num=parseInt(((new Date(e.range.after).getTime())-(new Date(e.range.before).getTime()))/1000/60/60/24)
|
|
|
+ if(this.endDate !=this.apartList.leaveTime) {
|
|
|
+ this.getRoomType()
|
|
|
+ }
|
|
|
}else{
|
|
|
this.endWeek='周'+e.lunar.ncWeek.substring(2,3)
|
|
|
this.startTime=e.range.before.substring(5,7)+'月'+e.range.before.substring(8,10)+'日'
|
|
|
@@ -823,7 +1065,9 @@
|
|
|
getLocationInfo() {
|
|
|
const that = this;
|
|
|
uni.getLocation({
|
|
|
- type: "gcj02",
|
|
|
+ type: "wgs84",
|
|
|
+ geocode: true,
|
|
|
+ highAccuracyExpireTime: 100,
|
|
|
success: function(res) {
|
|
|
// 暂时
|
|
|
that.longitude = res.longitude; //118.787575;
|
|
|
@@ -845,9 +1089,8 @@
|
|
|
lat = parseFloat(longlatsplit1[0] === "" ? 0 : longlatsplit1[0]) + parseFloat("." + longlatsplit1[1].slice(0,6));
|
|
|
}
|
|
|
}
|
|
|
- console.log("纬度", lat);
|
|
|
that.distance = that.getMapDistance(lat,long,'28.788671','115.387261');
|
|
|
- console.log(that.distance)
|
|
|
+ // alert(that.distance)
|
|
|
that.markers = [{
|
|
|
id: "",
|
|
|
latitude: res.latitude,
|
|
|
@@ -857,6 +1100,12 @@
|
|
|
height: that.markerHeight, //高
|
|
|
}, ];
|
|
|
},
|
|
|
+ fail: function () {
|
|
|
+ uni.showToast({
|
|
|
+ title: '获取地址失败,将导致部分功能不可用',
|
|
|
+ icon:'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
// 拒绝授权后,弹框提示是否手动打开位置授权
|
|
|
@@ -904,11 +1153,6 @@
|
|
|
默认单位km
|
|
|
*/
|
|
|
getMapDistance(lat1, lng1, lat2, lng2) {
|
|
|
- // console.log(this.Rad(lat1))
|
|
|
- // console.log(this.Rad(lng1))
|
|
|
- // console.log(this.Rad(lat2))
|
|
|
- // console.log(this.Rad(lng2))
|
|
|
- // console.log(this.Rad(28.678651))
|
|
|
var radLat1 = this.Rad(lat1);
|
|
|
var radLat2 = this.Rad(lat2);
|
|
|
var a = radLat1 - radLat2;
|