IDcard.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <view>
  3. <u-field v-model="name" class="mlr-36" label-width="0" placeholder="请输入真实姓名"></u-field>
  4. <u-field v-model="idcard" class="mlr-36" label-width="0" placeholder="请输入身份证号码"></u-field>
  5. <view class="mlr-36">
  6. <view class="mt-40 size-32">
  7. 上传证件
  8. </view>
  9. <view class="img text-center mt-30">
  10. <image :src="img1" mode="" @click="chooseImg1"></image>
  11. </view>
  12. <view class="size-28 text-center mt-10">
  13. 点击上传<text class="ml-10" style="color: #FF5C50;">人像面</text>
  14. </view>
  15. <view class="img text-center mt-60">
  16. <image :src="img2" mode="" @click="chooseImg2"></image>
  17. </view>
  18. <view class="size-28 text-center mt-10">
  19. 点击上传<text class="ml-10" style="color: #FF5C50;">国徽面</text>
  20. </view>
  21. </view>
  22. <u-button type="primary" :disabled="!name || !idcard || !imgurl1 || !imgurl2" class="mt-60" @click="submit">提交审核</u-button>
  23. </view>
  24. </template>
  25. <script>
  26. import {upload} from '../../common/common.js'
  27. export default {
  28. data() {
  29. return {
  30. name:'',
  31. idcard:'',
  32. img1:'../../static/IDcard-1.png',
  33. imgurl1:'',
  34. img2:'../../static/IDcard-2.png',
  35. imgurl2:'',
  36. submitbtn:true
  37. }
  38. },
  39. methods: {
  40. chooseImg1(){
  41. upload().then(data=>{
  42. this.img1 = data[0].img1
  43. this.imgurl1 = data[0].img2
  44. })
  45. },
  46. chooseImg2(){
  47. upload().then(data=>{
  48. this.img2 = data[0].img1
  49. this.imgurl2 = data[0].img2
  50. })
  51. },
  52. submit(){
  53. if(this.submitbtn == true){
  54. this.submitbtn = false
  55. this.$http('/addons/ddrive/user/verified',{
  56. type:1,
  57. truename: this.name,
  58. idcard: this.idcard,
  59. front_card_image: this.imgurl1,
  60. back_card_image: this.imgurl2,
  61. sign_areas:'',
  62. areas:'',
  63. driver_license:'',
  64. driver_front_image:'',
  65. driver_back_image:'',
  66. card_brand:'',
  67. card_type:'',
  68. number_plate:'',
  69. card_front_image:'',
  70. card_back_image:''
  71. },"POST").then(data=>{
  72. this.$store.dispatch('updateUserInfo')
  73. uni.showToast({
  74. title: '提交成功,请耐心等待',
  75. icon:'none'
  76. })
  77. setTimeout(()=>{
  78. uni.navigateBack({})
  79. },1000)
  80. }).catch(data=>{
  81. this.submitbtn = true
  82. })
  83. }
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. /deep/.u-field{
  90. padding: 13px 0 !important;
  91. }
  92. /deep/.u-btn{
  93. height: 96rpx !important;
  94. }
  95. /deep/.u-primary-hover {
  96. background-color: $blue !important;
  97. }
  98. /deep/.u-btn--primary--disabled {
  99. background-color: $bg-1 !important;
  100. }
  101. .img{
  102. image{
  103. width: 398rpx;
  104. height: 254rpx;
  105. }
  106. }
  107. </style>