代码编译没错,点击能收藏,再点击取消收藏就没反应啦


    var postcoll = wx.getStorageInfoSync('post_coll');

    if (postcoll) {

      var dqhczt = postcoll[postId];

      this.setData({

        coll: dqhczt

      });

    }


    else {

      var postcoll = {};

      postcoll[postId] = false;

      wx.setStorageSync('post_coll', postcoll);


    }

  },

  //.........................以上是文章缓存状态的初始化....................................................................




  hcztan: function (evert) {

    var postcoll = wx.getStorageInfoSync('post_coll');

    var dqhczt = postcoll[this.data.jsidbl];

    dqhczt = !dqhczt;

    postcoll[this.data.jsidbl] = dqhczt;

    wx.setStorageSync('post_coll', postcoll);

    this.setData({

      coll: dqhczt

    })


  }


qq_房瓦上的雨声_04368736
浏览 1532回答 0
0回答
打开App,查看更多内容
随时随地看视频慕课网APP