宜轩到家/服务到家第三版,换个颜色
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.

72 lines
1.5 KiB

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. import { showConfirmDialog } from 'vant';
  2. import { showDialog } from 'vant';
  3. export default {
  4. methods : {
  5. //再来一单
  6. moreOrder(projectId,successCallback) {
  7. this.$api('getProjectDetail', {
  8. id: projectId
  9. }, res => {
  10. if (res.code == 200) {
  11. successCallback && successCallback(res,projectId)
  12. }
  13. })
  14. },
  15. //立即评价
  16. toEvaluate(id,projectId,terId) {
  17. uni.navigateTo({
  18. url: `/pages/order/evaluate?id=${id}&projectId=${projectId}&terId=${terId}`
  19. })
  20. },
  21. //取消订单
  22. calcelOrder(orderId,successCallback) {
  23. showConfirmDialog({
  24. title: '取消订单',
  25. message: '确认取消订单?',
  26. }).then(() => {
  27. this.$api('cancelVipOrder', {
  28. orderId
  29. }, res => {
  30. if (res.code == 200) {
  31. successCallback && successCallback()
  32. }
  33. })
  34. }).catch(() => {});
  35. },
  36. //立即支付
  37. toPayOrder(item) {
  38. let data = {
  39. addressId: item.addressId,
  40. orderId: item.id,
  41. payType: item.payType,
  42. remark: item.remark,
  43. serviceTime: item.serviceTime
  44. }
  45. // if(item.couponId){
  46. // data.couponId = couponId
  47. // }
  48. this.$api('immediatelyPay', data, res => {
  49. if (res.code == 200) {
  50. if (item.payType == 1) { //余额支付
  51. showDialog({
  52. title: '支付成功',
  53. message: '订单支付成功!请前往订单查看',
  54. }).then(() => {
  55. this.active = 2
  56. });
  57. }else{
  58. this.$wxPay(res, this.getOrderList, this.getOrderList)
  59. }
  60. }
  61. this.getOrderList()
  62. })
  63. },
  64. }
  65. }