Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

100 řádky
2.3 KiB

  1. // const app = getApp()
  2. // const navigationBarHeight = (getApp().statusBarHeight + 44)+"px"
  3. // Page({
  4. // data:{
  5. // navigationBarHeight,
  6. // }
  7. // })
  8. const app = getApp()
  9. const config = require("../../config/config")
  10. const Http = require("../../utils/HttpBasics.js")
  11. const navigationBarHeight = (getApp().statusBarHeight + 44) + "px"
  12. Page({
  13. data: {
  14. imgHttps: app.globalData.imgHttps,
  15. navigationBarHeight,
  16. inputValue: '',
  17. pageNum: 1,
  18. list: [],
  19. showFlog:false,
  20. id:"",//选中id
  21. },
  22. setSearchValue(e) {
  23. let value = e.detail.value
  24. this.setData({
  25. inputValue: value
  26. })
  27. },
  28. searchBtn() {
  29. this.setData({
  30. list: [],
  31. pageNum: 1
  32. })
  33. this.search()
  34. },
  35. cancel(){
  36. Http.get({
  37. url:config.api.Fcollect,
  38. data:{
  39. id:this.data.id
  40. }
  41. }).then(res=>{{
  42. tt.showToast({
  43. title: '已取消收藏', // 内容
  44. icon: "none"
  45. });
  46. }}).catch(err=>{
  47. tt.showToast({
  48. title: err.message, // 内容
  49. icon:"none"
  50. });
  51. })
  52. },
  53. hie(){
  54. this.setData({
  55. showFlog:false
  56. })
  57. },
  58. showHie(e){
  59. let id = e.currentTarget.dataset.id
  60. this.setData({
  61. showFlog:true,
  62. id:id
  63. })
  64. },
  65. search() {
  66. Http.get({
  67. url: config.api.getOrderLsit,
  68. data: {
  69. productTitle: this.data.inputValue,
  70. pageNum: this.data.pageNum,
  71. pageSize: 8,
  72. orderStatus: 2
  73. }
  74. }).then(res => {
  75. console.log(res);
  76. let temp = this.data.list
  77. if (this.data.pageNum > 1) {
  78. temp.push(res.data.list)
  79. this.setData({
  80. list: temp
  81. })
  82. } else {
  83. this.setData({
  84. list: res.data.list
  85. })
  86. }
  87. })
  88. },
  89. onLoad() {
  90. this.search()
  91. },
  92. onReachBottom: function() {
  93. this.setData({
  94. pageNum:this.data.pageNum+1
  95. })
  96. this.search()
  97. }
  98. })