| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753 |
- <template>
- <view class="container" :style="'overflow:' + (showPage ? 'hidden' : 'visible')" v-if="info">
- <!-- 顶部分段器区域 -->
- <view class="control">
- <uni-segmented-control :current="activeIndex" :values="headerList" style-type="text" active-color="#096562" @clickItem="onClickItem" />
- </view>
- <!-- 顶部民宿图片区域 -->
- <view class="banner">
- <swiper autoplay circular class="swiper">
- <swiper-item class="swiper_item" v-for="(item, current) in info.hotelFileInfoList" :key="item.id" @click="handleClickSwiper(info.hotelFileInfoList, current)">
- <img mode="aspectFill" class="img" :src="item.url" />
- </swiper-item>
- </swiper>
- <view class="slogan">
- <img src="../../static/index/slogan.png" />
- </view>
- <!-- 720°全景链接区域 -->
- <view class="full" v-if="info.linkProUrl" @click="handleGoPull(info.linkProUrl)">
- <img src="../../static/index/full.png" />
- 720°全景
- </view>
- <!-- 收藏按钮区域 -->
- <view class="collect">
- <uni-fav circle bgColorChecked="#096562" :checked="info.is_collect_hotel" @click="changeCollect(info.is_collect_hotel)" />
- </view>
- </view>
- <!-- 民宿详细信息区域 -->
- <view class="detail">
- <view class="detail_name">{{ info.hotel_name }}</view>
- <view class="detail_info">
- <view class="info_left">{{ info.fitupTime }}装修 | {{ info.openTime }}开业</view>
- <view class="info_right" @click="goPageDetailInfo">
- 设施/详情
- <img src="../../static/index/right.png" />
- </view>
- </view>
- <view class="detail_group">
- <view class="group_item" v-for="item in info.hconfigList" :key="item.id">
- <img :src="item.fileUrl" />
- {{ item.name }}
- </view>
- </view>
- <view class="address">
- <view class="address_left">{{ info.hposition }}</view>
- <view class="address_right">
- <view class="right_box" @click="handleMap(info)">
- <img src="../../static/index/map.png" />
- </view>
- <view class="right_box" @click="handlePhone(info.managerPhone)">
- <img src="../../static/index/phone.png" />
- </view>
- </view>
- </view>
- <view class="distance" v-if="distance">距离我{{ distance }}km</view>
- </view>
- <!-- 房型信息区域 -->
- <view class="body">
- <!-- 选择日期区域 -->
- <view class="body_header" @click="handleOpen()">
- <view class="header_start">
- <view class="header_top">{{ getWeek(startTime) }}入住</view>
- <view class="header_bottom">{{ startTime.slice(5, 7) }}月{{ startTime.slice(8, 10) }}日</view>
- </view>
- <view class="header_night">
- <view class="night_line"></view>
- <view class="night_box">{{ nightNum }}晚</view>
- <view class="night_line"></view>
- </view>
- <view class="header_end">
- <view class="header_top">{{ getWeek(endTime) }}离店</view>
- <view class="header_bottom">{{ endTime.slice(5, 7) }}月{{ endTime.slice(8, 10) }}日</view>
- </view>
- </view>
- <!-- 日历组件 -->
- <uv-calendars
- ref="calendar"
- range
- title="选择日期"
- start-text="住店"
- end-text="离店"
- color="#096562"
- confirmColor="#096562"
- :selected="selected"
- :startDate="earlyTime"
- :endDate="lateTime"
- @monthSwitch="monthSwitch"
- @confirm="handleConfirm"
- />
- <!-- 房型列表区域 -->
- <view class="body_content" v-if="list.length">
- <!-- 每一个房型盒子区域 -->
- <view class="body_box" v-for="item in list" :key="item.id" @click="handleLookDetail(item)">
- <view class="box_left">
- <img mode="aspectFill" :src="item.fileInfoList[0].url" />
- </view>
- <view class="box_center">
- <view class="center_top">{{ item.hName }}</view>
- <view class="center_center">
- <view class="center_item" v-if="item.hAreas">{{ item.hAreas }}㎡ 剩余{{ item.remainRooms }}间</view>
- </view>
- <view class="center_bottom">
- <img v-for="item2 in item.hConfigList" :key="item2.id" class="img" :src="item2.fileUrl" />
- </view>
- </view>
- <view class="box_right">
- <view class="right_price">
- <text>¥</text>
- {{ item.price }}
- </view>
- <view class="right_btn" :class="{ inactive: item.remainRooms * 1 <= 0 }" @click.stop="goPageAffOrder(item)">订</view>
- </view>
- </view>
- <!-- 点击房型弹窗区域 -->
- <uv-popup ref="popup" bgColor="none" :safeAreaInsetBottom="false">
- <view class="body_pop">
- <!-- 轮播图区域 -->
- <swiper indicator-dots circular indicator-color="#FFFFFF" indicator-active-color="#096562" class="pop_swiper">
- <swiper-item class="pop_swiper_item" v-for="item in roomInfo.fileInfoList" :key="item.id">
- <img class="img" :src="item.url" />
- </swiper-item>
- </swiper>
- <!-- 轮播图关闭图标区域 -->
- <img class="pop_icon" src="../../static/index/close.png" @click="handleClosePop" />
- <view class="pop_body">
- <view class="body_title">{{ roomInfo.hName }}</view>
- <view class="body_tags">
- <view class="tags_item">
- <img class="img" src="../../static/index/place.png" />
- {{ roomInfo.hAreas }}㎡
- </view>
- <view class="tags_item" v-for="item2 in roomInfo.hConfigList" :key="item2.id">
- <img class="img" :src="item2.fileUrl" />
- {{ item2.name }}
- </view>
- </view>
- <view class="body_title2">费用明细</view>
- <view class="body_detail">
- <!-- <view class="detail_old">¥{{ roomInfo.price }}</view> -->
- <!-- <view class="detail_box">
- 黄金会员9折
- <text>-¥25</text>
- </view>
- <view class="detail_box">
- 活动
- <text>-¥2.5</text>
- </view> -->
- <view class="detail_new">
- 每间每晚
- <view class="ml_10 color">¥</view>
- <view class="price color">{{ roomInfo.price }}</view>
- </view>
- </view>
- <view class="body_bottom">
- <view class="bottom_left" @click="handlePhone(info.managerPhone)">
- <img class="img" src="../../static/index/phone2.png" />
- 联系商家
- </view>
- <view class="bottom_right">
- <text>¥</text>
- {{ roomInfo.price }}
- <view class="btn" :class="{ inactive: roomInfo.remainRooms * 1 <= 0 }" @click="goPageAffOrder(roomInfo)">预定</view>
- </view>
- </view>
- </view>
- </view>
- </uv-popup>
- </view>
- <view class="noData" v-else>
- <img src="../../static/images/noData.png" />
- 暂无数据
- </view>
- </view>
- <!-- 评价区域 -->
- <view class="evaluate">
- <view class="evaluate_title">评价</view>
- <view class="evaluate_body">
- <!-- 评分区域 -->
- <view class="header" v-if="score">
- <view class="header_box">
- <!-- 总评分区域 -->
- <view class="box_left">{{ score }}</view>
- <view class="box_right">
- <!-- 位置评分区域 -->
- <view class="right_item">
- <view class="item_info">位置 {{ scoreWz }}</view>
- <view class="item_progress">
- <progress activeColor="#0BAD8B" backgroundColor="#CCCCCC" stroke-width="10" border-radius="92" :percent="((scoreWz * 1) / 5) * 100" />
- </view>
- </view>
- <!-- 设施评分区域 -->
- <view class="right_item">
- <view class="item_info">设施 {{ scoreSs }}</view>
- <view class="item_progress">
- <progress activeColor="#0BAD8B" backgroundColor="#CCCCCC" stroke-width="10" border-radius="92" :percent="((scoreSs * 1) / 5) * 100" />
- </view>
- </view>
- <!-- 服务评分区域 -->
- <view class="right_item">
- <view class="item_info">服务 {{ scoreFw }}</view>
- <view class="item_progress">
- <progress activeColor="#0BAD8B" backgroundColor="#CCCCCC" stroke-width="10" border-radius="92" :percent="((scoreFw * 1) / 5) * 100" />
- </view>
- </view>
- <!-- 卫生评分区域 -->
- <view class="right_item">
- <view class="item_info">卫生 {{ scoreWs }}</view>
- <view class="item_progress">
- <progress activeColor="#0BAD8B" backgroundColor="#CCCCCC" stroke-width="10" border-radius="92" :percent="((scoreWs * 1) / 5) * 100" />
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 每一个评价区域 -->
- <view class="evaluate_box" v-for="item in commentList" :key="item.id" @click="handleGoDetail(item)">
- <!-- 用户信息区域 -->
- <view class="box_userInfo">
- <img mode="aspectFill" :src="item.headPhoto" />
- <view class="userInfo_msg">
- <view class="msg_name">{{ item.userName }}</view>
- <view class="msg_star">
- <uni-rate readonly activeColor="#FFC300" :size="16" :value="item.score" />
- </view>
- </view>
- </view>
- <!-- 入住时间区域 -->
- <view class="box_time" v-if="item.liveTime">{{ item.liveTime.slice(0, 10) }}入住,{{ item.commentTime.slice(0, 10) }}发表 | {{ item.houseName }}</view>
- <!-- 评价内容区域 -->
- <uv-read-more show-height="85rpx" closeText="全文" color="#096663" fontSize="24rpx" textIndent="0" :toggle="true" :shadowStyle="shadowStyle">
- <view class="box_content">
- {{ item.content }}
- </view>
- </uv-read-more>
- <!-- 图片区域 -->
- <view class="box_img">
- <img
- v-for="(ele, index) in item.url"
- :key="index"
- mode="aspectFill"
- v-if="ele.indexOf('jpg') !== -1 || ele.indexOf('png') !== -1"
- :src="ele"
- @click.stop="handleClickImg(ele, index)"
- />
- <video
- :id="item.id + index2"
- class="video"
- :show-fullscreen-btn="false"
- :show-play-btn="false"
- v-for="(video, index2) in item.url"
- :key="index2"
- v-if="video.indexOf('mp4') !== -1"
- :src="video"
- @fullscreenchange="fullscreenchange"
- @click.stop="handleClickVideo(item.id + index2)"
- ></video>
- </view>
- </view>
- <view class="foot" @click="handleGoPage" v-if="commentList.length">
- 查看全部{{ total }}条评价
- <img src="../../static/index/right.png" />
- </view>
- <view class="noData" v-if="commentList.length === 0">
- <img src="../../static/images/noData.png" />
- 暂无评论
- </view>
- </view>
- </view>
- <!-- 周边民宿区域 -->
- <view class="rim">
- <!-- 标题区域 -->
- <view class="rim_title">周边民宿</view>
- <!-- 周边民宿列表区域 -->
- <view class="rim_body">
- <!-- 每一个民宿区域 -->
- <view class="rim_box" v-for="item in rimList" :key="item.id" @click="testGo(item)">
- <img mode="aspectFill" :src="item.url" />
- <view class="box_info">
- <view class="info_top">{{ item.name }}</view>
- <view class="info_center">{{ item.leave }}</view>
- <view class="info_bottom">
- <view class="bottom_rate">{{ item.rate }}分</view>
- <view class="bottom_num">{{ item.num }}条评论</view>
- <view class="bottom_price">
- ¥{{ item.price }}
- <text>起</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 查看全部 -->
- <view class="rim_more" @click="test">
- 查看全部
- <img src="../../static/index/right.png" />
- </view>
- </view>
- <!-- 周边景点区域 -->
- <view class="scenicSpot">
- <!-- 标题区域 -->
- <view class="scenicSpot_title">周边景点</view>
- <!-- 周边景点列表区域 -->
- <view class="scenicSpot_body">
- <!-- 每一个景点区域 -->
- <view class="scenicSpot_box" v-for="item in scenicSpotList" :key="item.id">
- <img mode="aspectFill" :src="item.url" />
- <view class="box_info">
- <view class="info_top">{{ item.name }}</view>
- <view class="info_center">距您查询酒店直线{{ item.distance }}km</view>
- <view class="info_bottom">
- <view class="bottom_rate">{{ item.rate }}分</view>
- <view class="bottom_num">{{ item.num }}条评论</view>
- <view class="bottom_price">
- ¥{{ item.price }}
- <text>起</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 查看全部 -->
- <view class="scenicSpot_more" @click="test">
- 查看全部
- <img src="../../static/index/right.png" />
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- // 滚动穿透控制
- showPage: false,
- // 房型数据数组
- list: [],
- // 住几晚
- nightNum: 1,
- // 选择日期数组
- dayList: [],
- // 酒店信息
- info: null,
- // 房间信息
- roomInfo: {},
- // 民宿Id
- hotelId: '',
- // 是否有定位权限
- showLocation: false,
- // 是否展示距离
- distance: '',
- // 入住时间 YYYY-MM-DD
- startTime: '',
- // 离店时间 YYYY-MM-DD
- endTime: '',
- // 日历可以选择的最早日期
- earlyTime: '',
- // 日历可以选择的最晚日期
- lateTime: '',
- activeIndex: 0,
- headerList: ['预定', '评价', '周边'],
- // 评价列表数据
- commentList: [],
- queryDom: null,
- // 评价Dom距离页面顶部的距离
- domTop: null,
- // 周边Dom距离页面顶部的距离
- domTopRim: null,
- selected: [],
- // 总评分
- score: '',
- // 服务评分
- scoreFw: '',
- // 设施评分
- scoreSs: '',
- // 卫生评分
- scoreWs: '',
- // 位置评分
- scoreWz: '',
- // 评论总条数
- total: null,
- // 是否收藏
- ischecked: false,
- // video 上下文 videoContext 对象
- videoContext: null,
- // 是否是全屏状态
- isFullScreen: false,
- rimList: [
- {
- id: 1726150980,
- url: 'https://chtech.ncjti.edu.cn/hotelReservation/fileload/download/16311442750812_8.jpg',
- name: '九岭山房民宿',
- leave: '金宿',
- rate: 4.8,
- num: 109,
- price: 180
- },
- {
- id: 1102488098,
- url: 'https://chtech.ncjti.edu.cn/hotelReservation/fileload/download/1933617026前台.jpg',
- name: '云上九岭',
- leave: '白金',
- rate: 4.5,
- num: 21,
- price: 880
- },
- {
- id: 1147515780,
- url: 'https://chtech.ncjti.edu.cn/hotelReservation/fileload/download/1922593201民宿图片2.jpg',
- name: '靖安三闲居民宿',
- leave: '白金',
- rate: 4.6,
- num: 89,
- price: 680
- },
- {
- id: 1851521611,
- url: 'https://chtech.ncjti.edu.cn/hotelReservation/fileload/download/14323863982h0k15000000ym7ji8285_W_1080_808_R5_D.jpg',
- name: '野塘隐夏民宿',
- leave: '白金',
- rate: 4.7,
- num: 81,
- price: 650
- }
- ],
- scenicSpotList: [
- {
- id: 1,
- url: 'https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20230922113014_c1d59da5595928a4d865418eeae861b.png',
- name: '九仙君澜水上乐园',
- distance: 1.3,
- rate: 4.8,
- num: 69,
- price: 160
- },
- {
- id: 2,
- url: 'https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20230922112928_113d3f4c04eda11cea9051d516613aa.png',
- name: '九仙君澜温泉',
- distance: 1.5,
- rate: 4.5,
- num: 11,
- price: 880
- },
- {
- id: 3,
- url: 'https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20230922112955_639270c554d315e5a845d6c26ad8548.png',
- name: '白沙坪度假村',
- distance: 3,
- rate: 4.6,
- num: 89,
- price: 388
- },
- {
- id: 4,
- url: 'https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20230922112850_1bba201e62087a806240c668d0f2bf8.png',
- name: '百丈山萝卜潭',
- distance: 3.5,
- rate: 4.7,
- num: 81,
- price: 550
- }
- ]
- }
- },
- mounted() {
- // 开启转发功能
- uni.showShareMenu({
- withShareTicket: true,
- menus: ['shareAppMessage', 'shareTimeline']
- })
- },
- onLoad(options) {
- this.getTimes()
- this.hotelId = options.id
- this.distance = options.distance === 'undefined' ? false : options.distance
- uni.getSetting({
- success: (res) => {
- this.showLocation = res.authSetting['scope.userLocation']
- this.getHotelInfo()
- this.getEvaData()
- }
- })
- },
- onPageScroll(e) {
- if (!this.queryDom) {
- this.queryDom = uni.createSelectorQuery().in(this)
- this.queryDom
- .select('.evaluate')
- .boundingClientRect((data) => {
- this.domTop = data.top
- })
- .exec()
- this.queryDom
- .select('.rim')
- .boundingClientRect((data) => {
- this.domTopRim = data.top
- })
- .exec()
- }
- if (e.scrollTop > this.domTopRim) {
- this.activeIndex = 2
- } else if (e.scrollTop > this.domTop) {
- this.activeIndex = 1
- } else {
- this.activeIndex = 0
- }
- },
- methods: {
- test() {
- uni.showToast({
- title: '功能开发中',
- icon: 'none',
- mask: true
- })
- },
- testGo(item) {
- this.info = null
- this.activeIndex = 0
- this.score = ''
- this.scoreFw = ''
- this.scoreSs = ''
- this.scoreWs = ''
- this.scoreWz = ''
- this.commentList = []
- this.getHotelInfo(item.id)
- this.getEvaData(item.id)
- uni.pageScrollTo({
- scrollTop: 0
- })
- // this.queryDom = null
- },
- // 进入全屏和退出全屏时触发的回调
- fullscreenchange(e) {
- this.isFullScreen = e.detail.fullScreen
- },
- // 点击视频控件时触发的回调
- handleClickVideo(id) {
- this.videoContext = uni.createVideoContext(id)
- if (this.isFullScreen) {
- this.videoContext.stop()
- this.videoContext.exitFullScreen()
- } else {
- this.videoContext.requestFullScreen()
- this.videoContext.play()
- }
- },
- // 点击收藏按钮回调
- async changeCollect(is_collect_hotel) {
- let userInfo = uni.getStorageSync('userInfo')
- let openid = uni.getStorageSync('openid')
- if (userInfo && openid) {
- const res = await this.$myRequest({
- url: is_collect_hotel ? '/mhotel/ahpdelCollectHotel.action' : '/mhotel/ahpcollectHotel.action',
- data: {
- userId: uni.getStorageSync('userInfo').id,
- hotelId: this.hotelId
- }
- })
- // console.log(res)
- if (res.code === 200) {
- uni.showToast({
- title: is_collect_hotel ? '取消收藏成功' : '收藏成功',
- icon: 'success',
- mask: true
- })
- this.info.is_collect_hotel = !this.info.is_collect_hotel
- }
- } else {
- uni.showToast({
- title: '请先登录',
- icon: 'none',
- mask: true
- })
- setTimeout(() => {
- uni.navigateTo({
- url: '/pages/login/login'
- })
- }, 1500)
- }
- },
- // 获取评论数据
- async getEvaData(id) {
- const res = await this.$myRequest({
- url: '/mhotel/abcaevaluatePage.action',
- data: {
- hotelId: id ? id : this.hotelId,
- page: 1,
- rows: 5,
- status: 0
- }
- })
- // console.log(res);
- if (res.code === 200 && res.page.pageList) {
- this.score = res.score.score.toFixed(1)
- this.scoreFw = res.score.scoreFw.toFixed(1)
- this.scoreSs = res.score.scoreSs.toFixed(1)
- this.scoreWs = res.score.scoreWs.toFixed(1)
- this.scoreWz = res.score.scoreWz.toFixed(1)
- this.commentList = res.page.pageList
- this.total = res.page.total
- }
- },
- // 获取民宿信息
- async getHotelInfo(id) {
- const res = await this.$myRequest({
- url: '/mhotel/ahpgetHouseByHotelId.action',
- data: {
- hotelId: id ? id : this.hotelId,
- userId: uni.getStorageSync('userInfo').id,
- queryStartTime: this.startTime,
- queryEndTime: this.endTime
- }
- })
- // console.log(res)
- if (res.code === 200) {
- this.info = res.data.data
- this.list = res.data.data.houseList
- uni.setNavigationBarTitle({
- title: res.data.data.hotel_name
- })
- }
- },
- onClickItem(e) {
- this.activeIndex = e.currentIndex
- if (this.activeIndex === 1) {
- uni.pageScrollTo({
- selector: '.evaluate'
- })
- } else if (this.activeIndex === 0) {
- uni.pageScrollTo({
- scrollTop: 0
- })
- } else if (this.activeIndex === 2) {
- uni.pageScrollTo({
- selector: '.rim'
- })
- }
- },
- monthSwitch(e) {
- let time = e.year + '-' + e.month.toString().padStart(2, 0) + '-01'
- this.handleOpen(time)
- },
- // 选择日期确定回调
- handleConfirm(e) {
- this.startTime = e.range.before
- this.endTime = e.range.after
- this.dayList = e.range.data
- this.nightNum = e.range.data.length - 1
- this.getHotelInfo()
- },
- // 点击地图图标回调
- handleMap(item) {
- if (this.showLocation) {
- let lat = item.hpositionWens.split(',')[0] * 1
- let lng = item.hpositionWens.split(',')[1] * 1
- uni.openLocation({
- latitude: lat,
- longitude: lng,
- name: item.hname,
- address: item.hposition,
- success: () => {}
- })
- } else {
- uni.showModal({
- content: '当前没有定位权限,是否去设置打开?',
- confirmText: '确认',
- cancelText: '取消',
- success: (res) => {
- if (res.confirm) {
- uni.openSetting({
- success: (res) => {
- this.showLocation = true
- this.handleMap(item)
- }
- })
- } else {
- uni.showToast({
- title: '获取定位权限失败,无法使用地图功能',
- icon: 'none',
- mask: true
- })
- }
- }
- })
- }
- },
- // 点击电话图标回调
- handlePhone(phone) {
- uni.makePhoneCall({
- phoneNumber: phone
- })
- },
- // 点击弹窗关闭图标回调
- handleClosePop() {
- this.showPage = false
- this.$refs.popup.close()
- },
- // 点击每一个户型回调
- handleLookDetail(item) {
- this.roomInfo = item
- this.showPage = true
- this.$refs.popup.open('bottom')
- },
- // 点击设施详情回调
- goPageDetailInfo() {
- uni.navigateTo({
- url: `/pages/detailInfo/detailInfo?hotelId=${this.hotelId}`
- })
- },
- // 点击 订 预定 按钮回调
- goPageAffOrder(item) {
- let flag = uni.getStorageSync('openid')
- if (flag) {
- if (!this.startTime) {
- uni.showToast({
- title: '请选择入住时间',
- icon: 'none'
- })
- return
- }
- if (!this.endTime) {
- uni.showToast({
- title: '请选择离店时间',
- icon: 'none'
- })
- return
- }
- if (item.remainRooms * 1 > 0) {
- this.$refs.popup.close()
- this.showPage = false
- let info = JSON.stringify({
- nightNum: this.nightNum,
- startTimeDay: this.startTime.slice(8, 10),
- startTimeMonth: this.startTime.slice(5, 7),
- startTimeWeek: this.getWeek(this.startTime),
- endTimeDay: this.endTime.slice(8, 10),
- endTimeMonth: this.endTime.slice(5, 7),
- endTimeWeek: this.getWeek(this.endTime),
- item: item,
- queryStartTime: this.startTime,
- queryEndTime: this.endTime,
- dayList: this.dayList,
- hTypeName: this.info.hTypeName,
- hotelName: this.info.hotel_name,
- hotelId: this.hotelId
- })
- uni.navigateTo({
- url: `/pages/affirmOrder/affirmOrder?info=${info}`
- })
- } else {
- uni.showToast({
- title: '该房间已售罄',
- icon: 'none',
- mask: true
- })
- }
- } else {
- uni.showToast({
- title: '请先登录',
- icon: 'none',
- mask: true
- })
- setTimeout(() => {
- uni.navigateTo({
- url: '/pages/login/login'
- })
- }, 1500)
- }
- },
- // 点击日期区域回调
- async handleOpen(time) {
- const res = await this.$myRequest({
- url: '/mhotel/house/price/priceCalendar.action',
- data: {
- merchantId: this.info.managerId,
- startTime: time ? time : this.startTime
- }
- })
- if (res.code === 200) {
- this.selected = res.data
- }
- if (!time) {
- this.$refs.calendar.open()
- }
- },
- // 传入参数获取当前是星期几
- getWeek(time) {
- let date = new Date(time)
- let week = date.getDay()
- let weekList = ['日', '一', '二', '三', '四', '五', '六']
- let res = '周' + weekList[week]
- return res
- },
- // 获取今明两天的日期 YYYY-MM-DD
- getTimes() {
- // 今天
- let today = new Date()
- // 明天
- let tomorrow = new Date(today.getTime() + 24 * 60 * 60 * 1000)
- let late = new Date(today.getTime() + 24 * 60 * 60 * 1000 * 14)
- this.startTime = `${today.getFullYear()}-${(today.getMonth() + 1).toString().padStart(2, 0)}-${today.getDate().toString().padStart(2, 0)}`
- this.endTime = `${tomorrow.getFullYear()}-${(tomorrow.getMonth() + 1).toString().padStart(2, 0)}-${tomorrow.getDate().toString().padStart(2, 0)}`
- this.dayList = [this.startTime, this.endTime]
- this.earlyTime = this.startTime
- this.lateTime = `${late.getFullYear()}-${(late.getMonth() + 1).toString().padStart(2, 0)}-${late.getDate().toString().padStart(2, 0)}`
- },
- handleGoPull(linkProUrl) {
- let temURL = linkProUrl.slice(22)
- let url = 'https://f10mfe54bri.720yun.com' + temURL
- uni.navigateTo({
- url: `/pages/web/web?url=${url}`
- })
- },
- // 点击每一个评价回调
- handleGoDetail(item) {
- uni.navigateTo({
- url: `/pages/appraiseDetail/appraiseDetail?id=${item.id}`
- })
- },
- // 点击评价图片回调
- handleClickImg(url, index) {
- if (this.videoContext) {
- this.videoContext.stop()
- }
- // 预览图片
- uni.previewImage({
- current: index,
- urls: [url]
- })
- },
- handleGoPage() {
- uni.navigateTo({
- url: `/pages/appraise/appraise?hotelId=${this.hotelId}`
- })
- },
- handleClickSwiper(urls, current) {
- const temList = urls.map((ele) => ele.url)
- uni.previewImage({
- urls: temList,
- current
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .container {
- display: flex;
- flex-direction: column;
- align-items: center;
- position: relative;
- padding-bottom: 20rpx;
- min-height: 100vh;
- background-color: #f2f3f5;
- .control {
- z-index: 999;
- position: sticky;
- top: 0;
- width: 100%;
- height: 100rpx;
- background-color: #fff;
- }
- .banner {
- position: relative;
- width: 750rpx;
- height: 422rpx;
- .swiper {
- height: 422rpx;
- .swiper_item {
- width: 100%;
- height: 100%;
- .img {
- width: 100%;
- height: 100%;
- }
- }
- }
- .img {
- width: 100%;
- height: 100%;
- }
- .slogan {
- position: absolute;
- top: 0;
- left: 0;
- display: flex;
- justify-content: center;
- align-items: center;
- width: 163rpx;
- height: 60rpx;
- background-color: rgba(255, 255, 255, 0.4);
- img {
- width: 125rpx;
- height: 44rpx;
- }
- }
- .full {
- position: absolute;
- top: 13rpx;
- right: 20rpx;
- display: flex;
- align-items: center;
- justify-content: space-around;
- width: 173rpx;
- height: 60rpx;
- color: #fff;
- font-size: 24rpx;
- border-radius: 11rpx;
- background-color: rgba(0, 0, 0, 0.5);
- img {
- width: 40rpx;
- height: 40rpx;
- }
- }
- .collect {
- position: absolute;
- top: 68rpx;
- left: 8rpx;
- }
- }
- .detail {
- z-index: 1;
- float: left;
- margin-top: -177rpx;
- box-sizing: border-box;
- padding: 0 30rpx 30rpx;
- width: 710rpx;
- border-radius: 10rpx;
- background-color: #fff;
- .detail_name {
- margin-top: 25rpx;
- font-size: 34rpx;
- font-weight: bold;
- }
- .detail_info {
- display: flex;
- justify-content: space-between;
- margin-top: 10rpx;
- .info_left {
- color: #999999;
- font-size: 20rpx;
- }
- .info_right {
- display: flex;
- align-items: center;
- color: #096562;
- font-size: 24rpx;
- img {
- margin-left: 6rpx;
- width: 10rpx;
- height: 20rpx;
- }
- }
- }
- .detail_group {
- display: flex;
- flex-wrap: wrap;
- margin-top: 5rpx;
- width: 450rpx;
- .group_item {
- display: flex;
- align-items: center;
- margin-right: 10rpx;
- margin-bottom: 10rpx;
- color: #999999;
- font-size: 20rpx;
- img {
- margin-right: 5rpx;
- width: 22rpx;
- height: 22rpx;
- }
- }
- }
- .address {
- display: flex;
- justify-content: space-between;
- margin-top: 8rpx;
- font-size: 28rpx;
- font-weight: bold;
- .address_left {
- width: 480rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .address_right {
- display: flex;
- .right_box {
- margin-left: 28rpx;
- width: 50rpx;
- height: 78rpx;
- img {
- width: 100%;
- height: 100%;
- }
- }
- }
- }
- .distance {
- margin-top: -35rpx;
- color: #999999;
- font-size: 24rpx;
- }
- }
- .body {
- float: left;
- margin-top: 20rpx;
- // padding-bottom: 30rpx;
- width: 710rpx;
- border-radius: 10rpx;
- background-color: #fff;
- .body_header {
- display: flex;
- justify-content: space-around;
- box-sizing: border-box;
- padding: 0 30rpx;
- height: 150rpx;
- .header_start {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- width: 213rpx;
- height: 150rpx;
- font-size: 30rpx;
- .header_top {
- margin-bottom: 10rpx;
- color: #999999;
- font-size: 24rpx;
- }
- .header_bottom {
- font-size: 34rpx;
- font-weight: bold;
- }
- }
- .header_night {
- display: flex;
- justify-content: center;
- align-items: center;
- .night_line {
- width: 17rpx;
- height: 1rpx;
- background-color: #296de3;
- }
- .night_box {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 81rpx;
- height: 46rpx;
- font-size: 24rpx;
- border-radius: 66rpx;
- border: 1rpx solid #296de3;
- }
- }
- .header_end {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- width: 213rpx;
- height: 150rpx;
- font-size: 30rpx;
- .header_top {
- margin-bottom: 10rpx;
- color: #999999;
- font-size: 24rpx;
- }
- .header_bottom {
- font-size: 34rpx;
- font-weight: bold;
- }
- }
- }
- .body_content {
- .body_box {
- box-sizing: border-box;
- padding: 0 30rpx;
- margin-bottom: 30rpx;
- display: flex;
- height: 193rpx;
- border-bottom: 1rpx solid #cccccc;
- .box_left {
- width: 213rpx;
- height: 161rpx;
- border-radius: 5rpx;
- img {
- width: 100%;
- height: 100%;
- }
- }
- .box_center {
- margin-left: 16rpx;
- .center_top {
- font-size: 34rpx;
- font-weight: bold;
- }
- .center_center {
- display: flex;
- flex-wrap: wrap;
- margin-top: 10rpx;
- color: #999999;
- font-size: 24rpx;
- .center_item {
- margin-right: 15rpx;
- }
- }
- .center_bottom {
- margin-top: 25rpx;
- .img {
- margin-right: 15rpx;
- width: 30rpx;
- height: 30rpx;
- }
- }
- }
- .box_right {
- display: flex;
- flex-direction: column;
- align-items: flex-end;
- margin-left: auto;
- margin-top: 20rpx;
- .right_price {
- color: #ff5733;
- font-size: 42rpx;
- text {
- font-size: 24rpx;
- }
- }
- .right_btn {
- display: flex;
- justify-content: center;
- align-items: center;
- margin-top: 10rpx;
- width: 100rpx;
- height: 66rpx;
- color: #fff;
- font-size: 36rpx;
- border-radius: 11rpx;
- background-color: #096562;
- }
- .inactive {
- background-color: #cccccc;
- }
- }
- }
- .body_pop {
- position: relative;
- height: 955rpx;
- border-radius: 22rpx 22rpx 0 0;
- background-color: #fff;
- overflow-y: auto;
- .pop_swiper {
- height: 422rpx;
- border-radius: 22rpx 22rpx 0 0;
- .pop_swiper_item {
- width: 100%;
- height: 100%;
- .img {
- width: 100%;
- height: 100%;
- border-radius: 22rpx 22rpx 0 0;
- }
- }
- }
- .pop_icon {
- position: absolute;
- top: 20rpx;
- right: 30rpx;
- width: 58rpx;
- height: 58rpx;
- }
- .pop_body {
- box-sizing: border-box;
- padding: 0 20rpx 30rpx;
- .body_title {
- margin-top: 30rpx;
- font-size: 32rpx;
- font-weight: bold;
- }
- .body_tags {
- display: flex;
- flex-wrap: wrap;
- margin-top: 20rpx;
- .tags_item {
- display: flex;
- align-items: center;
- margin-right: 76rpx;
- margin-bottom: 20rpx;
- color: #383838;
- font-size: 24rpx;
- .img {
- margin-right: 5rpx;
- width: 28rpx;
- height: 28rpx;
- }
- }
- }
- .body_title2 {
- margin-top: 20rpx;
- font-size: 28rpx;
- }
- .body_detail {
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- // align-items: flex-end;
- box-sizing: border-box;
- padding: 20rpx 30rpx;
- margin-top: 18rpx;
- width: 710rpx;
- height: 266rpx;
- font-size: 24rpx;
- border-radius: 7rpx;
- background-color: #f2f2f2;
- .detail_old {
- text-align: end;
- text-decoration: line-through;
- }
- .detail_box {
- display: flex;
- justify-content: space-between;
- color: #808080;
- text {
- color: #ff5733;
- }
- }
- .detail_new {
- display: flex;
- justify-content: flex-end;
- align-items: center;
- font-size: 24rpx;
- .color {
- color: #ff5733;
- }
- .price {
- font-size: 36rpx;
- }
- .ml_10 {
- margin-left: 10rpx;
- }
- }
- }
- .body_bottom {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-top: 250rpx;
- height: 80rpx;
- .bottom_left {
- display: flex;
- align-items: center;
- color: #333333;
- font-size: 24rpx;
- .img {
- margin-right: 10rpx;
- width: 48rpx;
- height: 48rpx;
- }
- }
- .bottom_right {
- display: flex;
- align-items: center;
- color: #ff5733;
- font-size: 40rpx;
- font-weight: bold;
- text {
- font-size: 24rpx;
- }
- .btn {
- display: flex;
- justify-content: center;
- align-items: center;
- margin-left: 30rpx;
- width: 238rpx;
- height: 80rpx;
- color: #fff;
- font-size: 32rpx;
- font-weight: 400;
- border-radius: 64rpx;
- background-color: #096562;
- }
- .inactive {
- background-color: #cccccc;
- }
- }
- }
- }
- }
- }
- .noData {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- padding-bottom: 20rpx;
- img {
- margin-top: 60rpx;
- width: 600rpx;
- height: 600rpx;
- }
- }
- }
- .evaluate {
- width: 710rpx;
- background-color: #f2f3f5;
- .evaluate_title {
- line-height: 83rpx;
- font-size: 32rpx;
- font-weight: bold;
- }
- .evaluate_body {
- display: flex;
- flex-direction: column;
- // margin-bottom: 20rpx;
- width: 710rpx;
- border-radius: 11rpx;
- background-color: #fff;
- .header {
- display: flex;
- align-items: center;
- margin: 25rpx 20rpx;
- width: 670rpx;
- height: 120rpx;
- border-radius: 13rpx;
- background-color: #e4f0ef;
- .header_box {
- display: flex;
- height: 70rpx;
- .box_left {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 140rpx;
- color: #096562;
- font-size: 60rpx;
- font-weight: 900;
- border-right: 1rpx solid #cccccc;
- }
- .box_right {
- flex: 1;
- display: flex;
- flex-wrap: wrap;
- color: #808080;
- font-size: 24rpx;
- .right_item {
- display: flex;
- align-items: center;
- width: 50%;
- .item_info {
- margin-left: 33rpx;
- }
- .item_progress {
- margin-right: 20rpx;
- padding: 0 13rpx;
- flex: 1;
- }
- }
- }
- }
- }
- .evaluate_box {
- box-sizing: border-box;
- padding: 0 20rpx;
- margin: 0 auto 20rpx;
- width: 710rpx;
- border-radius: 18rpx;
- background-color: #fff;
- .box_userInfo {
- display: flex;
- align-items: center;
- height: 115rpx;
- img {
- width: 70rpx;
- height: 70rpx;
- border-radius: 50%;
- }
- .userInfo_msg {
- margin-left: 18rpx;
- .msg_name {
- font-size: 28rpx;
- }
- .msg_star {
- margin-left: -5rpx;
- margin-top: 5rpx;
- }
- }
- }
- .box_time {
- display: flex;
- align-items: center;
- color: #a6a6a6;
- font-size: 24rpx;
- }
- .box_content {
- margin-top: 15rpx;
- font-size: 24rpx;
- color: #000;
- }
- .box_img {
- display: grid;
- grid-template-columns: 1fr 1fr 1fr;
- grid-auto-rows: auto;
- gap: 10rpx;
- margin-top: 20rpx;
- img {
- width: 216rpx;
- height: 216rpx;
- border-radius: 20rpx;
- }
- .video {
- width: 216rpx;
- height: 216rpx;
- border-radius: 20rpx;
- }
- }
- }
- .foot {
- display: flex;
- justify-content: center;
- align-items: center;
- padding-bottom: 20rpx;
- height: 68rpx;
- font-size: 24rpx;
- font-weight: bold;
- color: #096663;
- img {
- margin-left: 10rpx;
- width: 10rpx;
- height: 18rpx;
- }
- }
- .noData {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- padding-bottom: 60rpx;
- img {
- margin-top: 160rpx;
- width: 600rpx;
- height: 600rpx;
- }
- }
- }
- }
- .rim {
- width: 710rpx;
- background-color: #f2f3f5;
- .rim_title {
- line-height: 83rpx;
- font-size: 32rpx;
- font-weight: bold;
- }
- .rim_body {
- .rim_box {
- display: flex;
- margin-bottom: 20rpx;
- width: 710rpx;
- height: 150rpx;
- background-color: #fff;
- img {
- width: 126rpx;
- height: 150rpx;
- }
- .box_info {
- display: flex;
- flex-direction: column;
- justify-content: space-evenly;
- padding: 0 24rpx;
- box-sizing: border-box;
- width: 584rpx;
- height: 150rpx;
- .info_top {
- font-size: 28rpx;
- font-weight: bold;
- }
- .info_center {
- font-size: 24rpx;
- color: #808080;
- }
- .info_bottom {
- display: flex;
- align-items: center;
- font-size: 24rpx;
- .bottom_rate {
- color: #ff5733;
- }
- .bottom_num {
- margin-left: 15rpx;
- color: #a6a6a6;
- }
- .bottom_price {
- margin-left: auto;
- font-size: 28rpx;
- color: #ff5733;
- text {
- font-size: 20rpx;
- color: #a6a6a6;
- }
- }
- }
- }
- }
- }
- .rim_more {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 710rpx;
- height: 70rpx;
- color: #096663;
- font-size: 24rpx;
- font-weight: bold;
- background-color: #fff;
- img {
- margin-left: 10rpx;
- margin-top: 2rpx;
- width: 10rpx;
- height: 18rpx;
- }
- }
- }
- .scenicSpot {
- width: 710rpx;
- background-color: #f2f3f5;
- .scenicSpot_title {
- line-height: 83rpx;
- font-size: 32rpx;
- font-weight: bold;
- }
- .scenicSpot_body {
- .scenicSpot_box {
- display: flex;
- margin-bottom: 20rpx;
- width: 710rpx;
- height: 150rpx;
- background-color: #fff;
- img {
- width: 126rpx;
- height: 150rpx;
- }
- .box_info {
- display: flex;
- flex-direction: column;
- justify-content: space-evenly;
- padding: 0 24rpx;
- box-sizing: border-box;
- width: 584rpx;
- height: 150rpx;
- .info_top {
- font-size: 28rpx;
- font-weight: bold;
- }
- .info_center {
- font-size: 24rpx;
- color: #808080;
- }
- .info_bottom {
- display: flex;
- align-items: center;
- font-size: 24rpx;
- .bottom_rate {
- color: #ff5733;
- }
- .bottom_num {
- margin-left: 15rpx;
- color: #a6a6a6;
- }
- .bottom_price {
- margin-left: auto;
- font-size: 28rpx;
- color: #ff5733;
- text {
- font-size: 20rpx;
- color: #a6a6a6;
- }
- }
- }
- }
- }
- }
- .scenicSpot_more {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 710rpx;
- height: 70rpx;
- color: #096663;
- font-size: 24rpx;
- font-weight: bold;
- background-color: #fff;
- img {
- margin-left: 10rpx;
- margin-top: 2rpx;
- width: 10rpx;
- height: 18rpx;
- }
- }
- }
- }
- </style>
|