/*
   提示确认类型弹窗
 */

import modalFrame from "@/plugin/modalFrame"
import coursewarePlayTip from "./coursewarePlayTip.vue"

/**
 * @param obj
 *  text :文字
 *  btnShow:控制确认按钮显示
 *  headImg:头部图片
 */
type objType = {
   text: string
   btnShow?: [boolean?, boolean?]
   headImg?: string
   onCancel?: (...nargs: any[]) => void
   onOk?: (...nargs: any[]) => void
   onClose?: (...nargs: any[]) => void
}
export default ({ text, onCancel, onOk, onClose, btnShow, headImg }: objType) => {
   modalFrame({
      maskClose: true,
      template: coursewarePlayTip,
      width: 840,
      height: 570,
      btnShow: [],
      modalData: {
         text,
         btnShow: btnShow || [true, true],
         headImg
      },
      className: "usecoursewarePlayTip",
      onCancel,
      onOk,
      onClose
   })
}
