Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
X
xzf_uniapp-wechat-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李智书
xzf_uniapp-wechat-web
Commits
f8afdf75
Commit
f8afdf75
authored
Mar 30, 2022
by
李智书
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.新增红包领取页面;
parent
ef970ab5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
206 additions
and
1 deletion
+206
-1
src/pages.json
src/pages.json
+9
-1
src/pages/ReceiveMoney/ReceiveMoney.vue
src/pages/ReceiveMoney/ReceiveMoney.vue
+197
-0
src/static/ReceiveMoney.png
src/static/ReceiveMoney.png
+0
-0
No files found.
src/pages.json
View file @
f8afdf75
...
...
@@ -341,7 +341,15 @@
"navigationBarBackgroundColor"
:
"#01CB88"
,
"enablePullDownRefresh"
:
false
}
},
{
"path"
:
"pages/ReceiveMoney/ReceiveMoney"
,
"style"
:
{
"navigationBarTitleText"
:
"领取红包"
,
"navigationStyle"
:
"custom"
,
"enablePullDownRefresh"
:
false
}
}
],
"globalStyle"
:
{
...
...
src/pages/ReceiveMoney/ReceiveMoney.vue
0 → 100644
View file @
f8afdf75
<
template
>
<view
class=
"contaner"
>
<view
class=
"headerbox"
>
<image
src=
"../../static/ReceiveMoney.png"
mode=
"aspectFit"
></image>
</view>
<view
class=
"LoginBox"
>
<view
class=
"phon"
>
<input
type=
"number"
class=
"phonNumber"
:adjust-position=
"true"
maxlength=
"11"
v-model=
"phonNumber"
value=
""
placeholder=
"请输入手机号"
placeholder-class=
"placeholder"
/>
</view>
<view
class=
"VerificationCode"
>
<input
type=
"number"
class=
"code"
value=
""
:adjust-position=
"true"
maxlength=
"6"
v-model=
"VerificationCode"
placeholder=
"请输入验证码"
placeholder-class=
"placeholder"
/>
<view
class=
"sendBtn"
@
click=
"getVerificationCode"
>
{{
timer
?
second
+
'
s后获取
'
:
'
获取验证码
'
}}
</view>
</view>
<view
class=
"ReceiveMoney"
@
tap=
"ReceiveMoney"
>
领取红包
</view>
</view>
</view>
</
template
>
<
script
>
export
default
{
name
:
"
ReceiveMoney
"
,
data
()
{
return
{
phonNumber
:
""
,
VerificationCode
:
""
,
timer
:
null
,
second
:
3
}
},
methods
:
{
// 获取验证码
async
getVerificationCode
()
{
try
{
if
(
!
this
.
phonNumber
)
{
this
.
$toast
(
"
请输入手机号码!
"
);
return
}
if
(
this
.
timer
)
{
return
}
this
.
$toast
.
loading
({
duration
:
0
,
message
:
'
请稍后...
'
,
forbidClick
:
true
,
loadingType
:
'
spinner
'
,
});
this
.
timer
=
setInterval
(()
=>
{
this
.
second
--
;
if
(
!
this
.
second
)
{
clearInterval
(
this
.
timer
);
// 手动清除 Toast
this
.
$toast
.
clear
();
this
.
second
=
60
this
.
timer
=
null
}
},
1000
);
}
catch
(
e
)
{
//TODO handle the exception
console
.
log
(
e
);
}
},
// 验证手机号码领取红包
async
ReceiveMoney
()
{
try
{
if
(
!
this
.
phonNumber
)
{
this
.
$toast
(
"
请输入手机号码!
"
);
return
}
if
(
!
this
.
VerificationCode
)
{
this
.
$toast
(
"
请输入验证码!
"
);
return
}
this
.
$toast
.
loading
({
duration
:
3000
,
message
:
'
请稍后...
'
,
forbidClick
:
true
,
loadingType
:
'
spinner
'
,
});
await
new
Promise
((
res
,
rej
)
=>
{
setTimeout
(()
=>
{
res
()
},
3000
)
})
await
this
.
$dialog
.
alert
({
title
:
'
系统提示
'
,
message
:
'
领取成功!
'
,
theme
:
'
round-button
'
,
});
if
(
typeof
WeixinJSBridge
!==
'
undefined
'
)
{
WeixinJSBridge
.
call
(
'
closeWindow
'
);
}
else
{
window
.
opener
=
null
;
window
.
close
()
}
}
catch
(
e
)
{
//TODO handle the exception
console
.
warn
(
"
----
"
,
e
);
}
}
}
}
</
script
>
<
style
>
page
{
width
:
750
pxr
;
height
:
100vh
;
background
:
linear-gradient
(
0deg
,
#790003
0%
,
#BD000B
100%
);
position
:
relative
;
}
.headerbox
{
width
:
750
rpx
;
height
:
268
rpx
;
}
.headerbox
image
{
width
:
100%
;
height
:
100%
;
position
:
relative
;
}
.LoginBox
{
width
:
570
rpx
;
height
:
450
rpx
;
margin
:
0
auto
;
position
:
absolute
;
left
:
0
;
right
:
0
;
top
:
404
rpx
;
}
.placeholder
{
/* width: 310rpx; */
font-size
:
30
rpx
;
font-family
:
Source
Han
Sans
CN
;
font-weight
:
400
;
color
:
#999999
;
/* padding-left: 31rpx; */
}
.phonNumber
{
/* width: 570rpx; */
height
:
100
rpx
;
background
:
#FFFFFF
;
border-radius
:
8
rpx
;
padding-left
:
31
rpx
;
}
.VerificationCode
{
display
:
flex
;
justify-content
:
space-between
;
margin-top
:
50
rpx
;
}
.code
{
width
:
350
rpx
;
height
:
100
rpx
;
background
:
#FFFFFF
;
border-radius
:
8
rpx
;
padding-left
:
31
rpx
;
}
.sendBtn
{
width
:
170
rpx
;
height
:
100
rpx
;
background
:
#FFE49C
;
border-radius
:
8
rpx
;
line-height
:
100
rpx
;
text-align
:
center
;
font-size
:
28
rpx
;
font-family
:
Source
Han
Sans
CN
;
font-weight
:
400
;
color
:
#222222
;
}
.ReceiveMoney
{
width
:
570
rpx
;
height
:
100
rpx
;
background
:
#FFC948
;
border-radius
:
8
rpx
;
line-height
:
100
rpx
;
text-align
:
center
;
font-size
:
36
rpx
;
font-family
:
Source
Han
Sans
CN
;
font-weight
:
500
;
color
:
#222222
;
margin-top
:
100
rpx
;
}
</
style
>
src/static/ReceiveMoney.png
0 → 100644
View file @
f8afdf75
332 KB
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