companyIdentity.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <template>
  2. <view class="center">
  3. <view>
  4. <text @click='consent' v-bind:class="switchs1">公司</text>
  5. <text @click='consent' v-bind:class="switchs2">个人</text>
  6. </view>
  7. <view v-if="consentStatus == true">
  8. <view>
  9. <view style="margin: 0 auto;height: 240px;" v-if="license1 != ''" @click="license">
  10. <image v-bind:src="license1" class="picture"></image>
  11. <view class="floats" v-if="certificates == true">
  12. <image src="../../static/img/authentication/xiangji@3x.png" style="width: 60px;height: 50px;">
  13. </image>
  14. <view class="words">
  15. 上传营业执照
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="c-row b-b">
  21. <text class="tit">公司名称</text>
  22. <view class="con-list">
  23. <input placeholder="请填写公司名称" name="input" v-model="identityAuthenticationInfo.compName"></input>
  24. </view>
  25. </view>
  26. <view class="c-row b-b">
  27. <text class="tit">纳税人识别号</text>
  28. <view class="con-list">
  29. <input placeholder="请填写纳税人识别号" name="input"
  30. v-model="identityAuthenticationInfo.payTaxesCard"></input>
  31. </view>
  32. </view>
  33. </view>
  34. <view v-else>
  35. <view>
  36. <view style="margin: 0 auto;" @click="idUp">
  37. <image v-bind:src="id1" class="picture"></image>
  38. </view>
  39. <view style="margin: 0 auto;" @click="idLow">
  40. <image v-bind:src="id2" class="picture"></image>
  41. </view>
  42. </view>
  43. <view class="c-row b-b">
  44. <text class="tit">姓名</text>
  45. <view class="con-list">
  46. <input placeholder="请填写姓名" name="input" v-model="identityAuthenticationInfo.customerName"></input>
  47. </view>
  48. </view>
  49. <view class="c-row b-b">
  50. <text class="tit">身份证号</text>
  51. <view class="con-list">
  52. <input placeholder="请填写身份证号" name="input"
  53. v-model="identityAuthenticationInfo.customerNumberCard"></input>
  54. </view>
  55. </view>
  56. </view>
  57. <button class="btns btn" @click="jumpUrl">下一步</button>
  58. </view>
  59. </template>
  60. <script>
  61. import {
  62. mapState
  63. } from 'vuex';
  64. export default {
  65. name: "buy",
  66. data() {
  67. return {
  68. tupian: "",
  69. inputContent: null,
  70. customerPhone: '',
  71. consentStatus: true,
  72. consentStatus1: false,
  73. codestatus: false,
  74. verifyCode: null,
  75. inputStatus: 'none',
  76. sendText: '获取验证码',
  77. platform: '',
  78. sendDisabled: false,
  79. license1: "../../static/img/authentication/business@3x.png",
  80. switchs1: "switchs1",
  81. switchs2: "switchs2",
  82. id: [],
  83. id1: "../../static/img/authentication/identityup(3).png",
  84. id2: "../../static/img/authentication/identitylow(3).png",
  85. identityImgs1: {},
  86. identityAuthenticationInfo: {},
  87. tempFilePaths: [],
  88. businessLicenseAddressUrl: "",
  89. certificates: true,
  90. };
  91. },
  92. computed: {
  93. ...mapState(['hasLogin', 'userInfo'])
  94. },
  95. methods: {
  96. jumpUrl() {
  97. if (this.consentStatus) {
  98. if (!this.identityAuthenticationInfo.compName) {
  99. this.$api.msg('公司名称不能为空')
  100. return
  101. }
  102. if (this.identityAuthenticationInfo.compName.length < 2 || this.identityAuthenticationInfo.compName.length > 25) {
  103. this.$api.msg('公司名称输入错误')
  104. return
  105. }
  106. if (!this.identityAuthenticationInfo.payTaxesCard) {
  107. this.$api.msg('纳税人识别号不能为空')
  108. return
  109. }
  110. if (this.identityAuthenticationInfo.payTaxesCard.length < 15 || this.identityAuthenticationInfo.payTaxesCard.length > 20) {
  111. this.$api.msg('纳税人识别号输入错误')
  112. return
  113. }
  114. if (this.identityAuthenticationInfo.businessLicenseAddressUrl == "" || this.identityAuthenticationInfo
  115. .businessLicenseAddressUrl == null) {
  116. this.$api.msg('请上传营业执照')
  117. return
  118. }
  119. this.identityAuthenticationInfo.customerTypeFlag = "2"
  120. this.identityAuthenticationInfo.customerType = "企业"
  121. var model = JSON.stringify(this.identityAuthenticationInfo);
  122. uni.navigateTo({
  123. url: `/pageD/identity/companyIdentityTwo?identityAuthenticationInfo=` + model,
  124. })
  125. } else if (this.consentStatus1) {
  126. this.identityAuthenticationInfo.cardAddressUrl = this.id.toString()
  127. if (this.id[0] == '' || this.id[0] == null) {
  128. this.$api.msg('请上传身份证正面')
  129. return
  130. }
  131. if (this.id[1] == '' || this.id[1] == null) {
  132. this.$api.msg('请上传身份证反面')
  133. return
  134. }
  135. if (!this.identityAuthenticationInfo.customerName) {
  136. this.$api.msg('姓名不能为空')
  137. return
  138. }
  139. if (this.identityAuthenticationInfo.customerName.length < 2 || this.identityAuthenticationInfo.customerName.length > 10) {
  140. this.$api.msg('姓名输入错误')
  141. return
  142. }
  143. if (!this.identityAuthenticationInfo.customerNumberCard) {
  144. this.$api.msg('身份证号不能为空')
  145. return
  146. }
  147. if (this.identityAuthenticationInfo.customerNumberCard.length != 18) {
  148. this.$api.msg('身份证号输入错误')
  149. return
  150. }
  151. this.identityAuthenticationInfo.customerTypeFlag = "1"
  152. this.identityAuthenticationInfo.customerType = "个人"
  153. var model = JSON.stringify(this.identityAuthenticationInfo);
  154. uni.navigateTo({
  155. url: `/pageD/identity/companyIdentityThree?identityAuthenticationInfo=` + model,
  156. })
  157. }
  158. },
  159. consent() {
  160. if (this.consentStatus == false && this.consentStatus1 == true) {
  161. this.consentStatus = true
  162. this.consentStatus1 = false
  163. this.switchs1 = "switchs1"
  164. this.switchs2 = "switchs2"
  165. } else if (this.consentStatus == true && this.consentStatus1 == false) {
  166. this.consentStatus = false
  167. this.consentStatus1 = true
  168. this.switchs1 = "switchs2"
  169. this.switchs2 = "switchs1"
  170. }
  171. },
  172. license() {
  173. var that = this
  174. uni.chooseImage({
  175. count:1,
  176. success: function(res) {
  177. uni.uploadFile({
  178. url: 'https://www.zthymaoyi.com/upload/admin',
  179. filePath: res.tempFilePaths[0],
  180. name: 'file',
  181. success(res) {
  182. var data = res.data
  183. var strToObj = JSON.parse(data)
  184. that.identityAuthenticationInfo.businessLicenseAddressUrl = strToObj.url
  185. that.license1 = strToObj.url
  186. that.certificates = false
  187. }
  188. })
  189. }
  190. })
  191. },
  192. idUp(){
  193. var that = this
  194. uni.chooseImage({
  195. count:1,
  196. success: function(res) {
  197. uni.uploadFile({
  198. url: 'https://www.zthymaoyi.com/upload/admin',
  199. filePath: res.tempFilePaths[0],
  200. name: 'file',
  201. success(res) {
  202. var data = res.data
  203. var strToObj = JSON.parse(data)
  204. that.id[0] = strToObj.url
  205. that.id1 = strToObj.url
  206. that.identityImgs1.personImg = strToObj.url
  207. that.$api.doRequest('get', '/driverViewInfo/personShibie', that.identityImgs1).then(res => {
  208. if(res.data.data.recPerson != null){
  209. if(res.data.data.recPerson != ""){
  210. that.$set(that.identityAuthenticationInfo,'customerName',res.data.data.recPerson)
  211. }
  212. }
  213. if(res.data.data.recPersonNo != null){
  214. if(res.data.data.recPersonNo != ""){
  215. that.$set(that.identityAuthenticationInfo,'customerNumberCard',res.data.data.recPersonNo)
  216. }
  217. }
  218. }).catch(res => {
  219. uni.showToast({
  220. title: res.data.message,
  221. icon: 'none',
  222. duration: 2000
  223. })
  224. })
  225. }
  226. })
  227. }
  228. })
  229. },
  230. idLow(){
  231. var that = this
  232. uni.chooseImage({
  233. count:1,
  234. success: function(res) {
  235. uni.uploadFile({
  236. url: 'https://www.zthymaoyi.com/upload/admin',
  237. filePath: res.tempFilePaths[0],
  238. name: 'file',
  239. success(res) {
  240. var data = res.data
  241. var strToObj = JSON.parse(data)
  242. that.id[1] = strToObj.url
  243. that.id2 = strToObj.url
  244. that.identityImgs1.personImg = strToObj.url
  245. that.$api.doRequest('get', '/driverViewInfo/personShibie', that.identityImgs1).then(res => {
  246. if(res.data.data.recPerson != null){
  247. if(res.data.data.recPerson != ""){
  248. that.$set(that.identityAuthenticationInfo,'customerName',res.data.data.recPerson)
  249. }
  250. }
  251. if(res.data.data.recPersonNo != null){
  252. if(res.data.data.recPersonNo != ""){
  253. that.$set(that.identityAuthenticationInfo,'customerNumberCard',res.data.data.recPersonNo)
  254. }
  255. }
  256. }).catch(res => {
  257. uni.showToast({
  258. title: res.data.message,
  259. icon: 'none',
  260. duration: 2000
  261. })
  262. })
  263. }
  264. })
  265. }
  266. })
  267. },
  268. phoneinput(e) {
  269. if (e.detail.value.length == 11) {
  270. this.codestatus = true
  271. }
  272. },
  273. verifyCodeInput(e) {
  274. this.verifyCode = e.detail.value
  275. },
  276. cancel() {
  277. this.inputShow = false
  278. this.inputStatus = 'none'
  279. this.isPhone = false
  280. },
  281. },
  282. }
  283. </script>
  284. <style>
  285. .center {
  286. padding: 10px 20px;
  287. }
  288. .c-row {
  289. display: -webkit-box;
  290. display: -webkit-flex;
  291. display: flex;
  292. -webkit-box-align: center;
  293. -webkit-align-items: center;
  294. align-items: center;
  295. padding: 20rpx 30rpx;
  296. position: relative;
  297. }
  298. .con-list {
  299. -webkit-box-flex: 1;
  300. -webkit-flex: 1;
  301. flex: 1;
  302. display: -webkit-box;
  303. display: -webkit-flex;
  304. display: flex;
  305. -webkit-box-orient: vertical;
  306. -webkit-box-direction: normal;
  307. -webkit-flex-direction: column;
  308. flex-direction: column;
  309. color: #303133;
  310. line-height: 40rpx;
  311. text-align: right;
  312. padding-right: 20rpx;
  313. font-size: 14px;
  314. }
  315. .uni-navigator {
  316. display: inline-block;
  317. color: #22C572;
  318. }
  319. .getcode.active {
  320. background: #22C572;
  321. color: #fff;
  322. }
  323. .btn {
  324. margin-top: 10px;
  325. background-color: #FFFFFF;
  326. border-radius: 25px;
  327. border: none;
  328. }
  329. .btns {
  330. background-color: #22C572;
  331. color: white;
  332. }
  333. .switchs1 {
  334. font-size: 20px;
  335. font-weight: 700;
  336. margin-right: 16px;
  337. }
  338. .switchs2 {
  339. font-size: 20px;
  340. margin-right: 16px;
  341. }
  342. .picture {
  343. width: 100%;
  344. height: 220px;
  345. text-align: center;
  346. margin-top: 10px;
  347. }
  348. .words {
  349. font-size: 18px;
  350. font-weight: 600;
  351. color: #617E8B;
  352. }
  353. .floats {
  354. position: relative;
  355. top: -150px;
  356. text-align: center;
  357. }
  358. </style>