页面
Some checks are pending
Auto Merge Main to Other Branches / Merge main into i18n (push) Waiting to run
Auto Merge Main to Other Branches / Merge main into base-sard-ui (push) Waiting to run

This commit is contained in:
sjeam 2025-09-06 16:22:11 +08:00
parent d519f01637
commit db69406150
4 changed files with 25 additions and 21 deletions

View File

@ -480,7 +480,9 @@ export default defineComponent({
more(item) { more(item) {
const islogin = hasLogin() const islogin = hasLogin()
if (islogin === false) { if (islogin === false) {
this.show = true uni.navigateTo({
url: '/pages/login/login',
})
return return
} }
if (islogin === true) { if (islogin === true) {

View File

@ -31,7 +31,6 @@ async function decryptPhoneNumber(e) {
if (res.code === 1) { if (res.code === 1) {
toast.success('登录成功') toast.success('登录成功')
setTimeout(() => { setTimeout(() => {
userStore.clearLastPage()
if (lastPage.value) { if (lastPage.value) {
let method let method
const indexPat = [ const indexPat = [

View File

@ -19,7 +19,7 @@
style="backdrop-filter: blur(2rpx); border-radius: 10rpx" style="backdrop-filter: blur(2rpx); border-radius: 10rpx"
> >
<view class="p-4"> <view class="p-4">
<view class="flex items-center leading-6" v-if="islogin"> <view class="flex items-center leading-6" v-if="userIsLogin">
<image class="w-18 h-18 rounded-full" :src="userStore.userInfo?.avatar"></image> <image class="w-18 h-18 rounded-full" :src="userStore.userInfo?.avatar"></image>
<view class="ml-2 flex-content-column"> <view class="ml-2 flex-content-column">
@ -31,13 +31,10 @@
</view> </view>
</view> </view>
</view> </view>
<view class="flex items-center leading-6" v-else @click="show = true"> <view class="flex items-center leading-6" v-else @click="toLogin">
<image class="w-18 h-18 rounded-full" :src="userStore.userInfo?.avatar"></image> <image class="w-18 h-18 rounded-full" :src="userStore.userInfo?.avatar"></image>
<view class="ml-2 font-size-4">去登录</view> <view class="ml-2 font-size-4">去登录</view>
</view> </view>
<!-- <fly-content :line="10" /> -->
<!-- <button v-if="hasLogin" class="mt-2" @click="logout">退出登录</button> -->
</view> </view>
</view> </view>
</view> </view>
@ -129,32 +126,35 @@
import { useUserStore } from '@/store' import { useUserStore } from '@/store'
import { getUrl, getWebUrl, getShopWebUrl, hasLogin } from '@/utils' import { getUrl, getWebUrl, getShopWebUrl, hasLogin } from '@/utils'
// const userStore = useUserStore() // const userStore = useUserStore()
const userIsLogin = computed(() => userStore.userInfo?.id)
import { defineComponent } from 'vue' import { defineComponent } from 'vue'
export default defineComponent({ export default defineComponent({
data() { data() {
return { return {
islogin: false, isLogin: false,
// userIsLogin: false,
show: false, show: false,
userStore: useUserStore(), userStore: {},
} }
}, },
onLoad(option) {}, onLoad(option) {
this.userStore = useUserStore()
// this.userIsLogin = useUserStore().userInfo.id ? true : false
},
methods: { methods: {
// logout() { toLogin() {
// uni.showModal({ uni.navigateTo({
// title: '退', url: '/pages/login/login',
// success: (res) => { })
// if (res.confirm) { },
// userStore.logout()
// }
// },
// })
// },
more(item) { more(item) {
this.islogin = hasLogin() this.islogin = hasLogin()
if (this.islogin === false) { if (this.islogin === false) {
this.show = true uni.navigateTo({
url: '/pages/login/login',
})
return return
} }
if (this.islogin === true) { if (this.islogin === true) {

View File

@ -226,6 +226,9 @@ export default defineComponent({
if (this.type === 1) { if (this.type === 1) {
// //
this.show = true this.show = true
// uni.navigateTo({
// url: '/pages/login/login',
// })
} else { } else {
// //
this.show = false this.show = false