smrz.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <view class="content">
  3. <view class="" style="height: 20rpx;">
  4. </view>
  5. <view class="tab">
  6. <view class="tit">
  7. 填写个人信息
  8. </view>
  9. <view class="bd-wrap flex">
  10. <view class="bg-name">
  11. 您的姓名:
  12. </view>
  13. <view class="bg-val">
  14. <input type="text" value="" placeholder="请输入姓名" class="val-ipt" v-model="bankInfo.name" ref="name" />
  15. </view>
  16. </view>
  17. <view class="bd-wrap flex">
  18. <view class="bg-name">
  19. 身份证号:
  20. </view>
  21. <view class="bg-val">
  22. <input type="text" value="" placeholder="请输入身份证号" class="val-ipt" v-model="bankInfo.idcard" ref="idcard" />
  23. </view>
  24. </view>
  25. <view class="tit tit1">
  26. 上传证件
  27. </view>
  28. <view class="" @click="imgsub('sfzz')">
  29. <image :src="bankInfo.sfzz" mode="" class="sfz" v-if="bankInfo.sfzz" ></image>
  30. <image src="../../static/img/sfzz.png" mode="" class="sfz" v-else></image>
  31. </view>
  32. <view class="tip">
  33. 身份证头像面
  34. </view>
  35. <view class="" @click="imgsub('sfzf')">
  36. <image :src="bankInfo.sfzf" mode="" class="sfz" v-if="bankInfo.sfzf"></image>
  37. <image src="../../static/img/sfzf.png" mode="" class="sfz" v-else></image>
  38. </view>
  39. <view class="tip">
  40. 身份证国徽面
  41. </view>
  42. </view>
  43. <view class="btm-btn" @click="bank">
  44. 确认
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import {
  50. mapState,
  51. mapMutations
  52. } from 'vuex';
  53. import {
  54. upload
  55. } from '@/api/order.js';
  56. import {
  57. enroll
  58. } from '@/api/index.js'
  59. import {
  60. getLevelList,
  61. bank,
  62. bankInfo,
  63. realName
  64. } from '@/api/user.js'
  65. export default {
  66. data() {
  67. return {
  68. bankInfo: {
  69. name: '',
  70. idcard: '',
  71. sfzz: '',
  72. sfzf: ''
  73. },
  74. loading: false,
  75. };
  76. },
  77. onLoad(opt) {
  78. },
  79. onShow() {
  80. },
  81. onReachBottom() {
  82. },
  83. computed: {
  84. ...mapState('user', ['userInfo'])
  85. },
  86. methods: {
  87. imgsub(name) {
  88. console.log('上传头像')
  89. upload({
  90. filename: ''
  91. }).then(data => {
  92. console.log("data", data);
  93. this.bankInfo[name] = data[0].url;
  94. })
  95. },
  96. bank() {
  97. let that = this
  98. if (that.loading) {
  99. return
  100. }
  101. if (that.bankInfo.name == '') {
  102. return that.$api.msg('请输入您的姓名')
  103. }
  104. if (that.bankInfo.idcard == '') {
  105. return that.$api.msg('请输入身份证号')
  106. }
  107. if (that.bankInfo.sfzz == '') {
  108. return that.$api.msg('请上传身份证照片')
  109. }
  110. if (that.bankInfo.sfzf == '') {
  111. return that.$api.msg('请上传身份证照片')
  112. }
  113. let data = {
  114. real_name: that.bankInfo.name,
  115. id_card: that.bankInfo.idcard,
  116. id_card_front_image:that.bankInfo.sfzz,
  117. id_card_back_image: that.bankInfo.sfzf
  118. }
  119. that.loading = true
  120. realName(data).then(res => {
  121. console.log(res);
  122. uni.showToast({
  123. title: '提交成功',
  124. duration: 2000
  125. });
  126. setTimeout(() => {
  127. uni.navigateBack()
  128. that.loading = false
  129. }, 1500)
  130. }).catch(err => {
  131. console.log('err');
  132. that.loading = false
  133. })
  134. }
  135. }
  136. };
  137. </script>
  138. <style lang="scss" scoped>
  139. .tab {
  140. width: 690rpx;
  141. margin: auto;
  142. // height: 606rpx;
  143. background: #FFFFFF;
  144. border-radius: 10rpx;
  145. padding: 30rpx 30rpx 99rpx;
  146. .tit {
  147. font-weight: bold;
  148. padding:25rpx 0;
  149. font-size: 38rpx;
  150. font-weight: 500;
  151. color: #333333;
  152. }
  153. .tit1 {
  154. padding-top: 45rpx;
  155. }
  156. }
  157. .bd-wrap {
  158. // width: 690rpx;
  159. // height: 100rpx;
  160. padding: 20rpx 0;
  161. background-color: #fff;
  162. border-bottom: 1px solid #f2f2f2;
  163. // line-height: 100rpx;
  164. font-size: 32rpx;
  165. position: relative;
  166. .code {
  167. position: absolute;
  168. width: 100rpx;
  169. height: 100rpx;
  170. right: 10rpx;
  171. color: #f64342;
  172. font-size: 23rpx;
  173. }
  174. .bg-name {
  175. width: 280rpx;
  176. height: 100%;
  177. // padding-left: 20rpx;
  178. }
  179. .bg-val {
  180. width: 430rpx;
  181. height: 100%;
  182. .val-ipt {
  183. width: 100%;
  184. height: 100%;
  185. // background-color: #009100;
  186. padding-left: 10rpx;
  187. padding-top: 10rpx;
  188. }
  189. }
  190. }
  191. .btm-btn {
  192. margin: 60rpx auto 0;
  193. font-size: 34rpx;
  194. font-weight: 500;
  195. color: #FFFFFF;
  196. text-align: center;
  197. line-height: 82rpx;
  198. width: 560rpx;
  199. height: 80rpx;
  200. background: $base-color;
  201. border-radius: 40rpx;
  202. }
  203. .sfz {
  204. width: 300rpx;
  205. height: 210rpx;
  206. display: block;
  207. margin:35rpx auto;
  208. border-radius: 35rpx;
  209. border: #ececec 1px solid;
  210. }
  211. .tip {
  212. text-align: center;
  213. font-size: 26rpx;
  214. font-weight: 500;
  215. color: #333333;
  216. }
  217. </style>