index.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <view>
  3. <view class="tips" v-if="item.isAuthentication === 1">
  4. <text class="icon">&#xe600;</text>
  5. <text>实名认证成功</text>
  6. </view>
  7. <view class="tips" v-else>
  8. <text class="icon">&#xe634;</text>
  9. <text>为保障资金安全,用户需进行实名认证,请务必认真填写</text>
  10. </view>
  11. <view class="main">
  12. <view class="form">
  13. <view class="form_group">
  14. <view class="lable re">姓名</view>
  15. <input type="text" placeholder="请输入姓名" v-model="item.name" :disabled="item.isAuthentication === 1" />
  16. </view>
  17. <view class="form_group">
  18. <view class="lable re">身份证</view>
  19. <input type="text" placeholder="请输入姓名" v-model="item.idCard" :disabled="item.isAuthentication === 1" />
  20. </view>
  21. </view>
  22. <u-divider text="本人二代身份证"></u-divider>
  23. <view class="r">
  24. <view class="r50">
  25. <card v-model="item.p1" text="点击拍摄/上传人像面" icon="&#xe690;" :read="item.isAuthentication === 1"></card>
  26. </view>
  27. <view class="r50">
  28. <card v-model="item.p2" text="点击拍摄/上传国徽面" icon="&#xe61f;" :read="item.isAuthentication === 1"></card>
  29. </view>
  30. </view>
  31. <button class="btn" @click="save()" v-if="item.isAuthentication != 1">确定</button>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. item: {}
  40. };
  41. },
  42. onLoad() {
  43. this.getData();
  44. },
  45. methods: {
  46. getData() {
  47. this.http.request({
  48. url: '/app/user/info',
  49. data: this.item,
  50. success: (res) => {
  51. this.item = res.data.data;
  52. }
  53. });
  54. },
  55. save() {
  56. let rule = [
  57. { name: 'name', checkType: 'notnull', errorMsg: '请输入姓名' },
  58. { name: 'idCard', checkType: 'notnull', errorMsg: '请输入身份证' },
  59. { name: 'p1', checkType: 'notnull', errorMsg: '请上传身份证人面像' },
  60. { name: 'p2', checkType: 'notnull', errorMsg: '请上传身份证人徽面' }
  61. ];
  62. if (!this.verify.check(this.item, rule)) {
  63. uni.showModal({ content: this.verify.error, showCancel: false });
  64. return false;
  65. }
  66. this.http.request({
  67. url: '/app/user/authentication',
  68. data: this.item,
  69. method: 'POST',
  70. success: (res) => {
  71. uni.showModal({
  72. title: '提示',
  73. content: '提交成功,等待后台审核。',
  74. showCancel: false,
  75. success: (res) => {
  76. uni.navigateBack();
  77. }
  78. });
  79. }
  80. });
  81. }
  82. }
  83. };
  84. </script>
  85. <style lang="scss">
  86. .btn {
  87. margin-top: 30px;
  88. }
  89. </style>