companyIdentityTwo.vue 6.3 KB

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