paymentList.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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. id = 0;
  20. iscrollState='down'
  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. id:"",
  44. queryList:{
  45. month:"",
  46. healthNo:""
  47. },
  48. code:"",
  49. 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:"支付宝支付"}],
  50. healthType:["","就诊卡缴费","住院缴费"],
  51. },
  52. mounted: function() {
  53. var vm = this
  54. checkUserAgent();
  55. vm.checkType()
  56. vm.code=JSON.parse(localStorage.getItem("wlyyAgent")).uid
  57. vm.queryList.month=new Date().getFullYear()+"-"+(new Date().getMonth()+1)
  58. vm.eventClick()
  59. },
  60. methods: {
  61. //获取就诊卡
  62. getData:function(){
  63. var vm=this
  64. loading.showModal();
  65. sendPost("patient/card/getCardList", {patient:vm.code}, "json", "get",function(){
  66. loading.close();
  67. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
  68. }, function(res){
  69. if(res.status == 200){
  70. if(res.data.length>0){
  71. if(Request.id){
  72. vm.data=res.data.filter(function(item){
  73. return item.id==Request.id
  74. })[0]
  75. }else{
  76. vm.data=res.data.filter(function(item){
  77. return item.isDefault==1
  78. })[0]
  79. if(!vm.data){
  80. vm.data=res.data[0]
  81. }
  82. }
  83. vm.queryList.healthNo=vm.data.cardNo
  84. vm.getList()
  85. }else{
  86. vm.gotoCards()
  87. }
  88. }else{
  89. loading.close();
  90. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
  91. }
  92. })
  93. },
  94. //获取列表数据
  95. getList:function(){
  96. var vm=this
  97. sendPost("third/hy/pay/gerPayOrderList", vm.queryList, "json", "get",function(){
  98. loading.close();
  99. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
  100. }, function(res){
  101. loading.close();
  102. if(res.status == 200){
  103. vm.dataList=res.data
  104. vm.length=vm.dataList.length
  105. }else{
  106. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
  107. }
  108. })
  109. },
  110. //跳转到订单结果页
  111. gotoResult:function(seqNo){
  112. window.location.href='../../payment/html/paymentResult.html?seqNo='+seqNo;
  113. },
  114. //跳转切换就诊卡
  115. changeCards:function(){
  116. window.location.href='../../payment/html/changeCards.html?pre=paymentList';
  117. },
  118. //绑定事件-时间
  119. eventClick:function(){
  120. var vm=this
  121. $('.date-icon').mobiscroll({
  122. preset: 'date',
  123. dateOrder: 'yymm',
  124. dateFormat: 'yy-mm',
  125. theme: 'ios',
  126. lang:'zh',
  127. minDate: new Date(2015,1),
  128. maxDate: new Date(),
  129. onSelect: function(valueText, inst){
  130. if(vm.queryList.month!=valueText){
  131. vm.queryList.month=valueText
  132. vm.getList()
  133. }
  134. },
  135. });
  136. },
  137. //跳转我的就诊卡页面
  138. gotoCards:function(){
  139. window.location.href='../../payment/html/patientIDCards.html';
  140. },
  141. //判断是否验证登录通过
  142. checkType:function(){
  143. var vm=this
  144. var timer = setInterval(function(){
  145. if(checktype){
  146. clearInterval(timer);
  147. vm.getData()
  148. }
  149. },10);
  150. },
  151. isdown:function(){alert(123)
  152. setTimeout(function(){
  153. mui('#wrapper').pullRefresh().endPulldownToRefresh(false);
  154. mui('#wrapper').pullRefresh().enablePullupToRefresh();//重置
  155. },1000)},
  156. isup:function(){alert(456)
  157. setTimeout(function(){
  158. mui('#wrapper').pullRefresh().endPullupToRefresh(false);//true表示没有更多数据了
  159. },1000)},
  160. },
  161. })
  162. })()
  163. function queryInit(){
  164. checktype=true
  165. }