家政小程序
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.

index.js 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. const $ = global;
  2. const WxParse = require('../../wxParse/wxParse.js');
  3. new $.Page({
  4. data: {
  5. imgUrls: [
  6. '/img/demo/banner.jpg',
  7. '/img/demo/banner.jpg',
  8. '/img/demo/banner.jpg'
  9. ]
  10. },
  11. onLoad() {
  12. $.request('server_infos', 'GET', {}).then((res) => {
  13. const {
  14. bottom,
  15. top,
  16. introduce
  17. } = res;
  18. WxParse.wxParse('article', 'html', introduce, this);
  19. this.setData({
  20. bottom,
  21. top,
  22. introduce
  23. });
  24. });
  25. },
  26. handleJump(e) {
  27. const {
  28. route,
  29. type,
  30. target
  31. } = e.currentTarget.dataset;
  32. if (route) {
  33. $.router.goto({
  34. path: `/pages/${route}/index`,
  35. type: type && parseInt(type),
  36. params: {
  37. type: target || ''
  38. }
  39. });
  40. }
  41. },
  42. toDetail(e) {
  43. const {
  44. id,
  45. name,
  46. type
  47. } = e.currentTarget.dataset;
  48. if (type && type == 'bottom') {
  49. return $.router.goto({
  50. path: `/pages/detail/index`,
  51. params: {
  52. content: this.data.bottom.content || ''
  53. }
  54. });
  55. }
  56. if (id) {
  57. $.router.goto({
  58. path: `/pages/introduce/index`,
  59. query: {
  60. id,
  61. name
  62. }
  63. });
  64. }
  65. },
  66. toConsult() {
  67. // $.wx.showToast({
  68. // title: '持续开发中'
  69. // });
  70. }
  71. });