建材商城系统20241014
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.

75 lines
1.2 KiB

  1. export default {
  2. data() {
  3. return {
  4. }
  5. },
  6. computed: {
  7. },
  8. methods: {
  9. // 立即支付
  10. toPayOrder(item){
  11. let api = ''
  12. // if([0, 1].includes(item.shopState)){
  13. // api = 'createOrderTwo'
  14. // }else{
  15. api = 'payOrder'
  16. // }
  17. this.$api(api, {
  18. orderId : item.id,
  19. type : 1,
  20. }, res => {
  21. if(res.code == 200){
  22. if(res.result.id){
  23. this.id = res.result.id
  24. }
  25. this.getData()
  26. uni.requestPaymentWxPay({
  27. result : res.result.pay || res.result
  28. })
  29. .then(res => {
  30. uni.showToast({
  31. title: '支付成功',
  32. icon: 'none'
  33. })
  34. this.getData()
  35. }).catch(n => {
  36. this.getData()
  37. })
  38. }
  39. })
  40. },
  41. // 确认收货
  42. confirmOrder(item){
  43. uni.showModal({
  44. title: '您收到货了吗?',
  45. success : e => {
  46. if(e.confirm){
  47. this.$api('confirmOrder', {
  48. orderId : item.id,
  49. }, res => {
  50. this.getData()
  51. })
  52. }
  53. }
  54. })
  55. },
  56. // 取消订单
  57. cancelOrder(item){
  58. uni.showModal({
  59. title: '确认取消订单吗?',
  60. success : e => {
  61. if(e.confirm){
  62. this.$api('cancelOrder', {
  63. orderId : item.id,
  64. }, res => {
  65. this.getData()
  66. })
  67. }
  68. }
  69. })
  70. },
  71. }
  72. }