家政小程序
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

index.js 1.6KB

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. },
  16. bookServer() {
  17. const {
  18. name,
  19. phone,
  20. address,
  21. notes
  22. } = this.data;
  23. if (!name || !phone || !address) {
  24. return $.wx.showToast({
  25. title: '请把信息填写完整'
  26. });
  27. }
  28. if (!this._isPhone(phone)) {
  29. return $.wx.showToast({
  30. title: '请输入正确的手机号码'
  31. });
  32. }
  33. $.wx.showToast({
  34. title: '加载中'
  35. }, 'loading');
  36. $.request('housekeeper_order/store', 'POST', {
  37. contents: '保洁服务',
  38. people_num: '1-2人',
  39. notes,
  40. server_time: '白天',
  41. address,
  42. rest: '晚上',
  43. area: '60-120平',
  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. radioChange(e) {
  55. }
  56. })