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

12345678910111213141516171819202122232425262728293031323334353637383940
  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. });
  24. },
  25. bookServer() {
  26. const {
  27. name
  28. } = this.data;
  29. if (name && name.includes('月嫂')) {
  30. $.router.goto({
  31. path: '/pages/yuesao/index'
  32. });
  33. } else {
  34. $.router.goto({
  35. path: '/pages/bookService/index'
  36. });
  37. }
  38. }
  39. })