index.vue 2.0 KB

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