Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
Harvey
/
ydu-lottery-shop-app
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 4c8169e6
由
Harvey
编写于
2022-04-15 18:23:24 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
注册登录
1 个父辈
fc291a8e
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
194 行增加
和
6 行删除
src/App.vue
src/common/router.js
src/manifest.json
src/pages.json
src/pages/auth/login.vue
src/pages/tv/info.vue
src/pages/tv/list.vue
src/static/js/h5-utils.js
src/App.vue
查看文件 @
4c8169e
<
script
>
<
script
>
export
default
{
export
default
{
onLaunch
:
function
()
{
onLaunch
:
function
(
e1
)
{
console
.
log
(
e1
)
console
.
log
(
'App Launch'
)
console
.
log
(
'App Launch'
)
},
},
onShow
:
function
()
{
onShow
:
function
()
{
...
@@ -14,4 +15,4 @@
...
@@ -14,4 +15,4 @@
<
style
>
<
style
>
/*每个页面公共css */
/*每个页面公共css */
</
style
>
</
style
>
src/common/router.js
查看文件 @
4c8169e
...
@@ -11,7 +11,10 @@ router.beforeEach((to, from, next) => {
...
@@ -11,7 +11,10 @@ router.beforeEach((to, from, next) => {
});
});
// 全局路由后置守卫
// 全局路由后置守卫
router
.
afterEach
((
to
,
from
)
=>
{
router
.
afterEach
((
to
,
from
)
=>
{
console
.
log
(
'跳转结束'
)
//console.log(to)
//console.log(from)
})
})
export
{
export
{
...
...
src/manifest.json
查看文件 @
4c8169e
...
@@ -81,7 +81,7 @@
...
@@ -81,7 +81,7 @@
"devServer"
:
{
"devServer"
:
{
"port"
:
80
,
"port"
:
80
,
"host"
:
"0.0.0.0"
,
"host"
:
"0.0.0.0"
,
"disableHostCheck"
:
tru
e
,
"disableHostCheck"
:
fals
e
,
"https"
:
false
,
"https"
:
false
,
"hotOnly"
:
false
,
"hotOnly"
:
false
,
"proxy"
:
{
"proxy"
:
{
...
...
src/pages.json
查看文件 @
4c8169e
...
@@ -34,6 +34,15 @@
...
@@ -34,6 +34,15 @@
"style"
:
{
"style"
:
{
"navigationStyle"
:
"default"
"navigationStyle"
:
"default"
}
}
},{
"path"
:
"pages/auth/login"
,
"aliasPath"
:
"/login"
,
"name"
:
"login"
,
"desc"
:
"登录页"
,
"style"
:
{
"navigationBarTitleText"
:
"登录/注册"
,
"navigationStyle"
:
"default"
}
}
}
],
],
"globalStyle"
:
{
"globalStyle"
:
{
...
...
src/pages/auth/login.vue
0 → 100644
查看文件 @
4c8169e
<
template
>
<view
class=
"body"
>
<text>
首次登录创建新帐号
</text>
<view
class=
"input"
>
<text>
手机号
</text>
<input
type=
"text"
v-model=
"mobile"
placeholder=
"请填写手机号"
placeholder-style=
"color:#ACACAC;"
/>
</view>
<view
class=
"input"
>
<text>
验证码
</text>
<input
type=
"text"
v-model=
"code"
placeholder-style=
"color:#ACACAC;"
placeholder=
"请填写手机验证码"
/>
<text
:class=
"'yzm '+yzm.class"
@
click=
"sendMobileCode"
>
获取验证码
{{
yzm
.
djs
}}
</text>
</view>
<button
type=
"default"
class=
"btn"
@
click=
"login"
>
下一步
</button>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
mobile
:
''
,
code
:
''
,
yzm
:
{
class
:
''
,
djs
:
''
,
setIntervalId
:
0
}
}
},
async
onLoad
()
{
//console.log(uni.$u)
},
methods
:
{
async
login
()
{
if
(
this
.
mobile
.
length
!=
11
)
{
uni
.
showToast
({
icon
:
"none"
,
icon
:
'error'
,
title
:
"手机号有误"
,
});
return
;
}
if
(
this
.
code
.
length
!=
6
)
{
uni
.
showToast
({
icon
:
"none"
,
icon
:
'error'
,
title
:
"验证码有误"
,
});
return
;
}
const
res
=
await
uni
.
$u
.
request
.
post
({
data
:
{
query
:
`mutation{ydn_sms_login(mobile:"
${
this
.
mobile
}
",code:"
${
this
.
code
}
",type:"web")}`
}
}).
then
(
a
=>
a
.
data
.
data
.
ydn_sms_login
);
if
(
res
.
Error
)
{
uni
.
showToast
({
title
:
res
.
Error
,
icon
:
'error'
,
duration
:
2000
});
return
}
console
.
log
(
res
)
},
async
sendMobileCode
()
{
var
yzm
=
this
.
yzm
if
(
yzm
.
class
==
'disabled'
)
{
uni
.
showToast
({
title
:
'请稍后再试试'
,
icon
:
'error'
,
duration
:
2000
});
return
}
yzm
.
class
=
'disabled'
const
res
=
await
uni
.
$u
.
request
.
post
({
data
:
{
query
:
`mutation{ydn_send_mobile_code(mobile:"15574985121",type:7)}`
}
}).
then
(
a
=>
a
.
data
.
data
.
ydn_send_mobile_code
);
console
.
log
(
res
)
if
(
res
.
success
==
'1'
){
uni
.
showToast
({
title
:
'验证码发送成功'
,
icon
:
'success'
,
duration
:
2000
});
}
yzm
.
setIntervalId
=
setInterval
(()
=>
{
if
(
yzm
.
djs
==
''
)
yzm
.
djs
=
60
;
else
yzm
.
djs
--
if
(
yzm
.
djs
==
0
)
{
yzm
.
djs
=
''
yzm
.
class
=
''
clearInterval
(
yzm
.
setIntervalId
)
yzm
.
setIntervalId
=
0
}
},
999
)
}
}
}
</
script
>
<
style
>
.body
{
font-family
:
Helvetica
;
font-weight
:
400
;
font-size
:
14px
;
color
:
#333333
;
padding
:
20px
;
margin-top
:
30px
;
}
.input
{
display
:
flex
;
margin
:
30px
0
;
padding
:
5px
0
;
border-bottom
:
solid
1px
#ACACAC
;
}
.input
input
{
margin-left
:
20px
;
color
:
#909399
;
}
.input
.yzm
{
color
:
#4F6FD9
;
}
.input
.disabled
{
color
:
rgb
(
204
,
204
,
204
)
!important
;
}
.btn
{
height
:
44px
;
margin-top
:
30px
;
background-color
:
#D23338
;
color
:
#FFFFFF
;
}
</
style
>
src/pages/tv/info.vue
查看文件 @
4c8169e
...
@@ -34,6 +34,8 @@
...
@@ -34,6 +34,8 @@
//#ifdef H5
//#ifdef H5
$h5
.
head_tv
(
this
.
src
)
$h5
.
head_tv
(
this
.
src
)
var
hs
=
$h5
.
getHeaders
()
console
.
log
(
hs
)
//#endif
//#endif
},
},
methods
:
{
methods
:
{
...
...
src/pages/tv/list.vue
查看文件 @
4c8169e
...
@@ -37,6 +37,11 @@
...
@@ -37,6 +37,11 @@
}
}
},
},
async
onLoad
()
{
async
onLoad
()
{
console
.
log
(
window
.
document
.
cookie
)
const
res
=
await
uni
.
$u
.
request
.
post
({
const
res
=
await
uni
.
$u
.
request
.
post
({
data
:
{
data
:
{
query
:
`query{lottery_shop_get_posters(module_id:0)}`
query
:
`query{lottery_shop_get_posters(module_id:0)}`
...
@@ -64,7 +69,7 @@
...
@@ -64,7 +69,7 @@
})
})
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'/tv/info'
,
url
:
'/tv/info
?zq=zq
'
,
});
});
}
}
}
}
...
...
src/static/js/h5-utils.js
查看文件 @
4c8169e
import
$
from
'@/static/js/jquery-3.3.1.min.js'
import
$
from
'@/static/js/jquery-3.3.1.min.js'
export
function
go_android_login
()
{
export
function
go_android_login
()
{
...
@@ -8,3 +7,22 @@ export function go_android_login() {
...
@@ -8,3 +7,22 @@ export function go_android_login() {
export
function
head_tv
(
url
)
{
export
function
head_tv
(
url
)
{
$
(
".uni-page-head"
).
eq
(
0
).
append
(
`<div onclick="Android.access2Tv('
${
url
}
')" style='font-size:12px;padding:0 5px;margin-right: 8px;height:24px;line-height:24px;margin-top: 3px;background-color: #007AFF;color:#FFFFFF;border-radius:5px;'>TV 投屏</div>`
)
$
(
".uni-page-head"
).
eq
(
0
).
append
(
`<div onclick="Android.access2Tv('
${
url
}
')" style='font-size:12px;padding:0 5px;margin-right: 8px;height:24px;line-height:24px;margin-top: 3px;background-color: #007AFF;color:#FFFFFF;border-radius:5px;'>TV 投屏</div>`
)
}
}
export
function
getHeaders
()
{
var
req
=
new
XMLHttpRequest
();
req
.
open
(
'GET'
,
document
.
location
.
href
,
false
);
req
.
send
(
null
);
var
headerArr
=
req
.
getAllResponseHeaders
().
split
(
'\r\n'
);
var
headers
=
{};
headerArr
.
forEach
(
item
=>
{
if
(
item
!==
''
)
{
var
index
=
item
.
indexOf
(
':'
);
var
key
=
item
.
slice
(
0
,
index
);
var
value
=
item
.
slice
(
index
+
1
).
trim
();
headers
[
key
]
=
value
}
});
return
headers
}
\ No newline at end of file
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论