|
|
@@ -4,11 +4,11 @@
|
|
|
<image v-if="userInfo && userInfo.avatar" class="avatar" :src="userInfo.avatar" mode="aspectFill"></image>
|
|
|
<image v-else class="avatar" src="../../static/img_avatar.png" mode="aspectFill"></image>
|
|
|
<view v-if="userInfo" class="info">
|
|
|
- <view class="name">{{ userInfo.name }}</view>
|
|
|
- <view class="company">{{ userInfo.company }}</view>
|
|
|
+ <view class="name">{{ userInfo.phone }}</view>
|
|
|
+ <view class="company">{{ userInfo.phone }}</view>
|
|
|
<image class="arrow" src="../../static/icon_arrow.png"></image>
|
|
|
</view>
|
|
|
- <button type='primary' class="btn" v-show="!isAuth" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">立即登录</button>
|
|
|
+ <button type="primary" class="btn" v-show="!userInfo.sessionKey" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">立即登录</button>
|
|
|
</view>
|
|
|
<view class="menu-panel">
|
|
|
<view class="item" v-for="(item, index) in menuList" :key="index" @click="handleMenu(item.value)">
|
|
|
@@ -36,13 +36,13 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import userService from '@/api/user.js';
|
|
|
import avatar from '@/static/taxation/poster.jpg';
|
|
|
export default {
|
|
|
components: {},
|
|
|
data() {
|
|
|
return {
|
|
|
userInfo: '',
|
|
|
- isAuth : false,
|
|
|
menuList: [
|
|
|
{
|
|
|
label: '我的订单',
|
|
|
@@ -64,10 +64,11 @@ export default {
|
|
|
navList: [
|
|
|
{
|
|
|
label: '我的企业',
|
|
|
- value: 1,
|
|
|
- },{
|
|
|
+ value: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
label: '我的合同',
|
|
|
- value: 2,
|
|
|
+ value: 2
|
|
|
},
|
|
|
// {
|
|
|
// label: '企业资料',
|
|
|
@@ -148,14 +149,16 @@ export default {
|
|
|
},
|
|
|
onLoad() {},
|
|
|
onShow() {
|
|
|
- this.isAuth = getApp().globalData.globalAuth;
|
|
|
+ this.getUserInfo();
|
|
|
},
|
|
|
methods: {
|
|
|
- getPhoneNumber(e){
|
|
|
+ getPhoneNumber(e) {
|
|
|
let res = getApp().getPhoneNumber(e);
|
|
|
- if (res){
|
|
|
-
|
|
|
- }
|
|
|
+ if (res) this.getUserInfo();
|
|
|
+ },
|
|
|
+ async getUserInfo() {
|
|
|
+ const { data } = await userService.getUserInfo();
|
|
|
+ this.userInfo = data;
|
|
|
},
|
|
|
handleOpenLogin() {
|
|
|
// this.userInfo = {
|
|
|
@@ -173,7 +176,7 @@ export default {
|
|
|
url: 'info'
|
|
|
});
|
|
|
},
|
|
|
- handleMenu(val){
|
|
|
+ handleMenu(val) {
|
|
|
let url = '';
|
|
|
switch (val) {
|
|
|
case 1:
|
|
|
@@ -231,4 +234,4 @@ export default {
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
@import 'index.scss';
|
|
|
-</style>
|
|
|
+</style>
|