evaluate.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. const app = getApp()
  2. var util = require("../../../utils/util.js")
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. evaluateList: [],
  9. evaluateListNew: [],
  10. bigimagecurrent: 0,
  11. plindex: '-1',
  12. loaddisplay: true
  13. },
  14. /**
  15. * 生命周期函数--监听页面加载
  16. */
  17. onLoad: function(options) {
  18. let _this = this;
  19. _this.setData({
  20. navH: app.globalData.navHeight
  21. })
  22. // 看点评列表
  23. util.getData('/getWXDianPing').then(res => {
  24. // console.log(res);
  25. _this.setData({
  26. evaluateList: res,
  27. loaddisplay: 'none'
  28. })
  29. })
  30. },
  31. hidemask() {
  32. this.setData({
  33. evaluateListNew: [],
  34. showmask: false
  35. })
  36. },
  37. showmask(e) {
  38. let index = e.currentTarget.dataset['index'];
  39. let dianPingImageIndex = e.currentTarget.dataset['imageIndex'];
  40. console.log(index, dianPingImageIndex, e.currentTarget)
  41. let arr = []
  42. arr.push(this.data.evaluateList[index])
  43. this.setData({
  44. evaluateListNew: arr,
  45. bigimagecurrent: dianPingImageIndex,
  46. showmask: true
  47. })
  48. },
  49. opencomment(e) {
  50. // console.log(e)
  51. if (e.currentTarget.dataset.index == this.data.plindex) {
  52. this.setData({
  53. plindex: '-1'
  54. })
  55. } else {
  56. this.setData({
  57. plindex: e.currentTarget.dataset.index
  58. })
  59. }
  60. },
  61. goback() {
  62. wx.navigateBack({
  63. delta: 1
  64. })
  65. },
  66. /**
  67. * 生命周期函数--监听页面初次渲染完成
  68. */
  69. onReady: function() {
  70. },
  71. /**
  72. * 页面相关事件处理函数--监听用户下拉动作
  73. */
  74. onPullDownRefresh: function() {
  75. },
  76. /**
  77. * 页面上拉触底事件的处理函数
  78. */
  79. onReachBottom: function() {
  80. },
  81. /**
  82. * 用户点击右上角分享
  83. */
  84. onShareAppMessage: function() {
  85. }
  86. })