roomType.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  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. }
  138. },
  139. onLoad() {
  140. // console.log(this.homestayId)
  141. this.getHomestayId()
  142. },
  143. methods: {
  144. selectType(type) {
  145. console.log(type);
  146. this.typeIndex = type;
  147. this.fromData.comboType = type
  148. },
  149. piliangxiajia() {
  150. this.$api.post('/merchant/hotel/repast/batchPutAway', this.from).then(res => {
  151. this.selectedTags = [];
  152. this.Selected = false;
  153. this.getHomestayId(); //获取商品列表
  154. })
  155. },
  156. selectPerson(e, i) {
  157. console.log(e, i);
  158. if (this.selectedTags.includes(e)) {
  159. this.selectedTags = this.selectedTags.filter(t => t !== e);
  160. this.ids.splice(i, 1)
  161. console.log('1111');
  162. } else {
  163. console.log('2222');
  164. this.selectedTags.push(e);
  165. this.ids.push(e.id)
  166. this.from = {
  167. ids: this.ids,
  168. status: e.status == 1 ? 0 : 1
  169. }
  170. }
  171. },
  172. close() {
  173. this.showPricing = false
  174. },
  175. open() {},
  176. Pricing() {
  177. console.log('11111111');
  178. this.showPricing = true
  179. },
  180. // 批量显示
  181. showList() {
  182. this.Selected = !this.Selected
  183. },
  184. // 获取房型列表信息
  185. getHomestayId() {
  186. this.$api.get(`/merchant/hotel/mine/getHouseBaseList/${this.homestayId}`, {
  187. homestayId: this.homestayId
  188. }).then((res) => {
  189. // console.log(res)
  190. this.roomType = res.data.data
  191. // let roomSymbleName=this.roomType.name
  192. // console.log(roomSymbleName)
  193. // console.log(this.roomType)
  194. })
  195. },
  196. // 新增房型
  197. addType(id) {
  198. uni.navigateTo({
  199. url: `/pages/my/houseList?id=${this.homestayId}`
  200. })
  201. },
  202. // 修改房型信息
  203. goEditTypeInfo(houseBaseId) {
  204. uni.navigateTo({
  205. url: `/pages/my/houseList?houseBaseId=${houseBaseId}`
  206. })
  207. console.log(houseBaseId)
  208. }
  209. }
  210. }
  211. </script>
  212. <style lang="scss">
  213. .u-input__content {
  214. margin-top: 22rpx !important;
  215. }
  216. .uicon-arrow-right,
  217. .uicon-close-circle-fill {
  218. margin-top: 32rpx !important;
  219. margin-right: 20rpx !important;
  220. }
  221. .pop-pop {
  222. height: 65vh;
  223. padding: 46rpx 20rpx 0;
  224. .hander-one {
  225. display: flex;
  226. justify-content: space-between;
  227. .text {
  228. font-size: 36rpx;
  229. color: #333333;
  230. font-weight: bold;
  231. }
  232. .del {}
  233. }
  234. .hander-two {
  235. display: flex;
  236. align-items: center;
  237. margin: 30rpx 0;
  238. .hander-two-text {
  239. font-size: 30rpx;
  240. color: #333333;
  241. font-weight: Regular;
  242. }
  243. .hander-two-image {
  244. display: flex;
  245. align-items: center;
  246. .image {
  247. margin: 0 10rpx;
  248. width: 30rpx;
  249. height: 30rpx;
  250. image {
  251. width: 100%;
  252. height: 100%;
  253. }
  254. }
  255. }
  256. }
  257. .hander-three {
  258. display: flex;
  259. border: 1rpx solid #CCCCCC;
  260. border-radius: 16rpx;
  261. justify-content: space-between;
  262. height: 102rpx;
  263. line-height: 102rpx;
  264. .hander-three-text {
  265. width: 200rpx;
  266. text-align: left;
  267. display: flex;
  268. justify-content: space-between;
  269. margin: 0 20rpx;
  270. }
  271. .hander-three-input {
  272. width: 55%;
  273. }
  274. .hander-three-icon {
  275. height: 102rpx;
  276. line-height: 102rpx;
  277. }
  278. }
  279. .hander-four {
  280. margin-top: 30rpx;
  281. display: flex;
  282. border-radius: 16rpx;
  283. justify-content: space-between;
  284. border: 1rpx solid #CCCCCC;
  285. height: 102rpx;
  286. line-height: 102rpx;
  287. .hander-three-text {
  288. width: 200rpx;
  289. text-align: center;
  290. display: flex;
  291. justify-content: space-between;
  292. margin: 0 20rpx;
  293. }
  294. .hander-three-input {
  295. width: 55%;
  296. }
  297. .hander-three-icon {
  298. height: 102rpx;
  299. line-height: 102rpx;
  300. }
  301. }
  302. }
  303. .page {
  304. background: #F3F4F4;
  305. padding-bottom: 260rpx;
  306. box-sizing: border-box;
  307. overflow-y: auto;
  308. overflow-x: auto;
  309. }
  310. .typeNum {
  311. // width: 100%;
  312. height: 73rpx;
  313. display: flex;
  314. justify-content: space-between;
  315. padding: 23rpx 24rpx;
  316. align-items: center;
  317. // .left {}
  318. .right {
  319. display: flex;
  320. align-items: center;
  321. .image {
  322. margin: 0 10rpx;
  323. width: 30rpx;
  324. height: 30rpx;
  325. image {
  326. width: 100%;
  327. height: 100%;
  328. }
  329. }
  330. .text {
  331. font-size: 28rpx;
  332. font-weight: Regular;
  333. color: #333333;
  334. }
  335. }
  336. }
  337. .type {
  338. margin: 0 auto;
  339. border-radius: 10rpx 10rpx 10rpx 10rpx;
  340. width: 86%;
  341. // height: 114rpx;
  342. background-color: #fff;
  343. padding: 30rpx;
  344. margin-bottom: 20rpx;
  345. display: flex;
  346. .left {
  347. height: 114rpx;
  348. line-height: 114rpx;
  349. margin-right: 20rpx;
  350. .image {
  351. margin: 0 10rpx;
  352. width: 30rpx;
  353. height: 30rpx;
  354. image {
  355. width: 100%;
  356. height: 100%;
  357. }
  358. }
  359. }
  360. .right {
  361. width: 100%;
  362. }
  363. }
  364. .top {
  365. display: flex;
  366. justify-content: space-between;
  367. }
  368. .under {
  369. margin-top: 40rpx;
  370. display: flex;
  371. justify-content: space-between;
  372. }
  373. .btn-btn {
  374. width: 100%;
  375. height: 136rpx;
  376. background-color: #fff;
  377. position: fixed;
  378. bottom: 0;
  379. padding: 30rpx 0 0;
  380. // margin: 0 auto;
  381. z-index: 9;
  382. // margin-top: 30rpx;
  383. // margin-left: 30rpx;
  384. .bottom-btn {
  385. display: flex;
  386. justify-content: space-between;
  387. margin: 0 24rpx;
  388. .left {
  389. width: 25%;
  390. display: flex;
  391. align-items: center;
  392. .image {
  393. width: 38rpx;
  394. height: 38rpx;
  395. margin: 0 10rpx;
  396. image {
  397. width: 100%;
  398. height: 100%;
  399. }
  400. }
  401. }
  402. .right {
  403. width: 75%;
  404. display: flex;
  405. justify-content: space-evenly;
  406. .right-btn {
  407. width: 148rpx;
  408. height: 80rpx;
  409. line-height: 80rpx;
  410. background-color: #1372FF;
  411. border-radius: 16rpx;
  412. font-size: 26rpx;
  413. color: #fff;
  414. font-weight: Regular;
  415. text-align: center;
  416. }
  417. }
  418. }
  419. }
  420. .btn {
  421. margin: 0 auto;
  422. width: 690rpx;
  423. height: 96rpx;
  424. background-color: #1372FF;
  425. color: #fff;
  426. display: flex;
  427. justify-content: center;
  428. align-items: center;
  429. font-size: 34rpx;
  430. border-radius: 48rpx;
  431. }
  432. </style>