roomType.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. <template>
  2. <view class="page" :style="{'height':(h-th)+'px','padding-top':mt+'px'}">
  3. <c-nav-bar title="房型列表" :showIcon="true"></c-nav-bar>
  4. <!-- 房型数量 -->
  5. <view class="typeNum">
  6. <view class="left" style="font-size: 24rpx; color: #777;">
  7. 共{{roomType.length}}个房型
  8. </view>
  9. <view class="right" @click="showList">
  10. <view class="image">
  11. <image src="https://i.ringzle.com/file/20240313/f3d301b3bc4544ffaf5a0d96a761dd00.png" mode="">
  12. </image>
  13. </view>
  14. <view class="text">
  15. 批量操作
  16. </view>
  17. </view>
  18. </view>
  19. <!-- 房型选择 -->
  20. <view class="type" v-for="item in roomType" :key="item.houseBaseId">
  21. <view class="left" v-if="Selected==true">
  22. <view class="image">
  23. <image @tap="selectPerson()"
  24. :src="isSelect?'https://i.ringzle.com/file/20240228/c741a340e19642c59473e6f4a6d2f4be.png':'https://i.ringzle.com/file/20231027/db588133d67548fc82dfb0d128eac9a8.png'">
  25. </image>
  26. </view>
  27. </view>
  28. <view class="right" @click="goEditTypeInfo(item.houseBaseId)">
  29. <view class="top">
  30. <text style="font-size: 30rpx; color: #333;">{{item.name}}</text>
  31. <u-icon name="arrow-right"></u-icon>
  32. </view>
  33. <view class="under">
  34. <text style="font-size: 24rpx; color: #777;">{{item.shortName}}</text>
  35. <text style="font-size: 24rpx; color: #777;">{{item.roomCount}}间</text>
  36. </view>
  37. </view>
  38. </view>
  39. <!-- 批量按钮 -->
  40. <view class="btn-btn" v-if="Selected==true">
  41. <view class="bottom-btn">
  42. <view class="left">
  43. <view class="image">
  44. <image @tap="selectPerson()"
  45. :src="isSelect?'https://i.ringzle.com/file/20240228/c741a340e19642c59473e6f4a6d2f4be.png':'https://i.ringzle.com/file/20231027/db588133d67548fc82dfb0d128eac9a8.png'">
  46. </image>
  47. </view>
  48. <view class="text">
  49. 已选:1
  50. </view>
  51. </view>
  52. <view class="right">
  53. <view class="right-btn">
  54. 批量下架
  55. </view>
  56. <view class="right-btn" @click="Pricing()">
  57. 批量定价
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. <!-- 新增按钮 -->
  63. <view class="btn-btn" @click="addType(id)" v-else>
  64. <view class="btn">
  65. 新增
  66. </view>
  67. </view>
  68. <u-popup :show="showPricing" @close="close" @open="open">
  69. <view class="pop-pop">
  70. <view class="hander-one">
  71. <view class="">
  72. </view>
  73. <view class="text">
  74. 批量定价
  75. </view>
  76. <view class="del" @click="close">
  77. <u-icon name="close" color=""></u-icon>
  78. </view>
  79. </view>
  80. <view class="hander-two">
  81. <view class="hander-two-text">
  82. 每天价格
  83. </view>
  84. <view class="hander-two-image">
  85. <view class="image">
  86. <image @tap="selectPerson()"
  87. :src="isSelect?'https://i.ringzle.com/file/20240228/c741a340e19642c59473e6f4a6d2f4be.png':'https://i.ringzle.com/file/20231027/db588133d67548fc82dfb0d128eac9a8.png'">
  88. </image>
  89. </view>
  90. <view class="hander-two-text">
  91. 固定设置
  92. </view>
  93. </view>
  94. <view class="hander-two-image">
  95. <view class="image">
  96. <image @tap="selectPerson()"
  97. :src="isSelect?'https://i.ringzle.com/file/20240228/c741a340e19642c59473e6f4a6d2f4be.png':'https://i.ringzle.com/file/20231027/db588133d67548fc82dfb0d128eac9a8.png'">
  98. </image>
  99. </view>
  100. <view class="hander-two-text">
  101. 按天设置
  102. </view>
  103. </view>
  104. </view>
  105. <view class="hander-three">
  106. <view class="hander-three-text">
  107. 起始日期
  108. </view>
  109. <view class="hander-three-input">
  110. <u--input placeholder="请选择" border="none" fontSize='26' v-model="value"
  111. @change="change"></u--input>
  112. </view>
  113. <view class="hander-three-icon">
  114. <u-icon name="arrow-right"></u-icon>
  115. </view>
  116. </view>
  117. <view class="hander-four">
  118. <view class="hander-three-text" style="">
  119. <view class="">
  120. 价格
  121. </view>
  122. <view class="">
  123. </view>
  124. </view>
  125. <view class="hander-three-input">
  126. <u--input placeholder="请输入价格" fontSize='26' border="none" v-model="value"
  127. @change="change"></u--input>
  128. </view>
  129. <view class="hander-three-icon">
  130. <u-icon name="close-circle-fill"></u-icon>
  131. </view>
  132. </view>
  133. </view>
  134. </u-popup>
  135. </view>
  136. </template>
  137. <script>
  138. export default {
  139. data() {
  140. return {
  141. homestayId: uni.getStorageSync('homestayId') || 0,
  142. roomType: [],
  143. isSelect: false,
  144. Selected: false,
  145. showPricing: false
  146. }
  147. },
  148. onLoad() {
  149. // console.log(this.homestayId)
  150. this.getHomestayId()
  151. },
  152. methods: {
  153. close() {
  154. this.showPricing = false
  155. },
  156. open() {},
  157. Pricing() {
  158. console.log('11111111');
  159. this.showPricing = true
  160. },
  161. // 选中
  162. selectPerson() {
  163. this.isSelect = !this.isSelect
  164. },
  165. // 批量显示
  166. showList() {
  167. this.Selected = !this.Selected
  168. },
  169. // 获取房型列表信息
  170. getHomestayId() {
  171. this.$api.get(`/merchant/hotel/mine/getHouseBaseList/${this.homestayId}`, {
  172. homestayId: this.homestayId
  173. }).then((res) => {
  174. // console.log(res)
  175. this.roomType = res.data.data
  176. // let roomSymbleName=this.roomType.name
  177. // console.log(roomSymbleName)
  178. // console.log(this.roomType)
  179. })
  180. },
  181. // 新增房型
  182. addType(id) {
  183. uni.navigateTo({
  184. url: `/pages/my/houseList?id=${this.homestayId}`
  185. })
  186. },
  187. // 修改房型信息
  188. goEditTypeInfo(houseBaseId) {
  189. uni.navigateTo({
  190. url: `/pages/my/houseList?houseBaseId=${houseBaseId}`
  191. })
  192. console.log(houseBaseId)
  193. }
  194. }
  195. }
  196. </script>
  197. <style lang="scss">
  198. .u-input__content {
  199. margin-top: 22rpx !important;
  200. }
  201. .uicon-arrow-right,
  202. .uicon-close-circle-fill {
  203. margin-top: 32rpx !important;
  204. margin-right: 20rpx !important;
  205. }
  206. .pop-pop {
  207. height: 65vh;
  208. padding: 46rpx 20rpx 0;
  209. .hander-one {
  210. display: flex;
  211. justify-content: space-between;
  212. .text {
  213. font-size: 36rpx;
  214. color: #333333;
  215. font-weight: bold;
  216. }
  217. .del {}
  218. }
  219. .hander-two {
  220. display: flex;
  221. align-items: center;
  222. margin: 30rpx 0;
  223. .hander-two-text {
  224. font-size: 30rpx;
  225. color: #333333;
  226. font-weight: Regular;
  227. }
  228. .hander-two-image {
  229. display: flex;
  230. align-items: center;
  231. .image {
  232. margin: 0 10rpx;
  233. width: 30rpx;
  234. height: 30rpx;
  235. image {
  236. width: 100%;
  237. height: 100%;
  238. }
  239. }
  240. }
  241. }
  242. .hander-three {
  243. display: flex;
  244. border: 1rpx solid #CCCCCC;
  245. border-radius: 16rpx;
  246. justify-content: space-between;
  247. height: 102rpx;
  248. line-height: 102rpx;
  249. .hander-three-text {
  250. width: 200rpx;
  251. text-align: left;
  252. display: flex;
  253. justify-content: space-between;
  254. margin: 0 20rpx;
  255. }
  256. .hander-three-input {
  257. width: 55%;
  258. }
  259. .hander-three-icon {
  260. height: 102rpx;
  261. line-height: 102rpx;
  262. }
  263. }
  264. .hander-four {
  265. margin-top: 30rpx;
  266. display: flex;
  267. border-radius: 16rpx;
  268. justify-content: space-between;
  269. border: 1rpx solid #CCCCCC;
  270. height: 102rpx;
  271. line-height: 102rpx;
  272. .hander-three-text {
  273. width: 200rpx;
  274. text-align: center;
  275. display: flex;
  276. justify-content: space-between;
  277. margin: 0 20rpx;
  278. }
  279. .hander-three-input {
  280. width: 55%;
  281. }
  282. .hander-three-icon {
  283. height: 102rpx;
  284. line-height: 102rpx;
  285. }
  286. }
  287. }
  288. .page {
  289. background: #F3F4F4;
  290. padding-bottom: 260rpx;
  291. box-sizing: border-box;
  292. overflow-y: auto;
  293. overflow-x: auto;
  294. }
  295. .typeNum {
  296. // width: 100%;
  297. height: 73rpx;
  298. display: flex;
  299. justify-content: space-between;
  300. padding: 23rpx 24rpx;
  301. align-items: center;
  302. // .left {}
  303. .right {
  304. display: flex;
  305. align-items: center;
  306. .image {
  307. margin: 0 10rpx;
  308. width: 30rpx;
  309. height: 30rpx;
  310. image {
  311. width: 100%;
  312. height: 100%;
  313. }
  314. }
  315. .text {
  316. font-size: 28rpx;
  317. font-weight: Regular;
  318. color: #333333;
  319. }
  320. }
  321. }
  322. .type {
  323. margin: 0 auto;
  324. border-radius: 10rpx 10rpx 10rpx 10rpx;
  325. width: 86%;
  326. // height: 114rpx;
  327. background-color: #fff;
  328. padding: 30rpx;
  329. margin-bottom: 20rpx;
  330. display: flex;
  331. .left {
  332. height: 114rpx;
  333. line-height: 114rpx;
  334. margin-right: 20rpx;
  335. .image {
  336. margin: 0 10rpx;
  337. width: 30rpx;
  338. height: 30rpx;
  339. image {
  340. width: 100%;
  341. height: 100%;
  342. }
  343. }
  344. }
  345. .right {
  346. width: 100%;
  347. }
  348. }
  349. .top {
  350. display: flex;
  351. justify-content: space-between;
  352. }
  353. .under {
  354. margin-top: 40rpx;
  355. display: flex;
  356. justify-content: space-between;
  357. }
  358. .btn-btn {
  359. width: 100%;
  360. height: 136rpx;
  361. background-color: #fff;
  362. position: fixed;
  363. bottom: 0;
  364. padding: 30rpx 0 0;
  365. // margin: 0 auto;
  366. z-index: 9;
  367. // margin-top: 30rpx;
  368. // margin-left: 30rpx;
  369. .bottom-btn {
  370. display: flex;
  371. justify-content: space-between;
  372. margin: 0 24rpx;
  373. .left {
  374. width: 25%;
  375. display: flex;
  376. align-items: center;
  377. .image {
  378. width: 38rpx;
  379. height: 38rpx;
  380. margin: 0 10rpx;
  381. image {
  382. width: 100%;
  383. height: 100%;
  384. }
  385. }
  386. }
  387. .right {
  388. width: 75%;
  389. display: flex;
  390. justify-content: space-evenly;
  391. .right-btn {
  392. width: 148rpx;
  393. height: 80rpx;
  394. line-height: 80rpx;
  395. background-color: #1372FF;
  396. border-radius: 16rpx;
  397. font-size: 26rpx;
  398. color: #fff;
  399. font-weight: Regular;
  400. text-align: center;
  401. }
  402. }
  403. }
  404. }
  405. .btn {
  406. margin: 0 auto;
  407. width: 690rpx;
  408. height: 96rpx;
  409. background-color: #1372FF;
  410. color: #fff;
  411. display: flex;
  412. justify-content: center;
  413. align-items: center;
  414. font-size: 34rpx;
  415. border-radius: 48rpx;
  416. }
  417. </style>