|
@@ -1,27 +1,16 @@
|
|
|
<template>
|
|
|
<view class="center">
|
|
|
<view>
|
|
|
-
|
|
|
- <view style="margin: 0 auto;height: 240px;" v-if="bank1 != ''" @click="bankUp()">
|
|
|
- <image v-bind:src="bank1" class="picture"></image>
|
|
|
- <view class="floats" v-if="certificates == true">
|
|
|
- <image src="../../static/img/authentication/xiangji@3x.png" style="width: 60px;height: 50px;">
|
|
|
- </image>
|
|
|
- <view class="words">
|
|
|
- 上传银行卡正面
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view style="margin: 0 auto;height: 240px;" v-if="bank2 != ''" @click="bankLow()">
|
|
|
- <image v-bind:src="bank2" class="picture"></image>
|
|
|
- <view class="floats" v-if="certificatesTwo == true">
|
|
|
- <image src="../../static/img/authentication/xiangji@3x.png" style="width: 60px;height: 50px;">
|
|
|
- </image>
|
|
|
- <view class="words">
|
|
|
- 上传银行卡反面
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <!-- 上传银行卡正面 -->
|
|
|
+ <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
|
|
|
+ :size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
|
|
|
+ @on-uploaded="isAdd = true" :before-upload="filterFileType" :options="uploadOptions"
|
|
|
+ :custom="uploadCustom" @on-progress="onProgress"></upload>
|
|
|
+ <!-- 上传银行卡反面 -->
|
|
|
+ <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
|
|
|
+ :size-type="['compressed']" @on-success="getImgUrl1" @on-error="onError" @on-remove="onRemove"
|
|
|
+ @on-uploaded="isAdd = true" :before-upload="filterFileType" :options="uploadOptions1"
|
|
|
+ :custom="uploadCustom" @on-progress="onProgress"></upload>
|
|
|
</view>
|
|
|
<view class="c-row b-b">
|
|
|
<text class="tit">银行卡号</text>
|
|
@@ -66,12 +55,13 @@
|
|
|
<view class="c-row b-b">
|
|
|
<text class="tit">手机号</text>
|
|
|
<view class="con-list">
|
|
|
- <input placeholder="请填写手机号" @input='phoneinput' type="number" maxlength="11" v-model="identityAuthenticationInfo.customerPhone"></input>
|
|
|
+ <input placeholder="请填写手机号" @input='phoneinput' type="number" maxlength="11"
|
|
|
+ v-model="identityAuthenticationInfo.customerPhone"></input>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view style='width:100%;border-bottom:1px solid #E8E9ED;padding:10px;' class="flex">
|
|
|
<button :class='codestatus&&!sendDisabled?"active":""' @click='obtain' class='getcode'>{{sendText}}</button>
|
|
|
- <view class="con-list" style='position:relative;'>
|
|
|
+ <view class="con-list" style='position:relative;'>
|
|
|
<input style='text-align:right;' v-model='verifyCode' placeholder="请输入验证码" type="number" maxlength="6">
|
|
|
</view>
|
|
|
</view>
|
|
@@ -92,15 +82,34 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import upload from '@/components/upload.vue';
|
|
|
import {
|
|
|
mapState
|
|
|
} from 'vuex';
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ upload
|
|
|
+ },
|
|
|
name: "buy",
|
|
|
data() {
|
|
|
return {
|
|
|
- bank1: "../../static/img/authentication/bankup(3).png",
|
|
|
- bank2: "../../static/img/authentication/banklow(3).png",
|
|
|
+ action: this.$uploadUrl,
|
|
|
+ maxSize: 5 * 1024 * 1024, //限制文件大小 2M
|
|
|
+ btnLoading: false, //防止重复点击
|
|
|
+ isAdd: true,
|
|
|
+ imgUrls: [],
|
|
|
+ uploadCustom: true,
|
|
|
+ uploadCustom1: true,
|
|
|
+ uploadOptions: {
|
|
|
+ "text": "上传银行卡正面",
|
|
|
+ "bgc": "https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/bankup%282%29.png"
|
|
|
+ },
|
|
|
+ uploadOptions1: {
|
|
|
+ "text": "上传银行卡反面",
|
|
|
+ "bgc": "https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/banklow%282%29.png"
|
|
|
+ },
|
|
|
+ // bank1: "../../static/img/authentication/bankup(3).png",
|
|
|
+ // bank2: "../../static/img/authentication/banklow(3).png",
|
|
|
bankid: [],
|
|
|
consentStatus: true,
|
|
|
consentStatus1: false,
|
|
@@ -118,7 +127,7 @@
|
|
|
certificatesTwo: true,
|
|
|
zhihangStatus: true,
|
|
|
verification: true,
|
|
|
- identityAuthenticationInfos:{},
|
|
|
+ identityAuthenticationInfos: {},
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -132,99 +141,100 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- obtain() {
|
|
|
- if (this.sendText == "获取验证码"){
|
|
|
- this.getcode()
|
|
|
+ filterFileType(index, lists) {
|
|
|
+ if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
|
|
|
+ lists.splice(index, 1);
|
|
|
+ // 当前文件不支持
|
|
|
+ uni.showModal({
|
|
|
+ title: '暂不支持当前图片类型',
|
|
|
+ showCancel: false
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.isAdd = false;
|
|
|
}
|
|
|
},
|
|
|
- bankUp() {
|
|
|
- var that = this
|
|
|
- uni.chooseImage({
|
|
|
- success: function(res) {
|
|
|
- uni.uploadFile({
|
|
|
- url: 'https://www.zthymaoyi.com/upload/admin',
|
|
|
- filePath: res.tempFilePaths[0],
|
|
|
- name: 'file',
|
|
|
- success(res) {
|
|
|
- var data = res.data
|
|
|
- var strToObj = JSON.parse(data)
|
|
|
- that.bankid[0] = strToObj.url
|
|
|
- that.bank1 = strToObj.url
|
|
|
- that.certificates = false
|
|
|
- that.bankImgs1.bankImg = strToObj.url
|
|
|
- that.$api.doRequest('get', '/driverViewInfo/bankShibie', that
|
|
|
- .bankImgs1).then(res => {
|
|
|
- if (res.data.data.bankNo != null) {
|
|
|
- if (res.data.data.bankNo != "") {
|
|
|
- that.$set(that.identityAuthenticationInfo,
|
|
|
- 'bankCard', res.data.data.bankNo)
|
|
|
- }
|
|
|
- }
|
|
|
- if (res.data.data.bankName != null) {
|
|
|
- if (res.data.data.bankName != "") {
|
|
|
- that.$set(that.identityAuthenticationInfo,
|
|
|
- 'bankDeposit', res.data.data.bankName)
|
|
|
- }
|
|
|
- }
|
|
|
- if (res.data.data.bankNameZhihang.length != 0) {
|
|
|
- that.bankType = res.data.data.bankNameZhihang
|
|
|
- }
|
|
|
- }).catch(res => {
|
|
|
- uni.showToast({
|
|
|
- title: res.data.message,
|
|
|
- icon: 'none',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ getImgUrl(res) {
|
|
|
+ console.log(res)
|
|
|
+ console.log('------------res-----------')
|
|
|
+ let that = this
|
|
|
+ that.bankid[0] = res
|
|
|
+ that.bank1 = res
|
|
|
+ that.certificates = false
|
|
|
+ that.bankImgs1.bankImg = res
|
|
|
+ that.$api.doRequest('get', '/driverViewInfo/bankShibie', that
|
|
|
+ .bankImgs1).then(res => {
|
|
|
+ if (res.data.data.bankNo != null) {
|
|
|
+ if (res.data.data.bankNo != "") {
|
|
|
+ that.$set(that.identityAuthenticationInfo,
|
|
|
+ 'bankCard', res.data.data.bankNo)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (res.data.data.bankName != null) {
|
|
|
+ if (res.data.data.bankName != "") {
|
|
|
+ that.$set(that.identityAuthenticationInfo,
|
|
|
+ 'bankDeposit', res.data.data.bankName)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (res.data.data.bankNameZhihang.length != 0) {
|
|
|
+ that.bankType = res.data.data.bankNameZhihang
|
|
|
}
|
|
|
+ }).catch(res => {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.data.message,
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
- bankLow() {
|
|
|
- var that = this
|
|
|
- uni.chooseImage({
|
|
|
- success: function(res) {
|
|
|
- uni.uploadFile({
|
|
|
- url: 'https://www.zthymaoyi.com/upload/admin',
|
|
|
- filePath: res.tempFilePaths[0],
|
|
|
- name: 'file',
|
|
|
- success(res) {
|
|
|
- var data = res.data
|
|
|
- var strToObj = JSON.parse(data)
|
|
|
- that.bankid[1] = strToObj.url
|
|
|
- that.bank2 = strToObj.url
|
|
|
- that.certificatesTwo = false
|
|
|
- that.bankImgs1.bankImg = strToObj.url
|
|
|
- that.$api.doRequest('get', '/driverViewInfo/bankShibie', that
|
|
|
- .bankImgs1).then(res => {
|
|
|
- if (res.data.data.bankNo != null) {
|
|
|
- if (res.data.data.bankNo != "") {
|
|
|
- that.$set(that.identityAuthenticationInfo,
|
|
|
- 'bankCard', res.data.data.bankNo)
|
|
|
- }
|
|
|
- }
|
|
|
- if (res.data.data.bankName != null) {
|
|
|
- if (res.data.data.bankName != "") {
|
|
|
- that.$set(that.identityAuthenticationInfo,
|
|
|
- 'bankDeposit', res.data.data.bankName)
|
|
|
- }
|
|
|
- }
|
|
|
- if (res.data.data.bankNameZhihang != null) {
|
|
|
- that.bankType = res.data.data.bankNameZhihang
|
|
|
- }
|
|
|
- }).catch(res => {
|
|
|
- uni.showToast({
|
|
|
- title: res.data.message,
|
|
|
- icon: 'none',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
+ getImgUrl1(res) {
|
|
|
+ console.log(res)
|
|
|
+ console.log('------------res-----------')
|
|
|
+ let that = this
|
|
|
+ that.bankid[1] = res
|
|
|
+ that.bank2 = res
|
|
|
+ that.certificatesTwo = false
|
|
|
+ that.bankImgs1.bankImg = res
|
|
|
+ that.$api.doRequest('get', '/driverViewInfo/bankShibie', that
|
|
|
+ .bankImgs1).then(res => {
|
|
|
+ if (res.data.data.bankNo != null) {
|
|
|
+ if (res.data.data.bankNo != "") {
|
|
|
+ that.$set(that.identityAuthenticationInfo,
|
|
|
+ 'bankCard', res.data.data.bankNo)
|
|
|
+ }
|
|
|
}
|
|
|
+ if (res.data.data.bankName != null) {
|
|
|
+ if (res.data.data.bankName != "") {
|
|
|
+ that.$set(that.identityAuthenticationInfo,
|
|
|
+ 'bankDeposit', res.data.data.bankName)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (res.data.data.bankNameZhihang != null) {
|
|
|
+ that.bankType = res.data.data.bankNameZhihang
|
|
|
+ }
|
|
|
+ }).catch(res => {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.data.message,
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
})
|
|
|
+
|
|
|
+ },
|
|
|
+ onError(error) {
|
|
|
+ alert(error)
|
|
|
+ console.log('------------error-----------')
|
|
|
+ console.log(error)
|
|
|
+ },
|
|
|
+ onProgress(e) {
|
|
|
+ console.log(e)
|
|
|
+ },
|
|
|
+ onRemove(index) {
|
|
|
+ this.imgUrls.splice(index, 1);
|
|
|
+ },
|
|
|
+ obtain() {
|
|
|
+ if (this.sendText == "获取验证码") {
|
|
|
+ this.getcode()
|
|
|
+ }
|
|
|
},
|
|
|
bankChange(e) {
|
|
|
this.bankIndex = e.detail.value
|
|
@@ -337,10 +347,9 @@
|
|
|
verifyCode: this.verifyCode
|
|
|
}).then(res => {
|
|
|
if (res.data.code == 200) {
|
|
|
- if(that.userInfo){
|
|
|
+ if (that.userInfo) {
|
|
|
that.identityAuthenticationInfo.commonId = that.userInfo.id
|
|
|
- }
|
|
|
- else{
|
|
|
+ } else {
|
|
|
that.identityAuthenticationInfo.commonId = res.data.data.id
|
|
|
}
|
|
|
that.identityAuthenticationInfo.payeeAddressUrl = that.bankid.toString()
|
|
@@ -351,7 +360,8 @@
|
|
|
confirmText: '确定',
|
|
|
success: function(res) {
|
|
|
if (res.confirm) {
|
|
|
- that.identityAuthenticationInfos.customerPhone = that.identityAuthenticationInfo.customerPhone
|
|
|
+ that.identityAuthenticationInfos.customerPhone = that
|
|
|
+ .identityAuthenticationInfo.customerPhone
|
|
|
that.$api.doRequest('get',
|
|
|
'/identityAuthenticationInfo/selectPhone', that
|
|
|
.identityAuthenticationInfos)
|
|
@@ -363,20 +373,25 @@
|
|
|
success: function(res) {
|
|
|
if (res.confirm) {
|
|
|
that.$api.doRequest('post',
|
|
|
- '/identityAuthenticationInfo/api/addIdentityAuthenticationInfo',that.identityAuthenticationInfo)
|
|
|
+ '/identityAuthenticationInfo/api/addIdentityAuthenticationInfo',
|
|
|
+ that
|
|
|
+ .identityAuthenticationInfo
|
|
|
+ )
|
|
|
.then(res => {
|
|
|
- if (res.data.code == 200) {
|
|
|
+ if (res.data
|
|
|
+ .code ==
|
|
|
+ 200) {
|
|
|
uni.showToast({
|
|
|
title: '提交成功',
|
|
|
icon: 'none',
|
|
|
duration: 2000
|
|
|
})
|
|
|
uni.navigateBack({
|
|
|
- delta:3
|
|
|
+ delta: 3
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
} else if (res.data.code == 200) {
|
|
@@ -391,7 +406,7 @@
|
|
|
duration: 2000
|
|
|
})
|
|
|
uni.navigateBack({
|
|
|
- delta:3
|
|
|
+ delta: 3
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -490,7 +505,7 @@
|
|
|
align-items: center;
|
|
|
padding: 20rpx 30rpx;
|
|
|
position: relative;
|
|
|
- font-size:14px;
|
|
|
+ font-size: 14px;
|
|
|
}
|
|
|
|
|
|
.con-list {
|
|
@@ -539,8 +554,8 @@
|
|
|
}
|
|
|
|
|
|
.getcode.active {
|
|
|
- background:#22C572;
|
|
|
- color:#fff;
|
|
|
+ background: #22C572;
|
|
|
+ color: #fff;
|
|
|
}
|
|
|
|
|
|
.words {
|