idPhoto.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view class="page">
  3. <view class="dis j-s a-c">
  4. <view class="item dis f-c a-c mr-2">
  5. <image :src="frontImg?frontImg:'/static/image/my/idCardfront.png'" mode=""></image>
  6. <text>人像面</text>
  7. </view>
  8. <view class="item dis f-c a-c">
  9. <image :src="backImg?backImg:'/static/image/my/idCardback.png'" mode=""></image>
  10. <text>国徽面</text>
  11. </view>
  12. </view>
  13. <u-empty v-if="!frontImg && !backImg" mode="car" icon="/static/image/Empty2.png" text="请先完成实名认证">
  14. </u-empty>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. frontImg: null, //正面
  22. backImg: null, //反面
  23. }
  24. },
  25. onShow() {
  26. },
  27. onLoad(options) {
  28. if (options.list) {
  29. const list = JSON.parse(decodeURIComponent(options.list));
  30. list.forEach(val => {
  31. if (val.fileType == 'sfz1') {
  32. this.frontImg = val.fileUrl;
  33. } else {
  34. this.backImg = val.fileUrl;
  35. }
  36. })
  37. }
  38. },
  39. methods: {
  40. }
  41. }
  42. </script>
  43. <style lang="scss" scoped>
  44. page {
  45. background-color: #f8f8f8;
  46. padding: 30rpx;
  47. box-sizing: border-box;
  48. }
  49. .item {
  50. flex: 1;
  51. image {
  52. width: 100%;
  53. height: 208rpx;
  54. border-radius: 4rpx;
  55. }
  56. text {
  57. margin-top: 20rpx;
  58. font-size: 28rpx;
  59. color: #333;
  60. }
  61. }
  62. .u-empty {
  63. width: 100%;
  64. position: absolute;
  65. top: 20%;
  66. left: 50%;
  67. transform: translate(-50%);
  68. }
  69. </style>