companyIdentityThree.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  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='getcode'
  79. class='getcode'>{{sendText}}</button>
  80. <view style='width:70%;position:relative;margin-left: 200px;'>
  81. <input v-model='verifyCode' placeholder="请输入验证码" type="text">
  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. }
  126. },
  127. computed: {
  128. ...mapState(['hasLogin', 'userInfo'])
  129. },
  130. onLoad(options) {
  131. this.identityAuthenticationInfo = JSON.parse(options.identityAuthenticationInfo)
  132. },
  133. methods: {
  134. bankUp() {
  135. var that = this
  136. wx.chooseImage({
  137. success: function(res) {
  138. wx.uploadFile({
  139. url: 'https://www.zthymaoyi.com/upload/admin',
  140. filePath: res.tempFilePaths[0],
  141. name: 'file',
  142. success(res) {
  143. var data = res.data
  144. var strToObj = JSON.parse(data)
  145. that.bankid[0] = strToObj.url
  146. that.bank1 = strToObj.url
  147. that.certificates = false
  148. that.bankImgs1.bankImg = strToObj.url
  149. that.$api.doRequest('get', '/driverViewInfo/bankShibie', that
  150. .bankImgs1).then(res => {
  151. that.$set(that.identityAuthenticationInfo, 'bankCard', res
  152. .data.data.bankNo)
  153. that.$set(that.identityAuthenticationInfo, 'bankDeposit',
  154. res.data.data.bankName)
  155. that.bankType = res.data.data.bankNameZhihang
  156. }).catch(res => {
  157. uni.showToast({
  158. title: res.data.message,
  159. icon: 'none',
  160. duration: 2000
  161. })
  162. })
  163. }
  164. })
  165. }
  166. })
  167. },
  168. bankLow() {
  169. var that = this
  170. wx.chooseImage({
  171. success: function(res) {
  172. wx.uploadFile({
  173. url: 'https://www.zthymaoyi.com/upload/admin',
  174. filePath: res.tempFilePaths[0],
  175. name: 'file',
  176. success(res) {
  177. var data = res.data
  178. var strToObj = JSON.parse(data)
  179. that.bankid[1] = strToObj.url
  180. that.bank2 = strToObj.url
  181. that.certificatesTwo = false
  182. }
  183. })
  184. }
  185. })
  186. },
  187. bankChange(e) {
  188. this.bankIndex = e.detail.value
  189. this.Model = this.bankType[this.bankIndex];
  190. this.identityAuthenticationInfo.bankDepositBranch = this.bankType[this.bankIndex];
  191. },
  192. changeZhihang(){
  193. this.zhihangStatus = !this.zhihangStatus
  194. },
  195. commit() {
  196. if (this.bankid[0] == '' || this.bankid[0] == null) {
  197. this.$api.msg('请上传银行卡正面')
  198. return
  199. }
  200. if (this.bankid[1] == '' || this.bankid[1] == null) {
  201. this.$api.msg('请上传银行卡反面')
  202. return
  203. }
  204. if (!this.identityAuthenticationInfo.bankCard) {
  205. this.$api.msg('银行卡号不能为空')
  206. return
  207. }
  208. if (!this.identityAuthenticationInfo.bankDeposit) {
  209. this.$api.msg('开户行不能为空')
  210. return
  211. }
  212. if (!this.identityAuthenticationInfo.bankDepositBranch) {
  213. this.$api.msg('开户支行不能为空')
  214. return
  215. }
  216. if (!this.identityAuthenticationInfo.customerPhone) {
  217. this.$api.msg('手机号不能为空')
  218. return
  219. }
  220. if(this.identityAuthenticationInfo.customerTypeFlag == 1){
  221. if (!this.identityAuthenticationInfo.payeeName) {
  222. this.$api.msg('收款人姓名不能为空')
  223. return
  224. }
  225. if (!this.identityAuthenticationInfo.payeeNumberCard) {
  226. this.$api.msg('收款人身份证号不能为空')
  227. return
  228. }
  229. if (!this.identityAuthenticationInfo.compAddress) {
  230. this.$api.msg('联系地址不能为空')
  231. return
  232. }
  233. }else if(this.identityAuthenticationInfo.customerTypeFlag == 2){
  234. if (!this.identityAuthenticationInfo.compAddress) {
  235. this.$api.msg('公司地址不能为空')
  236. return
  237. }
  238. }
  239. this.identityAuthenticationInfo.commonId = this.userInfo.id
  240. this.identityAuthenticationInfo.payeeAddressUrl = this.bankid.toString()
  241. this.$api.doRequest('post', '/identityAuthenticationInfo/api/addIdentityAuthenticationInfo', this
  242. .identityAuthenticationInfo)
  243. .then(res => {
  244. uni.navigateTo({
  245. url: `/pages/attestation/index` ,
  246. })
  247. }).catch(res => {
  248. uni.showToast({
  249. title: res.data.message,
  250. icon: 'none',
  251. duration: 2000
  252. })
  253. })
  254. },
  255. phoneinput(e){
  256. if(e.detail.value.length==11){
  257. this.codestatus=true
  258. }
  259. },
  260. getcode() {
  261. var that = this
  262. if (/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.identityAuthenticationInfo.customerPhone)) {
  263. this.$api.doRequest('get', '/commonUser/sendVerifyCode', {
  264. phone: this.identityAuthenticationInfo.customerPhone
  265. }).then(res => {
  266. if (res.data.code == 200) {
  267. that.sendDisabled = true
  268. let sec = 60
  269. let interval = setInterval(() => {
  270. sec--;
  271. that.sendText = sec + 's后重发'
  272. if (sec <= 0) {
  273. that.sendDisabled = false
  274. that.sendText = "获取验证码"
  275. clearInterval(interval)
  276. }
  277. }, 1000)
  278. } else {
  279. uni.showToast({
  280. title: res.data.message,
  281. icon: 'none',
  282. duration: 2000
  283. })
  284. }
  285. })
  286. .catch(res => {
  287. uni.showToast({
  288. title: res.data.message,
  289. icon: 'none',
  290. duration: 2000
  291. })
  292. });
  293. } else {
  294. uni.showToast({
  295. title: '请输入正确的手机号',
  296. icon: 'none',
  297. duration: 2000
  298. })
  299. }
  300. },
  301. }
  302. }
  303. </script>
  304. <style>
  305. .center {
  306. padding: 10px 20px;
  307. background-color: #F5F6FA;
  308. }
  309. .c-row {
  310. display: -webkit-box;
  311. display: -webkit-flex;
  312. display: flex;
  313. -webkit-box-align: center;
  314. -webkit-align-items: center;
  315. align-items: center;
  316. padding: 20rpx 30rpx;
  317. position: relative;
  318. }
  319. .con-list {
  320. -webkit-box-flex: 1;
  321. -webkit-flex: 1;
  322. flex: 1;
  323. display: -webkit-box;
  324. display: -webkit-flex;
  325. display: flex;
  326. -webkit-box-orient: vertical;
  327. -webkit-box-direction: normal;
  328. -webkit-flex-direction: column;
  329. flex-direction: column;
  330. color: #303133;
  331. line-height: 40rpx;
  332. text-align: right;
  333. padding-right: 20rpx;
  334. font-size: 14px;
  335. }
  336. .btn {
  337. margin-top: 10px;
  338. background-color: #FFFFFF;
  339. border-radius: 25px;
  340. border: none;
  341. }
  342. .btns {
  343. background-color: #22C572;
  344. }
  345. .picture {
  346. width: 100%;
  347. height: 220px;
  348. text-align: center;
  349. margin-top: 10px;
  350. }
  351. .getcode {
  352. font-size: 14px;
  353. position: absolute;
  354. top: 50%;
  355. transform: translateY(-50%);
  356. color: #AFB3BF;
  357. background: #F5F6F9;
  358. height: 30px;
  359. line-height: 30px;
  360. }
  361. .getcode.active {
  362. border: none;
  363. }
  364. .words{
  365. font-size: 18px;
  366. font-weight: 600;
  367. color: #617E8B;
  368. }
  369. .floats{
  370. position: relative;
  371. top: -150px;
  372. text-align: center;
  373. }
  374. </style>