storeOrderPaySuccess.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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.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 {getStoreOrderById} from '@/api/storeOrder.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('refreshStoreOrder');
  46. this.orderId=option.orderId;
  47. this.getStoreOrderById();
  48. },
  49. methods: {
  50. getStoreOrderById(){
  51. var data = {orderId:this.orderId};
  52. var that=this;
  53. uni.showLoading();
  54. getStoreOrderById(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. console.log(orderId)
  83. uni.redirectTo({
  84. url: "/pages_order/storeOrderDetail?orderId="+orderId
  85. })
  86. }
  87. }
  88. }
  89. </script>
  90. <style lang="scss">
  91. page{
  92. height: 100%;
  93. }
  94. .content{
  95. height: 100%;
  96. display: flex;
  97. flex-direction: column;
  98. justify-content: space-between;
  99. .inner{
  100. padding: 20upx;
  101. .top{
  102. box-sizing: border-box;
  103. background: #FFFFFF;
  104. border-radius: 16upx;
  105. display: flex;
  106. flex-direction: column;
  107. align-items: center;
  108. padding: 50upx 0upx;
  109. .title{
  110. font-size: 40upx;
  111. font-family: PingFang SC;
  112. font-weight: 500;
  113. color: #222222;
  114. line-height: 1;
  115. text-align: center;
  116. }
  117. .icon{
  118. margin: 60upx 0upx;
  119. width: 100upx;
  120. height: 100upx;
  121. }
  122. }
  123. .order-info{
  124. margin-top: 20upx;
  125. background: #FFFFFF;
  126. border-radius: 16upx;
  127. padding: 40upx 30upx;
  128. .title{
  129. font-size: 30upx;
  130. font-family: PingFang SC;
  131. font-weight: bold;
  132. color: #222222;
  133. line-height: 1;
  134. }
  135. .item{
  136. margin-top: 40upx;
  137. display: flex;
  138. align-items: center;
  139. justify-content: space-between;
  140. .label{
  141. font-size: 26upx;
  142. font-family: PingFang SC;
  143. font-weight: 500;
  144. color: #666666;
  145. line-height: 1;
  146. }
  147. .text{
  148. font-size: 26upx;
  149. font-family: PingFang SC;
  150. font-weight: 500;
  151. color: #222222;
  152. line-height: 32upx;
  153. }
  154. .cont-text{
  155. font-size: 26upx;
  156. font-family: PingFang SC;
  157. font-weight: 500;
  158. color: #666666;
  159. .bold{
  160. color: #111111;
  161. }
  162. }
  163. .sn-box{
  164. display: flex;
  165. align-items: center;
  166. .copy-btn{
  167. width: 58upx;
  168. height: 32upx;
  169. line-height: 32upx;
  170. text-align: center;
  171. font-size: 22upx;
  172. font-family: PingFang SC;
  173. font-weight: 500;
  174. color: #222222;
  175. background: #F5F5F5;
  176. border-radius: 4upx;
  177. margin-left: 24upx;
  178. }
  179. }
  180. }
  181. .line{
  182. width: 100%;
  183. height: 1px;
  184. background: #F0F0F0;
  185. margin-top: 30upx;
  186. }
  187. }
  188. }
  189. .btn-box{
  190. margin-top: 20upx;
  191. box-sizing: border-box;
  192. display: flex;
  193. align-items: center;
  194. .btn{
  195. width: 155upx;
  196. height: 64upx;
  197. line-height: 64upx;
  198. font-size: 26upx;
  199. font-family: PingFang SC;
  200. font-weight: 500;
  201. text-align: center;
  202. border-radius: 32upx;
  203. &.cancel{
  204. border: 1px solid #DDDDDD;
  205. color: #666666;
  206. }
  207. }
  208. }
  209. }
  210. </style>