index.js 1018 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. Component({
  2. properties: {
  3. list:{
  4. type: Array,
  5. observer:function(newVal){
  6. // console.log(newVal)
  7. this.setData({list:newVal})
  8. }
  9. },
  10. updateLoading:{
  11. type: Boolean,
  12. observer:function(newVal){
  13. this.setData({updateLoading:newVal})
  14. }
  15. },
  16. isAllLoaded:{
  17. type: Boolean,
  18. observer:function(newVal){
  19. this.setData({isAllLoaded:newVal})
  20. }
  21. },
  22. goodsTypeId:{
  23. type: String,
  24. observer:function(newVal){
  25. this.setData({goodsTypeId:newVal})
  26. }
  27. }
  28. },
  29. data: {
  30. list:[],
  31. updateLoading:false,
  32. isAllLoaded:false,
  33. goodsTypeId:-1,
  34. },
  35. lifetimes: {
  36. ready() {
  37. },
  38. },
  39. methods: {
  40. // 跳转至详情页
  41. goDetails(e){
  42. console.log(e)
  43. let aid = e.currentTarget.dataset.id,title = e.currentTarget.dataset.title,relAid=e.currentTarget.dataset.relaid;
  44. wx.navigateTo({
  45. url: '/pages/product/goods/detail?aid='+ (relAid?relAid:aid)
  46. })
  47. }
  48. }
  49. })