companyIdentity.vue 7.9 KB

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