From 068be2757aa2d51e3f6604dae54287683160ad0e Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 19 一月 2026 17:29:48 +0800
Subject: [PATCH] 2026.1.19
---
pages/mSelfPatrol/components/self-patrol/index.wxml | 73 ++++----
pages/mSelfPatrol/components/self-patrol/index.wxss | 59 ++++++
config/loadConfig.js | 47 +++++
service/configservice.js | 30 +++
pages/mLedger/home/summary.wxss | 179 ++++++++++++++++++++++
project.private.config.json | 2
pages/mUser/behaviors/bLogin.js | 36 +++-
app.json | 1
pages/mLedger/home/index.js | 2
model/ledger.js | 3
service/baserequest.js | 8
pages/mSelfPatrol/patrolhome/index.wxml | 2
pages/mSelfPatrol/components/self-patrol/index.js | 12 +
pages/home/home.wxss | 1
14 files changed, 392 insertions(+), 63 deletions(-)
diff --git a/app.json b/app.json
index b3fdbf0..df36a76 100644
--- a/app.json
+++ b/app.json
@@ -24,7 +24,6 @@
"pages/mLearn/learn/learn",
"pages/mLearn/learfile/learnfile",
"pages/mLearn/learncase/learncase",
- "pages/mLedger/ledgerhome/ledgerhome",
"pages/mLedger/ledgerupload/ledgerupload",
"pages/mLedger/ledgerhistory/ledgerhistory",
"pages/mNotice/notice/notice",
diff --git a/config/loadConfig.js b/config/loadConfig.js
new file mode 100644
index 0000000..011d97a
--- /dev/null
+++ b/config/loadConfig.js
@@ -0,0 +1,47 @@
+/**
+ * 浠庢湇鍔″櫒鍔犺浇鍔ㄦ�侀厤缃�
+ */
+
+import configservice from '../service/configservice';
+
+const app = getApp();
+
+function loadConfig() {
+ const pList = [];
+ const userId = app.globalData.accessToken.userId;
+ const f1 = new Promise((resolve, reject) => {
+ configservice.fetchUserSetting(userId, {
+ success: res => {
+ if (res.data) {
+ app.globalData.userSetting = res.data
+ } else {
+ app.globalData.userSetting = {}
+ }
+ // 鍙拌处鎻愪氦鏈熼檺
+ if (app.globalData.userSetting.ledgerDeadline == undefined) {
+ app.globalData.userSetting.ledgerDeadline = 10
+ }
+ // 鑷贰鏌ユ槸鍚﹀厑璁告壙璇轰竴骞村唴鏃犻渶閲嶅鎻愪氦
+ if (app.globalData.userSetting.selfPatrolPromise == undefined) {
+ app.globalData.userSetting.selfPatrolPromise = false
+ }
+ wx.setStorage({
+ key: 'user_setting',
+ data: res.data,
+ });
+ console.log('app.globalData.userSetting', app.globalData.userSetting);
+ resolve()
+ },
+ fail: e => {
+ reject(e)
+ }
+ });
+ });
+
+ pList.push(f1);
+ return Promise.all(pList);
+}
+
+export {
+ loadConfig
+};
\ No newline at end of file
diff --git a/model/ledger.js b/model/ledger.js
index 8686e6c..4d3a254 100644
--- a/model/ledger.js
+++ b/model/ledger.js
@@ -1,7 +1,8 @@
const moment = require('../utils/moment.min');
+const app = getApp();
function name(params) {
- const DEADLINEDAY = 10;
+ const DEADLINEDAY = app.globalData.userSetting.ledgerDeadline;
let monthInfo = {
totalMust: 0,
finishedMust: 0,
diff --git a/pages/home/home.wxss b/pages/home/home.wxss
index 9d57cad..3cbd202 100644
--- a/pages/home/home.wxss
+++ b/pages/home/home.wxss
@@ -7,6 +7,7 @@
.page__title {
margin-left: 10px;
font-size: 18px;
+ font-weight: 600;
color: var(--fyui-text-color_1);
/* font-weight: 600; */
white-space: nowrap;
diff --git a/pages/mLedger/home/index.js b/pages/mLedger/home/index.js
index 858779d..9401309 100644
--- a/pages/mLedger/home/index.js
+++ b/pages/mLedger/home/index.js
@@ -16,7 +16,7 @@
Page({
//姣忔湀鍙拌处鎻愪氦鏈熼檺鏃�
- DEADLINEDAY: 10,
+ DEADLINEDAY: app.globalData.userSetting.ledgerDeadline,
behaviors: [useTab, useSummary, useToolbar, useList],
data: {
tabList: [],
diff --git a/pages/mLedger/home/summary.wxss b/pages/mLedger/home/summary.wxss
index 80b6162..ce9128c 100644
--- a/pages/mLedger/home/summary.wxss
+++ b/pages/mLedger/home/summary.wxss
@@ -1,13 +1,188 @@
-@import '../ledgerhome/ledgerhome.wxss';
+@import '../ledgerhome/ledgerhome.wxss';.banner-bg {
+ position: fixed;
+ width: 100%;
+ height: 60%;
+ background: linear-gradient(to bottom, #57E4CB, #83b6ae);
+}
+
+.page__hd {
+ /* text-align: center; */
+ display: flex;
+ flex-flow: column;
+ justify-content: flex-start;
+ /* color: #50854C; */
+ color: white;
+ padding: 8px 16px;
+}
+
+.card{
+ height: 26vh;
+ /* background-color: royalblue; */
+}
+
+.head_row{
+ display: flex;
+ /* padding: 0 30px; */
+ justify-content: space-between;
+ align-items: baseline;
+}
+
+.head_row_item{
+ text-align: center;
+ /* width: 20vw; */
+ flex: 1;
+ /* background-color: red; */
+}
+
+.head_row_item_tag{
+ font-size: 12px;
+ font-weight: 559;
+}
.head_right {
+ text-align: end;
+ font-size: 12px;
+ /* background-color: brown; */
+ margin-bottom: 8px;
+ vertical-align: middle;
display: flex;
justify-content: space-between;
align-items: center;
}
+.head_tag{
+ font-size: 12px;
+ color: white;
+}
+
.head_btn{
+ /* background-color: rgb(11, 90, 77);
+ padding: 4px 6px;
+ border-radius: 4px; */
background-color: initial;
padding: 4px 0px;
border-radius: 4px;
-}
\ No newline at end of file
+}
+
+.head_btn:active{
+ background-color: rgba(11, 90, 77, 0.5);
+}
+
+.head_tag>text {
+ font-size: 40px;
+ font-weight: 600;
+}
+
+.head_1 {
+ font-size: 30px;
+}
+
+.head_1_big{
+ font-size: 30px;
+}
+
+.head_3 {
+ font-size: 12px;
+ margin-bottom: 16px;
+}
+
+.page__bd {
+ padding-bottom: 0;
+}
+
+.swiper-tab{
+ width: 100%;
+ text-align: center;
+ line-height: 80rpx;
+ white-space: nowrap;
+ z-index: 2;
+ /* background-color: #65EAD2; */
+ /* background-color: #70ea65; */
+ /* padding: 2px; */
+}
+
+.swiper-tab_view{
+ /* background-color: blueviolet; */
+}
+
+.swiper-tab-list{
+ position: relative;
+ font-size: 30rpx;
+ display: inline-block;
+ min-width: 18%;
+ padding: 0 16px;
+ color: rgba(255, 255, 255, 0.658);
+}
+
+.swiper-tab-list__tag{
+ position: absolute;
+ top: 2px;
+ right: 4px;
+ font-size: 10px;
+ line-height: 16px;
+ width: 16px;
+ background-color: brown;
+ border-radius: 50%;
+}
+
+.on{
+ color: white;
+ font-weight: bold;
+ border-bottom: 4rpx solid white;
+}
+
+.swiper-box{
+ display: block;
+ top: 80rpx;
+ width: 100%;
+ margin-top: 1px;
+ background-color: white;
+}
+
+.ledger-group {
+ display: flex;
+ flex-wrap: wrap;
+ /* background-color: white; */
+ justify-content: flex-start;
+}
+
+.ledger-item {
+ position: relative;
+ width: 33.33333vw;
+ text-align: center;
+ /* background-color: teal; */
+ margin-top: 16px;
+ margin-bottom: 16px;
+ font-size: x-small;
+}
+
+.ledger-item:active{
+ background-color: var(--fyui-BG-COLOR-ACTIVE);
+}
+
+.ledger-icon {
+ width: 60px;
+ height: 60px;
+}
+
+.ledger-tag {
+ position: absolute;
+ right: 6vw;
+ top: 6px;
+ width: 32px;
+ height: 16px;
+ color: white;
+ padding: 1px;
+ border-radius: 50%;
+ font-size: 10px;
+}
+
+/* .head_right {
+
+} */
+
+/* .head_btn{
+ background-color: initial;
+ padding: 4px 0px;
+ border-radius: 4px;
+} */
\ No newline at end of file
diff --git a/pages/mSelfPatrol/components/self-patrol/index.js b/pages/mSelfPatrol/components/self-patrol/index.js
index 0ed29c7..6a27a13 100644
--- a/pages/mSelfPatrol/components/self-patrol/index.js
+++ b/pages/mSelfPatrol/components/self-patrol/index.js
@@ -1,4 +1,5 @@
import { parseSelfPatrol, refreshLedgerStatus } from '../../../../model/ledger';
+import configservice from '../../../../service/configservice';
const ledgerservice = require('../../../../service/ledgerservice');
const moment = require('../../../../utils/moment.min');
const app = getApp();
@@ -17,6 +18,9 @@
thisMonth: '',
tags1: { count: 0 },
pageList1: [],
+ // 鏄惁鏈夋潈闄愬彲浠ヨ繘琛岃嚜宸℃煡鎵胯
+ promiseValid: app.globalData.userSetting.selfPatrolPromise,
+ promised: false
},
lifetimes: {
@@ -48,6 +52,14 @@
});
},
+ getPromise() {
+ configservice.fetchUserSettingRecord(app.globalData.accessToken.userId, {
+ success: res => {
+
+ },
+ })
+ },
+
getLedgerType(time, success, lastMonth) {
var that = this;
ledgerservice.getLedgerSummary(
diff --git a/pages/mSelfPatrol/components/self-patrol/index.wxml b/pages/mSelfPatrol/components/self-patrol/index.wxml
index 3cb2435..2f71c5d 100644
--- a/pages/mSelfPatrol/components/self-patrol/index.wxml
+++ b/pages/mSelfPatrol/components/self-patrol/index.wxml
@@ -1,42 +1,39 @@
-<!-- <scroll-view
- bindrefresherrefresh="init"
- refresher-enabled
- refresher-triggered="{{refresh}}"
- scroll-y
- style="height: 90vh;"
-> -->
- <view class="self-patrol-static">
- <view> {{thisMonth}} </view>
- <view class="head_row">
- <view class="head_row_item">
- <view class="head_tag">鑷贰鏌ユ彁浜ゆ暟</view>
- <view class="head_1">{{finished}}</view>
- </view>
- <view class="head_row_item">
- <view class="head_tag">鑷贰鏌ユ彁浜ゅ崰姣�</view>
- <view class="head_1"
- >{{progress}}<text class="head_row_item_tag">%</text></view
- >
- </view>
+<view class="self-patrol-promise" bindtap="gotoPromise">
+ <t-icon name="notification-error" size="32rpx"/>
+ <text class="promise-text"></text>
+ <text class="promise_btn">鍘绘壙璇� ></text>
+</view>
+<view class="self-patrol-static">
+ <view class="head_right">
+ <view style="font-size: 14px"> {{thisMonth}} </view>
+ <text class="head_btn" bindtap="gotoHistory">鍘嗗彶璁板綍 ></text>
+ </view>
+ <view class="head_row">
+ <view class="head_row_item">
+ <view class="head_tag">鑷贰鏌ユ彁浜ゆ暟</view>
+ <view class="head_1">{{finished}}</view>
</view>
- <view class="head_right">
- <text class="head_btn" bindtap="gotoHistory">鍘嗗彶璁板綍 ></text>
+ <view class="head_row_item">
+ <view class="head_tag">鑷贰鏌ユ彁浜ゅ崰姣�</view>
+ <view class="head_1"
+ >{{progress}}<text class="head_row_item_tag">%</text></view
+ >
</view>
- <!-- <view class="self-patrol-progress">
+ </view>
+ <!-- <view class="self-patrol-progress">
<t-progress percentage="{{progress}}" />
</view> -->
- </view>
- <t-grid column="{{3}}" theme="card" gutter="{{40}}">
- <t-grid-item
- style="opacity: {{item.opacity}};"
- badge-props="{{ item.badge }}"
- wx:for="{{pageList1}}"
- wx:key="index"
- text="{{item.ledgerName}}"
- image="{{item.iconUrl}}"
- data-index="{{index}}"
- bindtap="gotoLedgerDetail"
- t-class-text="grid-item"
- />
- </t-grid>
-<!-- </scroll-view> -->
+</view>
+<t-grid column="{{3}}" theme="card" gutter="{{40}}">
+ <t-grid-item
+ style="opacity: {{item.opacity}};"
+ badge-props="{{ item.badge }}"
+ wx:for="{{pageList1}}"
+ wx:key="index"
+ text="{{item.ledgerName}}"
+ image="{{item.iconUrl}}"
+ data-index="{{index}}"
+ bindtap="gotoLedgerDetail"
+ t-class-text="grid-item"
+ />
+</t-grid>
diff --git a/pages/mSelfPatrol/components/self-patrol/index.wxss b/pages/mSelfPatrol/components/self-patrol/index.wxss
index 0e62477..2c6f50b 100644
--- a/pages/mSelfPatrol/components/self-patrol/index.wxss
+++ b/pages/mSelfPatrol/components/self-patrol/index.wxss
@@ -1,5 +1,53 @@
+.self-patrol-promise {
+ color: var(--fyui-text-color_1);
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ font-size: 12px;
+ padding: 8rpx 8rpx;
+ background-color: var(--fyui-primary-color-2);
+}
+.promise_btn {
+ font-weight: 600;
+ white-space: nowrap;
+}
+.promise-text {
+ /* white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis; */
+ position: relative;
+ display: -webkit-box;
+ -webkit-line-clamp: 1;
+ -webkit-box-orient: vertical;
+ overflow-x: hidden;
+ text-overflow: ellipsis;
+ width: 80%;
+ height: 20px;
+ line-height: 20px;
+}
+.promise-text::after {
+ content: "绛剧讲鑷贰鏌ユ壙璇猴紝鍙皢鑷贰鏌ユ湁鏁堟湡寤堕暱涓哄綋骞存湁鏁堬紒";
+ position: absolute;
+ top: 0;
+ left: 0%;
+ white-space: nowrap;
+ animation: scrollText 10s linear 0s infinite normal;
+}
+
+@keyframes scrollText {
+ 0% {
+ transform: translateX(100%); /* 寮�濮嬩綅缃� */
+ }
+ 100% {
+ transform: translateX(-100%); /* 缁撴潫浣嶇疆锛屾牴鎹渶瑕佽皟鏁� */
+ }
+}
+
.self-patrol-static {
- padding: 16rpx 32rpx;
+ margin: 16rpx 32rpx;
+ padding: 4rpx;
+ background-color: white;
+ border-radius: 8px;
}
.self-patrol-progress {
@@ -27,16 +75,18 @@
}
.head_right {
- text-align: end;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
font-size: 12px;
/* background-color: brown; */
margin-bottom: 8px;
- vertical-align: middle;
+ /* vertical-align: middle; */
}
.head_tag{
font-size: 12px;
- color: var(--fyui-text-color_3);
+ color: var(--fyui-text-color_2);
}
.head_btn{
@@ -44,6 +94,7 @@
padding: 4px 6px;
border-radius: 4px;
color: white;
+ white-space: nowrap;
}
.head_btn:active{
diff --git a/pages/mSelfPatrol/patrolhome/index.wxml b/pages/mSelfPatrol/patrolhome/index.wxml
index bbdf757..b55df0e 100644
--- a/pages/mSelfPatrol/patrolhome/index.wxml
+++ b/pages/mSelfPatrol/patrolhome/index.wxml
@@ -1,5 +1,5 @@
<view class="page">
- <view class="page__hd"></view>
+ <!-- <view class="page__hd"></view> -->
<view class="page__bd">
<t-self-patrol wx:if="{{!exist}}" />
<t-tabs wx:else sticky stickyProps="{{stickyProps}}" defaultValue="{{0}}">
diff --git a/pages/mUser/behaviors/bLogin.js b/pages/mUser/behaviors/bLogin.js
index 0ceb3dc..b048e37 100644
--- a/pages/mUser/behaviors/bLogin.js
+++ b/pages/mUser/behaviors/bLogin.js
@@ -1,5 +1,8 @@
import userservice from '../../../service/userservice'
import moment from '../../../utils/moment.min'
+import {
+ loadConfig
+} from "../../../config/loadConfig";
const app = getApp()
@@ -74,9 +77,10 @@
},
complete() {
// wx.hideLoading()
- that.setData({
- loading: false
- })
+ // 2026.1.19 鍔犺浇鐘舵�佺敱涓嬮潰閰嶇疆鑾峰彇鎺ュ彛 缁撴潫
+ // that.setData({
+ // loading: false
+ // })
}
})
},
@@ -84,6 +88,7 @@
},
gotoHomePage() {
+ var that = this
if (app.globalData.accessToken.userName == 'pcheck') {
wx.navigateTo({
url: '/pages/mExtra/pSupervisiontask/pSupervisiontask',
@@ -96,23 +101,34 @@
const now = moment()
app.globalData.newUser = now.diff(registerTime, 'months') <= 1
}
- console.log(app.globalData.newUser);
-
+ console.log('app.globalData.newUser', app.globalData.newUser);
app.globalData.userInfo = data
app.globalData.isLogin = true
wx.setStorage({
key: 'userInfo',
data: data,
success: (result) => {
- wx.switchTab({
- url: '/pages/home/home',
- })
- }
+ loadConfig().then(() => {
+ wx.switchTab({
+ url: '/pages/home/home',
+ })
+ })
+ .finally(() => {
+ that.setData({
+ loading: false,
+ });
+ });
+ },
+ fail: err => {
+ that.setData({
+ loading: false,
+ });
+ },
})
}
})
}
-
+
},
}
})
\ No newline at end of file
diff --git a/project.private.config.json b/project.private.config.json
index 3187788..1c41a23 100644
--- a/project.private.config.json
+++ b/project.private.config.json
@@ -5,5 +5,5 @@
},
"description": "椤圭洰绉佹湁閰嶇疆鏂囦欢銆傛鏂囦欢涓殑鍐呭灏嗚鐩� project.config.json 涓殑鐩稿悓瀛楁銆傞」鐩殑鏀瑰姩浼樺厛鍚屾鍒版鏂囦欢涓�傝瑙佹枃妗o細https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "ep-law-abiding",
- "libVersion": "3.3.4"
+ "libVersion": "3.11.2"
}
\ No newline at end of file
diff --git a/service/baserequest.js b/service/baserequest.js
index 22a05a5..7449b7e 100644
--- a/service/baserequest.js
+++ b/service/baserequest.js
@@ -10,8 +10,8 @@
const util = require('../utils/util.js');
// 灏忕▼搴忓悗鍙�
-// const baseUrl = "http://192.168.0.138:8082"
-const baseUrl = 'https://fyami.com.cn';
+const baseUrl = "http://192.168.1.9:8082"
+// const baseUrl = 'https://fyami.com.cn';
const bu = 'https://fyami.com.cn';
const basePicUrl = `${bu}/images/`;
const baseIconUrl = `${bu}/images/weixin/eplaw/`;
@@ -22,8 +22,8 @@
const spBu = "https://fyami.com.cn:447"
const spPicUrl = `${spBu}/images/`;
-// const mode = 'debug';
-const mode = 'prod';
+const mode = 'debug';
+// const mode = 'prod';
function request(fun, hostUrl) {
const bUrl = hostUrl ? hostUrl : baseUrl;
diff --git a/service/configservice.js b/service/configservice.js
index e69de29..c237e81 100644
--- a/service/configservice.js
+++ b/service/configservice.js
@@ -0,0 +1,30 @@
+const $f = require("./baserequest")
+
+module.exports = {
+
+ // 鑾峰彇鐢ㄦ埛鐨勪笟鍔″睘鎬ч厤缃俊鎭紙渚嬪鍙拌处涓婃姤鏃ユ湡锛岃嚜宸℃煡鏄惁闇�瑕佹壙璇虹瓑锛�
+ fetchUserSetting(userId, fun) {
+ let cb = {
+ url: `/config/user/setting`,
+ params: {
+ userId: userId,
+ }
+ }
+ Object.assign(cb, fun)
+
+ $f.get(cb)
+ },
+
+ // 鑾峰彇鐢ㄦ埛鐨勪笟鍔″睘鎬ч厤缃粨鏋滐紙渚嬪鑷贰鏌ユ槸鍚﹀凡缁忔壙璇虹瓑锛�
+ fetchUserSettingRecord(userId, fun) {
+ let cb = {
+ url: `/config/user/setting/record`,
+ params: {
+ userId: userId,
+ }
+ }
+ Object.assign(cb, fun)
+
+ $f.get(cb)
+ }
+}
\ No newline at end of file
--
Gitblit v1.9.3