1
0

2 Commits 5106010f71 ... abb786123b

Autor SHA1 Nachricht Datum
  2912631854@qq.com abb786123b Merge branch 'master' of http://git.ringzle.com:3000/htcwl/hotelHomestayWx vor 3 Monaten
  2912631854@qq.com 96ed44d260 feat: 房型管理 vor 3 Monaten
1 geänderte Dateien mit 45 neuen und 57 gelöschten Zeilen
  1. 45 57
      pages/my/roomType.vue

+ 45 - 57
pages/my/roomType.vue

@@ -90,7 +90,8 @@
 						每天价格
 					</view>
 
-					<u-radio-group @change="selectType" size="32" iconSize="24" placement="row" activeColor='#1372FF'>
+					<u-radio-group @change="selectType" size="32" v-model="typeIndex" iconSize="24" placement="row"
+						activeColor='#1372FF'>
 						<u-radio labelSize='30' label="固定设置" :name='1'></u-radio>
 						<u-radio labelSize='30' label="按天设置" :name='2' v-if="tabIndex==0"></u-radio>
 					</u-radio-group>
@@ -234,31 +235,11 @@
 			},
 			showTimeOne() {
 				this.showOne = true
-
-				// if (this.typeIndex == 1) {
 				this.mode = 'single'
-				// this.valueTimeOne = ''
-				// this.valueTimeTwo = ''
-				// this.fromData.price = ''
-				// } else if (this.typeIndex == 2) {
-				// 	this.mode = 'single'
-				// 	this.valueTimeOne = ''
-				// 	this.valueTimeTwo = ''
-				// }
 			},
 			showTimeTwo() {
 				this.showTwo = true
-
-				// if (this.typeIndex == 1) {
 				this.mode = 'single'
-				// this.valueTimeOne = ''
-				// this.valueTimeTwo = ''
-				// this.fromData.price = ''
-				// } else if (this.typeIndex == 2) {
-				// 	this.mode = 'range'
-				// 	this.valueTimeOne = ''
-				// 	this.valueTimeTwo = ''
-				// }
 			},
 			addTime() {
 				this.fromData.homestayId = uni.getStorageSync('homestayId')
@@ -316,46 +297,51 @@
 
 			// 下架
 			piliangxiajia() {
-				let obj = {
-					isPutaway: 0,
-					idList: this.fromData.houseBaseIdList
-				}
-				console.log(this.selectedTags);
-				this.$api.post('/merchant/hotel/room/state/updPutawayState', obj).then(res => {
-					if (res.data.code == 0) {
-						this.$showToast('下架成功')
-						setTimeout(() => {
-							this.showPricing = false
-							this.getHomestayId()
-							this.Selected = false
-							this.selectedTags = []
-							this.fromData.houseBaseIdList = []
-						}, 1000)
-					} else this.$showToast(res.data.msg)
-
-				})
+				if (this.fromData.houseBaseIdList.length != 0) {
+					let obj = {
+						isPutaway: 0,
+						idList: this.fromData.houseBaseIdList
+					}
+					console.log(this.selectedTags);
+					this.$api.post('/merchant/hotel/room/state/updPutawayState', obj).then(res => {
+						if (res.data.code == 0) {
+							this.$showToast('下架成功')
+							setTimeout(() => {
+								this.showPricing = false
+								this.getHomestayId()
+								this.Selected = false
+								this.selectedTags = []
+								this.fromData.houseBaseIdList = []
+							}, 1000)
+						} else this.$showToast(res.data.msg)
+
+					})
+				} else this.$showToast('请选择房型')
 			},
 
 			// 上架
 			piliangshangjia() {
+				if (this.fromData.houseBaseIdList.length != 0) {
+					let obj = {
+						isPutaway: 1,
+						idList: this.fromData.houseBaseIdList
+					}
+					this.$api.post('/merchant/hotel/room/state/updPutawayState', obj).then(res => {
+						console.log(res);
+						if (res.data.code == 0) {
+							this.$showToast('上架成功')
+							setTimeout(() => {
+								this.showPricing = false
+								this.getHomestayId()
+								this.Selected = false
+								this.selectedTags = []
+								this.fromData.houseBaseIdList = []
+							}, 1000)
+						} else this.$showToast(res.data.msg)
+					})
+				} else this.$showToast('请选择房型')
+
 
-				let obj = {
-					isPutaway: 1,
-					idList: this.fromData.houseBaseIdList
-				}
-				this.$api.post('/merchant/hotel/room/state/updPutawayState', obj).then(res => {
-					console.log(res);
-					if (res.data.code == 0) {
-						this.$showToast('上架成功')
-						setTimeout(() => {
-							this.showPricing = false
-							this.getHomestayId()
-							this.Selected = false
-							this.selectedTags = []
-							this.fromData.houseBaseIdList = []
-						}, 1000)
-					} else this.$showToast(res.data.msg)
-				})
 
 			},
 
@@ -387,7 +373,9 @@
 			open() {},
 			Pricing() {
 				console.log('11111111');
-				this.showPricing = true
+				if (this.fromData.houseBaseIdList.length != 0) {
+					this.showPricing = true
+				} else this.$showToast('请选择房型')
 			},
 			// 批量显示
 			showList() {