index.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <view class="main">
  3. <view class="form">
  4. <view class="form_group">
  5. <view class="lable re">姓名</view>
  6. <input type="text" placeholder="请输入姓名" v-model="item.name" />
  7. </view>
  8. <view class="form_group">
  9. <view class="lable re">身份证</view>
  10. <input type="text" placeholder="请输入姓名" v-model="item.idCard" />
  11. </view>
  12. </view>
  13. <card v-model="item.p1"></card>
  14. <card v-model="item.p2"></card>
  15. <button class="btn" @click="save()">确定</button>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. data() {
  21. return {
  22. item: {}
  23. };
  24. },
  25. methods: {
  26. save() {
  27. let rule = [
  28. { name: 'name', checkType: 'notnull', errorMsg: '请输入姓名' },
  29. { name: 'idCard', checkType: 'notnull', errorMsg: '请输入身份证' },
  30. { name: 'p1', checkType: 'notnull', errorMsg: '请上传身份证人面像' },
  31. { name: 'p2', checkType: 'notnull', errorMsg: '请上传身份证人徽面' }
  32. ];
  33. if (!this.verify.check(this.item, rule)) {
  34. uni.showModal({ content: this.verify.error, showCancel: false });
  35. return false;
  36. }
  37. this.http.request({
  38. url: '/app/user/authentication',
  39. data: this.item,
  40. method: 'POST',
  41. success: (res) => {
  42. uni.showModal({
  43. title: '提示',
  44. content: '提交成功,等待后台审核。',
  45. showCancel: false,
  46. success: (res) => {
  47. uni.navigateBack();
  48. }
  49. });
  50. }
  51. });
  52. }
  53. }
  54. };
  55. </script>
  56. <style lang="scss"></style>