Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zuiketang
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
zuiketang
Commits
7aa101da
Commit
7aa101da
authored
Oct 12, 2016
by
杨培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改进提交课程的体验
parent
fc804553
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
publish.js
src/frontend/web/js/my-course/publish.js
+6
-1
file.js
src/frontend/web/js/utils/file.js
+26
-0
No files found.
src/frontend/web/js/my-course/publish.js
View file @
7aa101da
...
@@ -123,12 +123,13 @@ var vm = new Vue({
...
@@ -123,12 +123,13 @@ var vm = new Vue({
to
=
org
;
to
=
org
;
}
}
//绑定提示到元素上
if
(
text
)
{
if
(
text
)
{
if
(
to
.
tipIndex
)
{
if
(
to
.
tipIndex
)
{
layer
.
close
(
to
.
tipIndex
);
layer
.
close
(
to
.
tipIndex
);
}
}
to
.
tipIndex
=
layer
.
tips
(
text
,
to
,
{
to
.
tipIndex
=
layer
.
tips
(
text
,
to
,
{
tips
:
1
,
tips
:
org
==
form
.
name
?
3
:
2
,
time
:
0
,
time
:
0
,
tipsMore
:
true
tipsMore
:
true
});
});
...
@@ -140,13 +141,17 @@ var vm = new Vue({
...
@@ -140,13 +141,17 @@ var vm = new Vue({
success
:
function
()
{},
//添加 success 后,当表单验证成功时才会触发 errorPlacement,否则验证成功不触发
success
:
function
()
{},
//添加 success 后,当表单验证成功时才会触发 errorPlacement,否则验证成功不触发
submitHandler
:
function
()
{
submitHandler
:
function
()
{
var
data
=
$
(
form
).
serialize
();
var
data
=
$
(
form
).
serialize
();
var
idx
=
layer
.
msg
(
"正在提交.."
,
{
icon
:
16
,
shade
:
[
0.2
,
'#000'
],
time
:
0
});
$
.
post
(
"/my-course/submit"
,
data
,
function
(
t
)
{
$
.
post
(
"/my-course/submit"
,
data
,
function
(
t
)
{
layer
.
close
(
idx
);
if
(
t
.
status
)
{
if
(
t
.
status
)
{
location
.
replace
(
"/my-course/result?id="
+
t
.
data
.
course_id
+
"&action=publish"
);
location
.
replace
(
"/my-course/result?id="
+
t
.
data
.
course_id
+
"&action=publish"
);
}
else
{
}
else
{
alert
(
t
.
message
);
alert
(
t
.
message
);
}
}
},
"json"
);
},
"json"
);
return
false
;
return
false
;
}
}
});
});
...
...
src/frontend/web/js/utils/file.js
0 → 100644
View file @
7aa101da
/**
* Created by pader on 16/9/30.
*
* 文件相关辅助函数
* 文件、路径、文件名称、文件大小等与文件相关的能用辅助函数
*/
module
.
exports
=
{
/**
* 根据输入的字节数显示可读形式的文件大小
*
* @param {int} bytes
* @returns {string}
*/
readableSize
:
function
(
bytes
)
{
var
filesizeUnits
=
[
'Bytes'
,
'KB'
,
'MB'
,
'GB'
,
'TB'
,
'PB'
,
'EB'
,
'ZB'
,
'YB'
];
var
base
=
1024
;
if
(
bytes
)
{
var
i
=
0
;
if
(
bytes
>=
base
)
{
var
a
=
bytes
;
while
(
1
)
{
a
/=
base
;
i
++
;
if
(
a
<
base
)
break
;
}
}
return
parseFloat
((
bytes
/
Math
.
pow
(
base
,
i
)).
toFixed
(
2
))
+
' '
+
filesizeUnits
[
i
];
}
else
return
'0 Byte'
;
}
};
\ No newline at end of file
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