更新
This commit is contained in:
parent
7ed62600dc
commit
194844e966
@ -8,7 +8,11 @@
|
||||
<u-icon name="calendar" :size="fontSize*1.5"></u-icon>
|
||||
</template>
|
||||
</u-input>
|
||||
<view class="pos-abt-all"></view>
|
||||
<view class="pos-abt-all">
|
||||
<tpx-select :list="toolsRangesList" :value="value[1]" :customInput="true" mode="drop" @onChange="handleToolsRangChange">
|
||||
<view :style="`height: 64rpx;`" ></view>
|
||||
</tpx-select>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 日历 -->
|
||||
<u-calendar title="请选择日期范围" color="#B12D29" mode="range" rowHeight="90" closeOnClickOverlay :show="showCladar" :defaultDate="value" @confirm="handleClaOk" @close="handleSwitchCladar"
|
||||
@ -17,6 +21,8 @@
|
||||
|
||||
<script>
|
||||
import { } from "@/common/untool"
|
||||
import dayjs from "dayjs"
|
||||
|
||||
export default {
|
||||
computed: {
|
||||
inputValue() {
|
||||
@ -45,6 +51,21 @@
|
||||
return ''
|
||||
}
|
||||
},
|
||||
showTools:{
|
||||
default () {
|
||||
return true
|
||||
}
|
||||
},
|
||||
toolsRangesList: {
|
||||
default () {
|
||||
return [
|
||||
{ title: '今日', val: dayjs().format("YYYY-MM-DD") },
|
||||
{ title: '昨日', val: dayjs().subtract(1, 'days').format("YYYY-MM-DD") },
|
||||
{ title: '最近一周', val: dayjs().subtract(7, 'days').format("YYYY-MM-DD") },
|
||||
{ title: '自定义', val: -1 },
|
||||
]
|
||||
}
|
||||
},
|
||||
placeholderStyle:{
|
||||
default () {
|
||||
return ''
|
||||
@ -66,7 +87,9 @@
|
||||
|
||||
methods: {
|
||||
handleSelectDate() {
|
||||
this.handleSwitchCladar()
|
||||
if(!this.showTools) {
|
||||
this.handleSwitchCladar()
|
||||
}
|
||||
},
|
||||
handleChange(val){
|
||||
this.$emit('change', val)
|
||||
@ -80,6 +103,13 @@
|
||||
},
|
||||
handleSwitchCladar() {
|
||||
this.showCladar = !this.showCladar
|
||||
},
|
||||
handleToolsRangChange(val) {
|
||||
if(val == -1) {
|
||||
this.handleSwitchCladar()
|
||||
} else {
|
||||
this.handleChange([dayjs().format("YYYY-MM-DD"), val])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,8 +79,8 @@
|
||||
|
||||
<style scoped lang="scss">
|
||||
.slt-item{
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
height: 66rpx;
|
||||
line-height: 66rpx;
|
||||
font-size: 28rpx;
|
||||
&.active{
|
||||
font-weight: 600;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user