import { NetManager } from "../../libs/tw/manager/NetManager";

import { DataManager } from "../../libs/tw/manager/DataManager";
import Loading from "../../libs/new_wx/components/Loading";

export default (cb) => {
    Loading.instace.show();
    NetManager.ins.doJoinPlugDraw((isSuccess) => {
        Loading.instace.hide();
        if (isSuccess) {
            Loading.instace.show();
            NetManager.ins.getPlugOrderStatus((success) => {
                Loading.instace.hide();
                if (success) {
                    NetManager.ins.getCredits(() => { });
                    cb && cb();
                }
            }, DataManager.ins.doJoinPlugDrawData.orderId,
                () => DataManager.ins.getPlugOrderStatusData.result == 0
            )

        }
    }, window['revivePlugId'], true);
}
