houseList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. <template>
  2. <view class="page" :style="{'height':(h-th)+'px','padding-top':mt+'px'}">
  3. <c-nav-bar title="房间列表" :showIcon="false" :titleStyle="titleStyle"></c-nav-bar>
  4. <view class="body">
  5. <!-- 房型信息 -->
  6. <view class="typeInfo">
  7. <view class="titleInfo">
  8. <text style="font-size: 32rpx; font-weight: 700;">房型信息</text>
  9. </view>
  10. <view class="cellBox">
  11. <text style="font-size: 30rpx; margin-right: 30rpx;">房型名称</text>
  12. <input v-model="form.name" type="text" placeholder="请输入房型" style="width: 210rpx;height: 42rpx; font-size: 30rpx;"/>
  13. </view>
  14. <view class="bigRoom">
  15. <text style="font-size: 30rpx;color: black; margin-right: 90rpx;">简称</text>
  16. <input v-model="form.shortName" type="text" placeholder="请输入简称" style="width: 210rpx;height: 42rpx; font-size: 30rpx;"/>
  17. </view>
  18. </view>
  19. <view class="shelves">
  20. <view style="margin-left: 30rpx;">
  21. <text style="font-size: 30rpx; " >是否上架</text>
  22. </view>
  23. <view style="margin-right: 30rpx;">
  24. <u-switch v-model="checked" size="50" @change="change(status)" active-color="#07C160" ></u-switch>
  25. </view>
  26. </view>
  27. <!-- 图片上传
  28. -->
  29. <view class="uploadPic">
  30. <view style=" margin-left: 30rpx;">
  31. <text style="font-size: 32rpx; font-weight: 700; ">封面图片(0/1)</text>
  32. </view>
  33. <view style="margin-top: 20rpx; margin-left: 30rpx; color: #777; font-size: 24rpx;">
  34. <text>仅能上传1张,需展示房间内容</text>
  35. </view>
  36. <view class="pic">
  37. <!-- 图片 -->
  38. <view v-show="false" >
  39. <u-upload :action="action" :file-list="fileList" >
  40. <!-- <img src="https://img.51miz.com/Element/00/77/24/47/cd39208d_E772447_a1d65d72.png" style="width: 190rpx; height: 120rpx;" /> -->
  41. </u-upload>
  42. </view>
  43. </view>
  44. </view>
  45. <!-- 价格信息 -->
  46. <view class="priceInfo">
  47. <!-- 标题 -->
  48. <view class="titleInfo">
  49. <text style="font-size: 32rpx; font-weight: 700; margin-left: 10rpx;">价格信息</text>
  50. </view>
  51. <!-- 周末周日区分 -->
  52. <view class="week">
  53. <view class="weekend">
  54. <view >
  55. <text style="font-size: 30rpx; " >区分平日周末</text>
  56. </view>
  57. <view >
  58. <u-switch v-model="weekedChecked" size="50" active-color="#07C160" ></u-switch>
  59. </view>
  60. </view>
  61. </view>
  62. <!-- 每日价格 -->
  63. <view class="priceBoxWeek">
  64. <view class="weekendBox">
  65. <view >
  66. <text style="font-size: 30rpx; margin-right: 90rpx; " >周一</text>
  67. </view>
  68. <view style="display: flex;">
  69. <text style="font-size: 30rpx;">¥</text> <input v-model="form.mondayPrice" type="text" placeholder="请输入价格" style="width: 210rpx;height: 42rpx; font-size: 30rpx;"/>
  70. </view>
  71. </view>
  72. </view>
  73. <view class="priceBoxWeek">
  74. <view class="weekendBox">
  75. <view >
  76. <text style="font-size: 30rpx; margin-right: 90rpx; " >周二</text>
  77. </view>
  78. <view style="display: flex;">
  79. <text style="font-size: 30rpx;">¥</text> <input v-model="form.tuesdayPrice" type="text" placeholder="请输入价格" style="width: 210rpx;height: 42rpx; font-size: 30rpx;"/>
  80. </view>
  81. </view>
  82. </view>
  83. <view class="priceBoxWeek">
  84. <view class="weekendBox">
  85. <view >
  86. <text style="font-size: 30rpx; margin-right: 90rpx; " >周三</text>
  87. </view>
  88. <view style="display: flex;">
  89. <text style="font-size: 30rpx;">¥</text> <input v-model="form.wednesdayPrice" type="text" placeholder="请输入价格" style="width: 210rpx;height: 42rpx; font-size: 30rpx;"/>
  90. </view>
  91. </view>
  92. </view>
  93. <view class="priceBoxWeek">
  94. <view class="weekendBox">
  95. <view >
  96. <text style="font-size: 30rpx; margin-right: 90rpx; " >周四</text>
  97. </view>
  98. <view style="display: flex;">
  99. <text style="font-size: 30rpx;">¥</text> <input v-model="form.thursdayPrice" type="text" placeholder="请输入价格" style="width: 210rpx;height: 42rpx; font-size: 30rpx;"/>
  100. </view>
  101. </view>
  102. </view>
  103. <view class="priceBoxWeek">
  104. <view class="weekendBox">
  105. <view >
  106. <text style="font-size: 30rpx; margin-right: 90rpx; " >周五</text>
  107. </view>
  108. <view style="display: flex;">
  109. <text style="font-size: 30rpx;">¥</text> <input v-model="form.fridayPrice" type="text" placeholder="请输入价格" style="width: 210rpx;height: 42rpx; font-size: 30rpx;"/>
  110. </view>
  111. </view>
  112. </view>
  113. <view class="priceBoxWeek">
  114. <view class="weekendBox">
  115. <view >
  116. <text style="font-size: 30rpx; margin-right: 90rpx; " >周六</text>
  117. </view>
  118. <view style="display: flex;">
  119. <text style="font-size: 30rpx;">¥</text> <input v-model="form.saturdayPrice" type="text" placeholder="请输入价格" style="width: 210rpx;height: 42rpx; font-size: 30rpx;"/>
  120. </view>
  121. </view>
  122. </view>
  123. <view class="priceBoxWeek">
  124. <view class="weekendBox" style=" border-bottom: 1rpx solid #fff;">
  125. <view style="margin-top: 10rpx;">
  126. <text style="font-size: 30rpx; margin-right: 90rpx; " >周日</text>
  127. </view>
  128. <view style="display: flex; margin-top: 10rpx;">
  129. <text style="font-size: 30rpx;">¥</text> <input v-model="form.sundayPrice" type="text" placeholder="请输入价格" style="width: 210rpx;height: 42rpx; font-size: 30rpx;
  130. "/>
  131. </view>
  132. </view>
  133. </view>
  134. </view>
  135. <!-- 房间列表 -->
  136. <view class="everyHouseList" style="padding-top: 20rpx;">
  137. <view class="HouseListTitleInfo" >
  138. <text style="font-size: 32rpx; font-weight: 700;">房间列表</text>
  139. <text style="font-size: 24rpx; color: #777;">共8个房间</text>
  140. </view>
  141. <!-- 房间号 -->
  142. <view class="priceBoxWeek">
  143. <view class="weekendBox" style="display: flex; justify-content: space-between;">
  144. <view style="display: flex;">
  145. <text> 楼层:</text><input style="width: 50rpx;" v-model="form.roomFloor[0].floor" type="text" />
  146. </view>
  147. <view style="display: flex;">
  148. <text > 房间号:</text><input style="width: 50rpx;" v-model="form.roomFloor[0].roomNumber" type="text" />
  149. </view>
  150. <view style="display: flex; margin-top: 10rpx;">
  151. <u-icon name="trash"></u-icon>
  152. </view>
  153. </view>
  154. </view>
  155. </view>
  156. <!-- 添加按钮 -->
  157. <view class="submit">
  158. <u-icon name="plus-circle" color=" #1372FF"></u-icon>
  159. <text style="color: #1372FF; font-size: 30rpx;">添加房间</text>
  160. </view>
  161. <!-- 确定添加按钮 -->
  162. <view class="addSubmit" @click="addNewRoom">
  163. <text style="line-height: 96rpx; margin-left:310rpx; font-size: 32rpx; color: #fff;">确定</text>
  164. </view>
  165. </view>
  166. </view>
  167. </template>
  168. <script>
  169. export default{
  170. data(){
  171. return{
  172. checked:false,
  173. weekedChecked:false,
  174. action: '',//图片服务器地址
  175. fileList: [
  176. {
  177. url: '',
  178. }
  179. ],
  180. form:{
  181. homestayId:'',
  182. mondayPrice:'',
  183. tuesdayPrice:'',
  184. wednesdayPrice:'',
  185. thursdayPrice:'',
  186. fridayPrice:'',
  187. saturdayPrice:'',
  188. sundayPrice:'',
  189. name:'',
  190. shortName:'',
  191. roomFloor:[
  192. { floor:'',
  193. roomNumber:''}
  194. ]
  195. },
  196. }
  197. },
  198. onLoad({id}){
  199. this.form.homestayId=id
  200. console.log(this.form.homestayId)
  201. },
  202. methods:{
  203. // change(status) {
  204. // console.log(status);
  205. // },
  206. addNewRoom(){
  207. this.$api.post('/merchant/hotel/mine/addHouseBase',this.form).then(res=>{
  208. console.log(res)
  209. if(res.data.code===0){
  210. this.$showToast('添加成功');
  211. setTimeout(()=>{
  212. uni.reLaunch({
  213. url:'/pages/my/roomType'
  214. })
  215. },1500)
  216. }
  217. })
  218. }
  219. }
  220. }
  221. </script>
  222. <style lang="scss">
  223. .page {
  224. background: #F3F4F4;
  225. padding-bottom: 260rpx;
  226. box-sizing: border-box;
  227. overflow-y: auto;
  228. overflow-x: auto;
  229. }
  230. .body {
  231. padding-top: 20rpx;
  232. padding-left: 30rpx;
  233. padding-right: 30rpx;
  234. }
  235. .typeInfo{
  236. background-color: #fff;
  237. width: 650rpx;
  238. height: 290rpx;
  239. border-radius: 10rpx;
  240. padding-top: 30rpx;
  241. padding-left: 15rpx;
  242. padding-right: 30rpx;
  243. }
  244. .titleInfo{
  245. // margin-top: 30rpx;
  246. margin-left: 20rpx;
  247. margin-bottom: 40rpx;
  248. }
  249. .cellBox{
  250. margin-left: 20rpx;
  251. display: flex;
  252. padding-bottom: 40rpx;
  253. border-bottom: 1rpx solid #E1E1E1;
  254. }
  255. .bigRoom{
  256. margin-left: 20rpx;
  257. width: 100%;
  258. height: 102rpx;
  259. display: flex;
  260. // justify-content: center;
  261. align-items: center;
  262. }
  263. .shelves{
  264. width: 695rpx;
  265. height: 102rpx;
  266. background-color: #fff;
  267. margin-top: 20rpx;
  268. border-radius: 10rpx;
  269. display: flex;
  270. justify-content: space-between;
  271. align-items: center;
  272. // padding-left: 30rpx;
  273. // padding-right: 30rpx;
  274. }
  275. .uploadPic{
  276. padding-top: 28rpx;
  277. width: 690rpx;
  278. height: 293rpx;
  279. background-color: #fff;
  280. border-radius: 10rpx;
  281. margin-top: 20rpx;
  282. }
  283. .pic{
  284. margin-left: 30rpx;
  285. margin-top: 20rpx;
  286. width: 190rpx;
  287. height: 120rpx;
  288. background-color: pink;
  289. }
  290. // .custom-upload-button{
  291. // width: 190rpx;
  292. // height: 120rpx;
  293. // }
  294. .priceInfo{
  295. width: 690rpx;
  296. height: 908rpx;
  297. background-color: #fff;
  298. border-radius: 10rpx;
  299. margin-top: 20rpx;
  300. padding-top: 30rpx;
  301. }
  302. .week{
  303. padding-left: 30rpx;
  304. padding-right: 30rpx;
  305. margin-bottom: 20rpx;
  306. }
  307. .weekend{
  308. display: flex;
  309. justify-content: space-between;
  310. border-bottom: 1rpx solid #E1E1E1;
  311. padding-bottom: 30rpx;
  312. }
  313. .everyDay{
  314. padding-left: 30rpx;
  315. padding-right: 30rpx;
  316. width: 100%;
  317. // background-color: pink;
  318. height: 102rpx;
  319. display: flex;
  320. align-items: center;
  321. }
  322. .days{
  323. display: flex;
  324. align-items: center;
  325. border-bottom: 1rpx solid #E1E1E1;
  326. padding-bottom: 30rpx;
  327. }
  328. .priceBoxWeek{
  329. display: flex;
  330. align-items: center;
  331. height: 102rpx;
  332. padding-left: 30rpx;
  333. padding-right: 30rpx;
  334. }
  335. .weekendBox{
  336. width: 630rpx;
  337. display: flex;
  338. margin-top: 20rpx;
  339. // margin-right: 90rpx;
  340. // justify-content: space-between;
  341. border-bottom: 1rpx solid #E1E1E1;
  342. padding-bottom: 32rpx;
  343. }
  344. .everyHouseList{
  345. // padding-right: 30rpx;
  346. width: 690rpx;
  347. // height: 908rpx;
  348. background-color: #fff;
  349. border-radius: 10rpx;
  350. margin-top: 20rpx;
  351. // padding-top: 30rpx;
  352. }
  353. .HouseListTitleInfo{
  354. margin-right: 30rpx;
  355. margin-left: 20rpx;
  356. margin-bottom: 40rpx;
  357. display: flex;
  358. justify-content: space-between;
  359. }
  360. .submit{
  361. margin-top: 20rpx;
  362. border-radius: 10rpx;
  363. width: 690rpx;
  364. height: 102rpx;
  365. background-color: #fff;
  366. display: flex;
  367. justify-content: center;
  368. align-items: center;
  369. }
  370. .addSubmit{
  371. position: fixed; /* 固定定位 */
  372. bottom: 20rpx; /* 底部对齐 */
  373. left: 0; /* 可选:左对齐 */
  374. width: 690rpx; /* 可选:宽度为 100% */
  375. height: 96rpx;
  376. margin-left: 30rpx;
  377. // padding-top: 20rpx;
  378. margin-top: 30rpx;
  379. background-color: #1372FF;
  380. border-radius: 48rpx;
  381. }
  382. </style>