Files
pupil/packageReport/certifiedCj/certifiedCj.vue
2023-02-22 14:22:31 +08:00

113 lines
2.3 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view>
<view class="xw_content" v-for="(item,index) in cjsList" :key="index" @click="clickCj(item)">
<u--image :src="imgUrl+item.cover" width="112rpx" height="112rpx" :lazy-load="true">
</u--image>
<view class="xw_right">
<view class="xw_title">
{{item.name}}
</view>
<view style="display: flex;">
<!-- <text class="cj_tags" v-for="(tagsItem,tagsIndex) in item.tags" :key="tagsIndex">
{{tagsItem.tag}}
</text> -->
<text class="cj_tags">{{item.tag}}</text>
</view>
</view>
</view>
<view v-if="cjsShow" class="no-data">已经到底啦</view>
</view>
</template>
<script>
export default {
data() {
return {
cjsShow: true,
cjsList: [],
imgUrl: '',
pageNum: 1, // 当前页
pageSize: 4, // 每页条数
}
},
onLoad() {
this.imgUrl = uni.getStorageSync('img_url')
this.getCertifiedCj()
},
onReachBottom() {
this.pageNum++
this.getCertifiedCj()
},
methods: {
// 获取认证厂家列表
getCertifiedCj() {
this.$apiServe.getCertifiedCj({
pageSize: this.pageSize,
pageNum: this.pageNum
}).then(res => {
// console.log('认证厂家', res)
this.cjsList = [...this.cjsList, ...res.data.data]
}).finally(_ => {})
},
// 跳转到认证厂家详情页
clickCj(item) {
uni.navigateTo({
url: '../certifiedCjDetail/certifiedCjDetail?id=' + item.id
})
}
}
}
</script>
<style lang="scss">
page {
background: #FFFFFF;
}
.no-data {
text-align: center;
margin-top: 29rpx;
font-size: 20rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #BBBBBB;
line-height: 28rpx;
}
.xw_content {
background: #FFFFFF;
border: 1rpx solid #EEEEEE;
display: flex;
padding: 29rpx 19rpx;
.xw_right {
padding-left: 19rpx;
display: flex;
flex-direction: column;
.xw_title {
font-size: 30rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: bold;
color: #3E3E3E;
line-height: 42rpx;
-webkit-line-clamp: 2;
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.cj_tags {
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #969696;
line-height: 33rpx;
padding-right: 10rpx;
margin-top: 35rpx;
}
}
}
</style>