微信小程序之wx.showmodal

it2026-02-06  1

 

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

} })

  

转载于:https://www.cnblogs.com/520BigBear/p/9308949.html

最新回复(0)