paymentList.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. var Request = GetRequest();
  2. var checktype=false;
  3. var loading = dialog({
  4. contentType: 'load',
  5. skin: 'bk-popup',
  6. });
  7. var iscrollState='';//判断滑动方向
  8. (function() {
  9. mui.init({
  10. pullRefresh : {
  11. container:'#wrapper',
  12. down : {
  13. height:50,
  14. auto: false,
  15. contentdown : "下拉可以刷新",
  16. contentover : "释放立即刷新",
  17. contentrefresh : "正在刷新...",
  18. callback: function(){
  19. iscrollState='down'
  20. myVue.getList()
  21. myVue.isdown()
  22. }
  23. },
  24. up : {
  25. height:50,
  26. contentinit: '',
  27. contentdown: '',
  28. contentrefresh : "正在加载...",
  29. contentnomore:'没有更多数据了',
  30. callback: function() {
  31. iscrollState='up'
  32. myVue.isup()
  33. }
  34. }
  35. }
  36. })
  37. var myVue=new Vue({
  38. el: "#app",
  39. data: {
  40. data:{},
  41. dataList:[],
  42. length:1,
  43. cardlenght:0,
  44. id:"",
  45. queryList:{
  46. month:"",
  47. healthNo:""
  48. },
  49. code:"",
  50. payTypeList:[{},{type:"weixin",Img:"../images/weixinzhifu_icon.png",text:"微信支付"},{type:"xianjin",Img:"../images/xianjichongzhi_icon.png",text:"现金支付"},{type:"yinlian",Img:"../images/yinlianzhifu_icon.png",text:"银联支付"},{type:"zhifubao",Img:"../images/zhifubaozhifu_icon.png",text:"支付宝支付"}],
  51. healthType:["","就诊卡缴费","住院缴费"],
  52. },
  53. mounted: function() {
  54. var vm = this
  55. checkUserAgent();
  56. vm.checkType()
  57. vm.code=JSON.parse(localStorage.getItem("wlyyAgent")).uid
  58. vm.queryList.month=new Date().getFullYear()+"-"+(new Date().getMonth()+1)
  59. vm.eventClick()
  60. },
  61. methods: {
  62. //获取就诊卡
  63. getData:function(){
  64. var vm=this
  65. loading.showModal();
  66. sendPost("patient/card/getCardList", {patient:vm.code}, "json", "get",function(){
  67. loading.close();
  68. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
  69. }, function(res){
  70. if(res.status == 200){
  71. if(res.data.length>0){
  72. vm.cardlenght=res.data.length
  73. if(Request.id){
  74. vm.data=res.data.filter(function(item){
  75. return item.id==Request.id
  76. })[0]
  77. }else{
  78. vm.data=res.data.filter(function(item){
  79. return item.isDefault==1
  80. })[0]
  81. if(!vm.data){
  82. vm.data=res.data[0]
  83. }
  84. }
  85. vm.queryList.healthNo=vm.data.cardNo
  86. vm.getList()
  87. }else{
  88. dialog({
  89. content: "请先绑定就诊卡,再查看就诊缴费信息!",
  90. okValue: '确定',
  91. ok: function(){
  92. window.location.href='../../payment/html/patientIDCards.html';
  93. },
  94. // cancelValue: '我再看看',
  95. // cancel: function(){}
  96. }).showModal()
  97. }
  98. }else{
  99. loading.close();
  100. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
  101. }
  102. })
  103. },
  104. //获取列表数据
  105. getList:function(){
  106. var vm=this
  107. sendPost("third/hy/pay/gerPayOrderList", vm.queryList, "json", "get",function(){
  108. loading.close();
  109. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
  110. }, function(res){
  111. loading.close();
  112. if(res.status == 200){
  113. vm.dataList=res.data
  114. vm.length=vm.dataList.length
  115. }else{
  116. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
  117. }
  118. })
  119. },
  120. //跳转到订单结果页
  121. gotoResult:function(seqNo){
  122. window.location.href='../../payment/html/paymentResult.html?seqNo='+seqNo;
  123. },
  124. //跳转切换就诊卡
  125. changeCards:function(){
  126. window.location.href='../../payment/html/changeCards.html?pre=paymentList';
  127. },
  128. //绑定事件-时间
  129. eventClick:function(){
  130. var vm=this
  131. $('.date-icon').mobiscroll({
  132. preset: 'date',
  133. dateOrder: 'yymm',
  134. dateFormat: 'yy-mm',
  135. theme: 'ios',
  136. lang:'zh',
  137. minDate: new Date(2015,1),
  138. maxDate: new Date(),
  139. onSelect: function(valueText, inst){
  140. if(vm.queryList.month!=valueText){
  141. vm.queryList.month=valueText
  142. vm.getList()
  143. }
  144. },
  145. });
  146. },
  147. //跳转我的就诊卡页面
  148. gotoCards:function(){
  149. window.location.href='../../payment/html/patientIDCards.html';
  150. },
  151. //判断是否验证登录通过
  152. checkType:function(){
  153. var vm=this
  154. var timer = setInterval(function(){
  155. if(checktype){
  156. clearInterval(timer);
  157. vm.getData()
  158. }
  159. },10);
  160. },
  161. isdown:function(){
  162. // setTimeout(function(){
  163. mui('#wrapper').pullRefresh().endPulldownToRefresh(false);
  164. mui('#wrapper').pullRefresh().enablePullupToRefresh();//重置
  165. // },1000)
  166. },
  167. isup:function(){
  168. // setTimeout(function(){
  169. mui('#wrapper').pullRefresh().endPullupToRefresh(true);//true表示没有更多数据了
  170. // },1000)
  171. },
  172. },
  173. })
  174. })()
  175. function queryInit(){
  176. checktype=true
  177. }