123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- <style lang="scss">
- .app-body{
- padding: 10px 0;
- .input-form {
- background: #fff;
- .item{
- padding: 35rpx 20rpx;
- border-bottom: 1px solid #f1f1f1;
- .label{
- width: 86px;
- font-weight: 400;
- color: #333;
- }
- .value{
- width: calc(100% - 86px);
- }
- }
-
- }
- }
- .input-placeholder {
- color: #999;
- }
-
- .sbtn{
- font-size: 14px;
- color: #DB292B;
- margin-right: 10rpx;
- }
- .no-sbtn{
- font-size: 14px;
- color: #999999;
- margin-right: 10rpx;
- }
-
- .foot{
- padding: 40rpx 60rpx;
- }
-
- .btn{
- background: #DB292B;
- border-radius: 60rpx;
- text-align: center;
- font-weight: bold;
- font-size: 28rpx;
- padding: 30rpx 0;
- color: #FAFAFA;
- }
-
- </style>
- <template>
- <view class="app-body">
-
- <view class="input-form">
- <view class="item fx-r fx-bc">
- <view class="label">姓名</view>
- <view class="value">
- <input type="text" v-model="form.name" placeholder-class="input-placeholder" placeholder="请输入真实姓名" />
- </view>
- </view>
-
- <view class="item fx-r fx-bc">
- <view class="label">银行卡号</view>
- <view class="value">
- <input type="number" v-model="form.payment" placeholder-class="input-placeholder" placeholder="请输入银行卡号" />
- </view>
- </view>
-
- <view class="item fx-r fx-bc">
- <view class="label">所属银行</view>
- <view class="value">
- <input type="text" v-model="form.bank_name" placeholder-class="input-placeholder" placeholder="请输入所属银行" />
- </view>
- </view>
-
-
- <view class="item fx-r fx-bc">
- <view class="label">所属支行</view>
- <view class="value">
- <input type="text" v-model="form.bank" placeholder-class="input-placeholder" placeholder="请输入所属支行" />
- </view>
- </view>
-
-
- <view class="item fx-r fx-bc">
- <view class="label">验证码</view>
- <view class="value fx-r ">
- <input type="number" v-model="form.verify" placeholder-class="input-placeholder" style="width: 186px;" placeholder="请输入验证码" />
- <view class="fx-g1"></view>
- <view v-if="verifyCount <= 0" class="sbtn" @tap="getVcode">验证码</view>
- <view v-else class="no-sbtn">{{ verifyCount }} S</view>
- </view>
- </view>
-
- </view>
-
-
- <view class="foot">
- <view class="btn ihover" @tap="tapSubmit">保存</view>
- </view>
-
- </view>
-
-
- </template>
- <script>
- import {mapState,mapMutations} from 'vuex';
- export default {
- computed: mapState(['user']),
- data() {
- return {
- form : {},
- verifyCount : 0,
- type : 3
- }
- },
- onLoad(options) {
- this.getData();
- },
- methods: {
-
- getData:function(e){
- uni.showLoading({ title: '获取数据中..' });
- var that = this;
- this
- .request
- .post("getBankItem",{type : this.type})
- .then(res => {
- uni.hideLoading();
- if(res.code == 200) {
- if(res.data != null) this.form = res.data;
- } else {
- that.utils.Tip(res.msg);
- }
- }).catch(res => {
- uni.hideLoading();
- that.utils.Tip(res.msg);
- });
- },
-
- getVcode: function() {
- if (this.verifyCount > 0) return;
- uni.showLoading({ title: "获取中..."});
- this
- .request
- .post("userYzm",{type : "bank"})
- .then(res => {
- uni.hideLoading();
- if (res.code == 200) {
- if (res.data.status == 2) {
- this.utils.CountDowm(res.data.time, (e, s) => {
- this.verifyCount = e;
- });
- }
-
- if (res.data.status == 1) {
- this.utils.CountDowm(120, (e, s) => {
- this.verifyCount = e;
- });
- }
- } else {
- uni.showToast({
- title: res.msg,
- mask: true,
- icon: 'none'
- });
- }
- })
- .catch(err => {
- uni.showToast({
- title: '获取失败',
- mask: true,
- icon: 'none'
- });
- uni.hideLoading();
- });
- },
-
-
-
- tapSubmit:function(e){
-
- if(this.form.name == ""){
- uni.showToast({
- title:"请输入真实姓名",icon:"none",mask:true
- })
- return;
- }
-
- if(this.form.payment == ""){
- uni.showToast({
- title:"请输入银行卡号",icon:"none",mask:true
- })
- return;
- }
-
- if(this.form.bank == ""){
- uni.showToast({
- title:"请输入卡归属银行",icon:"none",mask:true
- })
- return;
- }
-
- if (this.form.verify == '') {
- uni.showToast({
- title: '请输入验证码',
- mask: true,
- icon: 'none'
- });
- return;
- }
-
- uni.showLoading({ title: '提交数据中..' });
- this.request
- .post("bankSave",{
- ...this.form,
- type : this.type
- })
- .then(res=>{
- uni.hideLoading();
- if(res.code == 200) {
- uni.navigateBack();
- } else {
- uni.showToast({ title:res.msg,icon:"none",mask:true});
- }
- })
- .catch(res=>{
- uni.hideLoading();
- uni.showModal({title: '系统提示',content: '加载失败,重新点击尝试!',showCancel: false});
- });
- }
- }
- }
- </script>
|