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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. });
  37. }
  38. },
  39. toDetail(e) {
  40. const {
  41. id
  42. } = e.target.dataset;
  43. if (id) {
  44. $.router.goto({
  45. path: `/pages/detail/index`,
  46. query: {
  47. id
  48. }
  49. });
  50. }
  51. },
  52. toConsult() {
  53. // $.wx.showToast({
  54. // title: '持续开发中'
  55. // });
  56. }
  57. });