import store from './store';
import { serviceReportCM } from '../../utils';

Page(store.register({
  data: {
  },

  onLoad(options) {
    const { serviceUUID = '', serviceCode = '', ...resParams } = options;
    serviceReportCM({ serviceUUID, serviceCode });
    this.commit({ serviceUUID, serviceCode, resParams });
    this.dispatch('init');
  },

  async onResume() {
    if (this.data.isExitApp) {
      my.call('exitApp');
    }
  },

  async onReloadHandle() {
    this.commit('$resetStore');
    await this.dispatch('init');
  },

}));
