Merge pull request '浏览记录字段问题及代码优化' (#54) from DJ into dev

Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/54
This commit is contained in:
odjbin
2023-01-17 15:31:21 +00:00
9 changed files with 64 additions and 29 deletions

View File

@@ -39,16 +39,18 @@
getNews() { getNews() {
this.$apiServe.getNews().then(res => { this.$apiServe.getNews().then(res => {
// console.log('行业新闻', res.data.data) // console.log('行业新闻', res.data.data)
for (const item of res.data.data) { let newsData = res.data.data
for (const item of newsData) {
item.pub_time_str = dateFormat(item.pub_time_str) item.pub_time_str = dateFormat(item.pub_time_str)
} }
this.newsList = res.data.data newsData = newsData.slice(0, 3)
this.newsList = newsData
}).finally(_ => {}) }).finally(_ => {})
}, },
// 跳转到新闻详情页 // 跳转到新闻详情页
clickNews(item) { clickNews(item) {
uni.navigateTo({ uni.navigateTo({
url: '../../packageReport/xwDetail/xwDetail?id=' + item.id url: '../../packageReport/newsDetail/newsDetail?id=' + item.id
}) })
}, },
} }

View File

@@ -18,7 +18,7 @@
<u-tag :text="item.tags" type="warning" shape="circle"></u-tag> <u-tag :text="item.tags" type="warning" shape="circle"></u-tag>
</view> </view>
<view class="product_desc"> <view class="product_desc">
{{item.title}} {{item.desc}}
</view> </view>
<view class="releaseDate"> <view class="releaseDate">
<u-image src="/static/products/xp_icon_sjf.png" width="22rpx" height="22rpx" <u-image src="/static/products/xp_icon_sjf.png" width="22rpx" height="22rpx"

View File

@@ -0,0 +1,22 @@
<template>
<view>
<productsByTime></productsByTime>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>

View File

@@ -26,8 +26,6 @@
background: #FFFFFF; background: #FFFFFF;
} }
.no-data { .no-data {
text-align: center; text-align: center;
margin-top: 29rpx; margin-top: 29rpx;

View File

@@ -155,7 +155,7 @@
{ {
"root": "packageReport", "root": "packageReport",
"pages": [{ "pages": [{
"path": "news/news", "path": "newsList/newsList",
"style": { "style": {
"navigationBarTitleText": "行内新闻", "navigationBarTitleText": "行内新闻",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
@@ -171,7 +171,7 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, { }, {
"path": "xwDetail/xwDetail", "path": "newsDetail/newsDetail",
"style": { "style": {
"navigationBarTitleText": "行业新闻详情", "navigationBarTitleText": "行业新闻详情",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
@@ -187,6 +187,15 @@
"navigationBarBackgroundColor": "#12CA64", "navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, {
"path": "newProductRelease/newProductRelease",
"style": {
"navigationBarTitleText": "新品发布",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": false
}
} }
] ]
} }

View File

@@ -120,15 +120,15 @@
//收藏按钮 //收藏按钮
starTap() { starTap() {
this.detailList.type = !this.detailList.type this.detailList.type = !this.detailList.type
this.$apiServe.collect(this.id).then(res => { // this.$apiServe.collect(this.id).then(res => {
console.log('收藏成功', res.data) // console.log('收藏成功', res.data)
if (res.data.code == 1) { // if (res.data.code == 1) {
this.detailList.type = 1 // this.detailList.type = 1
this.$toast.warn('收藏成功') // this.$toast.warn('收藏成功')
} else { // } else {
this.$toast.warn('收藏失败') // this.$toast.warn('收藏失败')
} // }
}).finally(_ => {}) // }).finally(_ => {})
}, },
//点赞按钮 //点赞按钮
heartTap() { heartTap() {

View File

@@ -28,7 +28,7 @@
</u--image> </u--image>
<text class="xpfb_text text">新品发布</text> <text class="xpfb_text text">新品发布</text>
</view> </view>
<productsByThumb></productsByThumb> <productsByTime></productsByTime>
</view> </view>
<!-- 认证厂家 --> <!-- 认证厂家 -->
@@ -69,7 +69,11 @@
//点击行内新闻时 //点击行内新闻时
if (listIndex == 0) { if (listIndex == 0) {
uni.navigateTo({ uni.navigateTo({
url: '../../packageReport/news/news' url: '../../packageReport/newsList/newsList'
})
} else if (listIndex == 1) {
uni.navigateTo({
url: '../../packageReport/newProductRelease/newProductRelease'
}) })
} else if (listIndex == 2) { } else if (listIndex == 2) {
uni.navigateTo({ uni.navigateTo({

View File

@@ -244,7 +244,7 @@ const apiService = {
}, },
// 获取行业新闻 // 获取行业新闻
getNews() { getNews() {
const url = `/news/nlists/?pageSize=3&pageNum=1` const url = `/news/nlists/?pageSize=50&pageNum=1`
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
resolve(service.get(url)) resolve(service.get(url))
}) })
@@ -258,7 +258,7 @@ const apiService = {
}, },
// 获取认证厂家列表 // 获取认证厂家列表
getCertifiedCj() { getCertifiedCj() {
const url = `/news/flists?pageSize=3&pageNum=1` const url = `/news/flists?pageSize=50&pageNum=1`
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
resolve(service.get(url)) resolve(service.get(url))
}) })
@@ -382,16 +382,16 @@ const apiService = {
}) })
}, },
postMobileByMnp(data) { postMobileByMnp(data) {
const url = `/user/getMobileByMnp` const url = `/user/getMobileByMnp`
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
resolve(service.post(url, data)) resolve(service.post(url, data))
}) })
}, },
postImage(data) { postImage(data) {
const url = `/upload/image/` const url = `/upload/image/`
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
resolve(service.post(url, data)) resolve(service.post(url, data))
}) })
}, },
// 解密 // 解密
decrypt(data) { decrypt(data) {