index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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. </uni-card>
  10. <uni-card style="margin-top: -22px;margin-bottom:0px; width:660rpx;height: 254rpx;">
  11. <text class="uni-body">宜春市靖安县北高速路口什么路899号</text>
  12. <image class="uni-phone" @click="telphone(phone)" src="../../static/index/index_phone.svg"></image>
  13. <image class="uni-map" @click="mapDaohang" src="../../static/index/index_map.svg"></image>
  14. <br><text class="uni-body2">距离我520km</text>
  15. </uni-card>
  16. <!-- 第二层工具 -->
  17. <view class="item-list">
  18. <view class="item-list-one" @click="navigateToXuzhi">
  19. <image src="../../static/index/index_xuzhi.svg" class="img-btn"></image>
  20. <text class="list-txt">入住须知</text>
  21. </view>
  22. <view class="item-list-one" @click="navigateToDairuzhu">
  23. <image src="../../static/index/index_ruzhu.svg" class="img-btn"></image>
  24. <text class="list-txt">办理入住</text>
  25. </view>
  26. <view class="item-list-one" @click="navigateToXuzhu">
  27. <image src="../../static/index/index_xuzhu.svg" class="img-btn"></image>
  28. <text class="list-txt">办理续住</text>
  29. </view>
  30. <view class="item-list-one" @click="navigateToTuifang">
  31. <image src="../../static/index/index_tuifang.svg" class="img-btn"></image>
  32. <text class="list-txt">办理退房</text>
  33. </view>
  34. </view>
  35. <!-- 第三层订房 -->
  36. <view class="room-list">
  37. <!-- 选择住房日期 -->
  38. <view class="select-time" @click="openCalendar">
  39. <view class="select-time-one">
  40. <text class="select-list">周四入住</text>
  41. <text class="select-list-time">07月21日</text>
  42. </view>
  43. <view class="select-center">
  44. <view class="select-line1"></view>
  45. <view class="select-circle">1晚</view>
  46. <view class="select-line2"></view>
  47. </view>
  48. <view class="select-time-one">
  49. <text class="select-list">周五离店</text>
  50. <text class="select-list-time">07月22日</text>
  51. </view>
  52. <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"
  53. :endDate="info.endDate" :range="info.range" @change="change" @confirm="confirm" @close="close"/>
  54. </view>
  55. <!-- 房型列表 -->
  56. <view class="room-kuang">
  57. <view class="room-xinxi" v-for="(item,index) in room" :key="index">
  58. <image class="room-image" src="../../static/index/room_image.svg" @click="inputDialogToggle"></image>
  59. <view class="room-name">{{item.name}}</view>
  60. <view class="room-mark">{{item.mark1}} {{item.mark2}} {{item.mark3}}</view>
  61. <view class="room-icon">
  62. <image src="../../static/index/index_wifi.svg" style="width: 30rpx;height: 30rpx;"></image>
  63. <image src="../../static/index/index_kongtiao.svg" style="width: 26rpx;height: 26rpx;margin-left: 10rpx;"></image>
  64. <image src="../../static/index/index_nosmoking.svg" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;"></image>
  65. <image src="../../static/index/index_lock.svg" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;"></image>
  66. </view>
  67. <view class="before-price"><strike>{{item.before_price}}</strike></view>
  68. <view class="room-price">{{item.price}}</view>
  69. <view class="room-button" @click="navigateToOrderRoom"><text>订</text></view>
  70. <view class="room-line" v-if="index<(room.length-1)"></view>
  71. </view>
  72. </view>
  73. </view>
  74. <!-- 房间样式弹窗页面 -->
  75. <uni-popup ref="popup" type="dialog" :mask-click="false">
  76. <view class="popup_bg">
  77. <text class="popup_title">户型详情</text>
  78. <text class="popup_error" @click="popupClose"></text>
  79. <!-- 轮播图 -->
  80. <swiper class="swiper" circular :indicator-dots="indicatorDots">
  81. <swiper-item v-for="(item, index) in img" :key="index">
  82. <view class="swiper-item">
  83. <image :src="item.srcUrl" class="swiper-img"></image>
  84. </view>
  85. </swiper-item>
  86. </swiper>
  87. <text class="popup_title2">便利设施</text>
  88. <view class="popup_txt">尤其是刚上线的产品,很难通过产品的内部体系来实现快速的用户增长,所以会更加依赖于分享来达到广泛的传播,获取目标用户。
  89. 所以监听用户的截图操作,提示用户进行分享,既缩短了以前分享截...</view>
  90. </view>
  91. </uni-popup>
  92. <!-- 办理续住弹窗页面 -->
  93. <uni-popup ref="popup_xuzhu" type="dialog" :mask-click="false">
  94. <view class="popup_bg_xu">
  95. <text class="popup_title">办理续住</text>
  96. <text class="popup_error" @click="popupXuzhuClose"></text>
  97. <text class="popup_xu_line"></text>
  98. <!-- 时间选择 -->
  99. <view class="select-time-xu" @click="openXuCalendar">
  100. <view class="select-time-one-xu">
  101. <text class="select-list">周四入住</text>
  102. <text class="select-list-time">07月21日</text>
  103. </view>
  104. <view class="select-center">
  105. <view class="select-line1"></view>
  106. <view class="select-circle">1晚</view>
  107. <view class="select-line2"></view>
  108. </view>
  109. <view class="select-time-one-xu">
  110. <text class="select-list">周五离店</text>
  111. <text class="select-list-time">07月22日</text>
  112. </view>
  113. <uni-calendar ref="calendar_xu" :selected="info.selected" class="uni-calendar--hook" :clear-date="true" :date="info.date" :insert="info.insert" :lunar="info.lunar" :startDate="info.startDate"
  114. :endDate="info.endDate" :range="info.range" @confirm="confirmXu" @close="closeXu"/>
  115. </view>
  116. <text class="popup_xu_txt">注:办理续住最多7天,如超过7天需要重新预定</text>
  117. <!-- 支付框 -->
  118. <view class="fukuan">
  119. <view class="fu-price"><text style="font-size: 28rpx;">总计:</text>¥20.00</view>
  120. <view class="fu-zhifu">立即支付</view>
  121. </view>
  122. </view>
  123. </uni-popup>
  124. </view>
  125. </template>
  126. <script>
  127. // 导入图片
  128. import room1 from '../../static/index/swiper_img1.svg'
  129. import room2 from '../../static/index/swiper_img1.svg'
  130. export default {
  131. data() {
  132. return {
  133. showCalendar: false,
  134. info: {
  135. lunar: true,
  136. range: true,
  137. insert: false,
  138. selected: []
  139. },
  140. room:[
  141. {id:1,room_img:({ url: "../../static/index/room_image.svg" }),name:'01户型',before_price:'¥419',price:'¥0.00',mark1:'22m',mark2:'无早',mark3:'大床'},
  142. {id:2,room_img:'url(../../static/index/index_bg.svg)',name:'02户型',before_price:'¥419',price:'¥0.00',mark1:'22m',mark2:'无早',mark3:'大床'},
  143. {id:3,room_img:({ url: "../../static/index/room_image.svg" }),name:'01户型',before_price:'¥419',price:'¥0.00',mark1:'22m',mark2:'无早',mark3:'大床'},
  144. {id:4,room_img:'url(../../static/index/index_bg.svg)',name:'02户型',before_price:'¥419',price:'¥0.00',mark1:'22m',mark2:'无早',mark3:'大床'},
  145. ],
  146. indicatorDots: true,//滚动图片提示条默认出现
  147. img:[
  148. {
  149. value: '1',
  150. srcUrl:room1,
  151. name: '图1'
  152. },
  153. {
  154. value: '2',
  155. srcUrl:room2,
  156. name: '图2'
  157. },
  158. ],
  159. phone:'15079248859',//电话
  160. }
  161. },
  162. onLoad() {
  163. },
  164. onReady() {
  165. this.$nextTick(() => {
  166. this.showCalendar = true
  167. })
  168. // TODO 模拟请求异步同步数据
  169. // setTimeout(() => {
  170. // this.info.date = getDate(new Date(),-30).fullDate
  171. // this.info.startDate = getDate(new Date(),-60).fullDate
  172. // this.info.endDate = getDate(new Date(),30).fullDate
  173. // this.info.selected = [{
  174. // date: getDate(new Date(),-3).fullDate,
  175. // info: '打卡'
  176. // },
  177. // {
  178. // date: getDate(new Date(),-2).fullDate,
  179. // info: '签到',
  180. // data: {
  181. // custom: '自定义信息',
  182. // name: '自定义消息头'
  183. // }
  184. // },
  185. // {
  186. // date: getDate(new Date(),-1).fullDate,
  187. // info: '已打卡'
  188. // }
  189. // ]
  190. // }, 2000)
  191. },
  192. methods: {
  193. // 跳转到入住须知
  194. navigateToXuzhi(){
  195. uni.navigateTo({
  196. url: "../ruzhuxuzhi/ruzhuxuzhi",
  197. });
  198. },
  199. // 跳转到公寓详情
  200. navigateToXiangqing(){
  201. uni.navigateTo({
  202. url: "../gongyuxiangqing/gongyuxiangqing",
  203. });
  204. },
  205. // 订房间
  206. navigateToOrderRoom() {
  207. uni.navigateTo({
  208. url: "../order_room/order_room",
  209. });
  210. },
  211. //办理入住跳转
  212. navigateToDairuzhu(){
  213. uni.navigateTo({
  214. url: "../my_orderlist/my_orderlist?Inv=2",
  215. })
  216. },
  217. //办理退房
  218. navigateToTuifang(){
  219. uni.navigateTo({
  220. url:"../my_orderlist/my_orderlist?Inv=3"
  221. })
  222. },
  223. //户型详情弹窗
  224. inputDialogToggle() {
  225. this.$refs.popup.open()
  226. },
  227. popupClose() {
  228. this.$refs.popup.close()
  229. },
  230. //办理续住弹窗
  231. navigateToXuzhu(){
  232. this.$refs.popup_xuzhu.open()
  233. },
  234. popupXuzhuClose() {
  235. this.$refs.popup_xuzhu.close()
  236. },
  237. // 日期选择器弹窗
  238. openCalendar() {
  239. this.$refs.calendar.open()
  240. },
  241. close(){
  242. console.log('弹窗关闭');
  243. },
  244. confirm(e) {
  245. console.log('confirm 返回:', e)
  246. },
  247. change(e) {
  248. console.log('1change 返回:', e)
  249. // 模拟动态打卡
  250. if (this.info.selected.length > 5) return
  251. this.info.selected.push({
  252. date: e.fulldate,
  253. info: '打卡'
  254. })
  255. },
  256. // 续住里日期选择器弹窗
  257. openXuCalendar() {
  258. this.$refs.calendar_xu.open()
  259. },
  260. closeXu(){
  261. console.log('弹窗关闭');
  262. },
  263. confirmXu(e) {
  264. console.log('confirm 返回:', e)
  265. },
  266. //拨打电话
  267. telphone(phone){
  268. uni.makePhoneCall({
  269. phoneNumber: phone ,
  270. }) // 传参带入号码即可
  271. },
  272. //地图导航
  273. mapDaohang(){
  274. uni.getLocation({
  275. type: 'wgs84',
  276. success: function (res) {
  277. console.log('当前位置的经度:' + res.longitude);
  278. console.log('当前位置的纬度:' + res.latitude);
  279. let longitude=res.longitude
  280. let latitude=res.latitude
  281. let name=res.name//
  282. let address=res.address//地址
  283. wx.openLocation({
  284. latitude,
  285. longitude,
  286. name,
  287. address,
  288. scale:18//缩放比例
  289. })
  290. }
  291. });
  292. }
  293. }
  294. }
  295. </script>
  296. <style>
  297. @import url("./css/index.css");
  298. </style>