首页图片获取,行业报告中行业新闻及详情页和新品发布及详情页接口对接完毕
This commit is contained in:
@@ -7,14 +7,14 @@
|
||||
</u-image>
|
||||
<view class="bgContent">
|
||||
<view>
|
||||
<u-image :src="item.cover" width="346rpx" height="320rpx" :lazy-load="true">
|
||||
<u-image :src="imgUrl+item.cover" width="346rpx" height="320rpx" :lazy-load="true">
|
||||
</u-image>
|
||||
<view class="img_tag">{{item.cate_name}}</view>
|
||||
</view>
|
||||
<view style="padding: 14rpx 22rpx;">
|
||||
<view class="title_box">
|
||||
<text class="title">{{item.name}}</text>
|
||||
<u-tag :text="item.tag" type="warning" shape="circle"></u-tag>
|
||||
<u-tag :text="item.tags" type="warning" shape="circle"></u-tag>
|
||||
</view>
|
||||
<view class="product_desc">
|
||||
{{item.title}}
|
||||
@@ -38,45 +38,14 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
productList: [
|
||||
// {
|
||||
// src: '/static/products/zhanwei_dg.png',
|
||||
// title: '锅巴',
|
||||
// tag: '无添加剂',
|
||||
// img_tag: '零食铺子',
|
||||
// desc: '糯米蟹黄锅巴散装,非油炸绿色健康食品',
|
||||
// time: '2022-12-04'
|
||||
// },
|
||||
// {
|
||||
// src: '/static/products/zhanwei_dg.png',
|
||||
// title: '干吃汤圆',
|
||||
// tag: '天然原料',
|
||||
// img_tag: '糕点卷酥',
|
||||
// desc: '休闲食品厂家甜品糯米食品零食闽南特产宵夜好吃糍粑',
|
||||
// time: '2022-12-04'
|
||||
// },
|
||||
// {
|
||||
// src: '/static/products/zhanwei_dg.png',
|
||||
// title: '紫薯魔芋人参魔芋人参魔芋人参…',
|
||||
// tag: '天然原料',
|
||||
// img_tag: '健康创新',
|
||||
// desc: '紫薯魔芋人参代餐粉 冲调饮品贴牌加工 五谷杂粮粉代餐',
|
||||
// time: '2022-12-04'
|
||||
// },
|
||||
// {
|
||||
// src: '/static/products/zhanwei_dg.png',
|
||||
// title: '焦糖饼干',
|
||||
// tag: '无防腐剂',
|
||||
// img_tag: '饼干曲奇',
|
||||
// desc: '比利时风味焦糖饼干代餐小吃零食品',
|
||||
// time: '2022-12-04'
|
||||
// }
|
||||
],
|
||||
|
||||
imgUrl: '',
|
||||
tagsArray: [],
|
||||
productList: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getProducts()
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -85,6 +54,12 @@
|
||||
// console.log("子组件的获取产品列表方法====");
|
||||
this.$apiServe.getProducts().then(res => {
|
||||
// console.log(res.data.data)
|
||||
let tags = res.data.data
|
||||
for (const item of tags) {
|
||||
let tag = item.tags
|
||||
this.tagsArray = tag.split(',')
|
||||
item.tags = this.tagsArray[0]
|
||||
}
|
||||
this.productList = res.data.data
|
||||
|
||||
}).finally(_ => {})
|
||||
|
||||
Reference in New Issue
Block a user