Feat: 地标好物(服务)

This commit is contained in:
linxi
2024-11-15 10:39:59 +08:00
parent c18ec66653
commit d3957be379
8 changed files with 258 additions and 51 deletions
+33 -8
View File
@@ -74,6 +74,12 @@
class="no-data-loadend"
/>
</view>
<image
v-if="infoArray.length === 0"
:src="webUrl + '/20231023131208675588.png'"
class="img-nodata"
mode="scaleToFill"
/>
</view>
</template>
@@ -97,17 +103,27 @@ export default {
infoArray: []
}
},
created() {
const params = {
landmarkDataId: this.landmarkDataId,
page: 1,
limit: 9999
watch: {
landmarkDataId(value) {
if(value) {
this.getData()
}
}
getNews(params).then(res => {
this.infoArray = res.data.records
})
},
created() {
this.getData()
},
methods: {
getData() {
const params = {
landmarkDataId: this.landmarkDataId,
page: 1,
limit: 9999
}
getNews(params).then(res => {
this.infoArray = res.data.records
})
},
likeInfoItemHandle(item, index, value, voValue) {
hadLike({ landmarkNewsId: item.id }).then(res => {
const { success } = res
@@ -258,5 +274,14 @@ export default {
color: #666;
font-size: 14px;
}
.img-nodata {
position: relative;
top: 0;
left: 50%;
transform: translate(-50%, 0);
width: 352rpx;
height: 338rpx;
margin-bottom: 60rpx;
}
</style>