Files
xdd-uniapp-new/pkg_product/views/expoList.vue
T

79 lines
1.6 KiB
Vue

<template>
<view class="expo-list">
<view class="search-wrap">
<u-search
placeholder="请输入关键字查询"
v-model="keyword"
shape="round"
:showAction="false"
@search="getList"
></u-search>
</view>
<view class="expo-wrap">
<view
class="expo-item"
v-for="(item, index) in expoList"
:key="index"
@click="toDetails(item)"
>
{{ item.name }}
</view>
<view v-if="expoList.length === 0">
<view class="no-data-wrap v12-justify-center v12-mt-6">
<image
:src="webUrl + '/orderIcon/微信图片_20241009220552.png'"
mode="widthFix"
></image>
</view>
</view>
</view>
</view>
</template>
<script>
import { getWellnessExhibition } from '@/api/health'
export default{
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
keyword: '',
expoList: []
}
},
onLoad() {
this.getList()
},
methods: {
toDetails(item) {
uni.navigateTo({
url: '/pkg_product/views/expoDetails?id='+item.id
})
},
getList() {
const params = {
page: 1,
limit: 9999,
keyword: this.keyword
}
getWellnessExhibition(params).then((res) => {
console.log(res);
this.expoList = res.data.records
})
}
}
}
</script>
<style lang="less" scoped>
.expo-list{
height: 100vh;
background: #fff;
padding: 20rpx;
}
.expo-item{
background-color: #f2f2f2;
border-radius: 100rpx;
font-size: 26rpx;
font-weight: bold;
margin-top: 20rpx;
padding: 20rpx;
}
</style>