Browse Source

2020-10-16好bug

yangyongyong 4 years ago
parent
commit
8e52054469

+ 2 - 2
client/pages/customer/taskreminder/taskreminder.js

@@ -7,7 +7,7 @@ Page({
   data: {
     showchangetime:false,
     nowselectTime:util.formatDate(new Date()),
-    datelist:[{title:"周一",date:0,cssName:'',id:1,day:0},{title:"周二",date:0,cssName:'',id:2,day:0},{title:"周三",date:0,cssName:'',id:3,day:0},{title:"周四",date:0,cssName:'',id:4,day:0},{title:"周五",date:0,cssName:'',id:5,day:0},{title:"周六",date:0,cssName:'',id:6,day:0},{title:"周天",date:0,cssName:'',id:7,day:0}],
+    datelist: [{ title: "周日", date: 0, cssName: '', id: 1, day: 0 },{ title: "周一", date: 0, cssName: '', id: 2, day: 0 }, { title: "周二", date: 0, cssName: '', id: 3, day: 0 }, { title: "周三", date: 0, cssName: '', id: 4, day: 0 }, { title: "周四", date: 0, cssName: '', id: 5, day: 0 }, { title: "周五", date: 0, cssName: '', id: 6, day: 0 }, { title: "周六", date: 0, cssName: '', id: 7, day: 0 }],
     isreminds:true,
     showcancelbox:false,
     cancellist:[{value:'1', label:'任务太多', checked:true},{value:'2', label:'我不会', checked:false},{value:'3', label:'任务不详细', checked:false}],
@@ -88,7 +88,7 @@ Page({
       nowDay:this.nowDay
     });//保存当前日
     this.nowDayOfWeek = this.now.getDay(); //今天是本周的第几天 
-    let dateStart = util.formatDate(new Date(this.nowYear, this.nowMonth, this.nowDay - this.nowDayOfWeek + 1));
+    let dateStart = util.formatDate(new Date(this.nowYear, this.nowMonth, this.nowDay - this.nowDayOfWeek));
     
     let weekdateday=[this.dateAdd(dateStart,0),this.dateAdd(dateStart,1),this.dateAdd(dateStart,2),this.dateAdd(dateStart,3),this.dateAdd(dateStart,4),this.dateAdd(dateStart,5),this.dateAdd(dateStart,6)];
     let weekdate=[this.datedayAdd(dateStart,0),this.datedayAdd(dateStart,1),this.datedayAdd(dateStart,2),this.datedayAdd(dateStart,3),this.datedayAdd(dateStart,4),this.datedayAdd(dateStart,5),this.datedayAdd(dateStart,6)];

+ 3 - 0
client/pages/servant/servantdetail/servantdetail.js

@@ -36,6 +36,9 @@ Page({
         });
       } else {
         console.log("aaa" + data[0])
+        for(let i=0;i<data.length;i++){
+          data[i]=(i+1)+'.'+data[i];
+        }
         this.setData({
           noServantList: true,
           noServantPic:false,

+ 8 - 3
client/pages/servant/servantedit/servantedit.acss

@@ -1,5 +1,6 @@
 .servant-settings-page{
   background-color: #F3F3F3;
+   padding:0 0 160rpx;
 }
 .servant-setting-header{
   height: 62rpx;
@@ -25,8 +26,12 @@
 }
 .setting-list{
   background: #FFFFFF;
-  border-radius: 18rpx;
-  margin: 25.99rpx 24rpx 20rpx 24rpx;
+   border-radius: 18rpx;
+  margin: 0 24rpx 30rpx 24rpx;
+}
+.settling-list-wrapper{
+  padding:26rpx 0 0;
+  background-color: #F3F3F3;
 }
 .setting-list-title{
   color: #333333;
@@ -82,7 +87,7 @@
   height: 110rpx;
   margin-left: 40rpx;
   margin-right: 86rpx;
-  color: #CCCCCC;
+  color: #333333;
   font-size: 24rpx;
   padding: 12rpx;
   width: 80%;

+ 31 - 29
client/pages/servant/servantedit/servantedit.axml

@@ -6,37 +6,39 @@
     <image mode="scaleToFill" src="/image/close-blue.png" class="close-stle" onTap="closeTip"/>
   </view>
   <!--服务列表-->
-  <view class="setting-list">
-    <view  class="setting-list-title">
-      {{servanteditlist.subjectType}}
-    </view>
-    <view class="setting-list-item" a:for="{{servanteditlist.subjectList}}" a:for-item="subjectitem" key="{{subjectindex}}">
-      <view  a:if="{{subjectitem.isChoose}}" >
-        <text class="item-title">{{subjectitem.subject}}</text>
-          <view a:if="{{subjectitem.chooseType==1}}"> <!---单选-->
-            <checkbox-group onChange="answerselectedSingle"  data-id="{{subjectitem.subjectId}}">
-              <label class="checkbox" a:for="{{subjectitem.answer}}"  a:for-item="answeritem" key="label-{{answerindex}}">
-                <checkbox value="{{answeritem.answer}}" checked="{{answeritem.isChoose}}" color="#09AFFF" />
-                <text class="checkbox-text">{{answeritem.answer}}</text>
-              </label>
-            </checkbox-group>                             
-          </view>
-          <view a:if="{{subjectitem.chooseType==2}}"><!---多选-->
-            <checkbox-group onChange="answerselected"  data-id="{{subjectitem.subjectId}}">
-              <label class="checkbox" a:for="{{subjectitem.answer}}"  a:for-item="answeritem" key="label-{{answerindex}}">
-                <checkbox value="{{answeritem.answer}}" checked="{{answeritem.isChoose}}" color="#09AFFF" />
-                <text class="checkbox-text">{{answeritem.answer}}</text>
-              </label>
-            </checkbox-group>                             
-          </view>
+  <view class="settling-list-wrapper">
+    <view class="setting-list">
+      <view  class="setting-list-title">
+        {{servanteditlist.subjectType}}
       </view>
-      <view class="item-body" a:if="{{subjectitem.isCustom==1}}">
-        <textarea placeholder="请输入文字" onBlur="customanswer" data-id="{{subjectitem.subjectId}}">{{subjectitem.customAnswer}}</textarea>
+      <view class="setting-list-item" a:for="{{servanteditlist.subjectList}}" a:for-item="subjectitem" key="{{subjectindex}}">
+        <view  a:if="{{subjectitem.isChoose}}" >
+          <text class="item-title">{{subjectitem.index}}.{{subjectitem.subject}}</text>
+            <view a:if="{{subjectitem.chooseType==1}}"> <!---单选-->
+              <checkbox-group onChange="answerselectedSingle"  data-id="{{subjectitem.subjectId}}">
+                <label class="checkbox" a:for="{{subjectitem.answer}}"  a:for-item="answeritem" key="label-{{answerindex}}">
+                  <checkbox value="{{answeritem.answer}}" checked="{{answeritem.isChoose}}" color="#09AFFF" />
+                  <text class="checkbox-text">{{answeritem.answer}}</text>
+                </label>
+              </checkbox-group>                             
+            </view>
+            <view a:if="{{subjectitem.chooseType==2}}"><!---多选-->
+              <checkbox-group onChange="answerselected"  data-id="{{subjectitem.subjectId}}">
+                <label class="checkbox" a:for="{{subjectitem.answer}}"  a:for-item="answeritem" key="label-{{answerindex}}">
+                  <checkbox value="{{answeritem.answer}}" checked="{{answeritem.isChoose}}" color="#09AFFF" />
+                  <text class="checkbox-text">{{answeritem.answer}}</text>
+                </label>
+              </checkbox-group>                             
+            </view>
+        </view>
+        <view class="item-body" a:if="{{subjectitem.isCustom==1}}">
+          <textarea placeholder="请输入文字" onBlur="customanswer" data-id="{{subjectitem.subjectId}}">{{subjectitem.customAnswer}}</textarea>
+        </view>
       </view>
+    <!--提交按钮-->
+    <view  class="common-button-wrapper">
+      <button type="primary"  data-id="{{item.subtypeNo}}" class="common-button" hover-class="active-button" onTap="dailytasksdeit" >提交</button>
+    </view>
     </view>
-  <!--提交按钮-->
-  <view  class="common-button-wrapper">
-     <button type="primary"  data-id="{{item.subtypeNo}}" class="common-button" hover-class="active-button" onTap="dailytasksdeit" >提交</button>
-  </view>
   </view>
 </view>

+ 6 - 1
client/pages/servant/servantedit/servantedit.js

@@ -26,9 +26,14 @@ Page({
               this.setData({
                   newSubTypeNo:data[i].subtypeNo
               })
-              console.log(subjectList);
           }
         }
+        //给每个题目添加编号
+        let t=1;
+        for(let j=0;j<subjectList.subjectList.length;j++){
+          subjectList.subjectList[j].index=t;
+          t++;
+        }
         this.setData({
           servanteditlist: subjectList
         });

+ 1 - 1
client/pages/servant/servantsettings/servantsettings.acss

@@ -87,7 +87,7 @@
   height: 110rpx;
   margin-left: 40rpx;
   margin-right: 86rpx;
-  color: #CCCCCC;
+  color: #333333;
   font-size: 24rpx;
   padding: 12rpx;
   width: 80%;

+ 2 - 2
client/pages/servant/taskreminder/taskreminder.js

@@ -6,7 +6,7 @@ Page({
   data: {
     showchangetime: false,
     nowselectTime: util.formatDate(new Date()),
-    datelist: [{ title: "周一", date: 0, cssName: '', id: 1, day: 0 }, { title: "周二", date: 0, cssName: '', id: 2, day: 0 }, { title: "周三", date: 0, cssName: '', id: 3, day: 0 }, { title: "周四", date: 0, cssName: '', id: 4, day: 0 }, { title: "周五", date: 0, cssName: '', id: 5, day: 0 }, { title: "周六", date: 0, cssName: '', id: 6, day: 0 }, { title: "周天", date: 0, cssName: '', id: 7, day: 0 }],
+    datelist: [{ title: "周日", date: 0, cssName: '', id: 1, day: 0 },{ title: "周一", date: 0, cssName: '', id: 2, day: 0 }, { title: "周二", date: 0, cssName: '', id: 3, day: 0 }, { title: "周三", date: 0, cssName: '', id: 4, day: 0 }, { title: "周四", date: 0, cssName: '', id: 5, day: 0 }, { title: "周五", date: 0, cssName: '', id: 6, day: 0 }, { title: "周六", date: 0, cssName: '', id: 7, day: 0 }],
     isreminds: true,
     showcancelbox: false,
     cancellist: [{ value: '1', label: '任务太多', checked: true }, { value: '2', label: '我不会', checked: false }, { value: '3', label: '任务不详细', checked: false }],
@@ -100,7 +100,7 @@ Page({
       nowDay: this.nowDay
     });//保存当前日
     this.nowDayOfWeek = this.now.getDay(); //今天是本周的第几天 
-    let dateStart = util.formatDate(new Date(this.nowYear, this.nowMonth, this.nowDay - this.nowDayOfWeek + 1));
+    let dateStart = util.formatDate(new Date(this.nowYear, this.nowMonth, this.nowDay - this.nowDayOfWeek));
 
     let weekdateday = [this.dateAdd(dateStart, 0), this.dateAdd(dateStart, 1), this.dateAdd(dateStart, 2), this.dateAdd(dateStart, 3), this.dateAdd(dateStart, 4), this.dateAdd(dateStart, 5), this.dateAdd(dateStart, 6)];
     let weekdate = [this.datedayAdd(dateStart, 0), this.datedayAdd(dateStart, 1), this.datedayAdd(dateStart, 2), this.datedayAdd(dateStart, 3), this.datedayAdd(dateStart, 4), this.datedayAdd(dateStart, 5), this.datedayAdd(dateStart, 6)];