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