Skip to content
切换导航面板
P
项目
G
群组
S
代码片段
帮助
成立
/
weiduh5
当前项目
正在载入...
登录
切换导航面板
转到一个项目
项目
版本库
问题
0
合并请求
0
流水线
维基
代码片段
设置
活动
图像
图表
创建新的问题
作业
提交
问题看板
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2a7cba6a
authored
Dec 13, 2017
by
颜景龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
gift领取礼物
parent
512b8d9c
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
342 行增加
和
5 行删除
gift/alert-icons.png
gift/alert-loading.gif
gift/gift.html
gift/giftindex.html
js/zepto.alert.js
gift/alert-icons.png
0 → 100755
查看文件 @
2a7cba6a
2 KB
gift/alert-loading.gif
0 → 100755
查看文件 @
2a7cba6a
3.81 KB
gift/gift.html
查看文件 @
2a7cba6a
...
@@ -85,7 +85,7 @@
...
@@ -85,7 +85,7 @@
background-size
:
cover
;
background-size
:
cover
;
flex-direction
:
column
;
flex-direction
:
column
;
background-position
:
center
;
background-position
:
center
;
/* background-image: url(./banner.png); */
background-image
:
url(./banner.png)
;
}
}
.clearfix
:after
{
.clearfix
:after
{
...
@@ -207,6 +207,93 @@
...
@@ -207,6 +207,93 @@
margin-top
:
1.2rem
;
margin-top
:
1.2rem
;
}
}
.rDialog
{
position
:
fixed
;
_position
:
absolute
;
}
.rDialog-wrap
{
position
:
relative
;
background
:
#000
;
opacity
:
.7
;
background-clip
:
padding-box
;
border-radius
:
10px
;
-moz-border-radius
:
10px
;
-o-border-radius
:
10px
;
-webkit-border-radius
:
10px
;
box-shadow
:
1px
1px
1px
#000
;
padding
:
1em
1em
;
}
.rDialog-header-load
{
text-align
:
center
;
background
:
url("./alert-loading.gif")
;
background-repeat
:
no-repeat
;
background-position
:
0
0
;
background-size
:
100%
;
width
:
50px
;
height
:
53px
;
margin
:
auto
;
}
.rDialog-header-alert
,
.rDialog-header-ok
{
text-align
:
center
;
background
:
url("./alert-icons.png")
;
background-repeat
:
no-repeat
;
background-size
:
100%
;
width
:
50px
;
height
:
53px
;
margin
:
auto
;
}
.rDialog-header-alert
{
background-position
:
0
-53px
;
}
.rDialog-header-ok
{
background-position
:
0
0
;
}
.rDialog-content
{
padding
:
1em
1em
;
font-size
:
0.8em
;
color
:
#FFF
;
overflow
:
hidden
;
text-align
:
center
;
}
.rDialog-footer
{
padding-left
:
15px
;
text-align
:
center
;
}
.rDialog-footer
a
{
display
:
inline-block
;
margin
:
0
15px
15px
0
;
height
:
32px
;
line-height
:
32px
;
padding
:
0
30px
;
font-size
:
0.8em
;
-moz-border-radius
:
3px
;
-webkit-border-radius
:
3px
;
border-radius
:
3px
;
}
.rDialog-footer
a
:
link
,
.rDialog-footer
a
:
visited
,
.rDialog-footer
a
:
hover
{
color
:
#fff
;
text-decoration
:
none
;
}
.rDialog-ok
,
.rDialog-ok
:hover
{
background
:
#FBA733
;
color
:
#fff
;
}
.rDialog-cancel
,
.rDialog-cancel
:hover
{
background
:
#E6E6E6
;
color
:
#A7A7A7
;
}
.rDialog-mask
{
position
:
fixed
;
_position
:
absolute
;
left
:
0
;
top
:
0
;
width
:
100%
;
height
:
100%
;
background
:
#000
;
filter
:
alpha
(
opacity
=
30
);
opacity
:
.3
;
}
</style>
</style>
</head>
</head>
<body>
<body>
...
@@ -304,7 +391,9 @@
...
@@ -304,7 +391,9 @@
<script
src=
"https://cdn.bootcss.com/zepto/1.2.0/zepto.min.js"
></script>
<script
src=
"https://cdn.bootcss.com/zepto/1.2.0/zepto.min.js"
></script>
<script
src=
"../js/zepto-mvalidate.js"
></script>
<script
src=
"../js/zepto-mvalidate.js"
></script>
<script
type=
"text/javascript"
>
<script
src=
"../js/zepto.alert.js"
></script>
<script
type=
"text/javascript"
>
var
HTTP_URL
=
'http://192.168.31.182:8080/wedo-fit'
;
var
HTTP_URL
=
'http://192.168.31.182:8080/wedo-fit'
;
//var HTTP_URL = 'http://192.168.31.217:8080/wedo';
//var HTTP_URL = 'http://192.168.31.217:8080/wedo';
...
@@ -380,7 +469,7 @@
...
@@ -380,7 +469,7 @@
$
(
'#customerUserId'
).
val
(
customerUserId
);
$
(
'#customerUserId'
).
val
(
customerUserId
);
var
data
=
result
.
data
;
var
data
=
result
.
data
;
initGiftList
(
data
.
giftInfo
);
initGiftList
(
data
.
giftInfo
);
$
(
'.class-banner'
).
css
({
'background-image'
:
`url(
${
HTTP_URL
}${
data
.
imgPath
}
)`
});
//
$('.class-banner').css({'background-image': `url(${HTTP_URL}${data.imgPath})`});
}
}
},
},
error
:
function
(
xhr
,
type
){
error
:
function
(
xhr
,
type
){
...
@@ -419,9 +508,19 @@
...
@@ -419,9 +508,19 @@
success
:
function
(
result
){
success
:
function
(
result
){
if
(
result
.
code
==
0
)
{
if
(
result
.
code
==
0
)
{
$
(
"#uploadForm"
)[
0
].
reset
();
$
(
"#uploadForm"
)[
0
].
reset
();
location
.
href
=
"ydl://goback"
;
$
.
dialog
({
content
:
'礼物领取成功'
,
title
:
'ok'
,
width
:
600
,
time
:
2000
});
}
else
{
}
else
{
alert
(
result
.
data
);
$
.
dialog
({
content
:
result
.
data
,
title
:
'alert'
,
width
:
600
,
time
:
2000
});
}
}
},
},
error
:
function
(
xhr
,
type
){
error
:
function
(
xhr
,
type
){
...
...
gift/giftindex.html
查看文件 @
2a7cba6a
...
@@ -60,6 +60,7 @@
...
@@ -60,6 +60,7 @@
margin
:
0.5rem
;
margin
:
0.5rem
;
margin-top
:
1.2rem
;
margin-top
:
1.2rem
;
}
}
</style>
</style>
</head>
</head>
<body>
<body>
...
...
js/zepto.alert.js
0 → 100755
查看文件 @
2a7cba6a
;(
function
(
$
,
window
,
undefined
)
{
var
win
=
$
(
window
),
doc
=
$
(
document
),
count
=
1
,
isLock
=
false
;
var
Dialog
=
function
(
options
)
{
this
.
settings
=
$
.
extend
({},
Dialog
.
defaults
,
options
);
this
.
init
();
}
Dialog
.
prototype
=
{
/**
* 初始化
*/
init
:
function
()
{
this
.
create
();
if
(
this
.
settings
.
lock
)
{
this
.
lock
();
}
if
(
!
isNaN
(
this
.
settings
.
time
)
&&
this
.
settings
.
time
!=
null
)
{
this
.
time
();
}
},
/**
* 创建
*/
create
:
function
()
{
var
divHeader
=
(
this
.
settings
.
title
==
null
)?
''
:
'<div class="rDialog-header-'
+
this
.
settings
.
title
+
'"></div>'
;
// HTML模板
var
templates
=
'<div class="rDialog-wrap">'
+
divHeader
+
'<div class="rDialog-content">'
+
this
.
settings
.
content
+
'</div>'
+
'<div class="rDialog-footer"></div>'
+
'</div>'
;
// 追回到body
this
.
dialog
=
$
(
'<div>'
).
addClass
(
'rDialog'
).
css
({
zIndex
:
this
.
settings
.
zIndex
+
(
count
++
)
}).
html
(
templates
).
prependTo
(
'body'
);
// 设置ok按钮
if
(
$
.
isFunction
(
this
.
settings
.
ok
))
{
this
.
ok
();
}
// 设置cancel按钮
if
(
$
.
isFunction
(
this
.
settings
.
cancel
))
{
this
.
cancel
();
}
// 设置大小
this
.
size
();
// 设置位置
this
.
position
();
},
/**
* ok
*/
ok
:
function
()
{
var
_this
=
this
,
footer
=
this
.
dialog
.
find
(
'.rDialog-footer'
);
$
(
'<a>'
,
{
href
:
'javascript:;'
,
text
:
this
.
settings
.
okText
}).
on
(
"click"
,
function
()
{
var
okCallback
=
_this
.
settings
.
ok
();
if
(
okCallback
==
undefined
||
okCallback
)
{
_this
.
close
();
}
}).
addClass
(
'rDialog-ok'
).
prependTo
(
footer
);
},
/**
* cancel
*/
cancel
:
function
()
{
var
_this
=
this
,
footer
=
this
.
dialog
.
find
(
'.rDialog-footer'
);
$
(
'<a>'
,
{
href
:
'javascript:;'
,
text
:
this
.
settings
.
cancelText
}).
on
(
"click"
,
function
()
{
var
cancelCallback
=
_this
.
settings
.
cancel
();
if
(
cancelCallback
==
undefined
||
cancelCallback
)
{
_this
.
close
();
}
}).
addClass
(
'rDialog-cancel'
).
appendTo
(
footer
);
},
/**
* 设置大小
*/
size
:
function
()
{
var
content
=
this
.
dialog
.
find
(
'.rDialog-content'
),
wrap
=
this
.
dialog
.
find
(
'.rDialog-wrap'
);
content
.
css
({
width
:
this
.
settings
.
width
,
height
:
this
.
settings
.
height
});
//wrap.width(content.width());
},
/**
* 设置位置
*/
position
:
function
()
{
var
_this
=
this
,
winWidth
=
win
.
width
(),
winHeight
=
win
.
height
(),
scrollTop
=
0
;
this
.
dialog
.
css
({
left
:
(
winWidth
-
_this
.
dialog
.
width
())
/
2
,
top
:
(
winHeight
-
_this
.
dialog
.
height
())
/
2
+
scrollTop
});
},
/**
* 设置锁屏
*/
lock
:
function
()
{
if
(
isLock
)
return
;
this
.
lock
=
$
(
'<div>'
).
css
({
zIndex
:
this
.
settings
.
zIndex
}).
addClass
(
'rDialog-mask'
);
this
.
lock
.
appendTo
(
'body'
);
isLock
=
true
;
},
/**
* 关闭锁屏
*/
unLock
:
function
()
{
if
(
this
.
settings
.
lock
)
{
if
(
isLock
)
{
this
.
lock
.
remove
();
isLock
=
false
;
}
}
},
/**
* 关闭方法
*/
close
:
function
()
{
this
.
dialog
.
remove
();
this
.
unLock
();
},
/**
* 定时关闭
*/
time
:
function
()
{
var
_this
=
this
;
this
.
closeTimer
=
setTimeout
(
function
()
{
_this
.
close
();
},
this
.
settings
.
time
);
}
}
/**
* 默认配置
*/
Dialog
.
defaults
=
{
// 内容
content
:
'加载中...'
,
// 标题
title
:
'load'
,
// 宽度
width
:
'auto'
,
// 高度
height
:
'auto'
,
// 确定按钮回调函数
ok
:
null
,
// 取消按钮回调函数
cancel
:
null
,
// 确定按钮文字
okText
:
'确定'
,
// 取消按钮文字
cancelText
:
'取消'
,
// 自动关闭时间(毫秒)
time
:
null
,
// 是否锁屏
lock
:
true
,
// z-index值
zIndex
:
9999
}
var
rDialog
=
function
(
options
)
{
return
new
Dialog
(
options
);
}
window
.
rDialog
=
$
.
rDialog
=
$
.
dialog
=
rDialog
;
})(
window
.
jQuery
||
window
.
Zepto
,
window
);
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此消息的编辑!
取消
请
注册
或
登录
后发表评论