Commit f4a7758d authored by 李晓兵's avatar 李晓兵

'input组件'

parent f9ac0642
Pipeline #3630 canceled with stages
/**
* @Author Sean
* @Date 2019/11/21
*/
<template>
<input
:value="formatValue" :readonly="disable" type="text"
@input="onInput($event.target.value)" @focus="onFocus" @blur="onBlur">
</template>
<script>
export default {
name: 'CurrencyInput',
props: {
value: {
type: Number,
default: 0,
},
disable: {
type: Boolean,
default: false,
},
},
data () {
return {
focused: false,
}
},
filter: {
uncurrency (val) {
if (!val) return null
return (Number((val).replace(/,/gi, ''))) === 0 ? null : Number((val).replace(/,/gi, ''))
},
},
computed: {
formatValue () {
let currency = this.$options.filters['currency']
if (!this.focused) {
return currency(this.value)
} else {
return this.value
}
},
},
methods: {
onInput: function (value) {
if (this.disable) return
let uncurrency = this.$options.filter['uncurrency']
this.currencyValue = uncurrency(value)
this.$emit('input', this.currencyValue)
},
onFocus (event) {
if (this.disable) return
this.focused = true
setTimeout(function () {
event.target.type = 'number'
event.target.focus()
}, 0)
},
onBlur (event) {
if (this.disable) return
event.target.type = 'text'
this.focused = false
},
},
}
</script>
<style scoped lang="less">
</style>
......@@ -36,6 +36,7 @@ var CryptoJS = require('crypto-js')
export default {
data () {
return {
money:234567,
pwdType: 'password', // 密码类型
openEye: require('@/assets/login/pwd.png'), // 图片地址
username: window.localStorage.username
......@@ -45,6 +46,17 @@ export default {
currentVersion: process.env.currentVersion,
routeName: this.$route.params.routeName || '',
}
},
beforeRouteEnter (to, from, next) {
if (from.fullPath === '/tab/my-info' || from.fullPath === '/margin-first-pay') { // 绑定查询入口
next(vm => {
vm.getAccessToken()
})
}
next()
},
created () {
},
mounted () {
window.addEventListener('native.keyboardhide', function () {
......@@ -87,6 +99,16 @@ export default {
// 极光推送
})
},
getAccessToken () {
let vm = this
let url = process.env.loginPath + 'admin'
let param = {}
// vm.hlsPopup.showLoading('请稍等')
vm.$post(url, param).then(function (res) {
// vm.hlsPopup.hideLoading()
window.localStorage.setItem('access_token', res.access_token)
})
},
access: function () {
document.getElementById('passwordInput').blur()
let vm = this
......@@ -95,14 +117,7 @@ export default {
} else if (!vm.password || vm.password === undefined) {
vm.hlsPopup.showLongCenter('请输入密码')
} else {
let url = process.env.loginPath + 'admin'
let param = {}
vm.hlsPopup.showLoading('请稍等')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
window.localStorage.setItem('access_token', res.access_token)
vm.login()
})
}
},
registerNew: function () {
......
......@@ -537,7 +537,7 @@ export default {
legal_personMsg: {
id_card_no: null,
// legal_person: '',
cell_phone: '',
cell_phone: window.localStorage.getItem('user_phone'),
living_address: '',
id_card_date_from: '', // 法定代表人身份证有效期从
id_card_date_to: '', // 法定代表人身份证有效期到
......@@ -795,10 +795,10 @@ export default {
this.hlsPopup.showLongCenter('请输入正确银行卡号!')
}
// 验证账户名称与承租人名称一致
if (this.bank_lists.bank_account_name !== this.saveInfo.bp_name) {
/* if (this.bank_lists.bank_account_name !== this.saveInfo.bp_name) {
this.bank_card_flag = false
this.hlsPopup.showLongCenter('企业名称与账户名称不一致')
}
}*/
if (this.bank_card_flag) {
this.hlsPopup.showLoading('请稍后')
let id
......@@ -1464,6 +1464,7 @@ export default {
vm.baseInfo.legal_person = result.法人.words
vm.baseInfo.registered_place = result.地址.words
vm.baseInfo.organization_code = result.社会信用代码.words
vm.baseInfo.business_address = vm.baseInfo.registered_place // 经营地址默认为注册地址,支持修改
})
},
load_picture (check_id, index, cdd_item) {
......
......@@ -236,7 +236,7 @@ export default {
phoneNumber: function (str) {
// ^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\\d{8}$
let reg = /^((13[0-9]{1})|(14[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1})|166|198|199|(147))+\d{8}$/
let reg = /^((13[0-9]{1})|(14[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(19[0-9]{1})|(18[0-9]{1})|166|198|199|(147))+\d{8}$/
return reg.test(str)
},
/**
......@@ -245,7 +245,7 @@ export default {
* @returns {boolean}
*/
phoneNumber86: function (str) {
let reg = /^(\+86|\+86+\s)+(((13[0-9]{1})|(14[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1})|166|198|199|(147))+\d{8})$/
let reg = /^(\+86|\+86+\s)+(((13[0-9]{1})|(14[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(19[0-9]{1})|(18[0-9]{1})|166|198|199|(147))+\d{8})$/
return reg.test(str)
},
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment