Commit d5b44402 by Jaxon

feat: 督导统计 - 业务开发

1 parent 392349c6
{
"component": true,
"usingComponents": {
"van-icon": "@vant/weapp/icon/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-calendar": "@vant/weapp/calendar/index",
"van-picker": "@vant/weapp/picker/index"
}
}
\ No newline at end of file \ No newline at end of file
/* components/dateScreen/dateScreen.wxss */
.date-screen {
display: flex;
align-items: center;
justify-content: center;
.tab-section {
box-sizing: border-box;
width: 278rpx;
height: 56rpx;
display: flex;
align-items: center;
background: #FFFFFF;
border-radius: 56rpx;
font-size: 26rpx;
color: #999999;
padding: 4rpx;
&.isSticky {
background: #F7F8FA;
}
.tab {
flex: 1;
text-align: center;
height: 48rpx;
line-height: 48rpx;
border-radius: 48rpx;
&.active{
color: #2C66F7;
font-weight: 500;
background: #2c66f71a;
}
}
}
.date-section {
box-sizing: border-box;
height: 56rpx;
flex: 1;
max-width: calc(100% - 278rpx);
display: flex;
align-items: center;
justify-content: space-around;
.date-text {
font-size: 26rpx;
text-align: center;
width: 320rpx;
flex-shrink: 0;
}
.arrow {
width: 32rpx;
}
}
}
\ No newline at end of file \ No newline at end of file
<!--components/dateScreen/dateScreen.wxml-->
<view class="date-screen">
<view class="tab-section {{ isSticky ? 'isSticky' : '' }}"
style="background: {{ customBackground }};"
wx:if="{{ !tabSelected || tabSelected == 3 }}">
<block wx:for="{{ dateList }}" wx:key="index">
<view class="tab {{ item.index==dateCurrent?'active':'' }}"
data-index="{{ item.index }}"
bind:tap="selectDate">
{{ item.title }}
</view>
</block>
</view>
<view class="date-section">
<view class="arrow left">
<van-icon wx:if="{{ !leftCurrent }}"
class="arrow-left"
name="arrow-left"
bind:tap="last" />
</view>
<view class="date-text" bind:tap="onDisplayDate">
{{ date }}
</view>
<view class="arrow right">
<van-icon wx:if="{{ !rightCurrent }}"
class="arrow-right"
name="arrow"
bind:tap="next" />
</view>
</view>
</view>
<!-- 年月日 -->
<block wx:if="{{ dateShow }}">
<popup bindcancel="cancel"
bindconfirm="confirm"
show="{{ dateShow }}"
title="{{ titleEnum[timeType] }}"
height="60vh">
<block wx:if="{{ timeType == 'date' || timeType == 'year-month' }}">
<van-datetime-picker id="datePicker"
show-toolbar="{{ false }}"
min-date="{{ minDate }}"
max-date="{{ maxDate }}"
model:value="{{ currentDate }}"
type="{{ timeType=='date'?'date':'year-month' }}"
bind:change="onChange"
bind:input="onInput" />
</block>
<!-- 周 -->
<block wx:if="{{ timeType == 'week' }}">
<van-picker id="weekPicker"
show-toolbar="{{ false }}"
model:value="{{ currentDate }}"
default-index="{{ defaultIndex }}"
value-key="label"
columns="{{ weekColumns }}"
bind:change="onWeekChange" />
</block>
</popup>
</block>
<block wx:if="{{ show }}">
<van-calendar id="calendar"
max-range="{{ 31 }}"
min-date="{{ minDate }}"
max-date="{{ maxDate }}"
show="{{ show }}"
type="range"
color="#2C66F7"
bind:confirm="onConfirm"
bind:close="onClose" />
</block>
...@@ -2,6 +2,7 @@ import { schemaList, schemaCommonBrandList } from "./stationStaffPerformance.dat ...@@ -2,6 +2,7 @@ import { schemaList, schemaCommonBrandList } from "./stationStaffPerformance.dat
import { brandTypeList } from "~/packageIndex/constant/performance.js"; import { brandTypeList } from "~/packageIndex/constant/performance.js";
import { getSupervisorStaffApi } from "~/packageIndex/api/performance.js"; import { getSupervisorStaffApi } from "~/packageIndex/api/performance.js";
const IMG_URL = "https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/"; const IMG_URL = "https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/";
import dayjs from "dayjs";
Page({ Page({
data: { data: {
IMG_URL, IMG_URL,
...@@ -53,6 +54,12 @@ Page({ ...@@ -53,6 +54,12 @@ Page({
} }
this.setData({ this.setData({
brandTypeList: wx.$util.deepClone(brandTypeList), brandTypeList: wx.$util.deepClone(brandTypeList),
query: {
...this.data.query,
dateType: 0,
startDate: dayjs().startOf("day").format("YYYY-MM-DD"),
endDate: dayjs().endOf("day").format("YYYY-MM-DD"),
},
}); });
}, },
// onLoad(options) { // onLoad(options) {
...@@ -104,6 +111,7 @@ Page({ ...@@ -104,6 +111,7 @@ Page({
await this.getData(); await this.getData();
}, },
async handleSearch({ detail }) { async handleSearch({ detail }) {
console.log("handleSearch");
this.setData({ this.setData({
query: { query: {
...this.data.query, ...this.data.query,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"usingComponents": { "usingComponents": {
"TypeTabs": "/packageIndex/components/typeTabs/typeTabs", "TypeTabs": "/packageIndex/components/typeTabs/typeTabs",
"StatisticsItem": "/packageIndex/components/statisticsItem/statisticsItem", "StatisticsItem": "/packageIndex/components/statisticsItem/statisticsItem",
"date-screen": "/components/dateScreen/dateScreen", "date-screen": "/packageIndex/components/dateScreen/dateScreen",
"van-search": "@vant/weapp/search/index" "van-search": "@vant/weapp/search/index"
}, },
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
<view class="date-filter-wrapper"> <view class="date-filter-wrapper">
<date-screen customBackground="#f3f3f4" <date-screen customBackground="#f3f3f4"
tabSelected="{{ 3 }}" tabSelected="{{ 3 }}"
initStartDate="{{ query.startDate }}" init-start-date="{{ query.startDate }}"
initEndDate="{{ query.endDate }}" init-end-date="{{ query.endDate }}"
initTimeDimension="{{ query.dateType }}" init-time-dimension="{{ query.dateType }}"
bind:search="handleSearch"></date-screen> bind:search="handleSearch"></date-screen>
</view> </view>
<van-search value="{{ query.filterKey }}" <van-search value="{{ query.filterKey }}"
......
...@@ -88,6 +88,7 @@ Page({ ...@@ -88,6 +88,7 @@ Page({
await this.getData(); await this.getData();
}, },
async handleSearch({ detail }) { async handleSearch({ detail }) {
console.log("store search");
this.setData({ this.setData({
query: { query: {
...this.data.query, ...this.data.query,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"usingComponents": { "usingComponents": {
"TypeTabs": "/packageIndex/components/typeTabs/typeTabs", "TypeTabs": "/packageIndex/components/typeTabs/typeTabs",
"StatisticsItem": "/packageIndex/components/statisticsItem/statisticsItem", "StatisticsItem": "/packageIndex/components/statisticsItem/statisticsItem",
"date-screen": "/components/dateScreen/dateScreen", "date-screen": "/packageIndex/components/dateScreen/dateScreen",
"van-search": "@vant/weapp/search/index", "van-search": "@vant/weapp/search/index",
"WarnList": "/packageIndex/components/warnList/index" "WarnList": "/packageIndex/components/warnList/index"
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!