Feat(时令尝鲜):接口对接
This commit is contained in:
+31
-56
@@ -58,13 +58,13 @@
|
||||
|
||||
<view class="guarantee" v-if="inn.guaranteeValue">保证金:{{ inn.guaranteeValue }}元</view>
|
||||
<view class="acea-row row-center row-middle" style="flex-shrink: 0;" @click="zanInn">
|
||||
<block v-if="inn.zanVo != null">
|
||||
<image style="width: 48rpx;height: 48rpx;margin-right: 10rpx;" :src="webUrl+'/20210302161135069143.png'"
|
||||
<block v-if="isLike">
|
||||
<image style="width: 48rpx;height: 48rpx;margin-right: 10rpx;" :src="webUrl+'/20230828095210280991.png'"
|
||||
mode=""></image>
|
||||
<text style="font-size: 28rpx;color: #FF564A;">{{ inn.zan }}</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<image style="width: 48rpx;height: 48rpx;margin-right: 10rpx;" :src="webUrl+'/20210807215657904755.png'"
|
||||
<image style="width: 48rpx;height: 48rpx;margin-right: 10rpx;" :src="webUrl+'/20230828095217616640.png'"
|
||||
mode=""></image>
|
||||
<text style="font-size: 28rpx;color: #333333;">{{ inn.zan }}</text>
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
|
||||
<view class="" style="padding: 0 32rpx;margin-top: 10rpx;">
|
||||
<view class="inn-signature">
|
||||
<text style="font-size: 24rpx;color: #080F1A;">{{ inn.tips }}</text>
|
||||
<text style="font-size: 24rpx;color: #080F1A;">{{ inn.content }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
<view class="phone-block acea-row row-middle" @click="call">
|
||||
<image style="width: 32rpx;height: 32rpx;margin-right: 10rpx;" :src="webUrl+'/20220901223901017309.png'"
|
||||
mode=""></image>
|
||||
<text style="font-size: 24rpx;color: #41454d;">拨打电话</text>
|
||||
<text style="font-size: 24rpx;color: #41454d;">联系客服</text>
|
||||
</view>
|
||||
<view class="vline"></view>
|
||||
<view class="map-block acea-row row-middle" @click="showLocation">
|
||||
@@ -153,7 +153,6 @@
|
||||
<!-- <drag-button :isDock="true" :existTabBar="true" @btnClick="showQrcode"/>-->
|
||||
<!-- </block>-->
|
||||
<view v-if="activeIndex==0" class="pics-section" style="position: relative;">
|
||||
|
||||
<view class="pics-list acea-row" v-if="inn.pics.length>0">
|
||||
<view :style="{width:picColumnWidth}" @click="showPic(index)" class="pics-item" v-for="(url, index) in inn.pics"
|
||||
:key="index">
|
||||
@@ -161,10 +160,10 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="activeIndex==1" class="info-section" style="position: relative;">
|
||||
<view class="info-list acea-row row-column" v-if="infoArray.length>0">
|
||||
<view class="pics-item acea-row" style="flex-wrap: nowrap;" @click="infoDetail(info)"
|
||||
v-for="(info, index) in infoArray" :key="index">
|
||||
<view class="pics-item acea-row" style="flex-wrap: nowrap;" v-for="(info, index) in infoArray" :key="index">
|
||||
<view class="date-block" style="flex-shrink: 0;">
|
||||
<view class="month-day" :style="index==0?'color:#0DC5C5;':''">{{ info.monthDay }}</view>
|
||||
<view class="year">{{ info.year }}</view>
|
||||
@@ -176,29 +175,27 @@
|
||||
<view :class="['dot',index==0?'first-cell':'']" style="flex-shrink: 0;"></view>
|
||||
<view v-if="(index+1)!=infoArray.length" class="dash-line" style="flex-grow: 1;"></view>
|
||||
</view>
|
||||
<view class="info-card " style="flex-grow: 1;" @click="infoClick(info)">
|
||||
<view class="info-title line1">
|
||||
{{ info.name }}
|
||||
</view>
|
||||
<view class="info-card" style="flex-grow: 1;">
|
||||
<view class="info-title line1" @click="infoClick(info)">{{ info.name }}</view>
|
||||
<block v-if="info.type=='NT_TEXT'">
|
||||
<img-box style="width: 100%;" :imgList='info.resources' :num='info.resources.length'></img-box>
|
||||
</block>
|
||||
|
||||
<view v-else class="video-wrap" style="margin-top: 10rpx;">
|
||||
<video style="width: 100%;height: 264rpx;" :src="info.resources[0]"></video>
|
||||
<video style="width: 100%;height: 264rpx;" :src="info.resources[0]" controls play-btn-position="center"/>
|
||||
</view>
|
||||
|
||||
<view class="info-media-wrap acea-row row-middle row-between" style="margin-top: 10rpx;">
|
||||
<view class="info-media-wrap acea-row row-middle row-between" style="margin-top: 10rpx;" @click="infoClick(info)">
|
||||
<view class="acea-row row-middle">
|
||||
<view class="acea-row row-middle">
|
||||
<image style="width: 28rpx;height: 28rpx;margin-right: 4rpx;"
|
||||
:src="webUrl+'/20220901224017781784.png'"
|
||||
:src="webUrl+'/20230803152147141807.png'"
|
||||
mode=""></image>
|
||||
<text class="seeNum-txt">{{ info.pv }}</text>
|
||||
</view>
|
||||
<view class="acea-row row-middle" style="margin-left: 20rpx;">
|
||||
<image style="width: 28rpx;height: 28rpx;margin-right: 4rpx;"
|
||||
:src="webUrl+'/20220901224304100136.png'" mode=""></image>
|
||||
:src="webUrl+'/20230803151302213857.png'" mode=""></image>
|
||||
<text class="likeNum-txt">{{ info.zan }}</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -280,7 +277,8 @@ export default {
|
||||
showShare: false,
|
||||
posterUrl: "", // 分享海报
|
||||
id: null,
|
||||
partnerId: null
|
||||
partnerId: null,
|
||||
isLike:false //点赞
|
||||
}
|
||||
},
|
||||
//必须在页面加 onPageScroll(e){} ,才能滑动显示背景
|
||||
@@ -288,8 +286,9 @@ export default {
|
||||
this.scrollData = e;
|
||||
},
|
||||
onShow: function () {
|
||||
this.goodsPage = 1;
|
||||
this.goodsList = [];
|
||||
// this.goodsPage = 1;
|
||||
// this.goodsList = [];
|
||||
// this.fetchGoods();
|
||||
|
||||
this.page = 1;
|
||||
this.loading = false;
|
||||
@@ -341,9 +340,7 @@ export default {
|
||||
},
|
||||
// 上拉触底
|
||||
onReachBottom() {
|
||||
if (this.activeIndex == 0) {
|
||||
|
||||
} else if (this.activeIndex == 2) {
|
||||
if (this.activeIndex === 3) {
|
||||
this.goodsPage++;
|
||||
this.fetchGoods();
|
||||
} else {
|
||||
@@ -452,38 +449,19 @@ export default {
|
||||
}
|
||||
,
|
||||
zanInn: function () {
|
||||
var id = this.inn.id;
|
||||
uni.showLoading();
|
||||
getHotelZan(id).then((res) => {
|
||||
uni.hideLoading();
|
||||
var msg = '操作成功!';
|
||||
if (res.msg.length > 0) {
|
||||
msg = res.msg;
|
||||
}
|
||||
uni.showToast({
|
||||
title: msg,
|
||||
mask: false,
|
||||
duration: 1500
|
||||
});
|
||||
setTimeout(function () {
|
||||
//刷新界面
|
||||
that.fetchInnDetail();
|
||||
}, 1500);
|
||||
getHotelZan(this.inn.id).then(() => {
|
||||
this.isLike = !this.isLike;
|
||||
this.fetchInnDetail();
|
||||
}).catch((err) => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: err.msg + '',
|
||||
icon: 'none',
|
||||
mask: false,
|
||||
duration: 1500
|
||||
});
|
||||
}).finally(() => {
|
||||
|
||||
})
|
||||
}
|
||||
,
|
||||
},
|
||||
infoClick: function (info) {
|
||||
return;
|
||||
this.$yrouter.push('/pagesInn/inn/innInfoDetail?id=' + info.id);
|
||||
}
|
||||
,
|
||||
@@ -599,6 +577,7 @@ export default {
|
||||
if (this.isMyInn) {
|
||||
getHotelDetail(this.id).then((res) => {
|
||||
that.inn = res.data;
|
||||
that.isLike = res.data.zanVo !== null;
|
||||
this.fetchInnInfoList();
|
||||
}).catch((err) => {
|
||||
|
||||
@@ -608,6 +587,7 @@ export default {
|
||||
} else {
|
||||
getHomeHotelDetail(this.id).then((res) => {
|
||||
that.inn = res.data;
|
||||
that.isLike = res.data.zanVo !== null;
|
||||
this.fetchInnInfoList();
|
||||
}).catch((err) => {
|
||||
|
||||
@@ -619,14 +599,6 @@ export default {
|
||||
initPoster() {
|
||||
getPoster(this.id).then(({data}) => this.posterUrl = data);
|
||||
},
|
||||
infoDetail: function (info) {
|
||||
if (info.type == 'NT_TEXT') {
|
||||
|
||||
} else if (info.type == 'NT_VIDEO') {
|
||||
|
||||
}
|
||||
}
|
||||
,
|
||||
showLocation: function () {
|
||||
if (!this.inn.latitude || !this.inn.longitude) {
|
||||
this.$dialog.error('暂无位置信息');
|
||||
@@ -970,10 +942,13 @@ export default {
|
||||
}
|
||||
|
||||
.info-card {
|
||||
background: #EBECF0;
|
||||
border-radius: 8rpx;
|
||||
padding: 24rpx;
|
||||
width: 500rpx;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 40rpx;
|
||||
padding: 24rpx;
|
||||
border-radius: 8rpx;
|
||||
background: #EBECF0;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user