payResult.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <!-- 昵称(邮箱或者个人主页) -->
  2. <template>
  3. <view class="container">
  4. <view class="pay-result">
  5. <view class="success" v-if="status == true">
  6. <view class="msg">付款成功</view>
  7. <view class="btns">
  8. <navigator class="btn" url="/pages/ucenter/order/order" open-type="redirect">查看订单</navigator>
  9. <navigator class="btn" url="/pages/index/index" open-type="switchTab">继续逛</navigator>
  10. </view>
  11. </view>
  12. <view class="error" v-if="status != true">
  13. <view class="msg">付款失败</view>
  14. <view class="tips">
  15. <view class="p">请在
  16. <text class="time">1小时</text>
  17. 内完成付款
  18. </view>
  19. <view class="p">否则订单将会被系统取消</view>
  20. </view>
  21. <view class="btns">
  22. <navigator class="btn" url="/pages/ucenter/order/order" open-type="redirect">查看订单</navigator>
  23. <view class="btn" @tap='payOrder'>重新付款</view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. const util = require("@/utils/util.js");
  31. const api = require('@/utils/api.js');
  32. export default {
  33. data() {
  34. return {
  35. status: false,
  36. orderId: 0
  37. }
  38. },
  39. methods: {
  40. updateSuccess: function() {
  41. let that = this
  42. util.request(api.OrderQuery, {
  43. orderId: that.orderId
  44. }).then(function(res) {})
  45. },
  46. payOrder() {
  47. util.payOrder(parseInt(this.orderId)).then(res => {
  48. that.status = true
  49. }).catch(res => {
  50. util.toast('支付失败');
  51. });
  52. }
  53. },
  54. onLoad: function(options) {
  55. // 页面初始化 options为页面跳转所带来的参数
  56. this.orderId = options.orderId || 24
  57. this.status = options.status
  58. }
  59. }
  60. </script>
  61. <style lang="scss">
  62. page {
  63. min-height: 100%;
  64. width: 100%;
  65. background: #fff;
  66. }
  67. .container {
  68. height: 100%;
  69. background: #fff;
  70. }
  71. .pay-result {
  72. background: #fff;
  73. }
  74. .pay-result .msg {
  75. text-align: center;
  76. margin: 100rpx auto;
  77. color: #2bab25;
  78. font-size: 36rpx;
  79. }
  80. .pay-result .btns {
  81. display: flex;
  82. align-items: center;
  83. justify-content: center;
  84. }
  85. .pay-result .btn {
  86. text-align: center;
  87. height: 80rpx;
  88. margin: 0 20rpx;
  89. width: 200rpx;
  90. line-height: 78rpx;
  91. border: 1px solid #868686;
  92. color: #000000;
  93. border-radius: 5rpx;
  94. }
  95. .pay-result .error .msg {
  96. color: #b4282d;
  97. margin-bottom: 60rpx;
  98. }
  99. .pay-result .error .tips {
  100. color: #7f7f7f;
  101. margin-bottom: 70rpx;
  102. }
  103. .pay-result .error .tips .p {
  104. font-size: 24rpx;
  105. line-height: 42rpx;
  106. text-align: center;
  107. }
  108. .pay-result .error .tips .p {
  109. line-height: 42rpx;
  110. text-align: center;
  111. }
  112. </style>