success.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <view class="success-container">
  3. <!-- 顶部导航栏 -->
  4. <view class="nav-bar">
  5. <view class="nav-title">支付成功</view>
  6. </view>
  7. <!-- 成功内容区域 -->
  8. <view class="success-content">
  9. <!-- 成功图标 -->
  10. <view class="success-icon">
  11. <text class="iconfont icon-dagou"></text>
  12. </view>
  13. <!-- 成功标题 -->
  14. <view class="success-title">支付成功</view>
  15. <!-- 支付金额 -->
  16. <view class="amount-section">
  17. <view class="amount-label">支付金额</view>
  18. <view class="amount-display">
  19. <text class="currency">¥</text>
  20. <text class="amount">{{ amount }}</text>
  21. </view>
  22. </view>
  23. <!-- 订单信息 -->
  24. <view class="order-info">
  25. <view class="info-item">
  26. <text class="info-label">订单号</text>
  27. <text class="info-value">{{ orderId }}</text>
  28. </view>
  29. <view class="info-item">
  30. <text class="info-label">支付时间</text>
  31. <text class="info-value">{{ payTime }}</text>
  32. </view>
  33. <view class="info-item">
  34. <text class="info-label">支付方式</text>
  35. <text class="info-value">支付宝</text>
  36. </view>
  37. </view>
  38. <!-- 操作按钮 -->
  39. <view class="action-buttons">
  40. <button class="btn-primary" @click="goHome">返回首页</button>
  41. <button class="btn-secondary" @click="viewOrder">查看订单</button>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. name: 'PaySuccessPage',
  49. data() {
  50. return {
  51. amount: '0.00',
  52. orderId: '',
  53. payTime: ''
  54. }
  55. },
  56. onLoad(options) {
  57. // 获取传递的参数
  58. if (options.amount) {
  59. this.amount = options.amount;
  60. }
  61. if (options.orderId) {
  62. this.orderId = options.orderId;
  63. }
  64. // 设置支付时间
  65. this.payTime = this.formatTime(new Date());
  66. },
  67. methods: {
  68. // 格式化时间
  69. formatTime(date) {
  70. const year = date.getFullYear();
  71. const month = String(date.getMonth() + 1).padStart(2, '0');
  72. const day = String(date.getDate()).padStart(2, '0');
  73. const hours = String(date.getHours()).padStart(2, '0');
  74. const minutes = String(date.getMinutes()).padStart(2, '0');
  75. const seconds = String(date.getSeconds()).padStart(2, '0');
  76. return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  77. },
  78. // 返回首页
  79. goHome() {
  80. uni.reLaunch({
  81. url: '/pages/index/index'
  82. });
  83. },
  84. // 查看订单
  85. viewOrder() {
  86. // 这里可以跳转到订单详情页面
  87. uni.showToast({
  88. title: '订单功能开发中',
  89. icon: 'none'
  90. });
  91. }
  92. }
  93. }
  94. </script>
  95. <style lang="scss" scoped>
  96. .success-container {
  97. min-height: 100vh;
  98. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  99. position: relative;
  100. }
  101. .nav-bar {
  102. display: flex;
  103. align-items: center;
  104. justify-content: center;
  105. padding: 20rpx 30rpx;
  106. background: rgba(255, 255, 255, 0.1);
  107. backdrop-filter: blur(10px);
  108. .nav-title {
  109. color: #fff;
  110. font-size: 36rpx;
  111. font-weight: 600;
  112. }
  113. }
  114. .success-content {
  115. padding: 80rpx 40rpx;
  116. text-align: center;
  117. }
  118. .success-icon {
  119. width: 160rpx;
  120. height: 160rpx;
  121. background: rgba(255, 255, 255, 0.2);
  122. border-radius: 50%;
  123. display: flex;
  124. align-items: center;
  125. justify-content: center;
  126. margin: 0 auto 40rpx;
  127. .iconfont {
  128. color: #fff;
  129. font-size: 80rpx;
  130. }
  131. }
  132. .success-title {
  133. color: #fff;
  134. font-size: 48rpx;
  135. font-weight: 700;
  136. margin-bottom: 60rpx;
  137. }
  138. .amount-section {
  139. margin-bottom: 60rpx;
  140. .amount-label {
  141. color: rgba(255, 255, 255, 0.8);
  142. font-size: 28rpx;
  143. margin-bottom: 20rpx;
  144. }
  145. .amount-display {
  146. display: flex;
  147. align-items: baseline;
  148. justify-content: center;
  149. .currency {
  150. color: #fff;
  151. font-size: 48rpx;
  152. font-weight: 600;
  153. margin-right: 10rpx;
  154. }
  155. .amount {
  156. color: #fff;
  157. font-size: 80rpx;
  158. font-weight: 700;
  159. font-family: 'Arial', sans-serif;
  160. }
  161. }
  162. }
  163. .order-info {
  164. background: rgba(255, 255, 255, 0.95);
  165. border-radius: 20rpx;
  166. padding: 40rpx;
  167. margin-bottom: 60rpx;
  168. .info-item {
  169. display: flex;
  170. justify-content: space-between;
  171. align-items: center;
  172. padding: 20rpx 0;
  173. border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
  174. &:last-child {
  175. border-bottom: none;
  176. }
  177. .info-label {
  178. color: #666;
  179. font-size: 28rpx;
  180. }
  181. .info-value {
  182. color: #333;
  183. font-size: 28rpx;
  184. font-weight: 500;
  185. }
  186. }
  187. }
  188. .action-buttons {
  189. display: flex;
  190. flex-direction: column;
  191. gap: 30rpx;
  192. .btn-primary {
  193. background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
  194. color: #fff;
  195. border: none;
  196. border-radius: 50rpx;
  197. padding: 30rpx;
  198. font-size: 32rpx;
  199. font-weight: 600;
  200. box-shadow: 0 8rpx 30rpx rgba(22, 119, 255, 0.3);
  201. &:active {
  202. transform: scale(0.98);
  203. }
  204. }
  205. .btn-secondary {
  206. background: rgba(255, 255, 255, 0.2);
  207. color: #fff;
  208. border: 2rpx solid rgba(255, 255, 255, 0.3);
  209. border-radius: 50rpx;
  210. padding: 30rpx;
  211. font-size: 32rpx;
  212. font-weight: 600;
  213. backdrop-filter: blur(10px);
  214. &:active {
  215. background: rgba(255, 255, 255, 0.3);
  216. }
  217. }
  218. }
  219. </style>