feat: 修复用户手动取消订单的状态显示、修复支付过程中订单支付按钮一直展示的问题
This commit is contained in:
16
src/store/orderStore.ts
Normal file
16
src/store/orderStore.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { create } from "zustand";
|
||||
|
||||
export interface OrderStore {
|
||||
paying: boolean;
|
||||
setPaying: (paying: boolean) => void;
|
||||
}
|
||||
|
||||
export const useOrderStore = create<OrderStore>()((set) => ({
|
||||
paying: false,
|
||||
setPaying: (paying: boolean) => set({ paying }),
|
||||
}));
|
||||
|
||||
export const useOrder = () => useOrderStore(({ paying, setPaying }) => ({
|
||||
paying,
|
||||
setPaying,
|
||||
}))
|
||||
Reference in New Issue
Block a user