wupengfei
2025-02-21 83f821e00802979e64840901bf2a1d18b4b61601
apps/taro/src/pages/home/index.vue
@@ -1,30 +1,32 @@
<template>
  <PageLayoutWithBg class="index-page-wrapper" :title="'生活缴费'" :need-auth="false">
    <ContentView>
      <RechargeGrid @phoneBillRecharge="goPhoneBillRecharge" />
      <RechargeGrid
        @phoneBillRecharge="goPhoneBillRecharge"
        @electricityBillRecharge="goElectricityBillRecharge"
      />
    </ContentView>
  </PageLayoutWithBg>
</template>
<script setup lang="ts">
import { useUser, useInfiniteLoading } from '@/hooks';
import { useUser, useAccessLogin } from '@/hooks';
import { useUserStore } from '@/stores/modules/user';
import Taro from '@tarojs/taro';
import IconLogo from '@/assets/home/icon-logo.png';
import { OrderInputType } from '@life-payment/constants';
import { RechargeGrid } from '@life-payment/components';
function goPhoneBillRecharge() {
const goPhoneBillRecharge = useAccessLogin(() => {
  Taro.navigateTo({
    url: `${RouterPath.phoneBillRecharge}`,
  })
    .then(() => {
      console.log('Navigate successfully');
    })
    .catch((err) => {
      console.error('Navigation failed:', err);
    });
}
  });
});
const goElectricityBillRecharge = useAccessLogin(() => {
  Taro.navigateTo({
    url: `${RouterPath.electricBillRecharge}`,
  });
});
</script>
<style lang="scss">