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"
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>
</template>
@ -110,7 +110,10 @@
date: '',
time: '',
select: '',
number: '',
number: 0,
sfzh: '',
cphm: '',
search: '',
},
selectData: [//text,
{text: "[1]A", code: "1", value: "A"},

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

@ -7,9 +7,14 @@
clickable
readonly
:label="label"
@click="showPicker"
right-icon="logistics"
placeholder="车牌号码">
right-icon="logistics">
<template slot="input">
<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-popup
v-model="showPopup"
@ -45,8 +50,9 @@
},
data(){
return {
prefix: '',
suffix: '',
showPopup: false,
value: '',
columns: [
{
values: [
@ -173,47 +179,113 @@
]
}
},
computed: {
result(){
this.$emit('input', this.prefix + this.suffix);
return '';
}
},
props: {
'label': String,
'required': Boolean
'label': {
type: String,
default: ''
},
'required': {
type: Boolean,
default: false
},
'readonly': {
type: Boolean,
default: false
},
'value': {
type: String,
default: 0
}
},
methods: {
onConfirm() {
//
const c = this.$refs['prefix'].getValues();
this.prefix = c[0].text + c[1];
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() {
this.showPopup = false;
},
onChange(picker, values) {
window.console.log(values);
// picker.setColumnValues(1, values.children);
picker.setColumnValues(1, values[0].children);
},
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;
},
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){
this.value = value;
this.$emit('input', this.value);
this.suffix = value;
},
filter(key){
if (key === '[+]') {
Toast("扫描未实现")
Toast("扫描未实现");
return "";
}
return key;
}
},
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>
<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>
<div>
<van-field
v-model="value"
v-model="showValue"
:required="required"
clearable
clickable
@ -9,7 +9,7 @@
:label="label"
@click="onPick"
right-icon="calender-o"
placeholder="请选择日期"/>
:placeholder="'请选择'+label"/>
<van-popup
v-model="showPopup"
position="bottom"
@ -40,15 +40,32 @@
data(){
return {
showPopup: false,
value: '',
showValue: '',
currentDate: '',
minDate: '',
}
},
props: {
'label': String,
'formatter': String,
'required': Boolean
'label': {
type: String,
default: ''
},
'required': {
type: Boolean,
default: false
},
'readonly': {
type: Boolean,
default: false
},
'value': {
type: String,
default: ''
},
'formatter': {
type: String,
default: 'yyyy-MM-dd'
}
},
methods: {
onPick(){
@ -56,8 +73,8 @@
},
onConfirm(value){
this.showPopup = false;
this.value = value.format(this.formatter);
this.$emit('input', this.value);
this.showValue = value.format(this.formatter);
this.$emit('input', this.showValue);
},
onCancel(){
this.showPopup = false;

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

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

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

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

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

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

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

Loading…
Cancel
Save

Powered by TurnKey Linux.