Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
InvestCustomer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
Giang Tran
InvestCustomer
Commits
5e5c86bc
Commit
5e5c86bc
authored
May 04, 2021
by
Nguyễn Thị Thúy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update version
parent
e7ab62e4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
255 additions
and
3 deletions
+255
-3
Info.plist
ios/Invest/Info.plist
+1
-1
RootView.js
src/RootView.js
+4
-2
index.js
src/Screens/VersionChecker/index.js
+241
-0
users.js
src/apis/Functions/users.js
+5
-0
url.js
src/apis/url.js
+1
-0
images.js
src/assets/images.js
+1
-0
iconUpgrade.png
src/assets/images/iconUpgrade.png
+0
-0
en.js
src/helper/i18/locales/en.js
+0
-0
vn.js
src/helper/i18/locales/vn.js
+2
-0
No files found.
ios/Invest/Info.plist
View file @
5e5c86bc
...
...
@@ -57,7 +57,7 @@
<
k
e
y
>
NSCameraUsageDescription
<
/k
e
y
>
<
string
>
Accect
connect
camera
<
/string
>
<
k
e
y
>
NSLocationWhenInUseUsageDescription
<
/k
e
y
>
<
string
><
/string
>
<
string
/
>
<
k
e
y
>
NSPhotoLibraryUsageDescription
<
/k
e
y
>
<
string
>
To
upload
images
<
/string
>
<
k
e
y
>
UIAppFonts
<
/k
e
y
>
...
...
src/RootView.js
View file @
5e5c86bc
...
...
@@ -8,7 +8,8 @@ import {SkypeIndicator} from 'react-native-indicators';
import
{
enableScreens
}
from
'react-native-screens'
;
import
NoInternetComponent
from
'./components/NoInternet'
;
import
{
getVersion
}
from
'react-native-device-info'
;
import
DeviceInfo
from
'react-native-device-info'
;
import
VersionChecker
from
'./Screens/VersionChecker'
;
enableScreens
();
...
...
@@ -18,7 +19,7 @@ const RootView = (props) => {
},
[]);
const
checkVersion
=
(
props
)
=>
{
const
verCurrent
=
getVersion
();
const
verCurrent
=
DeviceInfo
.
getVersion
();
console
.
log
(
'version current'
,
verCurrent
);
};
...
...
@@ -31,6 +32,7 @@ const RootView = (props) => {
<
StackNavigation
/>
<
/View
>
<
VersionChecker
/>
<
NoInternetComponent
/>
<
/
>
);
...
...
src/Screens/VersionChecker/index.js
0 → 100644
View file @
5e5c86bc
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
View
,
Text
,
Modal
,
TouchableOpacity
,
StyleSheet
,
Image
,
TouchableWithoutFeedback
,
Linking
,
Platform
,
}
from
'react-native'
;
import
R
from
'../../assets/R'
;
import
{
getFontXD
,
getHeight
,
getWidth
,
HEIGHTXD
,
WIDTHXD
}
from
'../../Config/Functions'
;
import
I18n
from
'../../helper/i18/i18n'
;
import
DeviceInfo
from
'react-native-device-info'
;
import
{
getNewestVersionInfo
}
from
'../../apis/Functions/users'
;
const
VersionChecker
=
(
props
)
=>
{
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
isForceUpdate
,
setIsForceUpdate
]
=
useState
(
false
);
const
[
version
,
setVersion
]
=
useState
(
'1.0'
);
useEffect
(()
=>
{
checkVersion
();
},
[]);
const
checkVersion
=
async
()
=>
{
const
verCurrent
=
DeviceInfo
.
getVersion
();
const
res
=
await
getNewestVersionInfo
({
platform
:
Platform
.
OS
,
});
if
((
res
.
data
.
code
=
200
&&
res
.
data
.
data
))
{
console
.
log
(
res
)
if
(
res
.
data
.
data
[
0
].
version_name
!==
verCurrent
||
res
.
data
.
data
[
0
].
build
.
toString
()
!==
DeviceInfo
.
getBuildNumber
)
{
setVersion
(
res
.
data
.
data
[
0
].
version_name
)
setVisible
(
true
)
setIsForceUpdate
(
res
.
data
.
data
[
0
].
is_require_update
==
0
?
false
:
true
)
}
}
};
const
setVisibleModal
=
(
visible
,
version
,
isForceUpdate
)
=>
{
setVisible
(
visible
);
setVersion
(
version
);
setIsForceUpdate
(
isForceUpdate
);
};
const
_renderDivider
=
()
=>
<
View
style
=
{
styles
.
dividerStyle
}
/>
;
const
onOutsidePressed
=
()
=>
{
setVisible
(
false
);
};
const
onUpdatePressed
=
async
()
=>
{
try
{
if
(
Platform
.
OS
===
'ios'
)
{
Linking
.
openURL
(
'itms-apps://itunes.apple.com/us/app/id${id1556621903}?mt=8.'
);
}
else
{
}
}
catch
(
error
)
{
}
setVisible
(
false
);
};
const
onRequestClose
=
()
=>
null
;
const
renderBackdrop
=
()
=>
{
return
(
<
View
style
=
{{
backgroundColor
:
'rgba(0,0,0,0.30)'
,
// backgroundColor: 'red',
position
:
'absolute'
,
top
:
0
,
bottom
:
0
,
left
:
0
,
right
:
0
,
width
:
getWidth
(),
height
:
getHeight
(),
}}
/
>
);
};
const
cancelUpdate
=
()
=>
{
setVisible
(
false
);
};
return
(
<
Modal
onRequestClose
=
{()
=>
onRequestClose
()}
transparent
animationType
=
"fade"
style
=
{{
position
:
'absolute'
}}
visible
=
{
visible
}
>
{
renderBackdrop
()}
<
View
pointerEvents
=
"box-none"
style
=
{
styles
.
containerStyle
}
>
<
View
style
=
{
styles
.
imageUpgradeContainer
}
zIndex
=
{
100
}
>
<
Image
style
=
{[
styles
.
imageUpgradeStyle
,
{
tintColor
:
R
.
colors
.
main
}]}
/
>
<
/View
>
<
View
style
=
{
styles
.
contentContainerStyle
}
>
<
Text
style
=
{
styles
.
titleStyle
}
>
{
I18n
.
t
(
'Update'
)}
<
/Text
>
<
Text
style
=
{
styles
.
versionLabelStyle
}
>
{
I18n
.
t
(
'Version'
)}
{
': '
}
{
version
}
<
/Text
>
<
Text
style
=
{
styles
.
descStyle
}
>
{
I18n
.
t
(
'UpdateDescription'
)}
<
/Text
>
{
_renderDivider
()}
{
isForceUpdate
?
<
TouchableOpacity
onPress
=
{()
=>
onUpdatePressed
()}
style
=
{
styles
.
notNowContainerStyle
}
>
<
Text
style
=
{[
styles
.
textNotNowStyle
,
{
color
:
R
.
colors
.
main
}]}
>
{
I18n
.
t
(
'Update'
)}
<
/Text
>
<
/TouchableOpacity
>
:
<
View
style
=
{[
styles
.
notNowContainerStyle
,
{
flexDirection
:
'row'
,
marginHorizontal
:
WIDTHXD
(
100
),
}]}
>
<
TouchableOpacity
onPress
=
{()
=>
cancelUpdate
()}
style
=
{[
styles
.
btnButton
,
{
paddingRight
:
WIDTHXD
(
90
)}]}
>
<
Text
style
=
{[
styles
.
textNotNowStyle
,
{
color
:
R
.
colors
.
color777
}]}
>
{
I18n
.
t
(
'Cancel'
)}
<
/Text
>
<
/TouchableOpacity
>
<
View
style
=
{
styles
.
dividerStyleVertical
}
><
/View
>
<
TouchableOpacity
onPress
=
{()
=>
onUpdatePressed
()}
style
=
{[
styles
.
btnButton
,
{
paddingLeft
:
WIDTHXD
(
90
)}]}
>
<
Text
style
=
{[
styles
.
textNotNowStyle
,
{
color
:
R
.
colors
.
main
}]}
>
{
I18n
.
t
(
'Update'
)}
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
}
<
/View
>
<
/View
>
<
/Modal
>
);
};
const
styles
=
StyleSheet
.
create
({
imageUpgradeStyle
:
{
width
:
50
,
height
:
50
,
tintColor
:
R
.
colors
.
primaryColor
,
},
imageUpgradeContainer
:
{
width
:
80
,
height
:
80
,
borderRadius
:
40
,
backgroundColor
:
'white'
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
},
containerStyle
:
{
flex
:
1
,
width
:
getWidth
()
*
0.8
,
alignSelf
:
'center'
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
},
contentContainerStyle
:
{
marginTop
:
-
40
,
paddingTop
:
40
,
width
:
getWidth
()
*
0.9
,
backgroundColor
:
'white'
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
borderRadius
:
15
,
},
logoStyle
:
{
width
:
65
,
height
:
65
,
marginVertical
:
20
,
},
titleStyle
:
{
fontWeight
:
'600'
,
fontSize
:
20
,
color
:
'black'
,
paddingHorizontal
:
8
,
textAlign
:
'center'
,
},
versionLabelStyle
:
{
fontSize
:
14
,
color
:
R
.
colors
.
grey600
,
marginTop
:
5
,
marginBottom
:
15
,
paddingHorizontal
:
8
,
textAlign
:
'center'
,
},
descStyle
:
{
fontSize
:
getFontXD
(
46
),
color
:
R
.
colors
.
grey900
,
marginBottom
:
20
,
paddingHorizontal
:
10
,
textAlign
:
'center'
,
},
notNowContainerStyle
:
{
height
:
HEIGHTXD
(
160
),
width
:
'100%'
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
},
btnButton
:
{
flex
:
0
,
},
textNotNowStyle
:
{
fontSize
:
getFontXD
(
46
),
width
:
'100%'
,
textAlign
:
'center'
,
color
:
R
.
colors
.
primaryColor
,
},
starContainer
:
{
flexDirection
:
'row'
,
width
:
'100%'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
height
:
45
,
},
dividerStyle
:
{
height
:
0.5
,
width
:
'100%'
,
backgroundColor
:
R
.
colors
.
borderC
,
},
dividerStyleVertical
:
{
height
:
HEIGHTXD
(
160
),
width
:
0.5
,
backgroundColor
:
R
.
colors
.
borderC
,
},
});
export
default
VersionChecker
;
src/apis/Functions/users.js
View file @
5e5c86bc
...
...
@@ -56,3 +56,8 @@ export const updateLangugeApi = async (body) =>
PostData
(
url
.
urlUpdateLanguage
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
export
const
getNewestVersionInfo
=
async
(
body
)
=>
GetData
(
url
.
urlGetNewestVersionInfo
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
src/apis/url.js
View file @
5e5c86bc
...
...
@@ -37,4 +37,5 @@ export default {
urlUpdateInforUser
:
root
+
'api/v1/customers/update-general-info'
,
urlUpdateLanguage
:
root
+
'api/v1/customers/update-language'
,
urlGetNewestVersionInfo
:
root
+
'api/v1/settings/version'
,
};
src/assets/images.js
View file @
5e5c86bc
...
...
@@ -85,6 +85,7 @@ const images = {
iconHistoryMenu
:
require
(
'./images/iconHistoryMenu1.png'
),
iconProfileMenu
:
require
(
'./images/iconProfileMenu.png'
),
iconUpgrade
:
require
(
'./images/iconUpgrade.png'
),
};
export
default
images
;
src/assets/images/iconUpgrade.png
0 → 100644
View file @
5e5c86bc
4.2 KB
src/helper/i18/locales/en.js
View file @
5e5c86bc
This diff is collapsed.
Click to expand it.
src/helper/i18/locales/vn.js
View file @
5e5c86bc
...
...
@@ -220,4 +220,6 @@ export default {
Time_Transaction
:
'Thời gian GD'
,
Due_Date
:
'Lịch đáo hạn'
,
Enter_Phone
:
'Nhập số điện thoại'
,
Version
:
'Phiên bản'
,
UpdateDescription
:
'Đã có phiên bản DCVInvest mới. Cập nhật ngay để tiếp tục sử dụng và trải nghiệm những tính năng mới nhất của hệ thống!'
,
};
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