roomType.vue 9.9 KB

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