|  |  |  | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <!-- 信息 --> | 
|---|
|  |  |  | <view class="user-info"> | 
|---|
|  |  |  | <view class="user-name">陈鹏</view> | 
|---|
|  |  |  | <view class="user-name">{{username}}</view> | 
|---|
|  |  |  | <view class="user-company">中扬立库技术有限公司</view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <!-- 更多 --> | 
|---|
|  |  |  | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | import user from '@/pages/api/user/user.js' | 
|---|
|  |  |  | export default{ | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | username: '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onShow() { | 
|---|
|  |  |  | this.getDetail() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | async getDetail() { | 
|---|
|  |  |  | let res = await user.getDetail() | 
|---|
|  |  |  | if (res.code === 200) { | 
|---|
|  |  |  | this.username = res.data.username | 
|---|
|  |  |  | console.log(res); | 
|---|
|  |  |  | } else if (res.code === 403) { | 
|---|
|  |  |  | this.backLogin(res) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | userDetail() { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | uni.navigateTo({ | 
|---|
|  |  |  | url:'/pages/user/user_detail/userDetail' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | backLogin(res) { | 
|---|
|  |  |  | uni.showToast({title: res.msg, icon: "none", position: 'top'}) | 
|---|
|  |  |  | setTimeout(() => { | 
|---|
|  |  |  | uni.reLaunch({ | 
|---|
|  |  |  | url: '../login/login' | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }, 1000); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|