Feat: 寻趣味接口对接(缺分享接口,店住名称字段)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user