166 lines
5.1 KiB
Vue
166 lines
5.1 KiB
Vue
|
<template>
|
|||
|
<view class="pad-x120">
|
|||
|
<!-- 头部 -->
|
|||
|
<status-nav navBarTitle="基本信息"></status-nav>
|
|||
|
<view class="content" :style="{'padding-top':statusHeight+50+'px'}" v-if="isLoding">
|
|||
|
<view class="information-from font26">
|
|||
|
<view class="item">
|
|||
|
<view class="title">头像</view>
|
|||
|
<view class="cover">
|
|||
|
<image :src="userInfo.headimgurl" mode="aspectFit"></image>
|
|||
|
</view>
|
|||
|
</view>
|
|||
|
<view class="item" @tap="editEv(0,'nickname')">
|
|||
|
<view class="title">昵称</view>
|
|||
|
<view class="msg font24">{{userInfo.nickname}}</view>
|
|||
|
<image src="/static/icon/icon-arrow-03.png" mode="aspectFit"></image>
|
|||
|
</view>
|
|||
|
<view class="item" @tap="editEv(1,'position_name')">
|
|||
|
<view class="title">技术岗位</view>
|
|||
|
<view class="msg font24">{{userInfo.position_name}}</view>
|
|||
|
<image src="/static/icon/icon-arrow-03.png" mode="aspectFit"></image>
|
|||
|
</view>
|
|||
|
<view class="item" @tap="editEv(2,'pay')">
|
|||
|
<view class="title">工资</view>
|
|||
|
<view class="msg font24">{{userInfo.pay}}</view>
|
|||
|
<image src="/static/icon/icon-arrow-03.png" mode="aspectFit"></image>
|
|||
|
</view>
|
|||
|
<view class="item" @tap="editEv(3,'real_name')">
|
|||
|
<view class="title">姓名</view>
|
|||
|
<view class="msg font24">{{userInfo.real_name}}</view>
|
|||
|
<image src="/static/icon/icon-arrow-03.png" mode="aspectFit"></image>
|
|||
|
</view>
|
|||
|
<view class="item" @tap="editEv(4,'mobile')">
|
|||
|
<view class="title">电话号码</view>
|
|||
|
<view class="msg font24">{{userInfo.mobile}}</view>
|
|||
|
<image src="/static/icon/icon-arrow-03.png" mode="aspectFit"></image>
|
|||
|
</view>
|
|||
|
<view class="item" @tap="editEv(5,'emergency_contact')">
|
|||
|
<view class="title">紧急联系人</view>
|
|||
|
<view class="msg font24">{{userInfo.emergency_contact}}</view>
|
|||
|
<image src="/static/icon/icon-arrow-03.png" mode="aspectFit"></image>
|
|||
|
</view>
|
|||
|
<view class="item" @tap="editEv(6,'emergency_phone')">
|
|||
|
<view class="title">联系人电话</view>
|
|||
|
<view class="msg font24">{{userInfo.emergency_phone}}</view>
|
|||
|
<image src="/static/icon/icon-arrow-03.png" mode="aspectFit"></image>
|
|||
|
</view>
|
|||
|
<view class="item" @tap="editEv(7,'bank_card_name')">
|
|||
|
<view class="title">银行卡姓名</view>
|
|||
|
<view class="msg font24">{{userInfo.bank_card_name}}</view>
|
|||
|
<image src="/static/icon/icon-arrow-03.png" mode="aspectFit"></image>
|
|||
|
</view>
|
|||
|
<view class="item" @tap="editEv(8,'bank_card_number')">
|
|||
|
<view class="title">银行卡账号</view>
|
|||
|
<view class="msg font24">{{userInfo.bank_card_number}}</view>
|
|||
|
<image src="/static/icon/icon-arrow-03.png" mode="aspectFit"></image>
|
|||
|
</view>
|
|||
|
<view class="item" @tap="editEv(9,'bank_name')">
|
|||
|
<view class="title">开户行</view>
|
|||
|
<view class="msg font24">{{userInfo.bank_name}}</view>
|
|||
|
<image src="/static/icon/icon-arrow-03.png" mode="aspectFit"></image>
|
|||
|
</view>
|
|||
|
</view>
|
|||
|
</view>
|
|||
|
<!-- 修改弹窗 -->
|
|||
|
<view class="pop-up-bg" v-if="ifShow" @tap.stop="closeEdit">
|
|||
|
<view class="edit-box bg-white">
|
|||
|
<view class="close-btn font30 color-66" @tap.stop="closeEdit"></view>
|
|||
|
<view class="title font34">{{editTitle}}</view>
|
|||
|
<input type="text" v-module="editMsg">
|
|||
|
<view class="submit-btn font30" @tap.stop="submitEv">提交</view>
|
|||
|
</view>
|
|||
|
</view>
|
|||
|
<!-- 尾部 -->
|
|||
|
<tabbar :userType="userType" current="2"></tabbar>
|
|||
|
</view>
|
|||
|
</template>
|
|||
|
<script>
|
|||
|
import tabbar from '@/components/tabbar/tabbar';
|
|||
|
export default {
|
|||
|
components:{
|
|||
|
tabbar
|
|||
|
},
|
|||
|
data() {
|
|||
|
return {
|
|||
|
statusHeight:uni.getSystemInfoSync().statusBarHeight, //状态栏高度
|
|||
|
userType:'worker', //账户类型 工人:worker 负责人:director
|
|||
|
userInfo:{}, //用户信息
|
|||
|
editTitle:'', //修改标题
|
|||
|
editMsg:'', //修改内容
|
|||
|
field:'', //修改栏目
|
|||
|
ifShow:false, //是否展示弹窗
|
|||
|
isLoding:false, //是否记载完成
|
|||
|
}
|
|||
|
},
|
|||
|
onLoad() {
|
|||
|
// 获取用户信息
|
|||
|
this.getUserInfo();
|
|||
|
},
|
|||
|
methods: {
|
|||
|
// 获取用户信息
|
|||
|
getUserInfo(){
|
|||
|
this.$requst.post('/api/v1/user/info').then(res=>{
|
|||
|
if(res.code==0){
|
|||
|
console.log(res,'用户信息');
|
|||
|
this.userInfo = res.data;
|
|||
|
this.isLoding = true;
|
|||
|
}
|
|||
|
})
|
|||
|
},
|
|||
|
|
|||
|
// 打开修改弹窗
|
|||
|
editEv(num,type){
|
|||
|
this.ifShow = true;
|
|||
|
this.field = type;
|
|||
|
switch (num){
|
|||
|
case 0:
|
|||
|
this.editTitle = '昵称';
|
|||
|
break;
|
|||
|
case 1:
|
|||
|
this.editTitle = '技术岗位';
|
|||
|
break;
|
|||
|
case 2:
|
|||
|
this.editTitle = '工资';
|
|||
|
break;
|
|||
|
case 3:
|
|||
|
this.editTitle = '姓名';
|
|||
|
break;
|
|||
|
case 4:
|
|||
|
this.editTitle = '电话号码';
|
|||
|
break;
|
|||
|
case 5:
|
|||
|
this.editTitle = '紧急联系人';
|
|||
|
break;
|
|||
|
case 6:
|
|||
|
this.editTitle = '联系人电话';
|
|||
|
break;
|
|||
|
case 7:
|
|||
|
this.editTitle = '银行卡姓名';
|
|||
|
break;
|
|||
|
case 8:
|
|||
|
this.editTitle = '银行卡账号';
|
|||
|
break;
|
|||
|
case 9:
|
|||
|
this.editTitle = '开户行';
|
|||
|
break;
|
|||
|
}
|
|||
|
},
|
|||
|
|
|||
|
// 提交修改
|
|||
|
submitEv(){
|
|||
|
|
|||
|
},
|
|||
|
|
|||
|
// 关闭修改弹窗
|
|||
|
closeEdit(){
|
|||
|
this.ifShow = false;
|
|||
|
this.editTitle = '';
|
|||
|
this.field = '';
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
</script>
|
|||
|
<style scoped>
|
|||
|
|
|||
|
</style>
|