web-retail-h5/pages/mine/balance/transfer.vue

222 lines
6.1 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="content">
<view class="theform">
<u--form labelPosition="left" :model="dataForm" :rules="rules" ref="uForm">
<u-form-item borderBottom label-width="200rpx" :label="$t('MY_WAL_14')" prop="pkAccountName"
@click="showAmount = true; " ref="item1">
<u--input v-model="dataForm.pkAccountName" disabled disabledColor="#ffffff"
:placeholder="$t('CK_KS_38')" border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label-width="200rpx" :label="$t('MY_WAL_16')" prop="memberCode" ref="item1">
<u--input v-model="dataForm.memberCode" disabled disabledColor="#F5F5F5;" border="none"></u--input>
</u-form-item>
<u-form-item label-width="200rpx" label="" borderBottom ref="item1">
<view class="contentye">
<text style="color: rgba(153, 153, 153, 1);">{{$t('MY_WAL_15')}}</text>
<text style="color: rgba(251, 48, 36, 1);">{{kzye}}</text>
</view>
</u-form-item>
<u-form-item label-width="200rpx" :label="$t('MY_WAL_17')" prop="memberName" borderBottom ref="item1">
<u--input v-model="dataForm.memberName" disabled disabledColor="#F5F5F5;" border="none"></u--input>
</u-form-item>
<u-form-item label-width="200rpx" :label="$t('MY_WAL_18')" prop="toMemberCode" borderBottom ref="item1">
<u--input @blur='checkName' :placeholder="$t('S_C_70')" v-model="dataForm.toMemberCode"
border="none"></u--input>
</u-form-item>
<u-form-item label-width="200rpx" :label="$t('MY_WAL_19')" prop="toMemberName" borderBottom ref="item1">
<u--input v-model="dataForm.toMemberName" disabled disabledColor="#F5F5F5;"
border="none"></u--input>
</u-form-item>
<u-form-item label-width="200rpx" :label="`${$t('MY_WAL_20')}(¥)`" prop="transferMoney" borderBottom
ref="item1">
<u--input v-model="dataForm.transferMoney" :placeholder="$t('S_C_70')" border="none"></u--input>
</u-form-item>
<u-form-item label-width="200rpx" :label="$t('MY_WAL_21')" prop="payPwd" borderBottom ref="item1">
<template v-if="!ifeye">
<u--input type='password' v-model="dataForm.payPwd" :placeholder="$t('S_C_70')"
border="none"></u--input>
<image @click="ifeye=!ifeye" slot="right" style="width: 38rpx;
height: 25rpx;" src="../../../static/images/my_eye.png" mode=""></image>
</template>
<template v-if="ifeye">
<u--input v-model="dataForm.payPwd" :placeholder="$t('S_C_70')" border="none"></u--input>
<image @click="ifeye=!ifeye" slot="right" style="width: 38rpx;
height: 30rpx;" src="../../../static/images/my_eye2.png" mode=""></image>
</template>
</u-form-item>
<u-form-item label-width="200rpx" :label="$t('MY_WAL_22')" prop="remarks" ref="item1">
<u--input v-model="dataForm.remarks" :placeholder="$t('S_C_70')" border="none"></u--input>
</u-form-item>
<u-picker @cancel='showAmount=false' :show="showAmount" ref="uPicker" :columns="accountList"
@confirm="confirm" keyName='pkTransactionKeyVal'></u-picker>
</u--form>
</view>
<view class="btnbox">
<u-button class="subbtn" @click="submit">{{$t('w_0035')}}</u-button>
</view>
<u-toast ref="uToast"></u-toast>
</view>
</template>
<script>
import * as bal from "@/config/balance.js"
export default {
data() {
return {
showAmount: false,
dataForm: {
transferMoney: "",
payPwd: "",
remarks: "",
pkAccountName: "",
pkAccount: "",
},
accountList: [],
rules: {
toMemberCode: [{
type: 'string',
required: true,
message: this.$t('S_C_70'),
trigger: ['blur', 'change']
}],
transferMoney: [{
type: 'string',
required: true,
message: this.$t('S_C_70'),
trigger: ['blur', 'change']
}],
payPwd: [{
type: 'string',
required: true,
message: this.$t('S_C_70'),
trigger: ['blur', 'change']
}],
pkAccountName: [{
required: true,
message: this.$t('CK_KS_38'),
trigger: ['change']
}],
},
widthDrwaData: {},
ifeye: false,
userInfo: {},
kzye: "0.00",
}
},
onLoad() {
this.getList()
this.userInfo = uni.getStorageSync('User')
this.zzMethods()
},
methods: {
zzMethods() {
if (this.userInfo.serviceCode) {
this.dataForm.memberCode = this.userInfo.serviceCode
} else {
this.dataForm.memberCode = this.userInfo.memberCode
}
bal.getTransferChineseName({
memberCode: this.dataForm.memberCode
}).then(
(res) => {
if (res.code == 200) {
this.$set(this.dataForm, "memberName", res.memberName)
}
}
);
},
getList() {
bal.getTransferAccount().then(res => {
this.accountList = [res.data]
})
},
submit() {
this.$refs.uForm.validate().then(res => {
bal.addTransfer(this.dataForm).then(res => {
if (res.code == 200) {
this.$refs.uToast.show({
message: res.msg,
type: 'success'
})
setTimeout(() => {
uni.navigateBack()
}, 1000);
}
})
}).catch(errors => {
uni.$u.toast(this.$t('MY_ORD_64'))
})
},
confirm(e) {
this.dataForm.pkAccountName = e.value[0].pkTransactionKeyVal
this.dataForm.pkAccount = e.value[0].pkId
this.showAmount = false
bal.getTransferMember({
pkAccount: this.dataForm.pkAccount
}).then(res => {
this.kzye = res.data
})
},
checkName() {
bal.getTransferChineseName({
memberCode: this.dataForm.toMemberCode
}).then(
(res) => {
if (res.code == 200) {
this.$set(this.dataForm, "toMemberName", res.memberName)
}
}
);
}
}
}
</script>
<style lang="scss" scoped>
.content {
background: #F2F2F2;
.theform {
margin-top: 6rpx;
background: #FFFFFF;
padding: 20rpx 23rpx 48rpx 23rpx;
.contentye {
font-size: 28rpx;
margin-left: 200rpx;
font-family: Source Han Sans CN;
font-weight: 400;
}
}
.btnbox {
margin-top: 38rpx;
padding: 0 20rpx;
.subbtn {
background: #FB3024;
border-radius: 46rpx;
font-size: 30rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #FFFFFF;
}
}
}
</style>