From f14ea940fb32105de8b592992e3f53c62f31d84d Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 22 一月 2026 16:42:51 +0800
Subject: [PATCH] 2026.1.22
---
pages/mSelfPatrol/components/self-patrol/index.js | 73 ++++++++++++++++++++++++++++++++----
1 files changed, 65 insertions(+), 8 deletions(-)
diff --git a/pages/mSelfPatrol/components/self-patrol/index.js b/pages/mSelfPatrol/components/self-patrol/index.js
index 6a27a13..6154bc9 100644
--- a/pages/mSelfPatrol/components/self-patrol/index.js
+++ b/pages/mSelfPatrol/components/self-patrol/index.js
@@ -16,11 +16,14 @@
data: {
refresh: false,
thisMonth: '',
- tags1: { count: 0 },
+ tags1: {
+ count: 0,
+ },
pageList1: [],
// 鏄惁鏈夋潈闄愬彲浠ヨ繘琛岃嚜宸℃煡鎵胯
promiseValid: app.globalData.userSetting.selfPatrolPromise,
- promised: false
+ // 鏄惁宸叉壙璇�
+ promised: false,
},
lifetimes: {
@@ -37,7 +40,9 @@
const now = moment();
const nowStr = now.format('YYYY-MM-DD');
const thisMonth = now.format('YYYY骞碝M鏈�');
- this.setData({ thisMonth });
+ this.setData({
+ thisMonth,
+ });
this.getLedgerType(nowStr, r => {
this.setData({
tags1: {
@@ -50,14 +55,29 @@
refresh: false,
});
});
+ this.getPromise();
},
+ /**
+ * 鏌ヨ鐢ㄦ埛鏄惁瀹屾垚鑷贰鏌ユ壙璇�
+ */
getPromise() {
- configservice.fetchUserSettingRecord(app.globalData.accessToken.userId, {
- success: res => {
-
- },
- })
+ if (this.data.promiseValid) {
+ configservice.fetchUserSettingRecord(
+ app.globalData.accessToken.userId,
+ {
+ success: res => {
+ const nowYear = moment().year();
+ const promiseYear = moment(res.data?.lastPromisedTime).year();
+ this.setData({
+ promised:
+ res.data?.selfPatrolPromised == true &&
+ nowYear == promiseYear,
+ });
+ },
+ },
+ );
+ }
},
getLedgerType(time, success, lastMonth) {
@@ -118,5 +138,42 @@
},
});
},
+
+ /**
+ * 璺宠浆鑷宠嚜宸℃煡鎵胯鐣岄潰
+ */
+ gotoPromise() {
+ wx.navigateTo({
+ url: '/pages/mSelfPatrol/patrolpromise/index',
+ events: {
+ doPromiseDone: data => {
+ this.setData({
+ promised: data.promised,
+ });
+ },
+ },
+ success: res => {
+ // 閫氳繃 eventChannel 鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
+ res.eventChannel.emit('acceptDataFromOpenerPage', {
+ review: false,
+ });
+ },
+ });
+ },
+
+ /**
+ * 鏌ョ湅鑷贰鏌ユ壙璇�
+ */
+ reviewPromise() {
+ wx.navigateTo({
+ url: '/pages/mSelfPatrol/patrolpromise/index',
+ success: res => {
+ // 閫氳繃 eventChannel 鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
+ res.eventChannel.emit('acceptDataFromOpenerPage', {
+ review: true,
+ });
+ },
+ });
+ },
},
});
--
Gitblit v1.9.3