微信小程序之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