Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xinrenli-app
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郑云飞
xinrenli-app
Commits
dc5e58b6
Commit
dc5e58b6
authored
Apr 21, 2023
by
honghong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改用户信息后不更新
parent
10de5c7f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
21 deletions
+54
-21
components/form.vue
+23
-8
my/addPersonMsg/index.vue
+30
-12
pages/my/index.vue
+1
-1
No files found.
components/form.vue
View file @
dc5e58b6
...
@@ -123,11 +123,13 @@
...
@@ -123,11 +123,13 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
mapGetters
}
from
'vuex'
import
{
import
{
addOrderFunction
,
addOrderFunction
,
updateUserMsg
updateUserMsg
}
from
'@/api/system/index.js'
}
from
'@/api/system/index.js'
import
{
loginUserInfo
}
from
'@/api/user.js'
import
freeAudio
from
'@/components/chengpeng-audio/free-audio.vue'
import
freeAudio
from
'@/components/chengpeng-audio/free-audio.vue'
import
recordCom
from
'@/components/record/record.vue'
import
recordCom
from
'@/components/record/record.vue'
...
@@ -209,9 +211,7 @@
...
@@ -209,9 +211,7 @@
mounted
()
{
mounted
()
{
this
.
$refs
.
form
.
setRules
(
this
.
rules
);
this
.
$refs
.
form
.
setRules
(
this
.
rules
);
},
},
computed
:{
...
mapGetters
([
'userInfo'
])
},
watch
:
{
watch
:
{
detailData
:
{
detailData
:
{
handler
(
newVal
,
oldVal
)
{
handler
(
newVal
,
oldVal
)
{
...
@@ -243,12 +243,27 @@
...
@@ -243,12 +243,27 @@
that
.
formInfo
.
repairTime
=
uni
.
$u
.
timeFormat
(
that
.
formInfo
.
repairTime
,
'yyyy-mm-dd'
)
that
.
formInfo
.
repairTime
=
uni
.
$u
.
timeFormat
(
that
.
formInfo
.
repairTime
,
'yyyy-mm-dd'
)
}
}
that
.
inite
()
that
.
inite
()
that
.
$set
(
that
.
formInfo
,
'linkman'
,
that
.
userInfo
.
user
.
linkMan
)
that
.
upDateUserInfoMount
()
that
.
$set
(
that
.
formInfo
,
'phone'
,
that
.
userInfo
.
user
.
mobile
)
// that.$set(that.formInfo,'linkman',that.userInfo.user.linkMan)
that
.
$set
(
that
.
formInfo
,
'title'
,
that
.
userInfo
.
user
.
company
)
// that.$set(that.formInfo,'phone',that.userInfo.user.mobile)
that
.
$set
(
that
.
formInfo
,
'repairAddress'
,
that
.
userInfo
.
user
.
address
)
// that.$set(that.formInfo,'title',that.userInfo.user.company)
// that.$set(that.formInfo,'repairAddress',that.userInfo.user.address)
},
},
methods
:
{
methods
:
{
upDateUserInfoMount
()
{
let
that
=
this
loginUserInfo
().
then
(
kh
=>
{
const
{
data
}
=
kh
console
.
log
(
data
,
'第三阶段是'
)
// this.model = data.user
that
.
$set
(
that
.
formInfo
,
'linkman'
,
data
.
user
.
linkMan
)
that
.
$set
(
that
.
formInfo
,
'phone'
,
data
.
user
.
mobile
)
that
.
$set
(
that
.
formInfo
,
'title'
,
data
.
user
.
company
)
that
.
$set
(
that
.
formInfo
,
'repairAddress'
,
data
.
user
.
address
)
})
},
inite
()
{
inite
()
{
let
self
=
this
;
let
self
=
this
;
self
.
timeValue
=
Number
(
new
Date
())
self
.
timeValue
=
Number
(
new
Date
())
...
...
my/addPersonMsg/index.vue
View file @
dc5e58b6
...
@@ -2,11 +2,12 @@
...
@@ -2,11 +2,12 @@
<view
class=
"content"
>
<view
class=
"content"
>
<!--
<com-navbar
:title=
"status == 1 ? '添加个人信息' : '修改个人信息'"
:titleStyle=
"
{ color: '#000000', fontSize: '32rpx' }" /> -->
<!--
<com-navbar
:title=
"status == 1 ? '添加个人信息' : '修改个人信息'"
:titleStyle=
"
{ color: '#000000', fontSize: '32rpx' }" /> -->
<view
class=
"content-form"
>
<view
class=
"content-form"
>
<u--form
label-position=
"top"
labelWidth=
"1
2
0"
:model=
"model"
:rules=
"rules"
ref=
"form"
>
<u--form
label-position=
"top"
labelWidth=
"1
4
0"
:model=
"model"
:rules=
"rules"
ref=
"form"
>
<u-form-item
label=
"公司名称"
prop=
"company"
borderBottom
:customStyle=
"
{
<u-form-item
label=
"公司名称"
prop=
"company"
borderBottom
:customStyle=
"
{
'flex-direction': 'row !important'
'flex-direction': 'row !important'
}">
}">
<u--input
inputAlign=
"right"
border=
"none"
v-model=
"model.company"
placeholder=
"请输入公司名称"
>
<u--input
inputAlign=
"right"
border=
"none"
v-model=
"model.company"
placeholder=
"请输入公司名称"
@
change=
"changeInput"
>
</u--input>
</u--input>
</u-form-item>
</u-form-item>
<u-form-item
required
label=
"联系人"
prop=
"linkMan"
borderBottom
:customStyle=
"
{
<u-form-item
required
label=
"联系人"
prop=
"linkMan"
borderBottom
:customStyle=
"
{
...
@@ -69,7 +70,12 @@
...
@@ -69,7 +70,12 @@
import
{
import
{
updateUserMsg
updateUserMsg
}
from
'@/api/system/index.js'
}
from
'@/api/system/index.js'
import
{
mapGetters
}
from
'vuex'
import
{
loginUserInfo
}
from
'@/api/user.js'
import
{
mapGetters
}
from
'vuex'
export
default
{
export
default
{
data
()
{
data
()
{
const
mobile
=
(
rule
,
value
,
callback
)
=>
{
const
mobile
=
(
rule
,
value
,
callback
)
=>
{
...
@@ -111,22 +117,33 @@
...
@@ -111,22 +117,33 @@
}
}
}
}
},
},
computed
:{
computed
:
{
...
mapGetters
([
'userInfo'
])
...
mapGetters
([
'userInfo'
])
},
},
mounted
()
{
mounted
()
{
this
.
$refs
.
form
.
setRules
(
this
.
rules
);
this
.
$refs
.
form
.
setRules
(
this
.
rules
);
},
},
onLoad
()
{
onLoad
()
{
this
.
model
=
{
this
.
upDateUserInfoMount
()
...
this
.
userInfo
.
user
,
}
},
},
methods
:
{
methods
:
{
changeInput
(
val
)
{
console
.
log
(
val
,
"======changeInput"
)
},
upDateUserInfoMount
()
{
let
that
=
this
loginUserInfo
().
then
(
kh
=>
{
const
{
data
}
=
kh
this
.
model
=
data
.
user
})
},
async
updateUser
(
data
)
{
async
updateUser
(
data
)
{
let
that
=
this
let
that
=
this
const
back_data
=
await
updateUserMsg
(
data
)
const
back_data
=
await
updateUserMsg
(
data
)
console
.
log
(
back_data
,
'修改'
)
console
.
log
(
back_data
,
'修改'
)
const
{
const
{
code
code
}
=
back_data
}
=
back_data
...
@@ -134,14 +151,14 @@
...
@@ -134,14 +151,14 @@
uni
.
showToast
({
uni
.
showToast
({
title
:
'保存成功!'
,
title
:
'保存成功!'
,
icon
:
'none'
,
icon
:
'none'
,
duration
:
2000
,
duration
:
2000
,
success
()
{
success
()
{
let
time
=
setTimeout
(()
=>
{
let
time
=
setTimeout
(()
=>
{
clearTimeout
(
time
)
clearTimeout
(
time
)
uni
.
navigateBack
({
uni
.
navigateBack
({
delta
:
1
delta
:
1
})
})
},
1000
)
},
1000
)
}
}
})
})
// that.upDateUserInfoMount()
// that.upDateUserInfoMount()
...
@@ -151,6 +168,7 @@
...
@@ -151,6 +168,7 @@
let
that
=
this
let
that
=
this
that
.
$refs
.
form
.
validate
().
then
(
res
=>
{
that
.
$refs
.
form
.
validate
().
then
(
res
=>
{
// uni.$u.toast('校验通过')
// uni.$u.toast('校验通过')
console
.
log
(
that
.
model
)
that
.
updateUser
(
that
.
model
)
that
.
updateUser
(
that
.
model
)
}).
catch
(
errors
=>
{
}).
catch
(
errors
=>
{
uni
.
$u
.
toast
(
'请完善信息'
)
uni
.
$u
.
toast
(
'请完善信息'
)
...
...
pages/my/index.vue
View file @
dc5e58b6
...
@@ -254,7 +254,7 @@
...
@@ -254,7 +254,7 @@
},
},
handleCallPhone
()
{
handleCallPhone
()
{
let
phone
=
'1
3585756959
'
let
phone
=
'1
7717504500
'
uni
.
makePhoneCall
({
uni
.
makePhoneCall
({
phoneNumber
:
phone
,
phoneNumber
:
phone
,
success
:
function
()
{
success
:
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment