inquiryOrderPaySuccess.vue 4.6 KB

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