123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- <template>
- <view class="index-content" :style="{'--status-bar-': statusBarHeight}">
- <view class="index-content-info">
- <!-- 头部主要内容 开始 -->
- <view class="index-content-header">
- <customNavbar
- :title="title"
- bgColor="rgba(0,0,0,0)"
- :is-left="true"
- :customNavbarInfo='{}'
- :leftStyle="{ color: '#fff' }"
- >
- </customNavbar>
- </view>
- <!-- 头部主要内容 结束 -->
- <view style="padding: 30rpx;">
- <u--form labelPosition="left" :model="form" :rules="rules" labelWidth='100' ref="uForm">
- <u-form-item label="开户人姓名" prop="name" borderBottom>
- <u--input v-model="form.name" border="none"></u--input>
- </u-form-item>
- <!-- <u-form-item label="银行名称" prop="bankName" borderBottom>
- <u--input v-model="form.bankName" border="none"></u--input>
- </u-form-item> -->
- <u-form-item label="银行卡号" prop="bankNo" borderBottom>
- <u--input v-model="form.bankNo" border="none"></u--input>
- </u-form-item>
- <u-form-item label="开户行" prop="openBankName" borderBottom>
- <u--input v-model="form.openBankName" border="none"></u--input>
- </u-form-item>
- </u--form>
- </view>
- <view class="info-text">
- 注意:若银行卡卡号错误、失效、状态异常等,均会打款失败,请谨慎填写。
- </view>
- <view style="padding: 30rpx;">
- <u-button type="primary" @click="insertOrUpdateFun()" text="提交"></u-button>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- title: '我的银行卡',
- loading: false,
- statusBarHeight: 0, // 状态栏安全距离
- form: {
- "id": "",
- "name": "",
- "moblie": "",
- "bankName": "",
- "bankNo": "",
- "openBankName": ""
- },
- rules: {
- 'name': {
- type: 'string',
- required: true,
- message: '请输入开户人姓名',
- trigger: ['blur', 'change']
- },
- 'moblie': {
- type: 'string',
- required: true,
- message: '请输入手机号',
- trigger: ['blur', 'change']
- },
- // 'bankName': {
- // type: 'string',
- // required: true,
- // message: '请输入银行名称',
- // trigger: ['blur', 'change']
- // },
- 'bankNo': {
- type: 'string',
- required: true,
- message: '请输入银行卡号',
- trigger: ['blur', 'change']
- },
- 'openBankName': {
- type: 'string',
- required: true,
- message: '请输入开户行',
- trigger: ['blur', 'change']
- },
- },
- }
- },
- onLoad() {
- this.getRetailQrcode()
- },
- onShow() {
- this.statusBarHeight = getApp().globalData.statusBarHeight
- //this.load()
- },
- methods: {
- /**
- * 获取 我的银行卡
- */
- async getRetailQrcode() {
- try {
- uni.showLoading({
- title: "获取银行卡中..."
- })
- let res = await this.$u.api.getPersonsBankApi({
- userid: this.distribution_user_info.userId
- })
- uni.hideLoading()
- if (res && res.code === 200) {
- this.form = {
- "id": res.data.id,
- "name": res.data.name,
- "moblie": res.data.moblie,
- "bankName": res.data.bankName,
- "bankNo": res.data.bankNo,
- "openBankName": res.data.openBankName
- }
- }
-
- } catch (e) {
- //TODO handle the exception
- console.error("e===", e)
- uni.hideLoading()
- }
- },
- /**
- * 提交 我的银行卡
- */
- async insertOrUpdateFun() {
- this.$refs.uForm.validate().then(async res => {
- try {
- uni.showLoading({
- title: "提交数据中..."
- })
- let res = await this.$u.api.insertOrUpdateApi({...this.form})
- uni.hideLoading()
- if (res && res.code === 200) {
- uni.showToast({
- title: "绑定成功!!!",
- duration: 2000
- })
- setTimeout(()=>{
- this.getRetailQrcode()
- },2000)
- }
- this.loading = false
- } catch (e) {
- uni.hideLoading()
- uni.showToast({
- title: "绑定失败!!!"
- })
- //TODO handle the exception
- console.error("e===", e)
- this.loading = false
- }
- }).catch(errors => {
-
- })
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .index-content {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- box-sizing: border-box;
- // background-color:
- .index-content-info {
- width: 100%;
- box-sizing: border-box;
- .info-text {
- padding: 30rpx;
- font-size: 30rpx
-
- }
- }
- }
- /** 头部主要内容 开始 */
- .index-content-header {
- width: 100%;
- box-sizing: border-box;
- background-color: var(--gd-bgm-color);
- ::v-deep .u-search {
- padding: 0 30rpx !important;
- }
- ::v-deep .u-search__action {
- color: #fff !important;
- }
- }
- /** 头部主要内容 结束 **/
- </style>
|