Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
肖康
/
H5_2.0
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
061d35d5
authored
May 18, 2023
by
LJM
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
js
parent
97b2617f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
96 deletions
assets/css/mine/login.scss
pages/mine/login.vue
util/util.js
assets/css/mine/login.scss
View file @
061d35d5
.page-login
{
padding
:
0
60rpx
;
padding
:
22rpx
60rpx
0
60rpx
;
background
:
linear-gradient
(
200deg
,
#d6e8ff
0%
,
#ffffff
277px
);
.icon-xxx
{
font-size
:
44rpx
;
color
:
#919399
;
margin-bottom
:
52rpx
;
display
:
block
;
}
.logo
{
width
:
170rpx
;
height
:
82rpx
;
...
...
pages/mine/login.vue
View file @
061d35d5
<
template
>
<view
class=
"page-login"
>
<text
class=
"iconfont icon-xxx"
v-back
></text>
<image
src=
"../../static/logo.png"
mode=
"aspectFill"
class=
"logo"
></image>
<view
class=
"tab"
:class=
"
{ mb40: curr == 1 }">
<text
class=
"box"
v-for=
"(item, index) in text_item"
:key=
"index"
:class=
"
{ curr: index == curr }" @click="tab(index)">
{{
item
}}
</text>
...
...
@@ -70,9 +71,9 @@
export
default
{
data
()
{
return
{
login_type
:
tru
e
,
login_type
:
fals
e
,
index
:
0
,
curr
:
0
,
curr
:
1
,
text_item
:
[
'免密登录/注册'
,
'账号登录'
],
array
:
[
'0086'
,
'00886'
,
'00853'
,
'00852'
]
};
...
...
util/util.js
View file @
061d35d5
...
...
@@ -6,7 +6,9 @@ const request = (url = '', type = 'GET', param = {}, Loading) => {
const
oa_user_id
=
uni
.
getStorageSync
(
'oa_user_id'
)
||
''
;
const
oa_skey
=
uni
.
getStorageSync
(
'oa_skey'
)
||
''
;
var
params
=
Object
.
assign
(
param
);
var
params
=
Object
.
assign
(
param
,
{
pf
:
2
});
//是否启动加载
if
(
Loading
)
{
...
...
@@ -14,10 +16,12 @@ const request = (url = '', type = 'GET', param = {}, Loading) => {
mask
:
true
});
}
let
header
=
{
const
header
=
{
"Content-Type"
:
"application/json; charset=utf-8"
,
"source"
:
'h5'
,
"source"
:
'h5'
};
return
new
Promise
((
resolve
,
reject
)
=>
{
uni
.
request
({
method
:
type
,
...
...
@@ -67,95 +71,7 @@ const getPlatform = () => {
}
/**
* 首字母转成大写
*/
const
titleCase
=
(
str
)
=>
{
str
=
str
.
toLowerCase
().
split
(
" "
).
map
(
function
(
val
)
{
return
val
.
replace
(
/
(
|^
)[
a-z
]
/g
,
function
(
L
)
{
return
L
.
toUpperCase
();
});
}).
join
(
" "
);
return
str
;
}
/**
* 时间格式化
*/
const
dateTime
=
(
str
,
time
=
''
)
=>
{
let
date
=
time
?
new
Date
(
time
)
:
new
Date
();
let
year
=
date
.
getFullYear
();
//年
let
month
=
date
.
getMonth
()
+
1
;
//月
let
day
=
date
.
getDate
();
//日
let
hour
=
date
.
getHours
()
<
10
?
"0"
+
date
.
getHours
()
:
date
.
getHours
();
//时
let
minute
=
date
.
getMinutes
()
<
10
?
date
.
getMinutes
()
:
date
.
getMinutes
();
//分
let
second
=
date
.
getSeconds
()
<
10
?
date
.
getSeconds
()
:
date
.
getSeconds
();
//秒
month
>=
1
&&
month
<=
9
?
(
month
=
"0"
+
month
)
:
""
;
day
>=
0
&&
day
<=
9
?
(
day
=
"0"
+
day
)
:
""
;
hour
>=
0
&&
hour
<=
9
?
hour
:
""
;
minute
>=
0
&&
minute
<=
9
?
(
minute
=
"0"
+
minute
)
:
""
;
second
>=
0
&&
second
<=
9
?
(
second
=
"0"
+
second
)
:
""
;
if
(
str
.
indexOf
(
'y'
)
!=
-
1
)
{
str
=
str
.
replace
(
'y'
,
year
)
}
if
(
str
.
indexOf
(
'm'
)
!=
-
1
)
{
str
=
str
.
replace
(
'm'
,
month
)
}
if
(
str
.
indexOf
(
'd'
)
!=
-
1
)
{
str
=
str
.
replace
(
'd'
,
day
)
}
if
(
str
.
indexOf
(
'h'
)
!=
-
1
)
{
str
=
str
.
replace
(
'h'
,
hour
)
}
if
(
str
.
indexOf
(
'i'
)
!=
-
1
)
{
str
=
str
.
replace
(
'i'
,
minute
)
}
if
(
str
.
indexOf
(
's'
)
!=
-
1
)
{
str
=
str
.
replace
(
's'
,
second
)
}
return
str
;
}
const
urlConversion
=
(
path
)
=>
{
let
reg
=
/^
(
https
?
:
\/\/)([
0-9a-z.
]
+
)(
:
[
0-9
]
+
)?([/
0-9a-z.
]
+
)?(\?[
0-9a-z&=
]
+
)?(
#
[
0-9-a-z
]
+
)?
/i
path
=
path
.
replace
(
reg
,
"https://$2$3$4$5$6"
);
return
path
;
}
const
getFileExt
=
(
file_url
)
=>
{
var
file_ext_name
=
""
;
if
(
file_url
)
{
if
(
file_url
.
indexOf
(
"/"
)
!=
-
1
)
{
var
file_arr
=
file_url
.
split
(
"/"
);
var
file_id
=
file_arr
.
pop
();
}
else
{
var
file_id
=
file_url
;
}
var
file_type
=
parseInt
(
file_id
.
substr
(
7
,
3
))
var
file_ext_map
=
{
"1"
:
"png"
,
"2"
:
"jpeg"
,
"3"
:
"pdf"
,
"4"
:
"text"
,
"5"
:
"xls"
,
"6"
:
"xlsx"
,
"7"
:
"doc"
,
"8"
:
"docx"
,
"9"
:
"ppt"
,
"10"
:
"zip"
,
"11"
:
"tar"
,
"12"
:
"html"
,
"13"
:
"mp4"
};
file_ext_name
=
file_ext_map
[
file_type
];
}
return
file_ext_name
;
}
module
.
exports
=
{
request
,
getPlatform
,
titleCase
,
dateTime
,
urlConversion
,
getFileExt
}
getPlatform
}
\ 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