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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. console.warn(e);
  44. const {
  45. id,
  46. name,
  47. type
  48. } = e.currentTarget.dataset;
  49. if (type && type == 'bottom') {
  50. return $.router.goto({
  51. path: `/pages/detail/index`,
  52. params: {
  53. content: this.data.bottom.content || ''
  54. }
  55. });
  56. }
  57. if (id) {
  58. $.router.goto({
  59. path: `/pages/introduce/index`,
  60. query: {
  61. id,
  62. name
  63. }
  64. });
  65. }
  66. },
  67. toConsult() {
  68. // $.wx.showToast({
  69. // title: '持续开发中'
  70. // });
  71. }
  72. });