1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!-- ******************* 输入框 ******************* -->
<template>
<view class="picker-box">
<!-- <view class="u-flex u-row-between" @click="openPicker">
<view class="txt u-flex-1">{{dataValue||'请选择时间'}}</view>
<u-icon name="arrow-right" color="#666" size="28"></u-icon>
</view> -->
<!-- <u-picker :params="params" v-model="showPicker" mode="time" @confirm="pickerConfirm"></u-picker> -->
<view class="u-flex u-row-between">
<picker mode="date" :value="dataValue" @change="bindDateChange" class="txt u-flex-1">
<view>{{dataValue || '请选择时间'}}</view>
</picker>
<u-icon name="arrow-right" color="#666" size="28"></u-icon>
</view>
</view>
</template>
<script>
import stringMixin from './stringMixin'
export default {
components: {},
mixins: [stringMixin],
props: {},
data() {
return {
showPicker: false,
params: {
year: true,
month: true,
day: true,
hour: false,
minute: false,
second: false,
timestamp: true,
},
date: '请选择',
}
},
mounted() {},
methods: {
openPicker() {
this.showPicker = true
},
pickerConfirm(data) {
let result = []
let dataValue = data.year + '-' + data.month + '-' + data.day
this.dataValue = dataValue
this.valueChange(dataValue)
},
bindDateChange: function(e) {
const value = e.target.value
this.dataValue = value
this.valueChange(value)
}
}
}
</script>
<style>
</style>