import payIcon from '../static/images/hint.png';
import { mapState } from 'vuex';
import uni from '@/utils/uniHooks';

export default {
  onLoad(params) {
    const parkInfo = JSON.parse(uni.getStorageSync('parkinfo'));
    this.carno = params.carno;
    if (parkInfo && parkInfo.outParkCharging) {
      this.outParkCharging = parkInfo.outParkCharging;
    }
  },
  data() {
    return {
      carno: '',
      outParkCharging: 15,
      blueIcon: this.$picUrl + '/images/icon-success-blue.png',
      greenIcon: this.$picUrl + '/images/icon-success-green.png',
    };
  },
  computed: {
    ...mapState({
      custTypeId: (state) => state.custTypeId,
    }),
    icon() {
      return this.custTypeId === 0
        ? payIcon
        : this.custTypeId === 1
        ? this.blueIcon
        : this.greenIcon;
    },
  },
  mounted() {
    setTimeout(() => {
      uni.setNavigationBarTitle({
        title: '提示',
      });
    }, 300);
  },
  methods: {
    page_button() {
      this.$router.replace({
        path: 'parkingFeeList',
      });
    },
    page_button1() {
      this.$router.replace({
        path: 'home',
      });
    },
  },
};
