introduce.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <template>
  2. <view class="introduce">
  3. <view class="content info">
  4. <image class="img" :src="info.pictures[0].path" mode=""></image>
  5. <view class="title">
  6. {{info.chineseName}}
  7. </view>
  8. <view class="star-box">
  9. <image class="star" v-for="i in getTag(info.star).num" src="../static/star.png" mode=""></image>
  10. </view>
  11. <view class="desc-box">
  12. <view class="text" v-if="info.debutYear">
  13. {{info.debutYear}}年开业
  14. </view>
  15. <view class="text" v-if="info.decorateDate">
  16. {{info.decorateDate}}年装修
  17. </view>
  18. <!-- <view class="text">
  19. {{info.roomCount}}间房
  20. </view> -->
  21. </view>
  22. <view class="desc-text">
  23. {{info.instruction}}
  24. </view>
  25. </view>
  26. <view class="content">
  27. <view class="content-title">
  28. 服务设施
  29. </view>
  30. <view v-for="(item,key) in facilities" :key="key">
  31. <view class="sub-title">
  32. {{item.typeName}}
  33. </view>
  34. <view class="box">
  35. <view class="item" v-for="(i,d) in item.list" :key="d">
  36. {{i.name}}
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="content">
  42. <view class="content-title">
  43. 酒店政策
  44. </view>
  45. <view class="sub-title">
  46. 入离时间
  47. </view>
  48. <view class="value">
  49. {{info.policy.arrivalDeparture || '-'}}
  50. </view>
  51. <view class="sub-title">
  52. 宠物政策
  53. </view>
  54. <view class="value">
  55. {{info.policy.pet || '-'}}
  56. </view>
  57. <view class="sub-title">
  58. 儿童政策
  59. </view>
  60. <view class="value">
  61. {{info.policy.children || '-'}}
  62. </view>
  63. <view class="sub-title">
  64. 特殊要求
  65. </view>
  66. <view class="value">
  67. {{info.policy.requirements || '-'}}
  68. </view>
  69. <view class="sub-title">
  70. 入住需要
  71. </view>
  72. <view class="value">
  73. {{info.policy.depositPrepaid || '-'}}
  74. </view>
  75. <view class="sub-title">
  76. 退订规则
  77. </view>
  78. <view class="value">
  79. {{info.policy.cancel || '-'}}
  80. </view>
  81. </view>
  82. <view class="btn-box">
  83. <view class="btn" @click="goDetail">
  84. 查看房型
  85. </view>
  86. <view class="btn call-btn" @click="handleCall">
  87. 联系酒店
  88. </view>
  89. </view>
  90. </view>
  91. </template>
  92. <script>
  93. import {getHotelDetail} from '@/api/hotel.js'
  94. export default {
  95. data() {
  96. return {
  97. info: null,
  98. facilities:{}
  99. }
  100. },
  101. methods: {
  102. getTag(star){
  103. if(star == 0 ||star == 1){
  104. return {tag:'tag1',num:1}
  105. }else if(star == 2 ||star == 6){
  106. return {tag:'tag2',num:2}
  107. }if(star == 3 ||star == 7){
  108. return {tag:'tag2',num:3}
  109. }if(star == 4 ||star == 8){
  110. return {tag:'tag3',num:4}
  111. }if(star == 5 ||star == 9){
  112. return {tag:'tag3',num:5}
  113. }
  114. },
  115. goDetail(id) {
  116. uni.navigateTo({
  117. url:`/hotel/hotelDetail?id=${this.info.hotelId}`
  118. })
  119. },
  120. handleCall() {
  121. if(this.info.tel){
  122. uni.makePhoneCall({
  123. phoneNumber: this.info.tel //仅为示例
  124. });
  125. }else{
  126. uni.showToast({
  127. title:'商家没有预留电话',
  128. icon:'none'
  129. })
  130. }
  131. },
  132. getHotelDetail(hotelId){
  133. getHotelDetail({hotelId}).then(res=>{
  134. if(res.state == 'Success'){
  135. this.info = res.content.data
  136. this.info.facilities.map(item=>{
  137. if(this.facilities[item.typeCode]){
  138. this.facilities[item.typeCode].list.push(item)
  139. }else{
  140. this.facilities[item.typeCode] = {}
  141. this.facilities[item.typeCode].typeName = item.typeName
  142. this.facilities[item.typeCode].list = [item]
  143. }
  144. })
  145. }
  146. })
  147. }
  148. },
  149. onLoad(options) {
  150. this.getHotelDetail(options.id)
  151. }
  152. }
  153. </script>
  154. <style lang="scss" scoped>
  155. .introduce{
  156. background: #F9F9F9;
  157. padding-bottom: 200rpx;
  158. .content{
  159. padding: 20rpx 24rpx;
  160. background: #fff;
  161. margin-bottom: 20rpx;
  162. .content-title{
  163. font-weight: 600;
  164. font-size: 28rpx;
  165. color: #222222;
  166. }
  167. .sub-title{
  168. font-weight: 600;
  169. font-size: 24rpx;
  170. color: #222222;
  171. margin-top: 28rpx;
  172. }
  173. .box{
  174. display: flex;
  175. flex-wrap: wrap;
  176. .item{
  177. width: 33%;
  178. font-size: 24rpx;
  179. color: #AAAAAA;
  180. margin-top: 20rpx;
  181. }
  182. }
  183. .value{
  184. font-size: 24rpx;
  185. color: #AAAAAA;
  186. line-height: 40rpx;
  187. margin-top: 20rpx;
  188. }
  189. }
  190. .info{
  191. .img{
  192. width: 100%;
  193. height: 376rpx;
  194. border-radius: 16rpx;
  195. }
  196. .title{
  197. font-weight: 600;
  198. font-size: 32rpx;
  199. color: #222222;
  200. width: 650rpx;
  201. white-space: nowrap;
  202. overflow: hidden;
  203. text-overflow: ellipsis;
  204. margin-top: 24rpx;
  205. }
  206. .star-box{
  207. display: flex;
  208. align-items: center;
  209. margin-top: 20rpx;
  210. .star{
  211. width: 21rpx;
  212. height: 17rpx;
  213. margin-left: 3rpx;
  214. }
  215. }
  216. .desc-box{
  217. display: flex;
  218. align-items: center;
  219. font-size: 24rpx;
  220. color: #AAAAAA;
  221. margin-top: 20rpx;
  222. .text{
  223. padding-right: 10rpx;
  224. }
  225. .text+.text{
  226. border-left: 2rpx solid #F0F0F0;
  227. padding-left: 10rpx;
  228. }
  229. }
  230. .desc-text{
  231. font-size: 24rpx;
  232. color: #222222;
  233. line-height: 40rpx;
  234. margin-top: 20rpx;
  235. }
  236. }
  237. .btn-box{
  238. position: fixed;
  239. bottom: 0%;
  240. left: 0%;
  241. background: #fff;
  242. z-index: 2;
  243. width: 100%;
  244. line-height: 98rpx;
  245. display: flex;
  246. justify-content: flex-end;
  247. padding: 0 0 calc(env(safe-area-inset-bottom) + 10rpx) ;
  248. border-top: 1rpx solid #EEEEEE;
  249. .btn{
  250. width: 240rpx;
  251. height: 80rpx;
  252. line-height: 80rpx;
  253. text-align: center;
  254. border-radius: 40rpx 40rpx 40rpx 40rpx;
  255. border: 2rpx solid #EE4320;
  256. font-weight: 600;
  257. font-size: 28rpx;
  258. color: #EE4320;
  259. margin-top: 9rpx;
  260. margin-right: 24rpx;
  261. }
  262. .btn.call-btn{
  263. background: #EE4320;
  264. color: #FFFFFF;
  265. }
  266. }
  267. }
  268. </style>