微信小程序之wx.showmodal


 

1.

.

wx.showModal({
      title: "2222步",
      content: currentCache ? "确定为自己城市添加步数吗" : "确定取消为自己城市添加步数吗?",
      showCancel: true,
      cancelText: "取消111",
      cancelColor: "#000",
      confirmText: "确定",
      confirmColor: "#0f0",
      success: function (res) {
        console.log(res)
        if (res.confirm) {
          // 重新设置缓存
          //wx.setStorageSync('cache_key', cache);
          // 更新数据绑定,从而切换图片
          //that.setData({
            //collection: currentCache
          //})
        }
      }
    })

  

2...

 

 

 wx.showModal({
      title: "2222步",
      content: currentCache ? "确定为自己城市添加步数吗" : "确定取消为自己城市添加步数吗?",
      showCancel: false,
      // cancelText: "取消111",
      // cancelColor: "#000",
      confirmText: "确定",
      confirmColor: "#0f0",
      success: function (res) {
        console.log(res)

     success: function (res) {
      if (res.cancel) {
        //点击取消,默认隐藏弹框
      } else {
        //点击确定
        temp.splice(index, 1),
        that.setData({
          tempFilePaths: temp,
        })
       }
      },
      fail: function (res) { },//接口调用失败的回调函数
      complete: function (res) { },//接口调用结束的回调函数(调用成功、失败都会执行)

      }
    })

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM