Merge pull request '行业报告上方三个按钮的列表展示' (#84) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/84
This commit is contained in:
@@ -33,7 +33,10 @@
|
|||||||
methods: {
|
methods: {
|
||||||
// 获取认证厂家列表
|
// 获取认证厂家列表
|
||||||
getCertifiedCj() {
|
getCertifiedCj() {
|
||||||
this.$apiServe.getCertifiedCj().then(res => {
|
this.$apiServe.getCertifiedCj({
|
||||||
|
pageSize: 2,
|
||||||
|
pageNum: 1
|
||||||
|
}).then(res => {
|
||||||
// console.log('认证厂家', res.data.data)
|
// console.log('认证厂家', res.data.data)
|
||||||
this.cjsList = res.data.data
|
this.cjsList = res.data.data
|
||||||
}).finally(_ => {})
|
}).finally(_ => {})
|
||||||
|
|||||||
@@ -37,13 +37,16 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getNews() {
|
getNews() {
|
||||||
this.$apiServe.getNews().then(res => {
|
this.$apiServe.getNews({
|
||||||
|
pageSize: 3,
|
||||||
|
pageNum: 1
|
||||||
|
}).then(res => {
|
||||||
// console.log('行业新闻', res.data.data)
|
// console.log('行业新闻', res.data.data)
|
||||||
let newsData = res.data.data
|
let newsData = res.data.data
|
||||||
for (const item of newsData) {
|
for (const item of newsData) {
|
||||||
item.pub_time_str = dateFormat(item.pub_time_str)
|
item.pub_time_str = dateFormat(item.pub_time_str)
|
||||||
}
|
}
|
||||||
newsData = newsData.slice(0, 3)
|
// newsData = newsData.slice(0, 3)
|
||||||
this.newsList = newsData
|
this.newsList = newsData
|
||||||
}).finally(_ => {})
|
}).finally(_ => {})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<certifiedCj></certifiedCj>
|
<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 v-if="cjsShow" class="no-data">已经到底啦!</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -9,11 +23,38 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
cjsShow: true
|
cjsShow: true,
|
||||||
|
cjsList: [],
|
||||||
|
imgUrl: '',
|
||||||
|
pageNum: 1, // 当前页
|
||||||
|
pageSize: 4, // 每页条数
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getCertifiedCj()
|
||||||
|
this.imgUrl = uni.getStorageSync('img_url')
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
this.pageNum++
|
||||||
|
this.getCertifiedCj()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// this.cjsShow = this.list.length === 0 ? true : false
|
// 获取认证厂家列表
|
||||||
|
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>
|
</script>
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<productsByTime></productsByTime>
|
<productsByTime ref="productsByTime" @getTimeLength="getTimeLength"></productsByTime>
|
||||||
|
<view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;"
|
||||||
|
v-show="reachBottomLength===0">
|
||||||
|
没有更多数据了</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -8,11 +11,22 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
reachBottomLength: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
this.$refs.productsByTime.pageNum++
|
||||||
|
this.$refs.productsByTime.getProductsByTime()
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.$refs.productsByTime.pageSize = 2
|
||||||
|
this.$refs.productsByTime.getProductsByTime()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//获取按上架时间排列的产品列表length
|
||||||
|
getTimeLength(e) {
|
||||||
|
this.reachBottomLength = e
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,22 +1,68 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<news></news>
|
<view class="xw_content" v-for="(item,index) in newsList" :key="index" @click="clickNews(item)">
|
||||||
|
<u--image :src="imgUrl+item.cover" width="192rpx" height="122rpx" :lazy-load="true">
|
||||||
|
</u--image>
|
||||||
|
<view class="xw_right">
|
||||||
|
<view class="xw_title">
|
||||||
|
{{item.title}}
|
||||||
|
</view>
|
||||||
|
<view style="display: flex;">
|
||||||
|
<text class="xw_time">
|
||||||
|
{{item.pub_time_str}}
|
||||||
|
</text>
|
||||||
|
<text class="xw_time xw_place">
|
||||||
|
{{item.pub_name}}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view v-if="newsShow" class="no-data">已经到底啦!</view>
|
<view v-if="newsShow" class="no-data">已经到底啦!</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {
|
||||||
|
dateFormat
|
||||||
|
} from '../../utills/date.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
newsShow: true,
|
newsShow: true,
|
||||||
|
imgUrl: '',
|
||||||
|
newsList: [],
|
||||||
|
pageNum: 1, // 当前页
|
||||||
|
pageSize: 4, // 每页条数
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
this.getNews()
|
||||||
|
this.imgUrl = uni.getStorageSync('img_url')
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
this.pageNum++
|
||||||
|
this.getNews()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// this.newsShow = this.list.length === 0 ? true : false
|
getNews() {
|
||||||
|
this.$apiServe.getNews({
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: this.pageNum
|
||||||
|
}).then(res => {
|
||||||
|
// console.log('行业新闻', res.data.data)
|
||||||
|
let newsData = res.data.data
|
||||||
|
for (const item of newsData) {
|
||||||
|
item.pub_time_str = dateFormat(item.pub_time_str)
|
||||||
|
}
|
||||||
|
this.newsList = [...this.newsList, ...newsData]
|
||||||
|
}).finally(_ => {})
|
||||||
|
},
|
||||||
|
// 跳转到新闻详情页
|
||||||
|
clickNews(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '../newsDetail/newsDetail?id=' + item.id
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ const toast = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const apiService = {
|
const apiService = {
|
||||||
uploadImgUrl: serverHost + `/upload/image/`,
|
uploadImgUrl: serverHost + `/upload/image/`,
|
||||||
imgUrl: serverHost,
|
imgUrl: serverHost,
|
||||||
// login: data => {
|
// login: data => {
|
||||||
// data = Object.assign(data || {}, {})
|
// data = Object.assign(data || {}, {})
|
||||||
@@ -243,10 +243,10 @@ const apiService = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取行业新闻
|
// 获取行业新闻
|
||||||
getNews() {
|
getNews(data) {
|
||||||
const url = `/news/nlists/?pageSize=50&pageNum=1`
|
const url = `/news/nlists`
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(service.get(url))
|
resolve(service.get(url, data))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取行业新闻详情
|
// 获取行业新闻详情
|
||||||
@@ -257,10 +257,10 @@ const apiService = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取认证厂家列表
|
// 获取认证厂家列表
|
||||||
getCertifiedCj() {
|
getCertifiedCj(data) {
|
||||||
const url = `/news/flists?pageSize=50&pageNum=1`
|
const url = `/news/flists`
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(service.get(url))
|
resolve(service.get(url, data))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取认证厂家详情
|
// 获取认证厂家详情
|
||||||
|
|||||||
Reference in New Issue
Block a user