zhengyiming
2025-03-25 dca624a7e4c877dc4bfd8c496a6c2a6b29ad4b46
packages/components/src/views/RechargeGrid/RechargeGrid.vue
@@ -2,10 +2,16 @@
  <MainCell title="生活缴费">
    <Grid square :gutter="20" :column-num="2" class="recharge-grid-wrapper">
      <GridItem class="recharge-grid-item" text="话费" @click="emit('phoneBillRecharge')">
        <Dongdong />
        <img :src="IconFreePhone" class="recharge-grid-item-icon" />
        <div class="discountTag">{{ lifePayPhoneRate }}折</div>
      </GridItem>
      <GridItem class="recharge-grid-item" text="电费" @click="emit('electricityBillRecharge')">
        <Dongdong />
        <img :src="IconFreeDian" class="recharge-grid-item-icon" />
        <div class="discountTag">{{ lifePayElectricRate }}折</div>
      </GridItem>
      <GridItem class="recharge-grid-item" text="燃气" @click="emit('gasBillRecharge')">
        <img :src="IconFreeGas" class="recharge-grid-item-icon" />
        <div class="discountTag">{{ lifePayGasRate }}折</div>
      </GridItem>
    </Grid>
  </MainCell>
@@ -14,7 +20,10 @@
<script setup lang="ts">
import MainCell from '../../components/Layout/MainCell.vue';
import { Grid, GridItem } from '@nutui/nutui-taro';
import { Dongdong } from '@nutui/icons-vue-taro';
import IconFreePhone from '../../assets/icon-free-phone.png';
import IconFreeDian from '../../assets/icon-free-dian.png';
import IconFreeGas from '../../assets/icon-free-gas.png';
import { useGetRate } from '../../hooks';
defineOptions({
  name: 'RechargeGrid',
@@ -27,5 +36,8 @@
const emit = defineEmits<{
  (e: 'phoneBillRecharge'): void;
  (e: 'electricityBillRecharge'): void;
  (e: 'gasBillRecharge'): void;
}>();
const { lifePayPhoneRate, lifePayElectricRate, lifePayGasRate } = useGetRate();
</script>