wx.showModal

 wx.showModal({
      title: '提示',
      content: '确定要退出!',
      howCancel: true,//是否显示取消按钮
      cancelText:"否",//默认是“取消”
      cancelColor:'skyblue',//取消文字的颜色
      confirmText:"是",//默认是“确定”
      confirmColor: 'skyblue',//确定文字的颜色
      success:function(res){
        if(res.cancel){
          console.log("取消退出");
        }else{
          console.log("确认退出,清空数据");
          wx.clearStorageSync();
          wx.navigateTo({
            url: '/pages/loginFoen/loginFoen',
          });
        }
      },fail:function(res){},
      complete:function(res){}
    });
posted @ 2020-03-04 09:23  A汉克先生  阅读(695)  评论(0编辑  收藏  举报