页面
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:50:07 +08:00
parent db69406150
commit 5a7ed3517b
6 changed files with 80 additions and 54 deletions

View File

@ -33,12 +33,12 @@
>
<view class="content p-2 text-left" style="align-items: normal">
<view class="px-2 flex-content-column">
<view class="p-1 font-size-4 color-black font-bold">{{ detail.author }}</view>
<view class="p-1 font-size-4 color-black font-bold">{{ detail.title }}</view>
<view class="p-1 ellipsis-2 font-size-3">
{{ detail.description }}
</view>
<view
<!-- <view
class="p-1 font-size-3 color-gary"
style="align-items: end"
@click="location(detail)"
@ -55,7 +55,7 @@
>
导航
</wd-tag>
</view>
</view> -->
</view>
</view>
</view>
@ -91,7 +91,7 @@
<view class="content p-2" style="align-items: normal" @click="goPage(item)">
<view class="ps-2 flex-content-column">
<view class="ps-1 font-size-4 font-bold color-black ellipsis-2">
{{ item.author }}
{{ item.title }}
</view>
<view class="ps-1 font-size-3 ellipsis-2">{{ item.description }}</view>

View File

@ -60,7 +60,7 @@
<view class="content p-2" style="align-items: normal" @click="goPage(item)">
<view class="ps-2 flex-content-column">
<view class="ps-1 font-size-4 font-bold color-black ellipsis-2">
{{ item.author }}
{{ item.title }}
</view>
<view class="ps-1 font-size-3 ellipsis-2">{{ item.description }}</view>

View File

@ -345,7 +345,7 @@
<wd-img radius="20rpx" :width="'100%'" :height="'100%'" :src="item.cover" />
</view>
<view class="ps-2 pt-2 font-size-4 font-bold color-black ellipsis">
{{ item.author }}
{{ item.title }}
</view>
<view class="ps-2 pt-2 font-size-3 ellipsis">{{ item.description }}</view>
<view class="ps-2 pt-2 pb-2">

View File

@ -30,6 +30,7 @@ async function decryptPhoneNumber(e) {
const res = await userStore.wxPhoneLogin(e.detail.iv, e.detail.encryptedData)
if (res.code === 1) {
toast.success('登录成功')
await userStore.getUserInfo()
setTimeout(() => {
if (lastPage.value) {
let method

View File

@ -19,7 +19,7 @@
style="backdrop-filter: blur(2rpx); border-radius: 10rpx"
>
<view class="p-4">
<view class="flex items-center leading-6" v-if="userIsLogin">
<view class="flex items-center leading-6" v-if="userStore.userInfo?.id">
<image class="w-18 h-18 rounded-full" :src="userStore.userInfo?.avatar"></image>
<view class="ml-2 flex-content-column">
@ -122,42 +122,63 @@
</view>
</template>
<script lang="ts" name="WxLogin">
<script lang="ts" setup name="WxLogin">
import { useUserStore } from '@/store'
import { getUrl, getWebUrl, getShopWebUrl, hasLogin } from '@/utils'
// const userStore = useUserStore()
const userIsLogin = computed(() => userStore.userInfo?.id)
import { defineComponent } from 'vue'
export default defineComponent({
data() {
return {
isLogin: false,
// userIsLogin: false,
show: false,
userStore: {},
}
},
onLoad(option) {
this.userStore = useUserStore()
// this.userIsLogin = useUserStore().userInfo.id ? true : false
},
methods: {
toLogin() {
uni.navigateTo({
url: '/pages/login/login',
})
},
more(item) {
this.islogin = hasLogin()
if (this.islogin === false) {
// export default defineComponent({
// data() {
// return {
// isLogin: false,
// userIsLogin: false,
// show: false,
// userStore: {},
// }
// },
// onLoad(option) {
// this.userStore = useUserStore()
// this.userIsLogin = useUserStore().userInfo.id ? true : false
// console.log('', this.userIsLogin)
// console.log('', this.userStore.userInfo)
// },
// methods: {
// toLogin() {
// uni.navigateTo({
// url: '/pages/login/login',
// })
// },
// more(item) {
// this.islogin = hasLogin()
// if (this.islogin === false) {
// uni.navigateTo({
// url: '/pages/login/login',
// })
// return
// }
// if (this.islogin === true) {
// // console.log(item)
// if (item.type == 1) {
// getUrl(item.url)
// } else if (item.type == 2) {
// getWebUrl(item.url)
// } else if (item.type == 3) {
// getShopWebUrl(item.url)
// }
// }
// },
// },
// })
function more(item) {
const islogin = hasLogin()
if (islogin === false) {
uni.navigateTo({
url: '/pages/login/login',
})
return
}
if (this.islogin === true) {
if (islogin === true) {
// console.log(item)
if (item.type == 1) {
getUrl(item.url)
@ -167,14 +188,18 @@ export default defineComponent({
getShopWebUrl(item.url)
}
}
},
},
})
// const show = ref(false)
// const userStore = useUserStore()
}
const show = ref(false)
const userStore = useUserStore()
// console.log('', userStore.userInfo)
// // const hasLogin = computed(() => userStore.userInfo?.id)
// const hasLogin = computed(() => userStore.userInfo?.id)
function toLogin() {
uni.navigateTo({
url: '/pages/login/login',
})
}
// const logout = () => {
// uni.showModal({
// title: '退',

View File

@ -38,7 +38,7 @@ export const useUserStore = defineStore(
// val.avatar = 'https://oss.laf.run/ukw0y1-site/avatar.jpg?feige'
}
// 判断是否设置村庄
val.isset = !!userInfoState.village
val.isset = val.village ? true : false
userInfo.value = val
}
const setUserAvatar = (avatar: string) => {