success.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <view class="content">
  3. <view class="inner">
  4. <view class="top">
  5. <text class="title">支付成功</text>
  6. <image class="icon" src="/static/images/success.png"></image>
  7. <view class="btn-box">
  8. <view class="btn cancel" @click="goOrderDetails(order.orderId)"> 查看订单</view>
  9. </view>
  10. </view>
  11. <!-- 订单详情查看 -->
  12. <view class="order-info">
  13. <view class="title">订单信息</view>
  14. <view class="item">
  15. <text class="label">订单编号</text>
  16. <view class="sn-box">
  17. <view class="text">{{orderCode}}</view>
  18. <view class="copy-btn" @click="copyOrderSn(orderCode)">复制</view>
  19. </view>
  20. </view>
  21. <view class="item">
  22. <text class="label">下单时间</text>
  23. <text class="text">{{order.createTime}}</text>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. order: null,
  34. orderCode: "",
  35. ids: []
  36. }
  37. },
  38. onLoad(option) {
  39. console.log("options是", option)
  40. // this.order=JSON.parse(decodeURIComponent(option.order))
  41. this.order = JSON.parse(decodeURIComponent(option.order))
  42. console.log("this.order是", this.order)
  43. // orderCodes和ids字段表示店铺订单
  44. this.orderCode = this.order.orderCode || '';
  45. this.orderId = this.order.orderId ? this.order.orderId : '';
  46. // this.ids = this.order && this.order.ids ? this.order.ids : this.order.orderid? [this.order.orderid] : [];
  47. },
  48. methods: {
  49. copyOrderSn(text) {
  50. // 复制方法
  51. uni.setClipboardData({
  52. data: text,
  53. success: () => {
  54. uni.showToast({
  55. title: '内容已成功复制到剪切板',
  56. icon: 'none'
  57. })
  58. }
  59. });
  60. },
  61. goOrderDetails(id) {
  62. console.log("id是", id)
  63. if (id) {
  64. uni.redirectTo({
  65. url: "./storeOrderDetail?id=" + id
  66. })
  67. } else {
  68. uni.navigateTo({
  69. url: './order'
  70. })
  71. }
  72. }
  73. }
  74. }
  75. </script>
  76. <style lang="scss">
  77. page {
  78. height: 100%;
  79. }
  80. .content {
  81. height: 100%;
  82. display: flex;
  83. flex-direction: column;
  84. justify-content: space-between;
  85. .inner {
  86. padding: 20upx;
  87. .top {
  88. box-sizing: border-box;
  89. background: #FFFFFF;
  90. border-radius: 16upx;
  91. display: flex;
  92. flex-direction: column;
  93. align-items: center;
  94. padding: 50upx 0upx;
  95. .title {
  96. font-size: 40upx;
  97. font-family: PingFang SC;
  98. font-weight: 500;
  99. color: #222222;
  100. line-height: 1;
  101. text-align: center;
  102. }
  103. .icon {
  104. margin: 60upx 0upx;
  105. width: 100upx;
  106. height: 100upx;
  107. }
  108. }
  109. .order-info {
  110. margin-top: 20upx;
  111. background: #FFFFFF;
  112. border-radius: 16upx;
  113. padding: 40upx 30upx;
  114. .title {
  115. font-size: 30upx;
  116. font-family: PingFang SC;
  117. font-weight: bold;
  118. color: #222222;
  119. line-height: 1;
  120. }
  121. .item {
  122. margin-top: 40upx;
  123. display: flex;
  124. align-items: center;
  125. justify-content: space-between;
  126. .label {
  127. font-size: 26upx;
  128. font-family: PingFang SC;
  129. font-weight: 500;
  130. color: #666666;
  131. line-height: 1;
  132. }
  133. .text {
  134. font-size: 26upx;
  135. font-family: PingFang SC;
  136. font-weight: 500;
  137. color: #222222;
  138. line-height: 32upx;
  139. }
  140. .cont-text {
  141. font-size: 26upx;
  142. font-family: PingFang SC;
  143. font-weight: 500;
  144. color: #666666;
  145. .bold {
  146. color: #111111;
  147. }
  148. }
  149. .sn-box {
  150. display: flex;
  151. align-items: center;
  152. .copy-btn {
  153. width: 58upx;
  154. height: 32upx;
  155. line-height: 32upx;
  156. text-align: center;
  157. font-size: 22upx;
  158. font-family: PingFang SC;
  159. font-weight: 500;
  160. color: #222222;
  161. background: #F5F5F5;
  162. border-radius: 4upx;
  163. margin-left: 24upx;
  164. }
  165. }
  166. }
  167. .line {
  168. width: 100%;
  169. height: 1px;
  170. background: #F0F0F0;
  171. margin-top: 30upx;
  172. }
  173. }
  174. }
  175. .btn-box {
  176. margin-top: 20upx;
  177. box-sizing: border-box;
  178. display: flex;
  179. align-items: center;
  180. .btn {
  181. width: 155upx;
  182. height: 64upx;
  183. line-height: 64upx;
  184. font-size: 26upx;
  185. font-family: PingFang SC;
  186. font-weight: 500;
  187. text-align: center;
  188. border-radius: 32upx;
  189. &.cancel {
  190. border: 1px solid #DDDDDD;
  191. color: #666666;
  192. }
  193. }
  194. }
  195. }
  196. </style>