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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. const WxParse = require('../../wxParse/wxParse.js')
  2. const $ = global
  3. new $.Page({
  4. onLoad() {
  5. var article = '<div>我是富文本</div>'
  6. /**
  7. * WxParse.wxParse(bindName , type, data, target,imagePadding)
  8. * 1.bindName绑定的数据名(必填)
  9. * 2.type可以为html或者md(必填)
  10. * 3.data为传入的具体数据(必填)
  11. * 4.target为Page对象,一般为this(必填)
  12. * 5.imagePadding为当图片自适应是左右的单一padding(默认为0,可选)
  13. */
  14. WxParse.wxParse('article', 'html', article, this, 5)
  15. },
  16. bookServer() {
  17. const {
  18. name,
  19. phone,
  20. address,
  21. notes,
  22. expectedDate,
  23. serviceDate
  24. } = this.data;
  25. if (!name || !phone || !address || !expectedDate || !serviceDate) {
  26. return $.wx.showToast({
  27. title: '请把信息填写完整'
  28. });
  29. }
  30. if (!this._isPhone(phone)) {
  31. return $.wx.showToast({
  32. title: '请输入正确的手机号码'
  33. });
  34. }
  35. $.wx.showToast({
  36. title: '加载中'
  37. }, 'loading');
  38. $.request('maternity_matron_order/store', 'POST', {
  39. level: '金牌月嫂',
  40. expected_date: expectedDate,
  41. special_demand: notes || '特殊需求',
  42. server_time: serviceDate,
  43. address,
  44. contact: name,
  45. phone
  46. }).then((res) => {
  47. $.wx.hideToast('loading');
  48. $.router.goto({
  49. path: '/pages/order/index',
  50. type: $.ROUTER_TYPE.SWITCH_TAB
  51. });
  52. });
  53. }
  54. })