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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. $.request('server_fields', 'GET', {}).then((res) => {
  16. });
  17. },
  18. bookServer() {
  19. const {
  20. name,
  21. phone,
  22. address,
  23. notes,
  24. expectedDate,
  25. serviceDate
  26. } = this.data;
  27. if (!name || !phone || !address || !expectedDate || !serviceDate) {
  28. return $.wx.showToast({
  29. title: '请把信息填写完整'
  30. });
  31. }
  32. if (!this._isPhone(phone)) {
  33. return $.wx.showToast({
  34. title: '请输入正确的手机号码'
  35. });
  36. }
  37. $.wx.showToast({
  38. title: '加载中'
  39. }, 'loading');
  40. $.request('maternity_matron_order/store', 'POST', {
  41. level: '金牌月嫂',
  42. expected_date: expectedDate,
  43. special_demand: notes || '特殊需求',
  44. server_time: serviceDate,
  45. address,
  46. contact: name,
  47. phone
  48. }).then((res) => {
  49. $.wx.hideToast('loading');
  50. $.router.goto({
  51. path: '/pages/order/index',
  52. type: $.ROUTER_TYPE.SWITCH_TAB
  53. });
  54. });
  55. }
  56. })