companyIdentityThree.vue 9.3 KB

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