qymljy пре 4 месеци
родитељ
комит
2c6bc9090c
3 измењених фајлова са 35 додато и 6 уклоњено
  1. 29 1
      prsx/calendar/index.js
  2. 4 4
      prsx/calendar/index.scss
  3. 2 1
      prsx/calendar/index.wxml

+ 29 - 1
prsx/calendar/index.js

@@ -18,6 +18,7 @@ Page({
     weekdays: ['日', '一', '二', '三', '四', '五', '六'],
     days: [], // 当前月份的日期数组
     selectedDate: '', // 格式:'2025-04-05'
+
   },
 
   onLoad() {
@@ -68,12 +69,39 @@ Page({
     // 本月
     for (let i = 1; i <= daysInMonth; i++) {
       const fullDate = this.formatDate(new Date(year, month - 1, i));
+      const daysData = {
+        '2026-01-06':{
+          follow:[
+            {followobj:'经销商'},
+            {followobj:'临床'}
+          ],
+          task:[]
+        },
+        '2026-01-08':{
+          follow:[
+            {followobj:'经销商'},
+            {followobj:'临床'}
+          ],
+          task:[]
+        },
+      }
+      // 默认值
+    let hasTask = false;
+    let hasFollow = false;
+
+    // 如果 daysData 包含当前日期,则更新 hasTask 和 hasFollow
+    if (daysData[fullDate]) {
+      hasTask = Array.isArray(daysData[fullDate].task) && daysData[fullDate].task.length > 0;
+      hasFollow = Array.isArray(daysData[fullDate].follow) && daysData[fullDate].follow.length > 0;
+    }
       days.push({
         day: i,
         type: 'current',
         fullDate,
         isToday: fullDate === today,
-        isSelected: fullDate === selected
+        isSelected: fullDate === selected,
+        hasTask,
+        hasFollow
       });
     }
 

+ 4 - 4
prsx/calendar/index.scss

@@ -255,13 +255,13 @@
 
 /* 今日样式(边框 or 背景) */
 .day.today {
-  color: #85b8ee;
-  font-weight: bold;
+  color: #007AFF;
+  // font-weight: bold;
 }
 
 /* 选中日期高亮 */
 .day.selected {
-  background-color: #85b8ee !important;
-  color: white !important;
+  background-color: #E7E9F0 !important;
+  
   font-weight: bold;
 }

+ 2 - 1
prsx/calendar/index.wxml

@@ -24,9 +24,10 @@
       <block wx:for="{{days}}" wx:key="index">
         <view class="day {{item.type}} {{item.isSelected ? 'selected' : ''}} {{item.isToday ? 'today' : ''}}" data-date="{{item.fullDate}}" bindtap="{{item.type === 'current' ? 'onDayTap' : ''}}">
           <text>{{ item.day }}</text>
+          <!-- <text>{{'数据'}}</text> -->
           <!-- 任务和跟进标记容器 -->
           <view class="dots-container" >
-            <text  class="dot task-dot">•</text>
+            <!-- <text  class="dot task-dot">•</text> -->
             <text  class="dot followup-dot" style="line-height: 1;margin-top: 1rpx;">•</text>
           </view>
         </view>