success.vue 4.2 KB

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