info.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <view class="cmain">
  3. <view class="form_group">
  4. <view class="lable re">认证类型</view>
  5. <u-radio-group v-model="item.type" style="margin-top: 15px;">
  6. <u-radio :name=1 label="企业收购商"></u-radio>
  7. <u-radio :name=2 label="个人收购商" style="margin-left: 20px;"></u-radio>
  8. </u-radio-group>
  9. </view>
  10. <view class="form_group">
  11. <view class="lable re">(企业)名称</view>
  12. <input type="text" placeholder="请输入" v-model="item.name" />
  13. </view>
  14. <view class="form_group">
  15. <view class="lable re">(法人)姓名</view>
  16. <input type="text" placeholder="请输入" v-model="item.legalPerson" />
  17. </view>
  18. <view class="form_group">
  19. <view class="lable re">身份证</view>
  20. <input type="text" placeholder="请输入" v-model="item.idCard" />
  21. </view>
  22. <view class="form_group">
  23. <view class="lable re">联系号码</view>
  24. <input type="text" placeholder="请输入" v-model="item.contact" />
  25. </view>
  26. <view class="form_group">
  27. <view class="lable re">银行账号</view>
  28. <input type="text" placeholder="请输入" v-model="item.bankAccount" />
  29. </view>
  30. <view class="form_group" v-if="item.type==1">
  31. <view class="lable re">营业执照</view>
  32. <card v-model="item.businessLicense" pic="../../static/images/yyzz.png"></card>
  33. </view>
  34. <button class="btn" @click="save()" v-if="item.judgeStatus != 1">提交审核</button>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. data() {
  40. return {
  41. item: {}
  42. };
  43. },
  44. onLoad(e) {
  45. this.http.request({
  46. url: '/level-two-server/app/TbPurchaser/info',
  47. success: res => {
  48. if (res.data.data) {
  49. this.item = res.data.data;
  50. uni.setNavigationBarTitle({
  51. title: '我的认证资料'
  52. });
  53. } else {
  54. this.item.type = 1
  55. uni.setNavigationBarTitle({
  56. title: '填写认证资料'
  57. });
  58. }
  59. }
  60. });
  61. },
  62. methods: {
  63. save() {
  64. let rule = [{
  65. name: 'name',
  66. checkType: 'notnull',
  67. errorMsg: '请填写(企业)名称'
  68. },
  69. {
  70. name: 'legalPerson',
  71. checkType: 'notnull',
  72. errorMsg: '请填写(法人)姓名'
  73. },
  74. {
  75. name: 'idCard',
  76. checkType: 'notnull',
  77. errorMsg: '请填写身份证'
  78. },
  79. {
  80. name: 'contact',
  81. checkType: 'notnull',
  82. errorMsg: '请填写联系号码'
  83. },
  84. {
  85. name: 'bankAccount',
  86. checkType: 'notnull',
  87. errorMsg: '请填写银行账号'
  88. },
  89. ];
  90. if (this.item.type == 1) {
  91. rule.push({
  92. name: 'businessLicense',
  93. checkType: 'notnull',
  94. errorMsg: '请上传营业执照'
  95. } )
  96. }
  97. if (!this.verify.check(this.item, rule)) {
  98. uni.showModal({
  99. content: this.verify.error,
  100. showCancel: false
  101. });
  102. return false;
  103. }
  104. this.http.request({
  105. url: '/level-two-server/app/TbPurchaser/identification',
  106. method: 'POST',
  107. data: this.item,
  108. success: res => {
  109. uni.showToast({
  110. title: '提交成功'
  111. });
  112. setTimeout(() => {
  113. uni.$emit('authentication');
  114. uni.navigateBack();
  115. }, 1000);
  116. }
  117. });
  118. }
  119. }
  120. };
  121. </script>
  122. <style lang="scss">
  123. .btn {
  124. margin-top: 25px;
  125. }
  126. </style>