<template>
|
<div class="wrapper">
|
<van-nav-bar
|
:title="($t('subdk'))"
|
:right-text="($t('jl'))"
|
left-arrow
|
fixed
|
@click-left="handleBackClick"
|
@click-right="go_yebs"
|
/>
|
<mt-tab-container class="order-list" v-model="selected">
|
<mt-tab-container-item id="1">
|
<div class="form-block">
|
<mt-field :label="$t('xzjg')" :placeholder="$t('xzjg')" type="text" v-model="form.dkJg" @click.native.capture="handleFocusF" />
|
</div>
|
<div class="form-block">
|
<mt-field :label="$t('sqje')" name="amt" v-model="form.account" :placeholder="$t('sqje')" type="number" @focus.native.capture="handleClick2" />
|
</div>
|
<div class="form-block">
|
<mt-field :label="$t('lxhm')" name="amt" v-model="form.phone" :placeholder="$t('lxhm')" type="number" @blur.native.capture="handleBlur(form.phone)" @focus.native.capture="handleClick2" />
|
</div>
|
|
<div class="btnbox">
|
<span class="text-center btnok loginout" @click="tosubmit(1,form.account, form.phone)">{{ $t('sq') }}</span>
|
</div>
|
</mt-tab-container-item>
|
</mt-tab-container>
|
<van-popup
|
v-model="showPicker"
|
round
|
position="bottom"
|
>
|
<van-picker
|
value-key="dkJg"
|
:title="$t('jgxz')"
|
:confirm-button-text="$t('qr')"
|
:cancel-button-text="$t('qx')"
|
show-toolbar
|
:columns="columns"
|
@confirm="onConfirm"
|
@cancel="onCancel"
|
/>
|
</van-popup>
|
</div>
|
</template>
|
|
<script>
|
// import '@/assets/style/common.less'
|
import * as api from '@/axios/api'
|
import Axios from 'axios'
|
import { Toast } from 'mint-ui'
|
// import {getYebs} from '@/axios/api'
|
|
export default {
|
components: {
|
},
|
data () {
|
return {
|
selected: '1', // 选中
|
form: {
|
account2: '',
|
account: '',
|
phone: ''
|
},
|
userInfo: {
|
realName: ''
|
},
|
yebinfo: [],
|
columns: [],
|
showPicker: false
|
}
|
},
|
watch: {},
|
computed: {},
|
created () {
|
this.getDkClass()
|
this.getProductSetting()
|
},
|
mounted () {
|
if (this.$route.query.type) {
|
this.selected = this.$route.query.type + ''
|
}
|
this.getUserInfo()
|
this.getYebInfo()
|
},
|
methods: {
|
handleFocusF () {
|
this.showPicker = true
|
},
|
onConfirm (v) {
|
console.log(v);
|
this.form.dkJg = v.dkJg
|
this.form.dkid = v.id
|
this.showPicker = false
|
},
|
onCancel () {
|
this.showPicker = false
|
},
|
// 获取贷款机构
|
async getDkClass () {
|
// 获取用户信息
|
let data = await api.queryDkjg()
|
if (data.status == 0) {
|
// 判断是否登录
|
console.log('1111111111111',data.data);
|
this.columns = data.data
|
// this.$store.state.userInfo = data.data
|
// this.userInfo = data.data
|
} else {
|
}
|
// const obj = {
|
// 银行贷款: 'yhdk',
|
// 信用卡融资: 'xykdk',
|
// 债券发行: 'zqfx',
|
// 股东募资: 'gdmz'
|
// }
|
// Axios.post('http://121.43.237.202:8091/api/dk/queryDkjg.do').then(res => {
|
// if (res.data.status === 0) {
|
// if (res.data.data && res.data.data.length > 0) {
|
// this.columns = res.data.data.map(v => {
|
// return {
|
// ...v,
|
// text: this.$t(obj[v.dkJg])
|
// // text: v.dkJg
|
// }
|
// })
|
// } else {
|
// this.columns = []
|
// }
|
// } else {
|
// this.$message.error(res.data.msg)
|
// }
|
// })
|
},
|
// 机构校验
|
handleClick2 (e) {
|
if (!this.form.dkJg) {
|
e.target.blur()
|
return Toast(this.$t('regJg'))
|
}
|
},
|
// 失去焦点校验手机号
|
handleBlur (val) {
|
// if (!this.form.dkJg) return
|
// const bool = /^1(3|4|5|6|7|8|9)\d{9}$/.test(val)
|
// if (!bool) {
|
// val = ''
|
// this.$set(this.form, 'phone', '')
|
// return Toast(this.$t('regPhone'))
|
// }
|
},
|
go_yebs () {
|
this.$router.push('/yebs2')
|
},
|
async getProductSetting () {
|
let data = await api.getProductSetting()
|
// console.log(data)
|
if (data.status === 0) {
|
this.$store.state.settingForm = data.data
|
if (!this.$store.state.settingForm.indexDisplay) {
|
this.selected = '3'
|
}
|
} else {
|
this.$message.error(data.msg)
|
}
|
},
|
handleBackClick () {
|
this.$router.go(-1)
|
},
|
selectAll1 () {
|
// 选择全部
|
this.form.account1 = this.$store.state.userInfo.enableAmt
|
},
|
selectAll2 () {
|
// 选择全部
|
this.form.account2 = this.$store.state.userInfo.enableIndexAmt
|
},
|
selectAll3 () {
|
// 选择全部
|
this.form.account3 = this.$store.state.userInfo.enableAmt
|
},
|
selectAll4 () {
|
// 选择全部
|
this.form.account4 = this.$store.state.userInfo.enableFuturesAmt
|
},
|
isInteger (obj) {
|
return obj % 1 === 0
|
},
|
async tosubmit (id, money, moblie) {
|
if (!this.isInteger(money)) return Toast(this.$t('regpInt'))
|
if (!moblie) return Toast(this.$t('regPhone2'))
|
// 融资转指数
|
let opt = {
|
// amt: this.selected === '1' ? this.form.account1 : this.selected === '2' ? this.form.account2 : this.selected === '3' ? this.form.account3 : this.form.account4,
|
// type: this.selected // 1 融资转指数 2 指数转融资
|
dkJgId:this.form.dkid,
|
dkPhone: moblie,
|
dkMoney: money
|
}
|
let data1 = await api.BuyDK(opt)
|
|
if (data1.status === 1) {
|
Toast(data1.msg)
|
this.$router.push('/yebs')
|
} else {
|
Toast(data1.msg)
|
}
|
},
|
async getUserInfo () {
|
// 获取用户信息
|
let data = await api.getUserInfo()
|
if (data.status === 0) {
|
this.$store.state.userInfo = data.data
|
} else {
|
Toast(data.msg)
|
}
|
},
|
async getYebInfo () {
|
// 获取用户信息
|
let data = await api.getYebInfo()
|
|
if (data.status === 0) {
|
this.$store.state.yebinfo = data.data
|
} else {
|
Toast(data.msg)
|
}
|
}
|
}
|
}
|
</script>
|
<style lang="less" scoped>
|
/deep/ .van-nav-bar {
|
height: 64px !important;
|
background: linear-gradient(to bottom, #45acff, #287df5);
|
.van-nav-bar__content {
|
height: 64px !important;
|
}
|
.van-nav-bar__title, .van-nav-bar__text {
|
color: #FFFFFF;
|
font-size: 24px;
|
}
|
.van-icon {
|
color: #FFFFFF;
|
font-size: 24px;
|
}
|
}
|
.order-list {
|
margin-top: 64px;
|
}
|
.warehouse_card {
|
|
width: 400px;
|
padding: 30px 200px 30px 200px;
|
border: gray solid 1px;
|
//margin: 10px 50px 10px 50px;
|
//position: relative;
|
//top: 1.5231rem;
|
//z-index: 0;
|
|
border: gray!important;
|
}
|
.custom-navbar {
|
display: flex;
|
flex-wrap: wrap;
|
}
|
//
|
/* Adjust styles for mt-tab-item if needed */
|
.custom-navbar mt-tab-item {
|
flex: 0 0 48%; /* Adjust the width as needed */
|
margin: 0 1%; /* Add margin for spacing */
|
width: 50%;
|
}
|
.header {
|
width: 100%;
|
height: 1.5rem;
|
background: #fff;
|
position: fixed;
|
z-index: 999;
|
border-radius: 0 0 .15rem .15rem;
|
|
.left_back {
|
width: 1rem;
|
height: 100%;
|
left: 0;
|
position: absolute;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
|
img {
|
width: .6rem;
|
height: .6rem;
|
}
|
}
|
.right_back {
|
width: 1rem;
|
height: 100%;
|
right: 0;
|
position: absolute;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
|
img {
|
width: .6rem;
|
height: .6rem;
|
}
|
}
|
|
.header_titles {
|
width: 100%;
|
height: 100%;
|
text-align: center;
|
font-size: .4615rem;
|
line-height: 1.5rem;
|
|
span {
|
font-weight: 600;
|
}
|
}
|
}
|
|
.form-block {
|
width: 100%;
|
height: 1.5rem;
|
margin-top: .3rem;
|
}
|
|
/deep/ .mint-field-other {
|
padding-right: .3rem;
|
}
|
|
/deep/ .mint-cell-wrapper {
|
height: 100%;
|
border: none;
|
background: rgb(245, 245, 245);
|
border-radius: .15rem;
|
}
|
|
.is-selected {
|
background: rgb(235, 235, 235) !important;
|
border-radius: .15rem;
|
}
|
|
.mint-navbar {
|
padding: 0 .3rem;
|
}
|
|
.btnbox {
|
width: 94%;
|
margin-top: .1rem;
|
}
|
|
.loginout {
|
height: 1.2rem !important;
|
line-height: 1.2rem !important;
|
}
|
|
.int-cell {
|
width: 100%;
|
height: 100%;
|
}
|
|
a {
|
width: 100%;
|
height: 100%;
|
|
.mint-cell-wrapper {
|
width: 100%;
|
height: 100%;
|
}
|
}
|
|
.bars {
|
width: 100%;
|
height: 4rem;
|
display: flex;
|
padding: 0 .3rem;
|
align-items: flex-end;
|
|
>div {
|
margin-bottom: 1.2rem;
|
font-size: .65rem;
|
|
span {
|
font-weight: 600;
|
}
|
}
|
}
|
|
.mint-cell.mint-field {
|
background: #fff !important;
|
color: #000 !important;
|
}
|
|
/deep/ .mint-cell-text {
|
color: #000 !important;
|
}
|
|
.text-center.btnok {
|
display: inline-block;
|
height: 1rem;
|
line-height: 1rem;
|
background: #2d6ae9;
|
border: none;
|
border-radius: .1rem;
|
}
|
|
.wrapper {
|
width: 100%;
|
// height: 100%;
|
height: calc(100% - 104px);
|
background: #fff;
|
}
|
|
/deep/.mint-cell-wrapper {
|
|
span {
|
font-size: 0.35rem !important;
|
}
|
|
/deep/input {
|
font-size: 0.35rem !important;
|
}
|
}
|
|
/deep/.mint-cell-value {
|
font-size: 0.35rem !important;
|
}
|
|
/deep/.mint-tab-item-label {
|
font-size: 0.35rem !important;
|
}
|
|
/deep/.loginout {
|
font-size: 0.35rem !important;
|
}
|
</style>
|