paymentList.js 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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.isdown()
  21. }
  22. },
  23. up : {
  24. height:50,
  25. contentinit: '',
  26. contentdown: '',
  27. contentrefresh : "正在加载...",
  28. contentnomore:'没有更多数据了',
  29. callback: function() {
  30. iscrollState='up'
  31. myVue.isup()
  32. }
  33. }
  34. }
  35. })
  36. var myVue=new Vue({
  37. el: "#app",
  38. data: {
  39. data:{},
  40. dataList:[],
  41. length:1,
  42. cardlenght:0,
  43. id:"",
  44. queryList:{
  45. month:"",
  46. healthNo:"",
  47. chargeType:"1", //1:门诊,2:住院,
  48. pageNo:1,
  49. pageSize:10,
  50. },
  51. code:"",
  52. 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:"支付宝支付"}],
  53. healthType:["","门诊缴费","住院缴费"],
  54. isUPsuccess:true, //上拉锁,搜索成功则释放
  55. },
  56. mounted: function() {
  57. var vm = this
  58. checkUserAgent();
  59. vm.checkType()
  60. vm.code=JSON.parse(localStorage.getItem("wlyyAgent")).uid
  61. vm.queryList.month=new Date().getFullYear()+"-"+(new Date().getMonth()+1)
  62. vm.eventClick()
  63. },
  64. methods: {
  65. //获取就诊卡
  66. getData:function(){
  67. var vm=this
  68. loading.showModal();
  69. sendPost("patient/card/getCardList", {patient:vm.code}, "json", "get",function(){
  70. loading.close();
  71. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
  72. }, function(res){
  73. if(res.status == 200){
  74. if(res.data.length>0){
  75. vm.cardlenght=res.data.length
  76. if(Request.id){
  77. vm.data=res.data.filter(function(item){
  78. return item.id==Request.id
  79. })[0]
  80. if(!vm.data){
  81. vm.data=res.data.filter(function(item){
  82. return item.isDefault==1
  83. })[0]
  84. }
  85. }else{
  86. vm.data=res.data.filter(function(item){
  87. return item.isDefault==1
  88. })[0]
  89. }
  90. if(!vm.data){
  91. vm.data=res.data[0]
  92. }
  93. vm.queryList.healthNo=vm.data.cardNo
  94. vm.getList(1)
  95. }else{
  96. dialog({
  97. content: "请先绑定就诊卡,再查看就诊缴费信息!",
  98. okValue: '确定',
  99. ok: function(){
  100. window.location.href='../../payment/html/patientIDCards.html';
  101. },
  102. // cancelValue: '我再看看',
  103. // cancel: function(){}
  104. }).showModal()
  105. }
  106. }else{
  107. loading.close();
  108. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
  109. }
  110. })
  111. },
  112. //获取列表数据
  113. getList:function(pageNo){
  114. var vm=this
  115. if(pageNo){
  116. vm.queryList.pageNo=pageNo
  117. vm.dataList=[]
  118. vm.isUPsuccess=true
  119. }
  120. sendPost("third/hy/pay/gerPayOrderList", vm.queryList, "json", "get",function(){
  121. loading.close();
  122. mui('#wrapper').pullRefresh().endPulldownToRefresh(false);
  123. mui('#wrapper').pullRefresh().enablePullupToRefresh();//重置
  124. mui('#wrapper').pullRefresh().endPullupToRefresh(false);
  125. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
  126. }, function(res){
  127. loading.close();
  128. if(vm.queryList.pageNo==1){
  129. vm.length=0
  130. }
  131. if(res.status == 200){
  132. vm.isUPsuccess=true
  133. vm.dataList.push.apply(vm.dataList,res.data)
  134. vm.length+=vm.dataList.length
  135. if(iscrollState=="down"){
  136. mui('#wrapper').pullRefresh().endPulldownToRefresh(false);
  137. mui('#wrapper').pullRefresh().enablePullupToRefresh();//重置
  138. }else{
  139. if(res.data.length<vm.queryList.pageSize){
  140. mui('#wrapper').pullRefresh().endPullupToRefresh(true);
  141. }else{
  142. mui('#wrapper').pullRefresh().endPullupToRefresh(false);
  143. }
  144. }
  145. }else{
  146. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
  147. mui('#wrapper').pullRefresh().endPulldownToRefresh(false);
  148. mui('#wrapper').pullRefresh().enablePullupToRefresh();//重置
  149. mui('#wrapper').pullRefresh().endPullupToRefresh(false);
  150. }
  151. })
  152. },
  153. //跳转到订单结果页
  154. gotoResult:function(item){
  155. var vm=this
  156. window.location.href='../../payment/html/paymentResult.html?healthType='+item.healthType+"&patientName="+item.patientName+"&healthNo="+item.healthNo+"&payAmount="+item.payAmount+"&seqNo="+item.seqNo+"&createDate="+item.createDate+"&hyStatus="+item.hyStatus;
  157. },
  158. //跳转切换就诊卡
  159. changeCards:function(){
  160. window.location.href='../../payment/html/changeCards.html?pre=paymentList';
  161. },
  162. //绑定事件-时间
  163. eventClick:function(){
  164. var vm=this
  165. $('.date-icon').mobiscroll({
  166. preset: 'date',
  167. dateOrder: 'yymm',
  168. dateFormat: 'yy-mm',
  169. theme: 'ios',
  170. lang:'zh',
  171. minDate: new Date(2015,1),
  172. maxDate: new Date(),
  173. onSelect: function(valueText, inst){
  174. if(vm.queryList.month!=valueText){
  175. vm.queryList.month=valueText
  176. vm.getList(1)
  177. }
  178. },
  179. });
  180. },
  181. //跳转我的就诊卡页面
  182. gotoCards:function(){
  183. window.location.href='../../payment/html/patientIDCards.html';
  184. },
  185. //判断是否验证登录通过
  186. checkType:function(){
  187. var vm=this
  188. var timer = setInterval(function(){
  189. if(checktype){
  190. clearInterval(timer);
  191. vm.getData()
  192. }
  193. },10);
  194. },
  195. isdown:function(){
  196. // alert(12)
  197. this.getList(1)
  198. },
  199. isup:function(){
  200. // alert(13)
  201. if(this.isUPsuccess){
  202. this.queryList.pageNo++
  203. this.isUPsuccess=false
  204. }
  205. this.getList()
  206. },
  207. },
  208. })
  209. })()
  210. function queryInit(){
  211. checktype=true
  212. }