|
@@ -23,7 +23,7 @@
|
|
<view :class="houseType==index?'houseType-item-active':'houseType-item'" v-for="item,index in houselist"
|
|
<view :class="houseType==index?'houseType-item-active':'houseType-item'" v-for="item,index in houselist"
|
|
@click="chooseHouse(index,item.price,item.room_id)">
|
|
@click="chooseHouse(index,item.price,item.room_id)">
|
|
<view class="image">
|
|
<view class="image">
|
|
- <image :src="item.room_picture" @touchend="dblclick(item.room_picture)" ></image>
|
|
|
|
|
|
+ <image :src="item.room_picture" @touchend="dblclick(item.room_picture)"></image>
|
|
<view class="surplus">
|
|
<view class="surplus">
|
|
剩余 {{item.number}}
|
|
剩余 {{item.number}}
|
|
</view>
|
|
</view>
|
|
@@ -110,7 +110,7 @@
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
- <u-popup :show="details" @close="details = false" duration="0" :overlay="false"
|
|
|
|
|
|
+ <u-popup :show="details" @close="details = false" duration="0" :overlay="false"
|
|
:customStyle="{'margin-bottom':'104rpx','background':' #F9F9F9 ','height':'104rpx'}">
|
|
:customStyle="{'margin-bottom':'104rpx','background':' #F9F9F9 ','height':'104rpx'}">
|
|
<view class="order">
|
|
<view class="order">
|
|
<view class="icon" @click="details = false">
|
|
<view class="icon" @click="details = false">
|
|
@@ -182,11 +182,11 @@
|
|
// 同住人
|
|
// 同住人
|
|
cohabits: [],
|
|
cohabits: [],
|
|
room_id: 0,
|
|
room_id: 0,
|
|
- value:1
|
|
|
|
|
|
+ value: 1
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
- that=this
|
|
|
|
|
|
+ that = this
|
|
console.log(options)
|
|
console.log(options)
|
|
let newdays = decodeURIComponent(options.obj)
|
|
let newdays = decodeURIComponent(options.obj)
|
|
let datainfo = JSON.parse(newdays)
|
|
let datainfo = JSON.parse(newdays)
|
|
@@ -201,23 +201,45 @@
|
|
this.init()
|
|
this.init()
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
- console.log(this.$store.state.peopleList)
|
|
|
|
- this.travelers = this.$store.state.peopleList
|
|
|
|
|
|
+ let open = this.$store.state.openpeopleList
|
|
|
|
+ console.log(open, 890890890)
|
|
|
|
+ if (open == 0) {
|
|
|
|
+ this.$store.commit('getpeopleList', [])
|
|
|
|
+ } else {
|
|
|
|
+ let arr = this.$store.state.peopleList
|
|
|
|
+ this.travelers = []
|
|
|
|
+ arr.forEach(item => {
|
|
|
|
+ if (item.checked) {
|
|
|
|
+ this.travelers.push(item)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ // console.log(this.$store.state.peopleList,7789789)
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ onUnload(event) { //监听是否跳转页面
|
|
|
|
+ if (this.tjzt) {
|
|
|
|
+ //tjzt为变量
|
|
|
|
+ } else {
|
|
|
|
+ let arr = []
|
|
|
|
+ this.$store.commit("getpeopleList", arr)
|
|
|
|
+ this.$store.commit("getopenpeopleList", 0)
|
|
|
|
+ }
|
|
|
|
+
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
- moveAdd(index){
|
|
|
|
- let addPel=this.travelers[index]
|
|
|
|
- addPel.state=0
|
|
|
|
|
|
+ moveAdd(index) {
|
|
|
|
+ let addPel = this.travelers[index]
|
|
|
|
+ addPel.state = 0
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url:`/pages/peopleList/addPeople?state=0&info=${JSON.stringify(addPel)}`
|
|
|
|
|
|
+ url: `/pages/peopleList/addPeople?state=0&info=${JSON.stringify(addPel)}`
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- dblclick(url,e) {
|
|
|
|
|
|
+ dblclick(url, e) {
|
|
this.touchNum++
|
|
this.touchNum++
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
- if (this.touchNum == 1) {
|
|
|
|
- }
|
|
|
|
|
|
+ if (this.touchNum == 1) {}
|
|
if (this.touchNum >= 2) {
|
|
if (this.touchNum >= 2) {
|
|
let imgUrl = []
|
|
let imgUrl = []
|
|
imgUrl.push(url)
|
|
imgUrl.push(url)
|
|
@@ -238,17 +260,23 @@
|
|
let end = newdays.end_at.slice(0, 10)
|
|
let end = newdays.end_at.slice(0, 10)
|
|
this.day = `${start}~${end}`
|
|
this.day = `${start}~${end}`
|
|
this.houselist = newdays.rooms
|
|
this.houselist = newdays.rooms
|
|
- this.room_id=this.houselist[0].room_id
|
|
|
|
- this.houseType=0
|
|
|
|
- this.roomPrice=Number(this.houselist[0].price)
|
|
|
|
- this.totalromprice=Number(this.houselist[0].price)
|
|
|
|
-
|
|
|
|
|
|
+ this.room_id = this.houselist[0].room_id
|
|
|
|
+ this.houseType = 0
|
|
|
|
+ this.roomPrice = Number(this.houselist[0].price)
|
|
|
|
+ this.totalromprice = Number(this.houselist[0].price)
|
|
|
|
+
|
|
console.log(this.day, this.houselist)
|
|
console.log(this.day, this.houselist)
|
|
},
|
|
},
|
|
// 选择出行人
|
|
// 选择出行人
|
|
choosePeople() {
|
|
choosePeople() {
|
|
|
|
+ let list = this.$store.state.peopleList
|
|
|
|
+ let obj = {
|
|
|
|
+ value: this.value,
|
|
|
|
+ list: list
|
|
|
|
+ }
|
|
|
|
+ console.log(obj, 9999999)
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url: "/pages/peopleList/peopleList?value="+this.value,
|
|
|
|
|
|
+ url: "/pages/peopleList/peopleList?obj=" + JSON.stringify(obj),
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 查看出行人
|
|
// 查看出行人
|
|
@@ -270,15 +298,19 @@
|
|
},
|
|
},
|
|
// 选择房间数量
|
|
// 选择房间数量
|
|
valChange(e) {
|
|
valChange(e) {
|
|
- this.value=e.value
|
|
|
|
|
|
+ let arr = []
|
|
|
|
+ this.$store.commit("getpeopleList", arr)
|
|
|
|
+ this.travelers = []
|
|
|
|
+ console.log(this.travelers, 77788)
|
|
|
|
+ this.value = e.value
|
|
this.totalromprice = Number(this.roomPrice) * e.value
|
|
this.totalromprice = Number(this.roomPrice) * e.value
|
|
},
|
|
},
|
|
// 添加同住人e
|
|
// 添加同住人e
|
|
addcohabits() {
|
|
addcohabits() {
|
|
-
|
|
|
|
- for(let i in this.cohabits){
|
|
|
|
|
|
+
|
|
|
|
+ for (let i in this.cohabits) {
|
|
console.log(i)
|
|
console.log(i)
|
|
- if(this.cohabits[i]==''){
|
|
|
|
|
|
+ if (this.cohabits[i] == '') {
|
|
console.log(i)
|
|
console.log(i)
|
|
this.$toast("请输入正确的同住人姓名")
|
|
this.$toast("请输入正确的同住人姓名")
|
|
return
|
|
return
|
|
@@ -291,23 +323,23 @@
|
|
this.houseType = index
|
|
this.houseType = index
|
|
this.roomPrice = price
|
|
this.roomPrice = price
|
|
this.room_id = id
|
|
this.room_id = id
|
|
- this.totalromprice = Number(this.roomPrice)*this.value
|
|
|
|
|
|
+ this.totalromprice = Number(this.roomPrice) * this.value
|
|
console.log(index, price, id, "<=============")
|
|
console.log(index, price, id, "<=============")
|
|
},
|
|
},
|
|
// 提交订单
|
|
// 提交订单
|
|
Submit() {
|
|
Submit() {
|
|
- if(this.chooseroommate==2){
|
|
|
|
- for(let i in this.cohabits){
|
|
|
|
|
|
+ if (this.chooseroommate == 2) {
|
|
|
|
+ for (let i in this.cohabits) {
|
|
console.log(i)
|
|
console.log(i)
|
|
- if(this.cohabits[i]==''){
|
|
|
|
|
|
+ if (this.cohabits[i] == '') {
|
|
console.log(i)
|
|
console.log(i)
|
|
this.$toast("请输入正确的同住人姓名")
|
|
this.$toast("请输入正确的同住人姓名")
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- if(this.travelers.length==0){
|
|
|
|
|
|
+
|
|
|
|
+ if (this.travelers.length == 0) {
|
|
this.$toast("请选择出行人")
|
|
this.$toast("请选择出行人")
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -319,7 +351,7 @@
|
|
suborder.travelers = []
|
|
suborder.travelers = []
|
|
suborder.cohabits = this.cohabits
|
|
suborder.cohabits = this.cohabits
|
|
suborder.cohabit_type = this.chooseroommate
|
|
suborder.cohabit_type = this.chooseroommate
|
|
- suborder.total=this.totalromprice
|
|
|
|
|
|
+ suborder.total = this.totalromprice
|
|
this.travelers.forEach((item, index) => {
|
|
this.travelers.forEach((item, index) => {
|
|
// console.log(item.id)
|
|
// console.log(item.id)
|
|
suborder.travelers.push(item.id)
|
|
suborder.travelers.push(item.id)
|
|
@@ -330,22 +362,15 @@
|
|
auth: true
|
|
auth: true
|
|
}
|
|
}
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
-// <<<<<<< HEAD
|
|
|
|
- // console.log(res)
|
|
|
|
- // suborder.name = this.goodsInfo.name
|
|
|
|
- // suborder.subtitle = this.goodsInfo.subtitle
|
|
|
|
- // suborder.day = this.day
|
|
|
|
- // suborder.people = []
|
|
|
|
- // this.travelers.forEach((item, index) => {
|
|
|
|
-// =======
|
|
|
|
|
|
+
|
|
console.log(res)
|
|
console.log(res)
|
|
- suborder.order_id=res.id // 订单id
|
|
|
|
- suborder.name=this.goodsInfo.name
|
|
|
|
- suborder.subtitle=this.goodsInfo.subtitle
|
|
|
|
- suborder.day=this.day
|
|
|
|
- suborder.people=[]
|
|
|
|
- this.travelers.forEach((item,index)=>{
|
|
|
|
-// >>>>>>> 4815da3871d3be566f42d407886303debb6a2364
|
|
|
|
|
|
+ suborder.order_id = res.id // 订单id
|
|
|
|
+ suborder.name = this.goodsInfo.name
|
|
|
|
+ suborder.subtitle = this.goodsInfo.subtitle
|
|
|
|
+ suborder.day = this.day
|
|
|
|
+ suborder.people = []
|
|
|
|
+ this.travelers.forEach((item, index) => {
|
|
|
|
+
|
|
suborder.people.push(item.name)
|
|
suborder.people.push(item.name)
|
|
})
|
|
})
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|