companyIdentityThree.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. <template>
  2. <view class="center">
  3. <view>
  4. <view style="margin: 0 auto;height: 240px;" v-if="bank1 != ''" @click="bankUp()">
  5. <image v-bind:src="bank1" 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;" v-if="bank2 != ''" @click="bankLow()">
  15. <image v-bind:src="bank2" 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.bankCard"></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" v-model="identityAuthenticationInfo.bankDeposit"></input>
  35. </view>
  36. </view>
  37. <view class="c-row b-b">
  38. <!-- <text class="tit">开户支行</text>
  39. <picker @change="bankChange" :value="bankIndex" :range="bankType" class="con-list">
  40. <view class="con-list">
  41. {{bankIndex>-1?bankType[bankIndex]:'请选择开户支行'}}
  42. </view>
  43. </picker> -->
  44. <text class="tit">开户支行</text>
  45. <view v-if="zhihangStatus" class="con-list">
  46. <picker @change="bankChange" :value="bankIndex" :range="bankType" class="con-list">
  47. <view class="con-list">
  48. {{bankIndex>-1?bankType[bankIndex]:'请选择开户支行'}}
  49. </view>
  50. </picker>
  51. </view>
  52. <view v-else class="con-list">
  53. <input placeholder="请填写" name="input" v-model="identityAuthenticationInfo.bankDepositBranch"></input>
  54. </view>
  55. <button v-if="zhihangStatus" class='cu-btn bg-green shadow' @click="changeZhihang">填写</button>
  56. <button v-else class='cu-btn bg-green shadow' @click="changeZhihang">识别</button>
  57. </view>
  58. <view class="c-row b-b" v-if="identityAuthenticationInfo.customerTypeFlag == 1">
  59. <text class="tit">收款人姓名</text>
  60. <view class="con-list">
  61. <input placeholder="请填写收款人姓名" name="input" v-model="identityAuthenticationInfo.payeeName"></input>
  62. </view>
  63. </view>
  64. <view class="c-row b-b" v-if="identityAuthenticationInfo.customerTypeFlag == 1">
  65. <text class="tit">收款人身份证号</text>
  66. <view class="con-list">
  67. <input placeholder="请填写收款人身份证号" name="input"
  68. v-model="identityAuthenticationInfo.payeeNumberCard"></input>
  69. </view>
  70. </view>
  71. <view class="c-row b-b">
  72. <text class="tit">手机号</text>
  73. <view class="con-list">
  74. <input placeholder="请填写手机号" v-model="identityAuthenticationInfo.customerPhone"></input>
  75. </view>
  76. </view>
  77. <view style='width:100%;border-bottom:1px solid #E8E9ED;position:relative;padding:10px;' class="flex">
  78. <button :class='codestatus&&!sendDisabled?"active":""' @click='obtain'
  79. class='getcode'>{{sendText}}</button>
  80. <view style='width:70%;position:relative;margin-left: 200px;'>
  81. <input v-model='verifyCode' placeholder="请输入验证码" type="number">
  82. </view>
  83. </view>
  84. <view class="c-row b-b" v-if="identityAuthenticationInfo.customerTypeFlag == 2">
  85. <text class="tit">公司地址</text>
  86. <view class="con-list">
  87. <input placeholder="请填写公司地址" name="input" v-model="identityAuthenticationInfo.compAddress"></input>
  88. </view>
  89. </view>
  90. <view class="c-row b-b" v-if="identityAuthenticationInfo.customerTypeFlag == 1">
  91. <text class="tit">联系地址</text>
  92. <view class="con-list">
  93. <input placeholder="请填写联系地址" name="input" v-model="identityAuthenticationInfo.compAddress"></input>
  94. </view>
  95. </view>
  96. <button class="btns btn" @click="commit">提交</button>
  97. </view>
  98. </template>
  99. <script>
  100. import {
  101. mapState
  102. } from 'vuex';
  103. export default {
  104. name: "buy",
  105. data() {
  106. return {
  107. bank1: "../../static/img/authentication/bankup(3).png",
  108. bank2: "../../static/img/authentication/banklow(3).png",
  109. bankid: [],
  110. consentStatus: true,
  111. consentStatus1: false,
  112. codestatus: false,
  113. verifyCode: null,
  114. inputStatus: 'none',
  115. sendText: '获取验证码',
  116. platform: '',
  117. sendDisabled: false,
  118. identityAuthenticationInfo: {},
  119. bankImgs1: {},
  120. bankIndex: -1,
  121. bankType: [],
  122. certificates:true,
  123. certificatesTwo:true,
  124. zhihangStatus:true,
  125. verification:true,
  126. }
  127. },
  128. computed: {
  129. ...mapState(['hasLogin', 'userInfo'])
  130. },
  131. onLoad(options) {
  132. this.identityAuthenticationInfo = JSON.parse(options.identityAuthenticationInfo)
  133. },
  134. methods: {
  135. obtain(){
  136. if(this.sendText == "获取验证码")
  137. this.getcode()
  138. },
  139. bankUp() {
  140. var that = this
  141. wx.chooseImage({
  142. success: function(res) {
  143. wx.uploadFile({
  144. url: 'https://www.zthymaoyi.com/upload/admin',
  145. filePath: res.tempFilePaths[0],
  146. name: 'file',
  147. success(res) {
  148. var data = res.data
  149. var strToObj = JSON.parse(data)
  150. that.bankid[0] = strToObj.url
  151. that.bank1 = strToObj.url
  152. that.certificates = false
  153. that.bankImgs1.bankImg = strToObj.url
  154. that.$api.doRequest('get', '/driverViewInfo/bankShibie', that
  155. .bankImgs1).then(res => {
  156. that.$set(that.identityAuthenticationInfo, 'bankCard', res
  157. .data.data.bankNo)
  158. that.$set(that.identityAuthenticationInfo, 'bankDeposit',
  159. res.data.data.bankName)
  160. that.bankType = res.data.data.bankNameZhihang
  161. }).catch(res => {
  162. uni.showToast({
  163. title: res.data.message,
  164. icon: 'none',
  165. duration: 2000
  166. })
  167. })
  168. }
  169. })
  170. }
  171. })
  172. },
  173. bankLow() {
  174. var that = this
  175. wx.chooseImage({
  176. success: function(res) {
  177. wx.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.bankid[1] = strToObj.url
  185. that.bank2 = strToObj.url
  186. that.certificatesTwo = false
  187. }
  188. })
  189. }
  190. })
  191. },
  192. bankChange(e) {
  193. this.bankIndex = e.detail.value
  194. this.Model = this.bankType[this.bankIndex];
  195. this.identityAuthenticationInfo.bankDepositBranch = this.bankType[this.bankIndex];
  196. },
  197. changeZhihang(){
  198. this.zhihangStatus = !this.zhihangStatus
  199. },
  200. commit() {
  201. if (this.bankid[0] == '' || this.bankid[0] == null) {
  202. this.$api.msg('请上传银行卡正面')
  203. return
  204. }
  205. if (this.bankid[1] == '' || this.bankid[1] == null) {
  206. this.$api.msg('请上传银行卡反面')
  207. return
  208. }
  209. if (!this.identityAuthenticationInfo.bankCard) {
  210. this.$api.msg('银行卡号不能为空')
  211. return
  212. }
  213. if (!this.identityAuthenticationInfo.bankDeposit) {
  214. this.$api.msg('开户行不能为空')
  215. return
  216. }
  217. if (!this.identityAuthenticationInfo.bankDepositBranch) {
  218. this.$api.msg('开户支行不能为空')
  219. return
  220. }
  221. if (!this.identityAuthenticationInfo.customerPhone) {
  222. this.$api.msg('手机号不能为空')
  223. return
  224. }
  225. if (this.identityAuthenticationInfo.customerPhone.length != 11) {
  226. this.$api.msg('手机号填写不正确')
  227. return
  228. }
  229. if(this.identityAuthenticationInfo.customerTypeFlag == 1){
  230. if (!this.identityAuthenticationInfo.payeeName) {
  231. this.$api.msg('收款人姓名不能为空')
  232. return
  233. }
  234. if (!this.identityAuthenticationInfo.payeeNumberCard) {
  235. this.$api.msg('收款人身份证号不能为空')
  236. return
  237. }
  238. if (!this.identityAuthenticationInfo.compAddress) {
  239. this.$api.msg('联系地址不能为空')
  240. return
  241. }
  242. }else if(this.identityAuthenticationInfo.customerTypeFlag == 2){
  243. if (!this.identityAuthenticationInfo.compAddress) {
  244. this.$api.msg('公司地址不能为空')
  245. return
  246. }
  247. }
  248. this.identityAuthenticationInfo.commonId = this.userInfo.id
  249. this.identityAuthenticationInfo.payeeAddressUrl = this.bankid.toString()
  250. this.amendprice()
  251. if(this.verification == false){
  252. return
  253. }
  254. this.$api.doRequest('post', '/identityAuthenticationInfo/api/addIdentityAuthenticationInfo', this
  255. .identityAuthenticationInfo)
  256. .then(res => {
  257. console.log(res.data.message)
  258. if(res.data.message == "Success"){
  259. uni.navigateTo({
  260. url: `/pages/attestation/indexTwo` ,
  261. })
  262. }else{
  263. this.$api.msg(res.data.message)
  264. return
  265. }
  266. }).catch(res => {
  267. uni.showToast({
  268. title: res.data.message,
  269. icon: 'none',
  270. duration: 2000
  271. })
  272. })
  273. },
  274. phoneinput(e){
  275. if(e.detail.value.length==11){
  276. this.codestatus=true
  277. }
  278. },
  279. amendprice(item) {
  280. var that = this
  281. this.$api.doRequest('get', '/commonUser/loginVerifyCode', {
  282. phone: this.identityAuthenticationInfo.customerPhone,
  283. verifyCode: this.verifyCode
  284. }).then(res => {
  285. if (res.data.code == 200) {
  286. } else {
  287. that.verification = false
  288. uni.showToast({
  289. title: res.data.message,
  290. icon: 'none',
  291. duration: 2000
  292. })
  293. return false
  294. }
  295. })
  296. .catch(res => {
  297. that.verification = false
  298. uni.showToast({
  299. title: res.data.message,
  300. icon: 'none',
  301. duration: 2000
  302. })
  303. return false
  304. });
  305. },
  306. getcode() {
  307. var that = this
  308. if (/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.identityAuthenticationInfo.customerPhone)) {
  309. this.$api.doRequest('get', '/commonUser/sendVerifyCode', {
  310. phone: this.identityAuthenticationInfo.customerPhone
  311. }).then(res => {
  312. if (res.data.code == 200) {
  313. that.sendDisabled = true
  314. let sec = 60
  315. let interval = setInterval(() => {
  316. sec--;
  317. that.sendText = sec + 's后重发'
  318. if (sec <= 0) {
  319. that.sendDisabled = false
  320. that.sendText = "获取验证码"
  321. clearInterval(interval)
  322. }
  323. }, 1000)
  324. } else {
  325. uni.showToast({
  326. title: res.data.message,
  327. icon: 'none',
  328. duration: 2000
  329. })
  330. return
  331. }
  332. })
  333. .catch(res => {
  334. uni.showToast({
  335. title: res.data.message,
  336. icon: 'none',
  337. duration: 2000
  338. })
  339. return
  340. });
  341. } else {
  342. uni.showToast({
  343. title: '请输入正确的手机号',
  344. icon: 'none',
  345. duration: 2000
  346. })
  347. }
  348. },
  349. }
  350. }
  351. </script>
  352. <style>
  353. .center {
  354. padding: 10px 20px;
  355. background-color: #F5F6FA;
  356. }
  357. .c-row {
  358. display: -webkit-box;
  359. display: -webkit-flex;
  360. display: flex;
  361. -webkit-box-align: center;
  362. -webkit-align-items: center;
  363. align-items: center;
  364. padding: 20rpx 30rpx;
  365. position: relative;
  366. }
  367. .con-list {
  368. -webkit-box-flex: 1;
  369. -webkit-flex: 1;
  370. flex: 1;
  371. display: -webkit-box;
  372. display: -webkit-flex;
  373. display: flex;
  374. -webkit-box-orient: vertical;
  375. -webkit-box-direction: normal;
  376. -webkit-flex-direction: column;
  377. flex-direction: column;
  378. color: #303133;
  379. line-height: 40rpx;
  380. text-align: right;
  381. padding-right: 20rpx;
  382. font-size: 14px;
  383. }
  384. .btn {
  385. margin-top: 10px;
  386. background-color: #FFFFFF;
  387. border-radius: 25px;
  388. border: none;
  389. }
  390. .btns {
  391. background-color: #22C572;
  392. }
  393. .picture {
  394. width: 100%;
  395. height: 220px;
  396. text-align: center;
  397. margin-top: 10px;
  398. }
  399. .getcode {
  400. font-size: 14px;
  401. position: absolute;
  402. top: 50%;
  403. transform: translateY(-50%);
  404. color: #AFB3BF;
  405. background: #F5F6F9;
  406. height: 30px;
  407. line-height: 30px;
  408. }
  409. .getcode.active {
  410. border: none;
  411. }
  412. .words{
  413. font-size: 18px;
  414. font-weight: 600;
  415. color: #617E8B;
  416. }
  417. .floats{
  418. position: relative;
  419. top: -150px;
  420. text-align: center;
  421. }
  422. </style>