|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<view class="page" :style="{'height':(h-th)+'px','padding-top':mt+'px'}">
|
|
<view class="page" :style="{'height':(h-th)+'px','padding-top':mt+'px'}">
|
|
- <c-nav-bar title="房间列表" :showIcon="false" :titleStyle="titleStyle"></c-nav-bar>
|
|
|
|
|
|
+ <c-nav-bar title="房型信息" :showIcon="false" :titleStyle="titleStyle"></c-nav-bar>
|
|
<view class="body">
|
|
<view class="body">
|
|
<!-- 房型信息 -->
|
|
<!-- 房型信息 -->
|
|
|
|
|
|
@@ -22,7 +22,7 @@
|
|
<text style="font-size: 30rpx; " >是否上架</text>
|
|
<text style="font-size: 30rpx; " >是否上架</text>
|
|
</view>
|
|
</view>
|
|
<view style="margin-right: 30rpx;">
|
|
<view style="margin-right: 30rpx;">
|
|
- <u-switch v-model="checked" size="50" @change="change(status)" active-color="#07C160" ></u-switch>
|
|
|
|
|
|
+ <u-switch v-model="checked" size="50" active-color="#07C160" ></u-switch>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 图片上传
|
|
<!-- 图片上传
|
|
@@ -37,9 +37,9 @@
|
|
</view>
|
|
</view>
|
|
<view class="pic">
|
|
<view class="pic">
|
|
<!-- 图片 -->
|
|
<!-- 图片 -->
|
|
|
|
+ <img @click="handelUpload" ref="pic-upload" src="https://img.51miz.com/Element/00/77/24/47/cd39208d_E772447_a1d65d72.png" style="width: 190rpx; height: 120rpx;" />
|
|
<view v-show="false" >
|
|
<view v-show="false" >
|
|
<u-upload :action="action" :file-list="fileList" >
|
|
<u-upload :action="action" :file-list="fileList" >
|
|
- <!-- <img src="https://img.51miz.com/Element/00/77/24/47/cd39208d_E772447_a1d65d72.png" style="width: 190rpx; height: 120rpx;" /> -->
|
|
|
|
</u-upload>
|
|
</u-upload>
|
|
|
|
|
|
</view>
|
|
</view>
|
|
@@ -151,16 +151,16 @@
|
|
<text style="font-size: 24rpx; color: #777;">共8个房间</text>
|
|
<text style="font-size: 24rpx; color: #777;">共8个房间</text>
|
|
</view>
|
|
</view>
|
|
<!-- 房间号 -->
|
|
<!-- 房间号 -->
|
|
- <view class="priceBoxWeek">
|
|
|
|
|
|
+ <view class="priceBoxWeek" v-for="(room,index) in form.roomFloor" :key="index">
|
|
<view class="weekendBox" style="display: flex; justify-content: space-between;">
|
|
<view class="weekendBox" style="display: flex; justify-content: space-between;">
|
|
<view style="display: flex;">
|
|
<view style="display: flex;">
|
|
- <text> 楼层:</text><input style="width: 50rpx;" v-model="form.roomFloor[0].floor" type="text" />
|
|
|
|
|
|
+ <text> 楼层:</text><input style="width: 70rpx;" v-model="room.floor" type="text" />
|
|
</view>
|
|
</view>
|
|
<view style="display: flex;">
|
|
<view style="display: flex;">
|
|
- <text > 房间号:</text><input style="width: 50rpx;" v-model="form.roomFloor[0].roomNumber" type="text" />
|
|
|
|
|
|
+ <text > 房间号:</text><input style="width: 70rpx;" v-model="room.roomNumber" type="text" />
|
|
</view>
|
|
</view>
|
|
|
|
|
|
- <view style="display: flex; margin-top: 10rpx;">
|
|
|
|
|
|
+ <view style="display: flex; margin-top: 10rpx;" @click="delRoom(index)">
|
|
<u-icon name="trash"></u-icon>
|
|
<u-icon name="trash"></u-icon>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -170,7 +170,7 @@
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<!-- 添加按钮 -->
|
|
<!-- 添加按钮 -->
|
|
- <view class="submit">
|
|
|
|
|
|
+ <view class="submit" @click="addRoom">
|
|
<u-icon name="plus-circle" color=" #1372FF"></u-icon>
|
|
<u-icon name="plus-circle" color=" #1372FF"></u-icon>
|
|
<text style="color: #1372FF; font-size: 30rpx;">添加房间</text>
|
|
<text style="color: #1372FF; font-size: 30rpx;">添加房间</text>
|
|
</view>
|
|
</view>
|
|
@@ -189,7 +189,7 @@
|
|
export default{
|
|
export default{
|
|
data(){
|
|
data(){
|
|
return{
|
|
return{
|
|
- checked:false,
|
|
|
|
|
|
+
|
|
weekedChecked:false,
|
|
weekedChecked:false,
|
|
action: '',//图片服务器地址
|
|
action: '',//图片服务器地址
|
|
fileList: [
|
|
fileList: [
|
|
@@ -197,8 +197,12 @@
|
|
url: '',
|
|
url: '',
|
|
}
|
|
}
|
|
],
|
|
],
|
|
|
|
+ id:'',
|
|
|
|
+ // roomTypeInfo:{},
|
|
|
|
|
|
|
|
+ checked:true,
|
|
form:{
|
|
form:{
|
|
|
|
+ isPutAway:1,
|
|
homestayId:'',
|
|
homestayId:'',
|
|
mondayPrice:'',
|
|
mondayPrice:'',
|
|
tuesdayPrice:'',
|
|
tuesdayPrice:'',
|
|
@@ -220,25 +224,61 @@
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|
|
- onLoad({id}){
|
|
|
|
|
|
+ onLoad({id,houseBaseId}){
|
|
this.form.homestayId=id
|
|
this.form.homestayId=id
|
|
- console.log(this.form.homestayId)
|
|
|
|
|
|
+ // console.log(houseBaseId)
|
|
|
|
+ this.id=houseBaseId
|
|
|
|
+ // console.log(this.id)
|
|
|
|
+ this.getTypeInfo()
|
|
|
|
|
|
},
|
|
},
|
|
methods:{
|
|
methods:{
|
|
// change(status) {
|
|
// change(status) {
|
|
// console.log(status);
|
|
// console.log(status);
|
|
// },
|
|
// },
|
|
|
|
+ // 添加&编辑房屋
|
|
addNewRoom(){
|
|
addNewRoom(){
|
|
- this.$api.post('/merchant/hotel/mine/addHouseBase',this.form).then(res=>{
|
|
|
|
- console.log(res)
|
|
|
|
|
|
+
|
|
|
|
+ if(!this.id){
|
|
|
|
+ this.$api.post('/merchant/hotel/mine/addHouseBase',this.form).then(res=>{
|
|
|
|
+ console.log(res)
|
|
|
|
+ if(res.data.code===0){
|
|
|
|
+ this.$showToast('添加成功');
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ uni.reLaunch({
|
|
|
|
+ url:'/pages/my/roomType'
|
|
|
|
+ })
|
|
|
|
+ },1500)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ console.log('这是')
|
|
|
|
+ }else{
|
|
|
|
+ // console.log('这是修改')
|
|
|
|
+ this.$api.put('/merchant/hotel/mine/updHouseBase',this.form).then(res=>{
|
|
|
|
+ console.log('修改成功')
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 添加房间
|
|
|
|
+ addRoom(){
|
|
|
|
+ const newRoom = {floor:'',roomNumber:''}
|
|
|
|
+ this.form.roomFloor.push(newRoom)
|
|
|
|
+ },
|
|
|
|
+ // 删除房间
|
|
|
|
+ delRoom(index){
|
|
|
|
+ this.form.roomFloor.splice(index,1)
|
|
|
|
+ },
|
|
|
|
+ handelUpload(){
|
|
|
|
+ this.$refs['pic-upload'].click()
|
|
|
|
+ },
|
|
|
|
+ // 获取当前房型信息
|
|
|
|
+ getTypeInfo(){
|
|
|
|
+ this.$api.get(`/merchant/hotel/mine/getHouseBaseInfo/${this.id}`).then((res)=>{
|
|
|
|
+ // console.log(res)
|
|
if(res.data.code===0){
|
|
if(res.data.code===0){
|
|
- this.$showToast('添加成功');
|
|
|
|
- setTimeout(()=>{
|
|
|
|
- uni.reLaunch({
|
|
|
|
- url:'/pages/my/roomType'
|
|
|
|
- })
|
|
|
|
- },1500)
|
|
|
|
|
|
+ this.form=res.data.data
|
|
|
|
+ // console.log(this.roomTypeInfo)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|