Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gaohuaxue-mobile-app
Project
Project
Details
Activity
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
前端-苏志权
gaohuaxue-mobile-app
Commits
a13b30a6
Commit
a13b30a6
authored
Nov 24, 2022
by
郑云峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 格式化代码
parent
37904497
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
190 additions
and
167 deletions
+190
-167
Item.tsx
src/components/Cell/Item.tsx
+8
-4
index.tsx
src/components/ImageBox/index.tsx
+49
-32
styles.ts
src/components/ImageBox/styles.ts
+2
-2
index.tsx
src/components/LazyImage/index.tsx
+4
-7
index.tsx
src/components/Loading/index.tsx
+1
-6
index.tsx
src/components/NoticeBar/index.tsx
+1
-5
index.tsx
src/components/Search/index.tsx
+10
-14
index.ts
src/constants/global/index.ts
+28
-20
index.ts
src/locales/en_US/index.ts
+1
-1
index.ts
src/locales/index.ts
+11
-11
index.ts
src/locales/ko_KR/index.ts
+1
-1
index.ts
src/locales/zh_CN/index.ts
+1
-1
routers.ts
src/routers/routers.ts
+1
-1
cryptoAes.ts
src/utils/cryptoAes.ts
+12
-6
index.tsx
src/views/Login/index.tsx
+57
-54
styles.ts
src/views/Login/styles.ts
+3
-2
No files found.
src/components/Cell/Item.tsx
View file @
a13b30a6
...
...
@@ -6,7 +6,13 @@
* @Description: CellItem 组件
*/
import
React
from
'react'
;
import
{
View
,
Text
,
TouchableOpacity
,
ViewStyle
,
TextStyle
}
from
'react-native'
;
import
{
View
,
Text
,
TouchableOpacity
,
ViewStyle
,
TextStyle
,
}
from
'react-native'
;
import
{
useTheme
}
from
'@react-navigation/native'
;
import
useAppStyle
from
'../../hooks/useAppStyle'
;
import
{
ThemeStyle
}
from
'../../constants/theme'
;
...
...
@@ -158,9 +164,7 @@ const CellItem: React.FC<CellItemProps> = (props: CellItemProps) => {
) : (
customIcon
)} */
}
{
!
customIcon
?
null
:
(
customIcon
)
}
{
!
customIcon
?
null
:
customIcon
}
</
View
>
)
:
null
}
<
View
style=
{
myStyle
[
'list-item-titleWrap'
]
}
>
{
renderTitle
()
}
</
View
>
...
...
src/components/ImageBox/index.tsx
View file @
a13b30a6
import
React
,
{
useState
}
from
'react'
import
{
View
,
ViewStyle
,
Modal
,
TouchableOpacity
,
GestureResponderEvent
,
ImageResizeMode
}
from
'react-native'
import
ImageViewer
from
'react-native-image-zoom-viewer'
import
{
IImageInfo
}
from
'react-native-image-zoom-viewer/built/image-viewer.type'
import
LazyImage
from
'../LazyImage'
import
defaultImg
from
'../../../assets/images/default_img.png'
import
styles
from
'./styles'
import
React
,
{
useState
}
from
'react'
;
import
{
View
,
ViewStyle
,
Modal
,
TouchableOpacity
,
GestureResponderEvent
,
ImageResizeMode
,
}
from
'react-native'
;
import
ImageViewer
from
'react-native-image-zoom-viewer'
;
import
{
IImageInfo
}
from
'react-native-image-zoom-viewer/built/image-viewer.type'
;
import
LazyImage
from
'../LazyImage'
;
import
defaultImg
from
'../../../assets/images/default_img.png'
;
import
styles
from
'./styles'
;
interface
ImageBoxPropsType
{
width
?:
number
|
string
;
...
...
@@ -12,14 +19,23 @@ interface ImageBoxPropsType {
source
:
string
;
style
?:
ViewStyle
;
resizeMode
?:
ImageResizeMode
;
borderRadius
?:
number
,
canPreview
?:
boolean
,
onPress
?:
((
event
:
GestureResponderEvent
)
=>
void
)
|
undefined
borderRadius
?:
number
;
canPreview
?:
boolean
;
onPress
?:
((
event
:
GestureResponderEvent
)
=>
void
)
|
undefined
;
}
const
ImageBox
=
(
props
:
ImageBoxPropsType
)
=>
{
const
{
width
,
height
,
source
=
""
,
style
,
borderRadius
,
resizeMode
=
'contain'
,
canPreview
,
onPress
}
=
props
const
[
previewVisible
,
setPreviewVisible
]
=
useState
<
boolean
>
(
false
)
const
{
width
,
height
,
source
=
''
,
style
,
borderRadius
,
resizeMode
=
'contain'
,
canPreview
,
onPress
,
}
=
props
;
const
[
previewVisible
,
setPreviewVisible
]
=
useState
<
boolean
>
(
false
);
const
showImgBg
=
()
=>
{
if
(
canPreview
&&
onPress
)
{
...
...
@@ -29,9 +45,9 @@ const ImageBox = (props: ImageBoxPropsType) => {
style=
{
{
width
,
height
,
borderRadius
,
overflow
:
'hidden'
}
}
onPress=
{
(
e
:
GestureResponderEvent
)
=>
{
if
(
canPreview
)
{
setPreviewVisible
(
true
)
setPreviewVisible
(
true
)
;
}
else
if
(
onPress
)
{
onPress
(
e
)
onPress
(
e
)
;
}
}
}
>
...
...
@@ -42,7 +58,7 @@ const ImageBox = (props: ImageBoxPropsType) => {
resizeMode=
{
resizeMode
}
/>
</
TouchableOpacity
>
)
)
;
}
return
(
<
LazyImage
...
...
@@ -51,45 +67,46 @@ const ImageBox = (props: ImageBoxPropsType) => {
style=
{
{
width
,
height
,
borderRadius
,
overflow
:
'hidden'
}
}
resizeMode=
{
resizeMode
}
/>
)
}
)
;
}
;
return
(
<
View
style=
{
[
styles
.
imageBox
,
style
]
}
>
{
s
ource
?
s
howImgBg
()
:
(
{
source
?
(
showImgBg
()
)
:
(
<
LazyImage
thumbnailSource=
{
defaultImg
}
fullSource=
{
{
uri
:
source
}
}
style=
{
{
width
,
height
,
borderRadius
,
overflow
:
'hidden'
}
}
resizeMode=
{
resizeMode
}
/>
)
}
{
canPreview
&&
(
)
}
{
canPreview
&&
(
<
Modal
visible=
{
previewVisible
}
onRequestClose=
{
()
=>
setPreviewVisible
(
false
)
}
transparent
>
<
ImageViewer
imageUrls=
{
[{
url
:
source
}]
as
unknown
as
IImageInfo
[]
}
index=
{
0
}
onClick=
{
()
=>
setPreviewVisible
(
false
)
}
/>
<
ImageViewer
imageUrls=
{
[{
url
:
source
}]
as
unknown
as
IImageInfo
[]
}
index=
{
0
}
onClick=
{
()
=>
setPreviewVisible
(
false
)
}
/>
</
Modal
>
)
}
)
}
</
View
>
)
}
)
;
}
;
ImageBox
.
defaultProps
=
{
width
:
106
,
height
:
106
,
style
:
{},
resizeMode
:
"cover"
,
resizeMode
:
'cover'
,
borderRadius
:
4
,
canPreview
:
false
,
onPress
:
undefined
,
}
}
;
export
default
ImageBox
export
default
ImageBox
;
src/components/ImageBox/styles.ts
View file @
a13b30a6
import
{
StyleSheet
}
from
'react-native'
import
{
StyleSheet
}
from
'react-native'
;
export
default
StyleSheet
.
create
({
imageBox
:
{
overflow
:
'hidden'
,
},
})
})
;
src/components/LazyImage/index.tsx
View file @
a13b30a6
...
...
@@ -6,7 +6,7 @@ import {
Animated
,
ImageResizeMode
,
}
from
'react-native'
;
import
defaultImg
from
'../../../assets/images/default_img.png'
import
defaultImg
from
'../../../assets/images/default_img.png'
;
interface
LazyImageProps
{
thumbnailSource
:
any
;
...
...
@@ -25,7 +25,7 @@ const styles = StyleSheet.create({
},
});
const
LazyImage
:
React
.
FC
<
LazyImageProps
>
=
(
props
)
=>
{
const
LazyImage
:
React
.
FC
<
LazyImageProps
>
=
props
=>
{
const
{
thumbnailSource
,
fullSource
,
style
,
resizeMode
}
=
props
;
const
opacity
=
useRef
(
new
Animated
.
Value
(
0
)).
current
;
...
...
@@ -39,8 +39,7 @@ const LazyImage: React.FC<LazyImageProps> = (props) => {
return
(
<
View
style=
{
style
}
>
{
fullSource
.
uri
?
(
{
fullSource
.
uri
?
(
<
Animated
.
Image
source=
{
fullSource
}
defaultSource=
{
thumbnailSource
}
...
...
@@ -65,9 +64,7 @@ const LazyImage: React.FC<LazyImageProps> = (props) => {
resizeMode=
{
resizeMode
}
onLoad=
{
onImageLoad
}
/>
)
}
)
}
</
View
>
);
};
...
...
src/components/Loading/index.tsx
View file @
a13b30a6
...
...
@@ -6,12 +6,7 @@
* @Description: 加载组件
*/
import
React
from
'react'
;
import
{
StyleSheet
,
ViewStyle
,
View
,
Text
,
}
from
'react-native'
;
import
{
StyleSheet
,
ViewStyle
,
View
,
Text
}
from
'react-native'
;
import
useAppStyle
from
'../../hooks/useAppStyle'
;
import
Spin
from
'./Spin'
;
import
styles
from
'./styles'
;
...
...
src/components/NoticeBar/index.tsx
View file @
a13b30a6
...
...
@@ -231,11 +231,7 @@ const NoticeBar: React.FC<NoticeBarProps> = (props: NoticeBarProps) => {
</
View
>
<
View
style=
{
[
myStyle
[
'boticeBar-content'
]]
}
>
{
renderContent
()
}
</
View
>
{
hasArrow
?
(
<
TouchableOpacity
style=
{
[
myStyle
[
'boticeBar-action'
],
]
}
>
<
TouchableOpacity
style=
{
[
myStyle
[
'boticeBar-action'
]]
}
>
{
/* <Icons
size={16}
// eslint-disable-next-line no-nested-ternary
...
...
src/components/Search/index.tsx
View file @
a13b30a6
...
...
@@ -191,6 +191,7 @@ const Search: React.FC<SearchProps> = React.forwardRef(
inputRef
.
current
!
.
blur
();
},
}),
// eslint-disable-next-line react-hooks/exhaustive-deps, array-bracket-spacing
[
inputRef
.
current
],
);
...
...
@@ -212,10 +213,8 @@ const Search: React.FC<SearchProps> = React.forwardRef(
shape
===
'round'
?
myStyle
[
'search-content__round'
]
:
null
,
])
}
>
{
!!
label
&&
(
<
Text
style=
{
myStyle
[
'search-label'
]
}
>
{
label
}
</
Text
>
)
}
<
View
style=
{
[
myStyle
[
'search-control'
]]
}
>
{
!!
label
&&
<
Text
style=
{
myStyle
[
'search-label'
]
}
>
{
label
}
</
Text
>
}
<
View
style=
{
myStyle
[
'search-control'
]
}
>
{
/* {!customLeftIcon ? (
<Icons
type="feather"
...
...
@@ -227,12 +226,8 @@ const Search: React.FC<SearchProps> = React.forwardRef(
) : (
customLeftIcon
)} */
}
{
!
customLeftIcon
?
null
:
(
customLeftIcon
)
}
<
View
style=
{
myStyle
[
'search-field-wrap'
]
}
>
{
!
customLeftIcon
?
null
:
customLeftIcon
}
<
View
style=
{
myStyle
[
'search-field-wrap'
]
}
>
<
TextInput
ref=
{
inputRef
}
value=
{
value
}
...
...
@@ -248,15 +243,15 @@ const Search: React.FC<SearchProps> = React.forwardRef(
style=
{
StyleSheet
.
flatten
([
myStyle
[
'search-field'
],
{
paddingRight
:
!
clearable
?
themeLayout
[
'padding-xs'
]
:
themeLayout
[
'padding-xs'
]
+
18
,
paddingRight
:
!
clearable
?
themeLayout
[
'padding-xs'
]
:
themeLayout
[
'padding-xs'
]
+
18
,
},
])
}
/>
{
/* 为了解决 ios 点击 Input 不会触发父级点击事件的问题 */
}
{
!
editable
?
(
<
View
style=
{
myStyle
[
'search-field-placeholder'
]
}
/>
<
View
style=
{
myStyle
[
'search-field-placeholder'
]
}
/>
)
:
null
}
</
View
>
{
clearable
&&
value
.
length
>
0
&&
(
...
...
@@ -273,6 +268,7 @@ const Search: React.FC<SearchProps> = React.forwardRef(
</
TouchableOpacity
>
)
}
</
View
>
</
View
>
{
!!
showAction
&&
(
!
customAction
?
(
<
TouchableOpacity
activeOpacity=
{
0.8
}
onPress=
{
handleCancel
}
>
...
...
src/constants/global/index.ts
View file @
a13b30a6
...
...
@@ -4,43 +4,51 @@
* **********
*/
import
SELF_CONFIG
from
'../../../base.config.json'
import
{
RootObject
}
from
'./global'
import
SELF_CONFIG
from
'../../../base.config.json'
;
import
{
RootObject
}
from
'./global'
;
interface
newRootObject
extends
RootObject
{
appMallInfo
:
any
,
pointMallId
:
number
|
undefined
,
channelPointMallId
:
number
|
undefined
,
pointMallInfo
:
any
,
channelPointMallInfo
:
any
,
appMallInfo
:
any
;
pointMallId
:
number
|
undefined
;
channelPointMallId
:
number
|
undefined
;
pointMallInfo
:
any
;
channelPointMallInfo
:
any
;
}
export
const
checkUrl
=
(
url
:
any
,
defaultUrl
:
any
)
=>
{
if
(
url
&&
typeof
url
===
'string'
)
{
if
(
url
.
indexOf
(
'/'
)
>
-
1
)
{
return
url
.
trim
()
return
url
.
trim
()
;
}
return
`/
${
url
}
`
.
trim
()
return
`/
${
url
}
`
.
trim
()
;
}
return
defaultUrl
}
return
defaultUrl
;
}
;
const
appMallInfo
=
SELF_CONFIG
.
web
.
shopInfo
.
filter
(
item
=>
item
.
environment
===
4
&&
item
.
type
===
1
)[
0
]
// app企业商城
const
appMallInfo
=
SELF_CONFIG
.
web
.
shopInfo
.
filter
(
item
=>
item
.
environment
===
4
&&
item
.
type
===
1
,
)[
0
];
// app企业商城
const
pointMallInfo
=
SELF_CONFIG
.
web
.
shopInfo
.
filter
(
item
=>
item
.
environment
===
4
&&
item
.
type
===
2
)[
0
]
// app积分商城
const
pointMallInfo
=
SELF_CONFIG
.
web
.
shopInfo
.
filter
(
item
=>
item
.
environment
===
4
&&
item
.
type
===
2
,
)[
0
];
// app积分商城
const
channelPointMallInfo
=
SELF_CONFIG
.
web
.
shopInfo
.
filter
(
item
=>
item
.
environment
===
4
&&
item
.
type
===
5
)[
0
]
// app渠道积分商城
const
channelPointMallInfo
=
SELF_CONFIG
.
web
.
shopInfo
.
filter
(
item
=>
item
.
environment
===
4
&&
item
.
type
===
5
,
)[
0
];
// app渠道积分商城
//@ts-ignore
SELF_CONFIG
.
appMallInfo
=
appMallInfo
// app企业商城信息
SELF_CONFIG
.
appMallInfo
=
appMallInfo
;
// app企业商城信息
//@ts-ignore
SELF_CONFIG
.
pointMallId
=
pointMallInfo
?
pointMallInfo
.
id
:
undefined
SELF_CONFIG
.
pointMallId
=
pointMallInfo
?
pointMallInfo
.
id
:
undefined
;
//@ts-ignore
SELF_CONFIG
.
channelPointMallId
=
channelPointMallInfo
?
channelPointMallInfo
.
id
:
undefined
SELF_CONFIG
.
channelPointMallId
=
channelPointMallInfo
?
channelPointMallInfo
.
id
:
undefined
;
//@ts-ignore
SELF_CONFIG
.
pointMallInfo
=
pointMallInfo
SELF_CONFIG
.
pointMallInfo
=
pointMallInfo
;
//@ts-ignore
SELF_CONFIG
.
channelPointMallInfo
=
channelPointMallInfo
SELF_CONFIG
.
channelPointMallInfo
=
channelPointMallInfo
;
//@ts-ignore
export
const
GlobalConfig
:
newRootObject
=
SELF_CONFIG
export
const
GlobalConfig
:
newRootObject
=
SELF_CONFIG
;
src/locales/en_US/index.ts
View file @
a13b30a6
export
default
{}
export
default
{}
;
src/locales/index.ts
View file @
a13b30a6
...
...
@@ -8,24 +8,24 @@ import en_US from './en_US';
import
ko_KR
from
'./ko_KR'
;
const
localeResource
:
{
"zh-CN"
:
any
,
"en-US"
:
any
,
"ko-KR"
:
any
,
'zh-CN'
:
any
;
'en-US'
:
any
;
'ko-KR'
:
any
;
}
=
{
"zh-CN"
:
zh_CN
,
"en-US"
:
en_US
,
"ko-KR"
:
ko_KR
,
}
'zh-CN'
:
zh_CN
,
'en-US'
:
en_US
,
'ko-KR'
:
ko_KR
,
}
;
type
Language
=
keyof
typeof
localeResource
;
const
LANGUAGE
:
Language
=
(
env
.
LANGUAGE
??
'zh-CN'
)
as
Language
const
LANGUAGE
:
Language
=
(
env
.
LANGUAGE
??
'zh-CN'
)
as
Language
;
const
languageDetector
=
{
type
:
'languageDetector'
,
async
:
true
,
detect
:
(
cb
:
any
)
=>
cb
(
LANGUAGE
),
init
:
()
=>
{
},
cacheUserLanguage
:
()
=>
{
},
init
:
()
=>
{},
cacheUserLanguage
:
()
=>
{},
};
i18n
...
...
@@ -37,4 +37,4 @@ i18n
resources
:
localeResource
,
});
export
default
i18n
export
default
i18n
;
src/locales/ko_KR/index.ts
View file @
a13b30a6
export
default
{}
export
default
{}
;
src/locales/zh_CN/index.ts
View file @
a13b30a6
export
default
{}
export
default
{}
;
src/routers/routers.ts
View file @
a13b30a6
...
...
@@ -17,7 +17,7 @@ export const ROUTERS = {
Login
:
{
title
:
'登入'
,
component
:
Login
,
headerShown
:
true
headerShown
:
true
,
},
AccountInfo
:
{
title
:
'账号信息'
,
...
...
src/utils/cryptoAes.ts
View file @
a13b30a6
...
...
@@ -8,9 +8,12 @@ const key = CryptoJS.enc.Utf8.parse('GzSsyLingxi2.0.0');
export
const
encryptedByAES
=
(
source
:
string
)
=>
{
const
password
=
CryptoJS
.
enc
.
Utf8
.
parse
(
source
);
// @ts-ignore
const
encrypted
=
CryptoJS
.
AES
.
encrypt
(
password
,
key
,
{
mode
:
CryptoJS
.
mode
.
ECB
,
padding
:
CryptoJS
.
pad
.
Pkcs7
})
// CryptoJS.pad.Pkcs7
return
encrypted
.
toString
()
// 加密后的base64
}
const
encrypted
=
CryptoJS
.
AES
.
encrypt
(
password
,
key
,
{
mode
:
CryptoJS
.
mode
.
ECB
,
padding
:
CryptoJS
.
pad
.
Pkcs7
,
});
// CryptoJS.pad.Pkcs7
return
encrypted
.
toString
();
// 加密后的base64
};
/**
* @auth xjm
...
...
@@ -18,6 +21,9 @@ export const encryptedByAES = (source: string) => {
*/
export
const
decryptedByAES
=
(
source
:
string
)
=>
{
// @ts-ignore
const
decrypted
=
CryptoJS
.
AES
.
decrypt
(
source
,
key
,
{
mode
:
CryptoJS
.
mode
.
ECB
,
padding
:
CryptoJS
.
pad
.
Pkcs7
});
// CryptoJS.pad.Pkcs7
return
decrypted
.
toString
(
CryptoJS
.
enc
.
Utf8
)
// 解密后的原始字符串
}
const
decrypted
=
CryptoJS
.
AES
.
decrypt
(
source
,
key
,
{
mode
:
CryptoJS
.
mode
.
ECB
,
padding
:
CryptoJS
.
pad
.
Pkcs7
,
});
// CryptoJS.pad.Pkcs7
return
decrypted
.
toString
(
CryptoJS
.
enc
.
Utf8
);
// 解密后的原始字符串
};
src/views/Login/index.tsx
View file @
a13b30a6
...
...
@@ -2,14 +2,14 @@ import React, { useEffect, useState } from 'react';
import
{
View
,
Text
,
Image
}
from
'react-native'
;
// import { Text, Image, Toast } from '@linkseeks/god-mobile';
// import ModeMobile from '@/components/Modemobile';
import
{
setAsyncStorage
}
from
'../../utils/storage'
import
{
encryptedByAES
,
decryptedByAES
}
from
'../../utils/cryptoAes'
import
{
setAsyncStorage
}
from
'../../utils/storage'
;
import
{
encryptedByAES
,
decryptedByAES
}
from
'../../utils/cryptoAes'
;
import
useStores
from
'../../store/useStores'
;
import
{
postMemberMobileWechatAppletLoginPhone
,
postMemberMobileWechatAppletLoginAccount
}
from
'../../services/MemberV2Api'
import
{
getManageContentNoticeFindWithOutContent
}
from
'../../services/ManageV2Api'
postMemberMobileWechatAppletLoginAccount
,
}
from
'../../services/MemberV2Api'
;
import
{
getManageContentNoticeFindWithOutContent
}
from
'../../services/ManageV2Api'
;
import
useAppStyle
from
'../../hooks/useAppStyle'
;
import
zhongranLogo
from
'../../../assets/images/zhongran_logo.png'
;
import
ImageBox
from
'../../components/ImageBox'
;
...
...
@@ -18,14 +18,11 @@ import ImageBox from '../../components/ImageBox';
import
styles
from
'./styles'
;
const
Login
=
()
=>
{
const
LoginTypeText
=
[
'密码登录'
,
'手机号码登录'
,
]
const
[
current
,
setcurrent
]
=
useState
(
0
)
// 0 是账号密码登录
const
LoginTypeText
=
[
'密码登录'
,
'手机号码登录'
];
const
[
current
,
setcurrent
]
=
useState
(
0
);
// 0 是账号密码登录
const
{
userStore
}
=
useStores
();
const
[
toggle
,
settoggle
]
=
useState
<
boolean
>
(
false
)
// 显示手机号模态框
const
[
countryCode
,
setCode
]
=
useState
(
'+86'
)
// 手机区号
const
[
toggle
,
settoggle
]
=
useState
<
boolean
>
(
false
)
;
// 显示手机号模态框
const
[
countryCode
,
setCode
]
=
useState
(
'+86'
)
;
// 手机区号
const
[
phoneLength
,
setphoneLength
]
=
useState
(
11
);
// 手机号码长度
const
[
select
,
setSelect
]
=
useState
(
false
);
// 设置协议选中
const
[
columnTypeList
,
setColumnTypeList
]
=
useState
<
any
>
([]);
// 协议数据
...
...
@@ -45,7 +42,10 @@ const Login = () => {
const
onSubmit
=
async
(
data
:
any
)
=>
{
if
(
!
select
)
{
Toast
.
show
({
title
:
i18n
.
t
(
'user:user.login.agreement.tips'
,
'请阅读并同意相关协议'
),
icon
:
'none'
});
Toast
.
show
({
title
:
i18n
.
t
(
'user:user.login.agreement.tips'
,
'请阅读并同意相关协议'
),
icon
:
'none'
,
});
return
;
}
let
fn
:
Function
|
null
=
null
;
...
...
@@ -53,81 +53,81 @@ const Login = () => {
switch
(
current
)
{
case
1
:
fn
=
postMemberMobileWechatAppletLoginPhone
fn
=
postMemberMobileWechatAppletLoginPhone
;
break
;
default
:
fn
=
postMemberMobileWechatAppletLoginAccount
fn
=
postMemberMobileWechatAppletLoginAccount
;
obj
.
account
=
data
.
account
;
obj
.
password
=
encryptedByAES
(
data
.
password
)
obj
.
password
=
encryptedByAES
(
data
.
password
)
;
obj
.
shopType
=
data
.
shopType
;
break
;
}
fn
?.(
current
==
1
?
data
:
obj
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setAsyncStorage
(
'USER_INFO'
,
res
.
data
)
userStore
.
setUserInfo
(
res
.
data
)
Router
.
reLaunch
(
'root/home'
)
return
setAsyncStorage
(
'USER_INFO'
,
res
.
data
)
;
userStore
.
setUserInfo
(
res
.
data
)
;
Router
.
reLaunch
(
'root/home'
)
;
return
;
}
else
{
if
(
current
==
1
)
{
obj
.
password
=
decryptedByAES
(
obj
.
password
)
obj
.
password
=
decryptedByAES
(
obj
.
password
)
;
}
Toast
.
show
({
title
:
res
.
message
,
icon
:
'none'
});
return
}
})
return
;
}
});
};
const
Confirm
=
(
flag
)
=>
{
const
Confirm
=
flag
=>
{
settoggle
(
flag
);
}
}
;
const
findAllByColumnType
=
async
()
=>
{
const
{
code
,
data
,
message
}
=
await
getManageContentNoticeFindWithOutContent
({
columnType
:
"2"
})
const
{
code
,
data
,
message
}
=
await
getManageContentNoticeFindWithOutContent
({
columnType
:
'2'
});
if
(
code
===
1000
)
{
setColumnTypeList
(
data
)
setColumnTypeList
(
data
)
;
}
else
{
Taro
.
showToast
({
title
:
message
,
icon
:
'none'
});
}
}
}
;
const
webView
=
(
item
:
any
)
=>
{
Router
.
navigateTo
(
'root/richtext'
,
{
id
:
item
.
id
,
type
:
'sign'
})
}
Router
.
navigateTo
(
'root/richtext'
,
{
id
:
item
.
id
,
type
:
'sign'
})
;
}
;
useEffect
(()
=>
{
findAllByColumnType
()
},
[])
findAllByColumnType
()
;
},
[])
;
/* 选择区号回调 */
const
onConfirm
=
(
item
)
=>
{
setCode
(
item
.
code
)
setphoneLength
(
item
.
phoneLength
)
const
onConfirm
=
item
=>
{
setCode
(
item
.
code
)
;
setphoneLength
(
item
.
phoneLength
)
;
settoggle
(
false
);
}
}
;
/* 关闭 */
const
onClose
=
(
item
)
=>
{
const
onClose
=
item
=>
{
settoggle
(
item
.
toggle
);
}
}
;
return
(
<
View
style=
{
myStyle
[
'container'
]
}
>
<
View
style=
{
myStyle
[
'head'
]
}
>
<
Image
source=
{
zhongranLogo
}
style=
{
myStyle
[
'logo'
]
}
/>
<
Text
style=
{
myStyle
[
'logoTitle'
]
}
>
欢迎来到慧售卖
</
Text
>
<
Text
style=
{
myStyle
[
'logoTitle'
]
}
>
欢迎来到慧售卖
</
Text
>
</
View
>
{
/* 登录方式 */
}
<
View
style=
{
myStyle
.
loginType
}
>
{
LoginTypeText
.
map
((
item
:
any
,
index
:
number
)
=>
(
{
LoginTypeText
.
map
((
item
:
any
,
index
:
number
)
=>
(
<
View
key=
{
index
}
style=
{
myStyle
[
'loginType-item'
]
}
>
<
Text
key=
{
index
}
style=
{
[
myStyle
[
'loginType-item-text'
],
index
==
current
?
myStyle
[
'loginType-item-text__ative'
]
:
undefined
,
index
==
current
?
myStyle
[
'loginType-item-text__ative'
]
:
undefined
,
]
}
onPress=
{
()
=>
setcurrent
(
index
)
}
>
...
...
@@ -137,8 +137,7 @@ const Login = () => {
<
View
style=
{
myStyle
[
'loginType-item-line'
]
}
/>
)
:
null
}
</
View
>
))
}
))
}
</
View
>
{
/* {renderComponentByType()} */
}
...
...
@@ -149,14 +148,18 @@ const Login = () => {
{
/* <Image src={select ? require('@/assets/images/Checked-@2x.png') : require('@/assets/images/Default@2x.png')} onClick={() => setSelect(!select)} /> */
}
<
View
style=
{
myStyle
[
'sign-signFlex'
]
}
>
<
Text
style=
{
myStyle
[
'sign-signText'
]
}
>
阅读并同意
</
Text
>
{
columnTypeList
.
map
((
items
:
any
)
=>
(
<
Text
key=
{
items
.
id
}
style=
{
myStyle
[
'sign-signRight'
]
}
onPress=
{
()
=>
webView
(
items
)
}
>
《
{
items
.
title
}
》
</
Text
>
))
}
{
columnTypeList
.
map
((
items
:
any
)
=>
(
<
Text
key=
{
items
.
id
}
style=
{
myStyle
[
'sign-signRight'
]
}
onPress=
{
()
=>
webView
(
items
)
}
>
《
{
items
.
title
}
》
{
' '
}
</
Text
>
))
}
</
View
>
</
View
>
</
View
>
)
}
)
;
}
;
export
default
Login
;
src/views/Login/styles.ts
View file @
a13b30a6
...
...
@@ -2,7 +2,8 @@ import { StyleSheet } from 'react-native';
import
{
ThemeStyle
}
from
'../../constants/theme'
;
import
themeLayout
from
'../../constants/theme/layout'
;
export
default
(
theme
:
ThemeStyle
)
=>
StyleSheet
.
create
({
export
default
(
theme
:
ThemeStyle
)
=>
StyleSheet
.
create
({
container
:
{
flex
:
1
,
justifyContent
:
'center'
,
...
...
@@ -124,4 +125,4 @@ export default (theme: ThemeStyle) => StyleSheet.create({
color
:
'#fff'
,
paddingVertical
:
10
,
},
});
});
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