react-native-timacare 2.0.10 → 2.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/lib/commonjs/index.js +1 -1
  2. package/lib/commonjs/index.js.flow +2 -0
  3. package/lib/commonjs/index.js.map +1 -1
  4. package/lib/commonjs/navigation/primary-navigator.js +1 -1
  5. package/lib/commonjs/navigation/primary-navigator.js.flow +6 -0
  6. package/lib/commonjs/navigation/primary-navigator.js.map +1 -1
  7. package/lib/commonjs/screens/camera/index.js +1 -1
  8. package/lib/commonjs/screens/camera/index.js.flow +1 -1
  9. package/lib/commonjs/screens/camera/index.js.map +1 -1
  10. package/lib/commonjs/screens/eSign/PreviewContract.js +2 -0
  11. package/lib/commonjs/screens/eSign/PreviewContract.js.flow +76 -0
  12. package/lib/commonjs/screens/eSign/PreviewContract.js.map +1 -0
  13. package/lib/commonjs/screens/eSign/Store.js +1 -1
  14. package/lib/commonjs/screens/eSign/Store.js.flow +22 -1
  15. package/lib/commonjs/screens/eSign/Store.js.map +1 -1
  16. package/lib/commonjs/screens/eSign/index.js +1 -1
  17. package/lib/commonjs/screens/eSign/index.js.flow +281 -181
  18. package/lib/commonjs/screens/eSign/index.js.map +1 -1
  19. package/lib/commonjs/screens/home/index.js +1 -1
  20. package/lib/commonjs/screens/home/index.js.flow +1 -9
  21. package/lib/commonjs/screens/home/index.js.map +1 -1
  22. package/lib/commonjs/screens/liveness/LivenessStore.js +1 -1
  23. package/lib/commonjs/screens/liveness/LivenessStore.js.flow +2 -1
  24. package/lib/commonjs/screens/liveness/LivenessStore.js.map +1 -1
  25. package/lib/commonjs/screens/liveness-v2/index.js +1 -1
  26. package/lib/commonjs/screens/liveness-v2/index.js.flow +13 -0
  27. package/lib/commonjs/screens/liveness-v2/index.js.map +1 -1
  28. package/lib/commonjs/screens/selfie/SelfieStore.js +1 -1
  29. package/lib/commonjs/screens/selfie/SelfieStore.js.flow +2 -0
  30. package/lib/commonjs/screens/selfie/SelfieStore.js.map +1 -1
  31. package/lib/commonjs/screens/selfie/index.js +1 -1
  32. package/lib/commonjs/screens/selfie/index.js.flow +1 -0
  33. package/lib/commonjs/screens/selfie/index.js.map +1 -1
  34. package/lib/commonjs/services/api/api-config.js +1 -1
  35. package/lib/commonjs/services/api/api-config.js.flow +2 -2
  36. package/lib/commonjs/services/api/api-config.js.map +1 -1
  37. package/lib/commonjs/services/api/api.js +1 -1
  38. package/lib/commonjs/services/api/api.js.flow +17 -0
  39. package/lib/commonjs/services/api/api.js.map +1 -1
  40. package/lib/module/index.js +1 -1
  41. package/lib/module/index.js.map +1 -1
  42. package/lib/module/navigation/primary-navigator.js +1 -1
  43. package/lib/module/navigation/primary-navigator.js.map +1 -1
  44. package/lib/module/screens/camera/index.js +1 -1
  45. package/lib/module/screens/camera/index.js.map +1 -1
  46. package/lib/module/screens/eSign/PreviewContract.js +2 -0
  47. package/lib/module/screens/eSign/PreviewContract.js.map +1 -0
  48. package/lib/module/screens/eSign/Store.js +1 -1
  49. package/lib/module/screens/eSign/Store.js.map +1 -1
  50. package/lib/module/screens/eSign/index.js +1 -1
  51. package/lib/module/screens/eSign/index.js.map +1 -1
  52. package/lib/module/screens/home/index.js +1 -1
  53. package/lib/module/screens/home/index.js.map +1 -1
  54. package/lib/module/screens/liveness/LivenessStore.js +1 -1
  55. package/lib/module/screens/liveness/LivenessStore.js.map +1 -1
  56. package/lib/module/screens/liveness-v2/index.js +1 -1
  57. package/lib/module/screens/liveness-v2/index.js.map +1 -1
  58. package/lib/module/screens/selfie/SelfieStore.js +1 -1
  59. package/lib/module/screens/selfie/SelfieStore.js.map +1 -1
  60. package/lib/module/screens/selfie/index.js +1 -1
  61. package/lib/module/screens/selfie/index.js.map +1 -1
  62. package/lib/module/services/api/api-config.js +1 -1
  63. package/lib/module/services/api/api-config.js.map +1 -1
  64. package/lib/module/services/api/api.js +1 -1
  65. package/lib/module/services/api/api.js.map +1 -1
  66. package/lib/typescript/index.d.ts.map +1 -1
  67. package/lib/typescript/navigation/primary-navigator.d.ts +1 -0
  68. package/lib/typescript/navigation/primary-navigator.d.ts.map +1 -1
  69. package/lib/typescript/screens/eSign/PreviewContract.d.ts +2 -0
  70. package/lib/typescript/screens/eSign/PreviewContract.d.ts.map +1 -0
  71. package/lib/typescript/screens/eSign/Store.d.ts +1 -0
  72. package/lib/typescript/screens/eSign/Store.d.ts.map +1 -1
  73. package/lib/typescript/screens/eSign/index.d.ts.map +1 -1
  74. package/lib/typescript/screens/home/index.d.ts.map +1 -1
  75. package/lib/typescript/screens/liveness/LivenessStore.d.ts.map +1 -1
  76. package/lib/typescript/screens/liveness-v2/index.d.ts.map +1 -1
  77. package/lib/typescript/screens/selfie/SelfieStore.d.ts +1 -0
  78. package/lib/typescript/screens/selfie/SelfieStore.d.ts.map +1 -1
  79. package/lib/typescript/screens/selfie/index.d.ts.map +1 -1
  80. package/lib/typescript/services/api/api.d.ts +16 -0
  81. package/lib/typescript/services/api/api.d.ts.map +1 -1
  82. package/package.json +1 -1
  83. package/src/index.tsx +2 -0
  84. package/src/navigation/primary-navigator.tsx +6 -0
  85. package/src/screens/camera/index.tsx +1 -1
  86. package/src/screens/eSign/PreviewContract.tsx +76 -0
  87. package/src/screens/eSign/Store.tsx +22 -1
  88. package/src/screens/eSign/index.tsx +281 -181
  89. package/src/screens/home/index.tsx +1 -9
  90. package/src/screens/liveness/LivenessStore.tsx +2 -1
  91. package/src/screens/liveness-v2/index.tsx +13 -0
  92. package/src/screens/selfie/SelfieStore.tsx +2 -0
  93. package/src/screens/selfie/index.tsx +1 -0
  94. package/src/services/api/api-config.ts +2 -2
  95. package/src/services/api/api.ts +17 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_mobx","require","_api","_log","_reactNative","_class","_descriptor","_descriptor2","_descriptor3","_descriptor4","_descriptor5","_descriptor6","_descriptor7","_descriptor8","Store","_classCallCheck2","default","_initializerDefineProperty2","_createClass2","key","value","signContractForBorrower","body","onSuccess","onFailure","response","_regenerator","async","signContractForBorrower$","_context","prev","next","awrap","Api","getInstance","sent","myLog","kind","data","meta","errorCode","isError","linkPreview","Alert","alert","errorMessage","text","isLoading","stop","Promise","confirmSignContractForBorrower","confirmSignContractForBorrower$","_context2","linkContract","t0","reSendOTP","reSendOTP$","_context3","reSendOTPLoading","eSignSendOTP","_applyDecoratedDescriptor2","prototype","observable","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor","eSignStore","_default","exports"],"sourceRoot":"../../../../src","sources":["screens/eSign/Store.tsx"],"mappings":"81BACA,IAAAA,KAAA,CAAAC,OAAA,SAEA,IAAAC,IAAA,CAAAD,OAAA,uBACA,IAAAE,IAAA,CAAAF,OAAA,oBACA,IAAAG,YAAA,CAAAH,OAAA,iBAAqC,IAAAI,MAAA,CAAAC,WAAA,CAAAC,YAAA,CAAAC,YAAA,CAAAC,YAAA,CAAAC,YAAA,CAAAC,YAAA,CAAAC,YAAA,CAAAC,YAAA,IAC/B,CAAAC,KAAK,EAAAT,MAAA,qBAAAS,MAAA,KAAAC,gBAAA,CAAAC,OAAA,OAAAF,KAAA,KAAAG,2BAAA,CAAAD,OAAA,mBAAAV,WAAA,UAAAW,2BAAA,CAAAD,OAAA,iBAAAT,YAAA,UAAAU,2BAAA,CAAAD,OAAA,qBAAAR,YAAA,UAAAS,2BAAA,CAAAD,OAAA,0BAAAP,YAAA,UAAAQ,2BAAA,CAAAD,OAAA,mBAAAN,YAAA,UAAAO,2BAAA,CAAAD,OAAA,qBAAAL,YAAA,UAAAM,2BAAA,CAAAD,OAAA,qBAAAJ,YAAA,UAAAK,2BAAA,CAAAD,OAAA,sBAAAH,YAAA,WAAAK,aAAA,CAAAF,OAAA,EAAAF,KAAA,GAAAK,GAAA,2BAAAC,KAAA,CAYT,SAAAC,wBAC8BC,IAAI,CAAEC,SAAU,CAAEC,SAAU,MAAAC,QAAA,QAAAC,YAAA,CAAAV,OAAA,CAAAW,KAAA,UAAAC,yBAAAC,QAAA,iBA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descriptor7","_descriptor8","Store","_classCallCheck2","default","_initializerDefineProperty2","_createClass2","key","value","signContractForBorrower","body","onSuccess","onFailure","response","_regenerator","async","signContractForBorrower$","_context","prev","next","awrap","Api","getInstance","sent","myLog","kind","data","meta","errorCode","isError","linkPreview","Alert","alert","errorMessage","text","isLoading","stop","Promise","confirmSignContractForBorrower","confirmSignContractForBorrower$","_context2","linkContract","t0","reSendOTP","reSendOTP$","_context3","reSendOTPLoading","eSignSendOTP","getPreviewContract","id","onError","getPreviewContract$","_context4","previewContract","_applyDecoratedDescriptor2","prototype","observable","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor","eSignStore","_default","exports"],"sourceRoot":"../../../../src","sources":["screens/eSign/Store.tsx"],"mappings":"81BACA,IAAAA,KAAA,CAAAC,OAAA,SAEA,IAAAC,IAAA,CAAAD,OAAA,uBACA,IAAAE,IAAA,CAAAF,OAAA,oBACA,IAAAG,YAAA,CAAAH,OAAA,iBAAqC,IAAAI,MAAA,CAAAC,WAAA,CAAAC,YAAA,CAAAC,YAAA,CAAAC,YAAA,CAAAC,YAAA,CAAAC,YAAA,CAAAC,YAAA,CAAAC,YAAA,IAC/B,CAAAC,KAAK,EAAAT,MAAA,qBAAAS,MAAA,KAAAC,gBAAA,CAAAC,OAAA,OAAAF,KAAA,KAAAG,2BAAA,CAAAD,OAAA,mBAAAV,WAAA,UAAAW,2BAAA,CAAAD,OAAA,iBAAAT,YAAA,UAAAU,2BAAA,CAAAD,OAAA,qBAAAR,YAAA,UAAAS,2BAAA,CAAAD,OAAA,0BAAAP,YAAA,UAAAQ,2BAAA,CAAAD,OAAA,mBAAAN,YAAA,UAAAO,2BAAA,CAAAD,OAAA,qBAAAL,YAAA,UAAAM,2BAAA,CAAAD,OAAA,qBAAAJ,YAAA,UAAAK,2BAAA,CAAAD,OAAA,sBAAAH,YAAA,WAAAK,aAAA,CAAAF,OAAA,EAAAF,KAAA,GAAAK,GAAA,2BAAAC,KAAA,CAYT,SAAAC,wB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,GAAA9D,MAAA,EAqBT,GAAM,CAAAuE,UAAU,CAAG,GAAI,CAAA9D,KAAK,CAAC,CAAC,CAAC,IAAA+D,QAAA,CAAAC,OAAA,CAAA9D,OAAA,CAChB4D,UAAU"}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ESign=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _native=require("@react-navigation/native");var _mobxReactLite=require("mobx-react-lite");var _CommonStyles=require("../CommonStyles");var _MButton=_interopRequireDefault(require("../../components/MButton"));var _MText=require("../../components/MText");var _theme=require("../../theme");var _icons=require("../../assets/icons");var _formik=require("formik");var _log=require("../../utils/log");var yup=_interopRequireWildcard(require("yup"));var _Store=_interopRequireDefault(require("./Store"));var _navigation=require("../../navigation");var _reactNativeSlackWebhook=_interopRequireDefault(require("react-native-slack-webhook"));var _jsxFileName="/Users/tima/Desktop/tima-care-v2/src/screens/eSign/index.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var webHookURL='https://hooks.slack.com/services/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';var ESign=exports.ESign=(0,_mobxReactLite.observer)(function ESign(props){var _props$route$params,_this=this;var navigation=(0,_native.useNavigation)();var loan=(_props$route$params=props.route.params)==null?void 0:_props$route$params.loan;var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),visible=_useState2[0],setIsVisible=_useState2[1];var countDown=function countDown(){_Store.default.currentTime=300;try{clearInterval(_Store.default.countDown);}catch(e){}_Store.default.countDown=setInterval(function(){if(_Store.default.currentTime>0){_Store.default.currentTime=_Store.default.currentTime-1;(0,_log.myLog)(_Store.default.currentTime);}else{clearInterval(_Store.default.countDown);}},1000);};var verify=function verify(OTP){if(!_Store.default.isLoading){_Store.default.confirmSignContractForBorrower({loanBriefId:loan.id,otp:OTP},function(){try{new _reactNativeSlackWebhook.default(webHookURL).post(JSON.stringify({loanID:loan.id,eSign:'Success'}),'#timacare');}catch(e){}navigation.dispatch(_native.CommonActions.reset({index:1,routes:[{name:_navigation.ScreenNames.Contract,params:{uri:'http://'+_Store.default.linkContract}}]}));});}};(0,_react.useEffect)(function(){_Store.default.signContractForBorrower({loanBriefId:loan.id},function(){countDown();},function(){navigation.goBack();});return function(){clearInterval(_Store.default.countDown);};},[]);var back=function back(){navigation.goBack();};var reSendOTP=function reSendOTP(){_Store.default.reSendOTP({customerId:loan.id},function(){countDown();});};return _react.default.createElement(_reactNative.View,{style:{flex:1,backgroundColor:'white'},__self:this,__source:{fileName:_jsxFileName,lineNumber:120,columnNumber:5}},_react.default.createElement(_reactNative.SafeAreaView,{style:{flex:1},__self:this,__source:{fileName:_jsxFileName,lineNumber:121,columnNumber:7}},_react.default.createElement(_reactNative.View,{style:{flex:1},__self:this,__source:{fileName:_jsxFileName,lineNumber:122,columnNumber:9}},_react.default.createElement(_reactNative.View,{style:[_CommonStyles.commonStyles.row,_CommonStyles.commonStyles.alignCenter,{paddingHorizontal:16,height:55}],__self:this,__source:{fileName:_jsxFileName,lineNumber:123,columnNumber:11}},_react.default.createElement(_MButton.default,{onPress:function onPress(){back();},style:{width:30,height:55,justifyContent:'center',alignItems:'center'},__self:this,__source:{fileName:_jsxFileName,lineNumber:130,columnNumber:13}},_react.default.createElement(_icons.IconBack,{width:18,height:18,fill:'black',__self:this,__source:{fileName:_jsxFileName,lineNumber:142,columnNumber:15}})),_react.default.createElement(_MText.MText,{style:{marginRight:30,fontSize:16,paddingHorizontal:4,color:_theme.color.headerColor,fontWeight:'bold',textAlign:'center',flex:1},__self:this,__source:{fileName:_jsxFileName,lineNumber:145,columnNumber:13}},'eSign')),_react.default.createElement(_reactNative.View,{style:{backgroundColor:_theme.color.border},__self:this,__source:{fileName:_jsxFileName,lineNumber:159,columnNumber:11}}),_react.default.createElement(_reactNative.ScrollView,{keyboardShouldPersistTaps:'always',style:_CommonStyles.commonStyles.fill,__self:this,__source:{fileName:_jsxFileName,lineNumber:160,columnNumber:11}},_react.default.createElement(_reactNative.View,{style:{shadowColor:'#aaaaaa59',shadowOffset:{width:0,height:2},shadowOpacity:1,shadowRadius:5,backgroundColor:'white',elevation:2,margin:16,padding:24,borderRadius:4,borderWidth:1,borderColor:_theme.color.border,alignItems:'center'},__self:this,__source:{fileName:_jsxFileName,lineNumber:164,columnNumber:13}},_react.default.createElement(_formik.Formik,{initialValues:{otp:__DEV__?'':''},onSubmit:function onSubmit(values){},validationSchema:yup.object().shape({otp:yup.string().required('Yêu cầu mã OTP.')}),__self:this,__source:{fileName:_jsxFileName,lineNumber:180,columnNumber:15}},function(_ref){var values=_ref.values,handleChange=_ref.handleChange,errors=_ref.errors,setFieldTouched=_ref.setFieldTouched,setFieldValue=_ref.setFieldValue,touched=_ref.touched,isValid=_ref.isValid,handleSubmit=_ref.handleSubmit;return _react.default.createElement(_reactNative.View,{style:{},__self:_this,__source:{fileName:_jsxFileName,lineNumber:199,columnNumber:19}},_Store.default.isLoading?_react.default.createElement(_reactNative.View,{style:[_CommonStyles.commonStyles.alignCenter,_CommonStyles.commonStyles.justifyCenter,{paddingVertical:16}],__self:_this,__source:{fileName:_jsxFileName,lineNumber:201,columnNumber:23}},_react.default.createElement(_reactNative.ActivityIndicator,{size:'large',color:_theme.color.primary,__self:_this,__source:{fileName:_jsxFileName,lineNumber:208,columnNumber:25}}),_react.default.createElement(_MText.MText,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:212,columnNumber:25}},"\u0110ang x\xE1c th\u1EF1c s\u1ED1 \u0111i\u1EC7n tho\u1EA1i c\u1EE7a b\u1EA1n")):_react.default.createElement(_reactNative.View,{style:{width:'80%'},__self:_this,__source:{fileName:_jsxFileName,lineNumber:215,columnNumber:23}},_react.default.createElement(_MText.MText,{style:{fontSize:12,color:_theme.color.textHeader,marginBottom:10},__self:_this,__source:{fileName:_jsxFileName,lineNumber:216,columnNumber:25}},"Nh\u1EADp m\xE3 OTP"),_react.default.createElement(_reactNative.View,{style:[_CommonStyles.commonStyles.row,_CommonStyles.commonStyles.alignCenter],__self:_this,__source:{fileName:_jsxFileName,lineNumber:223,columnNumber:25}},_react.default.createElement(_MText.MTextInput,{placeholderTextColor:'#939598',placeholder:'••••••',style:[_CommonStyles.commonStyles.textNormal,_CommonStyles.commonStyles.fill,{textAlign:'center',fontSize:16,borderRadius:4,borderWidth:1,borderColor:_theme.color.border,paddingVertical:_reactNative.Platform.OS==='android'?8:14,paddingHorizontal:16}],onChangeText:function onChangeText(text){setFieldValue('otp',text);if(text.length===6&&_Store.default.currentTime!==0){verify(text);}},maxLength:6,onBlur:function onBlur(){return setFieldTouched('otp');},returnKeyType:'done',value:values.otp,autoFocus:true,textContentType:'oneTimeCode',keyboardType:'numeric',__self:_this,__source:{fileName:_jsxFileName,lineNumber:226,columnNumber:27}})),_react.default.createElement(_MText.MText,{style:{fontSize:12,color:'#AAAAAA',marginTop:8,fontStyle:'italic'},__self:_this,__source:{fileName:_jsxFileName,lineNumber:261,columnNumber:25}},"Tin nh\u1EAFn SMS s\u1EBD \u0111\u01B0\u1EE3c g\u1EEDi t\u1EDBi s\u1ED1 \u0111i\u1EC7n tho\u1EA1i c\u1EE7a b\u1EA1n c\xF3 h\u1EA1n l\xE0 5 ph\xFAt")));}),_Store.default.currentTime===0?_react.default.createElement(_MButton.default,{onPress:reSendOTP,style:[_CommonStyles.commonStyles.alignCenter,_CommonStyles.commonStyles.justifyCenter,{marginTop:12,backgroundColor:_theme.color.primary,height:50,borderRadius:4,paddingHorizontal:20,marginLeft:16}],__self:this,__source:{fileName:_jsxFileName,lineNumber:275,columnNumber:17}},_Store.default.reSendOTPLoading?_react.default.createElement(_reactNative.ActivityIndicator,{color:'white',size:'small',__self:this,__source:{fileName:_jsxFileName,lineNumber:291,columnNumber:21}}):_react.default.createElement(_MText.MText,{style:[_CommonStyles.commonStyles.textNormalBold,{color:'white'}],__self:this,__source:{fileName:_jsxFileName,lineNumber:293,columnNumber:21}},"L\u1EA5y OTP")):_react.default.createElement(_MText.MText,{style:[_CommonStyles.commonStyles.textNormalBold,{marginTop:12,paddingHorizontal:16,color:_theme.color.primary}],__self:this,__source:{fileName:_jsxFileName,lineNumber:301,columnNumber:17}},_Store.default.currentTime,"s")),_react.default.createElement(_MButton.default,{onPress:function onPress(){return setIsVisible(true);},__self:this,__source:{fileName:_jsxFileName,lineNumber:315,columnNumber:13}},_react.default.createElement(_reactNative.Image,{source:{uri:_Store.default.linkPreview},style:{width:_reactNative.Dimensions.get('window').width-32,height:(_reactNative.Dimensions.get('window').width-32)*16/9,marginHorizontal:16,marginVertical:12,backgroundColor:'#f0f0f0'},__self:this,__source:{fileName:_jsxFileName,lineNumber:316,columnNumber:15}}))))));});
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ESign=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _native=require("@react-navigation/native");var _mobxReactLite=require("mobx-react-lite");var _reactNativeLinearGradient=_interopRequireDefault(require("react-native-linear-gradient"));var _CommonStyles=require("../CommonStyles");var _MButton=_interopRequireDefault(require("../../components/MButton"));var _MText=require("../../components/MText");var _theme=require("../../theme");var _icons=require("../../assets/icons");var _formik=require("formik");var yup=_interopRequireWildcard(require("yup"));var _Store=_interopRequireDefault(require("./Store"));var _navigation=require("../../navigation");var _reactNativeSlackWebhook=_interopRequireDefault(require("react-native-slack-webhook"));var _reactNativePdf=_interopRequireDefault(require("react-native-pdf"));var _reactNativeModal=_interopRequireDefault(require("react-native-modal"));var _Loading=_interopRequireDefault(require("../../components/Loading"));var _jsxFileName="/Users/tima/Desktop/tima-care-v2/src/screens/eSign/index.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var webHookURL='https://hooks.slack.com/services/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';var ESign=exports.ESign=(0,_mobxReactLite.observer)(function ESign(props){var _props$route$params,_this=this;var navigation=(0,_native.useNavigation)();var loan=(_props$route$params=props.route.params)==null?void 0:_props$route$params.loan;var _useState=(0,_react.useState)(true),_useState2=(0,_slicedToArray2.default)(_useState,2),loading=_useState2[0],setLoading=_useState2[1];var _useState3=(0,_react.useState)(),_useState4=(0,_slicedToArray2.default)(_useState3,2),contract=_useState4[0],setContract=_useState4[1];var _useState5=(0,_react.useState)(false),_useState6=(0,_slicedToArray2.default)(_useState5,2),showModal=_useState6[0],setShowModal=_useState6[1];var _useState7=(0,_react.useState)(false),_useState8=(0,_slicedToArray2.default)(_useState7,2),isLoading=_useState8[0],setIsLoading=_useState8[1];var _useState9=(0,_react.useState)(300),_useState10=(0,_slicedToArray2.default)(_useState9,2),currentTime=_useState10[0],setCurrentTime=_useState10[1];var timerRef=_react.default.useRef(currentTime);var countDown=function countDown(){var timerId=setInterval(function(){timerRef.current-=1;if(timerRef.current<0){clearInterval(timerId);}else{setCurrentTime(timerRef.current);}},1000);return function(){clearInterval(timerId);};};var verify=function verify(OTP){if(!_Store.default.isLoading){_Store.default.confirmSignContractForBorrower({loanBriefId:loan.id,otp:OTP},function(){try{new _reactNativeSlackWebhook.default(webHookURL).post(JSON.stringify({loanID:loan.id,eSign:'Success'}),'#timacare');}catch(e){}setShowModal(false);setTimeout(function(){_reactNative.Alert.alert('Thông báo','Ký hợp đồng thành công',[{text:'Đồng ý',onPress:function onPress(){navigation.dispatch(_native.CommonActions.reset({index:1,routes:[{name:_navigation.ScreenNames.Main}]}));}}]);},300);});}};var signContract=function signContract(){setIsLoading(true);_Store.default.signContractForBorrower({loanBriefId:loan.id},function(){setIsLoading(false);setShowModal(true);countDown();},function(){navigation.goBack();setIsLoading(false);});};var back=function back(){navigation.goBack();};var reSendOTP=function reSendOTP(){_Store.default.reSendOTP({customerId:loan.id},function(){setCurrentTime(300);timerRef.current=300;countDown();});};(0,_react.useEffect)(function(){_Store.default.getPreviewContract(loan==null?void 0:loan.id,function(res){setContract(res);setLoading(false);},function(){setLoading(false);});},[]);return _react.default.createElement(_reactNative.View,{style:{flex:1,backgroundColor:'white'},__self:this,__source:{fileName:_jsxFileName,lineNumber:156,columnNumber:5}},_react.default.createElement(_reactNative.SafeAreaView,{style:{flex:1},__self:this,__source:{fileName:_jsxFileName,lineNumber:157,columnNumber:7}},_react.default.createElement(_reactNative.View,{style:{flex:1},__self:this,__source:{fileName:_jsxFileName,lineNumber:158,columnNumber:9}},_react.default.createElement(_reactNative.View,{style:[_CommonStyles.commonStyles.row,_CommonStyles.commonStyles.alignCenter,{paddingHorizontal:16,height:55}],__self:this,__source:{fileName:_jsxFileName,lineNumber:159,columnNumber:11}},_react.default.createElement(_MButton.default,{onPress:function onPress(){back();},style:{width:30,height:55,justifyContent:'center',alignItems:'center'},__self:this,__source:{fileName:_jsxFileName,lineNumber:166,columnNumber:13}},_react.default.createElement(_icons.IconBack,{width:18,height:18,fill:'black',__self:this,__source:{fileName:_jsxFileName,lineNumber:178,columnNumber:15}})),_react.default.createElement(_MText.MText,{style:{marginRight:30,fontSize:16,paddingHorizontal:4,color:_theme.color.headerColor,fontWeight:'bold',textAlign:'center',flex:1},__self:this,__source:{fileName:_jsxFileName,lineNumber:181,columnNumber:13}},"K\xFD h\u1EE3p \u0111\u1ED3ng")),_react.default.createElement(_reactNative.View,{style:{backgroundColor:_theme.color.border},__self:this,__source:{fileName:_jsxFileName,lineNumber:195,columnNumber:11}}),_react.default.createElement(_reactNative.View,{style:{flex:1},__self:this,__source:{fileName:_jsxFileName,lineNumber:197,columnNumber:11}},_react.default.createElement(_reactNativePdf.default,{source:{uri:'data:application/pdf;base64,'+(contract==null?void 0:contract.base64_hopdongdichvu)},onLoadComplete:function onLoadComplete(numberOfPages,filePath){console.log("Number of pages: "+numberOfPages);},onPageChanged:function onPageChanged(page,numberOfPages){console.log("Current page: "+page);},onError:function onError(error){console.log(error);},onPressLink:function onPressLink(uri){console.log("Link pressed: "+uri);},style:{flex:1},__self:this,__source:{fileName:_jsxFileName,lineNumber:198,columnNumber:13}})),_react.default.createElement(_reactNative.View,{style:{paddingHorizontal:24},__self:this,__source:{fileName:_jsxFileName,lineNumber:221,columnNumber:11}},(contract==null?void 0:contract.base64_giaoket_1)&&_react.default.createElement(_reactNative.TouchableOpacity,{style:{marginTop:10},onPress:function onPress(){navigation.push(_navigation.ScreenNames.PreviewContract,{uri:'data:application/pdf;base64,'+(contract==null?void 0:contract.base64_giaoket_1)});},__self:this,__source:{fileName:_jsxFileName,lineNumber:223,columnNumber:15}},_react.default.createElement(_MText.MText,{style:{color:'blue',textDecorationLine:'underline'},__self:this,__source:{fileName:_jsxFileName,lineNumber:233,columnNumber:17}},"\u0110\u1EC1 ngh\u1ECB giao k\u1EBFt tho\u1EA3 thu\u1EADn cho vay 1")),(contract==null?void 0:contract.base64_giaoket_2)&&_react.default.createElement(_reactNative.TouchableOpacity,{style:{marginTop:10},onPress:function onPress(){navigation.push(_navigation.ScreenNames.PreviewContract,{uri:'data:application/pdf;base64,'+(contract==null?void 0:contract.base64_giaoket_2)});},__self:this,__source:{fileName:_jsxFileName,lineNumber:241,columnNumber:15}},_react.default.createElement(_MText.MText,{style:{color:'blue',textDecorationLine:'underline'},__self:this,__source:{fileName:_jsxFileName,lineNumber:251,columnNumber:17}},"\u0110\u1EC1 ngh\u1ECB giao k\u1EBFt tho\u1EA3 thu\u1EADn cho vay 2")),(contract==null?void 0:contract.base64_phulucsuadoithoathuanchovay)&&_react.default.createElement(_reactNative.TouchableOpacity,{style:{marginTop:10},onPress:function onPress(){navigation.push(_navigation.ScreenNames.PreviewContract,{uri:'data:application/pdf;base64,'+(contract==null?void 0:contract.base64_phulucsuadoithoathuanchovay)});},__self:this,__source:{fileName:_jsxFileName,lineNumber:259,columnNumber:15}},_react.default.createElement(_MText.MText,{style:{color:'blue',textDecorationLine:'underline'},__self:this,__source:{fileName:_jsxFileName,lineNumber:269,columnNumber:17}},"Ph\u1EE5 l\u1EE5c s\u1EEDa \u0111\u1ED5i tho\u1EA3 thu\u1EADn cho vay")),_react.default.createElement(_MButton.default,{disabled:isLoading,onPress:function onPress(){signContract();},__self:this,__source:{fileName:_jsxFileName,lineNumber:276,columnNumber:13}},_react.default.createElement(_reactNativeLinearGradient.default,{style:{height:40,marginVertical:16,borderRadius:30,alignItems:'center',justifyContent:'center'},colors:['#FF7A00','#EF4123'],__self:this,__source:{fileName:_jsxFileName,lineNumber:282,columnNumber:15}},_react.default.createElement(_MText.MText,{style:[_CommonStyles.commonStyles.textNormalBold,{color:'white',textAlign:'center'}],__self:this,__source:{fileName:_jsxFileName,lineNumber:292,columnNumber:17}},"K\xFD h\u1EE3p \u0111\u1ED3ng")))))),_react.default.createElement(_reactNativeModal.default,{isVisible:showModal,__self:this,__source:{fileName:_jsxFileName,lineNumber:308,columnNumber:7}},_react.default.createElement(_reactNative.View,{style:{backgroundColor:'white',padding:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:309,columnNumber:9}},_react.default.createElement(_MText.MText,{style:{fontSize:12,color:_theme.color.textHeader,marginBottom:10},__self:this,__source:{fileName:_jsxFileName,lineNumber:310,columnNumber:11}},"Nh\u1EADp m\xE3 OTP"),_react.default.createElement(_formik.Formik,{initialValues:{otp:__DEV__?'':''},onSubmit:function onSubmit(values,setFieldValue){},validationSchema:yup.object().shape({otp:yup.string().required('Yêu cầu mã OTP.')}),__self:this,__source:{fileName:_jsxFileName,lineNumber:317,columnNumber:11}},function(_ref){var values=_ref.values,setFieldValue=_ref.setFieldValue,setFieldTouched=_ref.setFieldTouched;return _react.default.createElement(_reactNative.View,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:327,columnNumber:15}},_react.default.createElement(_reactNative.View,{style:[_CommonStyles.commonStyles.row,_CommonStyles.commonStyles.alignCenter],__self:_this,__source:{fileName:_jsxFileName,lineNumber:328,columnNumber:17}},_react.default.createElement(_MText.MTextInput,{placeholderTextColor:'#939598',placeholder:'••••••',style:[_CommonStyles.commonStyles.textNormal,_CommonStyles.commonStyles.fill,{textAlign:'center',fontSize:16,borderRadius:4,borderWidth:1,borderColor:_theme.color.border,paddingVertical:_reactNative.Platform.OS==='android'?8:14,paddingHorizontal:16}],onChangeText:function onChangeText(text){setFieldValue('otp',text);if(text.length===6&&_Store.default.currentTime!==0){verify(text);}},maxLength:6,onBlur:function onBlur(){return setFieldTouched('otp');},returnKeyType:'done',value:values.otp,autoFocus:true,textContentType:'oneTimeCode',keyboardType:'numeric',__self:_this,__source:{fileName:_jsxFileName,lineNumber:329,columnNumber:19}})),_react.default.createElement(_MText.MText,{style:{fontSize:12,color:'#AAAAAA',marginTop:8,fontStyle:'italic'},__self:_this,__source:{fileName:_jsxFileName,lineNumber:361,columnNumber:17}},"Tin nh\u1EAFn SMS s\u1EBD \u0111\u01B0\u1EE3c g\u1EEDi t\u1EDBi s\u1ED1 \u0111i\u1EC7n tho\u1EA1i c\u1EE7a b\u1EA1n c\xF3 h\u1EA1n l\xE0 5 ph\xFAt"),_react.default.createElement(_mobxReactLite.Observer,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:370,columnNumber:17}},function(){return _react.default.createElement(_reactNative.View,{style:{alignItems:'center'},__self:_this,__source:{fileName:_jsxFileName,lineNumber:372,columnNumber:21}},currentTime===0?_react.default.createElement(_MButton.default,{onPress:reSendOTP,style:[_CommonStyles.commonStyles.alignCenter,_CommonStyles.commonStyles.justifyCenter,{marginTop:12,backgroundColor:_theme.color.primary,height:50,borderRadius:4,paddingHorizontal:20,marginLeft:16}],__self:_this,__source:{fileName:_jsxFileName,lineNumber:374,columnNumber:25}},_Store.default.reSendOTPLoading?_react.default.createElement(_reactNative.ActivityIndicator,{color:'white',size:'small',__self:_this,__source:{fileName:_jsxFileName,lineNumber:390,columnNumber:29}}):_react.default.createElement(_MText.MText,{style:[_CommonStyles.commonStyles.textNormalBold,{color:'white'}],__self:_this,__source:{fileName:_jsxFileName,lineNumber:392,columnNumber:29}},"L\u1EA5y OTP")):_react.default.createElement(_mobxReactLite.Observer,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:403,columnNumber:25}},function(){return _react.default.createElement(_MText.MText,{style:[_CommonStyles.commonStyles.textNormalBold,{marginTop:12,paddingHorizontal:16,color:_theme.color.primary}],__self:_this,__source:{fileName:_jsxFileName,lineNumber:405,columnNumber:29}},currentTime,"s");}));}));}))),_react.default.createElement(_Loading.default,{isLoading:loading,__self:this,__source:{fileName:_jsxFileName,lineNumber:429,columnNumber:7}}));});
2
2
  //# sourceMappingURL=index.js.map
@@ -10,10 +10,12 @@ import {
10
10
  ActivityIndicator,
11
11
  Platform,
12
12
  Alert,
13
+ TouchableOpacity,
13
14
  } from 'react-native';
14
15
  import { CommonActions, useNavigation } from '@react-navigation/native';
15
- import { observer } from 'mobx-react-lite';
16
+ import { observer, Observer } from 'mobx-react-lite';
16
17
  import WebView from 'react-native-webview';
18
+ import LinearGradient from 'react-native-linear-gradient';
17
19
  import { commonStyles } from '../CommonStyles';
18
20
  import MButton from '../../components/MButton';
19
21
  import { MText, MTextInput } from '../../components/MText';
@@ -28,27 +30,36 @@ import { ScreenNames } from '../../navigation';
28
30
  import Slack from 'react-native-slack-webhook';
29
31
  import homeStore from '../home/Store';
30
32
  import appStore from '../../AppStore';
33
+ import Pdf from 'react-native-pdf';
34
+ import Modal from 'react-native-modal';
35
+ import KeyboardSpacer from '../../components/keyboardspace';
36
+ import Loading from '../../components/Loading';
37
+
31
38
  const webHookURL =
32
39
  'https://hooks.slack.com/services/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';
33
40
 
34
41
  export const ESign = observer(function ESign(props: any) {
35
42
  const navigation = useNavigation();
36
43
  const loan = props.route.params?.loan;
37
- const [visible, setIsVisible] = useState(false);
44
+ const [loading, setLoading] = useState(true);
45
+ const [contract, setContract] = useState<any>();
46
+ const [showModal, setShowModal] = useState(false);
47
+ const [isLoading, setIsLoading] = useState(false);
48
+ const [currentTime, setCurrentTime] = useState(300);
49
+ const timerRef = React.useRef(currentTime);
38
50
 
39
51
  const countDown = () => {
40
- eSignStore.currentTime = 300;
41
- try {
42
- clearInterval(eSignStore.countDown);
43
- } catch (e) {}
44
- eSignStore.countDown = setInterval(() => {
45
- if (eSignStore.currentTime > 0) {
46
- eSignStore.currentTime = eSignStore.currentTime - 1;
47
- myLog(eSignStore.currentTime);
52
+ const timerId = setInterval(() => {
53
+ timerRef.current -= 1;
54
+ if (timerRef.current < 0) {
55
+ clearInterval(timerId);
48
56
  } else {
49
- clearInterval(eSignStore.countDown);
57
+ setCurrentTime(timerRef.current);
50
58
  }
51
59
  }, 1000);
60
+ return () => {
61
+ clearInterval(timerId);
62
+ };
52
63
  };
53
64
 
54
65
  const verify = (OTP) => {
@@ -68,38 +79,48 @@ export const ESign = observer(function ESign(props: any) {
68
79
  '#timacare'
69
80
  );
70
81
  } catch (e) {}
71
- navigation.dispatch(
72
- CommonActions.reset({
73
- index: 1,
74
- routes: [
75
- {
76
- name: ScreenNames.Contract,
77
- params: { uri: 'http://' + eSignStore.linkContract },
82
+ setShowModal(false);
83
+ setTimeout(() => {
84
+ Alert.alert('Thông báo', 'Ký hợp đồng thành công', [
85
+ {
86
+ text: 'Đồng ý',
87
+ onPress: () => {
88
+ navigation.dispatch(
89
+ CommonActions.reset({
90
+ index: 1,
91
+ routes: [
92
+ {
93
+ name: ScreenNames.Main,
94
+ },
95
+ ],
96
+ })
97
+ );
78
98
  },
79
- ],
80
- })
81
- );
99
+ },
100
+ ]);
101
+ }, 300);
82
102
  }
83
103
  );
84
104
  }
85
105
  };
86
106
 
87
- useEffect(() => {
107
+ const signContract = () => {
108
+ setIsLoading(true);
88
109
  eSignStore.signContractForBorrower(
89
110
  {
90
111
  loanBriefId: loan.id,
91
112
  },
92
113
  () => {
114
+ setIsLoading(false);
115
+ setShowModal(true);
93
116
  countDown();
94
117
  },
95
118
  () => {
96
119
  navigation.goBack();
120
+ setIsLoading(false);
97
121
  }
98
122
  );
99
- return () => {
100
- clearInterval(eSignStore.countDown);
101
- };
102
- }, []);
123
+ };
103
124
 
104
125
  const back = () => {
105
126
  navigation.goBack();
@@ -111,11 +132,26 @@ export const ESign = observer(function ESign(props: any) {
111
132
  customerId: loan.id,
112
133
  },
113
134
  () => {
135
+ setCurrentTime(300);
136
+ timerRef.current = 300;
114
137
  countDown();
115
138
  }
116
139
  );
117
140
  };
118
141
 
142
+ useEffect(() => {
143
+ eSignStore.getPreviewContract(
144
+ loan?.id,
145
+ (res) => {
146
+ setContract(res);
147
+ setLoading(false);
148
+ },
149
+ () => {
150
+ setLoading(false);
151
+ }
152
+ );
153
+ }, []);
154
+
119
155
  return (
120
156
  <View style={{ flex: 1, backgroundColor: 'white' }}>
121
157
  <SafeAreaView style={{ flex: 1 }}>
@@ -153,180 +189,244 @@ export const ESign = observer(function ESign(props: any) {
153
189
  flex: 1,
154
190
  }}
155
191
  >
156
- {'eSign'}
192
+ Ký hợp đồng
157
193
  </MText>
158
194
  </View>
159
195
  <View style={{ backgroundColor: color.border }} />
160
- <ScrollView
161
- keyboardShouldPersistTaps={'always'}
162
- style={commonStyles.fill}
163
- >
164
- <View
196
+
197
+ <View style={{ flex: 1 }}>
198
+ <Pdf
199
+ source={{
200
+ uri:
201
+ 'data:application/pdf;base64,' +
202
+ contract?.base64_hopdongdichvu,
203
+ }}
204
+ onLoadComplete={(numberOfPages, filePath) => {
205
+ console.log(`Number of pages: ${numberOfPages}`);
206
+ }}
207
+ onPageChanged={(page, numberOfPages) => {
208
+ console.log(`Current page: ${page}`);
209
+ }}
210
+ onError={(error) => {
211
+ console.log(error);
212
+ }}
213
+ onPressLink={(uri) => {
214
+ console.log(`Link pressed: ${uri}`);
215
+ }}
165
216
  style={{
166
- shadowColor: '#aaaaaa59',
167
- shadowOffset: { width: 0, height: 2 },
168
- shadowOpacity: 1,
169
- shadowRadius: 5,
170
- backgroundColor: 'white',
171
- elevation: 2,
172
- margin: 16,
173
- padding: 24,
174
- borderRadius: 4,
175
- borderWidth: 1,
176
- borderColor: color.border,
177
- alignItems: 'center',
217
+ flex: 1,
178
218
  }}
179
- >
180
- <Formik
181
- initialValues={{
182
- otp: __DEV__ ? '' : '',
219
+ />
220
+ </View>
221
+ <View style={{ paddingHorizontal: 24 }}>
222
+ {contract?.base64_giaoket_1 && (
223
+ <TouchableOpacity
224
+ style={{ marginTop: 10 }}
225
+ onPress={() => {
226
+ navigation.push(ScreenNames.PreviewContract, {
227
+ uri:
228
+ 'data:application/pdf;base64,' +
229
+ contract?.base64_giaoket_1,
230
+ });
183
231
  }}
184
- onSubmit={(values) => {}}
185
- validationSchema={yup.object().shape({
186
- otp: yup.string().required('Yêu cầu mã OTP.'),
187
- })}
188
232
  >
189
- {({
190
- values,
191
- handleChange,
192
- errors,
193
- setFieldTouched,
194
- setFieldValue,
195
- touched,
196
- isValid,
197
- handleSubmit,
198
- }) => (
199
- <View style={{}}>
200
- {eSignStore.isLoading ? (
201
- <View
202
- style={[
203
- commonStyles.alignCenter,
204
- commonStyles.justifyCenter,
205
- { paddingVertical: 16 },
206
- ]}
207
- >
208
- <ActivityIndicator
209
- size={'large'}
210
- color={color.primary}
211
- />
212
- <MText>Đang xác thực số điện thoại của bạn</MText>
213
- </View>
214
- ) : (
215
- <View style={{ width: '80%' }}>
216
- <MText
217
- style={{
218
- fontSize: 12,
219
- color: color.textHeader,
220
- marginBottom: 10,
221
- }}
222
- >{`Nhập mã OTP`}</MText>
223
- <View
224
- style={[commonStyles.row, commonStyles.alignCenter]}
225
- >
226
- <MTextInput
227
- placeholderTextColor={'#939598'}
228
- placeholder={'••••••'}
229
- style={[
230
- commonStyles.textNormal,
231
- commonStyles.fill,
232
- {
233
- textAlign: 'center',
234
- fontSize: 16,
235
- borderRadius: 4,
236
- borderWidth: 1,
237
- borderColor: color.border,
238
- paddingVertical:
239
- Platform.OS === 'android' ? 8 : 14,
240
- paddingHorizontal: 16,
241
- },
242
- ]}
243
- onChangeText={(text) => {
244
- setFieldValue('otp', text);
245
- if (
246
- text.length === 6 &&
247
- eSignStore.currentTime !== 0
248
- ) {
249
- verify(text);
250
- }
251
- }}
252
- maxLength={6}
253
- onBlur={() => setFieldTouched('otp')}
254
- returnKeyType={'done'}
255
- value={values.otp}
256
- autoFocus={true}
257
- textContentType={'oneTimeCode'}
258
- keyboardType={'numeric'}
259
- />
260
- </View>
261
- <MText
262
- style={{
263
- fontSize: 12,
264
- color: '#AAAAAA',
265
- marginTop: 8,
266
- fontStyle: 'italic',
267
- }}
268
- >{`Tin nhắn SMS sẽ được gửi tới số điện thoại của bạn có hạn là 5 phút`}</MText>
269
- </View>
270
- )}
271
- </View>
272
- )}
273
- </Formik>
274
- {eSignStore.currentTime === 0 ? (
275
- <MButton
276
- onPress={reSendOTP}
277
- style={[
278
- commonStyles.alignCenter,
279
- commonStyles.justifyCenter,
280
- {
281
- marginTop: 12,
282
- backgroundColor: color.primary,
283
- height: 50,
284
- borderRadius: 4,
285
- paddingHorizontal: 20,
286
- marginLeft: 16,
287
- },
288
- ]}
233
+ <MText
234
+ style={{ color: 'blue', textDecorationLine: 'underline' }}
289
235
  >
290
- {eSignStore.reSendOTPLoading ? (
291
- <ActivityIndicator color={'white'} size={'small'} />
292
- ) : (
293
- <MText
294
- style={[commonStyles.textNormalBold, { color: 'white' }]}
295
- >
296
- Lấy OTP
297
- </MText>
298
- )}
299
- </MButton>
300
- ) : (
236
+ Đề nghị giao kết thoả thuận cho vay 1
237
+ </MText>
238
+ </TouchableOpacity>
239
+ )}
240
+ {contract?.base64_giaoket_2 && (
241
+ <TouchableOpacity
242
+ style={{ marginTop: 10 }}
243
+ onPress={() => {
244
+ navigation.push(ScreenNames.PreviewContract, {
245
+ uri:
246
+ 'data:application/pdf;base64,' +
247
+ contract?.base64_giaoket_2,
248
+ });
249
+ }}
250
+ >
251
+ <MText
252
+ style={{ color: 'blue', textDecorationLine: 'underline' }}
253
+ >
254
+ Đề nghị giao kết thoả thuận cho vay 2
255
+ </MText>
256
+ </TouchableOpacity>
257
+ )}
258
+ {contract?.base64_phulucsuadoithoathuanchovay && (
259
+ <TouchableOpacity
260
+ style={{ marginTop: 10 }}
261
+ onPress={() => {
262
+ navigation.push(ScreenNames.PreviewContract, {
263
+ uri:
264
+ 'data:application/pdf;base64,' +
265
+ contract?.base64_phulucsuadoithoathuanchovay,
266
+ });
267
+ }}
268
+ >
269
+ <MText
270
+ style={{ color: 'blue', textDecorationLine: 'underline' }}
271
+ >
272
+ Phụ lục sửa đổi thoả thuận cho vay
273
+ </MText>
274
+ </TouchableOpacity>
275
+ )}
276
+ <MButton
277
+ disabled={isLoading}
278
+ onPress={() => {
279
+ signContract();
280
+ }}
281
+ >
282
+ <LinearGradient
283
+ style={{
284
+ height: 40,
285
+ marginVertical: 16,
286
+ borderRadius: 30,
287
+ alignItems: 'center',
288
+ justifyContent: 'center',
289
+ }}
290
+ colors={['#FF7A00', '#EF4123']}
291
+ >
301
292
  <MText
302
293
  style={[
303
294
  commonStyles.textNormalBold,
304
295
  {
305
- marginTop: 12,
306
- paddingHorizontal: 16,
307
- color: color.primary,
296
+ color: 'white',
297
+ textAlign: 'center',
308
298
  },
309
299
  ]}
310
300
  >
311
- {eSignStore.currentTime}s
301
+ Ký hợp đồng
312
302
  </MText>
313
- )}
314
- </View>
315
- <MButton onPress={() => setIsVisible(true)}>
316
- <Image
317
- source={{ uri: eSignStore.linkPreview }}
318
- style={{
319
- width: Dimensions.get('window').width - 32,
320
- height: ((Dimensions.get('window').width - 32) * 16) / 9,
321
- marginHorizontal: 16,
322
- marginVertical: 12,
323
- backgroundColor: '#f0f0f0',
324
- }}
325
- />
303
+ </LinearGradient>
326
304
  </MButton>
327
- </ScrollView>
305
+ </View>
328
306
  </View>
329
307
  </SafeAreaView>
308
+ <Modal isVisible={showModal}>
309
+ <View style={{ backgroundColor: 'white', padding: 16 }}>
310
+ <MText
311
+ style={{
312
+ fontSize: 12,
313
+ color: color.textHeader,
314
+ marginBottom: 10,
315
+ }}
316
+ >{`Nhập mã OTP`}</MText>
317
+ <Formik
318
+ initialValues={{
319
+ otp: __DEV__ ? '' : '',
320
+ }}
321
+ onSubmit={(values, setFieldValue) => {}}
322
+ validationSchema={yup.object().shape({
323
+ otp: yup.string().required('Yêu cầu mã OTP.'),
324
+ })}
325
+ >
326
+ {({ values, setFieldValue, setFieldTouched }) => (
327
+ <View>
328
+ <View style={[commonStyles.row, commonStyles.alignCenter]}>
329
+ <MTextInput
330
+ placeholderTextColor={'#939598'}
331
+ placeholder={'••••••'}
332
+ style={[
333
+ commonStyles.textNormal,
334
+ commonStyles.fill,
335
+ {
336
+ textAlign: 'center',
337
+ fontSize: 16,
338
+ borderRadius: 4,
339
+ borderWidth: 1,
340
+ borderColor: color.border,
341
+ paddingVertical: Platform.OS === 'android' ? 8 : 14,
342
+ paddingHorizontal: 16,
343
+ },
344
+ ]}
345
+ onChangeText={(text) => {
346
+ setFieldValue('otp', text);
347
+ if (text.length === 6 && eSignStore.currentTime !== 0) {
348
+ verify(text);
349
+ }
350
+ }}
351
+ maxLength={6}
352
+ onBlur={() => setFieldTouched('otp')}
353
+ returnKeyType={'done'}
354
+ value={values.otp}
355
+ autoFocus={true}
356
+ textContentType={'oneTimeCode'}
357
+ keyboardType={'numeric'}
358
+ />
359
+ </View>
360
+
361
+ <MText
362
+ style={{
363
+ fontSize: 12,
364
+ color: '#AAAAAA',
365
+ marginTop: 8,
366
+ fontStyle: 'italic',
367
+ }}
368
+ >{`Tin nhắn SMS sẽ được gửi tới số điện thoại của bạn có hạn là 5 phút`}</MText>
369
+
370
+ <Observer>
371
+ {() => (
372
+ <View style={{ alignItems: 'center' }}>
373
+ {currentTime === 0 ? (
374
+ <MButton
375
+ onPress={reSendOTP}
376
+ style={[
377
+ commonStyles.alignCenter,
378
+ commonStyles.justifyCenter,
379
+ {
380
+ marginTop: 12,
381
+ backgroundColor: color.primary,
382
+ height: 50,
383
+ borderRadius: 4,
384
+ paddingHorizontal: 20,
385
+ marginLeft: 16,
386
+ },
387
+ ]}
388
+ >
389
+ {eSignStore.reSendOTPLoading ? (
390
+ <ActivityIndicator color={'white'} size={'small'} />
391
+ ) : (
392
+ <MText
393
+ style={[
394
+ commonStyles.textNormalBold,
395
+ { color: 'white' },
396
+ ]}
397
+ >
398
+ Lấy OTP
399
+ </MText>
400
+ )}
401
+ </MButton>
402
+ ) : (
403
+ <Observer>
404
+ {() => (
405
+ <MText
406
+ style={[
407
+ commonStyles.textNormalBold,
408
+ {
409
+ marginTop: 12,
410
+ paddingHorizontal: 16,
411
+ color: color.primary,
412
+ },
413
+ ]}
414
+ >
415
+ {currentTime}s
416
+ </MText>
417
+ )}
418
+ </Observer>
419
+ )}
420
+ </View>
421
+ )}
422
+ </Observer>
423
+ </View>
424
+ )}
425
+ </Formik>
426
+ </View>
427
+ </Modal>
428
+
429
+ <Loading isLoading={loading} />
330
430
  </View>
331
431
  );
332
432
  });