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) { },//接口調用結束的回調函數(調用成功、失敗都會執行)
}
})
