index.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // components/inner-order-item/index.js
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. item: Object
  8. },
  9. /**
  10. * 组件的初始数据
  11. */
  12. data: {
  13. },
  14. /**
  15. * 组件的方法列表
  16. */
  17. methods: {
  18. navigate: function(e) {
  19. wx.navigateTo({
  20. url: e.currentTarget.dataset.url,
  21. })
  22. },
  23. doAction: function(e) {
  24. var type = e.currentTarget.dataset.type
  25. if(type == 'edit' || type == 'detail') {
  26. this.navigate(e)
  27. } else if(type == 'confirm') {
  28. var that = this
  29. var order = e.currentTarget.dataset.order
  30. Dialog.confirm({
  31. title: '提示',
  32. message: '确定订单吗',
  33. })
  34. .then(() => {
  35. that.submitCheck(order)
  36. })
  37. }
  38. },
  39. submitCheck(order) {
  40. var that = this
  41. http({
  42. url: 'orders/check',
  43. data: {
  44. id: order.id,
  45. type: 'confirm',
  46. remark: order.remark
  47. },
  48. success: function (res) {
  49. if (res.code == 0) {
  50. }
  51. }
  52. })
  53. },
  54. }
  55. })