packageOrderPaySuccess.vue 4.4 KB

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