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

View File

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

View File

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

View File

@ -374,6 +374,25 @@
this.$refs.loginRef.open() this.$refs.loginRef.open()
return 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({ uni.navigateTo({
url: '/pages/index/writeReview?beerId=' + this.beerId url: '/pages/index/writeReview?beerId=' + this.beerId
}) })
@ -398,6 +417,25 @@
this.$refs.loginRef.open() this.$refs.loginRef.open()
return 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 = { let data = {
beerId: this.beerId, beerId: this.beerId,
status status
@ -451,6 +489,25 @@
this.$refs.loginRef.open() this.$refs.loginRef.open()
return 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({ uni.navigateTo({
url: "/pagesActivity/winelist?beerId=" + this.beerId url: "/pagesActivity/winelist?beerId=" + this.beerId
}) })

View File

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