拓恒河湖长制全民护河平台WEB端
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.

115 lines
2.3KB

  1. // package_first/pages/LearningVideo/index.js
  2. import {api_westreamVideo} from '../../../api/learining';
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. list:[],
  9. params: {
  10. openid: null
  11. },
  12. current: ''
  13. },
  14. /**
  15. * 生命周期函数--监听页面加载
  16. */
  17. onLoad(options) {
  18. const openid = wx.getStorageSync('openid')
  19. this.setData({
  20. params:{ openid }
  21. })
  22. },
  23. /* 更新数据 */
  24. updateList(e) {
  25. let list = this.data.list.concat(e.detail || [])
  26. this.setData({ list })
  27. },
  28. /* 重置数据 */
  29. resetList() {
  30. this.setData({ list: [] })
  31. },
  32. /**
  33. * 生命周期函数--监听页面初次渲染完成
  34. */
  35. onReady() {
  36. },
  37. /**
  38. * 生命周期函数--监听页面显示
  39. */
  40. onShow() {
  41. this.setData({
  42. current:'/westreamVideo/index'
  43. })
  44. },
  45. /**
  46. * 生命周期函数--监听页面隐藏
  47. */
  48. onHide() {
  49. },
  50. /**
  51. * 生命周期函数--监听页面卸载
  52. */
  53. onUnload() {
  54. },
  55. /**
  56. * 页面相关事件处理函数--监听用户下拉动作
  57. */
  58. onPullDownRefresh() {
  59. },
  60. /**
  61. * 页面上拉触底事件的处理函数
  62. */
  63. onReachBottom() {
  64. },
  65. /**
  66. * 用户点击右上角分享
  67. */
  68. onShareAppMessage() {
  69. },
  70. westreamVideo(){
  71. const tenantObj = wx.getStorageSync('tenant')
  72. const openid = wx.getStorageSync('openid')
  73. let data = {
  74. tenantId:tenantObj.tenantId,
  75. openid : openid,
  76. ...this.data.userPage
  77. }
  78. api_westreamVideo(data).then(res=>{
  79. let list = [...this.data.list,...res.data.records]
  80. let total = res.data.total
  81. this.setData({
  82. total,
  83. list,
  84. })
  85. // if(list.status == 0){
  86. // data.entersList[0].isstudy = true
  87. // }else if(list.status == 1){
  88. // data.entersList[1].isstudy = true
  89. // }
  90. })
  91. },
  92. handleDetail(e){
  93. const data = JSON.stringify(e.currentTarget.dataset.item)
  94. wx.navigateTo({
  95. url: '/package_first/pages/videoDetail/index?data='+ encodeURIComponent(data)
  96. })
  97. }
  98. })