Commit 90cc4185 by 前端

Merge branch 'SAAS+V5.8.2' into 'master'

上线合并

See merge request !18
2 parents 0f2df1d9 5902bc09
Showing 84 changed files with 7514 additions and 1349 deletions
...@@ -9,15 +9,5 @@ end_of_line = lf ...@@ -9,15 +9,5 @@ end_of_line = lf
insert_final_newline = true insert_final_newline = true
charset = utf-8 charset = utf-8
indent_style = tab indent_style = tab
indent_size = 4 indent_size = 2
tab_width = 4 tab_width = 2
[*.{json,jsonc}]
indent_style = tab
indent_size = 4
tab_width = 4
[*.{js,ts,jsx,tsx,wxml,wxss,wxs,scss,sass}]
indent_style = tab
indent_size = 4
tab_width = 4
...@@ -11,7 +11,10 @@ miniprogram_npm ...@@ -11,7 +11,10 @@ miniprogram_npm
# local env files # local env files
.env.local .env.local
.env.*.local .env.*.local
.idea
*.local.json
.vscode/changelists.json
# Log files # Log files
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
......
export default { export default {
printWidth: 200, printWidth: 200,
tabWidth: 4, tabWidth: 2,
useTabs: true, useTabs: true,
semi: true, semi: true,
singleQuote: false, singleQuote: false,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// 使用 Prettier 作为默认格式化器 // 使用 Prettier 作为默认格式化器
"editor.defaultFormatter": "esbenp.prettier-vscode", "editor.defaultFormatter": "esbenp.prettier-vscode",
// 保存时自动格式化 // 保存时自动格式化
"editor.formatOnSave": false, "editor.formatOnSave": true,
// 缩进设置:使用 tab,大小为 4 // 缩进设置:使用 tab,大小为 4
"editor.tabSize": 2, "editor.tabSize": 2,
"editor.insertSpaces": false, "editor.insertSpaces": false,
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"scm.compactFolders": false, "scm.compactFolders": false,
"problems.decorations.enabled": false, "problems.decorations.enabled": false,
"[javascript]": { "[javascript]": {
"editor.defaultFormatter": "Wscats.eno" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"[wxml]": { "[wxml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
}, },
"files.associations": { "files.associations": {
"*.wxss": "css", "*.wxss": "css",
"*.sass": "scss"
}, },
"cSpell.words": [ "cSpell.words": [
// 微信小程序相关 // 微信小程序相关
...@@ -117,5 +116,5 @@ ...@@ -117,5 +116,5 @@
"gitlens.currentLineBlame.format": "${author}, ${date} - ${message}", "gitlens.currentLineBlame.format": "${author}, ${date} - ${message}",
"gitlens.blame.visibility": "on", "gitlens.blame.visibility": "on",
// 待团队讨论后再开启 // 待团队讨论后再开启
"prettier.enable": false "prettier.enable": true
} }
\ No newline at end of file \ No newline at end of file
### pnpm -v
10.29.2
### node -v
v20.20.2
#### 账号
##### 督导
-dev
* 13476670746
* 13132112126
-test
* 13267032121
* 13476670746
...@@ -92,5 +92,51 @@ module.exports = { ...@@ -92,5 +92,51 @@ module.exports = {
*/ */
getMentorRequireList(data) { getMentorRequireList(data) {
return api.post('dj.api.supervisor.mini.page.teachingRecords', data, [], '/rop-dj-supervisor-mini/router') return api.post('dj.api.supervisor.mini.page.teachingRecords', data, [], '/rop-dj-supervisor-mini/router')
},
/**
* 获取任务中心的专项带教任务列表数据
*/
getTaskCenterPageData(data) {
return api.post('dj.api.supervisor.mini.taskCenter.page', data, [], '/rop-dj-supervisor-mini/router')
},
/**
* 获取任务中心专项带教任务详情
*/
getTaskCenterDetail(data) {
return api.post('dj.api.supervisor.mini.taskCenter.getDetail',data, [], '/rop-dj-supervisor-mini/router')
},
/**
* 执行任务中心专项带教任务
*/
executeTaskCenter(data) {
return api.post('dj.api.supervisor.mini.taskCenter.execute',data, [], '/rop-dj-supervisor-mini/router')
},
/**
* 获取我发起的专项任务列表
*/
getSpecialTaskList(data) {
return api.post('dj.api.supervisor.mini.specialTask.page', data, [], '/rop-dj-supervisor-mini/router')
},
/**
* 发起专项任务
*/
createSpecialTask(data) {
return api.post('dj.api.supervisor.mini.specialTask.create', data, [], '/rop-dj-supervisor-mini/router')
},
// 获取门店配置的区域运营(D+平台)
getAreaOperatorList(data) {
return api.post('dj.api.supervisor.mini.list.regionOperator', data, [], '/rop-dj-supervisor-mini/router')
},
/**
* 获取专项任务详情
*/
getSpecialTaskDetail(data) {
return api.post('dj.api.supervisor.mini.specialTask.getDetail', data, [], '/rop-dj-supervisor-mini/router')
},
/**
* 获取我发起的专项任务统计数据
*/
getSpecialTaskCount(data) {
return api.post('dj.api.supervisor.mini.specialTask.count', data, [], '/rop-dj-supervisor-mini/router')
} }
} }
{ {
"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/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"
]
},
{
"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": "你的位置信息将用于小程序位置接口的效果展示"
}
}
}
\ No newline at end of file \ No newline at end of file
"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": "你的位置信息将用于小程序位置接口的效果展示"
}
}
}
@font-face { @font-face {
font-family: "numberNor"; font-family: "numberNor";
src: url("https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/font/D-DIN-PRO-500-Medium.ttf"); src: url("https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/font/D-DIN-PRO-500-Medium.ttf");
} }
@font-face { @font-face {
font-family: "numberBold"; font-family: "numberBold";
src: url("https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/font/D-DIN-PRO-700-Bold.ttf"); src: url("https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/font/D-DIN-PRO-700-Bold.ttf");
} }
page { page {
/* 兼容 IOS<11.2 先constant再env */ --primary-color: #2c66f7;
--constantSafeAreaInsetBottom: constant(safe-area-inset-bottom); --text-color: #333;
/* 兼容 IOS>11.2 */ /* 兼容 IOS<11.2 先constant再env */
--envSafeAreaInsetBottom: env(safe-area-inset-bottom); --constantSafeAreaInsetBottom: constant(safe-area-inset-bottom);
/* 兼容 IOS>11.2 */
@for $i from 1 through 1300 { --envSafeAreaInsetBottom: env(safe-area-inset-bottom);
--fontSize#{$i}: calc(#{$i}vmin / 7.5);
--fontSizeContent#{$i}: calc(#{$i}vmin / 7.176); @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); @media screen and (min-device-width: 768px) and (-webkit-min-device-pixel-ratio: 1) {
--fontSizeContent#{$i}: calc(#{$i}vmin / 6.719); @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%; image {
vertical-align: top; width: 100%;
} height: 100%;
vertical-align: top;
.y-center { }
top: 50%;
transform: translateY(-50%); .y-center {
} top: 50%;
transform: translateY(-50%);
.x-center { }
left: 50%;
transform: translateX(-50%); .x-center {
} left: 50%;
transform: translateX(-50%);
.box-center { }
position: absolute;
top: 50%; .box-center {
left: 50%; position: absolute;
transform: translate(-50%, -50%); top: 50%;
} left: 50%;
transform: translate(-50%, -50%);
.text-hide { }
white-space: nowrap;
overflow: hidden; .text-hide {
text-overflow: ellipsis; white-space: nowrap;
} overflow: hidden;
text-overflow: ellipsis;
.text-center { }
display: flex;
align-items: center; .text-center {
justify-content: center; display: flex;
} align-items: center;
justify-content: center;
}
.two-text {
display: inline-block; .two-text {
overflow: hidden; display: inline-block;
text-overflow: ellipsis; overflow: hidden;
-webkit-line-clamp: 2; text-overflow: ellipsis;
-webkit-box-orient: vertical; -webkit-line-clamp: 2;
} -webkit-box-orient: vertical;
}
.isFullSucreen {
box-sizing: border-box; .isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important; box-sizing: border-box;
padding-bottom: env(safe-area-inset-bottom) !important; padding-bottom: constant(safe-area-inset-bottom) !important;
// padding-bottom: 34px !important; padding-bottom: env(safe-area-inset-bottom) !important;
} // padding-bottom: 34px !important;
}
.isFullSucreen-bottom {
bottom: 34px !important; .isFullSucreen-bottom {
} bottom: 34px !important;
}
.list-nothing {
padding: var(--fontSize30) 0; .list-nothing {
text-align: center; padding: var(--fontSize30) 0;
font-size: var(--fontSize24); text-align: center;
color: #999999; font-size: var(--fontSize24);
} color: #999999;
}
.list-not {
display: flex; .list-not {
align-items: center; display: flex;
justify-content: center; align-items: center;
color: #999; justify-content: center;
font-size: var(--fontSize24); color: #999;
height: 100%; font-size: var(--fontSize24);
} height: 100%;
}
.bgcw {
background-color: #fff; .bgcw {
} background-color: #fff;
}
} }
.flex{ .flex {
display: flex; display: flex;
align-items: center; align-items: center;
}
\ No newline at end of file \ No newline at end of file
}
// components/SearchInput/SearchInput.js // components/SearchInput/SearchInput.js
Component({ Component({
externalClasses: ['container-class', 'field-class', 'input-class'],
// options: { // options: {
// styleIsolation: 'shared' // styleIsolation: 'shared'
// }, // },
...@@ -81,4 +82,4 @@ Component({ ...@@ -81,4 +82,4 @@ Component({
}) })
} }
} }
})
\ No newline at end of file \ No newline at end of file
})
<view class="search-box" style="{{styleValue}}"> <view class="search-box container-class" style="{{styleValue}}">
<view class="search-input"> <view class="search-input field-class">
<block wx:if="{{!edit}}"> <block wx:if="{{!edit}}">
<view class="input {{value?'':'placeholder'}}" bindtap="open"> <view class="input input-class {{value?'':'placeholder'}}" bindtap="open">
<block wx:if="{{value}}"> <block wx:if="{{value}}">
{{value}} {{value}}
</block> </block>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</view> </view>
</block> </block>
<block wx:else> <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> </block>
</view> </view>
</view>
\ No newline at end of file \ No newline at end of file
</view>
/* components/SearchInput/SearchInput.wxss */ /* components/SearchInput/SearchInput.wxss */
.search-box { .search-box {
height: var(--fontSize104); height: var(--fontSize104);
display: flex; display: flex;
align-items: center; align-items: center;
font-size: var(--fontSize28); font-size: var(--fontSize28);
width: 100%;
overflow: hidden;
} }
.search-box .search-input { .search-box .search-input {
width: 100%; width: 100%;
height: var(--fontSize72); height: var(--fontSize72);
background: #F7F8FA; background: #f7f8fa;
border-radius: var(--fontSize38); border-radius: var(--fontSize38);
color: #333; color: #333;
overflow: hidden;
} }
.search-input .input{ .search-input .input {
display: flex; display: flex;
align-items: center; align-items: center;
height: 100%; height: 100%;
width: 100%; width: 100%;
padding: 0 24rpx; padding: 0 24rpx;
} }
.search-input .icon{ .search-input .icon {
width: var(--fontSize28); width: var(--fontSize28);
height: var(--fontSize28); height: var(--fontSize28);
margin-right: var(--fontSize10); margin-right: var(--fontSize10);
}
.search-input .placeholder {
color: #c8c9cc;
} }
.search-input .placeholder{
color: #C8C9CC;
}
\ No newline at end of file \ No newline at end of file
<!--components/dateScreen/dateScreen.wxml--> <!--components/dateScreen/dateScreen.wxml-->
<view class="date-screen"> <view class="date-screen">
<view class="tab-section {{isSticky ? 'isSticky' : ''}}" style="background: {{customBackground}};" wx:if="{{!tabSelected || tabSelected == 3}}"> <view class="tab-section {{ isSticky ? 'isSticky' : '' }}"
<block wx:for="{{dateList}}" wx:key="index"> style="background: {{ customBackground }};"
<view class="tab {{item.index==dateCurrent?'active':''}}" data-index="{{item.index}}" bind:tap="selectDate">{{item.title}}</view> 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> </block>
</view> </view>
<view class="date-section"> <view class="date-section">
<view class="arrow left"> <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>
<view class="date-text" bind:tap="onDisplayDate">{{date}}</view>
<view class="arrow right"> <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> </view>
</view> </view>
<!-- 年月日 --> <!-- 年月日 -->
<block wx:if="{{dateShow}}"> <block wx:if="{{ dateShow }}">
<popup bindcancel="cancel" bindconfirm="confirm" show="{{dateShow}}" title="{{titleEnum[timeType]}}" height="60vh"> <popup bindcancel="cancel"
<block wx:if="{{timeType == 'date' || timeType == 'year-month'}}"> bindconfirm="confirm"
<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" /> show="{{ dateShow }}"
</block> title="{{ titleEnum[timeType] }}"
<!-- 周 --> height="60vh">
<block wx:if="{{timeType == 'week'}}"> <block wx:if="{{ timeType == 'date' || timeType == 'year-month' }}">
<van-picker id="weekPicker" show-toolbar="{{false}}" model:value="{{ currentDate }}" default-index="{{defaultIndex}}" value-key="label" columns="{{ weekColumns }}" bind:change="onWeekChange" /> <van-datetime-picker id="datePicker"
</block> show-toolbar="{{ false }}"
</popup> 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>
<block wx:if="{{show}}"> <block wx:if="{{ show }}">
<van-calendar <van-calendar id="calendar"
id="calendar" max-range="{{ 31 }}"
max-range="{{ 31 }}" min-date="{{ minDate }}"
min-date="{{ minDate }}" max-date="{{ maxDate }}"
max-date="{{ maxDate }}" show="{{ show }}"
show="{{ show }}" type="range"
type="range" color="#2C66F7"
color="#2C66F7" bind:confirm="onConfirm"
bind:confirm="onConfirm" bind:close="onClose" />
bind:close="onClose"
/>
</block> </block>
// packageWorkspace/pages/performanceRating/components/selectPopup/selectPopup.js // packageWorkspace/pages/performanceRating/components/selectPopup/selectPopup.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/'
Component({ Component({
options: { options: {
addGlobalClass: true addGlobalClass: true
}, },
properties: { properties: {
show: { show: {
type: Boolean, type: Boolean,
value: false value: false
}, },
title: { title: {
type: String, type: String,
value: '' value: ''
}, },
// 原始选项列表,支持任意字段名,通过 labelKey/valueKey 映射 // 原始选项列表,支持任意字段名,通过 labelKey/valueKey 映射
options: { options: {
type: Array, type: Array,
value: [] value: []
}, },
// 是否多选 // 是否多选
multiple: { multiple: {
type: Boolean, type: Boolean,
value: false value: false
}, },
// 单选初始值 // 单选初始值
value: { value: {
type: null, type: null,
value: null value: null
}, },
// 多选初始值 // 多选初始值
values: { values: {
type: Array, type: Array,
value: [] value: []
}, },
// 字段映射 // 字段映射
labelKey: { labelKey: {
type: String, type: String,
value: 'name' value: 'name'
}, },
valueKey: { valueKey: {
type: String, type: String,
value: 'value' value: 'value'
}, },
// 多选最大数量(不限制则设为 0 或不传) // 多选最大数量(不限制则设为 0 或不传)
max: { max: {
type: Number, type: Number,
value: 0 value: 0
}, },
// 单选时点击即确认 // 单选时点击即确认
confirmOnSelect: { confirmOnSelect: {
type: Boolean, type: Boolean,
value: false value: false
}, },
height: { height: {
type: String type: String
}, },
allowSearch: { allowSearch: {
type: Boolean type: Boolean
} }
}, },
data: { data: {
IMG_URL, IMG_URL,
displayOptions: [], // 带 checked 的渲染选项 displayOptions: [], // 带 checked 的渲染选项
selectedValues: [] // 选中的值列表(单选也统一用数组) selectedValues: [] // 选中的值列表(单选也统一用数组)
}, },
observers: { observers: {
'options, multiple, value, values': function(options, multiple, value, values) { 'options, multiple, value, values': function(options, multiple, value, values) {
this.initDisplay(options || [], multiple, value, values) this.initDisplay(options || [], multiple, value, values)
}, },
show(n) { show(n) {
// 进出场时保持数据一致 // 进出场时保持数据一致
if (n) { if (n) {
this.setData({ this.setData({
searchValue: '' searchValue: ''
}) })
this.initDisplay(this.properties.options || [], this.properties.multiple, this.properties.value, this.properties.values) this.initDisplay(this.properties.options || [], this.properties.multiple, this.properties.value, this.properties.values)
} }
} }
}, },
methods: { methods: {
initDisplay(options = [], multiple = false, value = null, values = []) { initDisplay(options = [], multiple = false, value = null, values = []) {
const vKey = this.properties.valueKey const vKey = this.properties.valueKey
// 初始选中值统一转为数组 // 初始选中值统一转为数组
const initSelected = multiple ? (Array.isArray(values) ? values.slice() : []) : (value !== null && value !== undefined ? value : []) const initSelected = multiple ? (Array.isArray(values) ? values.slice() : []) : (value !== null && value !== undefined ? value : [])
const display = (options || []).map(item => { const display = (options || []).map(item => {
const val = item[vKey] const val = item[vKey]
const checked = initSelected?.some(v => v === val) const checked = initSelected?.some(v => v === val)
return { ...item, checked } return { ...item, checked }
}) })
this.setData({ this.setData({
displayOptions: display, displayOptions: display,
copyDisplayOptions: wx.$util.deepClone(display), copyDisplayOptions: wx.$util.deepClone(display),
selectedValues: initSelected selectedValues: initSelected
}) })
}, },
toggle(e) { toggle(e) {
const { index, item } = e.currentTarget.dataset const { index, item } = e.currentTarget.dataset
const { multiple, max, valueKey } = this.properties const { multiple, max, valueKey } = this.properties
let { displayOptions, copyDisplayOptions } = this.data let { displayOptions, copyDisplayOptions } = this.data
if (!item || item.disabled) return if (!item || item.disabled) return
if (multiple) { if (multiple) {
let nextChecked = !item.checked let nextChecked = !item.checked
// 限制最大数量 // 限制最大数量
if (nextChecked && max > 0) { if (nextChecked && max > 0) {
const selectedCount = this.data.selectedValues.length const selectedCount = this.data.selectedValues.length
if (selectedCount >= max) { if (selectedCount >= max) {
// 可根据项目规范提示用户,这里不做 UI 弹窗,保持组件纯净 // 可根据项目规范提示用户,这里不做 UI 弹窗,保持组件纯净
this.triggerEvent('maxtips') this.triggerEvent('maxtips')
return return
} }
} }
const selectIndex = displayOptions?.findIndex(v => v[valueKey] == item[valueKey]) const selectIndex = displayOptions?.findIndex(v => v[valueKey] == item[valueKey])
this.setData({ [`displayOptions[${selectIndex}].checked`]: nextChecked }) this.setData({ [`displayOptions[${selectIndex}].checked`]: nextChecked })
const copySelectIndex = copyDisplayOptions?.findIndex(v => v[valueKey] == item[valueKey]) const copySelectIndex = copyDisplayOptions?.findIndex(v => v[valueKey] == item[valueKey])
this.setData({ [`copyDisplayOptions[${copySelectIndex}].checked`]: nextChecked }) this.setData({ [`copyDisplayOptions[${copySelectIndex}].checked`]: nextChecked })
const val = item[valueKey] const val = item[valueKey]
let selected = this.data.selectedValues.slice() let selected = this.data.selectedValues.slice()
const pos = selected.findIndex(v => v === val) const pos = selected.findIndex(v => v === val)
if (nextChecked && pos === -1) selected.push(val) if (nextChecked && pos === -1) selected.push(val)
if (!nextChecked && pos > -1) selected.splice(pos, 1) if (!nextChecked && pos > -1) selected.splice(pos, 1)
this.setData({ selectedValues: selected }) this.setData({ selectedValues: selected })
this.triggerEvent('change', { values: selected, items: this.getSelectedItems() }) this.triggerEvent('change', { values: selected, items: this.getSelectedItems() })
} else { } else {
// 单选:取消其他,选中当前 // 单选:取消其他,选中当前
const currentVal = item[valueKey] const currentVal = item[valueKey]
const display = this.data.displayOptions.map((it, idx) => ({ ...it, checked: idx === index ? !it.checked : false })) const display = this.data.displayOptions.map((it, idx) => ({ ...it, checked: idx === index ? !it.checked : false }))
const selected = display[index].checked ? [currentVal] : [] const selected = display[index].checked ? [currentVal] : []
this.setData({ displayOptions: display, selectedValues: selected }) this.setData({ displayOptions: display, selectedValues: selected })
const copyDisplay = this.data.copyDisplayOptions.map((it, idx) => ({ ...it, checked: idx === index ? !it.checked : false })) const copyDisplay = this.data.copyDisplayOptions.map((it, idx) => ({ ...it, checked: idx === index ? !it.checked : false }))
this.setData({ copyDisplayOptions: copyDisplay }) this.setData({ copyDisplayOptions: copyDisplay })
this.triggerEvent('change', { values: selected, items: this.getSelectedItems() })
if (this.properties.confirmOnSelect) {
this.onConfirm()
}
}
},
search(e) {
let { labelKey, copyDisplayOptions, displayOptions, selectedValues, valueKey } = this.data
let { value } = e.detail
if (!value) {
copyDisplayOptions.map(i => {
i.checked = false
if (selectedValues.includes(i[valueKey])) i.checked = true
return i
})
this.setData({
displayOptions: copyDisplayOptions
})
} else {
let arr = []
copyDisplayOptions.map(i => {
i.checked = false
if (selectedValues.includes(i[valueKey])) i.checked = true
if (i[labelKey].indexOf(value) != -1) {
arr.push(i)
}
})
this.setData({
displayOptions: arr
})
}
},
onCancel() {
this.triggerEvent('cancel')
},
onConfirm() {
const values = this.data.selectedValues
const items = this.getSelectedItems()
this.triggerEvent('confirm', { values, items })
},
getSelectedItems() {
return (this.data.copyDisplayOptions || []).filter(it => it.checked)
}
}
})
\ No newline at end of file \ No newline at end of file
this.triggerEvent('change', { values: selected, items: this.getSelectedItems() })
if (this.properties.confirmOnSelect) {
this.onConfirm()
}
}
},
search(e) {
let { labelKey, copyDisplayOptions, displayOptions, selectedValues, valueKey } = this.data
let { value } = e.detail
if (!value) {
copyDisplayOptions.map(i => {
i.checked = false
if (selectedValues.includes(i[valueKey])) i.checked = true
return i
})
this.setData({
displayOptions: copyDisplayOptions
})
} else {
let arr = []
copyDisplayOptions.map(i => {
i.checked = false
if (selectedValues.includes(i[valueKey])) i.checked = true
if (i[labelKey].indexOf(value) != -1) {
arr.push(i)
}
})
this.setData({
displayOptions: arr
})
}
},
onCancel() {
this.triggerEvent('cancel')
},
onConfirm() {
const values = this.data.selectedValues
const items = this.getSelectedItems()
this.triggerEvent('confirm', { values, items })
},
getSelectedItems() {
return (this.data.copyDisplayOptions || []).filter(it => it.checked)
}
}
})
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>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"rfdc": "^1.3.0" "rfdc": "^1.3.0"
}, },
"volta": { "volta": {
"node": "14.21.3" "node": "20.20.2"
}, },
"devDependencies": { "devDependencies": {
"@babel/generator": "^7.28.6", "@babel/generator": "^7.28.6",
......
// packageCrew/pages/specialMentoring/specialMentoring.js
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/'
import api from '~/api/crew/index'
import indexApi from '~/api/index/index'
import studyApi from '~/api/learningCenter/index'
import { uploadImg } from '~/api/api'
import dayjs from 'dayjs'
Page({
data: {
IMG_URL,
navBarHeight: 84,
isCompleted: false,
lockedFields: {},
orderObj: {
teachingSceneCode: 1,
teachingMethodCode: '',
teachingMethodName: '',
teachingTopicCode: '',
teachingTopicName: '',
teachingTime: '',
merchantList: [],
taskStaffList: [],
assigneeDetail: '',
assigneeImages: [],
bcCourseIdList: []
},
formItems: [{
label: '带教场景',
value: 'teachingSceneCode',
type: 'radio'
}, {
label: '带教时间',
value: 'teachingTime',
type: 'timePicker'
}, {
label: '带教方式',
value: 'teachingMethodCode',
valueText: 'teachingMethodName',
itemValue: 'itemValue',
itemName: 'itemName',
optionsName: 'teachingMethod',
type: 'select',
title: '方式选择',
selectHeight: '55%'
}, {
label: '推送课程',
value: 'bcCourseIdList',
itemValue: 'bcCourseId',
itemName: 'bcCourseName',
optionsName: 'course',
type: 'select',
hide: true,
selectMultiple: true,
title: '课程选择',
unit: '课'
}, {
label: '带教主题',
value: 'teachingTopicCode',
valueText: 'teachingTopicName',
itemValue: 'itemValue',
itemName: 'itemName',
optionsName: 'teachingTopic',
type: 'select',
title: '主题选择'
}, {
label: '带教门店',
value: 'merchantList',
itemValue: 'merchantId',
itemName: 'merchantName',
optionsName: 'merchant',
type: 'select',
selectMultiple: true,
title: '门店选择',
unit: '个'
}, {
label: '参与人员',
value: 'taskStaffList',
itemValue: 'participantPhone',
itemName: 'participantName',
optionsName: 'participant',
type: 'select',
selectMultiple: true,
title: '人员选择',
unit: '人'
}],
currentDate: dayjs().valueOf()
},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
})
},
onLoad(options) {
console.log(options)
this.setData({
pageOptions: options || {},
isCompleted: options?.taskStatus == '2'
})
if (options?.taskId) {
this.getDetail(options.taskId)
}
this.getDictList('teaching_method_1')
this.getDictList('teaching_method_2')
this.getDictList('teaching_topic')
this.getDictList('teaching_scene')
this.getMerchantList()
this.getbcCourseIdList()
},
back() {
wx.navigateBack()
},
getDictList(typeCode) {
api.getMentorDictList({typeCode, businessCode: 'supervisor'}).then(res => {
this.setData({
[`${typeCode}_list`]: res.data || []
})
})
},
getStaffList() {
let { orderObj } = this.data
let params = {
pageNum: 1,
pageSize: 9999,
merchantIdList: orderObj?.merchantList?.map(val => {return val.merchantId})
}
api.getParticipantOptions(params).then(res => {
let { code, data, message } = res
if (code == 0) {
data?.list?.forEach(val => {
val.participantName = val.staffName,
val.participantPhone = val.staffPhone
})
this.setData({
taskStaffList: data?.list || []
})
} else {
wx.$util.showToast(message)
}
})
},
getMerchantList() {
indexApi.getSupervisorMerchantList({}).then(res => {
let { code, data, message } = res
if (code == 0) {
this.setData({
merchantList: data || []
})
} else {
wx.$util.showToast(message)
}
})
},
getbcCourseIdList() {
let userInfo = wx.$util.getUserInfo()
let params = {
pageNum: 1,
pageSize: 9999,
staffPhone: userInfo?.phone,
sortType: 0,
sortOrder: 'desc'
}
studyApi.getRecommendedCourseList(params).then(res => {
let { code, data, message } = res
if (code == 0) {
data?.list?.forEach(val => {
val.bcCourseId = val.courseId
val.bcCourseName = val.title
})
this.setData({allbcCourseIdList: data?.list || []})
} else {
wx.$util.showToast(message)
}
})
},
getDetail(taskId) {
let { formItems} = this.data
indexApi.getTaskCenterDetail({taskId}).then(res => {
let { code, data, message } = res
if (code == 0) {
data = {
...data,
...data.teachingDetail,
bcCourseIdList: data.bcCourseIdList?.map((val, index) => { return {bcCourseId: val, bcCourseName: data.bcCourseNameList[index]} }) || [],
merchantList: data?.taskMerchantId ? [{merchantName: data?.taskMerchantName, merchantId: data?.taskMerchantId}] : [],
taskStaffList: data?.taskStaffList?.map(val => { return {participantName: val} }),
assigneeImages: data.assigneeImages?.map(val => {return {imageUrl: val}}) || []
}
const lockedFields = this._calcLockedFields(data)
let assigneeDetailLength = data?.assigneeDetail?.length || 0
if (data?.teachingSceneCode == 1 && data?.teachingMethodCode == 3) {
let index = formItems?.findIndex(val => val.value == 'bcCourseIdList')
this.setData({
[`formItems[${index}].hide`]: false
})
}
this.setData({
assigneeDetailLength,
taskId,
lockedFields,
}, () => {
this.setData({
orderObj: data || {}
}, () => {
if (Array.isArray(this.data.orderObj?.merchantList) && this.data.orderObj.merchantList.length) {
this.getStaffList()
}
})
})
} else {
wx.$util.showToast(message)
}
})
},
_calcLockedFields(detail) {
const d = detail || {}
const hasText = (v) => String(v ?? '').trim() !== ''
const hasArr = (v) => Array.isArray(v) && v.length > 0
return {
teachingSceneCode: d.teachingSceneCode !== null && d.teachingSceneCode !== undefined && d.teachingSceneCode !== '',
teachingTime: hasText(d.teachingTime),
teachingMethodCode: d.teachingMethodCode !== null && d.teachingMethodCode !== undefined && d.teachingMethodCode !== '',
teachingTopicCode: d.teachingTopicCode !== null && d.teachingTopicCode !== undefined && d.teachingTopicCode !== '',
bcCourseIdList: hasArr(d.bcCourseIdList),
merchantList: hasArr(d.merchantList),
taskStaffList: hasArr(d.taskStaffList),
assigneeDetail: hasText(d.assigneeDetail),
assigneeImages: hasArr(d.assigneeImages)
}
},
changeScene(e) {
let { formItems, orderObj, teaching_scene_list } = this.data
if (this.data.isCompleted) return
if (this.data.lockedFields?.teachingSceneCode) return
let { value } = e.currentTarget.dataset
this.setData({
['orderObj.teachingMethodCode']: '',
['orderObj.teachingMethodName']: '',
['orderObj.bcCourseIdList']: [],
'orderObj.teachingSceneCode': value,
'orderObj.teachingSceneName': teaching_scene_list?.find(v => v.itemValue == value)?.itemName
})
let index = formItems?.findIndex(val => val.value == 'bcCourseIdList')
this.setData({
[`formItems[${index}].hide`]: true
})
},
chooseSelect(e) {
let { item } = e.currentTarget.dataset
let { orderObj, merchantList, allbcCourseIdList, teaching_topic_list, teaching_method_1_list, teaching_method_2_list, taskStaffList } = this.data
if (this.data.isCompleted) return
if (this.data.lockedFields?.[item?.value]) return
if (item.optionsName == 'teachingMethod' && !orderObj.teachingSceneCode) return wx.$util.showToast('请先选择带教场景')
if (item.optionsName == 'participant' && !orderObj?.merchantList?.length) return wx.$util.showToast('请先选择带教门店')
const selectSources = {
'teachingMethod': orderObj.teachingSceneCode == 1 ? teaching_method_1_list : teaching_method_2_list,
'merchant': merchantList,
'course': allbcCourseIdList,
'teachingTopic': teaching_topic_list,
'participant': taskStaffList
}
this.setData({
selectType: item.optionsName,
showSelectPopup: true,
selectOptions: selectSources[item.optionsName],
selectTitle: item.title,
selectMultiple: item.selectMultiple || false,
labelKey: item.itemName,
valueKey: item.itemValue,
selectValue: item.selectMultiple ? orderObj[item.value]?.map(val => { return val[item.itemValue] }) : [orderObj[item.value]],
selectValues: item.selectMultiple ? orderObj[item.value]?.map(val => { return val[item.itemValue] }) : [orderObj[item.value]],
selectPopupHeight: item.selectHeight || '85%'
})
},
handlePopupConfirm(e) {
let { values, items } = e.detail
let { selectType, formItems, orderObj } = this.data
let obj = formItems?.find(val => val.optionsName == selectType)
if (obj.selectMultiple) {
this.setData({
[`orderObj.${obj.value}`]: items
})
} else {
this.setData({
[`orderObj.${obj.value}`]: values[0],
[`orderObj.${obj.valueText}`]: items[0] && items[0][obj.itemName]
})
}
if (selectType == 'teachingMethod' && values[0] != 3) this.setData({['orderObj.bcCourseIdList']: []})
let index = formItems?.findIndex(val => val.value == 'bcCourseIdList')
this.setData({
[`formItems[${index}].hide`]: !(orderObj.teachingSceneCode == 1 && orderObj.teachingMethodCode == 3)
})
if (selectType == 'merchant') {
this.setData({
['orderObj.taskStaffList']: []
}, () => {
orderObj.merchantList?.length && this.getStaffList()
})
}
this.hideSelectPopup()
},
removeMultiSelected(e) {
if (this.data.isCompleted) return
const field = e.currentTarget?.dataset?.field
const index = e.currentTarget?.dataset?.index
if (this.data.lockedFields?.[field]) return
if (!field && field !== 0) return
const list = Array.isArray(this.data.orderObj?.[field]) ? this.data.orderObj[field].slice() : []
if (index === null || index === undefined || index < 0 || index >= list.length) return
list.splice(index, 1)
const payload = {
[`orderObj.${field}`]: list
}
if (field === 'merchantList') {
payload['orderObj.taskStaffList'] = []
payload['taskStaffList'] = []
}
this.setData(payload, () => {
if (field === 'merchantList') {
const nextMerchants = this.data.orderObj?.merchantList || []
if (nextMerchants.length) this.getStaffList()
}
})
},
hideSelectPopup() {
this.setData({
showSelectPopup: false
})
},
chooseTime() {
let { orderObj } = this.data
if (this.data.isCompleted) return
if (this.data.lockedFields?.teachingTime) return
const ts = this._parseTimeToTimestamp(orderObj?.teachingTime) || this.data.currentDate || dayjs().valueOf()
this.setData({ dateShow: true, currentDate: ts, selectedDate: ts })
},
_parseTimeToTimestamp(timeStr) {
if (!timeStr) return null
const normalized = String(timeStr).trim().replace(/-/g, '/')
const d = dayjs(normalized)
return d.isValid() ? d.valueOf() : null
},
_normalizePickerTimestamp(raw) {
if (raw === null || raw === undefined || raw === '') return null
const v = raw?.value ?? raw?.detail?.value ?? raw
if (typeof v === 'number') return Number.isFinite(v) ? v : null
const s = String(v).trim()
if (!s) return null
const n = Number(s)
if (Number.isFinite(n)) return n
const normalized = s.replace(/-/g, '/')
const d = dayjs(normalized)
return d.isValid() ? d.valueOf() : null
},
cancel() {
this.setData({
dateShow: false
})
},
confirm() {
const selectedDate = this._normalizePickerTimestamp(this.data.selectedDate) || this._normalizePickerTimestamp(this.data.currentDate) || dayjs().valueOf()
this.setData({
dateShow: false,
currentDate: selectedDate,
['orderObj.teachingTime']: dayjs(selectedDate).format('YYYY-MM-DD HH:mm')
});
},
onChange(event) {
const ts = this._normalizePickerTimestamp(event?.detail?.value ?? event?.detail)
if (!ts) return
this.setData({ selectedDate: ts })
},
onInput(event) {
const ts = this._normalizePickerTimestamp(event?.detail?.value ?? event?.detail)
if (!ts) return
this.setData({ selectedDate: ts })
},
assigneeDetailInput(e) {
if (this.data.isCompleted) return
if (this.data.lockedFields?.assigneeDetail) return
let val = e.detail.value || ""
if (val.length > 1000) {
val = val.substring(0, 1000)
}
this.setData({
'orderObj.assigneeDetail': val,
assigneeDetailLength: val.length
})
},
handleImageUpload() {
if (this.data.isCompleted) return
if (this.data.lockedFields?.assigneeImages) return
let _this = this
let { orderObj } = _this.data
wx.chooseImage({
count: 1,
sourceType: ['album', 'camera'],
success(res) {
let [tempFiles] = res.tempFilePaths
for (const file of res.tempFiles) {
if (file.size > 10 * 1024 * 1024) {
return wx.showToast({
title: '图片上传最大10MB',
icon: 'none'
})
}
}
let imgType = tempFiles.split('.')[1]
let type = imgType == 'unknown' ? 'jpg' : imgType
wx.getFileSystemManager().readFile({
filePath: tempFiles,
encoding: 'base64',
success(_res) {
wx.$util.showLoading('上传中...')
uploadImg({
file: `${type}@${_res.data}`
}).then(img => {
wx.$util.hideLoading()
let { code, data, message } = img
if (code == 0) {
orderObj.assigneeImages.push({imageUrl: data})
_this.setData({
orderObj
})
} else {
wx.$util.showToast(message)
}
})
}
})
}
})
},
previewImage(e) {
let { url, index } = e.currentTarget.dataset
wx.previewImage({
urls: url?.map(val => {return val.imageUrl}),
current: url[index].imageUrl
})
},
delPhoto(e) {
if (this.data.isCompleted) return
if (this.data.lockedFields?.assigneeImages) return
let { index } = e.currentTarget.dataset
let { orderObj } = this.data
orderObj.assigneeImages.splice(index, 1)
this.setData({
'orderObj.assigneeImages': orderObj.assigneeImages
})
},
submit() {
let { orderObj, formItems } = this.data
let requiredList = [
...formItems?.filter(val => !val.hide),
{value: 'assigneeDetail'},
{value: 'assigneeImages'}
]
const hasInvalidItem = requiredList?.some((item) => {
const value = orderObj[item.value]
return !value || (Array.isArray(value) && value.length === 0);
});
if (hasInvalidItem) {
return wx.$util.showToast('请完成所有必填项')
}
let params = {
taskId: this.data.taskId,
teachingSceneCode: orderObj?.teachingSceneCode,
teachingSceneName: orderObj?.teachingSceneName,
teachingMethodCode: orderObj?.teachingMethodCode,
teachingMethodName: orderObj?.teachingMethodName,
teachingTopicCode: orderObj?.teachingTopicCode,
teachingTopicName: orderObj?.teachingTopicName,
teachingTime: orderObj?.teachingTime,
assigneeDetail: orderObj?.assigneeDetail,
taskMerchantId: orderObj?.taskMerchantId,
taskMerchantName: orderObj?.taskMerchantName,
taskStaffList: orderObj?.taskStaffList?.map(val => val.participantName),
taskStaffPhoneList: orderObj?.taskStaffPhoneList,
assigneeImages: orderObj?.assigneeImages?.map(val => val.imageUrl),
bcCourseIdList: orderObj?.bcCourseIdList?.map(val => val.bcCourseId),
bcCourseNameList: orderObj?.bcCourseIdList?.map(val => val.bcCourseName)
}
wx.$util.showLoading()
indexApi.executeTaskCenter(params).then(res => {
wx.$util.hideLoading()
let { code, message } = res
if (code == 0) {
wx.$util.showToast('操作成功')
this.back()
} else {
wx.$util.showToast(message)
}
}).catch(() => {
wx.$util.hideLoading()
})
},
})
{
"usingComponents": {
"van-icon": "@vant/weapp/icon/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
"select-popup": "/components/selectPopup/selectPopup"
},
"navigationStyle": "custom"
}
/* packageCrew/pages/specialMentoring/specialMentoring.wxss */
page{
background: #F2F3F7;
}
.required {
color: #F24724;
margin-left: 8rpx;
}
.container {
height: 100vh;
box-sizing: border-box;
width: calc(100% - 48rpx);
margin: 0 24rpx;
.box {
border-radius: 32rpx;
background: #FFFFFF;
padding: 32rpx;
margin-bottom: 24rpx;
font-size: 28rpx;
&.padding-0 {
padding: 0;
}
.name {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16rpx;
.staff {
display: flex;
align-items: center;
font-size: 36rpx;
width: 100%;
color: #333333;
.staff-name {
max-width: calc(100% - 40rpx);
word-break: break-all;
}
.sex-icon {
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
margin-left: 12rpx;
}
}
}
.items {
display: flex;
flex-wrap: wrap;
column-gap: 24rpx;
row-gap: 18rpx;
.item {
width: 100%;
display: flex;
align-items: center;
font-size: 26rpx;
color: #79859E;
.label {
flex-shrink: 0;
}
}
.inline {
flex: 1;
min-width: 0;
.value {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
.item-box {
height: 96rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 32rpx;
border-bottom: 1rpx solid #eff0f2;
.label {
color: #292D33;
}
.value {
display: flex;
align-items: center;
justify-content: flex-end;
width: calc(100% - 158rpx);
.value-text {
text-align: right;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.placeholder {
color: #BEC1C7;
font-size: 28rpx;
}
.input {
text-align: right;
font-size: 28rpx;
padding: 16rpx 0;
width: 100%;
}
image {
flex-shrink: 0;
width: 32rpx;
height: 32rpx;
transform: rotate(-90deg);
}
}
.value_box {
display: flex;
align-items: center;
gap: 32rpx;
.radio-box {
display: flex;
align-items: center;
gap: 16rpx;
.radio-icon {
flex-shrink: 0;
width: 32rpx;
height: 32rpx;
}
.circle {
flex-shrink: 0;
width: 28rpx;
height: 28rpx;
border-radius: 50%;
border: 2rpx solid #d0d2d6;
}
.text {
color: #292D33;
font-size: 28rpx;
}
}
}
}
.multi-select {
padding: 0 32rpx;
border-bottom: 1rpx solid #eff0f2;
.multi-select__header {
height: 96rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.multi-select__label {
color: #292D33;
}
.multi-select__arrow {
flex-shrink: 0;
width: 32rpx;
height: 32rpx;
transform: rotate(-90deg);
}
.multi-select__body {
margin-bottom: 12rpx;
}
.multi-placeholder {
color: #BEC1C7;
font-size: 28rpx;
}
.multi-tags {
display: flex;
flex-wrap: wrap;
gap: 24rpx;
}
.multi-tag {
display: inline-flex;
align-items: center;
max-width: 100%;
padding: 0 20rpx;
height: 44rpx;
border-radius: 8rpx;
background: #F6F7F9;
border: 2rpx solid #E6E8EC;
box-sizing: border-box;
}
.multi-tag__text {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 28rpx;
color: #292D33;
}
.multi-tag__close {
margin-left: 16rpx;
color: #999EA8;
font-size: 32rpx;
line-height: 1;
}
}
.remark_box {
height: 382rpx;
align-items: flex-start;
justify-content: flex-start;
flex-flow: column;
.label {
margin: 28rpx 0;
}
.textArea_box {
box-sizing: border-box;
width: 100%;
border-radius: 16rpx;
padding: 24rpx 24rpx 42rpx;
background: #FFFFFF;
border: 2rpx solid #eff0f2;
height: 262rpx;
position: relative;
font-size: 28rpx;
.textarea {
height: 100%;
width: 100%;
}
.currentWordNumber {
position: absolute;
right: 26rpx;
bottom: 8rpx;
color: #CCCCCC;
}
}
}
.image-box {
margin: 0 32rpx;
padding-bottom: 28rpx;
.label{
margin: 28rpx 0;
}
.upload_box{
display: flex;
flex-wrap: wrap;
gap: 28rpx;
.payVoucher_image{
flex-shrink: 0;
width: 192rpx;
height: 192rpx;
border-radius: 12rpx;
position: relative;
overflow: hidden;
image{
width: 100%;
height: 100%;
}
.del_icon{
width: 40rpx;
height: 40rpx;
position: absolute;
top: 16rpx;
right: 16rpx;
}
}
.upload-item {
width: 196rpx;
height: 196rpx;
border-radius: 12rpx;
background: #f5f5f7;
display: flex;
align-items: center;
justify-content: center;
flex-flow: column;
.icon-uploadAdd {
width: 40rpx;
height: 40rpx;
&.custom-icon-uploadAdd {
width: 100%;
height: 100%;
}
}
.upload-text {
margin-top: 16rpx;
color: #999EA8;
font-size: 24rpx;
}
}
}
}
}
}
.isFullSucreen-btn {
padding-bottom: 34px !important;
}
.footer-btn {
position: fixed;
left: 0;
width: 100%;
bottom: 0;
min-height: 100rpx;
background: #FFFFFF;
box-sizing: border-box;
display: flex;
align-items: center;
font-weight: 500;
z-index: 99;
.btn {
margin: 16rpx 32rpx;
width: calc(100% - 64rpx);
height: 88rpx;
text-align: center;
line-height: 88rpx;
background: #2C66F7;
border-radius: 24rpx;
font-size: 32rpx;
color: #FFFFFF;
font-weight: 500;
}
}
<!--packageCrew/pages/specialMentoring/specialMentoring.wxml-->
<glsx-privacy appletName="嘀加门店管理助手" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<navigation-bar bindnavbarReady="navbarReady"
class="navigation-header"
showBack="{{true}}"
bindback="back"
navStyle="background-color: transparent;box-shadow:none;">
<view class="page-title">
专项带教
</view>
</navigation-bar>
<scroll-view class="container" scroll-y show-scrollbar="{{false}}" enhanced style="padding-top: calc({{navBarHeight}}px + 8rpx);padding-bottom: {{!isCompleted ? (isFullSucreen ? 'calc(120rpx + 34px)' : '120rpx') : '0'}};">
<view style="width: 100%;height: 8rpx;"></view>
<view class="box padding-0">
<block wx:for="{{formItems}}" wx:key="index">
<block wx:if="{{!item.hide}}">
<view class="multi-select" wx:if="{{item.type == 'select' && item.selectMultiple}}" data-item="{{item}}">
<view class="multi-select__header">
<view class="multi-select__label">{{item.label}}<text class='required'>*</text></view>
<view bindtap="chooseSelect" data-item="{{item}}" style="display: flex;align-items: center;">
<text class="multi-placeholder" wx:if="{{!isCompleted && !lockedFields[item.value]}}">点击选择(可多选)</text>
<image wx:if="{{!isCompleted && !lockedFields[item.value]}}" class="multi-select__arrow" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/arrow.png" mode="aspectFit" />
</view>
</view>
<view class="multi-select__body" wx:if="{{orderObj[item.value] && orderObj[item.value].length}}">
<view class="multi-tags">
<block wx:for="{{orderObj[item.value]}}" wx:for-item="tag" wx:key="tagIndex" wx:for-index="tagIndex">
<view class="multi-tag">
<text class="multi-tag__text" style="max-width: {{(isCompleted || lockedFields[item.value]) ? '100%' : 'calc(100% - 36rpx)'}};">{{tag[item.itemName]}}</text>
<text class="multi-tag__close" wx:if="{{!isCompleted && !lockedFields[item.value]}}" catchtap="removeMultiSelected" data-field="{{item.value}}" data-index="{{tagIndex}}">×</text>
</view>
</block>
</view>
</view>
</view>
<view class="item-box" wx:else>
<view class="label">{{item.label}}<text class='required'>*</text></view>
<view wx:if="{{item.type == 'select'}}" class="value" bindtap="chooseSelect" data-item="{{item}}">
<block wx:if="{{orderObj[item.valueText]}}">
<text class="value-text">{{orderObj[item.valueText]}}</text>
</block>
<block wx:else>
<text wx:if="{{!isCompleted && !lockedFields[item.value]}}" class="placeholder">点击选择</text>
<text wx:else class="placeholder">-</text>
</block>
<image wx:if="{{!isCompleted && !lockedFields[item.value]}}" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/arrow.png" mode=""/>
</view>
<view class="value_box" wx:elif="{{item.type == 'radio'}}">
<view class="radio-box" wx:for="{{teaching_scene_list}}" wx:for-item="subItem" wx:for-index="subIndex" wx:key="subIndex" bindtap="changeScene" data-value="{{subItem.itemValue}}">
<image wx:if="{{orderObj.teachingSceneCode == subItem.itemValue}}" class="radio-icon" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/radio-checked.png" mode=""/>
<view wx:else class="circle"></view>
<view class="text">{{subItem.itemName}}</view>
</view>
</view>
<view wx:else class="value" bindtap="chooseTime">
<text wx:if="{{orderObj[item.value]}}" class="value-text">{{orderObj[item.value]}}</text>
<block wx:else>
<text wx:if="{{!isCompleted && !lockedFields[item.value]}}" class="placeholder">点击选择</text>
<text wx:else class="placeholder">-</text>
</block>
<image wx:if="{{!isCompleted && !lockedFields[item.value]}}" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/arrow.png" mode=""/>
</view>
</view>
</block>
</block>
<view class="item-box remark_box">
<view class="label">带教内容摘要<text class='required'>*</text></view>
<view class="textArea_box">
<textarea placeholder-style="color: #999EA8;" disabled="{{isCompleted || lockedFields.assigneeDetail}}" value="{{ orderObj.assigneeDetail }}" maxlength="1000" placeholder="请输入" class="textarea" bindinput="assigneeDetailInput" />
<view class="currentWordNumber">{{assigneeDetailLength || 0}} / 1000</view>
</view>
</view>
<view class="image-box">
<view class="label">带教照片佐证<text class='required'>*</text></view>
<view class="upload_box">
<block wx:if="{{orderObj.assigneeImages.length > 0}}">
<view class="payVoucher_image" wx:for="{{orderObj.assigneeImages}}" wx:key="index">
<image bindtap="previewImage" data-index="{{index}}" data-url="{{orderObj.assigneeImages}}" src="{{item.imageUrl}}"/>
<image class="del_icon" wx:if="{{!isCompleted && !lockedFields.assigneeImages}}" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/zy_paf_del_icon.png" mode="" bindtap="delPhoto" data-index="{{index}}"/>
</view>
</block>
<block wx:if="{{orderObj.assigneeImages.length < 9 && !isCompleted && !lockedFields.assigneeImages}}">
<view class="upload-item" bindtap="handleImageUpload">
<image src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/{{item.uploadIcon || 'zy-upload_icon.png'}}" class="icon-uploadAdd {{item.uploadIcon ? 'custom-icon-uploadAdd' : ''}}"></image>
<view class="upload-text">
{{orderObj.assigneeImages.length + '/' + 9}}
</view>
</view>
</block>
</view>
</view>
</view>
<view style="width: 100%;height: 20rpx;background: transparent;"></view>
</scroll-view>
<view class="footer-btn {{ isFullSucreen?'isFullSucreen-btn':'' }}" wx:if="{{!isCompleted}}">
<view class="btn" bindtap="submit">提交</view>
</view>
<select-popup show="{{ showSelectPopup }}" options="{{ selectOptions }}" multiple="{{selectMultiple}}" values="{{ selectValues }}" value="{{ selectValue }}" bindconfirm="handlePopupConfirm" labelKey="{{labelKey}}" valueKey="{{valueKey}}" height="{{selectPopupHeight}}" title="{{selectTitle}}" allowSearch="{{true}}" bindcancel="hideSelectPopup"></select-popup>
<popup bindcancel="cancel" bindconfirm="confirm" wx:if="{{dateShow}}" show="{{dateShow}}" title="时间选择" height="60vh">
<van-datetime-picker id="datePicker" show-toolbar="{{false}}" model:value="{{ currentDate }}" bind:change="onChange" bind:input="onInput" />
</popup>
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");
}
// 盯防门店业绩接口
export function getSupervisorStoreByMerchantApi(data) {
return api.post("dj.api.supervisor.store.performance.by.merchant", data, [], "/rop-dj-supervisor-mini/router");
}
// components/dateScreen/dateScreen.js
import api from "~/api/api";
import dayjs from "dayjs";
let currentObj;
let weekColumnsCache;
let weekColumnsPromise;
Component({
/**
* 组件的属性列表
*/
properties: {
tabSelected: {
type: Number,
observer: function (n, o) {
if (!((n ?? "") === "")) {
let { timeTypeEnum } = this.data;
const nextIndex = [1, 2].includes(n) ? n : 0;
const nextTimeType = timeTypeEnum[nextIndex];
if (n === 3 && this._hasInitConfig()) {
return;
}
if (this.data.date && this.data.dateCurrent === nextIndex && this.data.timeType === nextTimeType) {
return;
}
if ([1, 2].includes(n)) {
this.setData({
dateCurrent: n,
timeType: nextTimeType,
rightCurrent: true,
leftCurrent: false,
});
this.initDate(nextTimeType);
} else {
this.setData({
dateCurrent: 0,
timeType: nextTimeType,
rightCurrent: true,
leftCurrent: false,
});
this.initDate(nextTimeType);
}
}
},
},
initTimeDimension: {
type: Number,
value: -1,
observer: "_onInitConfigChange",
},
initStartDate: {
type: String,
value: "",
observer: "_onInitConfigChange",
},
initEndDate: {
type: String,
value: "",
observer: "_onInitConfigChange",
},
isSticky: Boolean,
customBackground: String,
setTrackData: Boolean,
},
lifetimes: {
attached: function () {
this._isAttached = true;
this._hasAppliedInit = false;
this._runInitConfigFlow();
},
detached: function () {
this._isAttached = false;
if (this._initConfigTimer) {
clearTimeout(this._initConfigTimer);
this._initConfigTimer = null;
}
},
},
/**
* 组件的初始数据
*/
data: {
// 默认展示今天日期,格式为 月/日
date: "",
minDate: dayjs().subtract(3, "year").valueOf(),
maxDate: dayjs().valueOf(),
dateCurrent: 0,
titleEnum: {
date: "选择日期",
week: "选择周",
"year-month": "选择年月",
},
timeType: "date",
weekList: [],
weekColumns: [],
dateList: [
{
title: "日",
index: 0,
},
{
title: "周",
index: 1,
},
{
title: "月",
index: 2,
},
],
timeTypeEnum: {
0: "date",
1: "week",
2: "year-month",
},
selectedDate: "",
leftCurrent: false,
rightCurrent: true,
},
/**
* 组件的方法列表
*/
methods: {
_onInitConfigChange() {
if (!this._isAttached) return;
this._hasAppliedInit = false;
if (this._initConfigTimer) {
clearTimeout(this._initConfigTimer);
}
this._initConfigTimer = setTimeout(() => {
this._initConfigTimer = null;
this._runInitConfigFlow();
}, 0);
},
_runInitConfigFlow() {
const hasInit = this._hasInitConfig();
if (hasInit) {
const dim = Number(this.data.initTimeDimension);
if (dim === 1) {
this.getWeeklyData().then(() => {
this._tryApplyInitConfig();
});
} else {
this._tryApplyInitConfig();
this.getWeeklyData();
}
} else {
this.initDate();
this.getWeeklyData();
}
},
async getWeeklyData() {
if (Array.isArray(weekColumnsCache) && weekColumnsCache.length) {
this.setData({ weekColumns: weekColumnsCache });
return;
}
if (!weekColumnsPromise) {
weekColumnsPromise = api
.getWeekSelectData()
.then((result) => {
const weekColumns =
result.data?.map((item, index) => ({
label: `${dayjs(item.startDate).format("YYYY/MM/DD")}-${dayjs(item.endDate).format("YYYY/MM/DD")}`,
startDate: dayjs(item.startDate).format("YYYY/MM/DD"),
endDate: dayjs(item.endDate).format("YYYY/MM/DD"),
index,
})) || [];
weekColumnsCache = weekColumns;
return weekColumns;
})
.catch(() => {
return [];
})
.finally(() => {
weekColumnsPromise = null;
});
}
const weekColumns = await weekColumnsPromise;
if (Array.isArray(weekColumns) && weekColumns.length) {
this.setData({ weekColumns });
}
},
// 切换日期类型
selectDate(event) {
const { index } = event.currentTarget.dataset;
const { timeTypeEnum } = this.data;
let eventCode = ["supervisor_dayTime_tab", "supervisor_weekTime_tab", "supervisor_monthTime_tab"];
if (this.data.setTrackData) {
wx.$track.setTrackData(0, eventCode[index], {}, "");
}
this.setData({
dateCurrent: index,
timeType: timeTypeEnum[index],
rightCurrent: true,
leftCurrent: false,
});
this.initDate(timeTypeEnum[index]);
},
getParams() {
let { dateCurrent, date, currentWeek } = this.data;
const obj = {};
switch (dateCurrent) {
case 0:
obj.startDay = obj.endDay = dayjs(date).format("YYYY/MM/DD");
break;
case 1:
obj.startDay = dayjs(currentWeek.startDate).format("YYYY/MM/DD");
obj.endDay = dayjs(currentWeek.endDate).format("YYYY/MM/DD");
break;
case 2:
obj.startDay = dayjs(date).startOf("month").format("YYYY/MM/DD");
obj.endDay = dayjs(date).endOf("month").format("YYYY/MM/DD");
break;
default:
console.warn("[getUsedCarBusinessData] 未知 timeType:", timeType);
}
obj.timeDimension = dateCurrent;
return obj;
},
initLoad() {
this.setData(
{
dateCurrent: 0,
leftCurrent: false,
rightCurrent: true,
},
() => {
this.initDate("date");
},
);
},
initDate(type = "date") {
const now = dayjs();
const setData = (payload) => {
this.setData(payload);
this.triggerEvent("search", this.getParams());
};
switch (type) {
case "date": {
const yesterday = now.subtract(1, "day");
setData({
date: now.format("YYYY/MM/DD"),
currentDate: now.valueOf(),
});
break;
}
case "year-month": {
const lastMonth = now.subtract(1, "month");
setData({
date: now.format("YYYY/MM"),
currentDate: now.valueOf(),
});
break;
}
case "week": {
// const secondWeek = this.data.weekColumns[1];
const firstWeek = this.data.weekColumns[0];
if (firstWeek) {
setData({
currentWeek: firstWeek,
date: `${firstWeek.startDate}-${firstWeek.endDate}`,
});
}
break;
}
default:
console.warn("[initDate] 未知 type:", type);
}
},
_hasInitConfig() {
const dim = Number(this.data.initTimeDimension);
if (![0, 1, 2].includes(dim)) return false;
return true;
},
_normalizeDateStr(input) {
if (!input) return "";
const str = String(input).trim().split(" ")[0];
const normalized = str.replace(/-/g, "/");
const d = dayjs(normalized);
return d.isValid() ? d.format("YYYY/MM/DD") : "";
},
_isSameAsCurrentQuery() {
const dim = Number(this.data.initTimeDimension);
if (![0, 1, 2].includes(dim)) return false;
const start = this._normalizeDateStr(this.data.initStartDate);
const end = this._normalizeDateStr(this.data.initEndDate);
const current = this.getParams();
return Number(current.timeDimension) === dim && this._normalizeDateStr(current.startDay) === start && this._normalizeDateStr(current.endDay) === end;
},
_tryApplyInitConfig() {
if (this._hasAppliedInit) return;
const dim = Number(this.data.initTimeDimension);
if (![0, 1, 2].includes(dim)) return;
if (this._isSameAsCurrentQuery()) {
this._hasAppliedInit = true;
return;
}
const timeTypeEnum = this.data.timeTypeEnum || {};
const timeType = timeTypeEnum[dim] || "date";
const start = this._normalizeDateStr(this.data.initStartDate);
const end = this._normalizeDateStr(this.data.initEndDate);
if (dim === 1 && (!Array.isArray(this.data.weekColumns) || !this.data.weekColumns.length)) {
return;
}
const nextData = {
dateCurrent: dim,
timeType,
};
if (dim === 0) {
const base = start || end;
if (base) {
const d = dayjs(base);
nextData.date = d.format("YYYY/MM/DD");
nextData.currentDate = d.valueOf();
} else {
const now = dayjs();
nextData.date = now.format("YYYY/MM/DD");
nextData.currentDate = now.valueOf();
}
}
if (dim === 2) {
const base = start || end;
if (base) {
const d = dayjs(base);
nextData.date = d.format("YYYY/MM");
nextData.currentDate = d.valueOf();
} else {
const now = dayjs();
nextData.date = now.format("YYYY/MM");
nextData.currentDate = now.valueOf();
}
}
if (dim === 1) {
const weekColumns = this.data.weekColumns || [];
const target = weekColumns.find((i) => i.startDate === start && i.endDate === end) || weekColumns[0];
if (target) {
nextData.currentWeek = target;
nextData.date = `${target.startDate}-${target.endDate}`;
nextData.defaultIndex = target.index;
nextData.rightCurrent = target.index === 0;
nextData.leftCurrent = target.index === weekColumns.length - 1;
}
}
if (dim === 0) {
const today = dayjs().startOf("day");
const min = dayjs(this.data.minDate).startOf("day");
const sel = dayjs(nextData.date).startOf("day");
nextData.rightCurrent = sel.isSame(today, "day");
nextData.leftCurrent = sel.isSame(min, "day");
}
if (dim === 2) {
const current = dayjs().startOf("month");
const min = dayjs(this.data.minDate).startOf("month");
const sel = dayjs(nextData.date);
nextData.rightCurrent = sel.isSame(current, "month");
nextData.leftCurrent = sel.isSame(min, "month");
}
this._hasAppliedInit = true;
this.setData(nextData, () => {
this.triggerEvent("search", this.getParams());
});
},
onDisplayDate() {
const { timeType, date, currentDate } = this.data;
if (timeType == "custom") {
this.setData(
{
show: true,
},
() => {
this._emitPopupVisible(true);
wx.nextTick(() => {
const calendar = this.selectComponent("#calendar");
if (calendar && calendar.__data__ && calendar.__data__.currentDate) {
const _calendar = calendar.__data__.currentDate.map((item) => dayjs(item).format("YYYY/MM/DD"));
const _value = date.split("-");
if (_value[0] != _calendar[0] || _value[1] != _calendar[1]) {
calendar.reset();
}
}
});
},
);
} else {
this.setData(
{
dateShow: true,
},
() => {
this._emitPopupVisible(true);
wx.nextTick(() => {
if (timeType == "date" && currentObj) {
const c_value = currentObj.getValues();
const _date = String(date).split(/[/-]/);
if (c_value[0] != _date[0] || c_value[1] != _date[1] || c_value[2] != _date[2]) {
const picker = this.selectComponent("#datePicker");
this.setData(
{
minDate: dayjs().subtract(3, "year").valueOf(),
maxDate: dayjs().valueOf(),
},
() => {
picker?.picker?.setValues?.(_date);
},
);
}
} else if (timeType == "year-month" && currentObj) {
const c_value = currentObj.getValues();
const _date = String(date).split(/[/-]/);
if (c_value[0] != _date[0] || c_value[1] != _date[1]) {
const picker = this.selectComponent("#datePicker");
this.setData(
{
minDate: dayjs().subtract(3, "year").valueOf(),
maxDate: dayjs().valueOf(),
},
() => {
picker?.picker?.setValues?.(_date);
},
);
}
} else if (timeType == "week") {
const { date, weekColumns } = this.data;
const picker = this.selectComponent("#weekPicker");
const label = date;
const index = weekColumns.findIndex((i) => i.label == label);
setTimeout(() => {
picker?.setColumnIndex?.(0, index);
}, 0);
}
});
},
);
}
},
// 取消
cancel() {
this.setData(
{
dateShow: false,
},
() => {
this._emitPopupVisible(false);
},
);
},
// 年月日确认
confirm() {
const { selectedDate, timeType, currentWeek } = this.data;
const baseDate = selectedDate || this.data.currentDate || dayjs().valueOf();
const formatMap = {
date: () => dayjs(baseDate).format("YYYY/MM/DD"),
"year-month": () => dayjs(baseDate).format("YYYY/MM"),
week: () => `${currentWeek.startDate}-${currentWeek.endDate}`,
};
const valueMap = {
date: () => dayjs(baseDate).valueOf(),
"year-month": () => dayjs(baseDate).valueOf(),
week: () => dayjs(currentWeek?.startDate, "YYYY/MM/DD").valueOf(),
};
// 边界状态统一计算
const calcBoundary = () => {
const { timeType, selectedDate, currentWeek, weekColumns, minDate } = this.data;
let rightCurrent = false;
let leftCurrent = false;
switch (timeType) {
case "date": {
const today = dayjs().startOf("day");
const min = dayjs(minDate).startOf("day");
const sel = dayjs(selectedDate || this.data.currentDate || this.data.date).startOf("day");
rightCurrent = sel.isSame(today, "day");
leftCurrent = sel.isSame(min, "day");
break;
}
case "year-month": {
const current = dayjs().startOf("month");
const min = dayjs(minDate).startOf("month");
const sel = dayjs(selectedDate || this.data.currentDate || this.data.date);
rightCurrent = sel.isSame(current, "month");
leftCurrent = sel.isSame(min, "month");
break;
}
case "week":
if (currentWeek.index === 0) rightCurrent = true;
if (currentWeek.index === weekColumns.length - 1) leftCurrent = true;
break;
default:
console.warn("[confirm] 未知 timeType:", timeType);
}
this.setData({ rightCurrent, leftCurrent });
};
calcBoundary();
this.setData(
{
dateShow: false,
currentDate: (valueMap[timeType] || (() => dayjs().valueOf()))(),
date: (formatMap[timeType] || (() => ""))(),
},
() => {
this._emitPopupVisible(false);
this.triggerEvent("search", this.getParams());
},
);
},
_emitPopupVisible(visible) {
this.triggerEvent("popupvisible", { visible }, { bubbles: true, composed: true });
},
onChange(e) {
currentObj = e.detail;
},
// 日选择
onInput(event) {
// 防止选择之后,取消选择,导致日期不变
this.setData({
selectedDate: event.detail,
});
},
// 周选择
onWeekChange(event) {
const { value } = event.detail;
const currentWeek = value;
this.setData({
currentWeek,
});
},
// 上一个月
last() {
const { timeType, merchantId, date, minDate, current } = this.data;
if (timeType == "year-month") {
// 使用 dayjs 处理年月逻辑
const currentDisplayDate = dayjs(date);
const prevMonth = currentDisplayDate.subtract(1, "month");
const leftCurrent = prevMonth.isSame(dayjs(minDate), "month");
this.setData({
date: prevMonth.format("YYYY/MM"),
currentDate: prevMonth.valueOf(),
rightCurrent: false,
leftCurrent,
});
} else if (timeType == "date") {
// 日选择:使用 dayjs 处理日期减一天
const currentDisplayDate = dayjs(date);
const prevDate = currentDisplayDate.subtract(1, "day");
const leftCurrent = prevDate.isSame(dayjs(minDate), "day");
this.setData({
date: prevDate.format("YYYY/MM/DD"),
currentDate: prevDate.valueOf(),
rightCurrent: false,
leftCurrent,
});
} else if (timeType == "week") {
const { currentWeek, weekColumns } = this.data;
if (currentWeek.index > -1) {
const prevWeek = weekColumns[currentWeek.index + 1];
const prevDate = dayjs(prevWeek.startDate, "YYYY/MM/DD");
this.setData({
date: `${prevWeek.startDate}-${prevWeek.endDate}`,
currentDate: prevDate.valueOf(),
defaultIndex: currentWeek.index + 1,
currentWeek: prevWeek,
leftCurrent: prevWeek.index === weekColumns.length - 1,
rightCurrent: false,
});
}
}
this.triggerEvent("search", this.getParams());
},
// 下一个月
next() {
const { timeType, merchantId, date, current } = this.data;
if (timeType == "year-month") {
// 获取当前显示的日期
const currentDisplayDate = dayjs(date);
// 设置为上一个月
const nextMonth = currentDisplayDate.add(1, "month");
const rightCurrent = nextMonth.isSame(dayjs(), "month");
this.setData({
date: nextMonth.format("YYYY/MM"),
currentDate: nextMonth.valueOf(),
leftCurrent: false,
rightCurrent,
});
} else if (timeType == "date") {
// 日选择
// 获取当前显示的日期
const currentDisplayDate = dayjs(date, "YYYY/MM/DD");
// 设置为下一个月
const nextDate = currentDisplayDate.add(1, "day");
const _date = nextDate.format("YYYY/MM/DD");
const _currentDate = dayjs().format("YYYY/MM/DD");
const rightCurrent = _date == _currentDate;
this.setData({
date: _date,
currentDate: nextDate.valueOf(),
rightCurrent,
leftCurrent: false,
});
} else if (timeType == "week") {
const { currentWeek, weekColumns } = this.data;
if (currentWeek.index < weekColumns.length) {
const nextWeek = weekColumns[currentWeek.index - 1];
const nextDate = dayjs(nextWeek.startDate, "YYYY/MM/DD");
this.setData({
date: `${nextWeek.startDate}-${nextWeek.endDate}`,
currentDate: nextDate.valueOf(),
defaultIndex: currentWeek.index - 1,
currentWeek: nextWeek,
rightCurrent: nextWeek.index == 0,
leftCurrent: false,
});
}
}
this.triggerEvent("search", this.getParams());
},
},
});
{
"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>
// 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,
arrowIcon: "/packageIndex/images/down-arrow-double.png",
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));
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: 0 0 var(--fontSize16);
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: 600;
font-size: var(--fontSize28);
line-height: var(--fontSize44);
color: rgba(0, 0, 0, 0.9);
}
.title-sub-label {
font-weight: 400;
font-size: var(--fontSize24);
line-height: var(--fontSize40);
color: #00000066;
&:empty + .title-sub-label__default {
display: block;
}
&__default {
display: none;
font-weight: 400;
font-size: var(--fontSize24);
line-height: var(--fontSize40);
color: #00000066;
}
}
}
.title-right-wrapper {
max-width: 60%;
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);
min-height: var(--fontSize40);
}
}
}
.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-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;
}
.toggle-icon {
width: var(--fontSize32);
height: var(--fontSize32);
margin-left: var(--fontSize4);
transform: rotate(0deg);
transition: transform 300ms ease;
&.is-expanded {
transform: rotate(-180deg);
}
}
}
}
.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] || item.emptyValue || '0' }}
</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">
{{ expanded ? '收起':'已隐藏' }} {{ hideValue }} 项售后成交指标
</view>
<image class="toggle-icon {{ expanded ? 'is-expanded' : '' }}"
src="{{ arrowIcon }}"
mode="aspectFit" />
</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: "预警门店数",
},
];
import api from '~/api/index/index'
import dayjs from 'dayjs'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/'
Page({
data: {
IMG_URL,
navBarHeight: 84,
statusMap: {
0: { name: '待完成', color: '#2C66F7', background: '#2c66f71a' },
1: { name: '已完成', color: '#35C376', background: '#35c3761a' }
},
list: [],
total: 0,
pageNum: 1,
pageSize: 10,
nothing: false,
flag: false
},
navbarReady(e) {
const navBarHeight = e.detail?.height
if (!navBarHeight) return
this.setData({ navBarHeight })
},
onLoad() {
this.reload()
},
onShow() {},
reload() {
this.setData(
{
list: [],
total: 0,
pageNum: 1,
nothing: false,
flag: false
},
() => {
this.getList(true)
}
)
},
onBottom() {
this.getList()
},
getList(reload) {
const { pageNum, pageSize, nothing } = this.data
if (nothing) return
const params = {
pageNum,
pageSize
}
wx.$util.showLoading()
api
.getSpecialTaskList(params)
.then(res => {
wx.$util.hideLoading()
const { code, data, message } = res || {}
if (code != 0) {
wx.$util.showToast(message || '加载失败')
this.setData({ flag: true })
return
}
const pageList = Array.isArray(data?.list) ? data.list : []
pageList.forEach(val => {
val.completeTime = val.completeTime ? dayjs(val.completeTime).format('YYYY-MM-DD HH:mm:ss') : ''
})
const nextList = reload ? pageList : this.data.list.concat(pageList)
const total = data?.total || 0
const isNothing = pageNum == data?.pages
this.setData({
list: nextList,
total,
pageNum: pageNum + 1,
nothing: !!isNothing,
flag: true
})
})
.catch(() => {
wx.$util.hideLoading()
this.setData({ flag: true })
})
},
viewDetail(e) {
const item = e.currentTarget?.dataset?.item || {}
wx.navigateTo({
url: `/packageIndex/pages/specialTaskApply/specialTaskApply?id=${item.id}`
})
},
goCreate() {
wx.navigateTo({
url: '/packageIndex/pages/specialTaskApply/specialTaskApply'
})
},
back() {
wx.navigateBack()
}
})
{
"usingComponents": {},
"navigationStyle": "custom"
}
page {
background: #F2F3F7;
}
.page-title {
font-size: var(--fontSize34);
color: #222222;
font-weight: 600;
}
.container {
height: 100vh;
box-sizing: border-box;
}
.count {
padding: 16rpx 24rpx;
font-size: 24rpx;
color: #999999;
}
.list {
padding: 0 24rpx 24rpx;
box-sizing: border-box;
}
.item {
border-radius: 24rpx;
background: #FFFFFF;
padding: 24rpx;
margin-bottom: 24rpx;
box-sizing: border-box;
}
.item-top {
display: flex;
align-items: center;
}
.status {
font-size: 22rpx;
padding: 8rpx 12rpx;
border-radius: 8rpx;
flex-shrink: 0;
}
.name {
margin-left: 12rpx;
font-size: 28rpx;
font-weight: 500;
color: #222222;
flex: 1 1 auto;
min-width: 0;
}
.btn {
flex: 0 0 auto;
text-align: center;
padding: 12rpx 34rpx;
border-radius: 60rpx;
color: #2C66F7;
font-size: 26rpx;
font-weight: 500;
background: #2c66f71a;
box-sizing: border-box;
}
.item-actions {
margin-top: 24rpx;
display: flex;
justify-content: flex-end;
}
.row {
margin-top: 24rpx;
display: flex;
align-items: center;
font-size: 24rpx;
color: #999999;
}
.icon {
margin-right: 8rpx;
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
}
.label {
flex: 0 0 auto;
}
.value {
flex: 1 1 auto;
min-width: 0;
}
.list-nothing {
text-align: center;
color: #999999;
font-size: 24rpx;
padding: 24rpx 0;
}
<navigation-bar
bindnavbarReady="navbarReady"
class="navigation-header"
showBack
bindback="back"
navStyle="background-color: #FFFFFF;box-shadow:none;"
>
<view class="page-title">我发起的专项任务</view>
</navigation-bar>
<scroll-view
scroll-y
class="container"
enhanced="{{true}}"
show-scrollbar="{{false}}"
style="padding-top: {{navBarHeight}}px;padding-bottom: 40rpx;"
bindscrolltolower="onBottom"
>
<view class="count">共{{ total || 0 }}条任务</view>
<view class="list">
<block wx:for="{{ list }}" wx:key="id">
<view class="item">
<view class="item-top">
<view
class="status text-center"
style="color: {{statusMap[item.taskStatus].color}}; background-color: {{statusMap[item.taskStatus].background}};"
>
{{statusMap[item.taskStatus].name}}
</view>
<view class="name text-hide">{{ item.categoryName || '-' }}</view>
</view>
<view class="row" wx:if="{{ item.merchantName }}">
<image class="icon" src="{{IMG_URL}}special-task-merchant.png" mode="" />
<view class="label">归属门店:</view>
<view class="value text-hide">{{ item.merchantName }}</view>
</view>
<view class="row" wx:if="{{ item.regionOperatorName }}">
<image class="icon" src="{{IMG_URL}}special-task-staff.png" mode="" />
<view class="label">指定区域运营:</view>
<view class="value text-hide">{{ item.regionOperatorName || '-' }}</view>
</view>
<view class="row" wx:if="{{ item.taskStatus == 1 }}">
<image class="icon" src="{{IMG_URL}}time-icon.png" mode="" />
<view class="label">完成时间:</view>
<view class="value">{{ item.completeTime || '-' }}</view>
</view>
<view class="item-actions">
<view class="btn" bindtap="viewDetail" data-item="{{ item }}">查看</view>
</view>
</view>
</block>
<view class="list-nothing" wx:if="{{ nothing && list.length }}">到底了~</view>
<empty-data wx:if="{{ flag && !list.length }}" />
</view>
</scroll-view>
import indexApi from '~/api/index/index'
import crewApi from '~/api/crew/index'
import dayjs from 'dayjs'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/'
Page({
data: {
IMG_URL,
navBarHeight: 84,
pageTitle: '发起专项任务',
readonly: false,
isFullSucreen: false,
businessList: [
{ label: '延保', value: 1 },
{ label: '权益', value: 3 },
{ label: '轻改', value: 2 }
],
bizTypeOptions: [
{ itemName: '人员更换评估', itemValue: 'staff-replace-access' },
{ itemName: '商务政策更新', itemValue: 'policy-update-access' },
{ itemName: '流量问题改善', itemValue: 'traffic-optimize' }
],
merchantOptions: [],
staffOptions: [],
operatorOptions: [],
form: {
bizType: '',
categoryName: '',
merchantId: '',
merchantName: '',
businessType: '',
problemStaffList: [],
regionOperatorPhone: '',
regionOperatorName: '',
description: ''
},
descriptionLength: 0,
showSelectPopup: false,
selectOptions: [],
selectMultiple: false,
selectValues: [],
selectValue: null,
selectTitle: '',
selectPopupHeight: '55%',
labelKey: 'itemName',
valueKey: 'itemValue',
selectScene: '',
allowSearch: false
},
navbarReady(e) {
const navBarHeight = e.detail?.height
if (!navBarHeight) return
this.setData({ navBarHeight })
},
onLoad(options) {
this.setData({
pageQuery: options || {},
readonly: !!options?.id,
pageTitle: options?.id ? '查看专项任务' : '发起专项任务'
})
this.getMerchantList()
this.getAreaOperatorList()
if (options?.id) {
this.getDetail(options.id)
}
},
back() {
wx.navigateBack()
},
getMerchantList() {
indexApi.getSupervisorMerchantList({}).then(res => {
const { code, data, message } = res || {}
if (code == 0) {
const list = Array.isArray(data) ? data : []
list.forEach(val => {
val.itemName = val.merchantName
val.itemValue = val.merchantId
})
this.setData({ merchantOptions: list })
} else {
wx.$util.showToast(message || '门店列表获取失败')
}
})
},
getStaffListByMerchant(merchantId) {
if (!merchantId) {
this.setData({ staffOptions: [] })
return
}
let params = {
pageNum: 1,
pageSize: 9999,
merchantIdList: [merchantId]
}
crewApi.getParticipantOptions(params).then(res => {
const { code, data, message } = res || {}
if (code == 0) {
const list = Array.isArray(data) ? data : data?.list || []
list.forEach(val => {
val.itemName = val.staffName || val.name
val.itemValue = val.staffPhone || val.phone
})
this.setData({ staffOptions: list })
} else {
wx.$util.showToast(message || '人员列表获取失败')
}
})
},
getAreaOperatorList() {
indexApi.getAreaOperatorList({}).then(res => {
const { code, data, message } = res || {}
if (code == 0) {
const list = Array.isArray(data) ? data : data?.list || []
list.forEach(v => {
v.itemName = v.name
v.itemValue = v.phone
})
this.setData({ operatorOptions: list })
} else {
wx.$util.showToast(message || '区域运营获取失败')
}
})
},
getDetail(id) {
indexApi.getSpecialTaskDetail({ id }).then(res => {
const { code, data, message } = res || {}
if (code != 0) {
wx.$util.showToast(message || '详情获取失败')
return
}
const detail = data || {}
const bizType = detail.bizTypeAttr || detail.bizType || ''
const categoryName = detail.categoryName || ''
const merchantId = detail.merchantId || ''
const merchantName = detail.merchantName || ''
const businessType = Number(detail.businessType || detail.business || '') || ''
const regionOperatorName = detail.regionOperatorName || ''
const regionOperatorPhone = detail.regionOperatorPhone || ''
const description = detail.description || ''
this.setData({
descriptionLength: description?.length || 0,
form: {
...this.data.form,
bizType: String(bizType),
categoryName: categoryName || this.findcategoryName(String(bizType)),
merchantId,
merchantName,
businessType,
regionOperatorName,
regionOperatorPhone,
problemStaffList: detail?.problemStaffName?.split(',')?.map(val => {return {name: val}}),
description
}
})
this.getStaffListByMerchant(merchantId)
})
},
findcategoryName(bizType) {
const found = (this.data.bizTypeOptions || []).find(v => String(v.itemValue) === String(bizType))
return found?.itemName || ''
},
openbizType() {
if (this.data.readonly) return
this.openPopup({
scene: 'bizType',
title: '任务类型',
options: this.data.bizTypeOptions,
labelKey: 'itemName',
valueKey: 'itemValue',
multiple: false,
value: this.data.form.bizType || null,
allowSearch: false
})
},
openMerchant() {
if (this.data.readonly) return
this.openPopup({
scene: 'merchant',
title: '门店选择',
options: this.data.merchantOptions,
labelKey: 'itemName',
valueKey: 'itemValue',
multiple: false,
value: [this.data.form.merchantId] || null,
allowSearch: true
})
},
openProblemSales() {
if (this.data.readonly) return
if (this.data.form.bizType !== 'staff-replace-access') return
if (!this.data.form.merchantId) return wx.$util.showToast('请先选择归属门店')
if (!this.data.staffOptions.length) return wx.$util.showToast('当前门店暂无可选人员')
const selectedPhones = (this.data.form.problemStaffList || []).map(v => v.phone).filter(Boolean)
this.openPopup({
scene: 'problemSales',
title: '问题驻店销售',
options: this.data.staffOptions,
labelKey: 'itemName',
valueKey: 'itemValue',
multiple: true,
values: selectedPhones,
allowSearch: true
})
},
openOperator() {
if (this.data.readonly) return
if (!this.data.operatorOptions.length) return wx.$util.showToast('未配置区域运营,请联系总部处理')
this.openPopup({
scene: 'operator',
title: '指定区域运营',
options: this.data.operatorOptions,
labelKey: 'itemName',
valueKey: 'itemValue',
multiple: false,
value: [this.data.form.regionOperatorPhone] || null,
allowSearch: true
})
},
openPopup({ scene, title, options, multiple, value, values, labelKey, valueKey, allowSearch }) {
this.setData({
selectScene: scene,
selectTitle: title,
selectOptions: options || [],
selectMultiple: !!multiple,
selectValue: value !== undefined ? value : null,
selectValues: Array.isArray(values) ? values : [],
labelKey: labelKey || 'itemName',
valueKey: valueKey || 'itemValue',
allowSearch: !!allowSearch,
showSelectPopup: true
})
},
hideSelectPopup() {
this.setData({ showSelectPopup: false })
},
handlePopupConfirm(e) {
const { values, items } = e.detail || {}
const scene = this.data.selectScene
this.setData({ showSelectPopup: false })
if (scene === 'bizType') {
const val = values?.[0] || ''
const name = items?.[0]?.itemName || ''
this.setData({
'form.bizType': val,
'form.categoryName': name,
'form.problemStaffList': val === 'staff-replace-access' ? this.data.form.problemStaffList : []
})
return
}
if (scene === 'merchant') {
const val = values?.[0] || ''
const name = items?.[0]?.itemName || ''
this.setData({
'form.merchantId': val,
'form.merchantName': name,
'form.problemStaffList': []
})
this.getStaffListByMerchant(val)
return
}
if (scene === 'operator') {
const val = values?.[0] || ''
const name = items?.[0]?.itemName || ''
this.setData({
'form.regionOperatorPhone': val,
'form.regionOperatorName': name
})
return
}
if (scene === 'problemSales') {
const list = (items || []).map(v => ({
name: v.itemName,
phone: v.itemValue
}))
this.setData({
'form.problemStaffList': list
})
}
},
removeProblemSales(e) {
const idx = Number(e.currentTarget?.dataset?.index)
if (Number.isNaN(idx)) return
const next = (this.data.form.problemStaffList || []).slice()
next.splice(idx, 1)
this.setData({
'form.problemStaffList': next
})
},
changeBusiness(e) {
if (this.data.readonly) return
const val = e.currentTarget?.dataset?.value
this.setData({
'form.businessType': val
})
},
descriptionInput(e) {
if (this.data.readonly) return
let val = e.detail?.value || ''
if (val.length > 500) val = val.substring(0, 500)
this.setData({
'form.description': val,
descriptionLength: val.length
})
},
validate() {
const f = this.data.form || {}
if (!f.bizType) return '请选择任务类型'
if (!f.merchantId) return '请选择归属门店'
if (!f.businessType) return '请选择归属业务'
if (f.bizType === 'staff-replace-access') {
if (!Array.isArray(f.problemStaffList) || !f.problemStaffList.length) return '请选择问题驻店销售'
}
if (!f.regionOperatorPhone) return '请选择指定区域运营'
if (!String(f.description || '').trim()) return '请输入任务事项描述'
return ''
},
submit() {
const msg = this.validate()
if (msg) return wx.$util.showToast(msg)
const f = this.data.form || {}
const params = {
bizType: f.bizType,
categoryName: f.categoryName,
merchantId: f.merchantId,
merchantName: f.merchantName,
businessType: f.businessType,
problemStaffList: f.problemStaffList?.map(v => {return {name: v.name, phone: v.phone}}),
regionOperatorList: [{name: f.regionOperatorName, phone: f.regionOperatorPhone}],
description: f.description
}
wx.$util.showLoading()
indexApi
.createSpecialTask(params)
.then(res => {
wx.$util.hideLoading()
const { code, message } = res || {}
if (code == 0) {
wx.$util.showToast('操作成功')
this.back()
} else {
wx.$util.showToast(message || '提交失败')
}
})
.catch(() => {
wx.$util.hideLoading()
})
}
})
{
"usingComponents": {
"select-popup": "/components/selectPopup/selectPopup"
},
"navigationStyle": "custom"
}
page {
background: #F2F3F7;
}
.page-title {
font-size: var(--fontSize34);
color: #222222;
font-weight: 600;
}
.required {
color: #F24724;
margin-left: 8rpx;
}
.container {
height: 100vh;
box-sizing: border-box;
width: calc(100% - 48rpx);
margin: 0 24rpx;
}
.box {
border-radius: 32rpx;
background: #FFFFFF;
padding: 32rpx;
margin-bottom: 24rpx;
font-size: 28rpx;
&.padding-0 {
padding: 0;
}
}
.item-box {
height: 96rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 32rpx;
border-bottom: 1rpx solid #eff0f2;
box-sizing: border-box;
.label {
color: #292D33;
flex: 0 0 auto;
}
.value {
display: flex;
align-items: center;
justify-content: flex-end;
width: calc(100% - 158rpx);
min-width: 0;
image {
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
transform: rotate(-90deg)
}
}
.value-text {
text-align: right;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #292D33;
}
.placeholder {
color: #BEC1C7;
font-size: 28rpx;
}
}
.value_box {
flex: 1 1 auto;
min-width: 0;
display: flex;
justify-content: flex-end;
gap: 24rpx;
.radio-box {
display: flex;
align-items: center;
gap: 10rpx;
.radio-icon {
width: 32rpx;
height: 32rpx;
}
.circle {
width: 28rpx;
height: 28rpx;
border-radius: 50%;
border: 2rpx solid #D9DDE3;
box-sizing: border-box;
}
.text {
color: #292D33;
font-size: 28rpx;
}
}
}
.multi-select {
padding: 0 32rpx;
border-bottom: 1rpx solid #eff0f2;
.multi-select__header {
height: 96rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.multi-select__label {
color: #292D33;
}
.multi-select__arrow {
flex-shrink: 0;
width: 32rpx;
height: 32rpx;
transform: rotate(-90deg);
}
.multi-select__body {
margin-bottom: 12rpx;
}
.multi-placeholder {
color: #BEC1C7;
font-size: 28rpx;
}
}
.multi-tags {
display: flex;
flex-wrap: wrap;
gap: 24rpx;
}
.multi-tag {
display: inline-flex;
align-items: center;
max-width: 100%;
padding: 0 12rpx;
height: 44rpx;
border-radius: 8rpx;
background: #F6F7F9;
border: 2rpx solid #E6E8EC;
box-sizing: border-box;
}
.multi-tag__text {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 28rpx;
color: #292D33;
}
.multi-tag__close {
margin-left: 16rpx;
color: #999EA8;
font-size: 32rpx;
line-height: 1;
}
.remark_box {
height: 382rpx;
align-items: flex-start;
justify-content: flex-start;
flex-flow: column;
border-bottom: none;
.label {
margin: 28rpx 0;
width: 100%;
}
.textArea_box {
box-sizing: border-box;
width: 100%;
border-radius: 16rpx;
padding: 24rpx 24rpx 42rpx;
background: #FFFFFF;
border: 2rpx solid #eff0f2;
height: 262rpx;
position: relative;
font-size: 28rpx;
.textarea {
height: 100%;
width: 100%;
}
.currentWordNumber {
position: absolute;
right: 26rpx;
bottom: 8rpx;
color: #CCCCCC;
}
}
}
.footer-btn {
position: fixed;
left: 0;
width: 100%;
bottom: 0;
min-height: 100rpx;
background: #FFFFFF;
box-sizing: border-box;
display: flex;
align-items: center;
font-weight: 500;
z-index: 99;
.btn {
margin: 16rpx 32rpx;
width: calc(100% - 64rpx);
height: 88rpx;
text-align: center;
line-height: 88rpx;
background: #2C66F7;
border-radius: 24rpx;
font-size: 32rpx;
color: #FFFFFF;
font-weight: 500;
}
}
.isFullSucreen-btn {
padding-bottom: 34px !important;
}
<glsx-privacy appletName="嘀加门店管理助手" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<navigation-bar
bindnavbarReady="navbarReady"
class="navigation-header"
showBack="{{true}}"
bindback="back"
navStyle="background-color: transparent;box-shadow:none;"
>
<view class="page-title">{{ pageTitle }}</view>
</navigation-bar>
<scroll-view
class="container"
scroll-y
show-scrollbar="{{false}}"
enhanced
style="padding-top: calc({{navBarHeight}}px + 8rpx);padding-bottom: {{ readonly ? '0' : (isFullSucreen ? 'calc(120rpx + 34px)' : '120rpx') }};"
>
<view style="width: 100%;height: 8rpx;"></view>
<view class="box padding-0">
<view class="item-box" bindtap="openbizType">
<view class="label">任务类型<text class="required">*</text></view>
<view class="value">
<text wx:if="{{ form.categoryName }}" class="value-text">{{ form.categoryName }}</text>
<text wx:else class="placeholder">点击选择</text>
<image src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/arrow.png" mode="" />
</view>
</view>
<view class="item-box" bindtap="openMerchant">
<view class="label">归属门店<text class="required">*</text></view>
<view class="value">
<text wx:if="{{ form.merchantName }}" class="value-text">{{ form.merchantName }}</text>
<text wx:else class="placeholder">点击选择</text>
<image src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/arrow.png" mode="" />
</view>
</view>
<view class="item-box">
<view class="label">归属业务<text class="required">*</text></view>
<view class="value_box">
<view class="radio-box" wx:for="{{ businessList }}" wx:key="value" bindtap="changeBusiness" data-value="{{ item.value }}">
<image wx:if="{{ form.businessType == item.value }}" class="radio-icon" src="{{IMG_URL}}radio-checked.png" mode="" />
<view wx:else class="circle" style="background: {{readonly ? '#EEE' : ''}};"></view>
<view class="text">{{ item.label }}</view>
</view>
</view>
</view>
<view class="multi-select" wx:if="{{ form.bizType == 'staff-replace-access' }}">
<view class="multi-select__header">
<view class="multi-select__label">问题驻店销售<text class="required">*</text></view>
<view bindtap="openProblemSales" style="display: flex;align-items: center;">
<text class="multi-placeholder" wx:if="{{ !readonly }}">点击选择(可多选)</text>
<image class="multi-select__arrow" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/arrow.png" mode="aspectFit" />
</view>
</view>
<view class="multi-select__body" wx:if="{{ form.problemStaffList && form.problemStaffList.length }}">
<view class="multi-tags">
<block wx:for="{{ form.problemStaffList }}" wx:key="phone">
<view class="multi-tag">
<text class="multi-tag__text" style="max-width: {{ readonly ? '100%' : 'calc(100% - 36rpx)'}};">{{ item.name || item.staffName || item.participantName || '-' }}</text>
<text class="multi-tag__close" wx:if="{{ !readonly }}" catchtap="removeProblemSales" data-index="{{ index }}">×</text>
</view>
</block>
</view>
</view>
</view>
<view class="item-box" bindtap="openOperator">
<view class="label">指定区域运营<text class="required">*</text></view>
<view class="value">
<text wx:if="{{ form.regionOperatorName }}" class="value-text">{{ form.regionOperatorName }}</text>
<text wx:else class="placeholder">点击选择</text>
<image src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/arrow.png" mode="" />
</view>
</view>
<view class="item-box remark_box">
<view class="label">任务事项描述<text class="required">*</text></view>
<view class="textArea_box">
<textarea
placeholder-style="color: #999EA8;"
disabled="{{ readonly }}"
value="{{ form.description }}"
maxlength="500"
placeholder="请输入"
class="textarea"
bindinput="descriptionInput"
/>
<view class="currentWordNumber">{{ descriptionLength || 0 }} / 500</view>
</view>
</view>
</view>
<view style="width: 100%;height: 20rpx;background: transparent;"></view>
</scroll-view>
<view class="footer-btn {{ isFullSucreen?'isFullSucreen-btn':'' }}" wx:if="{{ !readonly }}">
<view class="btn" bindtap="submit">提交</view>
</view>
<select-popup
show="{{ showSelectPopup }}"
options="{{ selectOptions }}"
multiple="{{ selectMultiple }}"
values="{{ selectValues }}"
value="{{ selectValue }}"
bindconfirm="handlePopupConfirm"
bindcancel="hideSelectPopup"
labelKey="{{ labelKey }}"
valueKey="{{ valueKey }}"
height="{{ selectPopupHeight }}"
title="{{ selectTitle }}"
allowSearch="{{ allowSearch }}"
/>
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: "displayDeliveryCount",
label: "交付数",
col: 8,
titleInfo: true,
emptyValue: "0",
},
{
name: "displayPreSalesTouchCount",
label: "触客数",
col: 8,
titleInfo: true,
emptyValue: "0",
},
{
name: "displayTotalOutput",
label: "总产值(万)",
col: 8,
titleInfo: true,
emptyValue: "0",
},
{
name: "displayVehicleWarrantyRate",
label: "整车延保",
col: 8,
tips: "整车延保触客转化率",
emptyValue: "0%",
},
{
name: "displayPeaceOfMindRate",
label: "安心包",
col: 6,
tips: "安心包触客转化率",
emptyValue: "0%",
},
{
name: "displayBatteryWarrantyRate",
label: "电池",
col: 5,
tips: "电池延保触客转化率",
emptyValue: "0%",
},
{
name: "displayTireInsuranceRate",
label: "轮胎",
col: 5,
tips: "轮胎险触客转化率",
emptyValue: "0%",
},
{
name: "displayVehicleWarrantyAfterSalesRate",
label: "整车延保售后成交/总成交",
col: 12,
emptyValue: "0/0",
},
{
name: "displayPeaceOfMindAfterSalesRate",
label: "安心包售后成交/总成交",
col: 12,
emptyValue: "0/0",
},
{
name: "displayBatteryAfterSalesRate",
label: "电池售后成交/总成交",
col: 12,
isMore: true,
emptyValue: "0/0",
},
{
name: "displayTireInsuranceAfterSalesRate",
label: "轮胎售后成交/总成交",
col: 12,
isMore: true,
emptyValue: "0/0",
},
];
export const schemaCommonBrandList = [
{
name: "displayDeliveryCount",
label: "交付数",
col: 8,
titleInfo: true,
emptyValue: "0",
},
{
name: "displayPreSalesTouchCount",
label: "触客数",
col: 8,
titleInfo: true,
emptyValue: "0",
},
{
name: "displayTotalOutput",
label: "总产值(万)",
col: 8,
titleInfo: true,
emptyValue: "0",
},
{
name: "displayTouchConversionRate",
label: "触客成交率",
col: 7,
emptyValue: "0%",
},
{
name: "displayWarrantyRate",
label: "延保",
col: 5,
tips: "延保触客转化率",
emptyValue: "0%",
},
{
name: "displayEquityProductRate",
label: "权益商品",
col: 7,
tips: "权益商品触客转化率",
emptyValue: "0%",
},
{
name: "displayEquityRate",
label: "权益",
col: 5,
tips: "权益触客转化率",
emptyValue: "0%",
},
{
name: "displayWarrantyAfterSalesRate",
label: "延保售后成交/总成交",
col: 12,
emptyValue: "0/0",
},
{
name: "displayEquityProductAfterSalesRate",
label: "权益商品售后成交/总成交",
col: 12,
emptyValue: "0/0",
},
{
name: "displayEquityAfterSalesRate",
label: "权益售后成交/总成交",
col: 12,
isMore: true,
emptyValue: "0/0",
},
{
name: "displayEquityAvgUnitPrice",
label: "权益平均客单价(元)",
col: 12,
isMore: true,
emptyValue: "0",
},
];
import { schemaList, schemaCommonBrandList } from "./stationStaffPerformance.data.js";
import { brandTypeList } from "~/packageIndex/constant/performance.js";
import { getSupervisorStaffApi, getSupervisorStoreByMerchantApi } 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: [],
originList: [],
list: [],
query: {
statDimension: "1",
dateType: 0,
filterKey: "",
merchantId: undefined,
},
},
navbarReady(e) {
this.setData({
navBarHeight: e.detail.height,
});
},
onRoute(options) {
wx.$track.setTrackData(0, "data_guard_view_stationed_sales_list", {}, "");
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}`,
},
],
schemaList: String(query.statDimension) === "1" ? schemaList : schemaCommonBrandList,
merchantName: options.merchantName,
query: {
...this.data.query,
...query,
dateType: Number(query.dateType),
merchantId: options.merchantId,
},
});
return;
}
this.setData({
brandTypeList: wx.$util.deepClone(brandTypeList),
schemaList: schemaList,
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 api = this.data.query.merchantId ? getSupervisorStoreByMerchantApi : getSupervisorStaffApi;
const { data } = await api({
supervisorId: userInfo.uuid,
...this.data.query,
});
this.setData({
originList: data,
list: this.filterData(data),
});
} 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 */
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
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: var(--fontSize28);
line-height: var(--fontSize28);
color: #000000e5;
padding: var(--fontSize16) 0;
}
.item-wrapper {
margin-bottom: var(--fontSize16);
.title-sub-wrapper {
font-weight: 400;
font-size: var(--fontSize24);
line-height: var(--fontSize40);
margin-right: var(--fontSize16);
}
}
.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"
class="title-sub-wrapper text-hide"
wx:if="{{ item.merchantName }}">
{{ 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,
emptyValue: "0",
},
{
name: "displayDeliveryCount",
label: "交付数",
col: 8,
emptyValue: "0",
},
{
name: "displayPreSalesTouchCount",
label: "触客数",
col: 8,
emptyValue: "0",
},
{
name: "displayVehicleWarrantyRate",
label: "整车延保",
col: 8,
tips: "整车延保触客转化率",
emptyValue: "0%",
},
{
name: "displayPeaceOfMindRate",
label: "安心包",
col: 6,
tips: "安心包触客转化率",
emptyValue: "0%",
},
{
name: "displayBatteryWarrantyRate",
label: "电池",
col: 5,
tips: "电池延保触客转化率",
emptyValue: "0%",
},
{
name: "displayTireInsuranceRate",
label: "轮胎",
col: 5,
tips: "轮胎险触客转化率",
emptyValue: "0%",
},
{
name: "displayVehicleWarrantyAfterSalesRate",
label: "整车延保售后成交/总成交",
col: 12,
isMore: true,
emptyValue: "0/0",
},
{
name: "displayPeaceOfMindAfterSalesRate",
label: "安心包售后成交/总成交",
col: 12,
isMore: true,
emptyValue: "0/0",
},
{
name: "displayBatteryAfterSalesRate",
label: "电池售后成交/总成交",
col: 12,
isMore: true,
emptyValue: "0/0",
},
{
name: "displayTireInsuranceAfterSalesRate",
label: "轮胎售后成交/总成交",
col: 12,
isMore: true,
emptyValue: "0/0",
},
];
export const schemaCommonBrandList = [
{
name: "displayTotalOutput",
label: "总产值(万)",
col: 8,
emptyValue: "0",
},
{
name: "displayDeliveryCount",
label: "交付数",
col: 8,
emptyValue: "0",
},
{
name: "displayPreSalesTouchCount",
label: "触客数",
col: 8,
emptyValue: "0",
},
{
name: "displayTouchConversionRate",
label: "触客成交率",
col: 7,
emptyValue: "0%",
},
{
name: "displayWarrantyRate",
label: "延保",
col: 5,
tips: "延保触客转化率",
emptyValue: "0%",
},
{
name: "displayEquityProductRate",
label: "权益商品",
col: 7,
tips: "权益商品触客转化率",
emptyValue: "0%",
},
{
name: "displayEquityRate",
label: "权益",
col: 5,
tips: "权益触客转化率",
emptyValue: "0%",
},
{
name: "displayWarrantyAfterSalesRate",
label: "延保售后成交/总成交",
col: 12,
isMore: true,
emptyValue: "0/0",
},
{
name: "displayEquityProductAfterSalesRate",
label: "权益商品售后成交/总成交",
col: 12,
isMore: true,
emptyValue: "0/0",
},
{
name: "displayEquityAfterSalesRate",
label: "权益售后成交/总成交",
col: 12,
isMore: true,
emptyValue: "0/0",
},
{
name: "displayEquityAvgUnitPrice",
label: "权益平均客单价(元)",
col: 12,
isMore: true,
emptyValue: "0",
},
];
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) {
wx.$track.setTrackData(0, "data_guard_view_store_count", {}, "");
// 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 */
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
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: var(--fontSize28);
line-height: var(--fontSize28);
color: #000000e5;
padding: var(--fontSize16) 0;
}
.item-wrapper {
margin-bottom: 8px;
.title-sub-wrapper {
display: flex;
align-items: center;
.label {
font-weight: 400;
font-size: var(--fontSize24);
line-height: var(--fontSize40);
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);">
<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> -->
// pages/tab/crew/crew.js // pages/tab/crew/crew.js
import dayjs from 'dayjs' import dayjs from "dayjs";
import api from '~/api/crew/index' import api from "~/api/crew/index";
import indexApi from '~/api/index/index' import indexApi from "~/api/index/index";
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/";
const sceneMaps = { // 1延保 2轻改 3权益 const sceneMaps = {
// 1延保 2轻改 3权益
1: 1, 1: 1,
2: 3, 2: 3,
3: 2 3: 2,
} };
Page({ Page({
/**
/** * 页面的初始数据
* 页面的初始数据 */
*/ data: {
data: {
IMG_URL, IMG_URL,
navBarHeight: 84, navBarHeight: 84,
tabIndex: 0, tabIndex: 0,
tabList: [{ tabList: [
text: '业绩', {
value: 'performance' text: "业绩",
}, { value: "performance",
text: '行为', },
value: 'behavior' {
}, { text: "行为",
text: '培训', value: "behavior",
value: 'training' },
}], {
text: "培训",
value: "training",
},
],
sceneTabIndex: 0, sceneTabIndex: 0,
sceneTabList: [{ sceneTabList: [
text: '全部', {
icon: 'all-icon', text: "全部",
value: '' icon: "all-icon",
}, { value: "",
text: '延保', },
icon: 'yanbao-icon', {
value: '1' text: "延保",
}, { icon: "yanbao-icon",
text: '权益', value: "1",
icon: 'quanyi-icon', },
value: '2' {
}, { text: "权益",
text: '轻改', icon: "quanyi-icon",
icon: 'qinggai-icon', value: "2",
value: '3' },
}], {
staticList: [{ text: "轻改",
label: '驻店人员', icon: "qinggai-icon",
width: '208', value: "3",
key: 'staffCount', },
background: 'linear-gradient(90deg, #42CCCF 0%, #36D9A5 100%)' ],
}, { staticList: [
label: '门店数量', {
width: '192', label: "驻店人员",
key: 'storeCount', width: "208",
background: 'linear-gradient(90deg, #5E69FF 0%, #4079FF 100%)' key: "staffCount",
}, { background: "linear-gradient(90deg, #42CCCF 0%, #36D9A5 100%)",
label: '总产值', },
key: 'totalOutput', {
background: 'linear-gradient(90deg, #3D76FC 0%, #4DA6FF 100%)' label: "门店数量",
}], width: "192",
AIContent: '', key: "storeCount",
background: "linear-gradient(90deg, #5E69FF 0%, #4079FF 100%)",
},
{
label: "总产值",
key: "totalOutput",
background: "linear-gradient(90deg, #3D76FC 0%, #4DA6FF 100%)",
},
],
AIContent: "",
staticData: {}, staticData: {},
employeeList: [], employeeList: [],
mode: 'performance', mode: "performance",
sortField: 1, sortField: 1,
sortOrder: 1 sortOrder: 1,
}, },
onTabItemTap(e) { onTabItemTap(e) {
// 点击埋点 // 点击埋点
wx.$track.setTrackData(0, 'supervisor_crew_page', {}, '') wx.$track.setTrackData(0, "supervisor_crew_page", {}, "");
}, },
navbarReady(e) { navbarReady(e) {
let navBarHeight = e.detail.height let navBarHeight = e.detail.height;
this.setData({ this.setData({
navBarHeight navBarHeight,
}) });
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {},
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() { onReady() {
const query = wx.createSelectorQuery().in(this) const query = wx.createSelectorQuery().in(this);
query.select('.top-box').boundingClientRect() query.select(".top-box").boundingClientRect();
query.exec(res => { query.exec((res) => {
this.setData({topBoxHeight: res[0]?.height}) this.setData({ topBoxHeight: res[0]?.height });
}) });
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
this.getAIAnalyse() this.getAIAnalyse();
this.getEmployeeRank() this.getEmployeeRank();
if (this.data.tabIndex == 2) { // 请求培训的统计数据 if (this.data.tabIndex == 2) {
this.getTrainingStaticsData() // 请求培训的统计数据
this.getTrainingStaticsData();
} }
}, },
formatThousands (v) { formatThousands(v) {
const s = String(v) const s = String(v);
if (!s) return s if (!s) return s;
const isNeg = s[0] === '-' const isNeg = s[0] === "-";
const raw = isNeg ? s.slice(1) : s const raw = isNeg ? s.slice(1) : s;
const [intPart, decPart] = raw.split('.') const [intPart, decPart] = raw.split(".");
const intFmt = String(intPart || '0').replace(/\B(?=(\d{3})+(?!\d))/g, ',') const intFmt = String(intPart || "0").replace(/\B(?=(\d{3})+(?!\d))/g, ",");
const res = decPart ? `${intFmt}.${decPart}` : intFmt const res = decPart ? `${intFmt}.${decPart}` : intFmt;
return isNeg ? `-${res}` : res return isNeg ? `-${res}` : res;
}, },
// 切换类型 // 切换类型
changeTab(e) { changeTab(e) {
let { target } = e.currentTarget.dataset let { target } = e.currentTarget.dataset;
let { tabList } = this.data let { tabList } = this.data;
let eventCode = ['supervisor_performance_tab', 'supervisor_behavior_tab', 'supervisor_training_tab'] let eventCode = ["supervisor_performance_tab", "supervisor_behavior_tab", "supervisor_training_tab"];
const index = tabList?.findIndex(val => val.value == target.value) const index = tabList?.findIndex((val) => val.value == target.value);
wx.$track.setTrackData(0, eventCode[index], {}, '') wx.$track.setTrackData(0, eventCode[index], {}, "");
this.setData({ this.setData(
tabIndex: index, {
mode: target.value, tabIndex: index,
// sceneTabIndex: 0, mode: target.value,
sortField: index == 1 ? 4 : 1, // 行为排序初始为4成交数 // sceneTabIndex: 0,
sortOrder: 1 sortField: index == 1 ? 4 : 1, // 行为排序初始为4成交数
}, () => { sortOrder: 1,
// const comp = this.selectComponent('#date') },
// if (comp) comp.initLoad('date') () => {
const sortComp = this.selectComponent('#employee-ranking') // const comp = this.selectComponent('#date')
if (sortComp) sortComp.initLoad() // if (comp) comp.initLoad('date')
setTimeout(() => { const sortComp = this.selectComponent("#employee-ranking");
this.getAIAnalyse() if (sortComp) sortComp.initLoad();
this.getEmployeeRank() setTimeout(() => {
if (index == 2) { this.getAIAnalyse();
this.getTrainingStaticsData() // 培训tab 多请求一次业绩接口获取统计数据 this.getEmployeeRank();
} if (index == 2) {
}) this.getTrainingStaticsData(); // 培训tab 多请求一次业绩接口获取统计数据
}) }
});
},
);
}, },
// 切换业务 // 切换业务
changeSceneTab(e) { changeSceneTab(e) {
let { target } = e.currentTarget.dataset let { target } = e.currentTarget.dataset;
let { sceneTabList } = this.data let { sceneTabList } = this.data;
const index = sceneTabList?.findIndex(val => val.value == target.value) const index = sceneTabList?.findIndex((val) => val.value == target.value);
let eventCode = ['supervisor_warranty_tab', 'supervisor_benefits_tab', 'supervisor_lightMod_tab'] let eventCode = ["supervisor_warranty_tab", "supervisor_benefits_tab", "supervisor_lightMod_tab"];
wx.$track.setTrackData(0, eventCode[index], {}, '') wx.$track.setTrackData(0, eventCode[index], {}, "");
this.setData({ this.setData(
sceneTabIndex: index {
}, () => { sceneTabIndex: index,
this.getAIAnalyse() },
this.getEmployeeRank() () => {
this.getTrainingStaticsData() this.getAIAnalyse();
}) this.getEmployeeRank();
this.getTrainingStaticsData();
},
);
}, },
// 排序变化 // 排序变化
onEmployeeSortChange(e) { onEmployeeSortChange(e) {
const { rankfield, rankType } = e.detail const { rankfield, rankType } = e.detail;
wx.$track.setTrackData(0, `supervisor_${rankfield}_${rankType}`, {}, '') wx.$track.setTrackData(0, `supervisor_${rankfield}_${rankType}`, {}, "");
this.setData({ this.setData({
sortField: rankfield, sortField: rankfield,
sortOrder: rankType == 'desc' ? 1 : 0 sortOrder: rankType == "desc" ? 1 : 0,
}) });
this.getEmployeeRank() this.getEmployeeRank();
}, },
search(e) { search(e) {
this.setData({ this.setData({
startStr: e.detail.startDay?.replace(/\//g, '-'), startStr: e.detail.startDay?.replace(/\//g, "-"),
endStr: e.detail.endDay?.replace(/\//g, '-'), endStr: e.detail.endDay?.replace(/\//g, "-"),
timeDimension: e.detail.timeDimension timeDimension: e.detail.timeDimension,
}) });
this.getAIAnalyse() this.getAIAnalyse();
this.getEmployeeRank() this.getEmployeeRank();
this.getTrainingStaticsData() this.getTrainingStaticsData();
}, },
getAIAnalyse() { getAIAnalyse() {
let { startStr, endStr, timeDimension, tabIndex, sceneTabIndex } = this.data let { startStr, endStr, timeDimension, tabIndex, sceneTabIndex } = this.data;
const apievents = ['getDashboardAIResult', 'getBehaviorAIResult', 'getAIAnslyseData'] const apievents = ["getDashboardAIResult", "getBehaviorAIResult", "getAIAnslyseData"];
let params = tabIndex == 2 ? { let params =
type: tabIndex + 1, tabIndex == 2
timeDimension: timeDimension + 1, ? {
startDate: startStr, type: tabIndex + 1,
endDate: endStr timeDimension: timeDimension + 1,
} : { startDate: startStr,
bizs: sceneTabIndex > 0 ? sceneMaps[sceneTabIndex] : undefined, endDate: endStr,
dateType: timeDimension, }
startDate: startStr, : {
endDate: endStr bizs: sceneTabIndex > 0 ? sceneMaps[sceneTabIndex] : undefined,
} dateType: timeDimension,
this.setData({AILoading: true, AIContent: ''}) startDate: startStr,
api[apievents[tabIndex]](params).then(res => { endDate: endStr,
this.setData({AILoading: false}) };
let { code, data, message } = res this.setData({ AILoading: true, AIContent: "" });
if (code == 0) { api[apievents[tabIndex]](params)
if (tabIndex == 2) { .then((res) => {
this.setData({ this.setData({ AILoading: false });
AIContent: data?.aiGenerateResult ? `${JSON.parse(data?.aiGenerateResult).current_analysis}${JSON.parse(data?.aiGenerateResult).suggestions}` : '', let { code, data, message } = res;
}) if (code == 0) {
if (tabIndex == 2) {
this.setData({
AIContent: data?.aiGenerateResult ? `${JSON.parse(data?.aiGenerateResult).current_analysis}${JSON.parse(data?.aiGenerateResult).suggestions}` : "",
});
} else {
this.setData({
AIContent: data?.aiAnalysisSuggestion ? `${JSON.parse(data?.aiAnalysisSuggestion).current_analysis}${JSON.parse(data?.aiAnalysisSuggestion).suggestions}` : "",
});
}
} else { } else {
this.setData({ wx.$util.showToast(message);
AIContent: data?.aiAnalysisSuggestion ? `${JSON.parse(data?.aiAnalysisSuggestion).current_analysis}${JSON.parse(data?.aiAnalysisSuggestion).suggestions}` : '',
})
} }
})
} else { .catch(() => {
wx.$util.showToast(message) this.setData({ AILoading: false });
} });
}).catch(() => {
this.setData({AILoading: false})
})
}, },
getTrainingStaticsData() { getTrainingStaticsData() {
let { sceneTabIndex, startStr, endStr, sortField, sortOrder, timeDimension } = this.data let { sceneTabIndex, startStr, endStr, sortField, sortOrder, timeDimension } = this.data;
api.getDashboardData({ api
bizs: sceneTabIndex > 0 ? sceneMaps[sceneTabIndex] : undefined, .getDashboardData({
dateType: timeDimension, bizs: sceneTabIndex > 0 ? sceneMaps[sceneTabIndex] : undefined,
startDate: startStr, dateType: timeDimension,
endDate: endStr, startDate: startStr,
sortField: 1, endDate: endStr,
sortDirection: 1 sortField: 1,
}).then(res => { sortDirection: 1,
let { code, data, message } = res })
if (code == 0) { .then((res) => {
if (data?.metrics) { let { code, data, message } = res;
data.metrics.staffCount = (data.metrics.staffCount ?? '') === '' ? '-' : this.formatThousands(data.metrics.staffCount) if (code == 0) {
data.metrics.storeCount = (data.metrics.storeCount ?? '') === '' ? '-' : this.formatThousands(data.metrics.storeCount) if (data?.metrics) {
data.metrics.totalOutput = (data.metrics.totalOutput ?? '') === '' ? '-' : this.formatThousands(data.metrics.totalOutput) data.metrics.staffCount = (data.metrics.staffCount ?? "") === "" ? "-" : this.formatThousands(data.metrics.staffCount);
data.metrics.storeCount = (data.metrics.storeCount ?? "") === "" ? "-" : this.formatThousands(data.metrics.storeCount);
data.metrics.totalOutput = (data.metrics.totalOutput ?? "") === "" ? "-" : this.formatThousands(data.metrics.totalOutput);
}
this.setData({
staticData: data?.metrics,
});
} else {
wx.$util.showToast(message);
} }
this.setData({ });
staticData: data?.metrics
})
} else {
wx.$util.showToast(message)
}
})
}, },
getEmployeeRank(noAI) { getEmployeeRank(noAI) {
let { tabIndex, sceneTabIndex, startStr, endStr, sortField, sortOrder, timeDimension } = this.data let { tabIndex, sceneTabIndex, startStr, endStr, sortField, sortOrder, timeDimension } = this.data;
const sortComp = this.selectComponent('#employee-ranking') const sortComp = this.selectComponent("#employee-ranking");
if (sortComp) { if (sortComp) {
sortComp.clear() sortComp.clear();
} }
this.setData({ this.setData({
employeeList: [] employeeList: [],
}) });
const event = ['getDashboardData', 'getDashboardBehavior', 'getTrainingStaffList'] const event = ["getDashboardData", "getDashboardBehavior", "getTrainingStaffList"];
let params = tabIndex == 2 ? { let params =
businessType: sceneTabIndex > 0 ? sceneMaps[sceneTabIndex] : undefined, tabIndex == 2
startDate: startStr, ? {
endDate: endStr, businessType: sceneTabIndex > 0 ? sceneMaps[sceneTabIndex] : undefined,
sortField, startDate: startStr,
sortOrder endDate: endStr,
} : { sortField,
bizs: sceneTabIndex > 0 ? sceneMaps[sceneTabIndex] : undefined, sortOrder,
dateType: timeDimension, }
startDate: startStr, : {
endDate: endStr, bizs: sceneTabIndex > 0 ? sceneMaps[sceneTabIndex] : undefined,
sortField, dateType: timeDimension,
sortDirection: sortOrder startDate: startStr,
} endDate: endStr,
wx.$util.showLoading() sortField,
api[event[tabIndex]](params).then(res => { sortDirection: sortOrder,
wx.$util.hideLoading() };
let { code, data, message } = res wx.$util.showLoading();
api[event[tabIndex]](params).then((res) => {
wx.$util.hideLoading();
let { code, data, message } = res;
if (code == 0) { if (code == 0) {
if (data?.metrics) { if (data?.metrics) {
data.metrics.staffCount = (data.metrics.staffCount ?? '') === '' ? '-' : this.formatThousands(data.metrics.staffCount) data.metrics.staffCount = (data.metrics.staffCount ?? "") === "" ? "-" : this.formatThousands(data.metrics.staffCount);
data.metrics.storeCount = (data.metrics.storeCount ?? '') === '' ? '-' : this.formatThousands(data.metrics.storeCount) data.metrics.storeCount = (data.metrics.storeCount ?? "") === "" ? "-" : this.formatThousands(data.metrics.storeCount);
data.metrics.totalOutput = (data.metrics.totalOutput ?? '') === '' ? '-' : this.formatThousands(data.metrics.totalOutput) data.metrics.totalOutput = (data.metrics.totalOutput ?? "") === "" ? "-" : this.formatThousands(data.metrics.totalOutput);
} }
switch(tabIndex) { switch (tabIndex) {
case 0: case 0:
this.setData({ this.setData({
staticData: data?.metrics, staticData: data?.metrics,
employeeList: data?.employeeList || [] employeeList: data?.employeeList || [],
}) });
break break;
case 1: case 1:
this.setData({ this.setData({
staticData: data?.metrics, staticData: data?.metrics,
employeeList: data?.employeeList || [] employeeList: data?.employeeList || [],
}) });
break break;
case 2: case 2:
data?.forEach(val => { data?.forEach((val) => {
val.employeePhone = val.phone val.employeePhone = val.phone;
}) });
this.setData({ this.setData({
employeeList: data || [] employeeList: data || [],
}) });
} }
} else { } else {
wx.$util.showToast(message) wx.$util.showToast(message);
} }
}) });
},
handleNavigatePerformance(e) {
const { key } = e.currentTarget.dataset;
const urlMap = {
staffCount: "/packageIndex/pages/stationStaffPerformance/stationStaffPerformance",
storeCount: "/packageIndex/pages/storePerformance/storePerformance",
shopCount: "/packageIndex/pages/storePerformance/storePerformance",
};
const url = urlMap[key];
if (!url) return;
wx.navigateTo({ url });
}, },
// 跳转员工个人看板 // 跳转员工个人看板
onEmployeeTap(e) { onEmployeeTap(e) {
const employee = e.detail.employee const employee = e.detail.employee;
wx.$track.setTrackData(0, 'supervisor_staffDetail', {}, '') wx.$track.setTrackData(0, "supervisor_staffDetail", {}, "");
let { startStr, endStr, timeDimension, sceneTabIndex } = this.data let { startStr, endStr, timeDimension, sceneTabIndex } = this.data;
let query = { let query = {
...employee, ...employee,
scene: sceneTabIndex > 0 ? sceneMaps[sceneTabIndex] : '', scene: sceneTabIndex > 0 ? sceneMaps[sceneTabIndex] : "",
startDate: startStr, startDate: startStr,
endDate: endStr, endDate: endStr,
timeDimension: timeDimension timeDimension: timeDimension,
} };
const encoded = encodeURIComponent(JSON.stringify(query)) const encoded = encodeURIComponent(JSON.stringify(query));
wx.navigateTo({ wx.navigateTo({
url: `/packageCrew/pages/peopleOverview/peopleOverview?query=${encoded}`, url: `/packageCrew/pages/peopleOverview/peopleOverview?query=${encoded}`,
}) });
}, },
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
}, /**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/** /**
* 页面上拉触底事件的处理函数 * 生命周期函数--监听页面卸载
*/ */
onReachBottom() { onUnload() {},
}, /**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/** /**
* 用户点击右上角分享 * 页面上拉触底事件的处理函数
*/ */
onShareAppMessage() { onReachBottom() {},
} /**
}) * 用户点击右上角分享
*/
onShareAppMessage() {},
});
...@@ -7,38 +7,61 @@ ...@@ -7,38 +7,61 @@
</view> </view>
</navigation-bar> </navigation-bar>
<view class="bg"></view> <view class="bg"></view>
<view class="container" scroll-y style="padding-top: {{navBarHeight}}px;"> <view class="container"
scroll-y
style="padding-top: {{ navBarHeight }}px;">
<view class="top-box"> <view class="top-box">
<view class="tab"> <view class="tab">
<view class="tab-item {{tabIndex == index ? 'active' : ''}}" bindtap="changeTab" data-target="{{item}}" wx:for="{{tabList}}" wx:key="index">{{item.text}}</view> <view class="tab-item {{ tabIndex == index ? 'active' : '' }}"
bindtap="changeTab"
data-target="{{ item }}"
wx:for="{{ tabList }}"
wx:key="index">
{{ item.text }}
</view>
</view> </view>
<view class="scene-tab"> <view class="scene-tab">
<view class="scene-tab-item {{sceneTabIndex == index ? 'active' : ''}}" wx:for="{{sceneTabList}}" wx:key="index" bindtap="changeSceneTab" data-target="{{item}}"> <view class="scene-tab-item {{ sceneTabIndex == index ? 'active' : '' }}"
<image wx:if="{{sceneTabIndex == index}}" src="{{IMG_URL}}{{item.icon}}.png" mode=""/> wx:for="{{ sceneTabList }}"
{{item.text}} wx:key="index"
bindtap="changeSceneTab"
data-target="{{ item }}">
<image wx:if="{{ sceneTabIndex == index }}"
src="{{ IMG_URL }}{{ item.icon }}.png"
mode="" />
{{ item.text }}
</view> </view>
</view> </view>
<view class="date"> <view class="date">
<date-screen id="date" bind:search="search" setTrackData="{{true}}"></date-screen> <date-screen id="date"
bind:search="search"
setTrackData="{{ true }}"></date-screen>
</view> </view>
</view> </view>
<scroll-view scroll-y style="height: calc(100% - {{topBoxHeight}}px);"> <scroll-view scroll-y style="height: calc(100% - {{ topBoxHeight }}px);">
<view class="static-info"> <view class="static-info">
<view class="static-item" style="flex: {{item.width}}rpx 0 0;background: {{item.background}};" wx:for="{{staticList}}" wx:key="index"> <view class="static-item"
<view class="label">{{item.label}}</view> wx:for="{{ staticList }}"
<view class="value">{{staticData[item.key]}}</view> style="flex: {{ item.width }}rpx 0 0;background: {{ item.background }};"
data-key="{{ item.key }}"
bind:tap="handleNavigatePerformance"
wx:key="index">
<view class="label">
{{ item.label }}
</view>
<view class="value">
{{ staticData[item.key] }}
</view>
</view> </view>
</view> </view>
<AI-analyse AIContent="{{AIContent}}" loading="{{AILoading}}" /> <AI-analyse AIContent="{{ AIContent }}" loading="{{ AILoading }}" />
<employee-ranking <employee-ranking id="employee-ranking"
id="employee-ranking" title-icon="{{ IMG_URL }}staff-rank.png"
title-icon="{{IMG_URL}}staff-rank.png" mode="{{ mode }}"
mode="{{mode}}" scene="{{ sceneTabIndex }}"
scene="{{sceneTabIndex}}" employee-list="{{ employeeList }}"
employee-list="{{employeeList}}" local-sort="{{ false }}"
local-sort="{{false}}" bind:sortChange="onEmployeeSortChange"
bind:sortChange="onEmployeeSortChange" bind:employeeTap="onEmployeeTap" />
bind:employeeTap="onEmployeeTap"
/>
</scroll-view> </scroll-view>
</view> </view>
import api from '~/api/index/index' import api from "~/api/index/index";
import dayjs from 'dayjs' import dayjs from "dayjs";
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/";
let timeoutId let timeoutId;
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
IMG_URL, IMG_URL,
navBarHeight: 84, navBarHeight: 84,
navStyle: 'background-color: rgba(0,0,0,0);', navStyle: "background-color: rgba(0,0,0,0);",
navTitleStyle: 'font-weight: 600; font- size: 32rpx; color: #000;', navTitleStyle: "font-weight: 600; font- size: 32rpx; color: #000;",
userInfo: {}, userInfo: {},
staticList: [{ staticList: [
label: '驻店人员', {
width: '208', label: "驻店人员",
key: 'staffCount', width: "208",
background: 'linear-gradient(90deg, #42CCCF 0%, #36D9A5 100%)' key: "staffCount",
}, { background: "linear-gradient(90deg, #42CCCF 0%, #36D9A5 100%)",
label: '门店数量', },
width: '192', {
key: 'shopCount', label: "门店数量",
background: 'linear-gradient(90deg, #5E69FF 0%, #4079FF 100%)' width: "192",
}, { key: "shopCount",
label: '总产值', background: "linear-gradient(90deg, #5E69FF 0%, #4079FF 100%)",
key: 'totalValue', },
background: 'linear-gradient(90deg, #3D76FC 0%, #4DA6FF 100%)' {
}], label: "总产值",
tabList: [{ key: "totalValue",
text: '每日任务', background: "linear-gradient(90deg, #3D76FC 0%, #4DA6FF 100%)",
count: 0, },
key: 'dailyCount' ],
}, { tabList: [
text: '本周任务', {
count: 0, text: "每日任务",
key: 'weeklyCount' count: 0,
}, { key: "dailyCount",
text: '月度任务', },
count: 0, {
key: 'monthlyCount' text: "本周任务",
}, { count: 0,
text: '专项任务', key: "weeklyCount",
count: 0, },
key: 'specialCount' {
}], text: "月度任务",
count: 0,
key: "monthlyCount",
},
{
text: "专项任务",
count: 0,
key: "specialCount",
},
],
tabIndex: 0, tabIndex: 0,
statusMap: { statusMap: {
0: {name: '待完成', color: '#2C66F7', background: '#2c66f71a'}, 0: { name: "待完成", color: "#2C66F7", background: "#2c66f71a" },
1: {name: '进行中', color: '#FF9D0A', background: '#ff9d0a1a'}, 1: { name: "进行中", color: "#FF9D0A", background: "#ff9d0a1a" },
2: {name: '已完成', color: '#35C376', background: '#35c3761a'}, 2: { name: "已完成", color: "#35C376", background: "#35c3761a" },
}, },
missionMap: { missionMap: {
3: {name: '录音复盘'}, 3: { name: "录音复盘" },
5: {name: '人员带教'}, 5: { name: "人员带教" },
0: {name: '督导日报'}, 0: { name: "督导日报" },
1: {name: '本周复盘'}, 1: { name: "本周复盘" },
2: {name: '督导月度计划'}, 2: { name: "督导月度计划" },
4: {name: '专项任务'}, 4: { name: "专项任务" },
6: {name: '提报优秀案例录音'}, 6: { name: "提报优秀案例录音" },
7: {name: '带教要求'} 7: { name: "带教要求" },
}, },
list: [], list: [],
scrollTop: 0, scrollTop: 0,
showIcon1: true showIcon1: true,
}, subTabIndex: 1,
onTabItemTap(e) { },
// 点击埋点 onTabItemTap(e) {
wx.$track.setTrackData(0, 'supervisor_index_page', {}, '') // 点击埋点
}, wx.$track.setTrackData(0, "supervisor_index_page", {}, "");
navbarReady(e) { },
let navBarHeight = e.detail.height navbarReady(e) {
this.setData({ let navBarHeight = e.detail.height;
navBarHeight this.setData({
}) navBarHeight,
});
}, },
onScroll(e) { onScroll(e) {
this.setData({ this.setData({
scrollTop: e.detail.scrollTop scrollTop: e.detail.scrollTop,
}) });
const {navBarHeight} = this.data const { navBarHeight } = this.data;
const query = wx.createSelectorQuery().in(this) const query = wx.createSelectorQuery().in(this);
query.select('.data-container').boundingClientRect() query.select(".data-container").boundingClientRect();
query.exec(res => { query.exec((res) => {
this.setData({ this.setData({
isSticky: res[0].top <= navBarHeight isSticky: res[0].top <= navBarHeight,
}) });
}) });
// 滚动时隐藏第一个图标,显示第二个图标 // 滚动时隐藏第一个图标,显示第二个图标
this.setData({ this.setData({
showIcon1: false showIcon1: false,
}) });
// 清除之前的定时器 // 清除之前的定时器
if (timeoutId) { if (timeoutId) {
clearTimeout(timeoutId) clearTimeout(timeoutId);
} }
// 设置一个定时器,在滚动停止后一定时间后恢复两个图标的显示状态 // 设置一个定时器,在滚动停止后一定时间后恢复两个图标的显示状态
timeoutId = setTimeout(() => { timeoutId = setTimeout(() => {
this.setData({ this.setData({
showIcon1: true showIcon1: true,
}) });
}, 1000) // 在这里设置等待的时间,单位是毫秒 }, 1000); // 在这里设置等待的时间,单位是毫秒
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo();
this.setData({userInfo}) this.setData({ userInfo });
this.getTabData(true) this.getTabData(true);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面初次渲染完成
*/ */
onShow () { onReady: function () {},
this.getTabData() /**
this.getStaticData() * 生命周期函数--监听页面显示
this.setData({ */
list: [], onShow() {
pageNum: 1, this.getTabData();
flag: false, this.getStaticData();
nothing: false this.setData(
}, () => { {
this.getList(true) list: [],
}) pageNum: 1,
flag: false,
nothing: false,
},
() => {
this.getList(true);
},
);
}, },
getTabData(loadFlag) { getTabData(loadFlag) {
let { tabIndex, tabList, startStr, endStr } = this.data let { tabIndex, tabList, startStr, endStr } = this.data;
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo();
let params = { let params = {
supervisorPhone: userInfo?.phone, supervisorPhone: userInfo?.phone,
startDate: loadFlag ? undefined : startStr, startDate: loadFlag ? undefined : startStr,
endDate: loadFlag ? undefined : endStr endDate: loadFlag ? undefined : endStr,
} };
api.getTaskTabData(params).then(res => { api.getTaskTabData(params).then((res) => {
let { code, data, message } = res let { code, data, message } = res;
if (code == 0) { if (code == 0) {
if (loadFlag) { if (loadFlag) {
tabList?.forEach(val => { tabList?.forEach((val) => {
val.count = data[val.key] > 99 ? '99+' : data[val.key] val.count = data[val.key] > 99 ? "99+" : data[val.key];
}) });
this.setData({ this.setData({
tabList tabList,
}) });
} else { } else {
// 仅更新当前选中tab数量 // 仅更新当前选中tab数量
let key = tabList[tabIndex].key let key = tabList[tabIndex].key;
this.setData({ this.setData({
[`tabList[${tabIndex}].count`]: data[key] > 99 ? '99+' : data[key] [`tabList[${tabIndex}].count`]: data[key] > 99 ? "99+" : data[key],
}) });
} }
} else { } else {
wx.$util.showToast(message) wx.$util.showToast(message);
} }
}) });
}, },
handleMentoring() { handleMentoring() {
wx.$track.setTrackData(0, `supervisor_start_mentoring_index`, {}, '') wx.$track.setTrackData(0, `supervisor_start_mentoring_index`, {}, "");
wx.navigateTo({ wx.navigateTo({
url: `/packageCrew/pages/mentoring/mentoring`, url: `/packageCrew/pages/mentoring/mentoring`,
}) });
},
formatThousands(v) {
const s = String(v);
if (!s) return s;
const isNeg = s[0] === "-";
const raw = isNeg ? s.slice(1) : s;
const [intPart, decPart] = raw.split(".");
const intFmt = String(intPart || "0").replace(/\B(?=(\d{3})+(?!\d))/g, ",");
const res = decPart ? `${intFmt}.${decPart}` : intFmt;
return isNeg ? `-${res}` : res;
}, },
formatThousands (v) { toDateTimeStart(dateStr) {
const s = String(v) if (!dateStr) return undefined;
if (!s) return s const s = String(dateStr).trim();
const isNeg = s[0] === '-' if (!s) return undefined;
const raw = isNeg ? s.slice(1) : s if (s.includes(":")) return s;
const [intPart, decPart] = raw.split('.') return `${s} 00:00:00`;
const intFmt = String(intPart || '0').replace(/\B(?=(\d{3})+(?!\d))/g, ',') },
const res = decPart ? `${intFmt}.${decPart}` : intFmt
return isNeg ? `-${res}` : res toDateTimeEnd(dateStr) {
if (!dateStr) return undefined;
const s = String(dateStr).trim();
if (!s) return undefined;
if (s.includes(":")) return s;
return `${s} 23:59:59`;
}, },
getStaticData() { getStaticData() {
api.getSupervisorStaticData({}).then(res => { api.getSupervisorStaticData({}).then((res) => {
let { code, data, message } = res let { code, data, message } = res;
if (code == 0) { if (code == 0) {
data.staffCount = (data.staffCount ?? '') === '' ? '-' : this.formatThousands(data.staffCount) data.staffCount = (data.staffCount ?? "") === "" ? "-" : this.formatThousands(data.staffCount);
data.shopCount = (data.shopCount ?? '') === '' ? '-' : this.formatThousands(data.shopCount) data.shopCount = (data.shopCount ?? "") === "" ? "-" : this.formatThousands(data.shopCount);
data.totalValue = (data.totalValue ?? '') === '' ? '-' : this.formatThousands(data.totalValue) data.totalValue = (data.totalValue ?? "") === "" ? "-" : this.formatThousands(data.totalValue);
this.setData({staticData: data}) this.setData({ staticData: data });
} else { } else {
wx.$util.showToast(message) wx.$util.showToast(message);
} }
}) });
}, },
handleNavigatePerformance(e) {
const { key } = e.currentTarget.dataset;
const urlMap = {
staffCount: "/packageIndex/pages/stationStaffPerformance/stationStaffPerformance",
shopCount: "/packageIndex/pages/storePerformance/storePerformance",
storeCount: "/packageIndex/pages/storePerformance/storePerformance",
};
const url = urlMap[key];
if (!url) return;
wx.navigateTo({ url });
},
tabClick(e) { tabClick(e) {
let eventCode = ['supervisor_dayTask_tab', 'supervisor_weeklyTask_tab', 'supervisor_monthlyTask_tab', 'supervisor_specificTask_tab'] let eventCode = ["supervisor_dayTask_tab", "supervisor_weeklyTask_tab", "supervisor_monthlyTask_tab", "supervisor_specificTask_tab"];
// 点击埋点 // 点击埋点
wx.$track.setTrackData(0, eventCode[e.detail], {}, '') wx.$track.setTrackData(0, eventCode[e.detail], {}, "");
this.setData({ const nextTabIndex = e.detail;
tabIndex: e.detail const nextSubTabIndex = nextTabIndex === 3 ? this.data.subTabIndex : 0;
}) this.setData(
{
tabIndex: nextTabIndex,
subTabIndex: nextSubTabIndex,
list: [],
pageNum: 1,
flag: false,
nothing: false,
total: 0,
},
() => {
this.getList(true);
this.getTabData();
},
);
},
switchSpecialCenter(e) {
const idx = Number(e.currentTarget?.dataset?.index);
if (Number.isNaN(idx)) return;
if (idx === this.data.subTabIndex) return;
this.setData(
{
subTabIndex: idx,
list: [],
pageNum: 1,
flag: false,
nothing: false,
total: 0,
},
() => {
this.getList(true);
this.getTabData()
},
);
}, },
jump(e) { jump(e) {
const { target } = e.currentTarget.dataset const { target } = e.currentTarget.dataset;
const pageUrl = { const pageUrl = {
3: '/packageIndex/pages/recordingReview/recordingReview', 3: "/packageIndex/pages/recordingReview/recordingReview",
5: '/packageCrew/pages/mentoring/mentoring', 5: "/packageCrew/pages/mentoring/mentoring",
0: '/packageIndex/pages/dailySupervisionReport/dailySupervisionReport', 0: "/packageIndex/pages/dailySupervisionReport/dailySupervisionReport",
1: '/packageIndex/pages/weeklyReview/weeklyReview', 1: "/packageIndex/pages/weeklyReview/weeklyReview",
2: '/packageIndex/pages/monthlyPlan/monthlyPlan', 2: "/packageIndex/pages/monthlyPlan/monthlyPlan",
4: '/packageIndex/pages/specialTask/specialTask', 4: "/packageIndex/pages/specialTask/specialTask",
6: '/packageIndex/pages/caseAudioList/caseAudioList', 6: "/packageIndex/pages/caseAudioList/caseAudioList",
7: '/packageIndex/pages/mentorRequirements/mentorRequirements' 7: "/packageIndex/pages/mentorRequirements/mentorRequirements",
} };
const eventCode = { const eventCode = {
3: {view: 'supervisor_recording_view', execute: 'supervisor_recording_execute'}, 3: { view: "supervisor_recording_view", execute: "supervisor_recording_execute" },
5: {view: 'supervisor_mentoring_view', execute: 'supervisor_mentoring_execute'}, 5: { view: "supervisor_mentoring_view", execute: "supervisor_mentoring_execute" },
0: {view: 'supervisor_report_view', execute: 'supervisor_report_execute'}, 0: { view: "supervisor_report_view", execute: "supervisor_report_execute" },
1: {view: 'supervisor_weeklyReview_view', execute: 'supervisor_weeklyReview_execute'}, 1: { view: "supervisor_weeklyReview_view", execute: "supervisor_weeklyReview_execute" },
2: {view: 'supervisor_monthlyPlan_view', execute: 'supervisor_monthlyPlan_execute'}, 2: { view: "supervisor_monthlyPlan_view", execute: "supervisor_monthlyPlan_execute" },
4: {view: 'supervisor_specificTask_view', execute: 'supervisor_specificTask_execute'}, 4: { view: "supervisor_specificTask_view", execute: "supervisor_specificTask_execute" },
6: {view: 'supervisor_caseAudioList_view', execute: 'supervisor_caseAudioList_view'}, 6: { view: "supervisor_caseAudioList_view", execute: "supervisor_caseAudioList_view" },
7: {view: 'supervisor_mentorRequirements_view', execute: 'supervisor_mentorRequirements_view'} 7: { view: "supervisor_mentorRequirements_view", execute: "supervisor_mentorRequirements_view" },
} };
let status = target.taskStatus != 2 ? 'execute' : 'view' let status = target.taskStatus != 2 ? "execute" : "view";
wx.$track.setTrackData(0, eventCode[target.taskType][status], {}, '') wx.$track.setTrackData(0, eventCode[target.taskType][status], {}, "");
wx.navigateTo({ wx.navigateTo({
url: `${pageUrl[target.taskType]}?taskStatus=${target.taskStatus}&id=${target.id}`, url: `${pageUrl[target.taskType]}?taskStatus=${target.taskStatus}&id=${target.id}`,
}) });
},
// 专项带教
jumpTaskCenter(e) {
const { target } = e.currentTarget.dataset || {};
if (!target) return;
const taskStatus = target.taskStatus;
// 专项带教埋点
wx.$track.setTrackData(0, `${taskStatus == 2 ? 'view_special_mentoring' : 'assignee_special_mentoring'}`, {}, "")
const qs = `taskId=${encodeURIComponent(target.taskId)}${taskStatus === null || taskStatus === undefined ? "" : `&taskStatus=${encodeURIComponent(taskStatus)}`}`;
wx.navigateTo({
url: `/packageCrew/pages/specialMentoring/specialMentoring?${qs}`,
});
}, },
search(e) { search(e) {
this.setData({ this.setData(
list: [], {
pageNum: 1, list: [],
flag: false, pageNum: 1,
nothing: false, flag: false,
startStr: e.detail.startDay?.replace(/\//g, '-'), nothing: false,
endStr: e.detail.endDay?.replace(/\//g, '-') startStr: e.detail.startDay?.replace(/\//g, "-"),
}, () => { endStr: e.detail.endDay?.replace(/\//g, "-"),
this.getList(true) },
this.getTabData() () => {
}) this.getList(true);
this.getTabData();
},
);
}, },
scrollonReachBottom() { scrollonReachBottom() {
this.getList() this.getList();
}, },
// 获取列表数据 // 获取列表数据
getList(repload) { getList(repload) {
let { pageNum, nothing, startStr, endStr, tabIndex, topBoxHeight, scrollTop } = this.data let { pageNum, nothing, startStr, endStr, tabIndex, topBoxHeight, scrollTop, subTabIndex } = this.data;
if (nothing) return if (nothing) return;
const taskList = [[0, 3, 5], [6, 7], [2], [4]] const taskList = [[0, 3, 5], [6, 7], [2], [4]];
wx.$util.showLoading() wx.$util.showLoading();
let params = { let params =
taskTypeList: taskList[tabIndex], tabIndex == 3 && subTabIndex == 0
startDate: startStr, ? {
endDate: endStr, pageNum,
pageNum, pageSize: 10,
pageSize: 10 bizType: "spec-coach",
} startDate: startStr,
api.getMissionList(params).then(res => { endDate: endStr,
wx.$util.hideLoading() }
let total = 0 : {
let list = [] taskTypeList: taskList[tabIndex],
let { startDate: startStr,
code, endDate: endStr,
data, pageNum,
message pageSize: 10,
} = res };
data?.list?.forEach(val => { let requestEvent = tabIndex == 3 && subTabIndex == 0 ? "getTaskCenterPageData" : "getMissionList";
val.updatedDate = val.updatedDate ? dayjs(val.updatedDate).format('YYYY-MM-DD HH:mm:ss') : '' api[requestEvent](params).then((res) => {
val.createTime = val.createTime ? dayjs(val.createTime).format('YYYY-MM-DD HH:mm:ss') : '' wx.$util.hideLoading();
}) let total = 0;
if (code == 0) { let list = [];
list = data.list let { code, data, message } = res;
total = data.total data?.list?.forEach((val) => {
} else { val.updatedDate = val.updatedDate ? dayjs(val.updatedDate).format("YYYY-MM-DD HH:mm:ss") : "";
wx.$util.showToast(message) val.createTime = val.createTime ? dayjs(val.createTime).format("YYYY-MM-DD HH:mm:ss") : "";
} if (tabIndex == 3 && subTabIndex == 0) {
if (total != 0) { val.taskStatus = val.status === "UNFINISHED" ? 0 : 2;
this.setData({ if (val.completeTime) val.completeTime = dayjs(val.completeTime).format("YYYY-MM-DD HH:mm:ss");
[`list[${pageNum - 1}]`]: list }
}) });
if (code == 0) {
list = data.list;
total = data.total;
} else {
wx.$util.showToast(message);
}
if (total != 0) {
this.setData({
[`list[${pageNum - 1}]`]: list,
});
} }
// if (repload) { // if (repload) {
// const query = wx.createSelectorQuery().in(this) // const query = wx.createSelectorQuery().in(this)
...@@ -300,35 +399,33 @@ Page({ ...@@ -300,35 +399,33 @@ Page({
// } // }
// }) // })
// } // }
this.setData({ this.setData({
total, total,
flag: true, flag: true,
triggered: false, triggered: false,
pageNum: pageNum + 1, pageNum: pageNum + 1,
nothing: pageNum == data?.pages nothing: pageNum == data?.pages,
}) });
}) });
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { onHide: function () {},
},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function () {},
},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () {}, onPullDownRefresh: function () {},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () {}, onShareAppMessage: function () {},
onShareTimeline: function () {} onShareTimeline: function () {},
}) });
...@@ -73,12 +73,53 @@ page { ...@@ -73,12 +73,53 @@ page {
} }
} }
} }
.count-row {
display: flex;
align-items: center;
justify-content: space-between;
background: #F2F3F7;
padding: 16rpx 24rpx;
}
.number { .number {
height: 30rpx; height: 30rpx;
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
background: #F2F3F7; }
padding: 16rpx 24rpx;
.sub-tab {
display: flex;
align-items: center;
gap: 24rpx;
padding: 8rpx;
border-radius: 16rpx;
background: #FFFFFF;
}
.center-switch {
display: flex;
align-items: center;
padding: 4rpx 8rpx;
border-radius: 8rpx;
&.active {
background: #E7EDFE;
}
}
.center-switch__text {
font-size: 26rpx;
color: #292D33;
&.active {
color: #2C66F7;
font-weight: 600;
}
}
.center-switch__icon {
font-size: 26rpx;
color: #BEC1C7;
line-height: 1;
margin: 0 6rpx;
} }
.content-box { .content-box {
padding: 0 24rpx; padding: 0 24rpx;
...@@ -232,4 +273,4 @@ page { ...@@ -232,4 +273,4 @@ page {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
} }
}
\ No newline at end of file \ No newline at end of file
}
<!--pages/tab/index/index.wxml--> <!--pages/tab/index/index.wxml-->
<navigation-bar bindnavbarReady="navbarReady" <navigation-bar bindnavbarReady="navbarReady"
class="navigation-header" class="navigation-header"
navStyle="background-color:{{isSticky ? '#FFFFFF' : 'transparent'}};box-shadow:none;"> navStyle="background-color:{{ isSticky ? '#FFFFFF' : 'transparent' }};box-shadow:none;">
<view class="page-title"> <view class="page-title">
工作台 工作台
</view> </view>
</navigation-bar> </navigation-bar>
<view class="bg" wx:if="{{!isSticky}}"></view> <view class="bg" wx:if="{{ !isSticky }}"></view>
<scroll-view class="container" scroll-y enable-back-to-top <scroll-view class="container"
scroll-top="{{setScrollTop}}" scroll-y
bind:scroll="onScroll" enable-back-to-top
bindrefresherrefresh="search" scroll-top="{{ setScrollTop }}"
bindscrolltolower="scrollonReachBottom" bind:scroll="onScroll"
enhanced="{{true}}" bind:refresherrefresh="search"
show-scrollbar="{{false}}" style="padding-top: {{navBarHeight}}px;"> bind:scrolltolower="scrollonReachBottom"
enhanced="{{ true }}"
show-scrollbar="{{ false }}"
style="padding-top: {{ navBarHeight }}px;">
<view class="top-box"> <view class="top-box">
<view class="user-info"> <view class="user-info">
<image src="{{IMG_URL}}default-avatar.png" /> <image src="{{ IMG_URL }}default-avatar.png" />
<view>督导{{userInfo.name}}</view> <view>
督导{{ userInfo.name }}
</view>
</view> </view>
<view class="static-info"> <view class="static-info">
<view class="static-item" style="flex: {{item.width}}rpx 0 0;background: {{item.background}};" wx:for="{{staticList}}" wx:key="index"> <view wx:for="{{ staticList }}"
<view class="label">{{item.label}}</view> wx:key="{{ item.key }}"
<view class="value">{{staticData[item.key]}}</view> class="static-item"
style="flex: {{ item.width }}rpx 0 0;background: {{ item.background }};"
data-key="{{ item.key }}"
bind:tap="handleNavigatePerformance">
<view class="label">
{{ item.label }}
</view>
<view class="value">
{{ staticData[item.key] }}
</view>
</view> </view>
</view> </view>
</view> </view>
<view class="data-container"> <view class="data-container">
<view class="sticky-box {{isSticky ? 'is-sticky' : ''}}"> <view class="sticky-box {{ isSticky ? 'is-sticky' : '' }}">
<view class="tab-box"> <view class="tab-box">
<tab-bar tabList="{{ tabList }}" badge="{{true}}" bindclick="tabClick" activeIndex="{{ tabIndex }}" /> <tab-bar tabList="{{ tabList }}"
badge="{{ true }}"
bind:click="tabClick"
activeIndex="{{ tabIndex }}" />
</view> </view>
<view class="date"> <view class="date">
<date-screen tabSelected="{{tabIndex}}" isSticky="{{isSticky}}" bind:search="search"></date-screen> <date-screen tabSelected="{{ tabIndex }}"
isSticky="{{ isSticky }}"
bind:search="search"></date-screen>
</view>
<view class="count-row">
<view class="number">
共{{ total || 0 }}条任务
</view>
<view class="sub-tab" wx:if="{{ tabIndex == 3 }}">
<view class="center-switch {{ subTabIndex == 0 ? 'active' : '' }}"
catchtap="switchSpecialCenter"
data-index="0">
<text class="center-switch__text {{ subTabIndex == 0 ? 'active' : '' }}">任务中心</text>
</view>
<text class="center-switch__icon">⇄</text>
<view class="center-switch {{ subTabIndex == 1 ? 'active' : '' }}"
catchtap="switchSpecialCenter"
data-index="1">
<text class="center-switch__text {{ subTabIndex == 1 ? 'active' : '' }}">策略中心</text>
</view>
</view>
</view> </view>
<view class="number">共{{total || 0}}条任务</view>
</view> </view>
<view class="content-box"> <view class="content-box">
<view class="list"> <view class="list">
<block wx:if="{{ list.length > 0 }}"> <block wx:if="{{ list.length > 0 }}">
<block wx:for="{{ list }}" wx:for-item="val" wx:for-index="sIndex" wx:key="sIndex"> <block wx:for="{{ list }}"
<block wx:for="{{val}}" wx:key="index"> wx:for-item="val"
<view class="item content"> wx:for-index="sIndex"
wx:key="sIndex">
<block wx:for="{{ val }}" wx:key="index">
<view class="item content">
<block wx:if="{{ tabIndex == 3 && subTabIndex == 0 }}">
<view class="item-top">
<view class="status text-center"
style="color: {{ statusMap[item.taskStatus].color }}; background-color: {{ statusMap[item.taskStatus].background }};">
{{ statusMap[item.taskStatus].name }}
</view>
<view class="name">
专项带教
</view>
</view>
<view class="list-item">
<image class="icon"
src="{{ IMG_URL }}special-task-merchant.png"
mode="" />
<view class="label">
归属门店:
</view>
<view class="text-hide">
{{ item.taskMerchantName || '-' }}
</view>
</view>
<view class="list-item">
<image class="icon"
src="{{ IMG_URL }}time-icon.png"
mode="" />
<view class="label">
完成时间:
</view>
<view wx:if="{{ item.taskStatus == 2 }}">
{{ item.completeTime || '-' }}
</view>
<view wx:else>
-
</view>
</view>
<view class="btn-box">
<view bindtap="jumpTaskCenter"
data-target="{{ item }}"
class="btn {{ item.taskStatus == 2 ? '' : 'primary' }}">
{{ item.taskStatus == 2 ? '查看' : '去执行' }}
</view>
</view>
</block>
<block wx:else>
<!-- 顶部状态和标题 --> <!-- 顶部状态和标题 -->
<view class="item-top"> <view class="item-top">
<view <view class="status text-center"
class="status text-center" style="color: {{ statusMap[item.taskStatus].color }}; background-color: {{ statusMap[item.taskStatus].background }};">
style="color: {{statusMap[item.taskStatus].color}}; background-color: {{statusMap[item.taskStatus].background}};" {{ statusMap[item.taskStatus].name }}
> </view>
{{statusMap[item.taskStatus].name}} <view class="name" wx:if="{{ item.taskType != 4 }}">
</view> {{ missionMap[item.taskType].name }}<text wx:if="{{ item.taskType == 5 }}"></text>
</view>
<view class="name" wx:if="{{item.taskType != 4}}"> <view class="name" wx:else>
{{missionMap[item.taskType].name}} {{ item.merchantName || '-' }}
<text wx:if="{{item.taskType == 5}}"></text> </view>
</view>
<view class="name" wx:else>{{item.merchantName || '-'}}</view>
</view> </view>
<!-- <view wx:if="{{(item.taskType == 0 || item.taskType == 1 || item.taskType == 2) && item.taskStatus == 2}}" class="list-item"> <block wx:if="{{ item.taskType == 4 }}">
<image class="icon" src="{{IMG_URL}}task-icon.png" mode="" />
<view class="label">{{['日报内容:', '复盘内容:', '月度计划:'][item.taskType]}}</view>
<view class="text-hide">{{item.taskContext || '-'}}</view>
</view> -->
<block wx:if="{{item.taskType == 4}}">
<view class="list-item"> <view class="list-item">
<image class="icon" src="{{IMG_URL}}matter-icon.png" mode="" /> <image class="icon"
<view class="label">事项描述:</view> src="{{ IMG_URL }}matter-icon.png"
<view class="text-hide">{{item.taskDesc || '-'}}</view> mode="" />
<view class="label">
事项描述:
</view>
<view class="text-hide">
{{ item.taskDesc || '-' }}
</view>
</view> </view>
<view wx:if="{{ item.taskStatus == 2 }}" class="list-item">
<view wx:if="{{item.taskStatus == 2}}" class="list-item"> <image class="icon"
<image class="icon" src="{{IMG_URL}}task-icon.png" mode="" /> src="{{ IMG_URL }}task-icon.png"
<view class="label">专项任务:</view> mode="" />
<view class="text-hide">{{item.taskContext || '-'}}</view> <view class="label">
专项任务:
</view>
<view class="text-hide">
{{ item.taskContext || '-' }}
</view>
</view> </view>
<view wx:else class="list-item"> <view wx:else class="list-item">
<image class="icon" src="{{IMG_URL}}time-icon.png" mode="" /> <image class="icon"
<view class="label">创建时间:</view> src="{{ IMG_URL }}time-icon.png"
<view>{{item.createTime || '-'}}</view> mode="" />
<view class="label">
创建时间:
</view>
<view>
{{ item.createTime || '-' }}
</view>
</view> </view>
</block> </block>
<view wx:if="{{item.taskType != 4 || (item.taskType == 4 && item.taskStatus == 2)}}" class="list-item"> <view wx:if="{{ item.taskType != 4 || (item.taskType == 4 && item.taskStatus == 2) }}"
<image class="icon" src="{{IMG_URL}}time-icon.png" mode="" /> class="list-item">
<view class="label">完成时间:</view> <image class="icon"
<view wx:if="{{item.taskStatus == 2}}">{{item.updatedDate || '-'}}</view> src="{{ IMG_URL }}time-icon.png"
<view wx:else>-</view> mode="" />
<view class="label">
完成时间:
</view>
<view wx:if="{{ item.taskStatus == 2 }}">
{{ item.updatedDate || '-' }}
</view>
<view wx:else>
-
</view>
</view> </view>
<!-- 录音复盘任务进度 --> <!-- 录音复盘任务进度 -->
<view wx:if="{{item.taskType == 3}}" class="list-item"> <view wx:if="{{ item.taskType == 3 }}" class="list-item">
<view class="progress"> <view class="progress">
<view class="progress-line"></view> <view class="progress-line"></view>
<view <view class="progress-item"
class="progress-item" style="width: {{ (item.audioReviewCompletedCount / item.audioReviewTotalCount * 100) + '%' }}"></view>
style="width: {{ (item.audioReviewCompletedCount / item.audioReviewTotalCount * 100) + '%' }}" <view class="num">
></view> {{ item.audioReviewCompletedCount + '/' + item.audioReviewTotalCount }}
<view class="num">{{item.audioReviewCompletedCount + '/' + item.audioReviewTotalCount}}</view> </view>
</view> </view>
</view> </view>
<!-- 提报优秀案例录音/带教要求任务进度 --> <!-- 提报优秀案例录音/带教要求任务进度 -->
<view wx:if="{{item.taskType == 6 || item.taskType == 7}}" class="list-item"> <view wx:if="{{ item.taskType == 6 || item.taskType == 7 }}" class="list-item">
<view class="progress"> <view class="progress">
<view class="progress-line"></view> <view class="progress-line"></view>
<view <view class="progress-item"
class="progress-item" style="width: {{ (item.weeklyTaskCompletedCount / item.weeklyTaskTotalCount * 100) + '%' }};"></view>
style="width: {{ (item.weeklyTaskCompletedCount / item.weeklyTaskTotalCount * 100) + '%' }};" <view class="num">
></view> {{ item.weeklyTaskCompletedCount + '/' + item.weeklyTaskTotalCount }}
<view class="num">{{item.weeklyTaskCompletedCount + '/' + item.weeklyTaskTotalCount}}</view> </view>
</view> </view>
</view> </view>
<!-- 底部按钮 --> <!-- 底部按钮 -->
<view class="btn-box"> <view class="btn-box">
<view <view bindtap="jump"
bindtap="jump" data-target="{{ item }}"
data-target="{{item}}" class="btn {{ item.taskStatus == 2 ? '' : 'primary' }}">
class="btn {{item.taskStatus == 2 ? '' : 'primary'}}" {{ item.taskStatus == 2 ? '查看' : '去执行' }}
>
{{item.taskStatus == 2 ? '查看' : '去执行'}}
</view> </view>
</view> </view>
</view> </block>
</block> </view>
</block> </block>
<block wx:if="{{ nothing }}"> </block>
<view class="list-nothing">到底了~</view> <block wx:if="{{ nothing }}">
</block> <view class="list-nothing">
</block> 到底了~
<block wx:else> </view>
<empty-data /> </block>
</block> </block>
<block wx:else>
<empty-data />
</block>
</view> </view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<block wx:if="{{tabIndex == 0}}"> <block wx:if="{{ tabIndex == 0 }}">
<block wx:if="{{showIcon1}}"> <block wx:if="{{ showIcon1 }}">
<view class="add-btn-box" bindtap="handleMentoring"> <view class="add-btn-box" bindtap="handleMentoring">
<view class="addBtn"> <view class="addBtn">
<van-icon name="plus" /> <van-icon name="plus" />
<view class="btn-text">带教记录</view> <view class="btn-text">
带教记录
</view>
</view> </view>
</view> </view>
</block> </block>
<block wx:else> <block wx:else>
<view class="arrowIcon"> <view class="arrowIcon">
<image class="image" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/usedCar/arrow-right.png" /> <image class="image"
src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/usedCar/arrow-right.png" />
</view> </view>
</block> </block>
</block> </block>
...@@ -12,6 +12,11 @@ Page({ ...@@ -12,6 +12,11 @@ Page({
navStyle: 'background-color: rgba(0,0,0,0);box-shadow:none;', navStyle: 'background-color: rgba(0,0,0,0);box-shadow:none;',
isForbidden: false isForbidden: false
}, },
goMySpecialTask() {
wx.navigateTo({
url: '/packageIndex/pages/mySpecialTaskList/mySpecialTaskList'
})
},
jump(e) { jump(e) {
let { let {
url url
...@@ -109,4 +114,4 @@ Page({ ...@@ -109,4 +114,4 @@ Page({
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { }, onReachBottom: function () { },
})
\ No newline at end of file \ No newline at end of file
})
...@@ -19,12 +19,20 @@ ...@@ -19,12 +19,20 @@
</view> </view>
</view> </view>
<view class="set_box"> <view class="set_box">
<!-- <view class="set_item" bindtap="goMySpecialTask">
<image class="icon" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/special-task-icon.png" mode=""/>
<view class="right">
<view class="title">我发起的专项任务</view>
<view class="set_tips"></view>
<image class="icon_image" src="{{IMG_URL}}arrow-left.png" mode="" />
</view>
</view> -->
<view class="set_item " bindtap="jump" data-url="agreement"> <view class="set_item " bindtap="jump" data-url="agreement">
<image class="icon" src="{{IMG_URL}}user-agreement.png" mode=""/> <image class="icon" src="{{IMG_URL}}user-agreement.png" mode=""/>
<view class="right"> <view class="right">
<view class="title">用户协议</view> <view class="title">用户协议</view>
<view class="set_tips"></view> <view class="set_tips"></view>
<image class="icon_image" src="./images/right.png" mode="" /> <image class="icon_image" src="{{IMG_URL}}arrow-left.png" mode="" />
</view> </view>
</view> </view>
<view class="set_item " bindtap="jump" data-url="privacy"> <view class="set_item " bindtap="jump" data-url="privacy">
...@@ -32,7 +40,7 @@ ...@@ -32,7 +40,7 @@
<view class="right"> <view class="right">
<view class="title">隐私协议</view> <view class="title">隐私协议</view>
<view class="set_tips"></view> <view class="set_tips"></view>
<image class="icon_image" src="./images/right.png" mode="" /> <image class="icon_image" src="{{IMG_URL}}arrow-left.png" mode="" />
</view> </view>
</view> </view>
<!-- <view class="set_item " bindtap="goVersionPage"> <!-- <view class="set_item " bindtap="goVersionPage">
......
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: {}
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
"packNpmRelationList": [ "packNpmRelationList": [
{ {
"packageJsonPath": "./package.json", "packageJsonPath": "./package.json",
"miniprogramNpmDistDir": "./miniprogram_npm" "miniprogramNpmDistDir": "./"
} }
], ],
"compileHotReLoad": true, "compileHotReLoad": true,
......
{ {
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"condition": { "condition": {
"miniprogram": { "miniprogram": {
"list": [ "list": [
{ {
"name": "packageCrew/pages/peopleOverview/peopleOverview", "name": "驻店人员",
"pathName": "packageCrew/pages/peopleOverview/peopleOverview", "pathName": "packageIndex/pages/stationStaffPerformance/stationStaffPerformance",
"query": "query=%7B%22employeeId%22%3Anull%2C%22employeeName%22%3A%22%E9%99%88%E5%B8%8C%22%2C%22employeePhone%22%3A%2213132112126%22%2C%22personalOutput%22%3A9420%2C%22personalUnitPrice%22%3A724.62%2C%22personalConversion%22%3A0.4483%2C%22dealCount%22%3Anull%2C%22defeatCount%22%3Anull%2C%22recordingCount%22%3Anull%2C%22leadCount%22%3Anull%2C%22missingRate%22%3Anull%2C%22dealRate%22%3Anull%2C%22avgRecordPerDeal%22%3Anull%2C%22bussinessType%22%3A%221%22%2C%22conversionWarningLevel%22%3A0%2C%22unitPriceWarningLevel%22%3A0%2C%22outputWarningLevel%22%3A2%2C%22scene%22%3A2%2C%22startDate%22%3A%222026-03-01%22%2C%22endDate%22%3A%222026-03-31%22%2C%22timeDimension%22%3A2%7D", "query": "",
"scene": null, "scene": null,
"launchMode": "default" "launchMode": "default"
}, },
{ {
"name": "packageCrew/pages/receptionRecording/receptionRecording", "name": "packageCrew/pages/peopleOverview/peopleOverview",
"pathName": "packageCrew/pages/receptionRecording/receptionRecording", "pathName": "packageCrew/pages/peopleOverview/peopleOverview",
"query": "storeManagerName=%E9%99%88%E5%B8%8C&gender=null&storeManagerPhone=13132112126&entryDate=2025-03-18&business=%E5%BB%B6%E4%BF%9D&selectedMerchantId=44211227&scene=1&employeeId=584fdb460afa4dad835cbe8d73cfa923", "query": "query=%7B%22employeeId%22%3Anull%2C%22employeeName%22%3A%22%E9%99%88%E5%B8%8C%22%2C%22employeePhone%22%3A%2213132112126%22%2C%22personalOutput%22%3A9420%2C%22personalUnitPrice%22%3A724.62%2C%22personalConversion%22%3A0.4483%2C%22dealCount%22%3Anull%2C%22defeatCount%22%3Anull%2C%22recordingCount%22%3Anull%2C%22leadCount%22%3Anull%2C%22missingRate%22%3Anull%2C%22dealRate%22%3Anull%2C%22avgRecordPerDeal%22%3Anull%2C%22bussinessType%22%3A%221%22%2C%22conversionWarningLevel%22%3A0%2C%22unitPriceWarningLevel%22%3A0%2C%22outputWarningLevel%22%3A2%2C%22scene%22%3A2%2C%22startDate%22%3A%222026-03-01%22%2C%22endDate%22%3A%222026-03-31%22%2C%22timeDimension%22%3A2%7D",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "packageCrew/pages/peopleOverview/peopleOverview", "name": "packageCrew/pages/receptionRecording/receptionRecording",
"pathName": "packageCrew/pages/peopleOverview/peopleOverview", "pathName": "packageCrew/pages/receptionRecording/receptionRecording",
"query": "query=%7B%22employeeName%22%3A%22%E9%99%88%E5%B8%8C%22%2C%22phone%22%3A%2213132112126%22%2C%22studyHours%22%3A0%2C%22completedCourses%22%3A0%2C%22coachingTimes%22%3A1%2C%22employeePhone%22%3A%2213132112126%22%2C%22scene%22%3A1%2C%22startDate%22%3A%222026-03-20%22%2C%22endDate%22%3A%222026-03-20%22%2C%22timeDimension%22%3A0%7D", "query": "storeManagerName=%E9%99%88%E5%B8%8C&gender=null&storeManagerPhone=13132112126&entryDate=2025-03-18&business=%E5%BB%B6%E4%BF%9D&selectedMerchantId=44211227&scene=1&employeeId=584fdb460afa4dad835cbe8d73cfa923",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "packageCrew/pages/receptionRecording/receptionRecording", "name": "packageCrew/pages/peopleOverview/peopleOverview",
"pathName": "packageCrew/pages/receptionRecording/receptionRecording", "pathName": "packageCrew/pages/peopleOverview/peopleOverview",
"query": "storeManagerName=%E9%99%88%E5%B8%8C&gender=null&storeManagerPhone=13132112126&entryDate=2025-03-18&business=%E5%BB%B6%E4%BF%9D&selectedMerchantId=44211227&scene=1&employeeId=584fdb460afa4dad835cbe8d73cfa923", "query": "query=%7B%22employeeName%22%3A%22%E9%99%88%E5%B8%8C%22%2C%22phone%22%3A%2213132112126%22%2C%22studyHours%22%3A0%2C%22completedCourses%22%3A0%2C%22coachingTimes%22%3A1%2C%22employeePhone%22%3A%2213132112126%22%2C%22scene%22%3A1%2C%22startDate%22%3A%222026-03-20%22%2C%22endDate%22%3A%222026-03-20%22%2C%22timeDimension%22%3A0%7D",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "packageCrew/pages/receptionRecording/receptionRecording", "name": "packageCrew/pages/receptionRecording/receptionRecording",
"pathName": "packageCrew/pages/receptionRecording/receptionRecording", "pathName": "packageCrew/pages/receptionRecording/receptionRecording",
"query": "storeManagerName=%E6%B5%8B%E8%AF%95%E5%91%98%E5%B7%A51194&gender=%E7%94%B7&storeManagerPhone=13132112126&entryDate=2025-04-05&business=%E5%BB%B6%E4%BF%9D&selectedMerchantId=44211227&scene=&employeeId=584fdb460afa4dad835cbe8d73cfa923", "query": "storeManagerName=%E9%99%88%E5%B8%8C&gender=null&storeManagerPhone=13132112126&entryDate=2025-03-18&business=%E5%BB%B6%E4%BF%9D&selectedMerchantId=44211227&scene=1&employeeId=584fdb460afa4dad835cbe8d73cfa923",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "packageCrew/pages/receptionRecording/receptionRecording", "name": "packageCrew/pages/receptionRecording/receptionRecording",
"pathName": "packageCrew/pages/receptionRecording/receptionRecording", "pathName": "packageCrew/pages/receptionRecording/receptionRecording",
"query": "storeManagerName=%E6%B5%8B%E8%AF%95%E5%91%98%E5%B7%A51194&gender=%E7%94%B7&storeManagerPhone=13132112126&entryDate=2025-04-05&business=%E5%BB%B6%E4%BF%9D&merchantId=44211227&scene=&employeeId=584fdb460afa4dad835cbe8d73cfa923", "query": "storeManagerName=%E6%B5%8B%E8%AF%95%E5%91%98%E5%B7%A51194&gender=%E7%94%B7&storeManagerPhone=13132112126&entryDate=2025-04-05&business=%E5%BB%B6%E4%BF%9D&selectedMerchantId=44211227&scene=&employeeId=584fdb460afa4dad835cbe8d73cfa923",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "复盘", "name": "packageCrew/pages/receptionRecording/receptionRecording",
"pathName": "packageIndex/pages/recordingReview/recordingReview", "pathName": "packageCrew/pages/receptionRecording/receptionRecording",
"query": "", "query": "storeManagerName=%E6%B5%8B%E8%AF%95%E5%91%98%E5%B7%A51194&gender=%E7%94%B7&storeManagerPhone=13132112126&entryDate=2025-04-05&business=%E5%BB%B6%E4%BF%9D&merchantId=44211227&scene=&employeeId=584fdb460afa4dad835cbe8d73cfa923",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "packageIndex/pages/weeklyReview/weeklyReview", "name": "复盘",
"pathName": "packageIndex/pages/weeklyReview/weeklyReview", "pathName": "packageIndex/pages/recordingReview/recordingReview",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "packageCrew/pages/receptionRecording/receptionRecording", "name": "packageIndex/pages/weeklyReview/weeklyReview",
"pathName": "packageCrew/pages/receptionRecording/receptionRecording", "pathName": "packageIndex/pages/weeklyReview/weeklyReview",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "packageCrew/pages/peopleOverview/peopleOverview", "name": "packageCrew/pages/receptionRecording/receptionRecording",
"pathName": "packageCrew/pages/peopleOverview/peopleOverview", "pathName": "packageCrew/pages/receptionRecording/receptionRecording",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "packageCrew/pages/peopleOverview/peopleOverview", "name": "packageCrew/pages/peopleOverview/peopleOverview",
"pathName": "packageCrew/pages/peopleOverview/peopleOverview", "pathName": "packageCrew/pages/peopleOverview/peopleOverview",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "packageCrew/pages/storeTransfer/storeTransfer", "name": "packageCrew/pages/peopleOverview/peopleOverview",
"pathName": "packageCrew/pages/storeTransfer/storeTransfer", "pathName": "packageCrew/pages/peopleOverview/peopleOverview",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "packageCrew/pages/peopleOverview/peopleOverview", "name": "packageCrew/pages/storeTransfer/storeTransfer",
"pathName": "packageCrew/pages/peopleOverview/peopleOverview", "pathName": "packageCrew/pages/storeTransfer/storeTransfer",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "packageIndex/pages/specialTask/specialTask", "name": "packageCrew/pages/peopleOverview/peopleOverview",
"pathName": "packageIndex/pages/specialTask/specialTask", "pathName": "packageCrew/pages/peopleOverview/peopleOverview",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "packageIndex/pages/monthlyPlan/monthlyPlan", "name": "packageIndex/pages/specialTask/specialTask",
"pathName": "packageIndex/pages/monthlyPlan/monthlyPlan", "pathName": "packageIndex/pages/specialTask/specialTask",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "packageIndex/pages/weeklyReview/weeklyReview", "name": "packageIndex/pages/monthlyPlan/monthlyPlan",
"pathName": "packageIndex/pages/weeklyReview/weeklyReview", "pathName": "packageIndex/pages/monthlyPlan/monthlyPlan",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "packageIndex/pages/dailySupervisionReport/dailySupervisionReport", "name": "packageIndex/pages/weeklyReview/weeklyReview",
"pathName": "packageIndex/pages/dailySupervisionReport/dailySupervisionReport", "pathName": "packageIndex/pages/weeklyReview/weeklyReview",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "申诉列表", "name": "packageIndex/pages/dailySupervisionReport/dailySupervisionReport",
"pathName": "packageWorkspace/pages/appealFormManage/appealFormList/appealFormList", "pathName": "packageIndex/pages/dailySupervisionReport/dailySupervisionReport",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "考勤列表", "name": "申诉列表",
"pathName": "packageWorkspace/pages/attendanceStatis/attendanceList/attendanceList", "pathName": "packageWorkspace/pages/appealFormManage/appealFormList/appealFormList",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "有效引荐数", "name": "考勤列表",
"pathName": "packageWorkspace/pages/validReferralCount/referralCountList/referralCountList", "pathName": "packageWorkspace/pages/attendanceStatis/attendanceList/attendanceList",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "精品升级", "name": "有效引荐数",
"pathName": "tabWorkOrder/pages/createOrder/createOrder", "pathName": "packageWorkspace/pages/validReferralCount/referralCountList/referralCountList",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "权战ai", "name": "精品升级",
"pathName": "packageEquity/pages/createDeafeatOrderAi/createDeafeatOrderAi", "pathName": "tabWorkOrder/pages/createOrder/createOrder",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "权订单", "name": "权战ai",
"pathName": "packageEquity/pages/carQuotation/createOrderCarQuotationSimple/createOrderCarQuotationSimple", "pathName": "packageEquity/pages/createDeafeatOrderAi/createDeafeatOrderAi",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "质检", "name": "权订单",
"pathName": "packageEquity/pages/aiInspection/aiInspection", "pathName": "packageEquity/pages/carQuotation/createOrderCarQuotationSimple/createOrderCarQuotationSimple",
"query": "badgeId=4827E2F0CD24", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "驻店目标", "name": "质检",
"pathName": "packageEquity/pages/residentTarget/residentTarget", "pathName": "packageEquity/pages/aiInspection/aiInspection",
"query": "", "query": "badgeId=4827E2F0CD24",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "线管理", "name": "驻店目标",
"pathName": "packageEquity/pages/clueList/clueList", "pathName": "packageEquity/pages/residentTarget/residentTarget",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "场景", "name": "线管理",
"pathName": "pages/sceneIndex/sceneIndex", "pathName": "packageEquity/pages/clueList/clueList",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "员工日报", "name": "场景",
"pathName": "tabWorkOrder/pages/staffDaily/staffDaily", "pathName": "pages/sceneIndex/sceneIndex",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "权益-个人中心", "name": "员工日报",
"pathName": "packageEquity/pages/TabBar/equityPage", "pathName": "tabWorkOrder/pages/staffDaily/staffDaily",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "创建权益订单", "name": "权益-个人中心",
"pathName": "packageEquity/pages/carQuotation/createOrderCarQuotationSimple/createOrderCarQuotationSimple", "pathName": "packageEquity/pages/TabBar/equityPage",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "权益列表", "name": "创建权益订单",
"pathName": "packageEquity/pages/TabBar/equityPage", "pathName": "packageEquity/pages/carQuotation/createOrderCarQuotationSimple/createOrderCarQuotationSimple",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "领券预约", "name": "权益列表",
"pathName": "tabMine/pages/collectCoupons/collectCoupons", "pathName": "packageEquity/pages/TabBar/equityPage",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "个人中心", "name": "领券预约",
"pathName": "pages/tabMine/pages/index/index", "pathName": "tabMine/pages/collectCoupons/collectCoupons",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
} },
] {
} "name": "个人中心",
}, "pathName": "pages/tabMine/pages/index/index",
"libVersion": "3.12.0", "query": "",
"projectname": "supervisor-miniprogram", "launchMode": "default",
"setting": { "scene": null
"compileHotReLoad": false }
} ]
}
},
"libVersion": "3.12.0",
"projectname": "supervisor-miniprogram",
"setting": {
"compileHotReLoad": true
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -266,7 +266,8 @@ export const checkScene = options => { ...@@ -266,7 +266,8 @@ export const checkScene = options => {
'recruitDetail': 'packageEquity/pages/recruitManage/recruitDetail/recruitDetail', 'recruitDetail': 'packageEquity/pages/recruitManage/recruitDetail/recruitDetail',
'performanceRate': 'packageWorkspace/pages/performanceRating/rateList/retaList', 'performanceRate': 'packageWorkspace/pages/performanceRating/rateList/retaList',
'validReferralCount': 'packageWorkspace/pages/validReferralCount/referralCountList/referralCountList', 'validReferralCount': 'packageWorkspace/pages/validReferralCount/referralCountList/referralCountList',
'orderApprovalDetail': '/packageWorkspace/pages/orderApprovalManage/orderApprovalDetail/orderApprovalDetail' 'orderApprovalDetail': '/packageWorkspace/pages/orderApprovalManage/orderApprovalDetail/orderApprovalDetail',
'supervisorIndex': 'pages/tab/index/index'
} }
options.path = pagePath[query.page] options.path = pagePath[query.page]
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!