paymentList.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. vm.gotoCards()
  89. }
  90. }else{
  91. loading.close();
  92. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
  93. }
  94. })
  95. },
  96. //获取列表数据
  97. getList:function(){
  98. var vm=this
  99. sendPost("third/hy/pay/gerPayOrderList", vm.queryList, "json", "get",function(){
  100. loading.close();
  101. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
  102. }, function(res){
  103. loading.close();
  104. if(res.status == 200){
  105. vm.dataList=res.data
  106. vm.length=vm.dataList.length
  107. }else{
  108. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
  109. }
  110. })
  111. },
  112. //跳转到订单结果页
  113. gotoResult:function(seqNo){
  114. window.location.href='../../payment/html/paymentResult.html?seqNo='+seqNo;
  115. },
  116. //跳转切换就诊卡
  117. changeCards:function(){
  118. window.location.href='../../payment/html/changeCards.html?pre=paymentList';
  119. },
  120. //绑定事件-时间
  121. eventClick:function(){
  122. var vm=this
  123. $('.date-icon').mobiscroll({
  124. preset: 'date',
  125. dateOrder: 'yymm',
  126. dateFormat: 'yy-mm',
  127. theme: 'ios',
  128. lang:'zh',
  129. minDate: new Date(2015,1),
  130. maxDate: new Date(),
  131. onSelect: function(valueText, inst){
  132. if(vm.queryList.month!=valueText){
  133. vm.queryList.month=valueText
  134. vm.getList()
  135. }
  136. },
  137. });
  138. },
  139. //跳转我的就诊卡页面
  140. gotoCards:function(){
  141. window.location.href='../../payment/html/patientIDCards.html';
  142. },
  143. //判断是否验证登录通过
  144. checkType:function(){
  145. var vm=this
  146. var timer = setInterval(function(){
  147. if(checktype){
  148. clearInterval(timer);
  149. vm.getData()
  150. }
  151. },10);
  152. },
  153. isdown:function(){
  154. // setTimeout(function(){
  155. mui('#wrapper').pullRefresh().endPulldownToRefresh(false);
  156. mui('#wrapper').pullRefresh().enablePullupToRefresh();//重置
  157. // },1000)
  158. },
  159. isup:function(){
  160. // setTimeout(function(){
  161. mui('#wrapper').pullRefresh().endPullupToRefresh(true);//true表示没有更多数据了
  162. // },1000)
  163. },
  164. },
  165. })
  166. })()
  167. function queryInit(){
  168. checktype=true
  169. }