青蛙卖大米小程序2024-11-24
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.

38 lines
576 B

4 months ago
  1. export default {
  2. data() {
  3. return {
  4. }
  5. },
  6. computed: {
  7. },
  8. methods: {
  9. toPayOrder(item){
  10. let api = ''
  11. if([0, 1].includes(item.shopState)){
  12. api = 'createOrderTwo'
  13. }else{
  14. api = 'createSumOrderAgain'
  15. }
  16. this.$api(api, {
  17. orderId : item.id,
  18. addressId : item.addressId
  19. }, res => {
  20. if(res.code == 200){
  21. uni.requestPaymentWxPay(res)
  22. .then(res => {
  23. uni.showToast({
  24. title: '支付成功',
  25. icon: 'none'
  26. })
  27. this.getData()
  28. }).catch(n => {
  29. this.getData()
  30. })
  31. }
  32. })
  33. },
  34. }
  35. }