index.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import { payHistory } from '../utils/service';
  2. import { reportCmPV_YL } from '../utils/cloudMonitorHelper';
  3. import { history, mapToArray } from '../utils';
  4. Component({
  5. props: {
  6. componentData: {}
  7. },
  8. didMount() {
  9. const {
  10. status,
  11. serviceCode
  12. } = this.$page.options;
  13. const query = {
  14. serviceCode,
  15. status
  16. };
  17. if (status === '0') {
  18. my.setNavigationBar({
  19. title: '诊间缴费'
  20. });
  21. reportCmPV_YL({
  22. title: '诊间缴费',
  23. query
  24. });
  25. } else if (status === '1,9') {
  26. my.setNavigationBar({
  27. title: '缴费查询'
  28. });
  29. reportCmPV_YL({
  30. title: '缴费查询',
  31. query
  32. });
  33. } else {
  34. reportCmPV_YL({
  35. title: '未知查询',
  36. query
  37. });
  38. }
  39. my.hideShareMenu(); // 隐藏分享按钮
  40. },
  41. methods: {
  42. async payHistory(params) {
  43. const {
  44. status
  45. } = this.$page.options;
  46. const [err, result] = await payHistory({ ...params,
  47. type: 3,
  48. status
  49. });
  50. if (result && result.list) {
  51. result.list.forEach(item => {
  52. item.customInfo = mapToArray(item.customInfo);
  53. });
  54. }
  55. return [err, { ...result
  56. }];
  57. },
  58. onItemClick(value) {
  59. const outTradeNo = value.target.dataset.detail.outTradeNo || '';
  60. history.openPage({
  61. pageType: 'payment-details',
  62. data: {
  63. outTradeNo
  64. }
  65. });
  66. }
  67. }
  68. });