id-card.wxml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <!-- 头图背景 start -->
  2. <view
  3. class="ocr-head-bg ocr-head-bg-{{theme}}"
  4. wx:if="{{!showCamera}}"
  5. ></view>
  6. <!-- 头图背景 end -->
  7. <!-- 功能列表 start -->
  8. <view class="ocr-features-list" wx:if="{{!showCamera}}">
  9. <view class="ocr-features-inner">
  10. <view class="ocr-features-card" data-side="FRONT" bind:tap="onItemTap">
  11. <view class="col-image">
  12. <image
  13. src="{{frontSidePath? frontSidePath : 'https://ocr-static-1254418846.file.myqcloud.com/mpsdk/images/card-id-front.svg'}}"
  14. class="{{frontSidePath? 'photo' : 'image'}}"
  15. mode="aspectFill"></image>
  16. </view>
  17. <view class="col-text">
  18. <view class="title">身份证正面</view>
  19. <view class="text">拍摄正面</view>
  20. </view>
  21. <icon type="{{frontState}}" wx:if="{{frontSidePath}}" color="{{themeColor}}"></icon>
  22. <seal-icon name="add-fill" wx:if="{{!frontSidePath}}" color="{{themeColor}}"></seal-icon>
  23. </view>
  24. <view class="ocr-features-card" data-side="BACK" bind:tap="onItemTap">
  25. <view class="col-image">
  26. <image
  27. src="{{backSidePath? backSidePath : 'https://ocr-static-1254418846.file.myqcloud.com/mpsdk/images/card-id-back.svg'}}"
  28. class="{{backSidePath? 'photo' : 'image'}}"
  29. mode="aspectFill"></image>
  30. </view>
  31. <view class="col-text">
  32. <view class="title">身份证反面</view>
  33. <view class="text">拍摄反面</view>
  34. </view>
  35. <icon type="{{backState}}" wx:if="{{backSidePath}}" color="{{themeColor}}"></icon>
  36. <seal-icon name="add-fill" wx:if="{{!backSidePath}}" color="{{themeColor}}"></seal-icon>
  37. </view>
  38. </view>
  39. </view>
  40. <!-- 功能列表 end -->
  41. <!-- 信息列表区 start -->
  42. <view class="ocr-result-form-list" wx:if="{{!showCamera}}">
  43. <seal-list>
  44. <view wx:for="{{ocrResponse}}" wx:key="index" wx:for-index="key" wx:for-item="value">
  45. <seal-form
  46. border
  47. wx:if="{{value.side==='FRONT'}}"
  48. textAlign="left" labelWidth="4em"
  49. type="{{value.type}}"
  50. autoHeight
  51. label="{{value.title}}"
  52. value="{{value.value}}"
  53. data-key="{{key}}"
  54. bind:input="onResultChange"
  55. readonly="{{!modifiable}}"
  56. ></seal-form>
  57. </view>
  58. <view wx:for="{{ocrResponse}}" wx:key="index" wx:for-index="key" wx:for-item="value">
  59. <seal-form
  60. border
  61. wx:if="{{value.side==='BACK'}}"
  62. textAlign="left" labelWidth="4em"
  63. type="{{value.type}}"
  64. autoHeight
  65. label="{{value.title}}"
  66. value="{{value.value}}"
  67. data-key="{{key}}"
  68. bind:input="onResultChange"
  69. readonly="{{!modifiable}}"
  70. ></seal-form>
  71. </view>
  72. </seal-list>
  73. <view class="btn-media" wx:if="{{ocrResponse}}">
  74. <seal-button color="{{sealTheme}}" bind:tap="onFinished">完成</seal-button>
  75. </view>
  76. </view>
  77. <!-- 信息列表区 end -->
  78. <take-image
  79. id="takeImage"
  80. wx:if="{{showCamera}}"
  81. bind:onImageReady="onImageReady"
  82. option="{{cameraInfo}}"
  83. category="{{category}}"
  84. side="{{selectedSide}}"
  85. theme="{{theme}}"
  86. ></take-image>