Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eduline
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
冷斌
eduline
Commits
0688d1ef
Commit
0688d1ef
authored
May 14, 2020
by
陈超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
T
parent
343fadd5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
16 deletions
+46
-16
apps/home/Tpl/default/UserShow/index_w3g.html
+46
-16
No files found.
apps/home/Tpl/default/UserShow/index_w3g.html
View file @
0688d1ef
...
...
@@ -284,6 +284,7 @@
show
:
false
,
innerShow
:
false
,
value
:
""
,
savedUrl
:
""
,
currentAvatar
:
"{:getUserFace($user['uid'],'b')}"
,
currentNickName
:
"{:getUserName($user['uid'])}"
,
currentGender
:
"{$user['sex'] ==1 ? 男 : 女}"
...
...
@@ -299,18 +300,45 @@
if
(
!
/^
[\u
4E00-
\u
9FA5
\w]{1,}
$/
.
test
(
that
.
currentNickName
))
{
ui
.
error
(
'昵称仅支持中英文、数字、下划线'
)
return
}
if
(
that
.
savedUrl
.
length
>
0
)
{
that
.
saveAvatar
(
this
.
saveInfo
)
}
else
{
that
.
saveInfo
()
}
},
saveInfo
:
function
()
{
$
.
post
(
U
(
'home/User/saveUser'
),
{
},
function
(
data
)
{
if
(
data
.
status
)
{
ui
.
success
(
'基本信息更改成功'
)
setTimeout
(
'window.location.reload();'
,
2000
)
}
else
{
ui
.
error
(
data
.
info
)
}
},
'json'
)
},
uname
:
this
.
currentNickName
},
function
(
data
)
{
if
(
data
.
status
)
{
ui
.
success
(
'基本信息更改成功'
)
}
else
{
ui
.
error
(
data
.
info
)
}
},
'json'
)
},
saveAvatar
:
function
(
call
)
{
let
that
=
this
$
.
ajax
({
type
:
"POST"
,
url
:
"{:U('basic/Account/doSaveAvatar',array('step'=>'save'))}"
,
data
:
"picurl="
+
that
.
savedUrl
+
"&picwidth="
+
300
+
"&x1="
+
300
+
"&y1="
+
300
+
"&x2="
+
300
+
"&y2="
+
300
+
"&w="
+
300
+
"&h="
+
300
,
async
:
false
,
dataType
:
"text"
,
success
:
function
(
data
)
{
if
(
data
)
{
call
&&
call
()
}
else
{
ui
.
error
(
'头像修改失败'
);
}
}
})
},
onRead
:
function
(
r
)
{
let
that
=
this
let
formData
=
new
FormData
()
...
...
@@ -325,6 +353,7 @@
success
:
function
(
res
)
{
let
result
=
JSON
.
parse
(
res
)
if
(
result
.
status
==
1
)
{
that
.
savedUrl
=
result
.
data
.
save_path
+
result
.
data
.
save_name
that
.
currentAvatar
=
result
.
data
.
src
}
else
{
ui
.
error
(
'上传失败'
)
...
...
@@ -334,7 +363,7 @@
ui
.
error
(
'上传失败'
)
}
})
},
},
onNickName
:
function
()
{
this
.
value
=
this
.
currentNickName
this
.
show
=
true
...
...
@@ -343,7 +372,8 @@
this
.
innerShow
=
true
},
onChooseGender
:
function
(
id
)
{
this
.
currentGender
=
id
==
1
?
'男'
:
'女'
this
.
currentGender
=
id
==
1
?
'男'
:
'女'
,
this
.
innerShow
=
false
},
onGenderCancel
:
function
()
{
this
.
innerShow
=
false
...
...
@@ -351,16 +381,16 @@
onAddress
:
function
()
{
},
onError
:
function
()
{
},
onEditConfirm
:
function
()
{
this
.
currentNickName
=
this
.
value
this
.
show
=
false
},
onPopupClose
:
function
()
{
}
},
onError
:
function
()
{
},
}
})
</script>
...
...
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