123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- import { createSubscribe } from 'applet-page-component';
- import { getOrderList, getVisitList, getPayList } from '../utils/service';
- import { navigateTo } from '../utils/index';
- import { reportCmPV_YL } from '../utils/cloudMonitorHelper';
- const config = {
- order: {
- title: '预约记录'
- },
- visit: {
- title: '就诊记录'
- },
- charge: {
- title: '充值记录'
- }
- };
- Component(createSubscribe({
- onShow() {
- const {
- type
- } = this.data;
- if (type === 'order' && getApp().globalData.cancelReservation) {
- getApp().globalData.cancelReservation = false;
- this.scrollFetch && this.scrollFetch.fetchList({
- pageIndex: 1
- }, true, true);
- }
- }
- })({
- data: {
- type: ''
- },
- didMount() {
- const {
- type,
- serviceCode
- } = getCurrentPages().pop().options;
- reportCmPV_YL({
- title: config[type].title,
- query: {
- serviceCode,
- type
- }
- });
- this.setData({
- type
- });
- },
- methods: {
- saveRef(ref) {
- this.scrollFetch = ref;
- },
- onService({
- pageIndex,
- pageSize,
- ...other
- }) {
- const {
- type
- } = this.data;
- if (type === 'order') {
- my.setNavigationBar({
- title: '预约记录'
- });
- return getOrderList({
- pageIndex,
- pageSize,
- ...other
- });
- } else if (type === 'visit') {
- my.setNavigationBar({
- title: '就诊记录'
- });
- return getVisitList({
- pageIndex,
- pageSize,
- ...other
- });
- } else if (type === 'charge') {
- my.setNavigationBar({
- title: '充值记录'
- });
- return getPayList({
- status: 1,
- type: 2,
- pageIndex,
- pageSize,
- ...other
- });
- }
- },
- toDetail(orderId) {
- navigateTo({
- url: `/pages/page-detail/index?queryId=${orderId}&type=${this.data.type}`
- });
- }
- }
- }));
|