Feat: 寻趣味接口对接(缺分享接口,店住名称字段)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="culture v12-d-grid-columns-2">
|
||||
<view class="v12-pa-2">
|
||||
<view class="culture v12-d-grid-columns-2" v-if="list.length > 0">
|
||||
<view class="img-item " v-for="(item, index) in list" :key="index" @click="viewImg(item)">
|
||||
<image class="img-item" :src="item" mode="widthFix|heightFix" lazy-load="false"></image>
|
||||
</view>
|
||||
@@ -48,7 +48,7 @@ export default {
|
||||
<style lang="scss" scoped>
|
||||
.culture{
|
||||
grid-gap: 20rpx 20rpx;
|
||||
padding: 20rpx;
|
||||
padding: 20rpx 10rpx;
|
||||
background: #fff;
|
||||
border-radius: 30rpx;
|
||||
margin-top: 20rpx;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<view>
|
||||
<view v-if="infoArray.length > 0" class="info-wrapper">
|
||||
<view v-if="actives.length > 0" class="info-wrapper">
|
||||
<view class="info-list">
|
||||
<view v-for="(item, index) in infoArray" :key="index" class="info-item">
|
||||
<view v-for="(item, index) in actives" :key="index" class="info-item">
|
||||
<view
|
||||
:class="item.isTop === 1 ? 'info-item-top' : ''"
|
||||
:style="{
|
||||
@@ -56,7 +56,7 @@
|
||||
/>
|
||||
</view>
|
||||
<image
|
||||
v-if="infoArray.length === 0"
|
||||
v-if="actives.length === 0"
|
||||
:src="webUrl + '/orderIcon/wu.png'"
|
||||
class="img-nodata"
|
||||
mode="scaleToFill"
|
||||
@@ -65,11 +65,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getNews,
|
||||
hadLike,
|
||||
hadView
|
||||
} from "@/api/product"
|
||||
import { watchTownActive } from "@/api/inn.js"
|
||||
import imgBox from '@/components/imageTypeSet/imagebox.vue'
|
||||
export default {
|
||||
props: {
|
||||
@@ -84,25 +80,19 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
actives: this.infoArray
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
infoArray(val) {
|
||||
this.actives = val
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
likeInfoItemHandle(item, index, value, voValue) {
|
||||
hadLike({ landmarkNewsId: item.id }).then(res => {
|
||||
const { success } = res
|
||||
if (success) {
|
||||
this.$dialog.toast({
|
||||
mes: '操作成功!'
|
||||
})
|
||||
this.$set(this.infoArray[index], 'zan', value)
|
||||
this.$set(this.infoArray[index], 'hasZan', voValue)
|
||||
}
|
||||
})
|
||||
},
|
||||
infoItemViewClick(item) {
|
||||
uni.$u.debounce(() => {
|
||||
hadView({ landmarkNewsId: item.id }).finally(() => {
|
||||
this.infoArray.map(info => {
|
||||
watchTownActive({ id: item.id }).finally(() => {
|
||||
this.actives.forEach(info => {
|
||||
if (info.id === item.id) {
|
||||
info.pv += 1
|
||||
}
|
||||
|
||||
@@ -23,30 +23,43 @@
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="tabs.length > 0"
|
||||
class="content v12-justify-center"
|
||||
:class="{
|
||||
'first-one': actived === 1,
|
||||
'last-one': actived === 3
|
||||
}"
|
||||
|
||||
>
|
||||
<view class="v12-d-grid-columns-2 v12-gap-10">
|
||||
<view v-for="(item, index) in items" :key="index" class="store-card">
|
||||
<view v-if="items.length > 0" class="v12-d-grid-columns-2 v12-gap-10">
|
||||
<view v-for="(item, index) in items" :key="index" class="store-card" @click="toStore(item.hotelId)">
|
||||
<view>
|
||||
<image class="town-cover" :src="item.cover" mode="aspectFit|aspectFill|widthFix"></image>
|
||||
</view>
|
||||
<view class="v12-pa-2">
|
||||
<view class="v12-dark-text v12-font-bold v12-font-30 v12-py-1 more-t">昆明小吃</view>
|
||||
<view class="v12-pa-2 card-bottom">
|
||||
<view class="v12-dark-text v12-font-bold v12-font-30 v12-py-1 more-t">{{ item.hotelName }}</view>
|
||||
<view class="v12-align-center">
|
||||
<view class="avtor">
|
||||
<image class="avtor"></image>
|
||||
<image class="avtor" :src="item.logo" mode="scaleToFill"></image>
|
||||
</view>
|
||||
<view class="v12-secondary-dark-text v12-font-28 v12-ml-3 one-t">刘欢小吃</view>
|
||||
<view class="v12-secondary-dark-text v12-font-28 v12-ml-3 one-t">{{ item.hotelName }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<image
|
||||
v-if="items.length === 0"
|
||||
:src="webUrl + '/orderIcon/wu.png'"
|
||||
class="img-nodata"
|
||||
style="left: 25%;"
|
||||
mode="scaleToFill"
|
||||
/>
|
||||
</view>
|
||||
<image
|
||||
v-if="tabs.length === 0"
|
||||
:src="webUrl + '/orderIcon/wu.png'"
|
||||
class="img-nodata"
|
||||
mode="scaleToFill"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -93,12 +106,35 @@ export default {
|
||||
methods: {
|
||||
handleTab(value) {
|
||||
this.actived = value
|
||||
}
|
||||
},
|
||||
toStore(id) {
|
||||
if (!id) {
|
||||
return
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pagesInn/inn/innHome?id=' + id
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.img-nodata {
|
||||
position: relative;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 0);
|
||||
width: 352rpx;
|
||||
height: 338rpx;
|
||||
margin-bottom: 60rpx;
|
||||
}
|
||||
.card-bottom{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
height: calc(100% - 356rpx);
|
||||
}
|
||||
.avtor{
|
||||
width: 52rpx;
|
||||
height: 52rpx;
|
||||
|
||||
@@ -13,7 +13,10 @@
|
||||
<view>
|
||||
<view class="v12-font-28 v12-mb-1 v12-dark1-text">{{ info.openTime || '' }}</view>
|
||||
<view class="v12-font-28 v12-mb-1 v12-dark1-text">{{ info.address || '' }}</view>
|
||||
<view class="v12-font-28 v12-mb-1 v12-dark1-text">{{ info.announcement || '' }}</view>
|
||||
<view class="v12-font-28 v12-mb-1 v12-dark1-text v12-d-flex">
|
||||
<u-icon size="16" :name="webUrl + '/orderIcon/laba.png'"></u-icon>
|
||||
{{ info.announcement || '' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="action-wrap">
|
||||
<view @click="showLocation">
|
||||
@@ -36,7 +39,7 @@
|
||||
简介
|
||||
</view>
|
||||
<view class="intro-text">
|
||||
{{ info.desc || '' }}
|
||||
<rich-text class="" :nodes="info.desc"></rich-text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -84,6 +87,7 @@ export default {
|
||||
background: #fff;
|
||||
margin-top: 20rpx;
|
||||
border-radius: 30rpx;
|
||||
padding: 20rpx;
|
||||
}
|
||||
.intro-text{
|
||||
color: #999;
|
||||
|
||||
Reference in New Issue
Block a user