统一了review.vue中写酒评、生成酒单和收藏三个按键的权限判断逻辑

This commit is contained in:
davy 2025-04-04 00:10:01 +08:00
parent ae35d60f12
commit ce75ba93a4
9 changed files with 156 additions and 41 deletions

View File

@ -143,7 +143,9 @@
"path" : "pages/index/myJoin",
"style" :
{
"navigationBarTitleText" : ""
"navigationBarTitleText" : "我参与的",
"navigationBarBackgroundColor": "#19367A",
"navigationBarTextStyle": "white"
}
},
{
@ -230,7 +232,9 @@
"path" : "winelist",
"style" :
{
"navigationBarTitleText" : "生成酒单"
"navigationBarTitleText" : "生成酒单",
"navigationBarBackgroundColor": "#19367A",
"navigationBarTextStyle": "white"
}
},
{
@ -267,7 +271,9 @@
"path" : "beerCoin",
"style" :
{
"navigationBarTitleText" : "啤酒币兑好礼"
"navigationBarTitleText" : "啤酒币兑好礼",
"navigationBarBackgroundColor": "#19367A",
"navigationBarTextStyle": "white"
}
},
{
@ -308,42 +314,54 @@
"path" : "myWineReview",
"style" :
{
"navigationBarTitleText" : "我的酒评"
"navigationBarTitleText" : "我的酒评",
"navigationBarBackgroundColor": "#19367A",
"navigationBarTextStyle": "white"
}
},
{
"path" : "myAttention",
"style" :
{
"navigationBarTitleText" : "我的关注"
"navigationBarTitleText" : "我的关注",
"navigationBarBackgroundColor": "#19367A",
"navigationBarTextStyle": "white"
}
},
{
"path" : "myAddress",
"style" :
{
"navigationBarTitleText" : "我的地址"
"navigationBarTitleText" : "我的地址",
"navigationBarBackgroundColor": "#19367A",
"navigationBarTextStyle": "white"
}
},
{
"path" : "feedback",
"style" :
{
"navigationBarTitleText" : ""
"navigationBarTitleText" : "意见反馈",
"navigationBarBackgroundColor": "#19367A",
"navigationBarTextStyle": "white"
}
},
{
"path" : "setting",
"style" :
{
"navigationBarTitleText" : ""
"navigationBarTitleText" : "设置",
"navigationBarBackgroundColor": "#19367A",
"navigationBarTextStyle": "white"
}
},
{
"path" : "addAiad",
"style" :
{
"navigationBarTitleText" : ""
"navigationBarTitleText" : "修改地址",
"navigationBarBackgroundColor": "#19367A",
"navigationBarTextStyle": "white"
}
}
// {

View File

@ -349,7 +349,7 @@
height: 100vh;
overflow-y: auto;
padding-bottom: 40rpx;
background: #F2F2F2;
background: #f9f9f9;
.user-box {
margin-left: 36rpx;

View File

@ -622,48 +622,49 @@
<style lang="scss" scoped>
.activitypage {
height: 100vh;
background: #F9F9F9;
background: #FFFFFF;
display: flex;
flex-direction: column;
.main-nav {
display: flex;
justify-content: center;
align-items: center;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
display: flex;
padding: 0 32rpx;
background: #FFFFFF;
// border-bottom: 1rpx solid #F5F5F5;
height: 88rpx;
align-items: center;
.nav-item {
position: relative;
padding: 28rpx 0;
margin-right: 48rpx;
margin: 0 48rpx;
color: #606060;
font-size: 32rpx;
font-weight: 400;
// margin-right: 24rpx;
&.nav-active {
font-size: 32rpx;
font-weight: 600;
padding: 32rpx;
// padding: 32rpx;
color: #19367A;
font-weight: 600;
.nav-line {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 48rpx;
height: 4rpx;
background: #19367A;
border-radius: 2rpx;
}
// font-weight: 600;
}
.nav-line {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 48rpx;
height: 4rpx;
background: #19367A;
border-radius: 2rpx;
}
}
}

View File

@ -374,6 +374,25 @@
this.$refs.loginRef.open()
return
}
//
const barInfo = uni.getStorageSync('barInfo')
if (!barInfo || barInfo.authState !== 2) {
uni.showModal({
title: '提示',
content: '请先认证门店',
showCancel: true,
success: (res) => {
if (res.confirm) {
uni.navigateTo({
url: '/pages/index/registration'
})
}
}
})
return
}
uni.navigateTo({
url: '/pages/index/writeReview?beerId=' + this.beerId
})
@ -398,6 +417,25 @@
this.$refs.loginRef.open()
return
}
//
const barInfo = uni.getStorageSync('barInfo')
if (!barInfo || barInfo.authState !== 2) {
uni.showModal({
title: '提示',
content: '请先认证门店',
showCancel: true,
success: (res) => {
if (res.confirm) {
uni.navigateTo({
url: '/pages/index/registration'
})
}
}
})
return
}
let data = {
beerId: this.beerId,
status
@ -451,6 +489,25 @@
this.$refs.loginRef.open()
return
}
//
const barInfo = uni.getStorageSync('barInfo')
if (!barInfo || barInfo.authState !== 2) {
uni.showModal({
title: '提示',
content: '请先认证门店',
showCancel: true,
success: (res) => {
if (res.confirm) {
uni.navigateTo({
url: '/pages/index/registration'
})
}
}
})
return
}
uni.navigateTo({
url: "/pagesActivity/winelist?beerId=" + this.beerId
})

View File

@ -125,20 +125,43 @@
data() {
return {
userInfo: null,
barInfo: null,
isLoggedIn: false,
isVerified: false,
navHeight: 0,
};
},
onLoad() {
let a = uni.getMenuButtonBoundingClientRect()
this.navHeight = a.bottom +18
let a = uni.getMenuButtonBoundingClientRect()
this.navHeight = a.bottom +18
this.checkLoginStatus()
},
onShow() {
this.checkLoginStatus()
},
// created(){
// this.userInfo = uni.getStorageSync('userInfo')
// if(this.userInfo) {
// this.handleScan()
// }
// },
methods: {
//
checkLoginStatus() {
const token = uni.getStorageSync('token')
const userInfo = uni.getStorageSync('userInfo')
const barInfo = uni.getStorageSync('barInfo')
this.isLoggedIn = !!token
this.userInfo = userInfo
this.barInfo = barInfo
this.isVerified = barInfo && barInfo.authState === 2
console.log('【checkLoginStatus】登录状态:', {
isLoggedIn: this.isLoggedIn,
isVerified: this.isVerified,
userInfo: this.userInfo,
barInfo: this.barInfo
})
},
//
loginSuccess() {
this.checkLoginStatus()
},
openP(index) {
uni.hideTabBar()
this.$refs['p' + index].open()
@ -154,10 +177,27 @@
})
},
handleScan() {
if (!uni.getStorageSync('token')) {
if (!this.isLoggedIn) {
this.$refs.loginRef.open()
return
}
if (!this.isVerified) {
uni.showModal({
title: '提示',
content: '请先认证门店',
showCancel: true,
success: (res) => {
if (res.confirm) {
uni.navigateTo({
url: '/pages/index/registration'
})
}
}
})
return
}
uni.getSetting({
success: (res) => {
if (!res.authSetting['scope.userLocation']) {
@ -187,12 +227,11 @@
})
}
})
}else {
} else {
this.startScan()
}
},
})
},
//
startScan() {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB