修改默认

This commit is contained in:
aihe 2024-01-27 16:55:59 +08:00
parent f77beff982
commit 56e2723ab3
4 changed files with 42 additions and 12 deletions

View File

@ -8,7 +8,11 @@
<u-icon name="calendar" :size="fontSize*1.5"></u-icon> <u-icon name="calendar" :size="fontSize*1.5"></u-icon>
</template> </template>
</u-input> </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> </view>
<!-- 日历 --> <!-- 日历 -->
<u-calendar title="请选择日期范围" color="#B12D29" mode="range" rowHeight="90" closeOnClickOverlay :show="showCladar" :defaultDate="value" @confirm="handleClaOk" @close="handleSwitchCladar" <u-calendar title="请选择日期范围" color="#B12D29" mode="range" rowHeight="90" closeOnClickOverlay :show="showCladar" :defaultDate="value" @confirm="handleClaOk" @close="handleSwitchCladar"
@ -17,6 +21,8 @@
<script> <script>
import { } from "@/common/untool" import { } from "@/common/untool"
import dayjs from "dayjs"
export default { export default {
computed: { computed: {
inputValue() { inputValue() {
@ -45,6 +51,21 @@
return '' 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:{ placeholderStyle:{
default () { default () {
return '' return ''
@ -66,7 +87,9 @@
methods: { methods: {
handleSelectDate() { handleSelectDate() {
if(!this.showTools) {
this.handleSwitchCladar() this.handleSwitchCladar()
}
}, },
handleChange(val){ handleChange(val){
this.$emit('change', val) this.$emit('change', val)
@ -80,6 +103,13 @@
}, },
handleSwitchCladar() { handleSwitchCladar() {
this.showCladar = !this.showCladar this.showCladar = !this.showCladar
},
handleToolsRangChange(val) {
if(val == -1) {
this.handleSwitchCladar()
} else {
this.handleChange([dayjs().format("YYYY-MM-DD"), val])
}
} }
} }
} }

View File

@ -79,8 +79,8 @@
<style scoped lang="scss"> <style scoped lang="scss">
.slt-item{ .slt-item{
height: 80rpx; height: 66rpx;
line-height: 80rpx; line-height: 66rpx;
font-size: 28rpx; font-size: 28rpx;
&.active{ &.active{
font-weight: 600; font-weight: 600;

View File

@ -8,8 +8,8 @@
<u-row justify="start" gutter="18" custom-style="flex-wrap: wrap;"> <u-row justify="start" gutter="18" custom-style="flex-wrap: wrap;">
<u-col v-for="(item, index) in faBtnlist" span="3" @click="goto(item.url)"> <u-col v-for="(item, index) in faBtnlist" span="3" @click="goto(item.url)">
<view class="dlb-item"> <view class="dlb-item">
<u-image height="60" width="60" :src="item.icon"></u-image> <u-image height="46" width="46" :src="item.icon"></u-image>
<view class="pt-10">{{item.title}}</view> <view class="pt-10 font-26">{{item.title}}</view>
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
@ -22,8 +22,8 @@
<u-row justify="start" gutter="18" custom-style="flex-wrap: wrap;"> <u-row justify="start" gutter="18" custom-style="flex-wrap: wrap;">
<u-col v-for="(item, index) in daoBtnlist" span="3" @click="goto(item.url)"> <u-col v-for="(item, index) in daoBtnlist" span="3" @click="goto(item.url)">
<view class="dlb-item"> <view class="dlb-item">
<u-image height="60" width="60" :src="item.icon"></u-image> <u-image height="46" width="46" :src="item.icon"></u-image>
<view class="pt-10">{{item.title}}</view> <view class="pt-10 font-26">{{item.title}}</view>
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
@ -36,8 +36,8 @@
<u-row justify="start" gutter="18" custom-style="flex-wrap: wrap;"> <u-row justify="start" gutter="18" custom-style="flex-wrap: wrap;">
<u-col v-for="(item, index) in otherBtnlist" span="3" @click="goto(item.url)"> <u-col v-for="(item, index) in otherBtnlist" span="3" @click="goto(item.url)">
<view class="dlb-item"> <view class="dlb-item">
<u-image height="60" width="60" :src="item.icon"></u-image> <u-image height="46" width="46" :src="item.icon"></u-image>
<view class="pt-10">{{item.title}}</view> <view class="pt-10 font-26">{{item.title}}</view>
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
@ -131,6 +131,6 @@
align-items: center; align-items: center;
border: 2rpx solid #F6F6F6; border: 2rpx solid #F6F6F6;
border-radius: 16rpx; border-radius: 16rpx;
height: 160rpx; height: 140rpx;
} }
</style> </style>

View File

@ -79,7 +79,7 @@
<u-row justify="start" gutter="18" custom-style="flex-wrap: wrap;"> <u-row justify="start" gutter="18" custom-style="flex-wrap: wrap;">
<u-col span="3" v-for="tlItem in toolBtnlist" align="center" @click="goto(tlItem.url)"> <u-col span="3" v-for="tlItem in toolBtnlist" align="center" @click="goto(tlItem.url)">
<u-col align="center" justify="center" custom-style="padding: 20rpx;border: 2rpx solid #F6F6F6;border-radius: 16rpx;margin-bottom: 18rpx;display: flex;"> <u-col align="center" justify="center" custom-style="padding: 20rpx;border: 2rpx solid #F6F6F6;border-radius: 16rpx;margin-bottom: 18rpx;display: flex;">
<image :src="tlItem.icon" style="height: 66rpx;width: 66rpx" mode="aspectFit"/> <image :src="tlItem.icon" style="height: 46rpx;width: 46rpx" mode="aspectFit"/>
<view style="font-size: 24rpx;margin-top: 20rpx;">{{tlItem.title}}</view> <view style="font-size: 24rpx;margin-top: 20rpx;">{{tlItem.title}}</view>
</u-col> </u-col>
</u-col> </u-col>