index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view class="success-container">
  3. <erp-nav-bar title="下单成功" />
  4. <view class="success-card">
  5. <icon type="success" size="80" color="#C1001C" class="success-icon"></icon>
  6. <text class="status-title">提交成功</text>
  7. <text class="status-desc">您的订单已提交,正在等待业务员审核</text>
  8. <view class="btn-group">
  9. <!-- 查看订单:主按钮 -->
  10. <button class="primary-btn" @click="viewOrder">查看订单</button>
  11. <!-- 再来一单:次按钮 -->
  12. <button class="outline-btn" @click="handleReorder">再来一单</button>
  13. <!-- 返回下单页面:文字/轻量化链接风格按钮 -->
  14. <button class="text-btn" @click="handleReorder">返回下单页面</button>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. import ErpNavBar from '@/components/erp-nav-bar.vue';
  21. export default {
  22. components: { ErpNavBar },
  23. data() {
  24. return {
  25. orderId: ''
  26. }
  27. },
  28. onLoad(options) {
  29. if (options.orderId) {
  30. this.orderId = options.orderId;
  31. }
  32. },
  33. methods: {
  34. // 将再来一单和返回页面功能合并:通过 reLaunch 自动重置数据
  35. handleReorder() {
  36. // reLaunch 会重新加载页面,彻底清空原有表单数据
  37. uni.reLaunch({
  38. url: '/pages/order/index'
  39. });
  40. },
  41. viewOrder() {
  42. if (!this.orderId) {
  43. uni.switchTab({
  44. url: '/pages/index/index'
  45. });
  46. return;
  47. }
  48. uni.navigateTo({
  49. url: '/pages/order/detail/index?rowId=' + this.orderId
  50. });
  51. }
  52. }
  53. }
  54. </script>
  55. <style scoped>
  56. .success-container {
  57. width: 100%;
  58. min-height: 100vh;
  59. background: #f7f8fa;
  60. display: flex;
  61. flex-direction: column;
  62. align-items: center;
  63. padding-top: 15vh;
  64. }
  65. .success-card {
  66. width: 90%;
  67. background: #fff;
  68. border-radius: 32rpx;
  69. padding: 80rpx 40rpx;
  70. display: flex;
  71. flex-direction: column;
  72. align-items: center;
  73. box-shadow: 0 4rpx 30rpx rgba(0, 0, 0, 0.03);
  74. }
  75. .success-icon {
  76. margin-bottom: 40rpx;
  77. }
  78. .status-title {
  79. font-size: 40rpx;
  80. font-weight: bold;
  81. color: #333;
  82. margin-bottom: 16rpx;
  83. }
  84. .status-desc {
  85. font-size: 28rpx;
  86. color: #999;
  87. margin-bottom: 80rpx;
  88. }
  89. .btn-group {
  90. width: 100%;
  91. display: flex;
  92. flex-direction: column;
  93. gap: 24rpx;
  94. }
  95. .primary-btn {
  96. width: 100%;
  97. height: 96rpx;
  98. background: #C1001C;
  99. color: #fff;
  100. border-radius: 48rpx;
  101. font-size: 32rpx;
  102. font-weight: bold;
  103. display: flex;
  104. align-items: center;
  105. justify-content: center;
  106. border: none;
  107. box-shadow: 0 10rpx 20rpx rgba(193, 0, 28, 0.15);
  108. }
  109. .outline-btn {
  110. width: 100%;
  111. height: 96rpx;
  112. background: #fff;
  113. color: #C1001C;
  114. border-radius: 48rpx;
  115. font-size: 32rpx;
  116. font-weight: bold;
  117. display: flex;
  118. align-items: center;
  119. justify-content: center;
  120. border: 2rpx solid #C1001C;
  121. }
  122. .text-btn {
  123. margin-top: 20rpx;
  124. background: transparent;
  125. color: #666;
  126. font-size: 28rpx;
  127. border: none;
  128. text-decoration: underline;
  129. /* 增加下划线提示可点击 */
  130. }
  131. .text-btn:active {
  132. color: #333;
  133. opacity: 0.8;
  134. }
  135. </style>