Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CFFP-HB
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
Chao Sun
CFFP-HB
Commits
d6a098d5
Commit
d6a098d5
authored
Nov 24, 2022
by
sunerhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
个人信息修改--上传头像/文件方法添加,
parent
8480bd31
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
383 additions
and
256 deletions
+383
-256
api/api.ts
+13
-1
pages/certifyDetail/uploadinformation.vue
+146
-56
pages/personalCenter/accountoperation/resetpassword.vue
+6
-75
pages/personalCenter/personalCenter.vue
+11
-1
pages/personalCenter/system/menulist.vue
+47
-40
pages/personalCenter/user-information.vue
+64
-11
static/myteam/Group1646.png
+0
-0
static/myteam/Pdf.png
+0
-0
util/uploaderFile.ts
+96
-72
No files found.
api/api.ts
View file @
d6a098d5
...
@@ -240,5 +240,17 @@ export default {
...
@@ -240,5 +240,17 @@ export default {
//合同声明
//合同声明
listQuery
(
params
){
listQuery
(
params
){
return
request
(
`
${
cffpURL
}
/contract/listQuery`
,
"POST"
,
params
)
return
request
(
`
${
cffpURL
}
/contract/listQuery`
,
"POST"
,
params
)
}
},
// 个人信息修改
updateinfo
(
params
){
return
request
(
`
${
cffpURL
}
/user/update`
,
"POST"
,
params
)
},
// 上传接口
uploadFile
(
params
){
return
request
(
`
${
cffpURL
}
/api/file/upload`
,
"POST"
,
params
)
},
// 上传计划书
uploadSignUpUserInfo
(
params
){
return
request
(
`
${
cffpURL
}
/api/cffp/user/uploadSignUpUserInfo`
,
"POST"
,
params
)
},
}
}
pages/certifyDetail/uploadinformation.vue
View file @
d6a098d5
...
@@ -2,38 +2,57 @@
...
@@ -2,38 +2,57 @@
<view
class=
"content"
>
<view
class=
"content"
>
<view
class=
"band"
>
<view
class=
"band"
>
<view
class=
"contentItem"
>
<view
class=
"contentItem"
>
<text>
姓名:
</text>
<text>
姓名:
</text>
<input
class=
"user-input"
type=
"text"
placeholder=
"请输入姓名"
/>
<input
v-model=
"openForm.userNameChinese"
class=
"user-input"
type=
"text"
placeholder=
"请输入姓名"
/>
</view>
</view>
<view
class=
"contentItem"
>
<view
class=
"contentItem"
>
<text>
英文名:
</text>
<text>
英文名:
</text>
<input
class=
"user-input"
maxlength=
"10"
type=
"text"
placeholder=
"请输入英文名"
/>
<input
class=
"user-input"
v-model=
"openForm.userNameEnglish"
maxlength=
"10"
type=
"text"
placeholder=
"请输入英文名"
/>
</view>
</view>
<view
class=
"contentItem"
>
<view
class=
"contentItem"
>
<text>
手机号
</text>
<text>
手机号
</text>
<input
class=
"user-input"
maxlength=
"10"
type=
"text"
placeholder=
"请输入手机号"
/>
<!-- userTel -->
<text>
{{
openForm
.
userTel
}}
</text>
</view>
</view>
<view
class=
"contentItem"
>
<view
class=
"contentItem"
>
<text>
证件类型
</text>
<text>
证件类型
</text>
<input
class=
"user-input"
maxlength=
"10"
type=
"text"
placeholder=
"请输入证件类型"
/>
<!--
<input
v-model=
"openForm.userIdType"
class=
"user-input"
maxlength=
"10"
type=
"text"
placeholder=
"请输入证件类型"
/>
-->
<!--
<picker
mode=
""
:range=
""
@
change=
""
>
<view>
{{
erplizeList
[
index
]
}}
</view>
</picker>
-->
<picker
v-if=
"erplizeList "
@
change=
"bindPickerChange"
:value=
"index"
:range=
"erplizeList"
range-key=
"name"
>
<view
style=
"background-color: white;"
>
{{
erplizeList
[
index
].
name
}}
</view>
</picker>
</view>
</view>
<view
class=
"contentItem"
>
<view
class=
"contentItem"
>
<text>
证件号
</text>
<text>
证件号
</text>
<input
class=
"user-input"
maxlength=
"10"
type=
"text"
placeholder=
"请输入证件号"
/>
<input
v-model=
"openForm.userIdNo"
class=
"user-input"
maxlength=
"20"
type=
"text"
placeholder=
"请输入证件号"
/>
</view>
</view>
<!--
<view
class=
"contentItem"
>
<view
class=
""
style=
"margin-top: 20rpx;"
>
<text>
个人简介
</text>
<text>
上传计划书
</text>
<textarea
class=
"user-textarea"
></textarea>
</view>
</view>
-->
<view
class=
""
style=
"display: flex;margin-top: 20rpx;"
v-if=
"openForm.name"
>
<view
class=
""
style=
"margin-top: 20rpx;"
>
<view
class=
""
style=
"width: 20px;height: 30px;"
>
<text
>
上传计划书
</text>
<image
class=
"imagegh"
src=
"../../static/myteam/Pdf.png"
mode=
""
></image>
</view>
<text
style=
"margin-left: 10rpx;"
>
{{
openForm
.
name
}}
</text>
</view>
</view>
<view
class=
"uploadpdf"
@
click=
"uploadFile()"
>
<view
class=
"uploadpdf"
@
click=
"uploadFile()"
>
<view
class=
"uploadimg"
>
<view
class=
""
style=
"width: 50px;"
>
<image
class=
"image"
src=
"../../static/myteam/Group1646.png"
></image>
</view>
<p>
点击添加计划书
</p>
</view>
<view
class=
"footer-text"
>
<text>
(请上传pdf文件)
</text>
</view>
</view>
</view>
</view>
</view>
<view
class=
"footer"
>
<view
class=
"footer"
>
<button
class=
"user-button"
>
保存
</button>
<button
class=
"user-button"
@
click=
"onsubmit()"
:loading=
"loading"
:disabled=
"loading"
>
保存
</button>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
...
@@ -42,80 +61,151 @@
...
@@ -42,80 +61,151 @@
import
{
import
{
uploadFilepdf
uploadFilepdf
}
from
'@/util/uploaderFile'
}
from
'@/util/uploaderFile'
import
api
from
"@/api/api"
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
dataForm
:
{
loginId
:
"1"
,
targetType
:
"5"
,
targetId
:
"1"
,
targetNo
:
"7"
,
targetUseFor
:
"12"
,
targetSeq
:
"0"
},
openForm
:
{
userTel
:
'183****9247'
},
index
:
0
,
loading
:
false
,
fileList
:
[],
fileForm
:
{},
erplizeList
:
null
}
}
},
},
methods
:{
onShow
()
{
this
.
geterpInitialize
()
},
methods
:
{
// 获取证件类型
async
geterpInitialize
(){
let
res
=
await
api
.
erpInitialize
()
this
.
erplizeList
=
res
.
data
.
idTypes
console
.
log
(
this
.
erplizeList
,
444
)
},
bindPickerChange
(
e
){
this
.
index
=
e
.
detail
.
value
;
},
onsubmit
()
{
this
.
loading
=
true
api
.
uploadSignUpUserInfo
(
this
.
openForm
).
then
(
res
=>
{
console
.
log
(
res
,
555458
)
this
.
loading
=
false
})
},
// 上传文件方法
uploadFile
(
event
)
{
uploadFile
(
event
)
{
// let that = this;
let
that
=
this
;
// uploadFilepdf()
uploadFilepdf
(
this
.
dataForm
)
// .then(res => {
.
then
(
res
=>
{
// that.headUrl = res[0].url
console
.
log
(
res
,
54854
)
// })
// that.headUrl = res[0].url
uni
.
uploadFile
({
// this.fileForm = {
url
:
'https://www.example.com/upload'
,
//仅为示例,非真实的接口地址
// name: res.name,
files
:
上边的
filelist
,
// filePath: res.data.filePath
formData
:
{
// }
//图片张数
this
.
openForm
.
name
=
res
.
name
'length'
:
上边的
filelist
.
length
this
.
openForm
.
filePath
=
res
.
data
.
filePath
},
})
success
:
(
res
)
=>
{
console
.
log
(
res
.
data
);
}
});
},
},
}
}
}
}
</
script
>
</
script
>
<
style
scoped
>
<
style
lang=
"scss"
>
.content
{
.content
{
width
:
100vw
;
width
:
100vw
;
}
}
.user-input
{
.signfile
{
display
:
flex
;
}
.imagegh
{
width
:
30
rpx
;
height
:
30
rpx
;
}
.user-input
{
text-align
:
right
;
text-align
:
right
;
}
}
.user-textarea
{
border
:
1px
solid
#C7C7C7
;
width
:
540
rpx
;
.uploadimg
{
height
:
160px
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
.image
{
width
:
50px
;
height
:
43px
;
}
}
.user-textarea
{
border
:
1px
solid
#C7C7C7
;
width
:
540
rpx
;
height
:
270
rpx
;
height
:
270
rpx
;
border-radius
:
10
rpx
;
border-radius
:
10
rpx
;
}
}
.band
{
margin
:
0
20
rpx
;
.band
{
font-size
:
26
rpx
;
margin
:
0
20
rpx
;
}
font-size
:
26
rpx
;
.uploadpdf
{
}
width
:
274px
;
height
:
160px
;
.footer-text
{
background
:
#F8F8F8
;
text-align
:
center
;
border-radius
:
2px
2px
2px
2px
;
margin-top
:
10
rpx
;
opacity
:
1
;
font-size
:
20
rpx
;
border
:
1px
solid
#E3E3E3
;
color
:
#666666
;
margin
:
20px
auto
;
}
}
.uploadpdf
{
width
:
274px
;
height
:
160px
;
background
:
#F8F8F8
;
border-radius
:
2px
2px
2px
2px
;
opacity
:
1
;
border
:
1px
solid
#E3E3E3
;
margin
:
10px
auto
;
}
.headportrait
{
.headportrait
{
width
:
260
rpx
;
width
:
260
rpx
;
height
:
260
rpx
;
height
:
260
rpx
;
border
:
1
rpx
solid
aqua
;
border
:
1
rpx
solid
aqua
;
border-radius
:
50%
;
border-radius
:
50%
;
}
}
.contentItem
{
.contentItem
{
margin-top
:
20
rpx
;
margin-top
:
20
rpx
;
display
:
flex
;
display
:
flex
;
justify-content
:
space-between
;
justify-content
:
space-between
;
border-bottom
:
2
rpx
solid
#E4E4E4
;
border-bottom
:
2
rpx
solid
#E4E4E4
;
padding
:
10
rpx
;
padding
:
10
rpx
;
}
}
.footer
{
.footer
{
width
:
500
rpx
;
width
:
500
rpx
;
height
:
80
rpx
;
height
:
80
rpx
;
opacity
:
1
;
opacity
:
1
;
margin
:
80
rpx
auto
;
margin
:
80
rpx
auto
;
}
}
.user-button
{
.user-button
{
color
:
#FFFFFF
;
color
:
#FFFFFF
;
background
:
#20269B
;
background
:
#20269B
;
border-radius
:
80px
;
border-radius
:
80px
;
...
...
pages/personalCenter/accountoperation/resetpassword.vue
View file @
d6a098d5
<
template
>
<
template
>
<view
class=
"conent"
>
<view
class=
"conent"
>
<view
class=
"input-row"
>
<view
class=
"input-row"
>
<input
class=
"m-input"
maxlength=
"11"
type=
"text"
clearable
v-model=
"account"
placeholder=
"请输入手机号"
/>
<text>
183****9247
</text>
</view>
<view
class=
"input-row"
>
<input
maxlength=
"16"
type=
"password"
clearable
v-model=
"password"
placeholder=
"请输入新密码"
/>
</view>
<view
class=
"input-row"
>
<input
maxlength=
"16"
type=
"password"
clearable
v-model=
"newpassword"
placeholder=
"重新输入密码"
/>
</view>
</view>
<view
class=
"input-row"
>
<view
class=
"input-row"
>
<view
style=
"width: 65%;"
><input
maxlength=
"11"
type=
"text"
v-model=
"code"
placeholder=
"请输入验证码"
/></view>
<view
style=
"width: 65%;"
><input
maxlength=
"11"
type=
"text"
v-model=
"code"
placeholder=
"请输入验证码"
/></view>
<view
style=
"width: 30%;"
><text
v-if=
"codetimecode == false"
style=
"font-size: 26upx;color: #3971E2;"
@
click=
"getCode()"
>
获取验证码
</text>
<view
style=
"width: 30%;"
><text
v-if=
"codetimecode == false"
style=
"font-size: 26upx;color: #3971E2;"
@
click=
"getCode()"
>
获取验证码
</text>
<text
v-else
style=
"font-size: 26upx;margin-right: 20upx;color: #3971E2;"
>
{{
countdown
}}
秒后重新获取
</text></view>
<text
v-else
style=
"font-size: 26upx;margin-right: 20upx;color: #3971E2;"
>
{{
countdown
}}
秒后重新获取
</text></view>
</view>
</view>
<view
class=
"forgetpsd"
><button
type=
"primary"
class=
"primary log-btn"
@
click=
"registerck"
>
修改密码
</button></view>
<view
class=
"forgetpsd"
><button
class=
"primary log-btn"
@
click=
"registerck"
>
修改密码
</button></view>
</view>
</view>
</
template
>
</
template
>
...
@@ -34,13 +28,6 @@
...
@@ -34,13 +28,6 @@
},
},
methods
:{
methods
:{
getCode
()
{
getCode
()
{
if
(
this
.
account
==
''
){
uni
.
showToast
({
title
:
'手机号码不能为空'
,
icon
:
'none'
});
return
false
}
const
data
=
{
const
data
=
{
phone
:
this
.
account
,
phone
:
this
.
account
,
codetype
:
'1'
codetype
:
'1'
...
@@ -85,66 +72,7 @@
...
@@ -85,66 +72,7 @@
this
.
codetimecode
=
false
this
.
codetimecode
=
false
},
},
registerck
()
{
if
(
this
.
account
==
''
){
uni
.
showToast
({
title
:
'手机号不能为空'
,
icon
:
'none'
});
return
false
}
if
(
this
.
password
==
''
){
uni
.
showToast
({
title
:
'密码不能为空'
,
icon
:
'none'
});
return
false
}
if
(
this
.
password
!=
this
.
newpassword
){
uni
.
showToast
({
title
:
'2次密码输入不一致'
,
icon
:
'none'
});
return
false
}
if
(
this
.
code
==
''
){
uni
.
showToast
({
title
:
'请输入短信验证码'
,
icon
:
'none'
});
return
false
}
if
(
this
.
newpassword
==
''
!=
this
.
confirmpassword
==
''
){
uni
.
showToast
({
title
:
'新密码与确认密码不一致'
,
icon
:
'none'
});
return
false
}
const
data
=
{
phone
:
this
.
account
,
newPassword
:
this
.
password
,
newPassword1
:
this
.
newpassword
,
code
:
this
.
code
,
codetype
:
'1'
}
this
.
$http
.
post
(
'/route/appUser/forgetPassword'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
0
)
{
uni
.
showToast
({
title
:
'修改成功'
,
icon
:
'none'
});
uni
.
redirectTo
({
url
:
'./success'
})
}
else
{
uni
.
showToast
({
title
:
res
.
msg
,
icon
:
'none'
});
}
})
}
}
}
}
}
</
script
>
</
script
>
...
@@ -164,6 +92,7 @@
...
@@ -164,6 +92,7 @@
display
:
flex
;
display
:
flex
;
margin
:
20
upx
0
;
margin
:
20
upx
0
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
space-between
;
padding
:
0
20
upx
;
padding
:
0
20
upx
;
background
:
#FFFFFF
;
background
:
#FFFFFF
;
border-bottom
:
1
upx
solid
#C8C7CC
;
border-bottom
:
1
upx
solid
#C8C7CC
;
...
@@ -183,6 +112,8 @@
...
@@ -183,6 +112,8 @@
.log-btn
{
.log-btn
{
border-radius
:
10
upx
;
border-radius
:
10
upx
;
font-size
:
34
upx
;
font-size
:
34
upx
;
color
:
#FFFFFF
;
background
:
#20269B
;
box-shadow
:
0px
16
upx
32
upx
0px
rgba
(
2
,
168
,
244
,
0.24
);
box-shadow
:
0px
16
upx
32
upx
0px
rgba
(
2
,
168
,
244
,
0.24
);
}
}
...
...
pages/personalCenter/personalCenter.vue
View file @
d6a098d5
...
@@ -130,7 +130,17 @@
...
@@ -130,7 +130,17 @@
components
:{
components
:{
tabBar
tabBar
},
},
onShow
()
{
uni
.
$on
(
"handClick"
,
res
=>
{
this
.
customerBasicInfo
=
res
.
data
// 清除监听
uni
.
$off
(
'handClick'
);
})
},
methods
:
{
methods
:
{
updateData
(
val
){
console
.
log
(
'我来修改一些数据'
)
},
// 菜单跳转页面
// 菜单跳转页面
goDetail
(
item
){
goDetail
(
item
){
if
(
item
.
isShow
&&
item
.
isOpen
){
if
(
item
.
isShow
&&
item
.
isOpen
){
...
@@ -147,7 +157,7 @@
...
@@ -147,7 +157,7 @@
},
},
userinfo
(){
userinfo
(){
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'/pages/personalCenter/user-information'
url
:
`/pages/personalCenter/user-information?customerBasicInfo=`
+
JSON
.
stringify
(
this
.
customerBasicInfo
)
})
})
},
},
// 弹窗
// 弹窗
...
...
pages/personalCenter/system/menulist.vue
View file @
d6a098d5
...
@@ -2,13 +2,15 @@
...
@@ -2,13 +2,15 @@
<view>
<view>
<view
class=
"personalInfo"
>
<view
class=
"personalInfo"
>
<view
class=
"ulBox"
>
<view
class=
"ulBox"
>
<view
v-for=
"item in menuList.filter(v=>v.isShow)"
:key=
"item.title"
@
click=
"goDetail(item)"
class=
"liBox"
>
<view
v-for=
"item in menuList.filter(v=>v.isShow)"
:key=
"item.title"
@
click=
"goDetail(item)"
class=
"liBox"
>
<view
class=
"infoBox"
>
<view
class=
"infoBox"
>
<!--
<image
:src=
"'/static/moduleIcon/'+item.icon+'.png'"
alt=
""
srcset=
""
mode=
"widthFix"
></image>
-->
<!--
<image
:src=
"'/static/moduleIcon/'+item.icon+'.png'"
alt=
""
srcset=
""
mode=
"widthFix"
></image>
-->
<text>
{{
item
.
title
}}
</text>
<text>
{{
item
.
title
}}
</text>
</view>
</view>
<view
class=
"iconBox"
>
<view
class=
"iconBox"
>
<i
class=
"iconfont icon-youjiantou"
></i>
<text
v-if=
"item.contentType"
>
{{
item
.
contentType
}}
</text>
<i
v-else
class=
"iconfont icon-youjiantou"
></i>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -24,40 +26,40 @@
...
@@ -24,40 +26,40 @@
}
}
},
},
data
()
{
data
()
{
return
{
return
{}
}
},
},
mounted
(){
mounted
()
{
console
.
log
(
this
.
minorMenuLists
,
7412
)
console
.
log
(
this
.
minorMenuLists
,
7412
)
},
},
methods
:{
methods
:
{
goDetail
(
item
){
goDetail
(
item
)
{
if
(
item
.
isShow
&&
item
.
isOpen
){{
console
.
log
(
item
,
844
)
if
(
item
.
isType
==
true
){
if
(
item
.
isShow
==
true
&&
item
.
isOpen
==
true
)
{
uni
.
showModal
({
if
(
item
.
isType
==
true
)
{
title
:
item
.
title
,
uni
.
showModal
({
content
:
'确定要进行'
+
item
.
title
+
'操作吗?'
,
title
:
item
.
title
,
showCancel
:
true
,
content
:
'确定要进行'
+
item
.
title
+
'操作吗?'
,
success
:
function
(
res
)
{
showCancel
:
true
,
if
(
res
.
confirm
)
{
success
:
function
(
res
)
{
uni
.
showToast
({
if
(
res
.
confirm
)
{
title
:
'操作成功'
,
uni
.
showToast
({
icon
:
'none'
title
:
'操作成功'
,
});
icon
:
'none'
}
else
{
});
console
.
log
(
'已取消'
)
}
else
{
}
console
.
log
(
'已取消'
)
}
}
});
}
}
else
{
});
uni
.
navigateTo
({
}
else
if
(
item
.
link
!=
null
)
{
url
:
item
.
link
uni
.
navigateTo
({
});
url
:
item
.
link
}
});
}
else
{
}
console
.
log
(
'错误抛出'
)
}
else
{
}
common
.
errorDialog
(
2
,
'该模块正在开发中,敬请期待!'
,
'提示'
);
}
else
{
common
.
errorDialog
(
2
,
'该模块正在开发中,敬请期待!'
,
'提示'
);
}
}
}
}
}
}
...
@@ -65,28 +67,33 @@
...
@@ -65,28 +67,33 @@
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
.personalInfo
{
.personalInfo
{
background
:
#fff
;
background
:
#fff
;
width
:
95%
;
width
:
95%
;
margin
:
6
rpx
auto
0
;
margin
:
6
rpx
auto
0
;
.ulBox{
.ulBox
{
padding
:
0
30
rpx
;
padding
:
0
30
rpx
;
.liBox{
.liBox
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
space-between
;
justify-content
:
space-between
;
border-bottom
:
1px
solid
#E6E6E6
;
border-bottom
:
1px
solid
#E6E6E6
;
height
:
92
rpx
;
height
:
92
rpx
;
.infoBox{
.infoBox
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
image{
image
{
width
:
52
rpx
!important
;
width
:
52
rpx
!important
;
height
:
52
rpx
;
height
:
52
rpx
;
}
}
}
}
&
:last-child
{
border
:
none
;
&
:last-child
{
border
:
none
;
}
}
}
}
}
}
...
...
pages/personalCenter/user-information.vue
View file @
d6a098d5
...
@@ -2,25 +2,25 @@
...
@@ -2,25 +2,25 @@
<view
class=
"content"
>
<view
class=
"content"
>
<view
class=
"header"
>
<view
class=
"header"
>
<view
class=
"headportrait"
@
click=
"uploadAvatar()"
>
<view
class=
"headportrait"
@
click=
"uploadAvatar()"
>
<im
g
src=
""
alt=
""
>
<im
age
:src=
"optionForm.headPicture ? optionForm.headPicture :'../../static/myteam/Group1633.png'"
mode=
""
></image
>
</view>
</view>
</view>
</view>
<view
class=
"band"
>
<view
class=
"band"
>
<view
class=
"contentItem"
>
<view
class=
"contentItem"
>
<text>
真实名称
</text>
<text>
真实名称
</text>
<input
class=
"user-input"
type=
"text"
placeholder=
"请输入姓名"
/>
<input
class=
"user-input"
v-model=
"optionForm.realName"
type=
"text"
placeholder=
"请输入姓名"
/>
</view>
</view>
<view
class=
"contentItem"
>
<view
class=
"contentItem"
>
<text>
昵称
</text>
<text>
昵称
</text>
<input
class=
"user-input"
maxlength=
"10"
type=
"text"
placeholder=
"请输入3~10个字符"
/>
<input
class=
"user-input"
v-model=
"optionForm.nickName"
maxlength=
"10"
type=
"text"
placeholder=
"请输入3~10个字符"
/>
</view>
</view>
<view
class=
"contentItem"
>
<view
class=
"contentItem"
>
<text>
个人简介
</text>
<text>
个人简介
</text>
<textarea
class=
"user-textarea"
></textarea>
<textarea
class=
"user-textarea"
v-model=
"optionForm.userDescription"
placeholder=
"请输入个人简介"
></textarea>
</view>
</view>
</view>
</view>
<view
class=
"footer"
>
<view
class=
"footer"
>
<button
class=
"user-button"
>
保存
</button>
<button
class=
"user-button"
@
click=
"submitinfo()"
>
保存
</button>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
...
@@ -29,20 +29,61 @@
...
@@ -29,20 +29,61 @@
import
{
import
{
CommonUpload
CommonUpload
}
from
'@/util/uploaderFile'
}
from
'@/util/uploaderFile'
import
api
from
"@/api/api"
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
dataForm
:{
loginId
:
"1"
,
targetType
:
"5"
,
targetId
:
"1"
,
targetNo
:
"6"
,
targetUseFor
:
"12"
,
targetSeq
:
"0"
},
optionForm
:{}
}
}
},
},
onLoad
(
options
)
{
this
.
optionForm
=
JSON
.
parse
(
options
.
customerBasicInfo
)
console
.
log
(
this
.
optionForm
,
7777
)
},
methods
:{
methods
:{
uploadAvatar
(
event
)
{
uploadAvatar
(
event
)
{
let
that
=
this
;
let
that
=
this
;
CommonUpload
()
CommonUpload
(
that
.
dataForm
).
then
(
res
=>
{
.
then
(
res
=>
{
this
.
optionForm
.
headPicture
=
res
.
data
.
filePath
// that.headUrl = res[0].url
})
})
},
},
// 修改个人资料接口
submitinfo
(){
uni
.
showLoading
({
title
:
'加载中'
,
mask
:
true
});
let
UserRequestVO
=
{
id
:
1
,
realName
:
this
.
optionForm
.
realName
,
nickName
:
this
.
optionForm
.
nickName
,
headPicture
:
this
.
optionForm
.
headPicture
,
userDescription
:
this
.
optionForm
.
userDescription
}
api
.
updateinfo
(
UserRequestVO
).
then
(
res
=>
{
if
(
res
.
success
)
{
uni
.
showToast
({
title
:
res
[
'message'
],
duration
:
2000
,
icon
:
'none'
});
uni
.
$emit
(
"handClick"
,
{
data
:
this
.
optionForm
});
uni
.
navigateBack
({
delta
:
1
})
}
})
},
}
}
}
}
</
script
>
</
script
>
...
@@ -69,11 +110,23 @@
...
@@ -69,11 +110,23 @@
}
}
.headportrait
{
.headportrait
{
width
:
250
rpx
;
height
:
250
rpx
;
/* border: 1rpx solid aqua; */
border-radius
:
50%
;
}
.headportrait
image
{
width
:
100%
;
height
:
100%
;
border-radius
:
50%
;
}
/* .headportrait-img {
width: 260rpx;
width: 260rpx;
height: 260rpx;
height: 260rpx;
border
:
1
rpx
solid
aqua
;
border-radius: 50%;
border-radius: 50%;
}
background-size: cover;
background-repeat: no-repeat center;
} */
.contentItem
{
.contentItem
{
margin-top
:
40
rpx
;
margin-top
:
40
rpx
;
display
:
flex
;
display
:
flex
;
...
...
static/myteam/Group1646.png
0 → 100644
View file @
d6a098d5
2.06 KB
static/myteam/Pdf.png
0 → 100644
View file @
d6a098d5
721 Bytes
util/uploaderFile.ts
View file @
d6a098d5
// import $http from "@/common/requestConfig.js"
import
request
from
"./request"
;
import
request
from
"./request"
;
// import {baseURL,apiURL,cffpURL} from "../environments/environment";
import
{
baseURL
,
apiURL
,
cffpURL
}
from
"../environments/environment"
;
// 上传的事件
// 上传图片事件
export
function
CommonUpload
()
{
export
function
CommonUpload
(
psrams
)
{
console
.
log
(
psrams
,
784512
)
// @ts-ignore
let
requestVO
=
psrams
return
new
Promise
((
resolve
,
rej
)
=>
{
// @ts-ignore
uni
.
chooseImage
({
count
:
1
,
//默认9
sizeType
:
[
'original'
,
'compressed'
],
//可以指定是原图还是压缩图,默认二者都有
sourceType
:
[
'album'
],
//从相册选择
success
:
function
(
res
)
{
var
urlList
=
[]
// res.tempFiles 数组
for
(
var
i
=
0
;
i
<
res
.
tempFiles
.
length
;
i
++
)
{
uni
.
showLoading
({
title
:
'加载中'
,
mask
:
true
});
uni
.
uploadFile
({
url
:
$http
.
baseUrl
+
'/route/appUser/updateImgUrl'
,
// 后端api接口
filePath
:
res
.
tempFilePaths
[
0
],
// uni.chooseImage函数调用后获取的本地文件路劲
name
:
'file'
,
//后端通过'file'获取上传的文件对象
// formData: this.sendDate,
// header:{"third-session": uni.getStorageSync('thirdSession')},
header
:
{
// "third-session": uni.getStorageSync('thirdSession')
'Authorization'
:
'Bearer'
+
uni
.
getStorageSync
(
'access_token'
)
},
success
:
(
res
)
=>
{
// let data = JSON.parse(res.data)
// that.headUrl = data.data.link
let
data
=
JSON
.
parse
(
res
.
data
)
urlList
.
push
({
url
:
data
.
data
.
link
,
recordId
:
data
.
data
.
recordId
})
// 抛出
resolve
(
urlList
)
uni
.
hideLoading
();
}
});
}
}
});
})
}
// 上传文件
export
function
uploadFilepdf
(){
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
uni
.
showLoading
({
uni
.
chooseImage
({
title
:
'加载中'
,
count
:
1
,
//默认9
mask
:
true
sizeType
:
[
'original'
,
'compressed'
],
//可以指定是原图还是压缩图,默认二者都有
});
sourceType
:
[
'album'
],
//从相册选择
uni
.
uploadFile
({
success
:
function
(
res
)
{
url
:
baseURL
+
'/common/upload'
,
//仅为示例,非真实的接口地址
// res.tempFiles 数组
filePath
:
tempFilePaths
,
// for (var i = 0; i < res.tempFiles.length; i++) {
name
:
'file'
,
formData
:
{...
data
,
token
:
uni
.
getStorageSync
(
'token'
)
||
''
},
success
:
(
res
)
=>
{
uni
.
showLoading
({
uni
.
showLoading
({
title
:
'加载中'
,
title
:
'加载中'
,
mask
:
true
mask
:
true
});
});
console
.
log
(
res
);
uni
.
uploadFile
({
if
(
res
.
statusCode
==
200
){
url
:
`/api/file/upload`
,
// 后端api接口
resolve
(
JSON
.
parse
(
res
.
data
).
data
)
filePath
:
res
.
tempFilePaths
[
0
],
// uni.chooseImage函数调用后获取的本地文件路劲
}
name
:
'file'
,
//后端通过'file'获取上传的文件对象
},
// formData: this.sendDate,
fail
:(
err
)
=>
{
// header:{"third-session": uni.getStorageSync('thirdSession')},
formData
:
{
//后台所需除图片外的参数可以写在这里面 ,单张多张都可
requestVO
:
JSON
.
stringify
(
requestVO
)
},
header
:
{
// "third-session": uni.getStorageSync('thirdSession')
// 'content-type': 'application/json',
'X-Authorization'
:
uni
.
getStorageSync
(
'uni-token'
)
?
uni
.
getStorageSync
(
'uni-token'
)
:
''
},
success
:
(
res
)
=>
{
let
data
=
JSON
.
parse
(
res
.
data
)
console
.
log
(
data
,
'这是上传成功了吗?'
)
// // 抛出
resolve
(
data
)
uni
.
hideLoading
();
}
});
// }
}
});
})
}
// 这个方法用来上传文件
export
function
uploadFilepdf
(
params
)
{
let
requestVO
=
params
// @ts-ignore
return
new
Promise
((
resolve
,
reject
)
=>
{
uni
.
chooseFile
({
count
:
1
,
//默认100
extension
:
[
'.pdf'
,
'.doc'
],
success
:
function
(
res
)
{
console
.
log
(
res
,
5588
)
var
name
=
res
.
tempFiles
[
0
].
name
// res.tempFiles 数组
// for (var i = 0; i < res.tempFiles.length; i++) {
uni
.
showLoading
({
uni
.
showLoading
({
title
:
'加载中'
,
title
:
'加载中'
,
mask
:
true
mask
:
true
});
});
console
.
log
(
err
,
'上传报错'
);
uni
.
uploadFile
({
// return
url
:
`/api/file/upload`
,
// 后端api接口
reject
(
err
)
filePath
:
res
.
tempFilePaths
[
0
],
// uni.chooseImage函数调用后获取的本地文件路劲
name
:
'file'
,
//后端通过'file'获取上传的文件对象
formData
:
{
requestVO
:
JSON
.
stringify
(
requestVO
)
},
// header:{"third-session": uni.getStorageSync('thirdSession')},
header
:
{
// "third-session": uni.getStorageSync('thirdSession')
// 'content-type': 'application/json',
'X-Authorization'
:
uni
.
getStorageSync
(
'uni-token'
)
?
uni
.
getStorageSync
(
'uni-token'
)
:
''
},
success
:
(
res
)
=>
{
console
.
log
(
res
,
54854
)
// let data = JSON.parse(res.data)
// that.headUrl = data.data.link
let
data
=
JSON
.
parse
(
res
.
data
)
if
(
data
.
success
==
true
){
data
.
name
=
name
resolve
(
data
)
}
else
{
uni
.
showToast
({
title
:
'上传失败'
,
duration
:
2000
,
icon
:
'none'
});
}
// urlList.push({
// url: data.data.link,
// recordId: data.data.recordId
// })
// 抛出
uni
.
hideLoading
();
}
});
// }
}
}
})
})
;
})
})
}
}
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