dengjie : 产品详情权限问题

This commit is contained in:
邓洁
2023-02-04 23:22:50 +08:00
parent 4b40658fb5
commit 0cbb51d933
3 changed files with 32 additions and 21 deletions

View File

@@ -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
}

View File

@@ -72,7 +72,7 @@
<text>{{detailList.pub_time}}</text>
</view>
<u-parse :content="detailList.desc" @preview="preview" @navigate="navigate"></u-parse>
<view class="footer" @click="showModal()">
<view class="footer" @click="showContact()">
<u-icon name="kefu-ermai" color="#fff" size="30rpx"></u-icon>
<text>联系客服</text>
</view>
@@ -88,9 +88,12 @@
<login @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay>
</view>
<u-modal :show="showM" :content='content' closeOnClickOverlay="false" showCancelButton="true"
<u-modal :show="showUpdate" :content='content' closeOnClickOverlay="false" showCancelButton="true"
confirmText="升级VIP" @confirm="confirm" @cancel="cancel" confirmColor="#0EBB5B">
<rich-text :nodes="content"></rich-text>
<rich-text :nodes="updateContent"></rich-text>
</u-modal>
<u-modal :show="showUpdating" closeOnClickOverlay="false" confirmText="确定" @confirm="confirm">
<rich-text :nodes="updatingContent"></rich-text>
</u-modal>
</view>
</view>
@@ -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,24 +139,35 @@
//获取详情信息
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);
//授权登录拦截
if (res.data.code == 0 && res.data.data.mytpe == 1) {
this.isLoad = false
}
//跳转到升级VIP页面
if (res.data.code == 0 && res.data.data.mytpe == 2) {
this.showUpdate = true
}
//升级VIP正在审核中
if (res.data.code == 0 && res.data.data.mytpe == 0) {
this.showUpdating = true
}
if (res.data.data) {
let detail = res.data.data
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收藏
@@ -231,7 +242,7 @@
})
},
// 联系客服模态框
showModal() {
showContact() {
this.showCall = true
},
confirmCall() {

View File

@@ -16,7 +16,7 @@
}
.my_avatar {
margin-top: -184rpx;
margin-top: -186rpx;
display: flex;
flex-direction: column;
align-items: center;