yangyongyong 4 år sedan
förälder
incheckning
716828685a

+ 103 - 0
client/pages/servant/servantedit/servantedit.acss

@@ -0,0 +1,103 @@
+.servant-settings-page{
+  background-color: #F3F3F3;
+}
+.servant-setting-header{
+  height: 62rpx;
+  line-height: 62rpx;
+  background-color: #E6F7FF;
+  color: #09AFFF;
+  padding-left: 35rpx;
+  padding-right: 24rpx;
+  font-size: 22rpx;
+}
+.notice-style{
+  width: 23rpx;
+  height: 22rpx;
+  margin-right: 10rpx;
+  float: left;
+  margin-top: 21rpx;
+}
+.close-stle{
+  width: 17.87rpx;
+  height: 17.87rpx;
+  float: right;
+  margin-top: 20rpx;
+}
+.setting-list{
+  background: #FFFFFF;
+  border-radius: 18px;
+  margin: 25.99rpx 24rpx 20rpx 24rpx;
+}
+.setting-list-title{
+  color: #333333;
+  font-size: 32rpx;
+  font-weight: bold;
+  text-align: center;
+  height: 80rpx;
+  line-height: 80rpx;
+  padding-right: 24rpx; 
+}
+.setting-list-title text{
+  font-size: 26rpx;
+  float: right;
+}
+.setting-list-titlelabel{
+  width: 72prx;
+  height: 80rpx;
+  font-size: 24rpx;
+  font-weight: 400;
+  color: #999999;
+  line-height: 80rpx;
+  display: inline-block;
+  float: left;
+  margin-left: 24rpx;
+}
+.icon-left{
+  width: 9rpx;
+  height: 16rpx;
+  margin-right: 7rpx;
+}
+.setting-list-item{
+  padding-left: 44rpx;
+  padding-top: 37rpx;
+  border-top: 1rpx solid #EEEEEE;
+  padding-bottom: 37rpx;
+}
+.item-title{
+  color: #333333;
+  font-size: 28rpx;
+  font-weight: bold;
+  height: 28rpx;
+  line-height: 28rpx;
+  margin-bottom: 31rpx;
+  display: inline-block;
+}
+.item-body{
+  margin-bottom: 24rpx;
+  padding-left: 20rpx;
+}
+
+.item-body textarea{
+  background-color: #EEEEEE;
+  border: none;
+  height: 110rpx;
+  margin-left: 40rpx;
+  margin-right: 86rpx;
+  color: #CCCCCC;
+  font-size: 24rpx;
+  padding: 12rpx;
+  width: 80%;
+}
+.checkbox {
+  display: block;
+  margin-bottom: 20rpx;
+}
+
+button + button {
+  margin-top: 32rpx;
+}
+
+.checkbox-text {
+  font-size:34rpx;
+  line-height: 1.2;
+}

+ 42 - 0
client/pages/servant/servantedit/servantedit.axml

@@ -0,0 +1,42 @@
+<view class="servant-settings-page">
+<!--服务设置-->
+  <view class="servant-setting-header">
+    <image mode="scaleToFill" src="/image/notice-blue.png" class="notice-style"/>
+    <text>您可以查看保姆偏好,双向沟通更清晰</text>
+    <image mode="scaleToFill" src="/image/close-blue.png" class="close-stle"/>
+  </view>
+  <!--服务列表-->
+  <view class="setting-list" a:for="{{servantlist}}" key="{{index}}">
+    <view a:if="{{item.show}}" class="setting-list-title" data-id="{{item.subtypeNo}}">
+      {{item.subjectType}}
+    </view>
+    <view a:if="{{item.show}}" class="setting-list-item" a:for="{{item.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>
+      <view class="item-body" a:if="{{subjectitem.isCustom==1}}">
+        <textarea placeholder="请输入文字" onBlur="customanswer" data-id="{{subjectitem.subjectId}}">{{subjectitem.customAnswer}}</textarea>
+      </view>
+    </view>
+  <!--提交按钮-->
+  <view  a:if="{{item.show}}" class="common-button-wrapper">
+     <button type="primary"  data-id="{{item.subtypeNo}}" class="common-button" hover-class="active-button" onTap="{{item.button=='完成'?'dailytasksdeit':'loadclasslistadd'}}" >{{item.button}}</button>
+  </view>
+  </view>
+</view>

+ 39 - 0
client/pages/servant/servantedit/servantedit.js

@@ -0,0 +1,39 @@
+import request from '../../../util/http'
+import apiUrl from '../../../util/apiUrl1'
+import util from '../../../util/util'
+import moment from 'moment'
+var app = getApp();
+
+Page({
+  data: {
+    servanteditlist:[],
+  },
+  onLoad(subtypeNo) {
+    this.loadpage(subtypeNo);
+  },
+  loadpage(subtypeNo){
+    let params = {}
+    request.httpServiceGet(apiUrl.getSubjectWhenEdit, params).then(data => {
+      if (data.length > 0) {
+        //加载全部的类别
+        let subjectList={};
+        for(let i=0;i<data.length;i++){
+          if(data[i].subtypeNo==subtypeNo){
+              subjectList.push(data[i]);
+              console.log(subjectList);
+          }
+        }
+
+        this.setData({
+          servanteditlist: subjectList
+        });
+      } else {
+        this.setData({
+          servanteditlist: []
+        });
+      }
+    }).catch(e => {
+      console.log(e);
+    })
+  },
+});

+ 1 - 0
client/pages/servant/servantedit/servantedit.json

@@ -0,0 +1 @@
+{}