From fd3b8347a40a23c285ff4b55d721347903b3d3fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=82=93=E6=B4=81?= <209192278@qq.com>
Date: Mon, 27 Feb 2023 00:46:01 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B0=8F=E7=A8=8B=E5=BA=8Fbu?=
=?UTF-8?q?g?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/myAvatar/myAvatar.vue | 16 ++++++++------
.../productsByThumb/productsByThumb.vue | 1 +
components/productsByTime/productsByTime.vue | 2 ++
packageMy/changeAvatar/changeAvatar.vue | 9 +++++---
packageReport/newsDetail/newsDetail.vue | 22 +++++++++++++++----
.../detail/productsDetail/productsDetail.vue | 4 ++--
pages/index/index.vue | 5 ++++-
pages/my/my.vue | 4 +++-
8 files changed, 45 insertions(+), 18 deletions(-)
diff --git a/components/myAvatar/myAvatar.vue b/components/myAvatar/myAvatar.vue
index 37ada0d..7bb3d68 100644
--- a/components/myAvatar/myAvatar.vue
+++ b/components/myAvatar/myAvatar.vue
@@ -71,13 +71,15 @@
this.isLoad = false
}
var data = res.data.data
- this.avatar = uni.getStorageSync('img_url') + data.avatar
- this.nickname = data.nickname
- this.member = data.member
- uni.setStorageSync('member', data.member)
- uni.setStorageSync('agreement', data.agreement)
- uni.setStorageSync('com_name', data.com_name)
- uni.setStorageSync('com_mobile', data.com_mobile)
+ if (data) {
+ this.avatar = uni.getStorageSync('img_url') + data.avatar
+ this.nickname = data.nickname
+ this.member = data.member
+ uni.setStorageSync('member', data.member)
+ uni.setStorageSync('agreement', data.agreement)
+ uni.setStorageSync('com_name', data.com_name)
+ uni.setStorageSync('com_mobile', data.com_mobile)
+ }
}).finally(_ => {})
},
reOnLoad() {
diff --git a/components/productsByThumb/productsByThumb.vue b/components/productsByThumb/productsByThumb.vue
index e42e113..55a323a 100644
--- a/components/productsByThumb/productsByThumb.vue
+++ b/components/productsByThumb/productsByThumb.vue
@@ -64,6 +64,7 @@
pageSize: this.pageSize,
pageNum: this.pageNum
}).then(res => {
+ console.log('产品列表2', res.data);
let tags = res.data.data
for (const item of tags) {
let tag = item.tags
diff --git a/components/productsByTime/productsByTime.vue b/components/productsByTime/productsByTime.vue
index 1099077..60d69f4 100644
--- a/components/productsByTime/productsByTime.vue
+++ b/components/productsByTime/productsByTime.vue
@@ -58,9 +58,11 @@
pageSize: this.pageSize,
pageNum: this.pageNum
}).then(res => {
+ console.log('产品列表1', res.data);
let tags = res.data.data
if (tags) {
for (const item of tags) {
+ console.log('item.cover', item.cover);
let tag = item.tags
this.tagsArray = tag.split(',')
item.tags = this.tagsArray[0]
diff --git a/packageMy/changeAvatar/changeAvatar.vue b/packageMy/changeAvatar/changeAvatar.vue
index 45ff9d6..f02d440 100644
--- a/packageMy/changeAvatar/changeAvatar.vue
+++ b/packageMy/changeAvatar/changeAvatar.vue
@@ -40,9 +40,12 @@
getUser() {
this.$apiServe.getUser().then(res => {
var data = res.data.data
- this.avatar = uni.getStorageSync('img_url') + data.avatar
- this.avatarUrl = '/' + data.avatar
- this.model.userInfo.name = data.nickname
+ console.log('头像昵称', res);
+ if (data) {
+ this.avatar = uni.getStorageSync('img_url') + data.avatar
+ this.avatarUrl = '/' + data.avatar
+ this.model.userInfo.name = data.nickname
+ }
}).finally(_ => {})
},
updatePromise(filePath) {
diff --git a/packageReport/newsDetail/newsDetail.vue b/packageReport/newsDetail/newsDetail.vue
index cff0af1..80138db 100644
--- a/packageReport/newsDetail/newsDetail.vue
+++ b/packageReport/newsDetail/newsDetail.vue
@@ -14,6 +14,9 @@
+
@@ -25,7 +28,9 @@
data() {
return {
id: '',
- detailList: []
+ detailList: [],
+ // showM: false,
+ // content: `该新闻已下架!`,
}
},
onLoad(option) {
@@ -36,15 +41,24 @@
//获取行业新闻详情
getNewsDetail() {
this.$apiServe.getNewsDetail(this.id).then(res => {
+ console.log('新闻详情', res.data);
+ if (res.data.code == 0 || res.data.msg == "该新闻已下架!") {
+ this.$toast.warn('该新闻已下架!')
+ // this.showM = true
+ }
if (res.data.data) {
let detail = res.data.data
detail.pub_time = dateFormatXwDetail(detail.pub_time)
this.detailList = res.data.data
- } else {
- this.$toast.warn('没有更多详情了')
}
+
}).finally(_ => {})
- }
+ },
+ // confirm() {
+ // uni.reLaunch({
+ // url: '/pages/index/index'
+ // })
+ // }
}
}
diff --git a/pages/detail/productsDetail/productsDetail.vue b/pages/detail/productsDetail/productsDetail.vue
index 9807372..2f29982 100644
--- a/pages/detail/productsDetail/productsDetail.vue
+++ b/pages/detail/productsDetail/productsDetail.vue
@@ -59,7 +59,7 @@
- {{detailList.thumb==NaN?1:detailList.thumb}} 赞
+ {{detailList.thumb}} 赞
@@ -139,7 +139,7 @@
//获取详情信息
getProductDetail() {
this.$apiServe.getProductDetail(this.id).then(res => {
- console.log('产品详情mtype', res.data.data);
+ console.log('产品详情', res.data.data);
let detail = res.data.data
let dataCode = res.data.code
//授权登录拦截
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 023e44c..0cd0756 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -141,7 +141,7 @@
getBanner() {
this.$apiServe.getBanner().then(res => {
let banner = res.data.data
- console.log('轮播图', banner);
+ console.log('轮播图', res.data);
if (banner) {
for (const item of banner) {
item.img = this.imgUrl + item.img
@@ -172,6 +172,9 @@
//获取图片url
getImgUrl() {
this.$apiServe.getImgUrl().then(res => {
+ console.log('图片url', res.data);
+ res.data.data.img_url = res.data.data.img_url + '/'
+ console.log('res.data.data.img_url', res.data.data.img_url);
try {
uni.setStorageSync('img_url', res.data.data.img_url);
this.initStart = true
diff --git a/pages/my/my.vue b/pages/my/my.vue
index 0bc9977..44a95fb 100644
--- a/pages/my/my.vue
+++ b/pages/my/my.vue
@@ -72,7 +72,9 @@
//获取客服电话
getCsTel() {
this.$apiServe.getCsTel().then(res => {
- this.mobile = res.data.data.cs_tel
+ if (res.data.data) {
+ this.mobile = res.data.data.cs_tel
+ }
}).finally(_ => {})
},
//跳转到绑定公司页面