Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

86 Zeilen
2.1 KiB

  1. const app = getApp()
  2. const config = require("../../config/config")
  3. const Http = require("../../utils/HttpBasics.js")
  4. const navigationBarHeight = (getApp().statusBarHeight + 44)+"px"
  5. Page({
  6. data:{
  7. imgHttps:app.globalData.imgHttps,
  8. navigationBarHeight,
  9. id:"",//upid
  10. name:'',//upName
  11. indexFlog:1,//选着类别
  12. upData:{},//作者信息
  13. pageNum:1,
  14. classList:[],//课程列表
  15. dNum:"",//但课程数
  16. zNum:"",//专栏数
  17. },
  18. getClass(){//课程list
  19. Http.get({
  20. url:config.api.columnLsit,
  21. data:{
  22. merchantId:this.data.id,
  23. type:this.data.indexFlog,
  24. pageNum:this.data.pageNum,
  25. pageSize: 6
  26. }
  27. }).then(res=>{
  28. if(this.data.pageNum>1){
  29. let temp = this.data.classList
  30. temp.push(...res.data.list)
  31. this.setData({
  32. classList:temp
  33. })
  34. }else{
  35. this.setData({
  36. classList:res.data.list
  37. })
  38. }
  39. })
  40. },
  41. setIndex(e){
  42. let index = e.currentTarget.dataset.index
  43. console.log(index);
  44. this.setData({
  45. indexFlog:index,
  46. pageNum:1,
  47. classList:[]
  48. })
  49. this.getClass()
  50. },
  51. getUpData(){
  52. Http.get({
  53. url:config.api.getUpUser,
  54. data:{
  55. id:this.data.id
  56. }
  57. }).then(res=>{
  58. console.log(res.data);
  59. this.setData({
  60. upData:res.data
  61. })
  62. }).catch(err=>{
  63. tt.showToast({
  64. title: err.message, // 内容
  65. icon:"none"
  66. });
  67. })
  68. },
  69. onLoad(options){
  70. this.setData({
  71. id:options.id,
  72. name:options.name
  73. })
  74. this.getUpData()
  75. this.getClass()
  76. },
  77. onReachBottom() {
  78. console.log("到底了");
  79. this.setData({
  80. pageNum:this.data.pageNum+1
  81. })
  82. this.getClass()
  83. }
  84. })