From ab70c6eb4a181b282af0eb200275cd8a4d2ab172 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 13 十一月 2024 16:41:32 +0800
Subject: [PATCH] 2024.11.13
---
pages/mService/cSchedule/cSchedule.wxml | 3
pages/home/home.js | 20 +
/dev/null | 192 --------------
pages/mUser/sceneauthentication/industrial/index.wxml | 6
pages/mService/pSchedule/pSchedule.js | 100 +++---
data/schedules.js | 207 +++++++++------
pages/mService/behaviors/bScheduleManager.js | 109 ++++----
pages/mUser/pAbout/pAbout.wxml | 2
pages/mExtra/pSupervisionchangeDetail/pSupervisionchangeDetail.wxml | 67 ++++-
pages/mExtra/pSupervisionchange/pSupervisionchange.wxml | 51 +++
service/baserequest.js | 14
pages/mUser/userlogin/userlogin.wxml | 2
12 files changed, 360 insertions(+), 413 deletions(-)
diff --git a/data/schedules.js b/data/schedules.js
index 2bb36fb..eea6609 100644
--- a/data/schedules.js
+++ b/data/schedules.js
@@ -1,92 +1,129 @@
-import moment from '../utils/moment.min'
+import moment from '../utils/moment.min';
+import scheduleservice from '../service/scheduleservice';
+var schedules = undefined;
//
-const sysSchedules = function () {
- let s = []
- const now = moment().hour(0).minute(0).second(0).millisecond(0)
- const year = now.year()
- //鍙拌处姣忔湀10鍙蜂负鎻愪氦鏃�
- const day = 10
- for (let m = 1; m <= 12; m++) {
- const mon = m > 9 ? m : `0${m}`
- const item = {
- time: moment(`${year}-${mon}-10`),
- type: 0,
- events: [{
- category: `${year}骞�${m}鏈堢幆淇濆伐浣滄棩绋媊,
- name: `鎻愪氦${m}鏈堢幆淇濆彴璐,
- type: 1, //绯荤粺鏃ョ▼
- steps: [{
- index: '01',
- title: ['鎻愪氦', '鏂瑰紡'],
- content: '鍓嶅線鍙拌处绠$悊鐣岄潰锛屾牴鎹彴璐︾被鍨嬪垎绫讳笂浼犲彴璐﹀浘鐗囥��'
- }, {
- index: '02',
- title: ['鎻愪氦', '鏈熼檺'],
- content: '娉ㄦ剰鍙拌处鎻愪氦鍛ㄦ湡涓轰竴涓湀锛屾瘡鏈堝敖閲�10鍙蜂箣鍓嶆彁浜や笂鏈堝彴璐︼紝閫炬湡鍚庣幆淇濅俊鐢ㄨ瘎浼颁細鏈夋墍褰卞搷銆�'
- }]
- }]
- }
- s.push(item)
- }
- //璇勪及姣忔湀鎻愪氦涓�娆★紝瀹氫负5鍙�
- for (let m = 1; m <= 12; m++) {
- const mon = m > 9 ? m : `0${m}`
- const item = {
- time: moment(`${year}-${mon}-05`),
- type: 1,
- events: [{
- category: `${year}骞�${m}鏈堢幆淇濆伐浣滄棩绋媊,
- name: `瀹屾垚${m}鏈堣嚜娴嬫櫤璇刞,
- type: 1, //绯荤粺鏃ョ▼
- steps: [{
- index: '01',
- title: ['鑷瘎', '鏂规硶'],
- content: '鍓嶅線鑷祴鏅鸿瘎鐣岄潰锛岀偣鍑烩�滃幓娴嬭瘎鈥濇寜閽繘琛岃嚜璇勩��'
- }, {
- index: '02',
- title: ['娴嬭瘎', '鍛ㄦ湡'],
- content: '娴嬭瘎鍛ㄦ湡涓轰竴涓湀涓�娆★紝绉瀬鑷瘎鍙湁鏁堝府鍔╂偍鐭ユ檽浼佷笟褰撳墠鐨勭幆淇濋殣鎮c��'
- }]
- }]
- }
- s.push(item)
- }
- //鎵胯姣忎竴骞存彁浜や竴娆�
- const item = {
- category: `${year}骞�12鏈堢幆淇濆伐浣滄棩绋媊,
- time: moment(`${year}-12-31`),
- type: 2,
- events: [{
- name: `瀹屾垚瀹堟硶鎵胯`,
- type: 1, //绯荤粺鏃ョ▼
- steps: [{
- index: '01',
- title: ['鎵胯', '鏂规硶'],
- content: '鍓嶅線瀹堟硶鎵胯鐣岄潰锛屾牴鎹彁绀猴紝绛剧讲瀹堟硶鎵胯涔︺��'
- }, {
- index: '02',
- title: ['鎵胯涔�', '浣滅敤'],
- content: '绛剧讲瀹堟硶鎵胯涔︼紝鎰忓懗鐫�鎮ㄤ富鍔ㄥ悜鐜繚閮ㄩ棬鎵胯閬靛畧鐩稿叧瑙勭珷鍒跺害銆�'
- }, {
- index: '03',
- title: ['鎵胯涔�', '鏈夋晥鏈�'],
- content: '瀹堟硶鎵胯涔︿粠绛剧讲涔嬫棩璧凤紝鏈夋晥鏈熶负涓�骞�'
- }]
- }],
- }
- s.push(item)
+// const sysSchedules = function () {
+// let s = []
+// const now = moment().hour(0).minute(0).second(0).millisecond(0)
+// const year = now.year()
+// //鍙拌处姣忔湀10鍙蜂负鎻愪氦鏃�
+// const day = 10
+// for (let m = 1; m <= 12; m++) {
+// const mon = m > 9 ? m : `0${m}`
+// const item = {
+// time: moment(`${year}-${mon}-10`),
+// type: 0,
+// events: [{
+// category: `${year}骞�${m}鏈堢幆淇濆伐浣滄棩绋媊,
+// name: `鎻愪氦${m}鏈堢幆淇濆彴璐,
+// type: 1, //绯荤粺鏃ョ▼
+// steps: [{
+// index: '01',
+// title: ['鎻愪氦', '鏂瑰紡'],
+// content: '鍓嶅線鍙拌处绠$悊鐣岄潰锛屾牴鎹彴璐︾被鍨嬪垎绫讳笂浼犲彴璐﹀浘鐗囥��'
+// }, {
+// index: '02',
+// title: ['鎻愪氦', '鏈熼檺'],
+// content: '娉ㄦ剰鍙拌处鎻愪氦鍛ㄦ湡涓轰竴涓湀锛屾瘡鏈堝敖閲�10鍙蜂箣鍓嶆彁浜や笂鏈堝彴璐︼紝閫炬湡鍚庣幆淇濅俊鐢ㄨ瘎浼颁細鏈夋墍褰卞搷銆�'
+// }]
+// }]
+// }
+// s.push(item)
+// }
+// //璇勪及姣忔湀鎻愪氦涓�娆★紝瀹氫负5鍙�
+// for (let m = 1; m <= 12; m++) {
+// const mon = m > 9 ? m : `0${m}`
+// const item = {
+// time: moment(`${year}-${mon}-05`),
+// type: 1,
+// events: [{
+// category: `${year}骞�${m}鏈堢幆淇濆伐浣滄棩绋媊,
+// name: `瀹屾垚${m}鏈堣嚜娴嬫櫤璇刞,
+// type: 1, //绯荤粺鏃ョ▼
+// steps: [{
+// index: '01',
+// title: ['鑷瘎', '鏂规硶'],
+// content: '鍓嶅線鑷祴鏅鸿瘎鐣岄潰锛岀偣鍑烩�滃幓娴嬭瘎鈥濇寜閽繘琛岃嚜璇勩��'
+// }, {
+// index: '02',
+// title: ['娴嬭瘎', '鍛ㄦ湡'],
+// content: '娴嬭瘎鍛ㄦ湡涓轰竴涓湀涓�娆★紝绉瀬鑷瘎鍙湁鏁堝府鍔╂偍鐭ユ檽浼佷笟褰撳墠鐨勭幆淇濋殣鎮c��'
+// }]
+// }]
+// }
+// s.push(item)
+// }
+// //鎵胯姣忎竴骞存彁浜や竴娆�
+// const item = {
+// category: `${year}骞�12鏈堢幆淇濆伐浣滄棩绋媊,
+// time: moment(`${year}-12-31`),
+// type: 2,
+// events: [{
+// name: `瀹屾垚瀹堟硶鎵胯`,
+// type: 1, //绯荤粺鏃ョ▼
+// steps: [{
+// index: '01',
+// title: ['鎵胯', '鏂规硶'],
+// content: '鍓嶅線瀹堟硶鎵胯鐣岄潰锛屾牴鎹彁绀猴紝绛剧讲瀹堟硶鎵胯涔︺��'
+// }, {
+// index: '02',
+// title: ['鎵胯涔�', '浣滅敤'],
+// content: '绛剧讲瀹堟硶鎵胯涔︼紝鎰忓懗鐫�鎮ㄤ富鍔ㄥ悜鐜繚閮ㄩ棬鎵胯閬靛畧鐩稿叧瑙勭珷鍒跺害銆�'
+// }, {
+// index: '03',
+// title: ['鎵胯涔�', '鏈夋晥鏈�'],
+// content: '瀹堟硶鎵胯涔︿粠绛剧讲涔嬫棩璧凤紝鏈夋晥鏈熶负涓�骞�'
+// }]
+// }],
+// }
+// s.push(item)
- s.sort(function (x, y) {
- if (x.time.isBefore(y.time)) {
- return -1;
- } else if (x.time.isAfter(y.time)) {
- return 1;
+// s.sort(function (x, y) {
+// if (x.time.isBefore(y.time)) {
+// return -1;
+// } else if (x.time.isAfter(y.time)) {
+// return 1;
+// } else {
+// return 0;
+// }
+// })
+// return s
+// }
+
+/**
+ * 鑾峰彇鐢ㄦ埛鏈勾搴︾殑鎵�鏈夌幆淇濇棩绋�
+ */
+function sysSchedules() {
+ let startTime = moment()
+ .month(0)
+ .date(1)
+ .format('YYYY-MM-DD')
+ let endTime = moment()
+ .month(11)
+ .date(31)
+ .format('YYYY-MM-DD')
+ return new Promise((resolve, reject) => {
+ if (schedules) {
+ resolve(schedules);
} else {
- return 0;
+ scheduleservice.getSchedules(
+ { startTime, endTime, type: 0 },
+ {
+ success: res => {
+ schedules = res.data;
+ schedules.forEach(s => {
+ s.time = moment(s.time.split('T')[0]).format('YYYY-MM-DD');
+ });
+ resolve(res.data);
+ },
+ fail: e => {
+ reject(e);
+ },
+ },
+ );
}
- })
- return s
+ });
}
-export default sysSchedules
\ No newline at end of file
+export default sysSchedules;
diff --git a/pages/home/home.js b/pages/home/home.js
index 4a2b497..57116f8 100644
--- a/pages/home/home.js
+++ b/pages/home/home.js
@@ -30,7 +30,7 @@
userRealName: '',
//鍘嗗彶璇勫垎璇︽儏
- assessmentCompleted: false,
+ assessmentCompleted: undefined,
historyPoint: {
time: '娴嬭瘎鍛ㄦ湡----骞�--鏈�',
score: '--',
@@ -40,7 +40,7 @@
period: '',
},
//鍙拌处瀹屾垚鎯呭喌
- ledgerCompleted: false,
+ ledgerCompleted: undefined,
monthInfo: {
//蹇呭~椤规�绘暟
totalMust: 0,
@@ -161,10 +161,19 @@
let year = lastOne.updateDate.substring(0, 4);
let month = lastOne.updateDate.substring(5, 7);
const now = moment();
- if (now.year() == year && now.month() + 1 == month) {
+ // fixme 2024.5.24 涓存椂娣诲姞闈欏畨鍖荤枟鏈烘瀯鐨勮瘎浼板懆鏈熶负1骞达紝鍚庣画鍐嶅仛瀹屽杽
+ const inPeriod =
+ app.globalData.userInfo.extension1 == '闈欏畨鍖�' &&
+ app.globalData.userInfo.extension2 == '9' &&
+ year == now.year();
+ if ((now.year() == parseInt(year) && now.month() + 1 == parseInt(month) ) || inPeriod) {
that.setData({
- assessmentCompleted: true,
+ assessmentCompleted: 2,
});
+ } else {
+ that.setData({
+ assessmentCompleted: 1,
+ });
}
that.setData({
historyPoint: {
@@ -289,8 +298,7 @@
this.setData({
monthInfo,
- ledgerCompleted: monthInfo.percent >= 100 && monthInfo.percent2 >= 100,
- // ledgerCompleted: true
+ ledgerCompleted: monthInfo.percent >= 100 && monthInfo.percent2 >= 100 ? 2 : 1,
});
},
diff --git a/pages/mAssessment/assessment/assessment.json b/pages/mAssessment/assessment/assessment.json
deleted file mode 100644
index 2419e5a..0000000
--- a/pages/mAssessment/assessment/assessment.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "navigationBarTitleText": "鑷祴鏅鸿瘎",
- "enablePullDownRefresh":true,
- "usingComponents": {
- "cp-progress": "/component/progress/progress",
- "ec-canvas": "/component/ec-canvas/ec-canvas",
- "mp-icon": "/component/icon/icon"
- },
- "navigationBarBackgroundColor": "#57E4CB"
-}
\ No newline at end of file
diff --git a/pages/mAssessment/assessment/assessment.wxml b/pages/mAssessment/assessment/assessment.wxml
deleted file mode 100644
index ff8b50e..0000000
--- a/pages/mAssessment/assessment/assessment.wxml
+++ /dev/null
@@ -1,111 +0,0 @@
-<!--pages/assessment/assessment.wxml-->
-<import src="/template/nodata.wxml"></import>
-
-<view class="page">
- <!-- <view class="banner-bg"></view> -->
-
- <!-- <view style="padding-top: {{statusBarHeight}}px;" class="statusbar-title">
- <view style="line-height: {{navContentHeight - statusBarHeight}}px;">
- <text>淇$敤鏅鸿瘎</text>
- </view>
- </view> -->
-
- <view class="page__hd flex-h">
- <view class="flex-v">
- <view>
- <view class="title">{{text1}}</view>
- <view class="title">{{text2}}</view>
- <view class="tag">娴嬭瘎鎴鏃堕棿锛歿{deadline}}</view>
- <image wx:if="{{hasScore}}" src="/res/icons/complete.png" class="t-image" mode="aspectFit"></image>
- </view>
- <view class="btn" bindtap="goto" data-index="0">{{text3}}</view>
- </view>
- <view class="progress" style="margin-right: 0px;">
- <cp-progress progress="{{score}}" />
- </view>
- </view>
-
- <view class="page__bd">
- <view style="margin-left: 10px;">鍒嗙被娴嬭瘎</view>
- <view class="top-card top-card_main" bindtap="goto" data-index="0">
- <image src="/res/icons/ass_3.png" mode="aspectFit"></image>
- <view>
- <view class="top-card__name">瀹堟硶鑷祴鏅鸿瘎</view>
- <view class="top-card__tag">鐐瑰嚮杩涜娴嬭瘎 ></view>
- </view>
- <!-- <mp-icon icon="arrow" class="" size="15" color="white"></mp-icon> -->
- </view>
- <view class="flex-h">
- <view class="flex-h_block" bindtap="goto" data-index="2">
- <view class="top-card">
- <image src="/res/icons/ass_2.png" mode="aspectFit"></image>
- <view>
- <view class="top-card__name">纰虫帓鏀炬櫤鑳戒及绠�</view>
- <view class="top-card__tag">鐐瑰嚮杩涜娴嬭瘎 ></view>
- </view>
- </view>
- </view>
- <view class="flex-h_block" bindtap="goto" data-index="3">
- <view class="top-card top-card_2">
- <image src="/res/icons/ass_1.png" mode="aspectFit"></image>
- <view>
- <view class="top-card__name">鍏朵粬涓撻」鑷祴</view>
- <view class="top-card__tag">鐐瑰嚮杩涜娴嬭瘎 ></view>
- </view>
- </view>
- </view>
- </view>
- <view style="margin-left: 10px;margin-top: 8px;">娴嬭瘎瓒嬪娍</view>
- <view class="fyui-panel line-chart-card">
- <view class="flex-h" style="padding: 4px;">
- <view></view>
- <picker bindchange="bindYearChange" data-type="planYear" value="{{planYear}}" mode="date" fields="year" end="{{maxYear}}">
- <view class="fyui-selector">
- {{planYear}}
- <mp-icon icon="arrow" class="icon-down" size="10" color="black"></mp-icon>
- </view>
- </picker>
- </view>
- <ec-canvas id="mychart-dom-line" canvas-id="mychart-line" ec="{{ ec }}"></ec-canvas>
- <!-- <template wx:else is="nodataPage"></template> -->
- </view>
-
- <view class="fyui-cell fyui-cell_select title">
- <view class="fyui-cell__bd">鍘嗗彶娴嬭瘎</view>
- <view class="fyui-cell__ft">鏌ョ湅鏇村</view>
- </view>
-
- <block wx:if="{{historys.length > 0}}">
- <view wx:for="{{historys}}" wx:key="index" data-index="index" class="flex-h" style="align-items: flex-start;">
- <view class="history_icon">
- <view class="history_icon_1">
- <view></view>
- </view>
- <view class="history_icon_2"></view>
- </view>
- <view style="flex: 1;">
- <view class="history_time">{{item.time}}</view>
- <view class="h-cell fyui-panel">
- <view class="h-tag">{{item.updateTime}}</view>
- <view class="h-line_1">
- <view class="flex-h">
- <view class="h-score" style="background-color: {{item.color}};">
- {{item.score}}
- </view>
- <view class="h-rank">
- <view>椋庨櫓鎺掑悕锛歿{item.rank}}</view>
- <view>椋庨櫓绛夌骇锛歿{item.level}}</view>
- </view>
- </view>
- <view data-id="{{item.scoreId}}" class="h-btn" bindtap="goto" data-index="1" data-period="{{item.period}}">鍘荤湅鐪�</view>
- </view>
- </view>
- </view>
- </view>
- </block>
-
- <template wx:else is="nodataPage"></template>
- </view>
- <view class="page__ft">
- </view>
-</view>
\ No newline at end of file
diff --git a/pages/mAssessment/assessment/assessment.wxss b/pages/mAssessment/assessment/assessment.wxss
deleted file mode 100644
index 1c152f1..0000000
--- a/pages/mAssessment/assessment/assessment.wxss
+++ /dev/null
@@ -1,192 +0,0 @@
-/* pages/assessment/assessment.wxss */
-.banner-bg {
- position: fixed;
- width: 100%;
- height: 50vh;
- background: linear-gradient(to bottom, #57E4CB, #bbf3eb);
- /* color: #dcfeea79; */
-}
-
-.page__hd {
- background: linear-gradient(to bottom, #57E4CB, #bbf3eb);
- padding-bottom: 4px;
-}
-
-.page__hd .title {
- font-size: 16px;
- font-weight: 600;
- margin-top: 8px;
-}
-
-.page__hd .tag {
- font-size: 10px;
- color: #55A37D;
- margin-top: 8px;
-}
-
-.page__hd .t-image {
- width: 100px;
- height: 100px;
-}
-
-.page__hd .btn {
- border-radius: 20px;
- line-height: 20px;
- background-color: #52be85;
- padding: 8px 4px;
- text-align: center;
- color: white;
-}
-
-.line-chart-card {
- position: relative;
- height: 30vh;
- padding: 0 0 8px 0;
-}
-
-.h-cell {
- padding: 16px 10px;
-}
-
-.h-score {
- background-color: #F0AE4E;
- border-radius: 50%;
- padding: 8px;
- width: 20px;
- height: 20px;
- color: white;
- font-size: 12px;
- text-align: center;
-}
-
-.h-line_1 {
- display: flex;
- justify-content: space-between;
- align-items: center;
-}
-
-.h-rank {
- font-size: 14px;
- margin-left: 4px;
-}
-
-.h-line_2 {
- display: flex;
- justify-content: space-between;
- font-size: 10px;
- color: var(--fyui-text-color_3);
- padding-left: 40px;
- padding-top: 4px;
- margin-top: 4px;
- border-top: 1px rgba(202, 202, 202, 0.295) solid;
- align-items: center;
-}
-
-.h-btn {
- border-radius: 4px;
- background: linear-gradient(to right, #6DF1A9, #62EBCF);
- padding: 4px 16px;
- color: white;
- font-size: 14px;
-}
-
-.h-tag{
- position: absolute;
- color: var(--fyui-text-color_3);
- font-size: 12px;
- text-align: end;
- bottom: 0;
- right: 8px;
-}
-
-.flex-h_block {
- flex: 1;
-}
-
-.top-card {
- position: relative;
- border-radius: 4px;
- /* background: linear-gradient(90deg, #A3D9F5, #88E1EC); */
- background-color: rgb(199, 199, 199);
- color: white;
- padding: 8px;
- margin-left: 10px;
- margin-right: 2px;
- display: flex;
- white-space: nowrap;
- text-overflow: ellipsis;
-}
-
-.top-card_2 {
- /* background: linear-gradient(90deg, #87CEB2, #6CD398); */
- background-color: rgb(199, 199, 199);
- margin-left: 2px;
- margin-right: 10px;
-}
-
-.top-card_main {
- background: linear-gradient(90deg, #55E2C9, #b6e9dc);
- margin-left: 10px;
- margin-right: 10px;
- margin-bottom: 4px;
-}
-
-.top-card>image {
- width: 40px;
- height: 40px;
- margin-right: 10px;
-}
-
-.top-card .top-card__tag {
- /* text-align: end; */
- font-size: 12px;
-}
-
-.top-card .top-card__name {
- font-size: 14px;
- /* width: 100%; */
- /* font-weight: 600; */
- /* text-align: center; */
- /* margin: 16px; */
-}
-
-.history_time{
- /* background-color: red; */
- margin-left: 10px;
- font-size: 14px;
- font-weight: 550;
-}
-
-.history_icon {
- width: 10vw;
- height: 100%;
- display: flex;
- flex-direction: column;
- justify-content: flex-start;
- align-items: center;
-}
-
-.history_icon .history_icon_1 {
- width: 22px;
- height: 22px;
- background-color: #8DF1E0;
- border-radius: 50%;
- opacity: 0.2;
- display: flex;
- justify-content: center;
- align-items: center;
-}
-
-.history_icon .history_icon_1>view {
- width: 11px;
- height: 11px;
- background: #1addbd;
- border-radius: 50%;
- z-index: 10;
-}
-
-.history_icon .history_icon_2 {
- width: 0px;
- height: 100px;
- border: 1px dashed #80EFDC;
-}
\ No newline at end of file
diff --git a/pages/mExtra/pSupervisionchange/pSupervisionchange.wxml b/pages/mExtra/pSupervisionchange/pSupervisionchange.wxml
index 06689c7..f23063f 100644
--- a/pages/mExtra/pSupervisionchange/pSupervisionchange.wxml
+++ b/pages/mExtra/pSupervisionchange/pSupervisionchange.wxml
@@ -19,20 +19,50 @@
<block wx:if="{{item.proPics.length > 0}}">
<view class="text-2">闂鍥剧墖</view>
<view class="img-group">
- <view wx:for="{{item.proPics}}" wx:for-index="index2" wx:key="index2" wx:for-item="m">
- <image class="img-group_img" src="{{m}}" mode="aspectFill" bindtap="previewImage" data-type="pro" data-index="{{[index, index2]}}"></image>
+ <view
+ wx:for="{{item.proPics}}"
+ wx:for-index="index2"
+ wx:key="index2"
+ wx:for-item="m"
+ >
+ <image
+ class="img-group_img"
+ src="{{m}}"
+ mode="aspectFill"
+ bindtap="previewImage"
+ data-type="pro"
+ data-index="{{[index, index2]}}"
+ ></image>
</view>
</view>
</block>
<block wx:if="{{item.changePics.length > 0}}">
<view class="text-2">鏁存敼鍥剧墖</view>
<view class="img-group">
- <view wx:for="{{item.changePics}}" wx:for-index="index2" wx:key="index2" wx:for-item="m">
- <image class="img-group_img" src="{{m}}" mode="aspectFill" bindtap="previewImage" data-type="change" data-index="{{[index, index2]}}"></image>
+ <view
+ wx:for="{{item.changePics}}"
+ wx:for-index="index2"
+ wx:key="index2"
+ wx:for-item="m"
+ >
+ <image
+ class="img-group_img"
+ src="{{m}}"
+ mode="aspectFill"
+ bindtap="previewImage"
+ data-type="change"
+ data-index="{{[index, index2]}}"
+ ></image>
</view>
</view>
</block>
- <button bindtap="changeProblem" disabled="{{item.ischanged}}" data-index="{{index}}">{{item.ischanged ? '宸叉暣鏀�' : '鏁存敼'}}</button>
+ <button
+ bindtap="changeProblem"
+ disabled="{{item.ischanged}}"
+ data-index="{{index}}"
+ >
+ {{item.ischanged ? '宸叉暣鏀�' : '鏁存敼'}}
+ </button>
</view>
</block>
<template wx:else is="nodataPage"></template>
@@ -43,5 +73,12 @@
<mp-icon type="filled" icon="error" size="60" color="white"></mp-icon>
<view>{{reason}}</view>
</view>
- <my-gallery hide-on-click="{{true}}" show-delete="{{false}}" show="{{showPreview}}" img-urls="{{previewImageUrls}}" current="{{previewCurrent}}" title="{{title}}"></my-gallery>
-</view>
\ No newline at end of file
+ <my-gallery
+ hide-on-click="{{true}}"
+ show-delete="{{false}}"
+ show="{{showPreview}}"
+ img-urls="{{previewImageUrls}}"
+ current="{{previewCurrent}}"
+ title="{{title}}"
+ ></my-gallery>
+</view>
diff --git a/pages/mExtra/pSupervisionchangeDetail/pSupervisionchangeDetail.wxml b/pages/mExtra/pSupervisionchangeDetail/pSupervisionchangeDetail.wxml
index 92f125f..4a4c2b9 100644
--- a/pages/mExtra/pSupervisionchangeDetail/pSupervisionchangeDetail.wxml
+++ b/pages/mExtra/pSupervisionchangeDetail/pSupervisionchangeDetail.wxml
@@ -3,8 +3,7 @@
<view class="page">
<view class="banner-bg"></view>
- <view class="page__hd">
- </view>
+ <view class="page__hd"> </view>
<view class="page__bd">
<block wx:if="{{problemList.length > 0}}">
<view wx:for="{{problemList}}" wx:key="index" class="card-subtask">
@@ -16,32 +15,74 @@
<block wx:if="{{item.proPics.length > 0}}">
<view class="text-2">闂鍥剧墖</view>
<view class="img-group">
- <view wx:for="{{item.proPics}}" wx:for-index="index2" wx:key="index2" wx:for-item="m">
- <image class="img-group_img" src="{{m}}" mode="aspectFill" bindtap="previewImage" data-type="pro" data-index="{{[index, index2]}}"></image>
+ <view
+ wx:for="{{item.proPics}}"
+ wx:for-index="index2"
+ wx:key="index2"
+ wx:for-item="m"
+ >
+ <image
+ class="img-group_img"
+ src="{{m}}"
+ mode="aspectFill"
+ bindtap="previewImage"
+ data-type="pro"
+ data-index="{{[index, index2]}}"
+ ></image>
</view>
</view>
</block>
<block wx:if="{{item.changePics.length > 0}}">
<view class="text-2">鏁存敼鍥剧墖</view>
<view class="img-group">
- <view wx:for="{{item.changePics}}" wx:for-index="index2" wx:key="index2" wx:for-item="m">
- <image class="img-group_img" src="{{m}}" mode="aspectFill" bindtap="previewImage" data-type="change" data-index="{{[index, index2]}}"></image>
+ <view
+ wx:for="{{item.changePics}}"
+ wx:for-index="index2"
+ wx:key="index2"
+ wx:for-item="m"
+ >
+ <image
+ class="img-group_img"
+ src="{{m}}"
+ mode="aspectFill"
+ bindtap="previewImage"
+ data-type="change"
+ data-index="{{[index, index2]}}"
+ ></image>
</view>
</view>
</block>
<block wx:else>
- <mp-upload title="涓婁紶鍙拌处鍥剧墖" titleClass="upload-title-class" max-count="3" files="{{imgFiles}}" binduploadImg="uploadFile" binddelete="delImg"></mp-upload>
+ <mp-upload
+ title="涓婁紶鍙拌处鍥剧墖"
+ titleClass="upload-title-class"
+ max-count="3"
+ files="{{imgFiles}}"
+ binduploadImg="uploadFile"
+ binddelete="delImg"
+ ></mp-upload>
</block>
- <button bindtap="submitDialog" disabled="{{item.ischanged}}" data-index="{{index}}">{{item.ischanged ? '宸叉暣鏀�' : '涓婁紶'}}</button>
+ <button
+ bindtap="submitDialog"
+ disabled="{{item.ischanged}}"
+ data-index="{{index}}"
+ >
+ {{item.ischanged ? '宸叉暣鏀�' : '涓婁紶'}}
+ </button>
</view>
</block>
<template wx:else is="nodataPage"></template>
</view>
- <view class="page__ft">
-
- </view>
+ <view class="page__ft"> </view>
<c-dialog show="{{showDialog}}" yes="纭" bindconfirm="changeProblem">
<view>纭鏄惁鎻愪氦鏁存敼锛�</view>
</c-dialog>
- <my-gallery hide-on-click="{{true}}" show-delete="{{false}}" show="{{showPreview}}" img-urls="{{previewImageUrls}}" current="{{previewCurrent}}" title="{{title}}"></my-gallery>
-</view>
\ No newline at end of file
+ <my-gallery
+ hide-on-click="{{true}}"
+ show-delete="{{false}}"
+ show="{{showPreview}}"
+ img-urls="{{previewImageUrls}}"
+ current="{{previewCurrent}}"
+ title="{{title}}"
+ ></my-gallery>
+</view>
diff --git a/pages/mService/behaviors/bScheduleManager.js b/pages/mService/behaviors/bScheduleManager.js
index 1704cb5..156adee 100644
--- a/pages/mService/behaviors/bScheduleManager.js
+++ b/pages/mService/behaviors/bScheduleManager.js
@@ -12,37 +12,47 @@
// behaviors: [bLoadingStatus],
properties: {
ledgerCompleted: {
- type: Boolean,
- observer(value) {
- this.checkScheduleComplete(0, value);
- },
- },
- assessmentCompleted: {
- type: Boolean,
+ type: Number,
observer(value) {
this.checkScheduleComplete(1, value);
},
},
+ assessmentCompleted: {
+ type: Number,
+ observer(value) {
+ this.checkScheduleComplete(2, value);
+ },
+ },
},
data: {
+ // 鍏ㄩ儴鐜繚鏃ョ▼
allSchedules: [],
+ // 褰撳墠鐢ㄦ埛鏈�涓磋繎鏈畬鎴愭棩绋�
thisSchedule: {},
+ // 褰撳墠鐢ㄦ埛鏈�涓磋繎鏈畬鎴愭棩绋嬬储寮�
index: 0,
+ // 鍙拌处鍜岃嚜璇勬湰鏈熷畬鎴愭儏鍐�
+ scheduleComplete: new Map(),
+ // 闇�瑕佸仛鏃ョ▼鏄惁瀹屾垚鍒ゆ柇鐨勬棩绋嬩釜鏁帮紙鍙拌处鍜岃嚜璇勶級
+ scheduleCount: 2,
},
lifetimes: {
attached: function () {
- this.getRecentSchedule();
- this.getSchedules();
- if (app.globalData.newUser) {
- this.nextSchedules();
- }
- // this.getAllSchedules()
+ this.setData({
+ scheduleComplete: new Map(),
+ });
+ this.getAllSchedules().then(() => {
+ this.getRecentSchedule();
+ if (app.globalData.newUser) {
+ this.nextSchedules();
+ }
+ });
+ // this.getSchedules();
},
},
methods: {
+ // 鑾峰彇鏈�閭昏繎鐨勪竴涓幆淇濈郴缁熸棩绋�
getSchedules() {
- // let startTime = '2023-04-10';
- // let endTime = '2023-04-10';
let startTime = moment().format('YYYY-MM-DD');
let endTime = startTime;
const that = this;
@@ -51,6 +61,9 @@
{
success(res) {
if (res.data.length > 0) {
+ res.data.sort(
+ (a, b) => Math.abs(a.diffDays) - Math.abs(b.diffDays),
+ );
const schedule = res.data[0];
schedule.time = moment(schedule.time.split('T')[0]).format(
'YYYY-MM-DD',
@@ -71,7 +84,7 @@
getRecentSchedule() {
//1. 浠庢帴鍙h幏鍙栫敤鎴蜂釜浜恒�佺敤鎴蜂紒涓氱被鍨嬬殑鐩稿叧鏈�涓磋繎鏃ョ▼
//2. 鎸夌収鏈湴閫昏緫锛屽緱鍑烘渶閭昏繎鏃ョ▼
- const schedules = sysSchedules();
+ const schedules = this.data.allSchedules;
//2.1 灏嗗彴璐︺�佽瘎浼般�佹壙璇轰笁椤笰PP鍔熻兘瀹氫箟涓烘棩绋�
//2.2 閫夋嫨鏈�閭昏繎鐨勪簨椤逛綔涓哄綋鏃ョ殑鎻愰啋浜嬮」,
let today = moment().hour(0).minute(0).second(0).millisecond(0);
@@ -80,8 +93,8 @@
let index = 0;
for (let i = 0; i < schedules.length; i++) {
let s = schedules[i];
- let d = s.time.diff(today, 'days');
- s.diffDays = d;
+ let d = s.diffDays;
+ // if (d == -8) {
if (Math.abs(d) < Math.abs(diffDays)) {
let _index = i;
@@ -93,60 +106,52 @@
//2.3 鏃ョ▼鍦ㄦ椂闂寸淮搴︿笂鍒嗕负涓夌被鎻愰啋锛岄鍛娿�佸綋鏃ャ�佹湭瀹屾垚鐨勯�炬湡鎻愰啋
this.setData({
- allSchedules: schedules,
- // thisSchedule: {
- // date: schedule.time,
- // time: schedule.time.format('YYYY-MM-DD dddd'),
- // type: schedule.type,
- // events: schedule.events,
- // diffDays: schedule.diffDays,
- // },
+ thisSchedule: schedule,
index,
});
},
//鑾峰彇鎵�鏈夋棩绋�
getAllSchedules() {
- const schedules = sysSchedules();
- this.setData({
- allSchedules: schedules,
+ return sysSchedules().then(res => {
+ this.setData({
+ allSchedules: res,
+ });
});
},
// 褰撳墠鏃ョ▼瀹屾垚锛岄『寤朵笅涓�涓棩绋�
nextSchedules() {
- let today = moment().hour(0).minute(0).second(0).millisecond(0);
let s = this.data.allSchedules[this.data.index + 1];
- let d = s.time.diff(today, 'days');
- s.diffDays = d;
-
this.setData({
- thisSchedule: {
- date: s.time,
- time: s.time.format('YYYY-MM-DD'),
- type: s.type,
- events: s.events,
- diffDays: s.diffDays,
- },
+ thisSchedule: s,
index: this.data.index + 1,
});
},
- // 妫�鏌ュ綋鍓嶆棩绋嬫槸鍚﹀畬鎴�
- checkScheduleComplete(type, value) {
+ // 妫�鏌ュ綋鍓嶆棩绋嬫槸鍚﹀畬鎴�(2023.8.24 鐩墠鍙秹鍙婂彴璐﹀拰鑷瘎涓ょ被鏃ョ▼)
+ checkScheduleComplete(scId, value) {
+ const { scheduleComplete, scheduleCount } = this.data;
+ scheduleComplete.set(scId, value);
+ // 鍙拌处鍜岃嚜璇勭殑缁撴灉鍏ㄩ儴浼犲叆鍚庡啀鍋氬垽鏂�
+ if (scheduleComplete.size < scheduleCount) return;
// 鏂扮敤鎴蜂笉鍋氬垽鏂�
if (app.globalData.newUser) return;
- // 鏃ョ▼绫诲瀷涓嶄竴鑷存棤闇�鍒ゆ柇
- if (this.data.thisSchedule.type != type) return;
- // 鏃ョ▼涓嶅湪褰撴湀鐨勬棤闇�鍒ゆ柇
- const thisMonth = moment().month();
- const sTimeMonth = moment(this.data.thisSchedule.date).month();
- if (thisMonth != sTimeMonth) return;
- // 鏃ョ▼瀹屾垚鍒欓『寤朵笅涓棩绋�
- if (value) {
- this.nextSchedules();
- }
+ let index = 0;
+ const thisMonth = moment().month();
+ do {
+ const { thisSchedule } = this.data;
+ // 鏃ョ▼涓嶅湪褰撴湀鐨勬棤闇�鍒ゆ柇
+ const sTimeMonth = moment(thisSchedule.time).month();
+ if (thisMonth != sTimeMonth) return;
+
+ // 鍒ゆ柇褰撴湀璇ユ棩绋嬫槸鍚﹀畬鎴愶紝瀹屾垚鍒欏皢褰撳墠鏃ョ▼椤哄欢鑷充笅涓�涓�
+ if (scheduleComplete.get(thisSchedule.id) == 2) {
+ this.nextSchedules();
+ }
+ index++
+ } while (index < scheduleCount);
},
},
});
diff --git a/pages/mService/cSchedule/cSchedule.wxml b/pages/mService/cSchedule/cSchedule.wxml
index b521a7d..637c86f 100644
--- a/pages/mService/cSchedule/cSchedule.wxml
+++ b/pages/mService/cSchedule/cSchedule.wxml
@@ -12,6 +12,9 @@
<text>宸ヤ綔鏃ョ▼</text>
</view>
<view class="schedule-title">{{thisSchedule.title}}</view>
+ <view wx:if="{{thisSchedule.content}}" class="schedule-time"
+ >{{thisSchedule.content}}</view
+ >
<view class="schedule-time">
<text>{{thisSchedule.time}}</text>
<view class="schedule-time__right">
diff --git a/pages/mService/pSchedule/pSchedule.js b/pages/mService/pSchedule/pSchedule.js
index 3f0b61a..b5732ee 100644
--- a/pages/mService/pSchedule/pSchedule.js
+++ b/pages/mService/pSchedule/pSchedule.js
@@ -1,77 +1,79 @@
-// pages/mService/pSchedule/pSchedule.js
-import bScheduleManager from '../behaviors/bScheduleManager'
-const moment = require('../../../utils/moment.min')
+import sysSchedules from '../../../data/schedules';
+import moment from "../../../utils/moment.min";
Page({
- behaviors: [bScheduleManager],
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
totals: 0,
- schedules: [{
- category: '2022骞�9鏈堢幆淇濆伐浣滄棩绋�',
- details: [{
- time: '9鏈�10鏃�',
- name: '鐜繚鏃ョ▼',
- left: 3,
- }]
- }]
+ schedules: [
+ // {
+ // category: '2022骞�9鏈堢幆淇濆伐浣滄棩绋�',
+ // details: [
+ // {
+ // time: '9鏈�10鏃�',
+ // name: '鐜繚鏃ョ▼',
+ // left: 3,
+ // },
+ // ],
+ // },
+ ],
},
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
*/
onLoad(options) {
- // const now = moment().hour(0).minute(0).second(0).millisecond(0)
- // const year = now.year()
- const schedules = []
- let totals = this.data.allSchedules.length
+ sysSchedules().then(res => this.parseAllSchedules(res));
+ },
- const map = new Map()
- for (let i = 0; i < this.data.allSchedules.length; i++) {
- const s = this.data.allSchedules[i];
- s.events.forEach(e => {
- if (!map.has(e.category)) {
- map.set(e.category, [])
- }
- map.get(e.category).push({
- time: s.time.format('MM鏈圖D鏃�'),
- name: e.name,
- left: s.diffDays,
- s: s
- })
+ parseAllSchedules(allSchedules) {
+ const schedules = [];
+ let totals = allSchedules.length;
+
+ const map = new Map();
+ for (let i = 0; i < allSchedules.length; i++) {
+ const s = allSchedules[i];
+ const _time = moment(s.time)
+ const category = `${_time.year()}骞�${_time.month() + 1}鏈堢幆淇濆伐浣滄棩绋媊
+ if (!map.has(category)) {
+ map.set(category, []);
+ }
+ map.get(category).push({
+ time: _time.format('MM鏈圖D鏃�'),
+ name: s.title,
+ left: s.diffDays,
+ s: s,
});
}
for (let item of map) {
schedules.push({
category: item[0],
- details: item[1]
- })
+ details: item[1],
+ });
}
this.setData({
schedules,
- totals
- })
+ totals,
+ });
},
goto(e) {
- var that = this
- const index = e.currentTarget.dataset.index
- const s = that.data.schedules[index[0]].details[index[1]].s
- const _s = {
- time: s.time.format('YYYY-MM-DD dddd'),
- events: s.events,
- diffDays: s.diffDays,
- steps: s.steps,
- category: s.category
- }
- console.log(that.data.schedules);
+ const index = e.currentTarget.dataset.index;
+ const s = this.data.schedules[index[0]].details[index[1]].s;
+ // const _s = {
+ // time: s.time.format('YYYY-MM-DD dddd'),
+ // events: s.events,
+ // diffDays: s.diffDays,
+ // steps: s.steps,
+ // category: s.category,
+ // };
wx.navigateTo({
url: '/pages/mService/pScheduledetail/pScheduledetail',
- success: (res) => {
- res.eventChannel.emit('acceptDataFromOpenerPage', _s)
+ success: res => {
+ res.eventChannel.emit('acceptDataFromOpenerPage', s);
},
- })
- }
-})
\ No newline at end of file
+ });
+ },
+});
diff --git a/pages/mUser/pAbout/pAbout.wxml b/pages/mUser/pAbout/pAbout.wxml
index 063baae..8e4c5bf 100644
--- a/pages/mUser/pAbout/pAbout.wxml
+++ b/pages/mUser/pAbout/pAbout.wxml
@@ -19,7 +19,7 @@
</view>
</view>
<view class="page__ft">
- <view>涓氬姟鎸囧锛氫笂娴峰競鐢熸�佺幆澧冨眬鎵ф硶鎬婚槦</view>
+ <!-- <view>涓氬姟鎸囧锛氫笂娴峰競鐢熸�佺幆澧冨眬鎵ф硶鎬婚槦</view> -->
<view>鎶�鏈敮鎸侊細涓婃捣椋炵窘鐜繚绉戞妧鏈夐檺鍏徃</view>
</view>
</view>
\ No newline at end of file
diff --git a/pages/mUser/sceneauthentication/industrial/index.wxml b/pages/mUser/sceneauthentication/industrial/index.wxml
index cc87766..7b1b826 100644
--- a/pages/mUser/sceneauthentication/industrial/index.wxml
+++ b/pages/mUser/sceneauthentication/industrial/index.wxml
@@ -56,7 +56,11 @@
bind:click="onDeleteDevice"
/>
</view>
- <c-form form="{{item}}" data-index="{{index}}" bind:itemChange="onDeviceChange"></c-form>
+ <c-form
+ form="{{item}}"
+ data-index="{{index}}"
+ bind:itemChange="onDeviceChange"
+ ></c-form>
<!-- <template is="sceneInfo" data="{{ msg: item }}" /> -->
<!-- <view style="padding: 0 10px;background-color: white;">
<mp-cells>
diff --git a/pages/mUser/userlogin/userlogin.wxml b/pages/mUser/userlogin/userlogin.wxml
index 62ccab7..45c6929 100644
--- a/pages/mUser/userlogin/userlogin.wxml
+++ b/pages/mUser/userlogin/userlogin.wxml
@@ -18,7 +18,7 @@
</view>
</view>
<view class="page__ft">
- <view>涓氬姟鎸囧锛氫笂娴峰競鐢熸�佺幆澧冨眬鎵ф硶鎬婚槦</view>
+ <!-- <view>涓氬姟鎸囧锛氫笂娴峰競鐢熸�佺幆澧冨眬鎵ф硶鎬婚槦</view> -->
<view>鎶�鏈敮鎸侊細涓婃捣椋炵窘鐜繚绉戞妧鏈夐檺鍏徃</view>
</view>
</view>
\ No newline at end of file
diff --git a/service/baserequest.js b/service/baserequest.js
index f56f380..22a05a5 100644
--- a/service/baserequest.js
+++ b/service/baserequest.js
@@ -44,12 +44,15 @@
fun.url = bUrl + url;
}
var fun1 = util.deepCopy(fun);
+ if (mode == 'debug') {
+ console.log(
+ '|------------------------------------------------------------------------------------------------------------',
+ );
+ console.log('|--璁块棶: ', fun.url);
+ console.log('|--鍙傛暟: ', fun.data);
+ }
fun1.success = function (res) {
if (mode == 'debug') {
- console.log(
- '|------------------------------------------------------------------------------------------------------------',
- );
- console.log('|--璁块棶: ', fun.url);
console.log('|--缁撴灉: ', res);
}
@@ -73,8 +76,7 @@
};
fun1.fail = function (error) {
if (mode == 'debug') {
- console.log('--------------璇锋眰閿欒----------------' + fun.url);
- console.log(error);
+ console.log('|--閿欒: ', error);
}
wx.showToast({
title: '璇锋眰澶辫触',
--
Gitblit v1.9.3