家政小程序
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

index.js 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. });