ocr.wxml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <import src="../riskTip/riskTip.wxml"></import><template name="verifyOcr">
  2. <view class="verify-gray-container">
  3. <view wx:if="{{!page.ocr.isManualInput && !ocr.isShowTakePhoto && !ocr.isShowResult}}" class="verify-white-bg">
  4. <view id="ocr-top">
  5. <view id="ocr-title">身份证识别</view>
  6. <image
  7. src="{{Common.IsWxNative ? '/static/verify_mpsdk/images/hint-shibieNative.png' : 'https://s.beta.gtimg.com/GodIdent/huiyan-ui-new/images-wx/hint-shibie-green.png'}}">
  8. </image>
  9. <view id="ocr-text"><text class="text" wx:if="{{page.ocr.backend}}">1. 拍摄身份证原件正反面</text><text
  10. class="text" wx:else>1. 拍摄身份证原件正面</text><text class="text">2. 保证照片清晰文字可辨</text><text
  11. class="text">3. 避免照片不全、遮挡、反光</text></view>
  12. <view id="ocr-startbtn" class="{{Common.IsWxNative ? 'index-btnNative' : 'index-btn'}}"><button
  13. type="primary" bindtap="ocrStartTakePhoto"
  14. hover-class="{{Common.IsWxNative ? 'btn-hoverNative' : 'btn-hover'}}">开始识别</button></view>
  15. </view>
  16. <view class="ocr-risk-tip"><template is="riskTip" wx:if="{{Common.RiskTip}}"
  17. data="{{riskTip: Common.RiskTip}}"></template></view>
  18. </view>
  19. <view wx:if="{{ocr.isShowTakePhoto && !ocr.isShowResult}}" class="verify-absolute-bg">
  20. <view class="verify-absolute-bg" wx:if="{{!ocr.isShowPhotoPreView}}">
  21. <view class="verify-ocr-title {{ocr.isInfinityDisplayOcrTitle}}">
  22. <view class="{{Common.IsWxNative ? 'color-green' : ''}}">{{ocr.ocrTitle}}</view>
  23. <view class="ocr-risk-tip"><template is="riskTip" wx:if="{{Common.RiskTip}}"
  24. data="{{riskTip: Common.RiskTip, isCoverView: true}}"></template></view>
  25. </view>
  26. <camera device-position="back" flash="off" binderror="ocrCameraError"
  27. class="verify-ocr-frameArea {{ocr.isInfinityDisplayOcrMiddle}}">
  28. <cover-view class="vof-bg" wx:if="{{!ocr.isShowPhotoPreView}}">
  29. <cover-image
  30. src="{{Common.IsWxNative ? '/static/verify_mpsdk/images/shibiebgNative.png' : 'http://beta.gtimg.com/GodIdent/huiyan/img/shibiebg.png'}}"
  31. class="full-weight-height"></cover-image>
  32. </cover-view>
  33. <cover-view wx:if="{{!ocr.isShowPhotoPreView && ocr.isFrontIdCard}}"
  34. style="margin-top:80rpx;margin-left:350rpx;">
  35. <cover-image src="http://beta.gtimg.com/GodIdent/huiyan/img/ico-head.png"
  36. style="width:254rpx;height:285rpx;"></cover-image>
  37. </cover-view>
  38. <cover-view wx:if="{{!ocr.isShowPhotoPreView && !ocr.isFrontIdCard}}"
  39. style="margin-top:80rpx;margin-left:90rpx;">
  40. <cover-image src="http://beta.gtimg.com/GodIdent/huiyan/img/ico-guohui.png"
  41. style="width:139rpx;height:144rpx:;"></cover-image>
  42. </cover-view>
  43. </camera>
  44. <view class="verify-ocr-pre {{ocr.isInfinityDisplayOcrBottom}}">
  45. <view class="verify-ocr-tools" wx:if="{{ocr.isToolsShow}}">
  46. <view wx:if="{{page.ocr.sourceType > 0}}"
  47. class="{{Common.IsWxNative ? 'vot-album color-green' : 'vot-album'}}" bindtap="chooseImg">相册
  48. </view>
  49. <view class="vot-middle">
  50. <image
  51. src="{{Common.IsWxNative ? '/static/verify_mpsdk/images/ico-cameNative.png' : '/static/verify_mpsdk/images/ico-came.png'}}"
  52. wx:if="{{!ocr.isShowPhotoPreView}}" bindtap="takePhotoWithCamera"></image>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <view wx:if="{{ocr.isShowPhotoPreView}}">
  58. <view class="verify-ocr-title" style="background:none">
  59. <view class="{{Common.IsWxNative ? 'color-green' : ''}}">{{ocr.ocrTitle}}</view>
  60. <view class="ocr-risk-tip"><template is="riskTip" wx:if="{{Common.RiskTip}}"
  61. data="{{riskTip: Common.RiskTip}}"></template></view>
  62. </view>
  63. <image src="{{ocr.tempImagePath}}" mode="aspectFit" id="vof-preview"></image>
  64. <view class="verify-ocr-pre">
  65. <view class="verify-ocr-tools" wx:if="{{ocr.isToolsShow}}">
  66. <view wx:if="{{page.ocr.sourceType > 0}}"
  67. class="{{Common.IsWxNative ? 'vot-album color-green' : 'vot-album'}}" bindtap="chooseImg">相册
  68. </view>
  69. <view class="vot-middle">
  70. <image
  71. src="{{Common.IsWxNative ? '/static/verify_mpsdk/images/ico-sucNative.png' : '/static/verify_mpsdk/images/ico-suc.png'}}"
  72. wx:if="{{ocr.isShowPhotoPreView}}" bindtap="startUploadAndOcr"></image>
  73. </view>
  74. <view wx:if="{{ocr.isShowPhotoPreView}}"
  75. class="{{Common.IsWxNative ? 'vot-right color-green' : 'vot-right'}}" bindtap="reTakePhoto">
  76. 重拍</view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. <view wx:if="{{ocr.isShowResult}}">
  82. <view class="ocr-result-title"
  83. wx:if="{{!page.ocr.isIdnameAllowEdit && !page.ocr.isIdnumberAllowEdit && !page.ocr.isIdaddressAllowEdit}}">
  84. 请确认您的身份信息</view>
  85. <view class="ocr-result-title" wx:else>请确认您的身份信息,若有误请手动修改</view>
  86. <view id="sms-top">
  87. <view class="sms-top-sec ocr-result-sec">
  88. <view class="sms-input-title"><label>姓名</label></view>
  89. <view class="sms-ts-input"><input type="text" bindinput="idnameInputChanged" placeholder="请输入姓名"
  90. disabled="{{!page.ocr.isIdnameAllowEdit}}" value="{{ocr.idname}}" /></view>
  91. </view>
  92. <view class="sms-top-sec ocr-result-sec">
  93. <view class="sms-input-title"><label>身份证</label></view>
  94. <view class="sms-ts-input"><input type="idcard" bindinput="idcartInputChanged" maxlength="18"
  95. placeholder="请输入身份证号" value="{{ocr.idcard}}" disabled="{{!page.ocr.isIdnumberAllowEdit}}" />
  96. </view>
  97. </view>
  98. <view class="sms-top-sec ocr-result-sec" wx:if="{{page.ocr.isAddress}}">
  99. <view class="sms-input-title"><label>住址</label></view>
  100. <view class="sms-ts-input" style="padding:16rpx 0"><textarea type="text"
  101. bindinput="idaddressInputChanged" placeholder="请输入住址" value="{{ocr.idaddress}}"
  102. disabled="{{!page.ocr.isIdaddressAllowEdit}}" auto-height="true"
  103. style="line-height:1.5em;min-height:1.5em;max-height:4.5em;width:100%;"
  104. fixed="true"></textarea></view>
  105. </view>
  106. </view>
  107. <view class="hint-error">{{ocr.hintErrorResult}}</view>
  108. <view class="{{Common.IsWxNative ? 'index-btnNative' : 'index-btn'}}"><button type="primary"
  109. bindtap="ocrInputGoNext" disabled="{{ocr.isForbiddenResultBtn}}"
  110. hover-class="{{Common.IsWxNative ? 'btn-hoverNative' : 'btn-hover'}}">下一步</button></view>
  111. <view class="ocr-risk-tip"><template is="riskTip" wx:if="{{Common.RiskTip}}"
  112. data="{{riskTip: Common.RiskTip}}"></template></view>
  113. </view>
  114. <view wx:if="{{page.ocr.isManualInput}}">
  115. <view id="sms-top">
  116. <view id="sms-top-phone" class="sms-top-sec">
  117. <view class="sms-ts-input"><input type="idcard" auto-focus="true"
  118. bindinput="idcartManualInputChanged" maxlength="18" placeholder="请输入身份证号" /></view>
  119. <view
  120. class="{{Common.IsWxNative ? 'sms-ts-btn sms-ts-btn-enable color-green' : 'sms-ts-btn sms-ts-btn-enable'}}"
  121. bindtap="manualInputTakePhone" wx:if="{{!page.ocr.isHideTakePhoto}}"
  122. style="font-size:17px;margin-right:5px;">拍照</view>
  123. </view>
  124. <view class="sms-top-sec">
  125. <view class="sms-ts-input"><input type="text" placeholder="请输入姓名"
  126. bindinput="idnameManualInputChanged" /></view>
  127. </view>
  128. </view>
  129. <view class="hint-error">{{ocr.hintError}}</view>
  130. <view class="{{Common.IsWxNative ? 'index-btnNative' : 'index-btn'}}"><button type="primary"
  131. bindtap="manualInputGoNext" disabled="{{ocr.isForbiddenManualBtn}}"
  132. hover-class="{{Common.IsWxNative ? 'btn-hoverNative' : 'btn-hover'}}">下一步</button></view>
  133. <view class="ocr-risk-tip"><template is="riskTip" wx:if="{{Common.RiskTip}}"
  134. data="{{riskTip: Common.RiskTip}}"></template></view>
  135. </view>
  136. <view class="verify-footer" wx:if="{{!ocr.isShowTakePhoto || ocr.isShowResult}}">
  137. <view class="verify-footer-logo" style="margin:6rpx 0;" wx:if="{{!page.index.isHideTipsLogo}}">
  138. <image src="http://beta.gtimg.com/GodIdent/huiyan/img/hint-logo.png"></image>
  139. </view>
  140. </view>
  141. </view>
  142. </template>