家政小程序
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

index.js 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. for (let item of top) {
  20. item.topPhoto = item.photo.split(';')[0];
  21. }
  22. this.setData({
  23. bottom,
  24. top,
  25. introduce
  26. });
  27. });
  28. },
  29. handleJump(e) {
  30. const {
  31. route,
  32. type,
  33. target
  34. } = e.currentTarget.dataset;
  35. if (route) {
  36. $.router.goto({
  37. path: `/pages/${route}/index`,
  38. type: type && parseInt(type),
  39. params: {
  40. type: target || ''
  41. }
  42. });
  43. }
  44. },
  45. toDetail(e) {
  46. const {
  47. id,
  48. name,
  49. type
  50. } = e.currentTarget.dataset;
  51. if (type && type == 'bottom') {
  52. return $.router.goto({
  53. path: `/pages/detail/index`,
  54. params: {
  55. content: this.data.bottom.content || ''
  56. }
  57. });
  58. }
  59. if (id) {
  60. $.router.goto({
  61. path: `/pages/introduce/index`,
  62. query: {
  63. id,
  64. name
  65. }
  66. });
  67. }
  68. },
  69. toConsult() {
  70. // $.wx.showToast({
  71. // title: '持续开发中'
  72. // });
  73. },
  74. // 页面分享
  75. onShareAppMessage() {
  76. return {
  77. title: '玥子轩母婴家政',
  78. desc: '首页',
  79. path: '/pages/home/index'
  80. }
  81. }
  82. });