Commit 84896f97 by zhangxw

常驻地样式修改

1 parent ce5eaf94
<template> <template>
<div class="info-content"> <div class="info-content">
<div class="searchControll" @click="showTimeDialog = true"> <!-- <div class="searchControll" @click="showTimeDialog = true">
<a class="icon icon-screen-btn"></a> <a class="icon icon-screen-btn"></a>
<span class="screen-text">筛选</span> <span class="screen-text">筛选</span>
</div> </div> -->
<popup <div class="tab">
:show="showTimeDialog" <div class="tabbar">
@btnCancel="showTimeDialog = false"
@btnSave="saveTime"
:position="'bottom'"
>
<div class="time-content">
<span <span
class="time_btn" class="time_btn"
v-for="(item, index) in timeBtnList" v-for="(item, index) in timeBtnList"
...@@ -20,9 +15,15 @@ ...@@ -20,9 +15,15 @@
>{{ index < 2 ? item : currentDateText }}</span >{{ index < 2 ? item : currentDateText }}</span
> >
</div> </div>
</div>
<popup
:show="showTimePicker"
@btnCancel="showTimePicker = false"
@btnSave="saveTime"
:position="'bottom'"
>
<van-datetime-picker <van-datetime-picker
style="width: 100%" style="width: 100%"
v-if="showTimePicker"
:show-toolbar="false" :show-toolbar="false"
v-model="currentDate" v-model="currentDate"
:max-date="maxDate" :max-date="maxDate"
...@@ -110,7 +111,6 @@ export default defineComponent({ ...@@ -110,7 +111,6 @@ export default defineComponent({
const currentDateText = ref("自定义"); const currentDateText = ref("自定义");
const timeBtnList = ["7天", "30天", "自定义"]; const timeBtnList = ["7天", "30天", "自定义"];
const seledtedItem = ref(0); const seledtedItem = ref(0);
const showTimeDialog = ref(false);
const isShowAllList = ref(false); const isShowAllList = ref(false);
const residentList = ref([]); const residentList = ref([]);
const listScroll = ref(0); const listScroll = ref(0);
...@@ -176,14 +176,14 @@ export default defineComponent({ ...@@ -176,14 +176,14 @@ export default defineComponent({
return val; return val;
}; };
const saveTime = () => { const saveTime = () => {
showTimeDialog.value = false; showTimePicker.value = false;
if (seledtedItem.value === 2) { if (seledtedItem.value === 2) {
currentDateText.value = moment(currentDate.value).format("YYYY-MM"); currentDateText.value = moment(currentDate.value).format("YYYY-MM");
searchTime.value = [ searchTime.value = [
moment(currentDate.value).format("YYYY-MM-DD HH:mm:ss"),
moment(currentDate.value) moment(currentDate.value)
.endOf("month") .endOf("month")
.format("YYYY-MM-DD HH:mm:ss"), .format("YYYY-MM-DD HH:mm:ss"),
moment(currentDate.value).format("YYYY-MM-DD HH:mm:ss"),
]; ];
} }
getData(); getData();
...@@ -209,6 +209,7 @@ export default defineComponent({ ...@@ -209,6 +209,7 @@ export default defineComponent({
]; ];
showTimePicker.value = false; showTimePicker.value = false;
currentDateText.value = "自定义"; currentDateText.value = "自定义";
getData();
break; break;
case 1: case 1:
searchTime.value = [ searchTime.value = [
...@@ -217,6 +218,7 @@ export default defineComponent({ ...@@ -217,6 +218,7 @@ export default defineComponent({
]; ];
currentDateText.value = "自定义"; currentDateText.value = "自定义";
showTimePicker.value = false; showTimePicker.value = false;
getData();
break; break;
case 2: case 2:
showTimePicker.value = true; showTimePicker.value = true;
...@@ -321,7 +323,6 @@ export default defineComponent({ ...@@ -321,7 +323,6 @@ export default defineComponent({
residentList, residentList,
selectTime, selectTime,
searchTime, searchTime,
showTimeDialog,
timeBtnList, timeBtnList,
changey, changey,
listScroll, listScroll,
...@@ -334,6 +335,37 @@ export default defineComponent({ ...@@ -334,6 +335,37 @@ export default defineComponent({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.info-content {
.map-box {
height: calc(100% - 44px) !important;
}
}
.tab {
height: 28px;
background: #fff;
padding: 8px 16px;
.tabbar {
background: #f5f6f7;
border-radius: 6px;
height: 28px;
display: flex;
justify-content: center;
align-items: center;
.time_btn {
height: 24px;
line-height: 24px;
color: #6c737a;
flex: 1;
margin: 0 1px;
text-align: center;
}
.time_btn.active {
background: #fff;
border-radius: 4px;
color: var(--base-color);
}
}
}
.searchControll { .searchControll {
position: fixed; position: fixed;
top: 70px; top: 70px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!