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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. const $ = global;
  2. const orderTexts = [
  3. '已预约,等待处理',
  4. '未付款',
  5. '已付款'
  6. ]
  7. new $.Page({
  8. data: {
  9. services: [],
  10. goods: []
  11. },
  12. onShow() {
  13. this.init();
  14. },
  15. init() {
  16. $.request('my/orders', 'GET', {}).then((res) => {
  17. const services = []
  18. const goods = []
  19. if (res.data && res.data.length > 0) {
  20. res.data.forEach(e => {
  21. e.orderText = orderTexts[e.status];
  22. if (e.order_type == 'product_order') {
  23. goods.push(e);
  24. } else {
  25. services.push(e);
  26. }
  27. });
  28. this.setData({
  29. services,
  30. goods
  31. });
  32. }
  33. });
  34. },
  35. toPay(e) {
  36. const {
  37. id
  38. } = e.target.dataset;
  39. if (id) {
  40. }
  41. },
  42. addComment(e) {
  43. const {
  44. id
  45. } = e.target.dataset;
  46. if (id) {
  47. $.router.goto({
  48. path: '/pages/addComment/index'
  49. });
  50. }
  51. }
  52. });