<template>
|
<view class="login-container">
|
<view class="p30">
|
<view class="group-bd">
|
|
<view class="form-level d-s-c">
|
<view class="d-s-c field-name">
|
<text class="orange">*</text>
|
<text class="gray3">结算银行卡号:</text>
|
</view>
|
<view class="val flex-1"><input type="text" v-model="formData.account_no" placeholder="请输入结算银行卡号" /></view>
|
</view>
|
<view class="certification_body">
|
<view class="login_index_updata_name">
|
<text style="color:red;">*</text>
|
<text style="">请上传结算银行卡照片</text>
|
</view>
|
<view class="login_index_updata_updata">
|
<view class="login_index_updata_updata_item2" @click="openUpload('bank_card_photo')">
|
<view class="login_index_updata_updata_item_body">
|
<view v-if="bank_card_photo!=''" class="img">
|
<image :src="bank_card_photo"></image>
|
</view>
|
<view v-if="bank_card_photo==''">点击上传结算银行卡照片</view>
|
<input style="display:none" name="bank_card_photo" v-model="form.bank_card_photo" />
|
</view>
|
</view>
|
</view>
|
</view>
|
|
|
</view>
|
</view>
|
|
|
<view class="btns p30"><button type="default" @click="formSubmit">提交</button></view>
|
<Upload v-if="isupload" :isupload="isupload" :type="type" @getImgs="getImgsFunc">上传图片</Upload>
|
</view>
|
</template>
|
|
<script>
|
import Upload from '@/components/upload/upload';
|
export default {
|
components: {
|
/*编辑组件*/
|
Upload,
|
},
|
data() {
|
return {
|
/*表单数据对象*/
|
formData: {
|
account_no:'',//结算银行卡号
|
bank_card_photo:'',//结算银行卡照片
|
bank_card_photo_id:'',//结算银行卡照片
|
},
|
isupload: false,
|
bank_card_photo:'',//没加密的图片链接
|
};
|
},
|
onLoad() {
|
/*获取数据*/
|
this.getData();
|
|
},
|
methods: {
|
/*获取数据*/
|
getData() {
|
let self = this;
|
uni.showLoading({
|
title: '加载中'
|
});
|
self._get('user.auth/detail', {}, function(res) {
|
if(res.code == 1){
|
var data = res.data.data;
|
self.formData = data;
|
if(data.bankCardPhoto){
|
self.bank_card_photo = data.bankCardPhoto.file_path;
|
}
|
}
|
uni.hideLoading();
|
});
|
},
|
|
/*上传*/
|
openUpload(e) {
|
this.type = e;
|
this.isupload = true;
|
},
|
|
/*获取图片*/
|
getImgsFunc(e) {
|
if (e != null && e.length > 0) {
|
var self = this;
|
uni.showLoading({
|
title:'上传中'
|
})
|
var type = this.type;
|
var type_id = this.type+"_id"
|
this[type] = e[0].file_path;//展示的图片
|
this.formData[type_id] = e[0].file_id;//存数据库的图片ID
|
var buy_type = 'bankCard';//银行卡
|
wx.getFileSystemManager().readFile({
|
filePath: e.beforeFilePath, //选择图片返回的相对路径
|
encoding: 'base64', //编码格式
|
success: res => {
|
//成功的回调
|
//console.log('data:image/png;base64,' + res.data)
|
var img= 'data:image/png;base64,' + res.data;
|
this._post('file.upload/imageFbEncryption', {
|
img: img,
|
bus_type:buy_type
|
}, function(res) {
|
uni.hideLoading()
|
if(res.code == 1){
|
self.formData[self.type] =res.data;//加密的图片
|
}else{
|
uni.showToast({
|
title: '图片加密失败',
|
duration: 2000
|
});
|
}
|
|
})
|
false,
|
() => {
|
uni.hideLoading();
|
}
|
}
|
})
|
}
|
this.isupload = false;
|
},
|
/*提交*/
|
formSubmit() {
|
let self = this;
|
uni.showLoading({
|
title: '正在提交'
|
});
|
uni.navigateBack();
|
self._post(
|
'user.auth/save',
|
self.formData,
|
result => {
|
if(result.code == 1){
|
uni.showToast({
|
title: '提交成功',
|
duration: 2000
|
});
|
setTimeout(function(){
|
// 执行回调函数
|
uni.navigateBack();
|
}, 2000);
|
}else{
|
uni.showToast({
|
title: '提交失败',
|
duration: 2000
|
});
|
}
|
|
},
|
false,
|
() => {
|
uni.hideLoading();
|
}
|
);
|
},
|
|
|
}
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
.login-container {
|
background: #ffffff;
|
}
|
.login-container input {
|
height: 88rpx;
|
line-height: 88rpx;
|
}
|
.wechatapp {
|
padding: 80rpx 0 48rpx;
|
border-bottom: 1rpx solid #e3e3e3;
|
margin-bottom: 72rpx;
|
text-align: center;
|
}
|
|
.wechatapp .header {
|
width: 190rpx;
|
height: 190rpx;
|
border: 2px solid #fff;
|
margin: 0rpx auto 0;
|
border-radius: 50%;
|
overflow: hidden;
|
box-shadow: 1px 0px 5px rgba(50, 50, 50, 0.3);
|
}
|
|
.auth-title {
|
color: #585858;
|
font-size: 34rpx;
|
margin-bottom: 40rpx;
|
}
|
|
.auth-subtitle {
|
color: #888;
|
margin-bottom: 88rpx;
|
font-size: 28rpx;
|
}
|
|
.login-btn {
|
padding: 0 20rpx;
|
}
|
|
.login-btn button {
|
height: 88rpx;
|
line-height: 88rpx;
|
background: #04be01;
|
color: #fff;
|
font-size: 30rpx;
|
border-radius: 999rpx;
|
text-align: center;
|
}
|
|
.no-login-btn {
|
margin-top: 20rpx;
|
padding: 0 20rpx;
|
}
|
|
.no-login-btn button {
|
height: 88rpx;
|
line-height: 88rpx;
|
background: #dfdfdf;
|
color: #fff;
|
font-size: 30rpx;
|
border-radius: 999rpx;
|
text-align: center;
|
}
|
|
.get-code-btn {
|
width: 200rpx;
|
height: 80rpx;
|
line-height: 76rpx;
|
padding: 0rpx 30rpx;
|
border-radius: 40rpx;
|
white-space: nowrap;
|
border: 1rpx solid $dominant-color;
|
color: $dominant-color;
|
font-size: 30rpx;
|
}
|
.get-code-btn[disabled='true'] {
|
border: 1rpx solid #cccccc;
|
}
|
|
.btns button {
|
height: 90rpx;
|
line-height: 90rpx;
|
font-size: 34rpx;
|
border-radius: 45rpx;
|
background: $dominant-color;
|
color: #ffffff;
|
}
|
.certification_head_body_item {
|
width: 100%;
|
height: 100rpx;
|
display: flex;
|
align-items: center;
|
}
|
.certification_head_body_item view {
|
margin-right: 10rpx;
|
}
|
.certification_head_body_item button {
|
width: 172rpx;
|
height: 56rpx;
|
line-height: 56rpx;
|
border: 1rpx #E2231A solid;
|
border-radius: 40rpx;
|
font-size: 26rpx;
|
color: #E2231A;
|
padding: 0 20rpx;
|
}
|
.login_index_updata_updata {
|
width: 90%;
|
height: 360rpx;
|
margin: 0 auto;
|
margin: 10rpx 0 30rpx;
|
}
|
|
.login_index_updata_updata_item2 {
|
width: 100%;
|
height: 360rpx;
|
border: 1rpx #9a9a9a dotted;
|
border-radius: 15rpx;
|
text-align: center;
|
|
}
|
|
.login_index_updata_updata_item_body {
|
width: 150rpx;
|
height: 360rpx;
|
text-align: center;
|
margin: 0 auto;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
}
|
|
.img image {
|
width: 554rpx;
|
height: 360rpx;
|
position: relative;
|
}
|
.selectpicker {
|
width: auto;
|
height: 88rpx;
|
line-height: 88rpx;
|
box-sizing: border-box;
|
color: #575757;
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
|
|
</style>
|