complete.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <view class="complete-page">
  3. <view class="success-container">
  4. <image class="success-image" src="/static/task/success.png" mode="widthFix" />
  5. <view style="padding-top: 50upx; color: #1c84c6"> 订单已完成,感谢您的付出! </view>
  6. <view class="btn-group" style="padding-top: 200upx">
  7. <view class="btn btn-primary " @click="goToHome">去首页</view>
  8. <view class="btn btn-secondary" @click="uploadImage">去上传图片</view>
  9. </view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. riderOrderId: ''
  18. }
  19. },
  20. onLoad(options) {
  21. if (options.id) {
  22. this.riderOrderId = options.id
  23. }
  24. },
  25. methods: {
  26. // 去首页
  27. goToHome() {
  28. uni.switchTab({
  29. url: '/pages/task/task'
  30. })
  31. },
  32. // 上传图片
  33. uploadImage() {
  34. if (!this.riderOrderId) {
  35. this.$api.msg('订单ID不存在')
  36. return
  37. }
  38. // 跳转到图片上传页面,带上订单ID
  39. uni.redirectTo({
  40. url: `/pages/order/order?id=${this.riderOrderId}`
  41. })
  42. }
  43. }
  44. }
  45. </script>
  46. <style lang="scss" scoped>
  47. .complete-page {
  48. min-height: 100vh;
  49. background-color: #f8f8f8;
  50. display: flex;
  51. flex-direction: column;
  52. align-items: center;
  53. justify-content: center;
  54. padding: 40upx;
  55. box-sizing: border-box;
  56. }
  57. .success-container {
  58. flex: 1;
  59. display: flex;
  60. flex-direction: column;
  61. align-items: center;
  62. .success-image {
  63. width: 550upx;
  64. height: 550upx;
  65. }
  66. }
  67. .button-container {
  68. width: 100%;
  69. max-width: 600upx;
  70. }
  71. .btn {
  72. flex: 1;
  73. height: 88upx;
  74. line-height: 88upx;
  75. text-align: center;
  76. border-radius: 44upx;
  77. font-size: 32upx;
  78. font-weight: 500;
  79. width: 500upx;
  80. margin-top: 40upx;
  81. margin-bottom: 60upx;
  82. &.btn-primary {
  83. background-color: #007aff;
  84. color: #fff;
  85. }
  86. &.btn-secondary {
  87. background-color: #fff;
  88. color: #007aff;
  89. border: 2upx solid #007aff;
  90. }
  91. &:active {
  92. opacity: 0.8;
  93. }
  94. }
  95. </style>