You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 rivejä
1.7 KiB

  1. // Pages/HGBot/Vote/recevied/recevied.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. userName:"洗后提",
  8. array:[1,2]
  9. },
  10. checkboxChange(e) {
  11. console.log('checkbox发生change事件,携带value值为:', e.detail.value)
  12. const items = this.data.array
  13. const values = e.detail.value
  14. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  15. items[i].checked = false
  16. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  17. if (items[i].value === values[j]) {
  18. items[i].checked = true
  19. break
  20. }
  21. }
  22. }
  23. },
  24. onAdd: function(){
  25. const length = this.data.array.length
  26. this.data.array = this.data.array.concat([length + 1])
  27. this.setData({
  28. array:this.data.array
  29. })
  30. },
  31. /**
  32. * 生命周期函数--监听页面加载
  33. */
  34. onLoad: function (options) {
  35. },
  36. /**
  37. * 生命周期函数--监听页面初次渲染完成
  38. */
  39. onReady: function () {
  40. },
  41. /**
  42. * 生命周期函数--监听页面显示
  43. */
  44. onShow: function () {
  45. },
  46. /**
  47. * 生命周期函数--监听页面隐藏
  48. */
  49. onHide: function () {
  50. },
  51. /**
  52. * 生命周期函数--监听页面卸载
  53. */
  54. onUnload: function () {
  55. },
  56. /**
  57. * 页面相关事件处理函数--监听用户下拉动作
  58. */
  59. onPullDownRefresh: function () {
  60. },
  61. /**
  62. * 页面上拉触底事件的处理函数
  63. */
  64. onReachBottom: function () {
  65. },
  66. /**
  67. * 用户点击右上角分享
  68. */
  69. onShareAppMessage: function () {
  70. }
  71. })