"use strict";
const common_vendor = require("../vendor.js");
function goto(url) {
  common_vendor.index.navigateTo({ url, fail: () => common_vendor.index.switchTab({ url }) });
}
function showToastBack(label, delta = 1, back = true, backFun) {
  common_vendor.index.showToast({
    title: label || "提交成功！",
    duration: 1e3,
    icon: "none",
    success() {
      if (back) {
        setTimeout(() => {
          common_vendor.index.navigateBack({ delta });
        }, 1e3);
      } else {
        setTimeout(() => {
          return backFun == null ? void 0 : backFun();
        }, 1e3);
      }
    }
  });
}
function showToast(label, fun) {
  common_vendor.index.showToast({
    title: label || "提交成功！",
    duration: 1e3,
    icon: "none",
    success() {
      setTimeout(() => {
        return fun == null ? void 0 : fun(true);
      }, 1e3);
    }
  });
}
exports.goto = goto;
exports.showToast = showToast;
exports.showToastBack = showToastBack;
