完成我的页面未登录状态

This commit is contained in:
weipengfei 2023-07-21 17:17:37 +08:00
parent 0f01458c15
commit 8f8318df5e
3 changed files with 35 additions and 17 deletions

View File

@ -6,20 +6,28 @@
<view style="height: var(--status-bar-height);"></view> <view style="height: var(--status-bar-height);"></view>
<view style="height: 100rpx"></view> <view style="height: 100rpx"></view>
<!-- #endif --> <!-- #endif -->
<view v-if="!$store.state.app.token" class="my_head"> <!-- <view v-if="!$store.state.app.token" class="my_head">
<view class="department flex_a_c"> <view class="department flex_a_c">
<view class="section">产品技术部</view> <view class="section">产品技术部</view>
<view class="" @click="login">去登陆</view> <view class="" @click="login">去登陆</view>
</view> </view>
</view> </view> -->
<view v-else class="personage"> <view class="personage">
<view class="my_msg flex_a_c_j_sb"> <view class="my_msg flex_a_c_j_sb">
<view class="flex_a_c"> <view class="flex_a_c">
<u--image :showLoading="true" :src="oaUserInfo.avatar||'../../static/img/public/man.png'" width="112.28rpx" height="112.28rpx" shape="circle"> <u--image :showLoading="true" :src="oaUserInfo.avatar||'../../static/img/public/avatar.png'" width="112.28rpx" height="112.28rpx" shape="circle">
</u--image> </u--image>
<view class="name_work"> <view v-if="!$store.state.app.token" @click="login" class="name_work">
<view class="name"> <view class="name">
<text style="margin-right: 30rpx;">{{ oaUserInfo.nickname }}</text> <text class="nickname">立即登录</text>
</view>
<view class="work">
登录后可查看更多
</view>
</view>
<view v-else class="name_work">
<view class="name">
<text class="nickname">{{ oaUserInfo.nickname }}</text>
<text>{{ oaUserInfo.mobile }}</text> <text>{{ oaUserInfo.mobile }}</text>
</view> </view>
<view class="work"> <view class="work">
@ -27,7 +35,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="compile" @click="alterMyInfo"> <view v-if="$store.state.app.token" class="compile" @click="alterMyInfo">
<view class="iconfont icon-bianji"></view> <view class="iconfont icon-bianji"></view>
<view class="">编辑</view> <view class="">编辑</view>
</view> </view>
@ -36,7 +44,8 @@
<view class="ass_cent flex_a_c_j_sb"> <view class="ass_cent flex_a_c_j_sb">
<view class="cent_item" @click="naviTo('/subpkg/finance/finance')"> <view class="cent_item" @click="naviTo('/subpkg/finance/finance')">
<!-- <view class="num">{{ oaUserInfo.achievements_money }}</view> --> <!-- <view class="num">{{ oaUserInfo.achievements_money }}</view> -->
<view class="num" v-if="eyeType">{{oaUserInfo.user_money||'0.00'}}</view> <view class="num" v-if="!$store.state.app.token">*</view>
<view class="num" v-else-if="eyeType">{{oaUserInfo.user_money||'0.00'}}</view>
<view class="num" v-if="!eyeType">****</view> <view class="num" v-if="!eyeType">****</view>
<view class="name">账户余额()</view> <view class="name">账户余额()</view>
</view> </view>
@ -46,7 +55,8 @@
</view> --> </view> -->
<view class="cent_item" @click="naviTo('/subpkg/finance/finance')"> <view class="cent_item" @click="naviTo('/subpkg/finance/finance')">
<!-- <view class="num">{{ oaUserInfo.company_money }}</view> --> <!-- <view class="num">{{ oaUserInfo.company_money }}</view> -->
<view class="num" v-if="eyeType">{{oaUserInfo.income||'0.00'}}</view> <view class="num" v-if="!$store.state.app.token">*</view>
<view class="num" v-else-if="eyeType">{{oaUserInfo.income||'0.00'}}</view>
<view class="num" v-if="!eyeType">****</view> <view class="num" v-if="!eyeType">****</view>
<view class="name">收益金额()</view> <view class="name">收益金额()</view>
</view> </view>
@ -66,7 +76,7 @@
</block> </block>
</view> </view>
<view class="log_out" v-if="$store.state.app.token" @click="logout">退出登录</view> <view class="log_out" v-if="$store.state.app.token" @click="logout">退出登录</view>
<view class="log_out" v-else @click="login">登录</view> <view class="log_out" v-else @click="login">登录账号</view>
<!-- <tabbar></tabbar> --> <!-- <tabbar></tabbar> -->
</view> </view>
</template> </template>
@ -95,10 +105,10 @@
backgroundColor: '#3175f9' backgroundColor: '#3175f9'
}) })
}, },
onLoad() { onLoad() {},
this.getOaUserInfo() onShow() {
this.getOaUserInfo();
}, },
onShow() {},
computed:{ computed:{
eyeType(){ eyeType(){
return this.$store.state.config.eyeType; return this.$store.state.config.eyeType;
@ -126,7 +136,7 @@
}) })
}, },
async getOaUserInfo() { async getOaUserInfo() {
const res = await userInfo() const res = await userInfo();
this.oaUserInfo = res.data; this.oaUserInfo = res.data;
this.$store.commit('setUserInfo', this.oaUserInfo); this.$store.commit('setUserInfo', this.oaUserInfo);
}, },
@ -202,7 +212,13 @@
.name_work { .name_work {
margin-left: 31.58rpx; margin-left: 31.58rpx;
font-size: 28.07rpx; font-size: 28.07rpx;
.name{
.nickname{
font-size: 32rpx;
font-weight: 500;
margin-right: 30rpx;
}
}
.work { .work {
margin-top: 14.04rpx; margin-top: 14.04rpx;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -51,8 +51,10 @@ function baseRequestTwo(url, method, data, {
if (noVerify) if (noVerify)
// reslove(res.data, res); // reslove(res.data, res);
reslove(res.data); reslove(res.data);
// else if (res.data.code == 0) else if (res.data.code == -1){
// reject(res.data); store.commit("LOGOUT");
reject(res.data);
}
else if (res.data.code == 1) else if (res.data.code == 1)
reslove(res.data); reslove(res.data);
else if (res.data.code == 200) else if (res.data.code == 200)