开发者工具UI自动化中,使用mock_wx_method方法mock不掉弹窗,还有其他方法吗?
发布于 5 年前 作者 zhulei 1349 次浏览 来自 问答

部分代码如下:

logOut: function () {

      wx.showModal({

        title: ‘确定要退出登录吗?’,

        showCancel: true, //是否显示取消按钮

        cancelText: “取消”, //默认是“取消”

        cancelColor: ‘#68758E’, //取消文字的颜色

        confirmText: “确定”, //默认是“确定”

        confirmColor: ‘#0093FF’, //确定文字的颜色

        success: function (res) {

          wx.hideLoading()

          if (res.confirm) {

            //点击确定

            wx.showLoading({

              title: ‘’,

            })

            commonUtil.loginOut(util.getLoginInfo().mobilenumber).then(() => {

              wx.hideLoading({

                complete: (res) => {},

              })

              util.clearStorageLoginout();

              //刷新个人中心

              wx.reLaunch({

                url: ‘…/…/pages/mine/mine’,

              });

            })

          }

        },

      })

回到顶部