insure.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. (function () {
  2. var page = {
  3. isScroll: true,
  4. init: function ($page) {
  5. $page.find('#select3').lrpicker({
  6. placeholder: '请选择(必填)',
  7. data: cityData,
  8. level: 3
  9. });
  10. var cityid = 10;
  11. renlian.http.get("http://czapp.rltest.cn/?s=api/get_insure_info&cityid="+cityid,{}, function (res) {
  12. if (res) {
  13. var insuredata = [];
  14. $.each(res.data, function (_index, _item) {
  15. //console.log(_item);
  16. insuredata.push({value:_index,text:_item.InsuranceName});
  17. $page.find('#checkbox1').lrcheckbox({
  18. data:insuredata
  19. });
  20. });
  21. }
  22. });
  23. /*var $this = $(this);
  24. var html = '';
  25. var insure_info = '{"0":{"data":"人车险","price":"100元"},"1":{"data":"被盗险","price":"110元"}}'
  26. if(insure_info){
  27. insureinfo = JSON.parse(insure_info);
  28. $.each(insureinfo, function (_index, _item) {
  29. html += '<button type="button" class="lr-btn lr-btn-block">'+ _item.data +'</button>';
  30. });
  31. html += '<button type="button" class="lr-btn-primary lr-btn-block">立即支付</button>\
  32. <button type="button" class="lr-btn-primary lr-btn-block">查看订单</button>';
  33. $page.find('#insure-button').append(html);
  34. $('.lr-btn-block').on('click',function () {
  35. $(".lr-btn-block").attr("lr-btn","lr-btn-primary");
  36. });
  37. }else{
  38. html += '<h4>暂无保险</h4>'
  39. $page.find('#insure-button').append(html);
  40. }*/
  41. var html = '';
  42. html += '<button type="button" class="lr-btn-primary lr-btn-block">立即支付</button>\
  43. <button type="button" class="lr-btn-primary lr-btn-block">查看订单</button>';
  44. $page.find('#insure-button').append(html);
  45. $('.lr-btn-block').on('click',function () {
  46. $(".lr-btn-block").attr("lr-btn","lr-btn-primary");
  47. });
  48. }
  49. };
  50. return page;
  51. })();