| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398 |
- <template>
- <view class="container" :style="'overflow:' + (showPage ? 'hidden' : 'visible')" v-if="info">
- <!-- 顶部轮播图区域 -->
- <swiper indicator-dots indicator-color="rgba(255, 255, 255, 0.5)" indicator-active-color="#fff" circular autoplay :interval="3000" class="swiper">
- <swiper-item v-if="info.show_video">
- <video
- class="video"
- :src="info.show_video"
- id="myVideo"
- :show-fullscreen-btn="false"
- :direction="0"
- @fullscreenchange="fullscreenchange"
- @click="handleClickVideo('myVideo')"
- ></video>
- </swiper-item>
- <swiper-item v-for="(item, index) in imgList" :key="index">
- <img class="img" mode="aspectFill" :src="item" @click="handleLookImgs(imgList, index)" />
- </swiper-item>
- </swiper>
- <!-- 周边信息区域 -->
- <view class="info">
- <view class="info_name">{{ info.rname }}</view>
- <view class="info_score">
- <view class="score_msg" @click="goPageInfo">简介</view>
- <img class="score_icon" src="../../static/index/right.png" @click="goPageInfo" />
- </view>
- <view class="info_address">
- <img class="address_icon" src="../../static/index/address.png" />
- <text @click="handleLookAddress">地址:{{ info.radress }}</text>
- </view>
- <view class="info_phone">
- <img class="phone_icon" src="../../static/index/phone3.png" />
- <text @click="handleCallPhone(info.rphone)">联系电话:{{ info.rphone }}</text>
- </view>
- </view>
- <!-- 周边产品区域 -->
- <view class="goods" v-if="goodList.length">
- <view class="goods_title">周边产品</view>
- <!-- 列表区域 -->
- <view class="goods_list">
- <!-- 每一个产品区域 -->
- <view class="item_box" v-for="item in goodList" :key="item.id" @click="handleLookDetail(item)">
- <view class="box_left">
- <view class="left_name">{{ item.product_name }}</view>
- <view class="left_info">产品简介 ></view>
- <view class="left_price">¥{{ item.price }}</view>
- </view>
- <view class="box_right">
- <view class="right_btn">预定</view>
- </view>
- </view>
- </view>
- </view>
- <!-- 查看更多区域 -->
- <view class="more" v-if="showMore" @click="handleShowMore">
- 查看更多
- <img class="more_icon" src="../../static/index/down.png" />
- </view>
- <!-- 弹窗区域 -->
- <uv-popup ref="popup" bgColor="none" :safeAreaInsetBottom="false">
- <view class="body_pop">
- <img class="pop_img" mode="aspectFill" :src="info.first_img" />
- <!-- 弹窗关闭图标区域 -->
- <img class="pop_icon" src="../../static/index/close.png" @click="handleClosePop" />
- <view class="pop_name">{{ popInfo.product_name }}</view>
- <view class="pop_desc">
- <mp-html :content="popInfo.product_desc" />
- </view>
- </view>
- </uv-popup>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- // 滚动穿透控制
- showPage: false,
- goodList: [],
- page: 1,
- rows: 3,
- total: null,
- info: null,
- showMore: true,
- popInfo: null,
- imgList: [],
- // video 上下文 videoContext 对象
- videoContext: null,
- // 是否是全屏状态
- isFullScreen: false
- }
- },
- onLoad(options) {
- this.info = JSON.parse(decodeURIComponent(options.info))
- if (this.info.detail_img) {
- this.imgList = this.info.detail_img.split(',')
- }
- this.getData()
- },
- methods: {
- async getData() {
- const res = await this.$myRequest({
- url: '/mhotel/applistAround_pd.action',
- data: {
- aid: this.info.id,
- page: this.page,
- rows: this.rows
- }
- })
- // console.log(res)
- if (res.code === 200) {
- this.goodList = [...this.goodList, ...res.rows]
- this.total = res.total
- if (this.goodList.length >= this.total) {
- this.showMore = false
- }
- }
- },
- goPageInfo() {
- uni.navigateTo({
- url: `/pages/rimInfo/rimInfo?desc=${this.info.detail}`
- })
- },
- handleLookDetail(item) {
- this.popInfo = item
- this.showPage = true
- this.$refs.popup.open('bottom')
- },
- // 点击弹窗关闭图标回调
- handleClosePop() {
- this.showPage = false
- this.$refs.popup.close()
- },
- handleLookImgs(urls, current) {
- uni.previewImage({
- urls,
- current
- })
- },
- handleLookAddress() {
- let latitude = this.info.jingwei.split(',')[1] * 1
- let longitude = this.info.jingwei.split(',')[0] * 1
- uni.openLocation({
- latitude,
- longitude,
- name: this.info.rname,
- address: this.info.radress,
- success: () => {}
- })
- },
- handleCallPhone(phone) {
- uni.makePhoneCall({
- phoneNumber: phone
- })
- },
- handleShowMore() {
- this.page++
- this.getData()
- },
- // 进入全屏和退出全屏时触发的回调
- fullscreenchange(e) {
- this.isFullScreen = e.detail.fullScreen
- },
- // 点击视频控件时触发的回调
- handleClickVideo(id) {
- this.videoContext = uni.createVideoContext(id)
- if (this.isFullScreen) {
- this.videoContext.pause()
- this.videoContext.exitFullScreen()
- } else {
- this.videoContext.requestFullScreen()
- this.videoContext.play()
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .container {
- min-height: 100vh;
- background-color: #fff;
- .swiper {
- width: 100%;
- height: 423rpx;
- .img,
- .video {
- width: 100%;
- height: 100%;
- }
- }
- .info {
- margin-top: 20rpx;
- padding: 0 20rpx;
- .info_name {
- font-size: 34rpx;
- font-weight: bold;
- color: #000000;
- }
- .info_score {
- display: flex;
- align-items: center;
- margin-top: 22rpx;
- font-size: 24rpx;
- .score_left {
- padding: 0 10rpx 0 12rpx;
- line-height: 36rpx;
- color: #fff;
- text-align: center;
- font-weight: bold;
- border-radius: 32rpx 0 0 32rpx;
- background-color: #096562;
- }
- .score_right {
- padding: 0 12rpx 0 10rpx;
- line-height: 36rpx;
- color: #096562;
- text-align: center;
- font-weight: bold;
- border-radius: 0 32rpx 32rpx 0;
- background-color: #dff2f2;
- }
- .score_msg {
- // margin-left: 42rpx;
- color: #096562;
- }
- .score_icon {
- margin-top: 5rpx;
- margin-left: 13rpx;
- width: 10rpx;
- height: 20rpx;
- }
- }
- .info_address {
- display: flex;
- align-items: center;
- margin-top: 24rpx;
- height: 83rpx;
- font-size: 28rpx;
- border-top: 1rpx solid #e6e6e6;
- .address_icon {
- margin-right: 8rpx;
- width: 30rpx;
- height: 30rpx;
- }
- }
- .info_phone {
- display: flex;
- align-items: center;
- height: 83rpx;
- font-size: 28rpx;
- border-top: 1rpx solid #e6e6e6;
- .phone_icon {
- margin-right: 8rpx;
- width: 40rpx;
- height: 40rpx;
- }
- }
- }
- .goods {
- padding: 0 20rpx;
- border-top: 1rpx solid #cccccc;
- .goods_title {
- margin-top: 30rpx;
- font-size: 32rpx;
- font-weight: bold;
- }
- .goods_list {
- margin-top: 17rpx;
- .item_box {
- display: flex;
- margin-bottom: 20rpx;
- padding: 0 32rpx 0 24rpx;
- height: 170rpx;
- border-radius: 10rpx;
- background-color: #f2f2f2;
- .box_left {
- flex: 2;
- display: flex;
- flex-direction: column;
- justify-content: space-evenly;
- overflow: hidden;
- .left_name {
- font-size: 28rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .left_info {
- color: #808080;
- font-size: 24rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .left_price {
- color: #ff5733;
- font-size: 24rpx;
- }
- }
- .box_right {
- flex: 1;
- display: flex;
- justify-content: flex-end;
- align-items: center;
- .right_btn {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 115rpx;
- height: 60rpx;
- color: #fff;
- font-size: 28rpx;
- border-radius: 10rpx;
- background-color: #ff5733;
- }
- }
- }
- }
- }
- .more {
- display: flex;
- justify-content: center;
- align-items: center;
- padding: 20rpx 0 30rpx 0;
- color: #096663;
- font-size: 24rpx;
- .more_icon {
- width: 38rpx;
- height: 48rpx;
- }
- }
- .body_pop {
- position: relative;
- width: 750rpx;
- height: 85vh;
- border-radius: 22rpx 22rpx 0 0;
- background-color: #fff;
- overflow-y: auto;
- .pop_img {
- width: 100%;
- height: 423rpx;
- border-radius: 20rpx 20rpx 0 0;
- }
- .pop_icon {
- position: absolute;
- top: 20rpx;
- right: 30rpx;
- width: 58rpx;
- height: 58rpx;
- }
- .pop_name {
- padding: 0 20rpx;
- line-height: 90rpx;
- font-size: 32rpx;
- font-weight: bold;
- }
- .pop_desc {
- padding: 0 20rpx;
- }
- }
- }
- </style>
|