import {reactive} from "vue";
import {wx} from "~/utils/wx";
import {Toast} from "vant";

enum AudioPlayModes {
    None, Html, Wechat
}

export interface PhotoStore {
    playing: string,
    loading: string,
    stopping: boolean,
    next?: () => void,
    mode: AudioPlayModes,
    target?: any
}

const caches = {} as any;

const store = reactive<PhotoStore>({
    playing: '',
    loading: '',
    stopping: false,
    mode: AudioPlayModes.None
})

const reset = () => {
    store.playing = '';
    store.loading = '';
    store.stopping = false;
    store.next = undefined;
    store.mode = AudioPlayModes.None;
    store.target = undefined;
}