introduce.vue 5.3 KB

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