页面
This commit is contained in:
parent
db69406150
commit
5a7ed3517b
@ -33,12 +33,12 @@
|
|||||||
>
|
>
|
||||||
<view class="content p-2 text-left" style="align-items: normal">
|
<view class="content p-2 text-left" style="align-items: normal">
|
||||||
<view class="px-2 flex-content-column">
|
<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">
|
<view class="p-1 ellipsis-2 font-size-3">
|
||||||
{{ detail.description }}
|
{{ detail.description }}
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view
|
<!-- <view
|
||||||
class="p-1 font-size-3 color-gary"
|
class="p-1 font-size-3 color-gary"
|
||||||
style="align-items: end"
|
style="align-items: end"
|
||||||
@click="location(detail)"
|
@click="location(detail)"
|
||||||
@ -55,7 +55,7 @@
|
|||||||
>
|
>
|
||||||
导航
|
导航
|
||||||
</wd-tag>
|
</wd-tag>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -91,7 +91,7 @@
|
|||||||
<view class="content p-2" style="align-items: normal" @click="goPage(item)">
|
<view class="content p-2" style="align-items: normal" @click="goPage(item)">
|
||||||
<view class="ps-2 flex-content-column">
|
<view class="ps-2 flex-content-column">
|
||||||
<view class="ps-1 font-size-4 font-bold color-black ellipsis-2">
|
<view class="ps-1 font-size-4 font-bold color-black ellipsis-2">
|
||||||
{{ item.author }}
|
{{ item.title }}
|
||||||
</view>
|
</view>
|
||||||
<view class="ps-1 font-size-3 ellipsis-2">{{ item.description }}</view>
|
<view class="ps-1 font-size-3 ellipsis-2">{{ item.description }}</view>
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
<view class="content p-2" style="align-items: normal" @click="goPage(item)">
|
<view class="content p-2" style="align-items: normal" @click="goPage(item)">
|
||||||
<view class="ps-2 flex-content-column">
|
<view class="ps-2 flex-content-column">
|
||||||
<view class="ps-1 font-size-4 font-bold color-black ellipsis-2">
|
<view class="ps-1 font-size-4 font-bold color-black ellipsis-2">
|
||||||
{{ item.author }}
|
{{ item.title }}
|
||||||
</view>
|
</view>
|
||||||
<view class="ps-1 font-size-3 ellipsis-2">{{ item.description }}</view>
|
<view class="ps-1 font-size-3 ellipsis-2">{{ item.description }}</view>
|
||||||
|
|
||||||
|
@ -345,7 +345,7 @@
|
|||||||
<wd-img radius="20rpx" :width="'100%'" :height="'100%'" :src="item.cover" />
|
<wd-img radius="20rpx" :width="'100%'" :height="'100%'" :src="item.cover" />
|
||||||
</view>
|
</view>
|
||||||
<view class="ps-2 pt-2 font-size-4 font-bold color-black ellipsis">
|
<view class="ps-2 pt-2 font-size-4 font-bold color-black ellipsis">
|
||||||
{{ item.author }}
|
{{ item.title }}
|
||||||
</view>
|
</view>
|
||||||
<view class="ps-2 pt-2 font-size-3 ellipsis">{{ item.description }}</view>
|
<view class="ps-2 pt-2 font-size-3 ellipsis">{{ item.description }}</view>
|
||||||
<view class="ps-2 pt-2 pb-2">
|
<view class="ps-2 pt-2 pb-2">
|
||||||
|
@ -30,6 +30,7 @@ async function decryptPhoneNumber(e) {
|
|||||||
const res = await userStore.wxPhoneLogin(e.detail.iv, e.detail.encryptedData)
|
const res = await userStore.wxPhoneLogin(e.detail.iv, e.detail.encryptedData)
|
||||||
if (res.code === 1) {
|
if (res.code === 1) {
|
||||||
toast.success('登录成功')
|
toast.success('登录成功')
|
||||||
|
await userStore.getUserInfo()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (lastPage.value) {
|
if (lastPage.value) {
|
||||||
let method
|
let method
|
||||||
|
@ -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="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>
|
<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">
|
||||||
@ -122,59 +122,84 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" name="WxLogin">
|
<script lang="ts" setup name="WxLogin">
|
||||||
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,
|
// userIsLogin: false,
|
||||||
show: false,
|
// show: false,
|
||||||
userStore: {},
|
// 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 (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)
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
onLoad(option) {
|
}
|
||||||
this.userStore = useUserStore()
|
const show = ref(false)
|
||||||
// this.userIsLogin = useUserStore().userInfo.id ? true : false
|
const userStore = useUserStore()
|
||||||
},
|
|
||||||
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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
// const show = ref(false)
|
|
||||||
// const userStore = useUserStore()
|
|
||||||
// console.log('获取用户信息', userStore.userInfo)
|
// 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 = () => {
|
// const logout = () => {
|
||||||
// uni.showModal({
|
// uni.showModal({
|
||||||
// title: '确认退出当前账号?',
|
// title: '确认退出当前账号?',
|
||||||
|
@ -38,7 +38,7 @@ export const useUserStore = defineStore(
|
|||||||
// val.avatar = 'https://oss.laf.run/ukw0y1-site/avatar.jpg?feige'
|
// val.avatar = 'https://oss.laf.run/ukw0y1-site/avatar.jpg?feige'
|
||||||
}
|
}
|
||||||
// 判断是否设置村庄
|
// 判断是否设置村庄
|
||||||
val.isset = !!userInfoState.village
|
val.isset = val.village ? true : false
|
||||||
userInfo.value = val
|
userInfo.value = val
|
||||||
}
|
}
|
||||||
const setUserAvatar = (avatar: string) => {
|
const setUserAvatar = (avatar: string) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user