order-success.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <view class="order-success">
  3. <image class="success-icon" src="../static/success.png" mode="widthFix"></image>
  4. <text class="success-title">订单提交成功</text>
  5. <text class="success-message">您的订单已提交,书嗨稍后将安排快递上门取书!</text>
  6. <view class="button-group">
  7. <u-button
  8. class="notify-button"
  9. :custom-style="{ borderColor: '#07c160', width: '235rpx', color: '#07c160' }"
  10. type="default"
  11. @click="goHome"
  12. >返回首页</u-button
  13. >
  14. <!-- <u-button class="notify-button" :custom-style="{borderColor: '#07c160',width:'235rpx',
  15. color: '#07c160'}" type="default" @click="notifyStatusChange">状态变更通知</u-button> -->
  16. <u-button
  17. :custom-style="{ background: '#07c160', width: '235rpx', color: '#ffffff' }"
  18. class="view-order-button"
  19. type="primary"
  20. @click="viewOrder"
  21. >查看订单</u-button
  22. >
  23. </view>
  24. <OrderSuccessPopup ref="orderPopupRef" />
  25. </view>
  26. </template>
  27. <script>
  28. import OrderSuccessPopup from "../components/OrderSuccessPopup.vue";
  29. export default {
  30. components: {
  31. OrderSuccessPopup,
  32. },
  33. methods: {
  34. notifyStatusChange() {
  35. // 处理状态变更通知逻辑
  36. console.log("状态变更通知");
  37. },
  38. viewOrder() {
  39. uni.navigateTo({
  40. url: "/pages-mine/pages/order-page?status=-1",
  41. });
  42. },
  43. goHome() {
  44. uni.switchTab({
  45. url: "/pages/home/index",
  46. });
  47. },
  48. //获取弹窗信息
  49. getDialogInfo() {
  50. uni.$u.http.post("/token/submitPage/dialog").then((res) => {
  51. if (res.code == 200) {
  52. res.data?.id && this.$refs.orderPopupRef.openPopup(res.data);
  53. }
  54. });
  55. },
  56. },
  57. onLoad() {
  58. let frequency = uni.getStorageSync("frequency");
  59. if (!frequency) {
  60. this.getDialogInfo();
  61. }
  62. },
  63. };
  64. </script>
  65. <style lang="scss" scoped>
  66. .order-success {
  67. display: flex;
  68. flex-direction: column;
  69. align-items: center;
  70. background-color: #ffffff;
  71. padding: 34rpx 0 44rpx 0;
  72. .success-icon {
  73. width: 200rpx;
  74. height: 200rpx;
  75. }
  76. .success-title {
  77. font-family: PingFang SC;
  78. font-weight: 400;
  79. font-size: 40rpx;
  80. color: #333333;
  81. line-height: 107rpx;
  82. }
  83. .success-message {
  84. font-family: PingFang SC;
  85. font-weight: 400;
  86. font-size: 28rpx;
  87. color: #999999;
  88. margin-bottom: 40rpx;
  89. }
  90. .button-group {
  91. display: flex;
  92. justify-content: center;
  93. gap: 70rpx;
  94. }
  95. }
  96. </style>