微信小程序提示框很常见,有的项目弹出提示选择关闭的时候需要不再弹出,清理缓存的时候才弹出。
var s = wx.getStorageSync('sh')
if (s == '') {
// s= true;
wx.showModal({
title: '温馨提示',
content: '标题',
confirmText: "不再提示",
confirmColor: '#589DFC',
cancelText: "关闭提示",
cancelColor: '#999999',
success(res) {
if (res.confirm) {
console.log(res.confirm)
wx.setStorageSync('sh', '1')
} else {
wx.setStorageSync('sh', '')
}
}
})
}