component-list.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // components/component-list.js
  2. const { imgServer } = require('../../../utils/services.js')
  3. const app = getApp()
  4. Component({
  5. /**
  6. * 组件的属性列表
  7. */
  8. properties: {
  9. hasProduct: {
  10. type: Boolean
  11. },
  12. hasPay: {
  13. type: Boolean
  14. },
  15. sceneId: {
  16. type: String
  17. },
  18. imageUrl: {
  19. type: String
  20. },
  21. name: {
  22. type: String
  23. },
  24. pavilionName: {
  25. type: String
  26. },
  27. statusTextDesp: {
  28. type: String
  29. },
  30. distance: {
  31. type: String
  32. },
  33. online: Number,
  34. scenePv: Number,
  35. link: String
  36. },
  37. options: {
  38. addGlobalClass: true,
  39. },
  40. /**
  41. * 组件的初始数据
  42. */
  43. data: {
  44. imgServer
  45. },
  46. /**
  47. * 组件的方法列表
  48. */
  49. methods: {
  50. goBigScene: function(){
  51. if (this.data.hasProduct){
  52. app.globalData.currentUrl = this.data.link
  53. wx.navigateTo({
  54. url: `../../wv_page/index?id=${this.data.sceneId}`,
  55. success: function (res) { },
  56. fail: function (res) { },
  57. complete: function (res) { },
  58. })
  59. }else{
  60. wx.navigateTo({
  61. url: `/pages/zl_detail/index?id=${this.data.sceneId}`,
  62. success: function (res) { },
  63. fail: function (res) { },
  64. complete: function (res) { },
  65. })
  66. }
  67. }
  68. },
  69. ready : function(){
  70. console.log(this.data)
  71. }
  72. })