companyIdentityTwo.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <view class="center">
  3. <view>
  4. <view style="margin: 0 auto;" @click="idUp">
  5. <image v-bind:src = "id1" class="picture"></image>
  6. </view>
  7. <view style="margin: 0 auto;" @click="idLow">
  8. <image v-bind:src = "id2" class="picture"></image>
  9. </view>
  10. </view>
  11. <view class="c-row b-b">
  12. <text class="tit">姓名</text>
  13. <view class="con-list">
  14. <input placeholder="请填写姓名" name="input" v-model="identityAuthenticationInfo.customerName"></input>
  15. </view>
  16. </view>
  17. <view class="c-row b-b">
  18. <text class="tit">身份证号</text>
  19. <view class="con-list">
  20. <input placeholder="请填写身份证号" name="input"
  21. v-model="identityAuthenticationInfo.customerNumberCard"></input>
  22. </view>
  23. </view>
  24. <button class="btns btn" @click="jumpUrl">下一步</button>
  25. </view>
  26. </template>
  27. <script>
  28. import {
  29. mapState
  30. } from 'vuex';
  31. export default {
  32. name: "buy",
  33. data() {
  34. return {
  35. id:[],
  36. id1:"../../static/img/authentication/identityup(3).png",
  37. id2:"../../static/img/authentication/identitylow(3).png",
  38. identityImgs1:{},
  39. identityAuthenticationInfo:{},
  40. }
  41. },
  42. onLoad(options){
  43. this.identityAuthenticationInfo = JSON.parse(options.identityAuthenticationInfo)
  44. console.log(this.identityAuthenticationInfo)
  45. },
  46. methods:{
  47. jumpUrl(){
  48. this.identityAuthenticationInfo.cardAddressUrl = this.id.toString()
  49. if(this.id[0] == '' || this.id[0] == null){
  50. this.$api.msg('请上传身份证正面')
  51. return
  52. }
  53. if(this.id[1] == '' || this.id[1] == null){
  54. this.$api.msg('请上传身份证反面')
  55. return
  56. }
  57. if (!this.identityAuthenticationInfo.customerName) {
  58. this.$api.msg('姓名不能为空')
  59. return
  60. }
  61. if (!this.identityAuthenticationInfo.customerNumberCard) {
  62. this.$api.msg('身份证号不能为空')
  63. return
  64. }
  65. var model = JSON.stringify(this.identityAuthenticationInfo);
  66. uni.navigateTo({
  67. url: `/pageD/identity/companyIdentityThree?identityAuthenticationInfo=` + model,
  68. })
  69. },
  70. idUp(){
  71. var that = this
  72. wx.chooseImage({
  73. success: function(res) {
  74. wx.uploadFile({
  75. url: 'https://www.zthymaoyi.com/upload/admin',
  76. filePath: res.tempFilePaths[0],
  77. name: 'file',
  78. success(res) {
  79. var data = res.data
  80. var strToObj = JSON.parse(data)
  81. that.id[0] = strToObj.url
  82. that.id1 = strToObj.url
  83. that.identityImgs1.personImg = strToObj.url
  84. that.$api.doRequest('get', '/driverViewInfo/personShibie', that.identityImgs1).then(res => {
  85. that.$set(that.identityAuthenticationInfo,'customerName',res.data.data.recPerson)
  86. that.$set(that.identityAuthenticationInfo,'customerNumberCard',res.data.data.recPersonNo)
  87. }).catch(res => {
  88. uni.showToast({
  89. title: res.data.message,
  90. icon: 'none',
  91. duration: 2000
  92. })
  93. })
  94. }
  95. })
  96. }
  97. })
  98. },
  99. idLow(){
  100. var that = this
  101. wx.chooseImage({
  102. success: function(res) {
  103. wx.uploadFile({
  104. url: 'https://www.zthymaoyi.com/upload/admin',
  105. filePath: res.tempFilePaths[0],
  106. name: 'file',
  107. success(res) {
  108. var data = res.data
  109. var strToObj = JSON.parse(data)
  110. that.id[1] = strToObj.url
  111. that.id2 = strToObj.url
  112. }
  113. })
  114. }
  115. })
  116. },
  117. }
  118. }
  119. </script>
  120. <style>
  121. .center {
  122. padding: 10px 20px;
  123. background-color: #F5F6FA;
  124. }
  125. .c-row {
  126. display: -webkit-box;
  127. display: -webkit-flex;
  128. display: flex;
  129. -webkit-box-align: center;
  130. -webkit-align-items: center;
  131. align-items: center;
  132. padding: 20rpx 30rpx;
  133. position: relative;
  134. }
  135. .con-list {
  136. -webkit-box-flex: 1;
  137. -webkit-flex: 1;
  138. flex: 1;
  139. display: -webkit-box;
  140. display: -webkit-flex;
  141. display: flex;
  142. -webkit-box-orient: vertical;
  143. -webkit-box-direction: normal;
  144. -webkit-flex-direction: column;
  145. flex-direction: column;
  146. color: #303133;
  147. line-height: 40rpx;
  148. text-align: right;
  149. padding-right: 20rpx;
  150. font-size: 14px;
  151. }
  152. .btn {
  153. margin-top: 10px;
  154. background-color: #FFFFFF;
  155. border-radius: 25px;
  156. border: none;
  157. }
  158. .btns {
  159. background-color: #22C572;
  160. }
  161. .picture{
  162. width: 100%;
  163. height: 220px;
  164. text-align: center;
  165. margin-top: 10px;
  166. }
  167. </style>