Feat: 寻趣味接口对接(缺分享接口,店住名称字段)

This commit is contained in:
linxi
2024-12-13 16:04:25 +08:00
parent 50cbe66332
commit b535e21e2f
8 changed files with 124 additions and 42 deletions
+3 -3
View File
@@ -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;
+12 -22
View File
@@ -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
}
+44 -8
View File
@@ -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;
+6 -2
View File
@@ -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;
+52 -6
View File
@@ -1,7 +1,18 @@
<template>
<view class="town">
<hx-navbar :back="true" :fixed="true" color="#fff" :statusBar="true" transparent="hidden" barPlaceholder="hidden" />
<view class="top-img">
<image :src="townInfo.cover" mode="scaleToFill" class="img"></image>
<image v-if="townInfo.coverType === 1" :src="townInfo.cover" mode="scaleToFill" class="img"></image>
<video
v-if="townInfo.coverType === 2"
class="img"
:src="townInfo.cover"
autoplay
:play-btn-position="center"
:show-fullscreen-btn="false"
:show-play-btn="false"
:show-center-play-btn="flase"
> </video>
</view>
<view class="top-intro">
<view class="intro-title v12-pa-3">
@@ -10,9 +21,12 @@
4A
</text>
</view>
<view class="shareBtn"><u-icon name="share-square" color="#C52733"></u-icon>分享给好友</view>
<u-line dashed></u-line>
<view class="v12-pa-3 intro-content">
{{ townInfo.intro }}
<view v-if="townInfo.intro" class="v12-pa-3 intro-content">
<u-read-more :toggle="true" showHeight="200">
{{ townInfo.intro }}
</u-read-more>
</view>
</view>
<view class="tabs-wrap">
@@ -93,6 +107,21 @@ export default {
</script>
<style lang="less" scoped>
.shareBtn{
width: fit-content;
padding: 5rpx 15rpx;
background: #edbfc2;
box-shadow: 0rpx 4rpx 4rpx rgba(0,0,0,0.16);
border-radius: 24rpx 0rpx 0rpx 24rpx;
color: #C52733;
font-weight: bold;
font-size: 28rpx;
position: absolute;
right: 0;
top: 0;
display: flex;
align-items: center;
}
.town{
min-height: 100vh;
background: #f0f0f0;
@@ -113,7 +142,7 @@ export default {
font-size: 36rpx;
}
.intro-content{
letter-spacing: 100px;
letter-spacing: 2.5px;
line-height: 40rpx;
font-size: 28rpx;
color: #666;
@@ -134,15 +163,32 @@ export default {
border-radius: 30rpx;
margin-top: -30rpx;
position: relative;
z-index: 2;
z-index: 11;
}
.top-img{
width: 100%;
background: #fff;
height: 560rpx;
background: rgba(180,18,18,0.39);
position: relative;
.img{
height: inherit;
width: 100%;
}
.img1{
z-index: 10;
position: absolute;
top: 0;
left: 0;
border-radius: 30rpx;
}
.bg{
height: 100%;
width: 50%;
background: #fff;
position: absolute;
top: -30rpx;
right: 0;
z-index: 9;
}
}
</style>