wangbing 5 years ago
parent 7bb6fbd28f
commit 306c76bbd4

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 KiB

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

@ -62,7 +62,7 @@
@search="onFilter" @search="onFilter"
label="搜索列表"/> label="搜索列表"/>
<van-button style="margin-top: 30px" type="primary" size="large" @click="onSearch"></van-button> <van-button style="margin-top: 30px" type="primary" size="large" @click="onSearch"></van-button>
</div> </div>
</div> </div>
</template> </template>
@ -110,7 +110,10 @@
date: '', date: '',
time: '', time: '',
select: '', select: '',
number: '', number: 0,
sfzh: '',
cphm: '',
search: '',
}, },
selectData: [//text, selectData: [//text,
{text: "[1]A", code: "1", value: "A"}, {text: "[1]A", code: "1", value: "A"},

@ -12,9 +12,15 @@
<van-swipe-item> <van-swipe-item>
<img src="../../assets/bar1.jpg" class="" width="100%"/> <img src="../../assets/bar1.jpg" class="" width="100%"/>
</van-swipe-item> </van-swipe-item>
<van-swipe-item>
<img src="../../assets/bar2.jpg" class="" width="100%"/>
</van-swipe-item>
<van-swipe-item>
<img src="../../assets/bar3.jpg" class="" width="100%"/>
</van-swipe-item>
</van-swipe> </van-swipe>
<van-notice-bar <van-notice-bar
text="连云港警方“快递哥消防宣传公益使者”行动" text="台风“利奇马”逼近 浙江象山为避灾民众撑起“避风港”"
left-icon="volume-o" :scrollable="false"/> left-icon="volume-o" :scrollable="false"/>
<van-grid> <van-grid>

@ -7,9 +7,14 @@
clickable clickable
readonly readonly
:label="label" :label="label"
@click="showPicker" right-icon="logistics">
right-icon="logistics" <template slot="input">
placeholder="车牌号码"> <div class="cphm">
<span class="cphm-qy" @click="showPicker">{{prefix}}</span>
<input class="cphm-bh" @click="showInput" readonly v-model="suffix"/>
<span>{{result}}</span>
</div>
</template>
</van-field> </van-field>
<van-popup <van-popup
v-model="showPopup" v-model="showPopup"
@ -45,8 +50,9 @@
}, },
data(){ data(){
return { return {
prefix: '',
suffix: '',
showPopup: false, showPopup: false,
value: '',
columns: [ columns: [
{ {
values: [ values: [
@ -173,47 +179,113 @@
] ]
} }
}, },
computed: {
result(){
this.$emit('input', this.prefix + this.suffix);
return '';
}
},
props: { props: {
'label': String, 'label': {
'required': Boolean type: String,
default: ''
},
'required': {
type: Boolean,
default: false
},
'readonly': {
type: Boolean,
default: false
},
'value': {
type: String,
default: 0
}
}, },
methods: { methods: {
onConfirm() { onConfirm() {
// //
const c = this.$refs['prefix'].getValues(); const c = this.$refs['prefix'].getValues();
this.prefix = c[0].text + c[1];
this.showPopup = false; this.showPopup = false;
keyboard({
value: c[0].text + c[1],
cols: 10,
keys: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[+]'],
finish: this.finish,
filter: this.filter,
})
}, },
onCancel() { onCancel() {
this.showPopup = false; this.showPopup = false;
}, },
onChange(picker, values) { onChange(picker, values) {
window.console.log(values); picker.setColumnValues(1, values[0].children);
// picker.setColumnValues(1, values.children);
}, },
showPicker(){ showPicker(){
this.columns[0].defaultIndex = 0;
this.columns[1].defaultIndex = 0;
let sheng = this.prefix.substr(0, 1);
let shi = this.prefix.substr(1, 1);
this.columns[0].values.forEach((item, index) => {
if (sheng === item.text) {
this.columns[0].defaultIndex = index;
item.children.forEach((item_, index_) => {
if (shi === item_) {
this.columns[1].defaultIndex = index_;
}
})
}
})
this.showPopup = true; this.showPopup = true;
}, },
showInput(){
keyboard({
value: '',
cols: 10,
keys: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[+]'],
finish: this.finish,
filter: this.filter,
})
},
finish(value){ finish(value){
this.value = value; this.suffix = value;
this.$emit('input', this.value);
}, },
filter(key){ filter(key){
if (key === '[+]') { if (key === '[+]') {
Toast("扫描未实现") Toast("扫描未实现");
return ""; return "";
} }
return key; return key;
} }
}, },
mounted(){ mounted(){
let value = this.value;
if (value.match("[\u4e00-\u9fa5].*")) {
this.prefix = value.substr(0, 2);
this.suffix = value.substr(2, value.length);
} else {
let item = this.columns[0].values[0];
this.prefix = item.text + item.children[0];
}
} }
} }
</script> </script>
<style lang="less">
.cphm {
-webkit-box-flex: 0;
-webkit-flex: none;
flex: none;
vertical-align: top;
&-qy {
display: inline-block;
vertical-align: top;
height: 30px;
line-height: 30px;
padding: 0 5px;
background-color: #f2f3f5;
}
&-bh {
vertical-align: top;
padding: 0 0 0 5px;
height: 30px;
border: 0;
}
}
</style>

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<van-field <van-field
v-model="value" v-model="showValue"
:required="required" :required="required"
clearable clearable
clickable clickable
@ -9,7 +9,7 @@
:label="label" :label="label"
@click="onPick" @click="onPick"
right-icon="calender-o" right-icon="calender-o"
placeholder="请选择日期"/> :placeholder="'请选择'+label"/>
<van-popup <van-popup
v-model="showPopup" v-model="showPopup"
position="bottom" position="bottom"
@ -40,15 +40,32 @@
data(){ data(){
return { return {
showPopup: false, showPopup: false,
value: '', showValue: '',
currentDate: '', currentDate: '',
minDate: '', minDate: '',
} }
}, },
props: { props: {
'label': String, 'label': {
'formatter': String, type: String,
'required': Boolean default: ''
},
'required': {
type: Boolean,
default: false
},
'readonly': {
type: Boolean,
default: false
},
'value': {
type: String,
default: ''
},
'formatter': {
type: String,
default: 'yyyy-MM-dd'
}
}, },
methods: { methods: {
onPick(){ onPick(){
@ -56,8 +73,8 @@
}, },
onConfirm(value){ onConfirm(value){
this.showPopup = false; this.showPopup = false;
this.value = value.format(this.formatter); this.showValue = value.format(this.formatter);
this.$emit('input', this.value); this.$emit('input', this.showValue);
}, },
onCancel(){ onCancel(){
this.showPopup = false; this.showPopup = false;

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<van-field <van-field
v-model="value" v-model="showValue"
:required="required" :required="required"
clearable clearable
clickable clickable
@ -9,7 +9,7 @@
:label="label" :label="label"
@click="onPick" @click="onPick"
right-icon="calender-o" right-icon="calender-o"
placeholder="请选择日期时间"/> :placeholder="'请选择'+label"/>
<van-popup <van-popup
v-model="showPopup" v-model="showPopup"
position="bottom" position="bottom"
@ -40,15 +40,32 @@
data(){ data(){
return { return {
showPopup: false, showPopup: false,
value: '', showValue: '',
currentDate: '', currentDate: '',
minDate: '', minDate: '',
} }
}, },
props: { props: {
'label': String, 'label': {
'formatter': String, type: String,
'required': Boolean default: ''
},
'required': {
type: Boolean,
default: false
},
'readonly': {
type: Boolean,
default: false
},
'value': {
type: String,
default: ''
},
'formatter': {
type: String,
default: 'yyyy-MM-dd hh:mm:ss'
}
}, },
methods: { methods: {
onPick(){ onPick(){
@ -56,8 +73,8 @@
}, },
onConfirm(value){ onConfirm(value){
this.showPopup = false; this.showPopup = false;
this.value = value.format(this.formatter); this.showValue = value.format(this.formatter);
this.$emit('input', this.value); this.$emit('input', this.showValue);
}, },
onCancel(){ onCancel(){
this.showPopup = false; this.showPopup = false;

@ -1,7 +1,6 @@
<template> <template>
<div> <div>
<van-field <van-field
v-model="value"
:required="required" :required="required"
clearable clearable
readonly readonly
@ -9,9 +8,10 @@
@click="onPick"> @click="onPick">
<van-stepper <van-stepper
:disabled="readonly" :disabled="readonly"
:min="0" :min="min"
:max="max"
slot="input" slot="input"
:value="value" :value="showValue"
@change="onChange"/> @change="onChange"/>
</van-field> </van-field>
</div> </div>
@ -30,13 +30,34 @@
data(){ data(){
return { return {
showPopup: false, showPopup: false,
value: 0, showValue: 0,
} }
}, },
props: { props: {
'label': String, 'label': {
'required': Boolean, type: String,
'readonly': Boolean default: ''
},
'required': {
type: Boolean,
default: false
},
'readonly': {
type: Boolean,
default: false
},
'value': {
type: Number,
default: 0
},
'min': {
type: Number,
default: 0
},
'max': {
type: Number,
default: 999999999
},
}, },
methods: { methods: {
onPick(){ onPick(){
@ -44,7 +65,8 @@
}, },
onChange(value){ onChange(value){
this.showPopup = false; this.showPopup = false;
this.$emit('input', value); this.showValue = value;
this.$emit('input', this.showValue);
} }
}, },
mounted(){ mounted(){

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<van-field <van-field
v-model="value" v-model="showValue"
:required="required" :required="required"
clearable clearable
clickable clickable
@ -56,20 +56,34 @@
data(){ data(){
return { return {
showPopup: false, showPopup: false,
value: '', showValue: '',
keywords: '', keywords: '',
data: [] data: []
} }
}, },
props: { props: {
'label': String, 'label': {
'required': Boolean, type: String,
default: ''
},
'required': {
type: Boolean,
default: false
},
'readonly': {
type: Boolean,
default: false
},
'value': {
type: String,
default: ''
}
}, },
methods: { methods: {
onConfirm(value, index) { onConfirm(value, index) {
this.showPopup = false; this.showPopup = false;
this.value = this.data[index]; this.showValue = this.data[index].text;
this.$emit('input', this.value); this.$emit('input', this.data[index].key);
}, },
onSearch() { onSearch() {
this.$emit('search', this.keywords, this.callback); this.$emit('search', this.keywords, this.callback);
@ -81,7 +95,7 @@
this.showPopup = false; this.showPopup = false;
}, },
onChange(picker, values) { onChange(picker, values) {
window.console.log(values);
}, },
showPicker(){ showPicker(){
this.showPopup = true; this.showPopup = true;

@ -1,14 +1,14 @@
<template> <template>
<div> <div>
<van-field <van-field
v-model="value" v-model="showValue"
:required="required" :required="required"
clearable clearable
readonly readonly
:label="label" :label="label"
@click="onPick" @click="onPick"
right-icon="wap-nav" right-icon="wap-nav"
placeholder="请选择"/> :placeholder="'请选择'+label"/>
<van-popup <van-popup
v-model="showPopup" v-model="showPopup"
position="bottom"> position="bottom">
@ -40,14 +40,31 @@
data(){ data(){
return { return {
showPopup: false, showPopup: false,
value: '', showValue: '',
defaultIndex: 0, defaultIndex: 0,
} }
}, },
props: { props: {
'label': String, 'label': {
'data': Array, type: String,
'required': Boolean default: ''
},
'required': {
type: Boolean,
default: false
},
'readonly': {
type: Boolean,
default: false
},
'value': {
type: String,
default: ''
},
'data': {
type: Array,
default: []
}
}, },
methods: { methods: {
onPick(){ onPick(){
@ -55,8 +72,8 @@
}, },
onConfirm(value, index) { onConfirm(value, index) {
this.showPopup = false; this.showPopup = false;
this.value = this.data[index].text; this.showValue = this.data[index].text;
this.$emit('input',this.data[index]); this.$emit('input',this.data[index].key);
}, },
onCancel(){ onCancel(){
this.showPopup = false; this.showPopup = false;

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<van-field <van-field
v-model="value" v-model="showValue"
:required="required" :required="required"
clearable clearable
clickable clickable
@ -9,7 +9,7 @@
:label="label" :label="label"
@click="showPicker" @click="showPicker"
right-icon="idcard" right-icon="idcard"
placeholder="证件号码"/> :placeholder="'请输入'+label"/>
<!--<keyboard v-model="value" :visible="true" :keys="keys" :cols="cols" @onCancel="onCancel" @onFinish="onFinish"/>--> <!--<keyboard v-model="value" :visible="true" :keys="keys" :cols="cols" @onCancel="onCancel" @onFinish="onFinish"/>-->
</div> </div>
@ -32,12 +32,26 @@
data(){ data(){
return { return {
visible: false, visible: false,
value: '', showValue: '',
} }
}, },
props: { props: {
'label': String, 'label': {
'required': Boolean type: String,
default: ''
},
'required': {
type: Boolean,
default: false
},
'readonly': {
type: Boolean,
default: false
},
'value': {
type: String,
default: ''
},
}, },
methods: { methods: {
showPicker(){ showPicker(){
@ -50,8 +64,8 @@
}) })
}, },
finish(value){ finish(value){
this.value = value; this.showValue = value;
this.$emit('input', this.value); this.$emit('input', this.showValue);
}, },
filter(key){ filter(key){
if (key === '[+]') { if (key === '[+]') {

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<van-field <van-field
v-model="value" v-model="showValue"
:required="required" :required="required"
clearable clearable
clickable clickable
@ -9,7 +9,7 @@
:label="label" :label="label"
@click="onPick" @click="onPick"
right-icon="clock-o" right-icon="clock-o"
placeholder="请选择时间"/> :placeholder="'请选择'+label"/>
<van-popup <van-popup
v-model="showPopup" v-model="showPopup"
position="bottom"> position="bottom">
@ -38,13 +38,27 @@
data(){ data(){
return { return {
showPopup: false, showPopup: false,
value: '', showValue: '',
currentTime: '', currentTime: '',
} }
}, },
props: { props: {
'label': String, 'label': {
'required': Boolean type: String,
default: ''
},
'required': {
type: Boolean,
default: false
},
'readonly': {
type: Boolean,
default: false
},
'value': {
type: String,
default: ''
},
}, },
methods: { methods: {
onPick(){ onPick(){
@ -52,8 +66,8 @@
}, },
onConfirm(value){ onConfirm(value){
this.showPopup = false; this.showPopup = false;
this.value = value + ":00"; this.showValue = value + ":00";
this.$emit('input', this.value); this.$emit('input', this.showValue);
}, },
onCancel(){ onCancel(){
this.showPopup = false; this.showPopup = false;

@ -76,7 +76,6 @@
show(){ show(){
this.showPopup = true; this.showPopup = true;
this.rows = Math.ceil(this.keys.length / this.cols); this.rows = Math.ceil(this.keys.length / this.cols);
window.console.log(this.rows)
} }
}, },
mounted(){ mounted(){

Loading…
Cancel
Save

Powered by TurnKey Linux.