Commit f8719490 by Jaxon

Merge branch 'feature/statistics' into 'SAAS+V5.8.2'

Feature/statistics

See merge request !5
2 parents 770f38d0 761fbcca
Showing 60 changed files with 3444 additions and 276 deletions
......@@ -12,6 +12,8 @@ miniprogram_npm
.env.local
.env.*.local
*.local.json
.vscode/changelists.json
# Log files
npm-debug.log*
yarn-debug.log*
......
......@@ -39,7 +39,6 @@
},
"files.associations": {
"*.wxss": "css",
"*.sass": "scss"
},
"cSpell.words": [
// 微信小程序相关
......
### pnpm -v
10.29.2
### node -v
v20.20.2
#### 账号
##### 督导
-dev 13132112126
-test 13267032121
{
"pages": [
"pages/loading/loading",
"pages/wxLogin/wxLogin",
"pages/nothing/nothing",
"pages/webView/webView",
"pages/tab/index/index",
"pages/tab/crew/crew",
"pages/tab/learningCenter/learningCenter",
"pages/tab/mine/mine"
],
"requiredPrivateInfos": [
"getLocation",
"chooseLocation"
],
"lazyCodeLoading": "requiredComponents",
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black"
},
"tabBar": {
"color": "#999999",
"selectedColor": "#2C66F7",
"backgroundColor": "#FFFFFF",
"borderStyle": "white",
"list": [
{
"pagePath": "pages/tab/index/index",
"text": "工作台",
"iconPath": "images/tab-home.png",
"selectedIconPath": "images/tab-home-active.png"
},
{
"pagePath": "pages/tab/crew/crew",
"text": "团队",
"iconPath": "images/tab-crew.png",
"selectedIconPath": "images/tab-crew-active.png"
},
{
"pagePath": "pages/tab/learningCenter/learningCenter",
"text": "学习中心",
"iconPath": "images/tab-learning.png",
"selectedIconPath": "images/tab-learning-active.png"
},
{
"pagePath": "pages/tab/mine/mine",
"text": "我的",
"iconPath": "images/tab-mine.png",
"selectedIconPath": "images/tab-mine-active.png"
}
]
},
"subpackages": [
{
"root": "packageIndex",
"name": "packageIndex",
"pages": [
"pages/dailySupervisionReport/dailySupervisionReport",
"pages/recordingReview/recordingReview",
"pages/recordingReviewDetail/recordingReviewDetail",
"pages/submitRecordingReview/submitRecordingReview",
"pages/weeklyReview/weeklyReview",
"pages/monthlyPlan/monthlyPlan",
"pages/specialTask/specialTask",
"pages/mySpecialTaskList/mySpecialTaskList",
"pages/specialTaskApply/specialTaskApply",
"pages/mentorRequirements/mentorRequirements",
"pages/caseAudioList/caseAudioList"
]
},
{
"root": "packageCrew",
"name": "packageCrew",
"pages": [
"pages/peopleOverview/peopleOverview",
"pages/storeTransfer/storeTransfer",
"pages/receptionRecording/receptionRecording",
"pages/recordingDetail/recordingDetail",
"pages": [
"pages/loading/loading",
"pages/wxLogin/wxLogin",
"pages/nothing/nothing",
"pages/webView/webView",
"pages/tab/index/index",
"pages/tab/crew/crew",
"pages/tab/learningCenter/learningCenter",
"pages/tab/mine/mine"
],
"requiredPrivateInfos": ["getLocation", "chooseLocation"],
"lazyCodeLoading": "requiredComponents",
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black"
},
"tabBar": {
"color": "#999999",
"selectedColor": "#2C66F7",
"backgroundColor": "#FFFFFF",
"borderStyle": "white",
"list": [
{
"pagePath": "pages/tab/index/index",
"text": "工作台",
"iconPath": "images/tab-home.png",
"selectedIconPath": "images/tab-home-active.png"
},
{
"pagePath": "pages/tab/crew/crew",
"text": "团队",
"iconPath": "images/tab-crew.png",
"selectedIconPath": "images/tab-crew-active.png"
},
{
"pagePath": "pages/tab/learningCenter/learningCenter",
"text": "学习中心",
"iconPath": "images/tab-learning.png",
"selectedIconPath": "images/tab-learning-active.png"
},
{
"pagePath": "pages/tab/mine/mine",
"text": "我的",
"iconPath": "images/tab-mine.png",
"selectedIconPath": "images/tab-mine-active.png"
}
]
},
"subpackages": [
{
"root": "packageIndex",
"name": "packageIndex",
"pages": [
"pages/dailySupervisionReport/dailySupervisionReport",
"pages/recordingReview/recordingReview",
"pages/recordingReviewDetail/recordingReviewDetail",
"pages/submitRecordingReview/submitRecordingReview",
"pages/weeklyReview/weeklyReview",
"pages/monthlyPlan/monthlyPlan",
"pages/specialTask/specialTask",
"pages/stationStaffPerformance/stationStaffPerformance",
"pages/storePerformance/storePerformance",
"pages/mySpecialTaskList/mySpecialTaskList",
"pages/specialTaskApply/specialTaskApply",
"pages/mentorRequirements/mentorRequirements",
"pages/caseAudioList/caseAudioList"
]
},
{
"root": "packageCrew",
"name": "packageCrew",
"pages": [
"pages/peopleOverview/peopleOverview",
"pages/storeTransfer/storeTransfer",
"pages/receptionRecording/receptionRecording",
"pages/recordingDetail/recordingDetail",
"pages/mentoring/mentoring",
"pages/specialMentoring/specialMentoring"
]
},
{
"root": "packageLearningCenter",
"name": "packageLearningCenter",
"pages": [
"pages/coursePush/coursePush"
]
}
],
"preloadRule": {},
"usingComponents": {
"gl-textarea": "/components/GlTextarea/GlTextarea",
"gl-cell": "/components/GlCell/GlCell",
"gl-cust-form": "/components/GLCustForm/GLCustForm",
"calendar": "/components/Calendar/Calendar",
"navigation-bar": "/components/navigationBar/navigationBar",
"popup": "/components/Popup/Popup",
"search-input": "/components/SearchInput/SearchInput",
"tab-bar": "/components/TabBar/TabBar",
"modal": "components/modal/modal",
"gl-image": "components/GlImage/index",
"van-field": "@vant/weapp/field/index",
"van-radio-group": "@vant/weapp/radio-group/index",
"van-radio": "@vant/weapp/radio/index",
"van-popup": "@vant/weapp/popup/index",
"van-dialog": "@vant/weapp/dialog/index",
"van-uploader": "@vant/weapp/uploader/index",
"glsx-privacy": "glsk-applet-component/GlsxPrivacy/index",
"empty-data": "/components/EmptyData/EmptyData",
"van-switch": "@vant/weapp/switch/index"
},
"resolveAlias": {
"~/*": "/*"
},
"sitemapLocation": "sitemap.json",
"__usePrivacyCheck__": true,
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
}
]
},
{
"root": "packageLearningCenter",
"name": "packageLearningCenter",
"pages": ["pages/coursePush/coursePush"]
}
],
"preloadRule": {},
"usingComponents": {
"gl-textarea": "/components/GlTextarea/GlTextarea",
"gl-cell": "/components/GlCell/GlCell",
"gl-cust-form": "/components/GLCustForm/GLCustForm",
"calendar": "/components/Calendar/Calendar",
"navigation-bar": "/components/navigationBar/navigationBar",
"popup": "/components/Popup/Popup",
"search-input": "/components/SearchInput/SearchInput",
"tab-bar": "/components/TabBar/TabBar",
"modal": "components/modal/modal",
"gl-image": "components/GlImage/index",
"van-field": "@vant/weapp/field/index",
"van-radio-group": "@vant/weapp/radio-group/index",
"van-radio": "@vant/weapp/radio/index",
"van-popup": "@vant/weapp/popup/index",
"van-dialog": "@vant/weapp/dialog/index",
"van-uploader": "@vant/weapp/uploader/index",
"glsx-privacy": "glsk-applet-component/GlsxPrivacy/index",
"empty-data": "/components/EmptyData/EmptyData",
"van-switch": "@vant/weapp/switch/index"
},
"resolveAlias": {
"~/*": "/*"
},
"sitemapLocation": "sitemap.json",
"__usePrivacyCheck__": true,
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
}
}
@font-face {
font-family: "numberNor";
src: url("https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/font/D-DIN-PRO-500-Medium.ttf");
font-family: "numberNor";
src: url("https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/font/D-DIN-PRO-500-Medium.ttf");
}
@font-face {
font-family: "numberBold";
src: url("https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/font/D-DIN-PRO-700-Bold.ttf");
font-family: "numberBold";
src: url("https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/font/D-DIN-PRO-700-Bold.ttf");
}
page {
/* 兼容 IOS<11.2 先constant再env */
--constantSafeAreaInsetBottom: constant(safe-area-inset-bottom);
/* 兼容 IOS>11.2 */
--envSafeAreaInsetBottom: env(safe-area-inset-bottom);
@for $i from 1 through 1300 {
--fontSize#{$i}: calc(#{$i}vmin / 7.5);
--fontSizeContent#{$i}: calc(#{$i}vmin / 7.176);
}
@media screen and (min-device-width: 768px) and (-webkit-min-device-pixel-ratio: 1) {
@for $i from 1 through 1300 {
--fontSize#{$i}: calc(#{$i}vmin / 8.5);
--fontSizeContent#{$i}: calc(#{$i}vmin / 6.719);
}
}
image {
width: 100%;
height: 100%;
vertical-align: top;
}
.y-center {
top: 50%;
transform: translateY(-50%);
}
.x-center {
left: 50%;
transform: translateX(-50%);
}
.box-center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.two-text {
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.isFullSucreen {
box-sizing: border-box;
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
// padding-bottom: 34px !important;
}
.isFullSucreen-bottom {
bottom: 34px !important;
}
.list-nothing {
padding: var(--fontSize30) 0;
text-align: center;
font-size: var(--fontSize24);
color: #999999;
}
.list-not {
display: flex;
align-items: center;
justify-content: center;
color: #999;
font-size: var(--fontSize24);
height: 100%;
}
.bgcw {
background-color: #fff;
}
--primary-color: #2c66f7;
--text-color: #333;
/* 兼容 IOS<11.2 先constant再env */
--constantSafeAreaInsetBottom: constant(safe-area-inset-bottom);
/* 兼容 IOS>11.2 */
--envSafeAreaInsetBottom: env(safe-area-inset-bottom);
@for $i from 1 through 1300 {
--fontSize#{$i}: calc(#{$i}vmin / 7.5);
--fontSizeContent#{$i}: calc(#{$i}vmin / 7.176);
}
@media screen and (min-device-width: 768px) and (-webkit-min-device-pixel-ratio: 1) {
@for $i from 1 through 1300 {
--fontSize#{$i}: calc(#{$i}vmin / 8.5);
--fontSizeContent#{$i}: calc(#{$i}vmin / 6.719);
}
}
image {
width: 100%;
height: 100%;
vertical-align: top;
}
.y-center {
top: 50%;
transform: translateY(-50%);
}
.x-center {
left: 50%;
transform: translateX(-50%);
}
.box-center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.two-text {
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.isFullSucreen {
box-sizing: border-box;
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
// padding-bottom: 34px !important;
}
.isFullSucreen-bottom {
bottom: 34px !important;
}
.list-nothing {
padding: var(--fontSize30) 0;
text-align: center;
font-size: var(--fontSize24);
color: #999999;
}
.list-not {
display: flex;
align-items: center;
justify-content: center;
color: #999;
font-size: var(--fontSize24);
height: 100%;
}
.bgcw {
background-color: #fff;
}
}
.flex{
.flex {
display: flex;
align-items: center;
}
\ No newline at end of file
}
// components/SearchInput/SearchInput.js
Component({
externalClasses: ['container-class', 'field-class', 'input-class'],
// options: {
// styleIsolation: 'shared'
// },
......@@ -81,4 +82,4 @@ Component({
})
}
}
})
\ No newline at end of file
})
<view class="search-box" style="{{styleValue}}">
<view class="search-input">
<view class="search-box container-class" style="{{styleValue}}">
<view class="search-input field-class">
<block wx:if="{{!edit}}">
<view class="input {{value?'':'placeholder'}}" bindtap="open">
<view class="input input-class {{value?'':'placeholder'}}" bindtap="open">
<block wx:if="{{value}}">
{{value}}
</block>
......@@ -12,7 +12,7 @@
</view>
</block>
<block wx:else>
<input type="text" maxlength="{{maxlength}}" class="input" value='{{value}}' focus='{{inputFocus}}' confirm-type="search" bindinput='input' bindblur="inputBlur" bindconfirm="inputConfifm" />
<input type="text" maxlength="{{maxlength}}" class="input input-class" value='{{value}}' focus='{{inputFocus}}' confirm-type="search" bindinput='input' bindblur="inputBlur" bindconfirm="inputConfifm" />
</block>
</view>
</view>
\ No newline at end of file
</view>
/* components/SearchInput/SearchInput.wxss */
.search-box {
height: var(--fontSize104);
display: flex;
align-items: center;
font-size: var(--fontSize28);
height: var(--fontSize104);
display: flex;
align-items: center;
font-size: var(--fontSize28);
width: 100%;
overflow: hidden;
}
.search-box .search-input {
width: 100%;
height: var(--fontSize72);
background: #F7F8FA;
border-radius: var(--fontSize38);
color: #333;
width: 100%;
height: var(--fontSize72);
background: #f7f8fa;
border-radius: var(--fontSize38);
color: #333;
overflow: hidden;
}
.search-input .input{
display: flex;
align-items: center;
height: 100%;
.search-input .input {
display: flex;
align-items: center;
height: 100%;
width: 100%;
padding: 0 24rpx;
}
.search-input .icon{
width: var(--fontSize28);
height: var(--fontSize28);
margin-right: var(--fontSize10);
.search-input .icon {
width: var(--fontSize28);
height: var(--fontSize28);
margin-right: var(--fontSize10);
}
.search-input .placeholder {
color: #c8c9cc;
}
.search-input .placeholder{
color: #C8C9CC;
}
\ 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>
<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" />
<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="date-text" bind:tap="onDisplayDate">{{date}}</view>
<view class="arrow right">
<van-icon wx:if="{{!rightCurrent}}" class="arrow-right" name="arrow" bind:tap="next" />
<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 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 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>
Component({
properties: {
show: {
type: Boolean,
value: false,
observer(show) {
if (show) {
this.openTooltip();
return;
}
this.closeTooltip({ triggerEvent: false });
},
},
duration: {
type: Number,
value: 2000,
},
content: {
type: String,
value: "",
},
placement: {
type: String,
value: "top",
},
customStyle: {
type: String,
value: "",
},
},
data: {
rendered: false,
visible: false,
popperStyle: "",
arrowStyle: "",
currentPlacement: "top",
},
lifetimes: {
detached() {
this.clearAutoHideTimer();
this.clearCloseAnimationTimer();
},
},
methods: {
openTooltip() {
this.clearAutoHideTimer();
this.clearCloseAnimationTimer();
this.setData(
{
rendered: true,
visible: true,
popperStyle: "left: -9999px; top: -9999px;",
arrowStyle: "",
currentPlacement: this.properties.placement,
},
() => {
wx.nextTick(() => {
this.updatePopperPosition();
this.emitChange(true);
this.startAutoHideTimer();
});
},
);
},
show() {
this.openTooltip();
},
hide() {
this.closeTooltip();
},
handleTriggerTap() {
if (this.data.visible) {
this.closeTooltip();
return;
}
this.openTooltip();
},
preventTap() {},
updatePopperPosition() {
const query = this.createSelectorQuery();
query.select(".tooltip-reference").boundingClientRect();
query.select(".tooltip-popper").boundingClientRect();
query.exec((res) => {
const referenceRect = res && res[0];
const popperRect = res && res[1];
if (!referenceRect || !popperRect) {
return;
}
const systemInfo = wx.getSystemInfoSync();
const viewportWidth = systemInfo.windowWidth;
const viewportHeight = systemInfo.windowHeight;
const margin = this.rpxToPx(16, viewportWidth);
const gap = this.rpxToPx(16, viewportWidth);
const arrowSize = this.rpxToPx(20, viewportWidth);
const placement = this.getAvailablePlacement(this.properties.placement, referenceRect, popperRect, viewportWidth, viewportHeight, margin, gap);
const position = this.getPopperPosition(placement, referenceRect, popperRect, viewportWidth, viewportHeight, margin, gap, arrowSize);
this.setData({
popperStyle: `left: ${position.left}px; top: ${position.top}px;`,
arrowStyle: position.arrowStyle,
currentPlacement: placement,
});
});
},
getAvailablePlacement(placement, referenceRect, popperRect, viewportWidth, viewportHeight, margin, gap) {
const enoughMap = {
top: referenceRect.top >= popperRect.height + gap + margin,
bottom: viewportHeight - referenceRect.bottom >= popperRect.height + gap + margin,
left: referenceRect.left >= popperRect.width + gap + margin,
right: viewportWidth - referenceRect.right >= popperRect.width + gap + margin,
};
if (enoughMap[placement]) {
return placement;
}
const fallbackMap = {
top: ["bottom", "right", "left"],
bottom: ["top", "right", "left"],
left: ["right", "top", "bottom"],
right: ["left", "top", "bottom"],
};
const fallbackList = fallbackMap[placement] || ["top", "bottom", "right", "left"];
const target = fallbackList.find((item) => enoughMap[item]);
return target || placement;
},
getPopperPosition(placement, referenceRect, popperRect, viewportWidth, viewportHeight, margin, gap, arrowSize) {
let left = 0;
let top = 0;
if (placement === "top" || placement === "bottom") {
left = referenceRect.left + referenceRect.width / 2 - popperRect.width / 2;
left = Math.min(Math.max(left, margin), viewportWidth - popperRect.width - margin);
top = placement === "top" ? referenceRect.top - popperRect.height - gap : referenceRect.bottom + gap;
top = Math.min(Math.max(top, margin), viewportHeight - popperRect.height - margin);
const arrowLeft = referenceRect.left + referenceRect.width / 2 - left - arrowSize / 2;
const safeArrowLeft = Math.min(Math.max(arrowLeft, this.rpxToPx(24, viewportWidth)), popperRect.width - this.rpxToPx(24, viewportWidth) - arrowSize);
return {
left,
top,
arrowStyle: `left: ${safeArrowLeft}px;`,
};
}
top = referenceRect.top + referenceRect.height / 2 - popperRect.height / 2;
top = Math.min(Math.max(top, margin), viewportHeight - popperRect.height - margin);
left = placement === "left" ? referenceRect.left - popperRect.width - gap : referenceRect.right + gap;
left = Math.min(Math.max(left, margin), viewportWidth - popperRect.width - margin);
const arrowTop = referenceRect.top + referenceRect.height / 2 - top - arrowSize / 2;
const safeArrowTop = Math.min(Math.max(arrowTop, this.rpxToPx(24, viewportWidth)), popperRect.height - this.rpxToPx(24, viewportWidth) - arrowSize);
return {
left,
top,
arrowStyle: `top: ${safeArrowTop}px;`,
};
},
rpxToPx(rpx, windowWidth) {
return (Number(rpx) * windowWidth) / 750;
},
startAutoHideTimer() {
const duration = Number(this.properties.duration) || 0;
if (duration <= 0) {
return;
}
this.autoHideTimer = setTimeout(() => {
this.closeTooltip();
}, duration);
},
clearAutoHideTimer() {
if (!this.autoHideTimer) {
return;
}
clearTimeout(this.autoHideTimer);
this.autoHideTimer = null;
},
clearCloseAnimationTimer() {
if (!this.closeAnimationTimer) {
return;
}
clearTimeout(this.closeAnimationTimer);
this.closeAnimationTimer = null;
},
closeTooltip(options = {}) {
const { triggerEvent = true } = options;
this.clearAutoHideTimer();
if (!this.data.visible) {
if (triggerEvent) {
this.emitChange(false);
}
return;
}
this.clearCloseAnimationTimer();
this.setData(
{
visible: false,
},
() => {
this.closeAnimationTimer = setTimeout(() => {
this.setData(
{
rendered: false,
popperStyle: "",
arrowStyle: "",
currentPlacement: this.properties.placement,
},
() => {
if (triggerEvent) {
this.emitChange(false);
}
},
);
this.closeAnimationTimer = null;
}, 100);
},
);
},
emitChange(show) {
if (!show) {
this.triggerEvent("close");
}
this.triggerEvent("change", { show });
},
},
});
{
"component": true,
"usingComponents": {}
}
.tooltip-wrapper {
position: relative;
display: inline-flex;
box-sizing: border-box;
width: 100%;
}
.tooltip-reference {
display: inline-flex;
box-sizing: border-box;
width: 100%;
}
.tooltip-popper {
position: fixed;
z-index: 9999;
max-width: 560rpx;
min-width: 180rpx;
opacity: 0;
transition: opacity 100ms ease;
}
.tooltip-popper-visible {
opacity: 1;
}
.tooltip-inner {
padding: 24rpx 28rpx;
box-sizing: border-box;
background: #ffffff;
border-radius: 16rpx;
box-shadow: 0 12rpx 40rpx rgba(0, 0, 0, 0.12);
color: #333333;
line-height: 1.5;
word-break: break-all;
}
.tooltip-arrow {
position: absolute;
width: 20rpx;
height: 20rpx;
background: #ffffff;
transform: rotate(45deg);
box-shadow: 0 8rpx 20rpx rgba(0, 0, 0, 0.08);
}
.tooltip-top {
}
.tooltip-top .tooltip-arrow {
bottom: -8rpx;
transform: rotate(45deg);
}
.tooltip-bottom {
}
.tooltip-bottom .tooltip-arrow {
top: -8rpx;
transform: rotate(45deg);
}
.tooltip-left {
}
.tooltip-left .tooltip-arrow {
right: -8rpx;
transform: rotate(45deg);
}
.tooltip-right {
}
.tooltip-right .tooltip-arrow {
left: -8rpx;
transform: rotate(45deg);
}
<view class="tooltip-wrapper">
<view class="tooltip-reference" catchtap="handleTriggerTap">
<slot></slot>
</view>
<view wx:if="{{ rendered }}"
class="tooltip-popper tooltip-{{ currentPlacement }} {{ visible ? 'tooltip-popper-visible' : '' }}"
style="{{ popperStyle }}{{ customStyle }}"
catchtap="preventTap">
<view class="tooltip-arrow" style="{{ arrowStyle }}"></view>
<view class="tooltip-inner">
<text class="tooltip-text">{{ content }}</text>
</view>
</view>
</view>
const DEFAULT_BREAKPOINTS = {
xs: 0,
sm: 375,
md: 768,
lg: 1024,
};
Component({
externalClasses: ["custom-class"],
options: {
virtualHost: true,
styleIsolation: "apply-shared",
},
relations: {
"../venusRow/venusRow": {
type: "ancestor",
},
},
properties: {
span: {
type: null,
value: 24,
observer() {
this.syncCol();
},
},
offset: {
type: Number,
value: 0,
observer() {
this.syncCol();
},
},
align: {
type: String,
value: "stretch",
observer() {
this.syncCol();
},
},
customStyle: {
type: String,
value: "",
observer() {
this.syncCol();
},
},
clickable: {
type: Boolean,
value: false,
observer() {
this.syncCol();
},
},
contentSpan: {
type: Number,
value: 24,
observer() {
this.syncCol();
},
},
responsive: {
type: Object,
value: null,
observer() {
this.syncCol();
},
},
},
data: {
itemClass: "",
itemStyleText: "",
clickable: false,
currentBreakpoint: "xs",
},
lifetimes: {
attached() {
this.syncCol();
},
},
methods: {
updateFromRow(rowContext) {
this.rowContext = rowContext || null;
this.syncCol();
},
getParentRow() {
const rows = this.getRelationNodes("../venusRow/venusRow") || [];
return rows[0] || null;
},
getStandaloneContext() {
const width = this.getWindowWidth();
const breakpoints = DEFAULT_BREAKPOINTS;
return {
columns: 24,
breakpoints,
viewportWidth: width,
activeBreakpoint: this.getActiveBreakpoint(width, breakpoints),
};
},
getWindowWidth() {
const info = typeof wx.getWindowInfo === "function" ? wx.getWindowInfo() : wx.getSystemInfoSync();
return Number(info.windowWidth || info.screenWidth || 375);
},
syncCol() {
const rowContext = this.rowContext || this.getStandaloneContext();
const config = this.resolveConfig(rowContext);
const columns = this.normalizeColumns(rowContext.columns);
const isContent = config.span === "content";
const span = isContent ? this.normalizeSpan(config.contentSpan, columns) : this.normalizeSpan(config.span, columns);
const offset = this.normalizeOffset(config.offset, columns);
const align = this.normalizeAlign(config.align || (isContent ? "start" : "stretch"));
const clickable = Boolean(config.clickable);
const itemClassList = [];
if (isContent) itemClassList.push("is-content");
if (clickable) itemClassList.push("is-clickable");
const itemStyleList = [`grid-column-end:span ${span}`, `justify-self:${align}`, "min-width:0", "box-sizing:border-box"];
if (offset > 0) {
itemStyleList.push(`grid-column-start:${offset + 1}`);
}
if (isContent) {
itemStyleList.push("width:fit-content");
itemStyleList.push("max-width:100%");
}
if (config.customStyle) {
itemStyleList.push(config.customStyle);
}
this.currentConfig = config;
this.setData({
itemClass: itemClassList.join(" "),
itemStyleText: itemStyleList.join(";"),
clickable,
currentBreakpoint: rowContext.activeBreakpoint || "xs",
});
},
resolveConfig(rowContext) {
let config = {
span: this.properties.span,
offset: this.properties.offset,
align: this.properties.align,
customStyle: this.properties.customStyle,
clickable: this.properties.clickable,
contentSpan: this.properties.contentSpan,
};
const responsive = this.properties.responsive;
if (responsive && typeof responsive === "object") {
const merged = {};
this.getSortedBreakpoints(rowContext.breakpoints).forEach((point) => {
const pointConfig = responsive[point.key];
if (rowContext.viewportWidth >= point.value && this.isPlainObject(pointConfig)) {
Object.assign(merged, pointConfig);
}
});
config = Object.assign({}, config, merged);
}
return config;
},
onTap() {
if (!this.data.clickable) return;
const detail = {
item: this.currentConfig || {},
breakpoint: this.data.currentBreakpoint,
};
this.triggerEvent("itemtap", detail);
const row = this.getParentRow();
if (row && typeof row.emitItemTap === "function") {
row.emitItemTap(detail);
}
},
normalizeColumns(value) {
const columns = Number(value);
if (!Number.isFinite(columns)) return 24;
return Math.max(1, Math.round(columns));
},
normalizeSpan(value, columns) {
const span = Number(value);
if (!Number.isFinite(span)) return columns;
return Math.min(columns, Math.max(1, Math.round(span)));
},
normalizeOffset(value, columns) {
const offset = Number(value);
if (!Number.isFinite(offset)) return 0;
return Math.min(Math.max(columns - 1, 0), Math.max(0, Math.round(offset)));
},
normalizeAlign(value) {
const alignMap = {
start: "start",
center: "center",
end: "end",
stretch: "stretch",
};
return alignMap[value] || "stretch";
},
getActiveBreakpoint(width, breakpoints) {
const list = this.getSortedBreakpoints(breakpoints);
if (!list.length) return "xs";
let activeKey = list[0].key;
list.forEach((item) => {
if (width >= item.value) {
activeKey = item.key;
}
});
return activeKey;
},
getSortedBreakpoints(breakpoints) {
return Object.keys(breakpoints || {})
.map((key) => ({
key,
value: Number(breakpoints[key]),
}))
.filter((item) => Number.isFinite(item.value))
.sort((a, b) => a.value - b.value);
},
isPlainObject(value) {
return !!value && Object.prototype.toString.call(value) === "[object Object]";
},
},
});
.venus-col {
min-width: 0;
box-sizing: border-box;
&.is-content {
max-width: 100%;
}
}
.venus-col--active {
opacity: 0.92;
}
<view class="venus-col custom-class {{ itemClass }}"
style="{{ itemStyleText }}"
hover-class="{{ clickable ? 'venus-col--active' : '' }}"
bind:tap="onTap">
<slot></slot>
</view>
const DEFAULT_BREAKPOINTS = {
xs: 0,
sm: 375,
md: 768,
lg: 1024,
};
Component({
externalClasses: ["custom-class"],
options: {
styleIsolation: "apply-shared",
},
relations: {
"../venusCol/venusCol": {
type: "descendant",
linked() {
this.notifyChildren();
},
linkChanged() {
this.notifyChildren();
},
unlinked() {
this.notifyChildren();
},
},
},
properties: {
columns: {
type: Number,
value: 24,
observer() {
this.syncRow();
},
},
gap: {
type: null,
value: [0, 0],
observer() {
this.syncRow();
},
},
dense: {
type: Boolean,
value: false,
observer() {
this.syncRow();
},
},
breakpoints: {
type: Object,
value: DEFAULT_BREAKPOINTS,
observer() {
this.syncRow();
},
},
},
data: {
rowStyle: "",
activeBreakpoint: "xs",
viewportWidth: 0,
},
lifetimes: {
attached() {
this.bindWindowResize();
this.syncRow();
},
detached() {
this.unbindWindowResize();
},
},
methods: {
bindWindowResize() {
if (typeof wx.onWindowResize !== "function" || this.resizeHandler) return;
this.resizeHandler = (res) => {
const size = (res && res.size) || {};
const width = Number(size.windowWidth || res.windowWidth || this.getWindowWidth());
if (width && width !== this.data.viewportWidth) {
this.syncRow(width);
}
};
wx.onWindowResize(this.resizeHandler);
},
unbindWindowResize() {
if (!this.resizeHandler || typeof wx.offWindowResize !== "function") return;
wx.offWindowResize(this.resizeHandler);
this.resizeHandler = null;
},
getWindowWidth() {
const info = typeof wx.getWindowInfo === "function" ? wx.getWindowInfo() : wx.getSystemInfoSync();
return Number(info.windowWidth || info.screenWidth || 375);
},
syncRow(forcedWidth) {
const columns = this.normalizeColumns(this.properties.columns);
const viewportWidth = Number(forcedWidth || this.getWindowWidth()) || 375;
const activeBreakpoint = this.getActiveBreakpoint(viewportWidth, this.properties.breakpoints);
const rowStyle = this.buildRowStyle(columns, this.properties.gap, this.properties.dense);
this.setData(
{
rowStyle,
activeBreakpoint,
viewportWidth,
},
() => {
this.notifyChildren();
},
);
},
buildRowStyle(columns, gap, dense) {
const normalizedGap = this.normalizeGap(gap);
return [
"display:grid",
"width:100%",
"box-sizing:border-box",
"align-items:start",
`grid-template-columns:repeat(${columns}, minmax(0, 1fr))`,
`column-gap:${normalizedGap.columnGap}`,
`row-gap:${normalizedGap.rowGap}`,
`grid-auto-flow:${dense ? "row dense" : "row"}`,
].join(";");
},
notifyChildren() {
const children = this.getRelationNodes("../venusCol/venusCol") || [];
const context = {
columns: this.normalizeColumns(this.properties.columns),
breakpoints: this.properties.breakpoints,
activeBreakpoint: this.data.activeBreakpoint,
viewportWidth: this.data.viewportWidth || this.getWindowWidth(),
};
children.forEach((child) => {
if (child && typeof child.updateFromRow === "function") {
child.updateFromRow(context);
}
});
},
emitItemTap(detail) {
this.triggerEvent("itemtap", detail);
},
normalizeColumns(value) {
const columns = Number(value);
if (!Number.isFinite(columns)) return 24;
return Math.max(1, Math.round(columns));
},
normalizeGap(value) {
let columnGap = "0rpx";
let rowGap = "0rpx";
if (Array.isArray(value)) {
columnGap = this.toCssSize(value[0]);
rowGap = this.toCssSize(value.length > 1 ? value[1] : value[0]);
} else if (value && typeof value === "object") {
columnGap = this.toCssSize(value.x != null ? value.x : value.column);
rowGap = this.toCssSize(value.y != null ? value.y : value.row);
} else {
columnGap = this.toCssSize(value);
rowGap = this.toCssSize(value);
}
return {
columnGap,
rowGap,
};
},
toCssSize(value) {
if (value == null || value === "") return "0rpx";
if (typeof value === "number") return `${value}rpx`;
if (typeof value !== "string") return "0rpx";
if (/^-?\d+(\.\d+)?$/.test(value)) {
return `${value}rpx`;
}
return value;
},
getActiveBreakpoint(width, breakpoints) {
const list = this.getSortedBreakpoints(breakpoints);
if (!list.length) return "xs";
let activeKey = list[0].key;
list.forEach((item) => {
if (width >= item.value) {
activeKey = item.key;
}
});
return activeKey;
},
getSortedBreakpoints(breakpoints) {
return Object.keys(breakpoints || {})
.map((key) => ({
key,
value: Number(breakpoints[key]),
}))
.filter((item) => Number.isFinite(item.value))
.sort((a, b) => a.value - b.value);
},
},
});
.venus-row {
width: 100%;
box-sizing: border-box;
}
<view class="venus-row custom-class" style="{{ rowStyle }}">
<slot></slot>
</view>
import api from "~/utils/request/request.js";
// 盯防驻店销售业绩接口
export function getSupervisorStaffApi(data) {
return api.post("dj.api.supervisor.staff.performance", data, [], "/rop-dj-supervisor-mini/router");
}
// 盯防门店业绩接口
export function getSupervisorStoreApi(data) {
return api.post("dj.api.supervisor.store.performance", data, [], "/rop-dj-supervisor-mini/router");
}
{
"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
/* 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
<!--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>
// components/dateScreen/dateScreen.js
Component({
options: {
multipleSlots: true,
},
/**
* 组件的属性列表
*/
properties: {
// hideColon 是否隐藏colon , 默认false
// name : - 唯一key , 数据的键值
// label : 文案
// col : 占24分之几
// valueWidth : 值的宽度,默认为100%
// labelWidth : 标签宽度,默认为150px
// slot : 整体的插槽名,优先级高于name
// itemStyle: 每一项的样式
// tooltip: boolean 是否用tooltip 展示data数据
// tooltipProps: el-tooltip 的传参
// render ?:(h,{ data,schemaItem,schema } )=>{} 自定义渲染
// isHide 是否隐藏 (data)=>boolean || boolean
// parentProps:{
// className:'text-hide' // 默认
// },
schema: {
type: Array,
value: [],
observer: function (schema) {
const hasMore = Array.isArray(schema) && schema.some((item) => item && item.isMore);
this.setData({
hasMore,
expanded: hasMore ? this.data.expanded : false,
});
this.measureMoreHeight();
},
},
data: {
type: Object,
value: {},
},
title: {
type: String,
value: "",
},
beTap: {
type: Boolean,
value: true,
},
hideValue: {
type: String,
value: "2",
},
},
/**
* 组件的初始数据
*/
data: {
expanded: false,
hasMore: false,
moreHeight: 0,
tooltipIconPath: "/images/tips-icon.png",
},
lifetimes: {
ready() {
this.measureMoreHeight();
},
},
/**
* 组件的方法列表
*/
methods: {
onToggleMore() {
if (!this.data.hasMore) return;
if (this.data.expanded) {
this.setData({ expanded: false });
return;
}
this.measureMoreHeight(() => {
this.setData({ expanded: true });
});
},
handleTapItem() {
this.triggerEvent("tapItem", {
// item: this.data.normalizedList[nextIndex],
});
},
measureMoreHeight(done) {
wx.nextTick(() => {
const query = this.createSelectorQuery().in(this);
query.select("#moreMeasureInner").boundingClientRect();
query.exec((res) => {
const rect = res && res[0];
const height = Math.max(0, Math.round((rect && rect.height) || 0));
console.log(height);
if (height !== this.data.moreHeight) {
this.setData({ moreHeight: height }, () => {
if (typeof done === "function") done();
});
return;
}
if (typeof done === "function") done();
});
});
},
},
});
{
"component": true,
"usingComponents": {
"van-row": "@vant/weapp/row/index",
"van-col": "@vant/weapp/col/index",
"van-divider": "@vant/weapp/divider/index",
"van-icon": "@vant/weapp/icon/index",
"Tooltip": "/components/tooltip/tooltip",
"VenusCol": "/components/venusCol/venusCol",
"VenusRow": "/components/venusRow/venusRow"
}
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.statistics-item-wrapper {
background-color: white;
padding: var(--fontSize16) 0;
box-sizing: border-box;
overflow: hidden;
border-radius: var(--fontSize24);
position: relative;
transition: background 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
&.is-tap {
&:active {
background: rgb(252, 252, 252);
}
}
.title-wrapper {
display: flex;
align-items: center;
padding: var(--fontSize16) var(--fontSize32);
border-bottom: 1px solid #eeeef0;
overflow: hidden;
.title-label-wrapper {
flex-shrink: 0;
flex: 1;
overflow: hidden;
margin-right: var(--fontSize32);
.title-label {
font-weight: 500;
font-size: var(--fontSize28);
line-height: var(--fontSize44);
color: rgba(0, 0, 0, 0.9);
}
.title-sub-label {
font-weight: 400;
font-size: 10px;
line-height: 16px;
color: #00000066;
&:empty + .title-sub-label__default {
display: block;
}
&__default {
display: none;
font-weight: 400;
font-size: 10px;
line-height: 16px;
color: #00000066;
}
}
}
.title-right-wrapper {
max-width: 50%;
display: flex;
align-items: center;
justify-content: flex-end;
overflow: hidden;
.title-right-content {
&:empty + .title-right-content__default {
display: flex;
align-items: center;
.right-item {
text-align: center;
margin-left: var(--fontSize24);
&:first-child {
margin-left: 0;
}
.value {
font-family: numberBold;
font-weight: 700;
font-style: Bold;
font-size: 20px;
line-height: 20px;
text-align: center;
color: var(--primary-color);
}
.label {
font-weight: 400;
font-size: 10px;
line-height: 16px;
text-align: center;
color: #00000042;
}
}
}
&__default {
display: none;
flex: 1;
flex-shrink: 0;
flex-basis: 0;
}
}
.arrow-right {
flex-shrink: 0;
flex-basis: 0;
margin-left: var(--fontSize32);
}
}
}
.schema-wrapper {
padding: 0 var(--fontSize32) var(--fontSize10);
box-sizing: border-box;
&.is-expanded {
padding-bottom: var(--fontSize48);
}
.grid-container {
margin-top: var(--fontSize16);
border-radius: var(--fontSize16);
overflow: hidden;
position: relative;
}
}
}
.col-wrapper {
overflow: hidden;
.item-wrapper {
background: rgba(248, 248, 248, 1);
padding: var(--fontSize16) var(--fontSize20);
overflow: hidden;
box-sizing: border-box;
width: 100%;
&.tooltip-wrapper {
.label {
display: flex;
align-items: center;
.icon {
width: 16px;
height: 16px;
margin-left: var(--fontSize8);
flex-shrink: 0;
}
}
}
.label {
font-weight: 400;
font-size: var(--fontSize24);
line-height: var(--fontSize40);
color: rgba(0, 0, 0, 0.26);
}
.value {
margin-top: var(--fontSize8);
font-family: numberNor;
font-weight: 500;
font-size: var(--fontSize32);
line-height: var(--fontSize40);
color: var(--primary-color);
}
}
}
.toggle-more-wrapper {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
text-align: center;
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.5) 15%, rgba(255, 255, 255, 0.7) 30%, #ffffff 100%);
}
.toggle-icon {
margin-left: var(--fontSize4);
transform: rotate(90deg);
transition: transform 300ms ease;
}
.toggle-icon.is-expanded {
transform: rotate(-90deg);
}
.toggle-more-content {
display: flex;
align-items: center;
justify-content: center;
padding: var(--fontSize16) 0;
color: rgba(0, 0, 0, 0.9);
font-size: var(--fontSize24);
line-height: var(--fontSize40);
}
.toggle-more-text {
line-height: inherit;
font-weight: 400;
font-size: var(--fontSize24);
line-height: var(--fontSize40);
color: #00000066;
}
.more-collapse {
overflow: hidden;
transition: height 300ms ease;
}
.more-inner {
overflow: hidden;
}
.more-measure {
position: absolute;
left: 0;
top: 0;
width: 100%;
visibility: hidden;
z-index: -1;
pointer-events: none;
}
<view class="statistics-item-wrapper {{ beTap ? 'is-tap' : '' }}"
bind:tap="handleTapItem">
<view class="title-wrapper">
<view class="title-label-wrapper ">
<view class="title-label text-hide">
{{ title }}
</view>
<view class="title-sub-label">
<slot name="title-sub"></slot>
</view>
<view class="title-sub-label__default text-hide"></view>
</view>
<view class="title-right-wrapper">
<view class="title-right-content">
<slot name="title-right"></slot>
</view>
<view class="title-right-content__default">
<view class="right-item"
wx:for="{{ schema }}"
wx:key="index"
wx:if="{{ item.titleInfo }}">
<view class="value">
{{ data[item.name] }}
</view>
<view class="label">
{{ item.label }}
</view>
</view>
</view>
<van-icon wx:if="{{ beTap }}"
class="arrow-right"
name="arrow" />
</view>
</view>
<view class="schema-wrapper {{ expanded ? 'is-expanded' : '' }}">
<VenusRow custom-class="grid-container " gap="4">
<VenusCol wx:for="{{ schema }}"
wx:key="index"
wx:if="{{ !item.isMore && !item.titleInfo }}"
span="{{ item.col }}"
contentSpan="{{ item.contentSpan || 24 }}"
custom-class="col-wrapper">
<Tooltip duration="{{ 2000 }}"
wx:if="{{ item.tips }}"
placement="top"
content="{{ item.tips }}">
<view class="item-wrapper tooltip-wrapper" style="{{ item.style }}">
<view class="label text-hide ">
{{ item.label }}
<image class="icon"
src="{{ tooltipIconPath }}"
mode="aspectFit" />
</view>
<view class="value text-hide ">
{{ data[item.name] }}
</view>
</view>
</Tooltip>
<view wx:else
class="item-wrapper"
style="{{ item.style }}">
<view class="label text-hide ">
{{ item.label }}
</view>
<view class="value text-hide ">
{{ data[item.name] }}
</view>
</view>
</VenusCol>
<VenusCol wx:for="{{ schema }}"
wx:key="index"
wx:if="{{ item.isMore }}"
span="{{ item.col }}"
contentSpan="{{ item.contentSpan || 24 }}"
custom-class="col-wrapper">
<view class="more-collapse"
style="height: {{ expanded ? (moreHeight + 'px') : '0px' }};">
<view id="moreInner" class="more-inner">
<view class="item-wrapper" style="{{ item.style }}">
<view class="label text-hide ">
{{ item.label }}
</view>
<view class="value text-hide ">
{{ data[item.name] }}
</view>
</view>
</view>
</view>
</VenusCol>
</VenusRow>
<VenusRow custom-class="more-measure" gap="4">
<VenusCol wx:for="{{ schema }}"
wx:key="index"
wx:if="{{ item.isMore }}"
span="{{ item.col }}"
contentSpan="{{ item.contentSpan || 24 }}"
custom-class="col-wrapper">
<view id="moreMeasureInner" class="more-inner">
<view class="item-wrapper" style="{{ item.style }}">
<view class="label text-hide ">
{{ item.label }}
</view>
<view class="value text-hide ">
{{ data[item.name] }}
</view>
</view>
</view>
</VenusCol>
</VenusRow>
<view class="toggle-more-wrapper"
catch:tap="onToggleMore"
wx:if="{{ hasMore }}">
<view class="toggle-more-content">
<view class="toggle-more-text">
已隐藏{{ hideValue }}项售后成交指标
</view>
<van-icon name="play"
size="12px"
color="#A2A6B1"
custom-class="toggle-icon {{ expanded ? 'is-expanded' : '' }}" />
</view>
</view>
</view>
<!-- <van-row custom-class="container {{ expanded ? 'is-expanded' : '' }}">
<van-col wx:for="{{ schema }}"
wx:key="index"
wx:if="{{ !item.isMore }}"
span="{{ item.col }}"
custom-class="col-wrapper">
<Tooltip duration="{{ 2000 }}"
placement="top"
content="asdasd">
<view class="item-wrapper" style="{{ item.style }}">
<view class="label text-hide ">
{{ item.label }}
</view>
<view class="value text-hide ">
{{ item.name }}
</view>
</view>
</Tooltip>
</van-col>
<van-col span="24" wx:if="{{ hasMore }}">
<view class="more-collapse"
style="height: {{ expanded ? (moreHeight + 'px') : '0px' }};">
<view id="moreInner" class="more-inner">
<van-row gutter="4">
<van-col wx:for="{{ schema }}"
wx:key="index"
wx:if="{{ item.isMore }}"
span="{{ item.col }}"
custom-class="col-wrapper">
<view class="item-wrapper" style="{{ item.style }}">
<view class="label text-hide ">
{{ item.label }}
</view>
<view class="value text-hide ">
{{ item.name }}
</view>
</view>
</van-col>
</van-row>
</view>
</view>
<view class="more-measure">
<view id="moreMeasureInner" class="more-inner">
<van-row>
<van-col wx:for="{{ schema }}"
wx:key="index"
wx:if="{{ item.isMore }}"
span="{{ item.col }}"
custom-class="col-wrapper">
<view class="item-wrapper" style="{{ item.style }}">
<view class="label text-hide ">
{{ item.label }}
</view>
<view class="value text-hide ">
{{ item.name }}
</view>
</view>
</van-col>
</van-row>
</view>
</view>
</van-col>
<view class="toggle-more-wrapper"
catch:tap="onToggleMore"
wx:if="{{ hasMore }}">
<view class="toggle-more-content">
<view class="toggle-more-text">
查看更多
</view>
<van-icon name="play"
size="12px"
color="#A2A6B1"
custom-class="toggle-icon {{ expanded ? 'is-expanded' : '' }}" />
</view>
</view>
</van-row> -->
</view>
// components/dateScreen/dateScreen.js
Component({
options: {
multipleSlots: true,
},
/**
* 组件的属性列表
*/
properties: {
// hideColon 是否隐藏colon , 默认false
// name : - 唯一key , 数据的键值
// label : 文案
// col : 占24分之几
// valueWidth : 值的宽度,默认为100%
// labelWidth : 标签宽度,默认为150px
// slot : 整体的插槽名,优先级高于name
// itemStyle: 每一项的样式
// tooltip: boolean 是否用tooltip 展示data数据
// tooltipProps: el-tooltip 的传参
// render ?:(h,{ data,schemaItem,schema } )=>{} 自定义渲染
// isHide 是否隐藏 (data)=>boolean || boolean
// parentProps:{
// className:'text-hide' // 默认
// },
itemSchemaList: {},
title: {},
itemTitleKey: {
type: String,
value: "employeeName",
},
list: {
type: Array,
value: [],
},
},
lifetimes: {
ready() {},
},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
handleTapItem() {
this.triggerEvent("tapItem", {});
},
},
});
{
"component": true,
"usingComponents": {
"StatisticsItem": "../statisticsItem/statisticsItem"
}
}
.statisticsList-wrapper {
.title-wrapper {
font-weight: 400;
font-size: var(--fontSize28);
line-height: var(--fontSize28);
padding: var(--fontSize16) var(--fontSize24);
}
.container-wrapper {
padding: 0 var(--fontSize24) var(--fontSize16);
.item-wrapper {
margin-bottom: 8px;
}
}
}
<view class="statisticsList-wrapper">
<view class="title-wrapper">
{{ title }}
</view>
<view class="container-wrapper">
<view class="item-wrapper"
wx:for="{{ list }}"
wx:key="index">
<StatisticsItem data="{{ item }}"
title="{{ item[itemTitleKey] }}"
bind:tapItem="handleTapItem"
schema="{{ itemSchemaList }}" />
</view>
</view>
</view>
// components/dateScreen/dateScreen.js
Component({
/**
* 组件的属性列表
*/
properties: {
list: {
type: Array,
value: [],
observer: function () {
this.syncFromProps();
},
},
value: {
type: null,
value: null,
observer: function () {
this.syncFromProps();
},
},
},
lifetimes: {
ready() {
this.syncFromProps();
},
},
/**
* 组件的初始数据
*/
data: {
normalizedList: [],
activeKey: null,
activeIndex: 0,
sliderX: 0,
sliderWidth: 0,
scrollIntoView: "",
},
/**
* 组件的方法列表
*/
methods: {
syncFromProps() {
const normalizedList = this.normalizeList(this.properties.list);
let activeKey = this.getValidActiveKey({
normalizedList,
value: this.properties.value,
prevActiveKey: this.data.activeKey,
});
const activeIndex = this.getIndexByKey(normalizedList, activeKey);
const shouldAutoScroll = normalizedList.length > 2;
this.setData(
{
normalizedList,
activeKey,
activeIndex,
scrollIntoView: shouldAutoScroll && activeIndex > -1 ? `type-tab-${activeIndex}` : "",
},
() => {
this.updateSlider();
},
);
},
normalizeList(list) {
if (!Array.isArray(list)) return [];
return list
.map((raw) => {
const item = raw || {};
const key = item.key ?? item.value ?? item.id ?? (item.label && typeof item.label === "object" ? (item.label.key ?? item.label.value) : undefined);
const label = typeof item.label === "object" ? (item.label.text ?? item.label.name ?? item.label.label ?? item.label.value ?? item.label.key) : (item.label ?? item.text ?? item.name ?? "");
return {
icon: item.icon || "",
key,
label: label == null ? "" : String(label),
showIconOnActiveOnly: Boolean(item.showIconOnActiveOnly),
};
})
.filter((it) => it.key !== undefined && it.key !== null)
.map((it) => ({
...it,
key: String(it.key),
}));
},
getValidActiveKey({ normalizedList, value, prevActiveKey }) {
const keys = normalizedList.map((it) => it.key);
const val = value === undefined || value === null ? null : String(value);
if (val != null && keys.includes(val)) return val;
if (prevActiveKey != null && keys.includes(String(prevActiveKey))) return String(prevActiveKey);
return normalizedList[0]?.key ?? null;
},
getIndexByKey(normalizedList, key) {
if (!normalizedList?.length || key == null) return 0;
const idx = normalizedList.findIndex((it) => it.key === String(key));
return idx > -1 ? idx : 0;
},
onTap(e) {
const { key, index } = e.currentTarget.dataset || {};
const nextKey = key == null ? null : String(key);
if (!nextKey || nextKey === this.data.activeKey) return;
const nextIndex = Number(index) || 0;
const shouldAutoScroll = this.data.normalizedList.length > 2;
this.setData(
{
activeKey: nextKey,
activeIndex: nextIndex,
scrollIntoView: shouldAutoScroll ? `type-tab-${nextIndex}` : "",
},
() => {
this.updateSlider();
this.triggerEvent("change", {
key: nextKey,
index: nextIndex,
item: this.data.normalizedList[nextIndex],
});
},
);
},
updateSlider() {
if (!this.data.normalizedList.length) {
this.setData({ sliderX: 0, sliderWidth: 0 });
return;
}
const activeIndex = this.data.activeIndex || 0;
const tabSelector = `#type-tab-${activeIndex}`;
const containerSelector = "#tabsInner";
this.getViewInfo(containerSelector, (container) => {
if (!container) return;
this.getViewInfo(tabSelector, (tab) => {
if (!tab) return;
const sliderX = tab.left - container.left;
const sliderWidth = tab.width;
this.setData({ sliderX, sliderWidth });
});
});
},
getViewInfo(selector, cb) {
const query = wx.createSelectorQuery().in(this);
query
.select(selector)
.boundingClientRect((res) => {
cb && cb(res);
})
.exec();
},
},
});
{
"component": true,
"usingComponents": {}
}
.tabs-wrapper {
width: 100%;
box-sizing: border-box;
}
.tabs-inner {
position: relative;
display: flex;
align-items: center;
padding: var(--fontSize6);
min-width: 100%;
width: fit-content;
box-sizing: border-box;
border-radius: var(--fontSize48);
overflow: hidden;
}
.tabs-bg {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border-radius: var(--fontSize48);
pointer-events: none;
}
.slider {
position: absolute;
top: var(--fontSize6);
bottom: var(--fontSize6);
left: 0;
border-radius: var(--fontSize48);
background-color: var(--primary-color);
z-index: 1;
transition:
transform 250ms cubic-bezier(0.2, 0.8, 0.2, 1),
width 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
will-change: transform, width;
pointer-events: none;
}
.tab-item {
position: relative;
padding: var(--fontSize12) var(--fontSize28);
border-radius: var(--fontSize48);
display: flex;
align-items: center;
justify-content: center;
white-space: nowrap;
color: #222222;
background: rgba(243, 243, 244, 1);
transition: color 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
&.is-active {
color: #ffffff;
}
.icon {
width: var(--fontSize32);
height: var(--fontSize32);
margin-right: var(--fontSize12);
flex-shrink: 0;
position: relative;
z-index: 2;
}
.label {
line-height: var(--fontSize40);
font-size: var(--fontSize26);
transition: color 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
position: relative;
z-index: 2;
}
}
.tab-item + .tab-item {
margin-left: var(--fontSize12);
}
<!--components/dateScreen/dateScreen.wxml-->
<scroll-view class="tabs-wrapper"
scroll-x
show-scrollbar="{{ false }}"
scroll-with-animation
scroll-into-view="{{ scrollIntoView }}">
<view class="tabs-inner" id="tabsInner">
<view class="tabs-bg" />
<view class="slider"
wx:if="{{ normalizedList.length }}"
style="width: {{ sliderWidth }}px; transform: translate3d({{ sliderX }}px, 0, 0);" />
<block wx:for="{{ normalizedList }}" wx:key="key">
<view class="tab-item {{ activeKey === item.key ? 'is-active' : '' }}"
id="type-tab-{{ index }}"
data-index="{{ index }}"
data-key="{{ item.key }}"
bind:tap="onTap">
<image class="icon"
src="{{ item.icon }}"
mode="aspectFit"
wx:if="{{ item.icon && (!item.showIconOnActiveOnly || activeKey === item.key) }}" />
<view class="label">
{{ item.label }}
</view>
</view>
</block>
</view>
</scroll-view>
import { storeWarnList } from "~/packageIndex/constant/performance.js";
const DEFAULT_WARN_STYLE = "color: #FA8C16; background: rgba(250, 140, 22, 0.12);";
function keyBy(list, key) {
return (Array.isArray(list) ? list : []).reduce((result, item) => {
const targetKey = item && item[key];
if (targetKey === undefined || targetKey === null || targetKey === "") {
return result;
}
result[targetKey] = item;
return result;
}, {});
}
const storeWarnMap = keyBy(storeWarnList, "key");
Component({
/**
* 组件的属性列表
*/
properties: {
list: {
type: Array,
value: [],
observer: function (list) {
this.updateWarnItems(list);
},
},
},
lifetimes: {
attached() {
this.updateWarnItems(this.data.list);
},
},
/**
* 组件的初始数据
*/
data: {
warnItems: [],
},
/**
* 组件的方法列表
*/
methods: {
updateWarnItems(list) {
const warnItems = (Array.isArray(list) ? list : [])
.map((warn) => {
const warnKey = String(warn);
const warnConfig = storeWarnMap[warnKey] || {};
return {
key: warnKey,
label: warnConfig.label || warnKey,
style: warnConfig.style || DEFAULT_WARN_STYLE,
};
})
.filter((item) => item.label);
this.setData({
warnItems,
});
},
},
});
{
"component": true,
"usingComponents": {}
}
.warn-wrapper {
display: flex;
align-items: center;
flex-wrap: wrap;
}
.warn-item {
margin-right: var(--fontSize12);
padding: var(--fontSize4) var(--fontSize8);
border-radius: var(--fontSize6);
font-weight: 400;
font-size: var(--fontSize16);
line-height: var(--fontSize24);
text-align: center;
box-sizing: border-box;
}
<view wx:if="{{ warnItems.length }}" class="warn-wrapper">
<view class="warn-item"
wx:for="{{ warnItems }}"
wx:key="key"
style="{{ item.style }}">
{{ item.label }}
</view>
</view>
export const brandTypeList = [
{
showIconOnActiveOnly: true,
icon: "/packageIndex/images/brand-tabs-icon.png",
key: "1",
label: "问界鸿蒙-延保权益",
},
{
showIconOnActiveOnly: true,
icon: "/packageIndex/images/brand-tabs-icon.png",
key: "2",
label: "通用品牌-延保权益",
},
];
export const storeWarnList = [
{
key: 2,
label: "兜底",
style: "background-color:#FFF5E7;color:#FF9D0A",
},
{
key: 3,
label: "生态",
style: "color:#F24724;background-color:#FEECE8",
},
{
key: 4,
label: "红色",
style: "background-color:#EE3140;color:white",
},
{
key: 5,
label: "黄色",
style: "background-color:#FF9D0A;color:white",
},
];
export const staticInfoList = [
{
key: "greenStoreCount",
background: "linear-gradient(90deg, #42CCCF 0%, #36D9A5 100%)",
label: "达标门店数",
},
{
key: "yellowStoreCount",
background: "linear-gradient(90deg, #7552FF 0%, #977DFF 100%)",
label: "需关注门店数",
},
{
key: "redStoreCount",
background: "linear-gradient(90deg, #3D76FC 0%, #4DA6FF 100%)",
label: "预警门店数",
},
];
export const brandTypeList = [
{
showIconOnActiveOnly: true,
icon: "/packageIndex/images/brand-tabs-icon.png",
key: "1",
label: "问界鸿蒙-延保权益",
},
{
showIconOnActiveOnly: true,
icon: "/packageIndex/images/brand-tabs-icon.png",
key: "2",
label: "通用品牌-延保权益",
},
];
export const schemaList = [
{
name: "displayTotalOutput",
label: "总产值",
col: 8,
titleInfo: true,
},
{
name: "displayDeliveryCount",
label: "交付数",
col: 8,
titleInfo: true,
},
{
name: "displayPreSalesTouchCount",
label: "触客数",
col: 8,
titleInfo: true,
},
{
name: "displayVehicleWarrantyRate",
label: "整车延保",
col: 8,
tips: "整车延保触客转化率",
},
{
name: "displayPeaceOfMindRate",
label: "安心包",
col: 6,
tips: "安心包触客转化率",
},
{
name: "displayBatteryWarrantyRate",
label: "电池",
col: 5,
tips: "电池延保触客转化率",
},
{
name: "displayTireInsuranceRate",
label: "轮胎",
col: 5,
tips: "轮胎险触客转化率",
},
{
name: "displayVehicleWarrantyAfterSalesRate",
label: "整车延保售后成交/总成交",
col: 12,
},
{
name: "displayPeaceOfMindAfterSalesRate",
label: "安心包售后成交/总成交",
col: 12,
},
{
name: "displayBatteryAfterSalesRate",
label: "电池售后成交/总成交",
col: 12,
isMore: true,
},
{
name: "displayTireInsuranceAfterSalesRate",
label: "轮胎售后成交/总成交",
col: 12,
isMore: true,
},
];
export const schemaCommonBrandList = [
{
name: "displayDeliveryCount",
label: "交付数",
col: 8,
titleInfo: true,
},
{
name: "displayPreSalesTouchCount",
label: "触客数",
col: 8,
titleInfo: true,
},
{
name: "displayTotalOutput",
label: "总产值(万)",
col: 8,
titleInfo: true,
},
{
name: "displayTouchConversionRate",
label: "触客成交率",
col: 7,
},
{
name: "displayWarrantyRate",
label: "延保",
col: 5,
tips: "延保触客转化率",
},
{
name: "displayEquityProductRate",
label: "权益商品",
col: 7,
tips: "权益商品触客转化率",
},
{
name: "displayEquityRate",
label: "权益",
col: 5,
tips: "权益触客转化率",
},
{
name: "displayWarrantyAfterSalesRate",
label: "延保售后成交/总成交",
col: 12,
},
{
name: "displayEquityProductAfterSalesRate",
label: "权益商品售后成交/总成交",
col: 12,
},
{
name: "displayEquityAfterSalesRate",
label: "权益售后成交/总成交",
col: 12,
isMore: true,
},
{
name: "displayEquityAvgUnitPrice",
label: "权益平均客单价(元)",
col: 12,
isMore: true,
},
];
import { schemaList, schemaCommonBrandList } from "./stationStaffPerformance.data.js";
import { brandTypeList } from "~/packageIndex/constant/performance.js";
import { getSupervisorStaffApi } from "~/packageIndex/api/performance.js";
const IMG_URL = "https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/";
import dayjs from "dayjs";
Page({
data: {
IMG_URL,
pageTitle: "驻店人员业绩列表",
merchantName: undefined,
navBarHeight: 84,
brandTypeList: [],
schemaList: schemaList,
originList: [],
list: [],
query: {
statDimension: "1",
dateType: 0,
filterKey: "",
merchantId: undefined,
},
},
navbarReady(e) {
this.setData({
navBarHeight: e.detail.height,
});
},
onRoute(options) {
console.log("options", options);
if (options.merchantId && options.merchantName) {
if (options.pageTitle) {
this.setData({
pageTitle: options.pageTitle,
});
}
const query = options?.query || {};
this.setData({
brandTypeList: [
{
key: query.statDimension,
label: `${query.statDimension === "1" ? "问界鸿蒙" : "通用品牌"}-${options.merchantName}`,
},
],
merchantName: options.merchantName,
query: {
...this.data.query,
...query,
dateType: Number(query.dateType),
merchantId: options.merchantId,
},
});
return;
}
this.setData({
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) {
// console.log("options", options);
// },
onReady() {},
onShow() {},
filterData(list) {
if (!this.data.query.filterKey.trim()) {
return list || this.data.originList;
}
return (list || this.data.originList).filter((item) => item?.employeeName?.includes(this.data.query.filterKey));
},
async getData() {
wx.$util.showLoading();
this.setData({
originList: [],
list: [],
});
try {
let userInfo = wx.$util.getUserInfo();
const { data } = await getSupervisorStaffApi({
supervisorId: userInfo.uuid,
...this.data.query,
});
this.setData({
originList: data.splice(0, 10),
list: this.filterData(data.splice(0, 10)),
});
} finally {
wx.$util.hideLoading();
}
},
async handleBrandTabChange({ detail }) {
const schemaLists = String(detail.key) === "1" ? schemaList : schemaCommonBrandList;
this.setData({
schemaList: schemaLists,
query: {
...this.data.query,
statDimension: detail.key,
},
});
await this.getData();
},
async handleSearch({ detail }) {
console.log("handleSearch");
this.setData({
query: {
...this.data.query,
startDate: detail.startDay?.replace(/\//g, "-"),
endDate: detail.endDay?.replace(/\//g, "-"),
dateType: detail.timeDimension,
},
});
await this.getData();
},
handleFilterKeyChange({ detail }) {
wx.$util.showLoading();
this.setData({
query: {
...this.data.query,
filterKey: detail,
},
});
this.setData(
{
list: this.filterData(),
},
function () {
wx.$util.hideLoading();
},
);
},
handleTapItem() {},
handleBack() {
wx.navigateBack();
},
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
async onPullDownRefresh() {
try {
await this.getData();
} finally {
wx.stopPullDownRefresh();
}
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {},
});
{
"usingComponents": {
"TypeTabs": "/packageIndex/components/typeTabs/typeTabs",
"StatisticsItem": "/packageIndex/components/statisticsItem/statisticsItem",
"date-screen": "/packageIndex/components/dateScreen/dateScreen",
"van-search": "@vant/weapp/search/index"
},
"enablePullDownRefresh": true,
"navigationStyle": "custom"
}
/* packageIndex/pages/specialTask/specialTask.wxss */
page {
background: #f2f3f7;
height: 100%;
.filter-wrapper {
background-color: white;
.tab-wrapper {
padding: var(--fontSize12) var(--fontSize24);
}
.date-filter-wrapper {
padding: var(--fontSize16) var(--fontSize24);
}
.search-input-wrapper {
padding: var(--fontSize16) var(--fontSize24);
width: 100%;
overflow: hidden;
box-sizing: border-box;
}
}
.list-wrapper {
padding: 0 var(--fontSize24) var(--fontSize16);
.title-wrapper {
font-weight: 400;
font-size: 14px;
line-height: 14px;
color: #000000e5;
padding: var(--fontSize16) 0;
}
.item-wrapper {
margin-bottom: 8px;
}
.last-tips {
padding: var(--fontSize30) 0;
text-align: center;
font-size: var(--fontSize24);
color: #999999;
}
}
}
<!--packageIndex/pages/specialTask/specialTask.wxml-->
<navigation-bar bind:navbarReady="navbarReady"
class="navigation-header"
showBack
bind:back="handleBack"
navStyle="background-color: white;box-shadow:none;">
<view class="page-title">
{{ pageTitle }}
</view>
</navigation-bar>
<scroll-view scroll-y
class="container"
style="padding-top: calc({{ navBarHeight }}px);">
<view class="filter-wrapper">
<view class="tab-wrapper">
<TypeTabs bind:change="handleBrandTabChange"
list="{{ brandTypeList }}"
value="{{ query.statDimension }}" />
</view>
<view class="date-filter-wrapper">
<date-screen customBackground="#f3f3f4"
tabSelected="{{ 3 }}"
init-start-date="{{ query.startDate }}"
init-end-date="{{ query.endDate }}"
init-time-dimension="{{ query.dateType }}"
bind:search="handleSearch"></date-screen>
</view>
<van-search value="{{ query.filterKey }}"
shape="round"
custom-class="search-input-wrapper"
background="#fff"
bind:change="handleFilterKeyChange"
placeholder="搜索驻店销售姓名..." />
</view>
<view class="list-wrapper">
<view class="title-wrapper">
驻店列表
</view>
<block wx:if="{{ list && list.length > 0 }}">
<view class="item-wrapper"
wx:for="{{ list }}"
wx:key="index">
<StatisticsItem title="{{ item.employeeName }}"
data="{{ item }}"
beTap="{{ false }}"
schema="{{ schemaList }}">
<view slot="title-sub">
{{ item.merchantName }}
</view>
</StatisticsItem>
</view>
<view class="last-tips">
到底了~
</view>
</block>
<block wx:else>
<empty-data />
</block>
</view>
</scroll-view>
export const schemaList = [
{
name: "displayTotalOutput",
label: "总产值(万)",
col: 8,
},
{
name: "displayDeliveryCount",
label: "交付数",
col: 8,
},
{
name: "displayPreSalesTouchCount",
label: "触客数",
col: 8,
},
{
name: "displayVehicleWarrantyRate",
label: "整车延保",
col: 8,
tips: "整车延保触客转化率",
},
{
name: "displayPeaceOfMindRate",
label: "安心包",
col: 6,
tips: "安心包触客转化率",
},
{
name: "displayBatteryWarrantyRate",
label: "电池",
col: 5,
tips: "电池延保触客转化率",
},
{
name: "displayTireInsuranceRate",
label: "轮胎",
col: 5,
tips: "轮胎险触客转化率",
},
{
name: "displayVehicleWarrantyAfterSalesRate",
label: "整车延保售后成交/总成交",
col: 12,
isMore: true,
},
{
name: "displayPeaceOfMindAfterSalesRate",
label: "安心包售后成交/总成交",
col: 12,
isMore: true,
},
{
name: "displayBatteryAfterSalesRate",
label: "电池售后成交/总成交",
col: 12,
isMore: true,
},
{
name: "displayTireInsuranceAfterSalesRate",
label: "轮胎售后成交/总成交",
col: 12,
isMore: true,
},
];
export const schemaCommonBrandList = [
{
name: "displayTotalOutput",
label: "总产值(万)",
col: 8,
},
{
name: "displayDeliveryCount",
label: "交付数",
col: 8,
},
{
name: "displayPreSalesTouchCount",
label: "触客数",
col: 8,
},
{
name: "displayTouchConversionRate",
label: "触客成交率",
col: 7,
},
{
name: "displayWarrantyRate",
label: "延保",
col: 5,
tips: "延保触客转化率",
},
{
name: "displayEquityProductRate",
label: "权益商品",
col: 7,
tips: "权益商品触客转化率",
},
{
name: "displayEquityRate",
label: "权益",
col: 5,
tips: "权益触客转化率",
},
{
name: "displayWarrantyAfterSalesRate",
label: "延保售后成交/总成交",
col: 12,
isMore: true,
},
{
name: "displayEquityProductAfterSalesRate",
label: "权益商品售后成交/总成交",
col: 12,
isMore: true,
},
{
name: "displayEquityAfterSalesRate",
label: "权益售后成交/总成交",
col: 12,
isMore: true,
},
{
name: "displayEquityAvgUnitPrice",
label: "权益平均客单价(元)",
col: 12,
isMore: true,
},
];
import { schemaList, schemaCommonBrandList } from "./storePerformance.data.js";
import { brandTypeList, staticInfoList } from "~/packageIndex/constant/performance.js";
import { getSupervisorStoreApi } from "~/packageIndex/api/performance.js";
const IMG_URL = "https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/";
Page({
data: {
IMG_URL,
navBarHeight: 84,
brandType: {
list: brandTypeList,
},
schemaList: schemaList,
staticInfoList: staticInfoList,
statistics: {
totalStoreCount: 0,
redStoreCount: 0,
yellowStoreCount: 0,
greenStoreCount: 0,
},
originList: [],
list: [],
query: {
statDimension: "1",
dateType: 0,
filterKey: "",
startDate: undefined,
endDate: undefined,
},
},
navbarReady(e) {
let navBarHeight = e.detail.height;
this.setData({
navBarHeight,
});
},
onLoad(options) {
// this.setData({
// pageQuery: options,
// });
// this.getDetail(options);
},
onReady() {},
onShow() {},
filterData(list) {
if (!this.data.query.filterKey.trim()) {
return list || this.data.originList;
}
return (list || this.data.originList).filter((item) => item?.merchantName?.includes(this.data.query.filterKey));
},
async getData() {
wx.$util.showLoading();
this.setData({
originList: [],
list: [],
});
try {
let userInfo = wx.$util.getUserInfo();
const { data } = await getSupervisorStoreApi({
supervisorId: userInfo.uuid,
...this.data.query,
});
this.setData({
originList: data.storeList,
statistics: data.statistics,
list: this.filterData(data.storeList),
});
} finally {
wx.$util.hideLoading();
}
},
async handleBrandTabChange({ detail }) {
const schemaLists = String(detail.key) === "1" ? schemaList : schemaCommonBrandList;
this.setData({
schemaList: schemaLists,
query: {
...this.data.query,
statDimension: detail.key,
},
});
await this.getData();
},
async handleSearch({ detail }) {
console.log("store search");
this.setData({
query: {
...this.data.query,
startDate: detail.startDay?.replace(/\//g, "-"),
endDate: detail.endDay?.replace(/\//g, "-"),
dateType: detail.timeDimension,
},
});
await this.getData();
},
handleFilterKeyChange({ detail }) {
wx.$util.showLoading();
this.setData({
query: {
...this.data.query,
filterKey: detail,
},
});
this.setData(
{
list: this.filterData(),
},
function () {
wx.$util.hideLoading();
},
);
},
handleTapItem({ currentTarget }) {
const row = currentTarget.dataset.item;
wx.$router.go("packageIndex.stationStaffPerformance", {
merchantName: row.merchantName,
merchantId: row.merchantId,
pageTitle: "门店驻店销售列表",
query: this.data.query,
});
},
goSpecialTaskApply() {
wx.navigateTo({
url: "/packageIndex/pages/specialTaskApply/specialTaskApply",
});
},
back() {
wx.navigateBack();
},
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
async onPullDownRefresh() {
try {
await this.getData();
} finally {
wx.stopPullDownRefresh();
}
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {},
});
{
"usingComponents": {
"TypeTabs": "/packageIndex/components/typeTabs/typeTabs",
"StatisticsItem": "/packageIndex/components/statisticsItem/statisticsItem",
"date-screen": "/packageIndex/components/dateScreen/dateScreen",
"van-search": "@vant/weapp/search/index",
"WarnList": "/packageIndex/components/warnList/index"
},
"enablePullDownRefresh": true,
"navigationStyle": "custom"
}
/* packageIndex/pages/specialTask/specialTask.wxss */
page {
background: #f2f3f7;
height: 100%;
.filter-wrapper {
background-color: white;
.tab-wrapper {
padding: var(--fontSize12) var(--fontSize24);
}
.date-filter-wrapper {
padding: var(--fontSize16) var(--fontSize24);
}
.search-input-wrapper {
padding: var(--fontSize16) var(--fontSize24);
width: 100%;
overflow: hidden;
box-sizing: border-box;
}
.statistics-wrapper {
display: flex;
align-items: center;
padding: var(--fontSize16) var(--fontSize32);
.static-item {
margin-left: var(--fontSize8);
padding: var(--fontSize24);
border-radius: var(--fontSize16);
flex: 1;
.label {
font-weight: 400;
font-size: 14px;
line-height: 16px;
color: white;
}
.value {
font-family: numberBold;
font-weight: 700;
font-style: Bold;
font-size: 20px;
margin-top: var(--fontSize10);
color: white;
}
}
}
}
.list-wrapper {
padding: 0 var(--fontSize24) var(--fontSize16);
.title-wrapper {
font-weight: 400;
font-size: 14px;
line-height: 14px;
color: #000000e5;
padding: var(--fontSize16) 0;
}
.item-wrapper {
margin-bottom: 8px;
.title-sub-wrapper {
display: flex;
align-items: center;
.label {
margin-right: var(--fontSize16);
}
}
}
.last-tips {
padding: var(--fontSize30) 0;
text-align: center;
font-size: var(--fontSize24);
color: #999999;
}
}
}
.fixed-action-bar {
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 99;
padding: 32rpx 16rpx calc(32rpx + env(safe-area-inset-bottom));
background: #ffffff;
box-sizing: border-box;
}
.fixed-action-btn {
height: 44px;
border-radius: 12px;
background: #2f6bff;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
color: #ffffff;
font-size: 16px;
font-weight: 600;
}
.fixed-action-text {
line-height: 16px;
}
<!--packageIndex/pages/specialTask/specialTask.wxml-->
<navigation-bar bind:navbarReady="navbarReady"
class="navigation-header"
showBack
bind:back="back"
navStyle="background-color: white;box-shadow:none;">
<view class="page-title">
门店业绩列表
</view>
</navigation-bar>
<scroll-view scroll-y
class="container"
style="padding-top: calc({{ navBarHeight }}px); padding-bottom: calc(140rpx + env(safe-area-inset-bottom));">
<view class="filter-wrapper">
<view class="tab-wrapper">
<TypeTabs bind:change="handleBrandTabChange"
list="{{ brandType.list }}"
value="{{ query.statDimension }}" />
</view>
<view class="date-filter-wrapper">
<date-screen customBackground="#f3f3f4"
tabSelected="{{ 3 }}"
bind:search="handleSearch"></date-screen>
</view>
<view class="statistics-wrapper"
wx:if="{{ query.dateType === 1 || query.dateType === 2 }}">
<view wx:for="{{ staticInfoList }}"
wx:key="{{ item.key }}"
class="static-item"
style="background:{{ item.background }}">
<view class="label">
{{ item.label }}
</view>
<view class="value">
{{ statistics[item.key] }}
</view>
</view>
</view>
<van-search value="{{ query.filterKey }}"
shape="round"
custom-class="search-input-wrapper"
background="#fff"
bind:change="handleFilterKeyChange"
placeholder="搜索门店名称..." />
</view>
<view class="list-wrapper">
<view class="title-wrapper">
门店列表
</view>
<block wx:if="{{ list && list.length > 0 }}">
<view class="item-wrapper"
wx:for="{{ list }}"
wx:key="index"
data-item="{{ item }}"
bind:tap="handleTapItem">
<StatisticsItem title="{{ item.merchantName }}"
data="{{ item }}"
hideValue="4"
schema="{{ schemaList }}">
<view slot="title-sub" class="title-sub-wrapper">
<view class="label">
{{ item.staffCount }}名驻店人员
</view>
<view wx:if="{{ item.warnList && item.warnList.length }}">
<WarnList list="{{ item.warnList }}" />
</view>
</view>
</StatisticsItem>
</view>
<view class="last-tips">
到底了~
</view>
</block>
<block wx:else>
<empty-data />
</block>
</view>
</scroll-view>
<view class="fixed-action-bar">
<view class="fixed-action-btn" catchtap="goSpecialTaskApply">
<view class="fixed-action-text">发起专项任务</view>
</view>
</view>
......@@ -220,6 +220,16 @@ Page({
}
});
},
handleNavigatePerformance(e) {
const { key } = e.currentTarget.dataset;
const urlMap = {
staffCount: "/packageIndex/pages/stationStaffPerformance/stationStaffPerformance",
shopCount: "/packageIndex/pages/storePerformance/storePerformance",
};
const url = urlMap[key];
if (!url) return;
wx.navigateTo({ url });
},
tabClick(e) {
let eventCode = ["supervisor_dayTask_tab", "supervisor_weeklyTask_tab", "supervisor_monthlyTask_tab", "supervisor_specificTask_tab"];
......
......@@ -25,10 +25,12 @@
</view>
</view>
<view class="static-info">
<view class="static-item"
<view wx:for="{{ staticList }}"
wx:key="{{ item.key }}"
class="static-item"
style="flex: {{ item.width }}rpx 0 0;background: {{ item.background }};"
wx:for="{{ staticList }}"
wx:key="index">
data-key="{{ item.key }}"
bind:tap="handleNavigatePerformance">
<view class="label">
{{ item.label }}
</view>
......@@ -43,7 +45,7 @@
<view class="tab-box">
<tab-bar tabList="{{ tabList }}"
badge="{{ true }}"
bindclick="tabClick"
bind:click="tabClick"
activeIndex="{{ tabIndex }}" />
</view>
<view class="date">
......
lockfileVersion: "9.0"
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.:
dependencies:
"@vant/area-data":
specifier: ^1.5.1
version: 1.5.2
"@vant/weapp":
specifier: ^1.10.24
version: 1.11.7
dayjs:
specifier: ^1.11.11
version: 1.11.20
glsk-applet-component:
specifier: ^1.0.0
version: 1.0.0
glsx-applet-component:
specifier: ^1.1.29
version: 1.1.29
glsx-common-sdk:
specifier: ^0.2.8
version: 0.2.8
number-precision:
specifier: ^1.6.0
version: 1.6.0
rfdc:
specifier: ^1.3.0
version: 1.4.1
devDependencies:
"@babel/generator":
specifier: ^7.28.6
version: 7.29.1
"@babel/parser":
specifier: ^7.28.6
version: 7.29.3
prettier:
specifier: ^3.8.1
version: 3.8.3
prettier-plugin-mp:
specifier: ^2.5.0
version: 2.5.0(prettier@3.8.3)
packages:
"@babel/generator@7.29.1":
resolution: { integrity: sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw== }
engines: { node: ">=6.9.0" }
"@babel/helper-string-parser@7.27.1":
resolution: { integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA== }
engines: { node: ">=6.9.0" }
"@babel/helper-validator-identifier@7.28.5":
resolution: { integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q== }
engines: { node: ">=6.9.0" }
"@babel/parser@7.29.3":
resolution: { integrity: sha512-b3ctpQwp+PROvU/cttc4OYl4MzfJUWy6FZg+PMXfzmt/+39iHVF0sDfqay8TQM3JA2EUOyKcFZt75jWriQijsA== }
engines: { node: ">=6.0.0" }
hasBin: true
"@babel/types@7.29.0":
resolution: { integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A== }
engines: { node: ">=6.9.0" }
"@jridgewell/gen-mapping@0.3.13":
resolution: { integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA== }
"@jridgewell/resolve-uri@3.1.2":
resolution: { integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== }
engines: { node: ">=6.0.0" }
"@jridgewell/sourcemap-codec@1.5.5":
resolution: { integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og== }
"@jridgewell/trace-mapping@0.3.31":
resolution: { integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw== }
"@vant/area-data@1.5.2":
resolution: { integrity: sha512-Gtxgt6Rjgopt6234ANpO0bBsSwtjZ23lBlVDHIy8Mi2NJqyoj1vgVWY0dri8/2LCZAWzQ6EnwRrUVViUZ0cvMA== }
"@vant/weapp@1.11.7":
resolution: { integrity: sha512-Rwn9BBnb4kHSV4XmvBicwtd42J+amEUfnFDcXJsGNPNX4a9c/DoT6YLsm4X1wB2+sQbdiQsbFBLAvGRBxCkD8g== }
"@wxml/parser@0.4.0":
resolution: { integrity: sha512-pS0OPyKzCOhCPGlcfO9IDLZbqH4485bPdGDqaa+hYnI+cY/OW+GN4J88XpfdzM8wXJcJShFZy5F6MTUr2rysXg== }
dayjs@1.11.20:
resolution: { integrity: sha512-YbwwqR/uYpeoP4pu043q+LTDLFBLApUP6VxRihdfNTqu4ubqMlGDLd6ErXhEgsyvY0K6nCs7nggYumAN+9uEuQ== }
glsk-applet-component@1.0.0:
resolution: { integrity: sha512-ulz1OquWy4y4Q26Zu4FLDWzyqK+sInPWs4o8MKj2N8V/TnYQlUXoWkkgKh8fERK8A+rsusf3eiyZB0odchKk8g== }
glsx-applet-component@1.1.29:
resolution: { integrity: sha512-HPzVayIRZvA3nvG2Lj9V9+S+BFiCer4XxjQwuZksta5Bs9JbbKaY4ztcIEe1Se3vw3rbPL0Dv2OsWvVz2b5jfw== }
glsx-common-sdk@0.2.8:
resolution: { integrity: sha512-qCDUBRvJwE2Gs1PLwB+fHOSFPgB5W5fwYC3GSBSjMQOxs4keeOvd7o5wIb7bNakp0xF6ARPqpC/xm3hZ9TRW6A== }
jsesc@3.1.0:
resolution: { integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA== }
engines: { node: ">=6" }
hasBin: true
number-precision@1.6.0:
resolution: { integrity: sha512-05OLPgbgmnixJw+VvEh18yNPUo3iyp4BEWJcrLu4X9W05KmMifN7Mu5exYvQXqxxeNWhvIF+j3Rij+HmddM/hQ== }
prettier-plugin-mp@2.5.0:
resolution: { integrity: sha512-xOACEwH19w211V8kkQEcrZnVQsP+g7/wepcJ2VM0ajLJdhQgcW4qJpD827vl28BYUuhkQ6dnyAAkeybJ3lzvzQ== }
peerDependencies:
prettier: ^3.0.0
prettier@3.8.3:
resolution: { integrity: sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw== }
engines: { node: ">=14" }
hasBin: true
rfdc@1.4.1:
resolution: { integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA== }
snapshots:
"@babel/generator@7.29.1":
dependencies:
"@babel/parser": 7.29.3
"@babel/types": 7.29.0
"@jridgewell/gen-mapping": 0.3.13
"@jridgewell/trace-mapping": 0.3.31
jsesc: 3.1.0
"@babel/helper-string-parser@7.27.1": {}
"@babel/helper-validator-identifier@7.28.5": {}
"@babel/parser@7.29.3":
dependencies:
"@babel/types": 7.29.0
"@babel/types@7.29.0":
dependencies:
"@babel/helper-string-parser": 7.27.1
"@babel/helper-validator-identifier": 7.28.5
"@jridgewell/gen-mapping@0.3.13":
dependencies:
"@jridgewell/sourcemap-codec": 1.5.5
"@jridgewell/trace-mapping": 0.3.31
"@jridgewell/resolve-uri@3.1.2": {}
"@jridgewell/sourcemap-codec@1.5.5": {}
"@jridgewell/trace-mapping@0.3.31":
dependencies:
"@jridgewell/resolve-uri": 3.1.2
"@jridgewell/sourcemap-codec": 1.5.5
"@vant/area-data@1.5.2": {}
"@vant/weapp@1.11.7": {}
"@wxml/parser@0.4.0": {}
dayjs@1.11.20: {}
glsk-applet-component@1.0.0: {}
glsx-applet-component@1.1.29: {}
glsx-common-sdk@0.2.8: {}
jsesc@3.1.0: {}
number-precision@1.6.0: {}
prettier-plugin-mp@2.5.0(prettier@3.8.3):
dependencies:
"@wxml/parser": 0.4.0
prettier: 3.8.3
prettier@3.8.3: {}
rfdc@1.4.1: {}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!