首页初次对接口

This commit is contained in:
clay
2022-12-25 16:05:39 +08:00
parent 4050e638f0
commit fd6f5b5390
7 changed files with 305 additions and 191 deletions

View File

@@ -1,16 +1,17 @@
<template>
<view>
<view class="xw_content" v-for="(item,index) in cjsList" :key="index" @click="clickCj(index)">
<u--image :src="item.src" width="112rpx" height="112rpx" :lazy-load="true">
<view class="xw_content" v-for="(item,index) in cjsList" :key="index" @click="clickCj(item)">
<u--image :src="item.cover" width="112rpx" height="112rpx" :lazy-load="true">
</u--image>
<view class="xw_right">
<view class="xw_title">
{{item.title}}
{{item.name}}
</view>
<view style="display: flex;">
<text class="cj_tags" v-for="(tagsItem,tagsIndex) in item.tags" :key="tagsIndex">
<!-- <text class="cj_tags" v-for="(tagsItem,tagsIndex) in item.tags" :key="tagsIndex">
{{tagsItem.tag}}
</text>
</text> -->
<text class="cj_tags">{{item.tag}}</text>
</view>
</view>
</view>
@@ -21,48 +22,56 @@
export default {
data() {
return {
cjsList: [
cjsList: [{
src: '/static/report/zhanwei_xf(1).png',
title: '西安兴沃丰餐饮管理有限责任公司',
tags: [{
tag: '咖啡'
},
{
tag: '饮品'
}
]
},
{
src: '/static/report/zhanwei_xf(1).png',
title: '福建省海纳川食品有限公司',
tags: [{
tag: '活冻鲍鱼'
},
{
tag: '鲍鱼罐头'
},
{
tag: '佛跳墙'
},
{
tag: '海螺片'
}
// {
// src: '/static/report/zhanwei_xf(1).png',
// title: '西安兴沃丰餐饮管理有限责任公司',
// tags: [{
// tag: '咖啡'
// },
// {
// tag: '饮品'
// }
// ]
// },
// {
// src: '/static/report/zhanwei_xf(1).png',
// title: '福建省海纳川食品有限公司',
// tags: [{
// tag: '活冻鲍鱼'
// },
// {
// tag: '鲍鱼罐头'
// },
// {
// tag: '佛跳墙'
// },
// {
// tag: '海螺片'
// }
]
},
// ]
// },
]
}
},
created() {
this.getCertifiedCj()
},
methods: {
// 获取认证厂家列表
getCertifiedCj() {
this.$apiServe.getCertifiedCj().then(res => {
// console.log('认证厂家', res.data.data)
this.cjsList = res.data.data
}).finally(_ => {})
},
// 跳转到认证厂家详情页
clickCj(index) {
if (index == 0) {
uni.navigateTo({
url: '../../packageReport/certifiedCjDetail/certifiedCjDetail'
})
}
clickCj(item) {
uni.navigateTo({
url: '../../packageReport/certifiedCjDetail/certifiedCjDetail?id=' + item.id
})
}
}
}