inquiryOrderPaySuccess.vue 4.7 KB

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