Browse Source

偏好列表

yangyongyong 4 years ago
parent
commit
2fa3813183

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

@@ -18,7 +18,7 @@
     </view>
     </view>
     <view a:if="{{item.show}}" class="setting-list-item" a:for="{{item.subjectList}}" a:for-item="subjectitem" key="{{subjectindex}}">
     <view a:if="{{item.show}}" class="setting-list-item" a:for="{{item.subjectList}}" a:for-item="subjectitem" key="{{subjectindex}}">
       <view  a:if="{{subjectitem.isChoose}}" >
       <view  a:if="{{subjectitem.isChoose}}" >
-        <text class="item-title">{{subjectitem.subject}}</text>
+        <text class="item-title">{{subjectitem.index}}.{{subjectitem.subject}}</text>
           <view a:if="{{subjectitem.chooseType==1}}"> <!---单选-->
           <view a:if="{{subjectitem.chooseType==1}}"> <!---单选-->
             <checkbox-group onChange="answerselectedSingle"  data-id="{{subjectitem.subjectId}}">
             <checkbox-group onChange="answerselectedSingle"  data-id="{{subjectitem.subjectId}}">
               <label class="checkbox" a:for="{{subjectitem.answer}}"  a:for-item="answeritem" key="label-{{answerindex}}">
               <label class="checkbox" a:for="{{subjectitem.answer}}"  a:for-item="answeritem" key="label-{{answerindex}}">

+ 7 - 0
client/pages/servant/servantsettings/servantsettings.js

@@ -19,6 +19,7 @@ Page({
         let servantlist = data;
         let servantlist = data;
         var that = this;
         var that = this;
         for(let i=0;i<servantlist.length;i++){
         for(let i=0;i<servantlist.length;i++){
+          //添加是否展示tab
           if(i==0){
           if(i==0){
           servantlist[i].show=true;
           servantlist[i].show=true;
           }
           }
@@ -31,6 +32,12 @@ Page({
             servantlist[i].button="下一步";
             servantlist[i].button="下一步";
           }
           }
           servantlist[i].index=i+1;
           servantlist[i].index=i+1;
+          //给每个题目添加编号
+          let t=1;
+          for(let j=0;j<servantlist[i].subjectList.length;j++){
+            servantlist[i].subjectList[j].index=t;
+            t++;
+          }
         }
         }
         this.setData({
         this.setData({
           servantlist: servantlist
           servantlist: servantlist