推广小程序前端代码
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.

54 lines
863 B

2 months ago
  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 = 'createSumOrderAgain'
  16. }
  17. this.$api(api, {
  18. orderId : item.id,
  19. addressId : item.addressId
  20. }, res => {
  21. if(res.code == 200){
  22. uni.requestPaymentWxPay(res)
  23. .then(res => {
  24. uni.showToast({
  25. title: '支付成功',
  26. icon: 'none'
  27. })
  28. this.getData()
  29. }).catch(n => {
  30. this.getData()
  31. })
  32. }
  33. })
  34. },
  35. // 确认收货
  36. confirmOrder(item){
  37. uni.showModal({
  38. title: '您收到货了吗?',
  39. success : e => {
  40. if(e.confirm){
  41. this.$api('confirmOrder', {
  42. orderId : item.id,
  43. }, res => {
  44. this.getData()
  45. })
  46. }
  47. }
  48. })
  49. },
  50. }
  51. }