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.

64 lines
1.7 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <template>
  2. <div class="result">
  3. <el-result icon="success">
  4. <template slot="title">
  5. <p style="font-size: 24px;">恭喜您支付成功</p>
  6. </template>
  7. <template class="subTitle" slot="subTitle">
  8. <p style="margin-bottom: 6px;font-size: 16px;">您已成功支付 {{params.total_amount}} </p>
  9. <p style="margin-bottom: 6px;font-size: 16px;">订单号{{params.out_trade_no}} 查看订单</p>
  10. </template>
  11. <template slot="extra">
  12. <el-button type="primary" size="larget" @click="goBuyAgain()">继续购买</el-button>
  13. <el-button size="larget" @click="returnHome()">返回首页</el-button>
  14. </template>
  15. </el-result>
  16. </div>
  17. </template>
  18. <script>
  19. export default {
  20. data() {
  21. return {
  22. params: {},
  23. }
  24. },
  25. created() {
  26. const href = window.location.href;
  27. this.params = this.urlParamsHash(href);
  28. console.log(this.params, "params");
  29. },
  30. methods: {
  31. returnHome() {
  32. this.$router.push({path:'/dashboard'})
  33. },
  34. goBuyAgain() {
  35. this.$router.push({path:'/my/order/index'})
  36. },
  37. urlParamsHash(url) {
  38. var params = {}
  39. var h
  40. var hash = url.slice(url.indexOf('?') + 1).split('&')
  41. for(var i = 0; i < hash.length; i++) {
  42. h = hash[i].split('=')
  43. params[h[0]] = h[1]
  44. }
  45. return params;
  46. }
  47. },
  48. }
  49. </script>
  50. <style lang="scss" scoped>
  51. .result {
  52. height: 600px;
  53. display: flex;
  54. justify-content: center;
  55. align-items: center;
  56. }
  57. </style>