success.vue 4.2 KB

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