Quellcode durchsuchen

fix display gender of the myInfo page

git vor 5 Jahren
Ursprung
Commit
b9be1f86aa
3 geänderte Dateien mit 11 neuen und 2 gelöschten Zeilen
  1. 1 1
      pages/my/mybaodan/mybaodan.html
  2. 8 0
      pages/my/mybaodan/mybaodan.js
  3. 2 1
      pages/my/userInfo/userInfo.js

+ 1 - 1
pages/my/mybaodan/mybaodan.html

@@ -2,7 +2,7 @@
 <!--     <div style="width: 100%;height: 100%;">
         <img style="max-width: 100%!important;max-height: 100%!important;width: auto;height: auto;" src="./images/developing.jpg" alt="">
     </div>  --> 
-    <div class="lr-list lr-contactInfo-list">
+    <div class="lr-list lr-contactInfo-list" id='total'>
     <div class="lr-list-item"><div>保险套餐</div><span class="insuranceName"></span></div>
     <div class="lr-list-item"><div>开始日期</div><span class="startTime"></span></div>
     <div class="lr-list-item"><div>结束日期</div><span class="endTime"></span></div>

+ 8 - 0
pages/my/mybaodan/mybaodan.js

@@ -11,15 +11,23 @@
             };
             renlian.http.post(config.webapi + "/?s=api/get_insurance_detail", postdata, function(res) {
                  console.log(res);
+                 if(res.data != null){
                  var str = '<div class="lr-list-item" style="text-align: center;font-size: 20px;font-weight:bold;" id="detailList">套餐包含</div>';
                  $('.insuranceName').text(res.data.insuranceName);
                  $('.startTime').text(res.data.insureInfo.StartDate);
                  $('.endTime').text(res.data.insureInfo.EndDate);
+                 if(res.data.insuranceDetailInfo){
                  for (var i = 0; i < res.data.insuranceDetailInfo.length; i++) {
                   str += ' <div class="lr-list-item"><div style="font-weight: bold;">险种'+ (i+1) + '</div></div><div class="lr-list-item"><div>险种名称</div><span class="weChat">' + res.data.insuranceDetailInfo[i].InsuranceTypeName + '</span></div><div class="lr-list-item"><div>保单编号</div><span class="oICQ">'
                     + res.data.insuranceDetailInfo[i].InsuranceTypeNo + '</span></div>';
                  }
+               }
                  $('#detailList').after(str);
+               }
+               else{
+                  $('#total').css('display','none');
+
+               }
          });
         }
     };

+ 2 - 1
pages/my/userInfo/userInfo.js

@@ -16,7 +16,8 @@
             $page.find('.my-gpsNumber').text(baseinfo.gpsNumber);
             $page.find('.enCode').text(baseinfo.enCode);
             $page.find('.realName').text(baseinfo.realName);
-            $page.find('.gender').text(baseinfo.gender == 1 ? '男' : '女');
+            $page.find('.gender').text(baseinfo.gender == 1 ? '女' : '男');
+            console.log(baseinfo.gender);
 
             if (baseinfo.companyId) {
                 renlian.clientdata.get('company', {