Feat: 地标好物(服务)

(cherry picked from commit d3957be379)
This commit is contained in:
linxi
2024-11-15 10:40:22 +08:00
parent b5c87c1edb
commit 5f9a6b358d
8 changed files with 258 additions and 51 deletions
+35 -8
View File
@@ -18,6 +18,12 @@
<view class="item-action v12-white"><u-icon name="arrow-right" color="#C52733 " size="12"></u-icon></view>
</view>
</view>
<image
v-if="list.length === 0"
:src="webUrl + '/20231023131208675588.png'"
class="img-nodata"
mode="scaleToFill"
/>
</view>
</template>
@@ -31,22 +37,34 @@ export default {
},
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
list: [],
currentList: [],
isMore: false
}
},
mounted() {
getPorjectRecommend({landmarkDataId: this.landmarkDataId}).then(res => {
this.list = res.data
if(this.isMore) {
this.currentList = this.list
} else {
this.currentList = this.list.filter((item, index) => index < 3)
watch: {
landmarkDataId(value) {
if(value) {
this.getData()
}
})
}
},
mounted() {
this.getData()
},
methods: {
getData() {
getPorjectRecommend({landmarkDataId: this.landmarkDataId}).then(res => {
this.list = res.data
if(this.isMore) {
this.currentList = this.list
} else {
this.currentList = this.list.filter((item, index) => index < 3)
}
})
},
toStore(id) {
if (!id) {
return
@@ -131,4 +149,13 @@ export default {
padding: 5rpx 20rpx;
border-radius: 30rpx;
}
.img-nodata {
position: relative;
top: 0;
left: 50%;
transform: translate(-50%, 0);
width: 352rpx;
height: 338rpx;
margin-bottom: 60rpx;
}
</style>