detail.vue 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390
  1. <template>
  2. <view class="container" :style="'overflow:' + (showPage ? 'hidden' : 'visible')" v-if="info">
  3. <!-- 顶部分段器区域 -->
  4. <view class="control">
  5. <uni-segmented-control :current="activeIndex" :values="headerList" style-type="text" active-color="#096562" @clickItem="onClickItem" />
  6. </view>
  7. <!-- 顶部民宿图片区域 -->
  8. <view class="banner">
  9. <swiper autoplay circular class="swiper">
  10. <swiper-item class="swiper_item" v-for="item in info.hotelFileInfoList" :key="item.id">
  11. <img mode="aspectFill" class="img" :src="item.url" />
  12. </swiper-item>
  13. </swiper>
  14. <view class="slogan">
  15. <img src="../../static/index/slogan.png" />
  16. </view>
  17. <!-- 720°全景链接区域 -->
  18. <view class="full" v-if="info.linkProUrl" @click="handleGoPull(info.linkProUrl)">
  19. <img src="../../static/index/full.png" />
  20. 720°全景
  21. </view>
  22. <!-- 收藏按钮区域 -->
  23. <view class="collect">
  24. <uni-fav circle bgColorChecked="#096562" :checked="info.is_collect_hotel" @click="changeCollect(info.is_collect_hotel)" />
  25. </view>
  26. </view>
  27. <!-- 民宿详细信息区域 -->
  28. <view class="detail">
  29. <view class="detail_name">{{ info.hotel_name }}</view>
  30. <view class="detail_info">
  31. <view class="info_left">{{ info.fitupTime }}装修 | {{ info.openTime }}开业</view>
  32. <view class="info_right" @click="goPageDetailInfo">
  33. 设施/详情
  34. <img src="../../static/index/right.png" />
  35. </view>
  36. </view>
  37. <view class="detail_group">
  38. <view class="group_item" v-for="item in info.hconfigList" :key="item.id">
  39. <img :src="item.fileUrl" />
  40. {{ item.name }}
  41. </view>
  42. </view>
  43. <view class="address">
  44. <view class="address_left">{{ info.hposition }}</view>
  45. <view class="address_right">
  46. <view class="right_box" @click="handleMap(info)">
  47. <img src="../../static/index/map.png" />
  48. </view>
  49. <view class="right_box" @click="handlePhone(info.managerPhone)">
  50. <img src="../../static/index/phone.png" />
  51. </view>
  52. </view>
  53. </view>
  54. <view class="distance" v-if="distance">距离我{{ distance }}km</view>
  55. </view>
  56. <!-- 房型信息区域 -->
  57. <view class="body">
  58. <!-- 选择日期区域 -->
  59. <view class="body_header" @click="handleOpen()">
  60. <view class="header_start">
  61. <view class="header_top">{{ getWeek(startTime) }}入住</view>
  62. <view class="header_bottom">{{ startTime.slice(5, 7) }}月{{ startTime.slice(8, 10) }}日</view>
  63. </view>
  64. <view class="header_night">
  65. <view class="night_line"></view>
  66. <view class="night_box">{{ nightNum }}晚</view>
  67. <view class="night_line"></view>
  68. </view>
  69. <view class="header_end">
  70. <view class="header_top">{{ getWeek(endTime) }}离店</view>
  71. <view class="header_bottom">{{ endTime.slice(5, 7) }}月{{ endTime.slice(8, 10) }}日</view>
  72. </view>
  73. </view>
  74. <!-- 日历组件 -->
  75. <uv-calendars
  76. ref="calendar"
  77. range
  78. title="选择日期"
  79. start-text="住店"
  80. end-text="离店"
  81. color="#096562"
  82. confirmColor="#096562"
  83. :selected="selected"
  84. :startDate="earlyTime"
  85. :endDate="lateTime"
  86. @monthSwitch="monthSwitch"
  87. @confirm="handleConfirm"
  88. />
  89. <!-- 房型列表区域 -->
  90. <view class="body_content" v-if="list.length">
  91. <!-- 每一个房型盒子区域 -->
  92. <view class="body_box" v-for="item in list" :key="item.id" @click="handleLookDetail(item)">
  93. <view class="box_left">
  94. <img mode="aspectFill" :src="item.fileInfoList[0].url" />
  95. </view>
  96. <view class="box_center">
  97. <view class="center_top">{{ item.hName }}</view>
  98. <view class="center_center">
  99. <view class="center_item" v-if="item.hAreas">{{ item.hAreas }}㎡ 剩余{{ item.remainRooms }}间</view>
  100. </view>
  101. <view class="center_bottom">
  102. <img v-for="item2 in item.hConfigList" :key="item2.id" class="img" :src="item2.fileUrl" />
  103. </view>
  104. </view>
  105. <view class="box_right">
  106. <view class="right_price">
  107. <text>¥</text>
  108. {{ item.price }}
  109. </view>
  110. <view class="right_btn" :class="{ inactive: item.remainRooms * 1 <= 0 }" @click.stop="goPageAffOrder(item)">订</view>
  111. </view>
  112. </view>
  113. <!-- 点击房型弹窗区域 -->
  114. <uv-popup ref="popup" bgColor="none" :safeAreaInsetBottom="false">
  115. <view class="body_pop">
  116. <!-- 轮播图区域 -->
  117. <swiper indicator-dots circular indicator-color="#FFFFFF" indicator-active-color="#096562" class="pop_swiper">
  118. <swiper-item class="pop_swiper_item" v-for="item in roomInfo.fileInfoList" :key="item.id">
  119. <img class="img" :src="item.url" />
  120. </swiper-item>
  121. </swiper>
  122. <!-- 轮播图关闭图标区域 -->
  123. <img class="pop_icon" src="../../static/index/close.png" @click="handleClosePop" />
  124. <view class="pop_body">
  125. <view class="body_title">{{ roomInfo.hName }}</view>
  126. <view class="body_tags">
  127. <view class="tags_item">
  128. <img class="img" src="../../static/index/place.png" />
  129. {{ roomInfo.hAreas }}㎡
  130. </view>
  131. <view class="tags_item" v-for="item2 in roomInfo.hConfigList" :key="item2.id">
  132. <img class="img" :src="item2.fileUrl" />
  133. {{ item2.name }}
  134. </view>
  135. </view>
  136. <view class="body_title2">费用明细</view>
  137. <view class="body_detail">
  138. <!-- <view class="detail_old">¥{{ roomInfo.price }}</view> -->
  139. <!-- <view class="detail_box">
  140. 黄金会员9折
  141. <text>-¥25</text>
  142. </view>
  143. <view class="detail_box">
  144. 活动
  145. <text>-¥2.5</text>
  146. </view> -->
  147. <view class="detail_new">
  148. 每间每晚
  149. <view class="ml_10 color">¥</view>
  150. <view class="price color">{{ roomInfo.price }}</view>
  151. </view>
  152. </view>
  153. <view class="body_bottom">
  154. <view class="bottom_left" @click="handlePhone(info.managerPhone)">
  155. <img class="img" src="../../static/index/phone2.png" />
  156. 联系商家
  157. </view>
  158. <view class="bottom_right">
  159. <text>¥</text>
  160. {{ roomInfo.price }}
  161. <view class="btn" :class="{ inactive: roomInfo.remainRooms * 1 <= 0 }" @click="goPageAffOrder(roomInfo)">预定</view>
  162. </view>
  163. </view>
  164. </view>
  165. </view>
  166. </uv-popup>
  167. </view>
  168. <view class="noData" v-else>
  169. <img src="../../static/images/noData.png" />
  170. 暂无数据
  171. </view>
  172. </view>
  173. <!-- 评价区域 -->
  174. <view class="evaluate">
  175. <view class="evaluate_title">评价</view>
  176. <view class="evaluate_body">
  177. <!-- 评分区域 -->
  178. <view class="header" v-if="score">
  179. <view class="header_box">
  180. <!-- 总评分区域 -->
  181. <view class="box_left">{{ score }}</view>
  182. <view class="box_right">
  183. <!-- 位置评分区域 -->
  184. <view class="right_item">
  185. <view class="item_info">位置 {{ scoreWz }}</view>
  186. <view class="item_progress">
  187. <progress activeColor="#0BAD8B" backgroundColor="#CCCCCC" stroke-width="10" border-radius="92" :percent="((scoreWz * 1) / 5) * 100" />
  188. </view>
  189. </view>
  190. <!-- 设施评分区域 -->
  191. <view class="right_item">
  192. <view class="item_info">设施 {{ scoreSs }}</view>
  193. <view class="item_progress">
  194. <progress activeColor="#0BAD8B" backgroundColor="#CCCCCC" stroke-width="10" border-radius="92" :percent="((scoreSs * 1) / 5) * 100" />
  195. </view>
  196. </view>
  197. <!-- 服务评分区域 -->
  198. <view class="right_item">
  199. <view class="item_info">服务 {{ scoreFw }}</view>
  200. <view class="item_progress">
  201. <progress activeColor="#0BAD8B" backgroundColor="#CCCCCC" stroke-width="10" border-radius="92" :percent="((scoreFw * 1) / 5) * 100" />
  202. </view>
  203. </view>
  204. <!-- 卫生评分区域 -->
  205. <view class="right_item">
  206. <view class="item_info">卫生 {{ scoreWs }}</view>
  207. <view class="item_progress">
  208. <progress activeColor="#0BAD8B" backgroundColor="#CCCCCC" stroke-width="10" border-radius="92" :percent="((scoreWs * 1) / 5) * 100" />
  209. </view>
  210. </view>
  211. </view>
  212. </view>
  213. </view>
  214. <!-- 每一个评价区域 -->
  215. <view class="evaluate_box" v-for="item in commentList" :key="item.id" @click="handleGoDetail(item)">
  216. <!-- 用户信息区域 -->
  217. <view class="box_userInfo">
  218. <img mode="aspectFill" :src="item.headPhoto" />
  219. <view class="userInfo_msg">
  220. <view class="msg_name">{{ item.userName }}</view>
  221. <view class="msg_star">
  222. <uni-rate readonly activeColor="#FFC300" :size="16" :value="item.score" />
  223. </view>
  224. </view>
  225. </view>
  226. <!-- 入住时间区域 -->
  227. <view class="box_time">{{ item.liveTime.slice(0, 10) }}入住,{{ item.commentTime.slice(0, 10) }}发表 | {{ item.houseName }}</view>
  228. <!-- 评价内容区域 -->
  229. <uv-read-more show-height="85rpx" closeText="全文" color="#096663" fontSize="24rpx" textIndent="0" :toggle="true" :shadowStyle="shadowStyle">
  230. <view class="box_content">
  231. {{ item.content }}
  232. </view>
  233. </uv-read-more>
  234. <!-- 图片区域 -->
  235. <view class="box_img">
  236. <img
  237. v-for="(ele, index) in item.url"
  238. :key="index"
  239. mode="aspectFill"
  240. v-if="ele.indexOf('jpg') !== -1 || ele.indexOf('png') !== -1"
  241. :src="ele"
  242. @click.stop="handleClickImg(ele, index)"
  243. />
  244. <video
  245. :id="item.id + index2"
  246. class="video"
  247. :show-fullscreen-btn="false"
  248. :show-play-btn="false"
  249. v-for="(video, index2) in item.url"
  250. :key="index2"
  251. v-if="video.indexOf('mp4') !== -1"
  252. :src="video"
  253. @fullscreenchange="fullscreenchange"
  254. @click.stop="handleClickVideo(item.id + index2)"
  255. ></video>
  256. </view>
  257. </view>
  258. <view class="foot" @click="handleGoPage" v-if="commentList.length">
  259. 查看全部{{ total }}条评价
  260. <img src="../../static/index/right.png" />
  261. </view>
  262. <view class="noData" v-if="commentList.length === 0">
  263. <img src="../../static/images/noData.png" />
  264. 暂无评论
  265. </view>
  266. </view>
  267. </view>
  268. </view>
  269. </template>
  270. <script>
  271. export default {
  272. data() {
  273. return {
  274. // 滚动穿透控制
  275. showPage: false,
  276. // 房型数据数组
  277. list: [],
  278. // 住几晚
  279. nightNum: 1,
  280. // 选择日期数组
  281. dayList: [],
  282. // 酒店信息
  283. info: null,
  284. // 房间信息
  285. roomInfo: {},
  286. // 民宿Id
  287. hotelId: '',
  288. // 是否有定位权限
  289. showLocation: false,
  290. // 是否展示距离
  291. distance: '',
  292. // 入住时间 YYYY-MM-DD
  293. startTime: '',
  294. // 离店时间 YYYY-MM-DD
  295. endTime: '',
  296. // 日历可以选择的最早日期
  297. earlyTime: '',
  298. // 日历可以选择的最晚日期
  299. lateTime: '',
  300. activeIndex: 0,
  301. headerList: ['预定', '评价'],
  302. // 评价列表数据
  303. commentList: [],
  304. queryDom: null,
  305. domTop: null,
  306. selected: [],
  307. // 总评分
  308. score: '',
  309. // 服务评分
  310. scoreFw: '',
  311. // 设施评分
  312. scoreSs: '',
  313. // 卫生评分
  314. scoreWs: '',
  315. // 位置评分
  316. scoreWz: '',
  317. // 评论总条数
  318. total: null,
  319. // 是否收藏
  320. ischecked: false,
  321. // video 上下文 videoContext 对象
  322. videoContext: null,
  323. // 是否是全屏状态
  324. isFullScreen: false
  325. }
  326. },
  327. onLoad(options) {
  328. this.getTimes()
  329. this.hotelId = options.id
  330. this.distance = options.distance === 'undefined' ? false : options.distance
  331. uni.getSetting({
  332. success: (res) => {
  333. this.showLocation = res.authSetting['scope.userLocation']
  334. this.getHotelInfo()
  335. this.getEvaData()
  336. }
  337. })
  338. },
  339. onPageScroll(e) {
  340. if (!this.queryDom) {
  341. this.queryDom = uni.createSelectorQuery().in(this)
  342. this.queryDom
  343. .select('.evaluate')
  344. .boundingClientRect((data) => {
  345. this.domTop = data.top
  346. })
  347. .exec()
  348. }
  349. if (e.scrollTop > this.domTop) {
  350. this.activeIndex = 1
  351. } else {
  352. this.activeIndex = 0
  353. }
  354. },
  355. methods: {
  356. // 进入全屏和退出全屏时触发的回调
  357. fullscreenchange(e) {
  358. this.isFullScreen = e.detail.fullScreen
  359. },
  360. // 点击视频控件时触发的回调
  361. handleClickVideo(id) {
  362. this.videoContext = uni.createVideoContext(id)
  363. if (this.isFullScreen) {
  364. this.videoContext.stop()
  365. this.videoContext.exitFullScreen()
  366. } else {
  367. this.videoContext.requestFullScreen()
  368. this.videoContext.play()
  369. }
  370. },
  371. // 点击收藏按钮回调
  372. async changeCollect(is_collect_hotel) {
  373. let userInfo = uni.getStorageSync('userInfo')
  374. let openid = uni.getStorageSync('openid')
  375. if (userInfo && openid) {
  376. const res = await this.$myRequest({
  377. url: is_collect_hotel ? '/mhotel/ahpdelCollectHotel.action' : '/mhotel/ahpcollectHotel.action',
  378. data: {
  379. userId: uni.getStorageSync('userInfo').id,
  380. hotelId: this.hotelId
  381. }
  382. })
  383. // console.log(res)
  384. if (res.code === 200) {
  385. uni.showToast({
  386. title: is_collect_hotel ? '取消收藏成功' : '收藏成功',
  387. icon: 'success',
  388. mask: true
  389. })
  390. this.info.is_collect_hotel = !this.info.is_collect_hotel
  391. }
  392. } else {
  393. uni.showToast({
  394. title: '请先登录',
  395. icon: 'none',
  396. mask: true
  397. })
  398. setTimeout(() => {
  399. uni.navigateTo({
  400. url: '/pages/login/login'
  401. })
  402. }, 1500)
  403. }
  404. },
  405. // 获取评论数据
  406. async getEvaData() {
  407. const res = await this.$myRequest({
  408. url: '/mhotel/abcaevaluatePage.action',
  409. data: {
  410. hotelId: this.hotelId,
  411. page: 1,
  412. rows: 5,
  413. status: 0
  414. }
  415. })
  416. // console.log(res);
  417. if (res.code === 200 && res.page.pageList) {
  418. this.score = res.score.score.toFixed(1)
  419. this.scoreFw = res.score.scoreFw.toFixed(1)
  420. this.scoreSs = res.score.scoreSs.toFixed(1)
  421. this.scoreWs = res.score.scoreWs.toFixed(1)
  422. this.scoreWz = res.score.scoreWz.toFixed(1)
  423. this.commentList = res.page.pageList
  424. this.total = res.page.total
  425. }
  426. },
  427. // 获取民宿信息
  428. async getHotelInfo() {
  429. const res = await this.$myRequest({
  430. url: '/mhotel/ahpgetHouseByHotelId.action',
  431. data: {
  432. hotelId: this.hotelId,
  433. userId: uni.getStorageSync('userInfo').id,
  434. queryStartTime: this.startTime,
  435. queryEndTime: this.endTime
  436. }
  437. })
  438. // console.log(res)
  439. if (res.code === 200) {
  440. this.info = res.data.data
  441. this.list = res.data.data.houseList
  442. uni.setNavigationBarTitle({
  443. title: res.data.data.hotel_name
  444. })
  445. }
  446. },
  447. onClickItem(e) {
  448. this.activeIndex = e.currentIndex
  449. if (this.activeIndex === 1) {
  450. uni.pageScrollTo({
  451. selector: '.evaluate'
  452. })
  453. } else {
  454. uni.pageScrollTo({
  455. scrollTop: 0
  456. })
  457. }
  458. },
  459. monthSwitch(e) {
  460. let time = e.year + '-' + e.month.toString().padStart(2, 0) + '-01'
  461. this.handleOpen(time)
  462. },
  463. // 选择日期确定回调
  464. handleConfirm(e) {
  465. this.startTime = e.range.before
  466. this.endTime = e.range.after
  467. this.dayList = e.range.data
  468. this.nightNum = e.range.data.length - 1
  469. this.getHotelInfo()
  470. },
  471. // 点击地图图标回调
  472. handleMap(item) {
  473. if (this.showLocation) {
  474. let lat = item.hpositionWens.split(',')[0] * 1
  475. let lng = item.hpositionWens.split(',')[1] * 1
  476. uni.openLocation({
  477. latitude: lat,
  478. longitude: lng,
  479. name: item.hname,
  480. address: item.hposition,
  481. success: () => {}
  482. })
  483. } else {
  484. uni.showModal({
  485. content: '当前没有定位权限,是否去设置打开?',
  486. confirmText: '确认',
  487. cancelText: '取消',
  488. success: (res) => {
  489. if (res.confirm) {
  490. uni.openSetting({
  491. success: (res) => {
  492. this.showLocation = true
  493. this.handleMap(item)
  494. }
  495. })
  496. } else {
  497. uni.showToast({
  498. title: '获取定位权限失败,无法使用地图功能',
  499. icon: 'none',
  500. mask: true
  501. })
  502. }
  503. }
  504. })
  505. }
  506. },
  507. // 点击电话图标回调
  508. handlePhone(phone) {
  509. uni.makePhoneCall({
  510. phoneNumber: phone
  511. })
  512. },
  513. // 点击弹窗关闭图标回调
  514. handleClosePop() {
  515. this.showPage = false
  516. this.$refs.popup.close()
  517. },
  518. // 点击每一个户型回调
  519. handleLookDetail(item) {
  520. this.roomInfo = item
  521. this.showPage = true
  522. this.$refs.popup.open('bottom')
  523. },
  524. // 点击设施详情回调
  525. goPageDetailInfo() {
  526. uni.navigateTo({
  527. url: `/pages/detailInfo/detailInfo?hotelId=${this.hotelId}`
  528. })
  529. },
  530. // 点击 订 预定 按钮回调
  531. goPageAffOrder(item) {
  532. let flag = uni.getStorageSync('openid')
  533. if (flag) {
  534. if (!this.startTime) {
  535. uni.showToast({
  536. title: '请选择入住时间',
  537. icon: 'none'
  538. })
  539. return
  540. }
  541. if (!this.endTime) {
  542. uni.showToast({
  543. title: '请选择离店时间',
  544. icon: 'none'
  545. })
  546. return
  547. }
  548. if (item.remainRooms * 1 > 0) {
  549. this.$refs.popup.close()
  550. this.showPage = false
  551. let info = JSON.stringify({
  552. nightNum: this.nightNum,
  553. startTimeDay: this.startTime.slice(8, 10),
  554. startTimeMonth: this.startTime.slice(5, 7),
  555. startTimeWeek: this.getWeek(this.startTime),
  556. endTimeDay: this.endTime.slice(8, 10),
  557. endTimeMonth: this.endTime.slice(5, 7),
  558. endTimeWeek: this.getWeek(this.endTime),
  559. item: item,
  560. queryStartTime: this.startTime,
  561. queryEndTime: this.endTime,
  562. dayList: this.dayList,
  563. hTypeName: this.info.hTypeName,
  564. hotelName: this.info.hotel_name,
  565. hotelId: this.hotelId
  566. })
  567. uni.navigateTo({
  568. url: `/pages/affirmOrder/affirmOrder?info=${info}`
  569. })
  570. } else {
  571. uni.showToast({
  572. title: '该房间已售罄',
  573. icon: 'none',
  574. mask: true
  575. })
  576. }
  577. } else {
  578. uni.showToast({
  579. title: '请先登录',
  580. icon: 'none',
  581. mask: true
  582. })
  583. setTimeout(() => {
  584. uni.navigateTo({
  585. url: '/pages/login/login'
  586. })
  587. }, 1500)
  588. }
  589. },
  590. // 点击日期区域回调
  591. async handleOpen(time) {
  592. const res = await this.$myRequest({
  593. url: '/mhotel/house/price/priceCalendar.action',
  594. data: {
  595. merchantId: this.info.managerId,
  596. startTime: time ? time : this.startTime
  597. }
  598. })
  599. if (res.code === 200) {
  600. this.selected = res.data
  601. }
  602. if (!time) {
  603. this.$refs.calendar.open()
  604. }
  605. },
  606. // 传入参数获取当前是星期几
  607. getWeek(time) {
  608. let date = new Date(time)
  609. let week = date.getDay()
  610. let weekList = ['日', '一', '二', '三', '四', '五', '六']
  611. let res = '周' + weekList[week]
  612. return res
  613. },
  614. // 获取今明两天的日期 YYYY-MM-DD
  615. getTimes() {
  616. // 今天
  617. let today = new Date()
  618. // 明天
  619. let tomorrow = new Date(today.getTime() + 24 * 60 * 60 * 1000)
  620. let late = new Date(today.getTime() + 24 * 60 * 60 * 1000 * 14)
  621. this.startTime = `${today.getFullYear()}-${(today.getMonth() + 1).toString().padStart(2, 0)}-${today.getDate().toString().padStart(2, 0)}`
  622. this.endTime = `${tomorrow.getFullYear()}-${(tomorrow.getMonth() + 1).toString().padStart(2, 0)}-${tomorrow.getDate().toString().padStart(2, 0)}`
  623. this.dayList = [this.startTime, this.endTime]
  624. this.earlyTime = this.startTime
  625. this.lateTime = `${late.getFullYear()}-${(late.getMonth() + 1).toString().padStart(2, 0)}-${late.getDate().toString().padStart(2, 0)}`
  626. },
  627. handleGoPull(linkProUrl) {
  628. let temURL = linkProUrl.slice(22)
  629. let url = 'https://f10mfe54bri.720yun.com' + temURL
  630. uni.navigateTo({
  631. url: `/pages/web/web?url=${url}`
  632. })
  633. },
  634. // 点击每一个评价回调
  635. handleGoDetail(item) {
  636. uni.navigateTo({
  637. url: `/pages/appraiseDetail/appraiseDetail?id=${item.id}`
  638. })
  639. },
  640. // 点击评价图片回调
  641. handleClickImg(url, index) {
  642. if (this.videoContext) {
  643. this.videoContext.stop()
  644. }
  645. // 预览图片
  646. uni.previewImage({
  647. current: index,
  648. urls: [url]
  649. })
  650. },
  651. handleGoPage() {
  652. uni.navigateTo({
  653. url: `/pages/appraise/appraise?hotelId=${this.hotelId}`
  654. })
  655. }
  656. }
  657. }
  658. </script>
  659. <style lang="scss" scoped>
  660. .container {
  661. display: flex;
  662. flex-direction: column;
  663. align-items: center;
  664. position: relative;
  665. min-height: 100vh;
  666. background-color: #f2f3f5;
  667. .control {
  668. z-index: 999;
  669. position: sticky;
  670. top: 0;
  671. width: 100%;
  672. height: 100rpx;
  673. background-color: #fff;
  674. }
  675. .banner {
  676. position: relative;
  677. width: 750rpx;
  678. height: 422rpx;
  679. .swiper {
  680. height: 422rpx;
  681. .swiper_item {
  682. width: 100%;
  683. height: 100%;
  684. .img {
  685. width: 100%;
  686. height: 100%;
  687. }
  688. }
  689. }
  690. .img {
  691. width: 100%;
  692. height: 100%;
  693. }
  694. .slogan {
  695. position: absolute;
  696. top: 0;
  697. left: 0;
  698. display: flex;
  699. justify-content: center;
  700. align-items: center;
  701. width: 163rpx;
  702. height: 60rpx;
  703. background-color: rgba(255, 255, 255, 0.4);
  704. img {
  705. width: 125rpx;
  706. height: 44rpx;
  707. }
  708. }
  709. .full {
  710. position: absolute;
  711. top: 13rpx;
  712. right: 20rpx;
  713. display: flex;
  714. align-items: center;
  715. justify-content: space-around;
  716. width: 173rpx;
  717. height: 60rpx;
  718. color: #fff;
  719. font-size: 24rpx;
  720. border-radius: 11rpx;
  721. background-color: rgba(0, 0, 0, 0.5);
  722. img {
  723. width: 40rpx;
  724. height: 40rpx;
  725. }
  726. }
  727. .collect {
  728. position: absolute;
  729. top: 68rpx;
  730. left: 8rpx;
  731. }
  732. }
  733. .detail {
  734. z-index: 1;
  735. float: left;
  736. margin-top: -177rpx;
  737. box-sizing: border-box;
  738. padding: 0 30rpx 30rpx;
  739. width: 710rpx;
  740. border-radius: 10rpx;
  741. background-color: #fff;
  742. .detail_name {
  743. margin-top: 25rpx;
  744. font-size: 34rpx;
  745. font-weight: bold;
  746. }
  747. .detail_info {
  748. display: flex;
  749. justify-content: space-between;
  750. margin-top: 10rpx;
  751. .info_left {
  752. color: #999999;
  753. font-size: 20rpx;
  754. }
  755. .info_right {
  756. display: flex;
  757. align-items: center;
  758. color: #096562;
  759. font-size: 24rpx;
  760. img {
  761. margin-left: 6rpx;
  762. width: 10rpx;
  763. height: 20rpx;
  764. }
  765. }
  766. }
  767. .detail_group {
  768. display: flex;
  769. flex-wrap: wrap;
  770. margin-top: 5rpx;
  771. width: 450rpx;
  772. .group_item {
  773. display: flex;
  774. align-items: center;
  775. margin-right: 10rpx;
  776. margin-bottom: 10rpx;
  777. color: #999999;
  778. font-size: 20rpx;
  779. img {
  780. margin-right: 5rpx;
  781. width: 22rpx;
  782. height: 22rpx;
  783. }
  784. }
  785. }
  786. .address {
  787. display: flex;
  788. justify-content: space-between;
  789. margin-top: 8rpx;
  790. font-size: 28rpx;
  791. font-weight: bold;
  792. .address_left {
  793. width: 480rpx;
  794. overflow: hidden;
  795. text-overflow: ellipsis;
  796. white-space: nowrap;
  797. }
  798. .address_right {
  799. display: flex;
  800. .right_box {
  801. margin-left: 28rpx;
  802. width: 50rpx;
  803. height: 78rpx;
  804. img {
  805. width: 100%;
  806. height: 100%;
  807. }
  808. }
  809. }
  810. }
  811. .distance {
  812. margin-top: -35rpx;
  813. color: #999999;
  814. font-size: 24rpx;
  815. }
  816. }
  817. .body {
  818. float: left;
  819. margin-top: 20rpx;
  820. // padding-bottom: 30rpx;
  821. width: 710rpx;
  822. border-radius: 10rpx;
  823. background-color: #fff;
  824. .body_header {
  825. display: flex;
  826. justify-content: space-around;
  827. box-sizing: border-box;
  828. padding: 0 30rpx;
  829. height: 150rpx;
  830. .header_start {
  831. display: flex;
  832. flex-direction: column;
  833. justify-content: center;
  834. align-items: center;
  835. width: 213rpx;
  836. height: 150rpx;
  837. font-size: 30rpx;
  838. .header_top {
  839. margin-bottom: 10rpx;
  840. color: #999999;
  841. font-size: 24rpx;
  842. }
  843. .header_bottom {
  844. font-size: 34rpx;
  845. font-weight: bold;
  846. }
  847. }
  848. .header_night {
  849. display: flex;
  850. justify-content: center;
  851. align-items: center;
  852. .night_line {
  853. width: 17rpx;
  854. height: 1rpx;
  855. background-color: #296de3;
  856. }
  857. .night_box {
  858. display: flex;
  859. align-items: center;
  860. justify-content: center;
  861. width: 81rpx;
  862. height: 46rpx;
  863. font-size: 24rpx;
  864. border-radius: 66rpx;
  865. border: 1rpx solid #296de3;
  866. }
  867. }
  868. .header_end {
  869. display: flex;
  870. flex-direction: column;
  871. justify-content: center;
  872. align-items: center;
  873. width: 213rpx;
  874. height: 150rpx;
  875. font-size: 30rpx;
  876. .header_top {
  877. margin-bottom: 10rpx;
  878. color: #999999;
  879. font-size: 24rpx;
  880. }
  881. .header_bottom {
  882. font-size: 34rpx;
  883. font-weight: bold;
  884. }
  885. }
  886. }
  887. .body_content {
  888. .body_box {
  889. box-sizing: border-box;
  890. padding: 0 30rpx;
  891. margin-bottom: 30rpx;
  892. display: flex;
  893. height: 193rpx;
  894. border-bottom: 1rpx solid #cccccc;
  895. .box_left {
  896. width: 213rpx;
  897. height: 161rpx;
  898. border-radius: 5rpx;
  899. img {
  900. width: 100%;
  901. height: 100%;
  902. }
  903. }
  904. .box_center {
  905. margin-left: 16rpx;
  906. .center_top {
  907. font-size: 34rpx;
  908. font-weight: bold;
  909. }
  910. .center_center {
  911. display: flex;
  912. flex-wrap: wrap;
  913. margin-top: 10rpx;
  914. color: #999999;
  915. font-size: 24rpx;
  916. .center_item {
  917. margin-right: 15rpx;
  918. }
  919. }
  920. .center_bottom {
  921. margin-top: 25rpx;
  922. .img {
  923. margin-right: 15rpx;
  924. width: 30rpx;
  925. height: 30rpx;
  926. }
  927. }
  928. }
  929. .box_right {
  930. display: flex;
  931. flex-direction: column;
  932. align-items: flex-end;
  933. margin-left: auto;
  934. margin-top: 20rpx;
  935. .right_price {
  936. color: #ff5733;
  937. font-size: 42rpx;
  938. text {
  939. font-size: 24rpx;
  940. }
  941. }
  942. .right_btn {
  943. display: flex;
  944. justify-content: center;
  945. align-items: center;
  946. margin-top: 10rpx;
  947. width: 100rpx;
  948. height: 66rpx;
  949. color: #fff;
  950. font-size: 36rpx;
  951. border-radius: 11rpx;
  952. background-color: #096562;
  953. }
  954. .inactive {
  955. background-color: #cccccc;
  956. }
  957. }
  958. }
  959. .body_pop {
  960. position: relative;
  961. height: 955rpx;
  962. border-radius: 22rpx 22rpx 0 0;
  963. background-color: #fff;
  964. overflow-y: auto;
  965. .pop_swiper {
  966. height: 422rpx;
  967. border-radius: 22rpx 22rpx 0 0;
  968. .pop_swiper_item {
  969. width: 100%;
  970. height: 100%;
  971. .img {
  972. width: 100%;
  973. height: 100%;
  974. border-radius: 22rpx 22rpx 0 0;
  975. }
  976. }
  977. }
  978. .pop_icon {
  979. position: absolute;
  980. top: 20rpx;
  981. right: 30rpx;
  982. width: 58rpx;
  983. height: 58rpx;
  984. }
  985. .pop_body {
  986. box-sizing: border-box;
  987. padding: 0 20rpx 30rpx;
  988. .body_title {
  989. margin-top: 30rpx;
  990. font-size: 32rpx;
  991. font-weight: bold;
  992. }
  993. .body_tags {
  994. display: flex;
  995. flex-wrap: wrap;
  996. margin-top: 20rpx;
  997. .tags_item {
  998. display: flex;
  999. align-items: center;
  1000. margin-right: 76rpx;
  1001. margin-bottom: 20rpx;
  1002. color: #383838;
  1003. font-size: 24rpx;
  1004. .img {
  1005. margin-right: 5rpx;
  1006. width: 28rpx;
  1007. height: 28rpx;
  1008. }
  1009. }
  1010. }
  1011. .body_title2 {
  1012. margin-top: 20rpx;
  1013. font-size: 28rpx;
  1014. }
  1015. .body_detail {
  1016. display: flex;
  1017. flex-direction: column;
  1018. justify-content: space-between;
  1019. // align-items: flex-end;
  1020. box-sizing: border-box;
  1021. padding: 20rpx 30rpx;
  1022. margin-top: 18rpx;
  1023. width: 710rpx;
  1024. height: 266rpx;
  1025. font-size: 24rpx;
  1026. border-radius: 7rpx;
  1027. background-color: #f2f2f2;
  1028. .detail_old {
  1029. text-align: end;
  1030. text-decoration: line-through;
  1031. }
  1032. .detail_box {
  1033. display: flex;
  1034. justify-content: space-between;
  1035. color: #808080;
  1036. text {
  1037. color: #ff5733;
  1038. }
  1039. }
  1040. .detail_new {
  1041. display: flex;
  1042. justify-content: flex-end;
  1043. align-items: center;
  1044. font-size: 24rpx;
  1045. .color {
  1046. color: #ff5733;
  1047. }
  1048. .price {
  1049. font-size: 36rpx;
  1050. }
  1051. .ml_10 {
  1052. margin-left: 10rpx;
  1053. }
  1054. }
  1055. }
  1056. .body_bottom {
  1057. display: flex;
  1058. justify-content: space-between;
  1059. align-items: center;
  1060. margin-top: 250rpx;
  1061. height: 80rpx;
  1062. .bottom_left {
  1063. display: flex;
  1064. align-items: center;
  1065. color: #333333;
  1066. font-size: 24rpx;
  1067. .img {
  1068. margin-right: 10rpx;
  1069. width: 48rpx;
  1070. height: 48rpx;
  1071. }
  1072. }
  1073. .bottom_right {
  1074. display: flex;
  1075. align-items: center;
  1076. color: #ff5733;
  1077. font-size: 40rpx;
  1078. font-weight: bold;
  1079. text {
  1080. font-size: 24rpx;
  1081. }
  1082. .btn {
  1083. display: flex;
  1084. justify-content: center;
  1085. align-items: center;
  1086. margin-left: 30rpx;
  1087. width: 238rpx;
  1088. height: 80rpx;
  1089. color: #fff;
  1090. font-size: 32rpx;
  1091. font-weight: 400;
  1092. border-radius: 64rpx;
  1093. background-color: #096562;
  1094. }
  1095. .inactive {
  1096. background-color: #cccccc;
  1097. }
  1098. }
  1099. }
  1100. }
  1101. }
  1102. }
  1103. .noData {
  1104. display: flex;
  1105. flex-direction: column;
  1106. justify-content: center;
  1107. align-items: center;
  1108. padding-bottom: 20rpx;
  1109. img {
  1110. margin-top: 60rpx;
  1111. width: 600rpx;
  1112. height: 600rpx;
  1113. }
  1114. }
  1115. }
  1116. .evaluate {
  1117. width: 710rpx;
  1118. background-color: #f2f3f5;
  1119. .evaluate_title {
  1120. line-height: 83rpx;
  1121. font-size: 32rpx;
  1122. font-weight: bold;
  1123. }
  1124. .evaluate_body {
  1125. display: flex;
  1126. flex-direction: column;
  1127. margin-bottom: 20rpx;
  1128. width: 710rpx;
  1129. border-radius: 11rpx;
  1130. background-color: #fff;
  1131. .header {
  1132. display: flex;
  1133. align-items: center;
  1134. margin: 25rpx 20rpx;
  1135. width: 670rpx;
  1136. height: 120rpx;
  1137. border-radius: 13rpx;
  1138. background-color: #e4f0ef;
  1139. .header_box {
  1140. display: flex;
  1141. height: 70rpx;
  1142. .box_left {
  1143. display: flex;
  1144. justify-content: center;
  1145. align-items: center;
  1146. width: 140rpx;
  1147. color: #096562;
  1148. font-size: 60rpx;
  1149. font-weight: 900;
  1150. border-right: 1rpx solid #cccccc;
  1151. }
  1152. .box_right {
  1153. flex: 1;
  1154. display: flex;
  1155. flex-wrap: wrap;
  1156. color: #808080;
  1157. font-size: 24rpx;
  1158. .right_item {
  1159. display: flex;
  1160. align-items: center;
  1161. width: 50%;
  1162. .item_info {
  1163. margin-left: 33rpx;
  1164. }
  1165. .item_progress {
  1166. margin-right: 20rpx;
  1167. padding: 0 13rpx;
  1168. flex: 1;
  1169. }
  1170. }
  1171. }
  1172. }
  1173. }
  1174. .evaluate_box {
  1175. box-sizing: border-box;
  1176. padding: 0 20rpx;
  1177. margin: 0 auto 20rpx;
  1178. width: 710rpx;
  1179. border-radius: 18rpx;
  1180. background-color: #fff;
  1181. .box_userInfo {
  1182. display: flex;
  1183. align-items: center;
  1184. height: 115rpx;
  1185. img {
  1186. width: 70rpx;
  1187. height: 70rpx;
  1188. border-radius: 50%;
  1189. }
  1190. .userInfo_msg {
  1191. margin-left: 18rpx;
  1192. .msg_name {
  1193. font-size: 28rpx;
  1194. }
  1195. .msg_star {
  1196. margin-left: -5rpx;
  1197. margin-top: 5rpx;
  1198. }
  1199. }
  1200. }
  1201. .box_time {
  1202. display: flex;
  1203. align-items: center;
  1204. color: #a6a6a6;
  1205. font-size: 24rpx;
  1206. }
  1207. .box_content {
  1208. margin-top: 15rpx;
  1209. font-size: 24rpx;
  1210. color: #000;
  1211. }
  1212. .box_img {
  1213. display: grid;
  1214. grid-template-columns: 1fr 1fr 1fr;
  1215. grid-auto-rows: auto;
  1216. gap: 10rpx;
  1217. margin-top: 20rpx;
  1218. img {
  1219. width: 216rpx;
  1220. height: 216rpx;
  1221. border-radius: 20rpx;
  1222. }
  1223. .video {
  1224. width: 216rpx;
  1225. height: 216rpx;
  1226. border-radius: 20rpx;
  1227. }
  1228. }
  1229. }
  1230. .foot {
  1231. display: flex;
  1232. justify-content: center;
  1233. align-items: center;
  1234. padding-bottom: 20rpx;
  1235. height: 68rpx;
  1236. font-size: 24rpx;
  1237. font-weight: bold;
  1238. color: #096663;
  1239. img {
  1240. margin-left: 10rpx;
  1241. width: 10rpx;
  1242. height: 18rpx;
  1243. }
  1244. }
  1245. .noData {
  1246. display: flex;
  1247. flex-direction: column;
  1248. justify-content: center;
  1249. align-items: center;
  1250. padding-bottom: 60rpx;
  1251. img {
  1252. margin-top: 160rpx;
  1253. width: 600rpx;
  1254. height: 600rpx;
  1255. }
  1256. }
  1257. }
  1258. }
  1259. }
  1260. </style>