Browse Source

sytle(小程序/助贷推广计划): 代码格式化

qq12rrr 3 tháng trước cách đây
mục cha
commit
2bda958c47
2 tập tin đã thay đổi với 59 bổ sung57 xóa
  1. 9 9
      src/component/layout/index.tsx
  2. 50 48
      src/redux/index.ts

+ 9 - 9
src/component/layout/index.tsx

@@ -29,15 +29,15 @@ const BottomNavBar = () => {
         zIndex: 110,
         background: "#fff",
       }}
-      className='bottom-nav'
+      className="bottom-nav"
       placeholder
-      position='bottom'
+      position="bottom"
     >
       <Flex
         style={{ height: pxTransform(104) }}
-        direction='row'
-        alignItem='center'
-        justifyContent='center'
+        direction="row"
+        alignItem="center"
+        justifyContent="center"
       >
         {menu.map((p) => {
           let _index = ["home", "user_center"].findIndex((sp) => sp === p.code);
@@ -60,15 +60,15 @@ const BottomNavBar = () => {
                 return;
               }}
               flex={1}
-              alignItem='center'
-              justifyContent='center'
+              alignItem="center"
+              justifyContent="center"
             >
               <Image
-                className='bottom-nav-icon'
+                className="bottom-nav-icon"
                 src={_index === bottomBarContext?.index ? p.iconActive : p.icon}
               />
               <Label
-                size='sm'
+                size="sm"
                 type={
                   _index === bottomBarContext?.index ? "default" : "secondary"
                 }

+ 50 - 48
src/redux/index.ts

@@ -1,58 +1,60 @@
-import { HomeTabUsingPostResponseTabMenus, WxLoginUsingGetResponse } from '@/apis/userApi';
-import StorageUtil, { EStorage } from '@/utils/storageUtil';
-import { createSlice } from '@reduxjs/toolkit';
-
+import {
+  HomeTabUsingPostResponseTabMenus,
+  WxLoginUsingGetResponse,
+} from "@/apis/userApi";
+import StorageUtil, { EStorage } from "@/utils/storageUtil";
+import { createSlice } from "@reduxjs/toolkit";
 
 export interface IReduxStore {
-    userInfo: WxLoginUsingGetResponse;
-    tabMenu: HomeTabUsingPostResponseTabMenus[]
+  userInfo: WxLoginUsingGetResponse;
+  tabMenu: HomeTabUsingPostResponseTabMenus[];
 }
 
 const initialState = (): IReduxStore => ({
-    userInfo: StorageUtil.get(EStorage.userInfo),
-    tabMenu: StorageUtil.get(EStorage.tabMenu) || [
-        {
-            code: "home",
-            icon: require('@/assets/icon_bottom_bar_apply.png'),
-            iconActive: require('@/assets/icon_bottom_bar_apply_active.png'),
-            name: "首页",
-        },
-        {
-            code: "user_center",
-            icon: require('@/assets/icon_bottom_bar_mine.png'),
-            iconActive: require('@/assets/icon_bottom_bar_mine_active.png'),
-            name: "我的",
-        }
-    ]
-})
+  userInfo: StorageUtil.get(EStorage.userInfo),
+  tabMenu: StorageUtil.get(EStorage.tabMenu) || [
+    {
+      code: "home",
+      icon: require("@/assets/icon_bottom_bar_apply.png"),
+      iconActive: require("@/assets/icon_bottom_bar_apply_active.png"),
+      name: "首页",
+    },
+    {
+      code: "user_center",
+      icon: require("@/assets/icon_bottom_bar_mine.png"),
+      iconActive: require("@/assets/icon_bottom_bar_mine_active.png"),
+      name: "我的",
+    },
+  ],
+});
 
 export const reducersSlice = createSlice({
-    name: 'reducer',
-    initialState: initialState(),
-    reducers: {
-        changeUserInfo: (state, action) => {
-            state.userInfo = action.payload;
-        },
-        clearState: (state) => {
-            let initState = initialState();
-            for (const key in state) {
-                state[key] = initState[key];
-            }
-            // state = initialState();
-        },
-        changeTabMenu: (state, action) => {
-            state.tabMenu = action.payload;
-        }
-        /**更改地址 */
-        // changeAddress: (state, action) => {
-        //     let obj = { ...action.payload };
-        //     state.wallet = obj;
-        // },
+  name: "reducer",
+  initialState: initialState(),
+  reducers: {
+    changeUserInfo: (state, action) => {
+      state.userInfo = action.payload;
+    },
+    clearState: (state) => {
+      let initState = initialState();
+      for (const key in state) {
+        state[key] = initState[key];
+      }
+      // state = initialState();
+    },
+    changeTabMenu: (state, action) => {
+      state.tabMenu = action.payload;
+    },
+    /**更改地址 */
+    // changeAddress: (state, action) => {
+    //     let obj = { ...action.payload };
+    //     state.wallet = obj;
+    // },
 
-        // changeTokenList: (state, action) => {
-        //     state.tokenList = action.payload;
-        // }
-    }
+    // changeTokenList: (state, action) => {
+    //     state.tokenList = action.payload;
+    // }
+  },
 });
 
-export const reduxActions = reducersSlice.actions;
+export const reduxActions = reducersSlice.actions;