Quellcode durchsuchen

change the dialog of the jpush, file rlmui.js

git vor 5 Jahren
Ursprung
Commit
4460a4af27
3 geänderte Dateien mit 14 neuen und 10 gelöschten Zeilen
  1. 4 3
      pages/my/mybaodan/mybaodan.html
  2. 5 5
      pages/my/mybaodan/mybaodan.js
  3. 5 2
      scripts/rlmui.js

+ 4 - 3
pages/my/mybaodan/mybaodan.html

@@ -2,11 +2,11 @@
 <!--     <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" id='total'>
+    <div class="lr-list lr-contactInfo-list" id='total' style="display: none">
     <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>
-<!--     <div class="lr-list-item" style="text-align: center;font-size: 20px;font-weight:bold;" id="detailList">套餐包含</div> -->
+    <div class="lr-list-item" id="detailList"><div>结束日期</div><span class="endTime"></span></div>
+<!--     <div class="lr-list-item" style="text-align: center;font-size: 20px;font-weight:bold;">套餐包含</div> -->
 <!--     <div class="lr-list-item"><div style="font-weight: bold;">险种1</div></div>
     <div class="lr-list-item"><div>险种名称</div><span class="weChat">111111</span></div>
     <div class="lr-list-item"><div>保单编号</div><span class="oICQ">1111111</span></div>
@@ -14,4 +14,5 @@
     <div class="lr-list-item"><div>险种名称</div><span class="weChat">2222222</span></div>
     <div class="lr-list-item"><div>保单编号</div><span class="oICQ">222222222</span></div> -->
     </div>
+    <div id="message" style="margin-left: 39%;margin-top: 70%;font-size: 20px;font-weight: bold;display: none;">暂无保险信息</div>
 </div>

+ 5 - 5
pages/my/mybaodan/mybaodan.js

@@ -12,21 +12,21 @@
             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>';
+                 $('#total').css('display','block');
+                 var str = '<div class="lr-list-item" style="text-align: center;font-size: 20px;font-weight:bold;">套餐包含</div>';
                  $('.insuranceName').text(res.data.insuranceName);
                  $('.startTime').text(res.data.insureInfo.StartDate);
                  $('.endTime').text(res.data.insureInfo.EndDate);
-                 if(res.data.insuranceDetailInfo){
+                 if(res.data.insuranceDetailInfo != null){
                  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);
                }
-                 $('#detailList').after(str);
                }
                else{
-                  $('#total').css('display','none');
-
+                $('#message').css('display','block');
                }
          });
         }

+ 5 - 2
scripts/rlmui.js

@@ -200,7 +200,8 @@ u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(
             } else {
               alertContent = event.aps.alert;
             }
-            alert("open Notification:" + alertContent);
+            // alert("open Notification:" + alertContent);
+            renlian.layer.warning('通知', function () { }, alertContent, '确认');
           } catch (exception) {
             console.log("JPushPlugin:onOpenNotification" + exception);
           }
@@ -215,7 +216,8 @@ u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(
             }
             cordova.plugins.notification.badge.increase(1, function (badge) {
 				console.log("ReceiveNotification badge increase 1");
-			});
+            });
+            renlian.layer.warning('通知', function () { }, alertContent, '确认');
           } catch (exception) {
             console.log(exception)
           }
@@ -229,6 +231,7 @@ u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(
               message = event.content;
             }
             console.log("ReceiveMessage badge increase 1");
+            renlian.layer.warning('告警消息', function () { }, message, '确认');
           } catch (exception) {
             console.log("JPushPlugin:onReceiveMessage-->" + exception);
           }