微信小程序之wx.showmodal

时间:2023-11-11 12:51:20

1.

.微信小程序之wx.showmodal

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

 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) { },//接口调用结束的回调函数(调用成功、失败都会执行)

      }
})