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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. const WxParse = require('../../wxParse/wxParse.js')
  2. const $ = global
  3. new $.Page({
  4. onLoad(options) {
  5. const id = options.id;
  6. const name = options.name || '';
  7. if (id) {
  8. $.request(`server_info/${id}`, 'GET', {}, true).then((res) => {
  9. var article = res.data && res.data.content || '';
  10. /**
  11. * WxParse.wxParse(bindName , type, data, target,imagePadding)
  12. * 1.bindName绑定的数据名(必填)
  13. * 2.type可以为html或者md(必填)
  14. * 3.data为传入的具体数据(必填)
  15. * 4.target为Page对象,一般为this(必填)
  16. * 5.imagePadding为当图片自适应是左右的单一padding(默认为0,可选)
  17. */
  18. WxParse.wxParse('article', 'html', article, this, 5)
  19. });
  20. }
  21. this.setData({
  22. name,
  23. id
  24. });
  25. },
  26. bookServer() {
  27. const {
  28. name,
  29. id
  30. } = this.data;
  31. if (name && name.includes('月嫂') || id == 6) {
  32. $.router.goto({
  33. path: '/pages/yuesao/index',
  34. query: {
  35. id
  36. }
  37. });
  38. } else {
  39. $.router.goto({
  40. path: '/pages/bookService/index',
  41. query: {
  42. id
  43. }
  44. });
  45. }
  46. }
  47. })