、、 此方法只适用于 app端
g_show_model .js -------------------------------------
import sj_show_modal from './index.js'
const g_show_modal = {
install: function(Vue) {
Vue.prototype.$showModal=function(op={}){
return new Promise((resolve, reject)=>{
new sj_show_modal({
...op,
$event:function(e){
if(e.res){
resolve(e);
}else{
reject(e);
}
}
}).show();
})
}
}
};
export default g_show_modal
index .js -------------------------------------
/**
* author:G brother
* date:20200430
* Thank:chunLei所提供的思路和参照
* **/
export class show_model{
constructor(option={}) {
this.bodyModel=null;
this.cancelModel=null;
this.confirmModel=null;
this.pageHeight=uni.getSystemInfoSync().screenHeight;
let opacity = option.opacity || 0.4;
let zIndex = option.zIndex || 99;
let model_tit=option.title||'温馨提示';
let model_concent=option.concent||"请输入内容~"
let clickEvent=option.IsclickEvent||false;
let cancelVal=optio