index.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view class="content">
  3. <!-- 背景图 -->
  4. <view class="index_bg">
  5. <view class="welcome"><image class="welcome_img" src="../../static/index/welcome.png"></image></view>
  6. </view>
  7. <!-- 第一层公寓名称卡片 -->
  8. <uni-card style="margin-top: -40px;margin-bottom:0px; width:660rpx;height: 254rpx;" title="墨轩湖姬子公寓(南昌交通学院)" sub-title="2021年装修 | 智能门锁 | 房间wifi | 免费停车" extra="设施/详情>" @click="navigateToXiangqing">
  9. <text class="uni-body">宜春市靖安县北高速路口什么路899号</text>
  10. <image class="uni-phone" src="../../static/index/index_phone.svg"></image>
  11. <image class="uni-map" src="../../static/index/index_map.svg"></image>
  12. <br><text class="uni-body2">距离我520km</text>
  13. </uni-card>
  14. <!-- 第二层工具 -->
  15. <view class="item-list">
  16. <view class="item-list-one" @click="navigateToXuzhi">
  17. <image src="../../static/index/index_xuzhi.svg" class="img-btn"></image>
  18. <text class="list-txt">入住须知</text>
  19. </view>
  20. <view class="item-list-one" @click="navigateToDairuzhu">
  21. <image src="../../static/index/index_ruzhu.svg" class="img-btn"></image>
  22. <text class="list-txt">办理入住</text>
  23. </view>
  24. <view class="item-list-one" @click="navigateToPay">
  25. <image src="../../static/index/index_xuzhu.svg" class="img-btn"></image>
  26. <text class="list-txt">办理续住</text>
  27. </view>
  28. <view class="item-list-one" @click="navigateToTuifang">
  29. <image src="../../static/index/index_tuifang.svg" class="img-btn"></image>
  30. <text class="list-txt">办理退房</text>
  31. </view>
  32. </view>
  33. <!-- 第三层订房 -->
  34. <view class="room-list">
  35. <!-- 选择住房日期 -->
  36. <view class="select-time" @click="openCalendar">
  37. <view class="select-time-one">
  38. <text class="select-list">周四入住</text>
  39. <text class="select-list-time">07月21日</text>
  40. </view>
  41. <view class="select-center">
  42. <view class="select-line1"></view>
  43. <view class="select-circle">1晚</view>
  44. <view class="select-line2"></view>
  45. </view>
  46. <view class="select-time-one">
  47. <text class="select-list">周五离店</text>
  48. <text class="select-list-time">07月22日</text>
  49. </view>
  50. <uni-calendar ref="calendar" :selected="info.selected" class="uni-calendar--hook" :clear-date="true" :date="info.date" :insert="info.insert" :lunar="info.lunar" :startDate="info.startDate"
  51. :endDate="info.endDate" :range="info.range" @change="change" @confirm="confirm" @close="close"/>
  52. </view>
  53. <!-- 房型列表 -->
  54. <view class="room-kuang">
  55. <view class="room-xinxi" v-for="(item,index) in room" :key="index">
  56. <image class="room-image" src="../../static/index/room_image.svg" @click="inputDialogToggle"></image>
  57. <view class="room-name">{{item.name}}</view>
  58. <view class="room-mark">{{item.mark1}} {{item.mark2}} {{item.mark3}}</view>
  59. <view class="room-icon">
  60. <image src="../../static/index/index_wifi.svg" style="width: 30rpx;height: 30rpx;"></image>
  61. <image src="../../static/index/index_kongtiao.svg" style="width: 26rpx;height: 26rpx;margin-left: 10rpx;"></image>
  62. <image src="../../static/index/index_nosmoking.svg" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;"></image>
  63. <image src="../../static/index/index_lock.svg" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;"></image>
  64. </view>
  65. <view class="before-price"><strike>{{item.before_price}}</strike></view>
  66. <view class="room-price">{{item.price}}</view>
  67. <view class="room-button" @click="navigateToOrderRoom"><text>订</text></view>
  68. <view class="room-line" v-if="index<(room.length-1)"></view>
  69. </view>
  70. </view>
  71. </view>
  72. <!-- 房间样式弹窗页面 -->
  73. <uni-popup ref="popup" type="dialog" :mask-click="false">
  74. <view class="popup_bg">
  75. <text class="popup_title">户型详情</text>
  76. <text class="popup_error" @click="popupClose"></text>
  77. <!-- 轮播图 -->
  78. <swiper class="swiper" circular :indicator-dots="indicatorDots">
  79. <swiper-item v-for="(item, index) in img" :key="index">
  80. <view class="swiper-item">
  81. <image :src="item.srcUrl" class="swiper-img"></image>
  82. </view>
  83. </swiper-item>
  84. </swiper>
  85. <text class="popup_title2">便利设施</text>
  86. <view class="popup_txt">尤其是刚上线的产品,很难通过产品的内部体系来实现快速的用户增长,所以会更加依赖于分享来达到广泛的传播,获取目标用户。
  87. 所以监听用户的截图操作,提示用户进行分享,既缩短了以前分享截...</view>
  88. </view>
  89. </uni-popup>
  90. </view>
  91. </template>
  92. <script>
  93. // 导入图片
  94. import room1 from '../../static/index/swiper_img1.svg'
  95. import room2 from '../../static/index/swiper_img1.svg'
  96. export default {
  97. data() {
  98. return {
  99. showCalendar: false,
  100. info: {
  101. lunar: true,
  102. range: true,
  103. insert: false,
  104. selected: []
  105. },
  106. room:[
  107. {id:1,room_img:({ url: "../../static/index/room_image.svg" }),name:'01户型',before_price:'¥419',price:'¥0.00',mark1:'22m',mark2:'无早',mark3:'大床'},
  108. {id:2,room_img:'url(../../static/index/index_bg.svg)',name:'02户型',before_price:'¥419',price:'¥0.00',mark1:'22m',mark2:'无早',mark3:'大床'},
  109. {id:3,room_img:({ url: "../../static/index/room_image.svg" }),name:'01户型',before_price:'¥419',price:'¥0.00',mark1:'22m',mark2:'无早',mark3:'大床'},
  110. {id:4,room_img:'url(../../static/index/index_bg.svg)',name:'02户型',before_price:'¥419',price:'¥0.00',mark1:'22m',mark2:'无早',mark3:'大床'},
  111. ],
  112. indicatorDots: true,//滚动图片提示条默认出现
  113. img:[
  114. {
  115. value: '1',
  116. srcUrl:room1,
  117. name: '图1'
  118. },
  119. {
  120. value: '2',
  121. srcUrl:room2,
  122. name: '图2'
  123. },
  124. ]
  125. }
  126. },
  127. onLoad() {
  128. },
  129. onReady() {
  130. this.$nextTick(() => {
  131. this.showCalendar = true
  132. })
  133. // TODO 模拟请求异步同步数据
  134. // setTimeout(() => {
  135. // this.info.date = getDate(new Date(),-30).fullDate
  136. // this.info.startDate = getDate(new Date(),-60).fullDate
  137. // this.info.endDate = getDate(new Date(),30).fullDate
  138. // this.info.selected = [{
  139. // date: getDate(new Date(),-3).fullDate,
  140. // info: '打卡'
  141. // },
  142. // {
  143. // date: getDate(new Date(),-2).fullDate,
  144. // info: '签到',
  145. // data: {
  146. // custom: '自定义信息',
  147. // name: '自定义消息头'
  148. // }
  149. // },
  150. // {
  151. // date: getDate(new Date(),-1).fullDate,
  152. // info: '已打卡'
  153. // }
  154. // ]
  155. // }, 2000)
  156. },
  157. methods: {
  158. // 跳转到入住须知
  159. navigateToXuzhi(){
  160. uni.navigateTo({
  161. url: "../ruzhuxuzhi/ruzhuxuzhi",
  162. });
  163. },
  164. // 跳转到公寓详情
  165. navigateToXiangqing(){
  166. uni.navigateTo({
  167. url: "../gongyuxiangqing/gongyuxiangqing",
  168. });
  169. },
  170. // 订房间
  171. navigateToOrderRoom() {
  172. uni.navigateTo({
  173. url: "../order_room/order_room",
  174. });
  175. },
  176. //办理入住跳转
  177. navigateToDairuzhu(){
  178. uni.navigateTo({
  179. url: "../my_orderlist/my_orderlist?Inv=2",
  180. })
  181. },
  182. //办理退房
  183. navigateToTuifang(){
  184. uni.navigateTo({
  185. url:"../my_orderlist/my_orderlist?Inv=3"
  186. })
  187. },
  188. //弹窗
  189. inputDialogToggle() {
  190. this.$refs.popup.open()
  191. },
  192. popupClose() {
  193. this.$refs.popup.close()
  194. },
  195. // 日期选择器弹窗
  196. openCalendar() {
  197. this.$refs.calendar.open()
  198. },
  199. close(){
  200. console.log('弹窗关闭');
  201. },
  202. confirm(e) {
  203. console.log('confirm 返回:', e)
  204. // 模拟动态打卡
  205. if (this.info.selected.length > 5) return
  206. this.info.selected.push({
  207. date: e.fulldate,
  208. info: '打卡'
  209. })
  210. },
  211. }
  212. }
  213. </script>
  214. <style>
  215. @import url("./css/index.css");
  216. </style>