|
@@ -1,34 +1,41 @@
|
|
<template>
|
|
<template>
|
|
<view>
|
|
<view>
|
|
<view class="con">
|
|
<view class="con">
|
|
- <view class="flex item">
|
|
|
|
- <view>用户名:</view>
|
|
|
|
- <input v-model="person.name" />
|
|
|
|
|
|
+ <view class="item">
|
|
|
|
+ <view class="l">用户名:</view>
|
|
|
|
+ <input class="r" v-model="person.name" :disabled="enable" />
|
|
</view>
|
|
</view>
|
|
- <view class="flex item">
|
|
|
|
- <view>性别:</view>
|
|
|
|
- <input v-model="person.name" />
|
|
|
|
|
|
+ <view class="item">
|
|
|
|
+ <view class="l">性别:</view>
|
|
|
|
+ <input class="r" v-model="person.genderName" :disabled="enable" />
|
|
</view>
|
|
</view>
|
|
- <view class="flex item">
|
|
|
|
- <view>年龄:</view>
|
|
|
|
- <input v-model="person.name" />
|
|
|
|
|
|
+ <view class="item">
|
|
|
|
+ <view class="l">年龄:</view>
|
|
|
|
+ <input class="r" v-model="person.age" :disabled="enable" />
|
|
</view>
|
|
</view>
|
|
- <view class="flex item">
|
|
|
|
- <view>手机号:</view>
|
|
|
|
- <input v-model="person.phone" />
|
|
|
|
|
|
+ <view class="item">
|
|
|
|
+ <view class="l">手机号:</view>
|
|
|
|
+ <input class="r" v-model="person.phone" :disabled="enable" />
|
|
</view>
|
|
</view>
|
|
- <view class="flex item">
|
|
|
|
- <view>互助组:</view>
|
|
|
|
- <input v-model="person.name" />
|
|
|
|
|
|
+ <view class="item">
|
|
|
|
+ <view class="l">互助组:</view>
|
|
|
|
+ <input class="r" v-model="person.groupName" :disabled="enable" />
|
|
</view>
|
|
</view>
|
|
- <view class="flex item">
|
|
|
|
- <view>角色:</view>
|
|
|
|
- <input v-model="person.name" />
|
|
|
|
|
|
+ <view class="item">
|
|
|
|
+ <view class="l">角色:</view>
|
|
|
|
+ <input class="r" v-model="person.roleName" :disabled="enable" />
|
|
</view>
|
|
</view>
|
|
- <view class="flex item" style="border: none;">
|
|
|
|
- <view>地址:</view>
|
|
|
|
- <input v-model="person.name" />
|
|
|
|
|
|
+ <view class="item">
|
|
|
|
+ <view class="l">贸易区域:</view>
|
|
|
|
+ <input class="r" v-model="person.tradeAreaName" :disabled="enable" />
|
|
</view>
|
|
</view>
|
|
|
|
+ <view class="item" style="border: none;">
|
|
|
|
+ <view class="l">地址:</view>
|
|
|
|
+ <input class="r" v-model="person.address" :disabled="enable" />
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view>
|
|
|
|
+ <button class="btn" v-if="btnTitle=='编辑资料'" @click="edit">{{btnTitle}}</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
@@ -37,7 +44,10 @@
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- person: {}
|
|
|
|
|
|
+ person: {},
|
|
|
|
+ enable: true,
|
|
|
|
+ btnTitle: '编辑资料',
|
|
|
|
+ name: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
@@ -53,10 +63,32 @@
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ edit(){
|
|
|
|
+ this.enable = false
|
|
|
|
+ this.btnTitle = '确认修改'
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: '请输入用户名',
|
|
|
|
+ editable: true,
|
|
|
|
+ placeholderText: '请输入用户名',
|
|
|
|
+ success: res => {
|
|
|
|
+ if(res.confirm){
|
|
|
|
+ this.name = res.content
|
|
|
|
+ this.updateUser()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 修改个人信息
|
|
// 修改个人信息
|
|
updateUser(){
|
|
updateUser(){
|
|
|
|
+ let userId = this.getUser().id
|
|
|
|
+ let param = {
|
|
|
|
+ id: userId,
|
|
|
|
+ name: this.name
|
|
|
|
+ }
|
|
this.http.request({
|
|
this.http.request({
|
|
url: '/sp-admin/app/AppUser/update',
|
|
url: '/sp-admin/app/AppUser/update',
|
|
|
|
+ data: param,
|
|
|
|
+ method: 'POST',
|
|
success: res => {
|
|
success: res => {
|
|
uni.showModal({
|
|
uni.showModal({
|
|
content: '修改成功',
|
|
content: '修改成功',
|
|
@@ -87,5 +119,14 @@
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
border-bottom: 1px #dcdcdc solid;
|
|
border-bottom: 1px #dcdcdc solid;
|
|
|
|
+ .l{
|
|
|
|
+ flex: 4;
|
|
|
|
+ }
|
|
|
|
+ .r{
|
|
|
|
+ flex: 10;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .btn{
|
|
|
|
+ width: 80%;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|