邓洁 : 登录功能及拦截
This commit is contained in:
105
pages/my/my.vue
105
pages/my/my.vue
@@ -1,56 +1,89 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
<view class="my">
|
||||
<view class="profile">
|
||||
<image src="../../static/img/wo_bj_ll@2x.png" mode="aspectFit" class="profile-bgi"></image>
|
||||
<view class="avator">
|
||||
<u-avatar :src="src"></u-avatar>
|
||||
<view class="profile">
|
||||
<image src="../../static/img/wo_bj_ll@2x.png" mode="aspectFit" class="profile-bgi"></image>
|
||||
<view class="avator">
|
||||
<u-avatar :src="src"></u-avatar>
|
||||
</view>
|
||||
<view class="username">{{username}}</view>
|
||||
<view class="account">账号:{{account}}</view>
|
||||
</view>
|
||||
<view class="username">{{username}}</view>
|
||||
<view class="account">账号:{{account}}</view>
|
||||
</view>
|
||||
<view class="publish">
|
||||
<u-cell-group>
|
||||
<u-cell icon="/static/my/wo_icon_zr.png" title="发布的店铺转让" is-link="true" @click="topublished('发布的店铺转让')"></u-cell>
|
||||
<u-cell icon="/static/my/wo_icon_xz.png" title="发布的找店选址" is-link="true" @click="topublished('发布的找店选址')"></u-cell>
|
||||
<u-cell icon="/static/my/wo_icon_cc.png" title="发布的店铺出租" is-link="true" @click="topublished('发布的店铺出租')"></u-cell>
|
||||
<u-cell icon="/static/my/wo_icon_zs.png" title="发布的项目招商" is-link="true" @click="topublished('发布的项目招商')"></u-cell>
|
||||
<u-cell icon="/static/my/wo_icon_hh.png" title="成功合伙人" is-link="true" @click="topartner"></u-cell>
|
||||
<view class="publish">
|
||||
<u-cell-group>
|
||||
<u-cell icon="/static/my/wo_icon_zr.png" title="发布的店铺转让" is-link="true"
|
||||
@click="topublished('发布的店铺转让')"></u-cell>
|
||||
<u-cell icon="/static/my/wo_icon_xz.png" title="发布的找店选址" is-link="true"
|
||||
@click="topublished('发布的找店选址')"></u-cell>
|
||||
<u-cell icon="/static/my/wo_icon_cc.png" title="发布的店铺出租" is-link="true"
|
||||
@click="topublished('发布的店铺出租')"></u-cell>
|
||||
<u-cell icon="/static/my/wo_icon_zs.png" title="发布的项目招商" is-link="true"
|
||||
@click="topublished('发布的项目招商')"></u-cell>
|
||||
<u-cell icon="/static/my/wo_icon_hh.png" title="成功合伙人" is-link="true" @click="topartner"></u-cell>
|
||||
<u-cell icon="/static/my/wo_icon_pppp.png" title="我的匹配" is-link="true" @click="topublished('我的匹配')"></u-cell>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
</view>
|
||||
<TabBar :current-page="4"></TabBar>
|
||||
<view>
|
||||
<u-overlay :show="!isLoad">
|
||||
<login @success="reOnLoad()" @fail="failToLoad()"></login>
|
||||
</u-overlay>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import login from 'pages/my/login/login'
|
||||
export default {
|
||||
components: {
|
||||
login
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
src: 'https://cdn.uviewui.com/uview/album/2.jpg',
|
||||
account:'123456',
|
||||
username:'用户名',
|
||||
account: '123456',
|
||||
username: '用户名',
|
||||
isLoad: true
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// this.getInfo()
|
||||
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
|
||||
this.isLoad = false
|
||||
return
|
||||
}
|
||||
this.isLoad = true
|
||||
this.src = uni.getStorageSync('avatar')
|
||||
this.username = uni.getStorageSync('nickname')
|
||||
this.account = uni.getStorageSync('account')
|
||||
},
|
||||
methods: {
|
||||
topublished(title){
|
||||
uni.navigateTo({
|
||||
url:'/pages/published/published?titletext='+title
|
||||
reOnLoad() {
|
||||
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
|
||||
this.$toast.warn('登录失败请重试')
|
||||
this.isLoad = false
|
||||
return
|
||||
}
|
||||
this.isLoad = true
|
||||
},
|
||||
failToLoad() {
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
},
|
||||
todetail(){
|
||||
topublished(title) {
|
||||
uni.navigateTo({
|
||||
url:'/pages/detail/detail'
|
||||
url: '/pages/published/published?titletext=' + title
|
||||
})
|
||||
},
|
||||
topartner(){
|
||||
todetail() {
|
||||
uni.navigateTo({
|
||||
url:'/pages/Partnerships/Partnerships'
|
||||
url: '/pages/detail/detail'
|
||||
})
|
||||
},
|
||||
topartner() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/Partnerships/Partnerships'
|
||||
})
|
||||
}
|
||||
//---------页面调用接口示例------------
|
||||
@@ -64,7 +97,7 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.profile{
|
||||
.profile {
|
||||
color: #fff;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
@@ -74,27 +107,27 @@
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
gap: 10rpx;
|
||||
.profile-bgi{
|
||||
|
||||
.profile-bgi {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
z-index: -1;
|
||||
}
|
||||
.avator{
|
||||
|
||||
.avator {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.username{
|
||||
|
||||
.username {
|
||||
font-size: 18px;
|
||||
font-weight: 1rpx;
|
||||
}
|
||||
.account{
|
||||
|
||||
.account {
|
||||
font-size: 15px;
|
||||
font-weight: 1rpx;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user