createOrder.js 850 B

123456789101112131415161718192021222324252627282930
  1. import { $createGasOrder } from '@/service/pay'
  2. import { $purchaseGasInfo } from '@/service/strategy'
  3. export default {
  4. created() {
  5. this.getGasstationInfo()
  6. },
  7. methods: {
  8. getGasstationInfo() {
  9. $purchaseGasInfo({ gasstationId: this.gasstationId }).then(response => {
  10. this.options.info.value = response.platformPrice
  11. })
  12. },
  13. createGasOrderEvent(param, path) {
  14. this.$toast.loading({
  15. duration: 0, // 持续展示 toast
  16. forbidClick: true, // 禁用背景点击
  17. message: '订单创建中...'
  18. })
  19. // alert("参数!!!" + JSON.stringify(param))
  20. $createGasOrder(param).then(response => {
  21. this.$toast('提交完成!')
  22. setTimeout(() => {
  23. this.$router.replace({ path: path })
  24. }, 1000)
  25. this.$toast.clear()
  26. })
  27. }
  28. }
  29. }