courseOrderPaySuccess.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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="back()"> 返回首页</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. <text class="text">{{order.orderCode}}</text>
  18. <view class="copy-btn" @click="copyTest(order.orderCode)">复制</view>
  19. </view>
  20. </view>
  21. <view class="item">
  22. <text class="label">支付金额</text>
  23. <text class="text">{{order.payMoney.toFixed(2)}}</text>
  24. </view>
  25. <view class="item">
  26. <text class="label">下单时间</text>
  27. <text class="text">{{order.createTime}}</text>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import {getCourseOrderById} from '@/api/courseOrder.js'
  35. export default {
  36. data() {
  37. return {
  38. order:null,
  39. }
  40. },
  41. onLoad(option) {
  42. uni.setNavigationBarTitle({
  43.   title:'支付结果'
  44. })
  45. this.orderId=option.orderId;
  46. this.getCourseOrderById();
  47. },
  48. methods: {
  49. back(){
  50. uni.switchTab({
  51. url:"/pages/index/index"
  52. })
  53. },
  54. getCourseOrderById(){
  55. var data = {orderId:this.orderId};
  56. var that=this;
  57. uni.showLoading();
  58. getCourseOrderById(data).then(
  59. res => {
  60. uni.hideLoading();
  61. if(res.code==200){
  62. that.order=res.order;
  63. }else{
  64. uni.showToast({
  65. icon:'none',
  66. title: res.msg,
  67. });
  68. }
  69. },
  70. rej => {}
  71. );
  72. },
  73. copyTest(text) {
  74. // 复制方法
  75. uni.setClipboardData({
  76. data:text,
  77. success:()=>{
  78. uni.showToast({
  79. title:'内容已成功复制到剪切板',
  80. icon:'none'
  81. })
  82. }
  83. });
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="scss">
  89. page{
  90. height: 100%;
  91. }
  92. .content{
  93. height: 100%;
  94. display: flex;
  95. flex-direction: column;
  96. justify-content: space-between;
  97. .inner{
  98. padding: 20upx;
  99. .top{
  100. box-sizing: border-box;
  101. background: #FFFFFF;
  102. border-radius: 16upx;
  103. display: flex;
  104. flex-direction: column;
  105. align-items: center;
  106. padding: 50upx 0upx;
  107. .title{
  108. font-size: 40upx;
  109. font-family: PingFang SC;
  110. font-weight: 500;
  111. color: #222222;
  112. line-height: 1;
  113. text-align: center;
  114. }
  115. .icon{
  116. margin: 60upx 0upx;
  117. width: 100upx;
  118. height: 100upx;
  119. }
  120. }
  121. .order-info{
  122. margin-top: 20upx;
  123. background: #FFFFFF;
  124. border-radius: 16upx;
  125. padding: 40upx 30upx;
  126. .title{
  127. font-size: 30upx;
  128. font-family: PingFang SC;
  129. font-weight: bold;
  130. color: #222222;
  131. line-height: 1;
  132. }
  133. .item{
  134. margin-top: 40upx;
  135. display: flex;
  136. align-items: center;
  137. justify-content: space-between;
  138. .label{
  139. font-size: 26upx;
  140. font-family: PingFang SC;
  141. font-weight: 500;
  142. color: #666666;
  143. line-height: 1;
  144. }
  145. .text{
  146. font-size: 26upx;
  147. font-family: PingFang SC;
  148. font-weight: 500;
  149. color: #222222;
  150. line-height: 32upx;
  151. }
  152. .cont-text{
  153. font-size: 26upx;
  154. font-family: PingFang SC;
  155. font-weight: 500;
  156. color: #666666;
  157. .bold{
  158. color: #111111;
  159. }
  160. }
  161. .sn-box{
  162. display: flex;
  163. align-items: center;
  164. .copy-btn{
  165. width: 58upx;
  166. height: 32upx;
  167. line-height: 32upx;
  168. text-align: center;
  169. font-size: 22upx;
  170. font-family: PingFang SC;
  171. font-weight: 500;
  172. color: #222222;
  173. background: #F5F5F5;
  174. border-radius: 4upx;
  175. margin-left: 24upx;
  176. }
  177. }
  178. }
  179. .line{
  180. width: 100%;
  181. height: 1px;
  182. background: #F0F0F0;
  183. margin-top: 30upx;
  184. }
  185. }
  186. }
  187. .btn-box{
  188. margin-top: 20upx;
  189. box-sizing: border-box;
  190. display: flex;
  191. align-items: center;
  192. .btn{
  193. width: 155upx;
  194. height: 64upx;
  195. line-height: 64upx;
  196. font-size: 26upx;
  197. font-family: PingFang SC;
  198. font-weight: 500;
  199. text-align: center;
  200. border-radius: 32upx;
  201. &.cancel{
  202. border: 1px solid #DDDDDD;
  203. color: #666666;
  204. }
  205. }
  206. }
  207. }
  208. </style>