diff --git a/components/myAvatar/myAvatar.vue b/components/myAvatar/myAvatar.vue
index 2030b29..fa09a00 100644
--- a/components/myAvatar/myAvatar.vue
+++ b/components/myAvatar/myAvatar.vue
@@ -67,7 +67,7 @@
//获取头像昵称和普通会员和VIP会员
getUser() {
this.$apiServe.getUser().then(res => {
- // console.log('个人信息==', res.data);
+ console.log('个人信息==', res.data);
if (res.data.msg === "登录超时,请重新登录") {
this.isLoad = false
}
diff --git a/pages/detail/productsDetail/productsDetail.vue b/pages/detail/productsDetail/productsDetail.vue
index b33298f..b808501 100644
--- a/pages/detail/productsDetail/productsDetail.vue
+++ b/pages/detail/productsDetail/productsDetail.vue
@@ -72,7 +72,7 @@
{{detailList.pub_time}}
-
-
-
+
+
+
+
@@ -112,10 +115,12 @@
showHeart: false,
detailList: [],
isLoad: true,
- showM: false,
+ showUpdate: false,
+ showUpdating: false,
showCall: false,
mobile: '',
- content: '您暂无权限访问,请升级VIP访问'
+ updateContent: '您暂无权限访问,请升级VIP访问',
+ updatingContent: '升级VIP,正在审核中'
}
},
onLoad(option) {
@@ -123,11 +128,6 @@
this.getProductDetail()
this.getCsTel()
this.imgUrl = uni.getStorageSync('img_url')
- if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
- this.isLoad = false
- return
- }
- this.isLoad = true
},
methods: {
//获取客服电话
@@ -139,36 +139,52 @@
//获取详情信息
getProductDetail() {
this.$apiServe.getProductDetail(this.id).then(res => {
- console.log('产品详情', res.data);
- if (res.data.msg == "没有权限访问" && uni.getStorageSync('loginToken')) {
- this.showM = true
+ console.log('产品详情mtype', res.data.data.mytpe);
+ let detail = res.data.data
+ let dataCode = res.data.code
+ //授权登录拦截
+ if (dataCode == 0 && detail.mytpe == 1) {
+ this.isLoad = false
}
- if (res.data.data) {
- let detail = res.data.data
+ //跳转到升级VIP页面
+ if (dataCode == 0 && detail.mytpe == 2) {
+ this.showUpdate = true
+ }
+ //升级VIP正在审核中
+ if (dataCode == 0 && detail.mytpe == 0) {
+ this.showUpdating = true
+ }
+ if (detail) {
detail.pub_time = dateFormatDetail(detail.pub_time)
detail.tags = detail.tags.split(',')
- if (detail.is_thumb == 1) {
+ //点赞数
+ if (detail.thumbcount !== 0 && detail.is_thumb == 0) {
detail.thumb = parseInt(detail.thumb) + parseInt(detail.thumbcount)
} else {
- detail.thumb = parseInt(detail.thumb) - parseInt(detail.thumbcount)
+ if (detail.is_thumb == 1) {
+ detail.thumb = parseInt(detail.thumb) + parseInt(detail.thumbcount)
+ } else {
+ detail.thumb = parseInt(detail.thumb) - parseInt(detail.thumbcount)
+ }
}
this.detailList = detail
}
- // else {
- // this.$toast.warn('没有更多详情了')
- // }
}).finally(_ => {})
},
//点击star收藏
starTap() {
- this.$apiServe.collect(this.id).then(res => {
- if (res.data.code == 1) {
- this.$toast.warn('收藏成功')
- this.getProductDetail()
- } else {
- this.$toast.warn('收藏失败')
- }
- }).finally(_ => {})
+ if (!uni.getStorageSync('loginToken')) {
+ this.$toast.warn('请登录后操作')
+ } else {
+ this.$apiServe.collect(this.id).then(res => {
+ if (res.data.code == 1) {
+ this.$toast.warn('收藏成功')
+ this.getProductDetail()
+ } else {
+ this.$toast.warn('收藏失败')
+ }
+ }).finally(_ => {})
+ }
},
//点击star取消收藏
cancelStarTap(fav_id) {
@@ -183,14 +199,18 @@
},
//点赞按钮
heartTap() {
- this.$apiServe.thumb(this.id).then(res => {
- if (res.data.code == 1) {
- this.getProductDetail()
- this.$toast.warn('点赞成功')
- } else {
- this.$toast.warn('点赞失败')
- }
- }).finally(_ => {})
+ if (!uni.getStorageSync('loginToken')) {
+ this.$toast.warn('请登录后操作')
+ } else {
+ this.$apiServe.thumb(this.id).then(res => {
+ if (res.data.code == 1) {
+ this.getProductDetail()
+ this.$toast.warn('点赞成功')
+ } else {
+ this.$toast.warn('点赞失败')
+ }
+ }).finally(_ => {})
+ }
},
//取消点赞
cancelHeartTap(thumb_id) {
@@ -231,7 +251,7 @@
})
},
// 联系客服模态框
- showModal() {
+ showContact() {
this.showCall = true
},
confirmCall() {
diff --git a/static/styles/myAvatar.scss b/static/styles/myAvatar.scss
index 5e37938..7245b1d 100644
--- a/static/styles/myAvatar.scss
+++ b/static/styles/myAvatar.scss
@@ -16,7 +16,7 @@
}
.my_avatar {
- margin-top: -184rpx;
+ margin-top: -186rpx;
display: flex;
flex-direction: column;
align-items: center;