index.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <view>
  3. <!-- index.wxml -->
  4. <com-header :page-title="pageTitle" :show-back="showBack" :show-header="showHeader"></com-header>
  5. <view class="wrap">
  6. <view class="wrap_t">
  7. <image class="banner" src="/static/statics/img/success_bg.png"></image>
  8. </view>
  9. <view class="order_wrap">
  10. <view class="order_t">
  11. <image class="icon_success" src="/static/statics/img/icon_success.png"></image>
  12. <view class="tips">支付成功</view>
  13. <view class="desc">您的订单会快速进行处理</view>
  14. <view class="price">
  15. <text class="unit">¥</text>
  16. {{ orderInfo.pay_price }}
  17. </view>
  18. </view>
  19. <image class="order_nr_t" src="/static/statics/img/line_tu.png"></image>
  20. <view class="order_nr">
  21. <view class="order_item">
  22. <text class="item_l">订单编号:</text>
  23. <text class="item_r">{{ orderInfo.order_num }}</text>
  24. </view>
  25. <view class="order_item">
  26. <text class="item_l">下单时间:</text>
  27. <text class="item_r">{{ orderInfo.created_at }}</text>
  28. </view>
  29. <view class="order_item">
  30. <text class="item_l">支付方式:</text>
  31. <text class="item_r">{{ orderInfo.pay_name }}</text>
  32. </view>
  33. <view class="order_item">
  34. <text class="item_l">交易时间:</text>
  35. <text class="item_r">{{ orderInfo.pay_at }}</text>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="btn_wrap" @tap="toOrderDetail">
  40. <view class="btn">订单详情</view>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. // index.js
  47. let myPro = require('../../utils/wxRequest.js');
  48. let util = require('../../utils/util.js');
  49. export default {
  50. data() {
  51. return {
  52. pageTitle: '支付成功',
  53. showBack: true,
  54. showHeader: false,
  55. order_id: '',
  56. orderInfo: {
  57. order_num: '',
  58. created_at: '',
  59. pay_name: '',
  60. pay_at: ''
  61. }
  62. };
  63. },
  64. onLoad: function (options) {
  65. // Do some initialize when page load.
  66. let that = this;
  67. that.setData({
  68. order_id: options.order_id
  69. });
  70. },
  71. onShow: function () {
  72. // Do something when page show.
  73. let that = this; // 获取订单信息
  74. that.getOrderDetail();
  75. },
  76. onReady: function () {
  77. // Do something when page ready.
  78. },
  79. onHide: function () {
  80. // Do something when page hide.
  81. },
  82. onUnload: function () {
  83. // Do something when page close.
  84. },
  85. onPullDownRefresh: function () {
  86. // Do something when pull down.
  87. },
  88. onReachBottom: function () {
  89. // Do something when page reach bottom.
  90. },
  91. onPageScroll: function () {
  92. // Do something when page scroll
  93. },
  94. onResize: function () {
  95. // Do something when page resize
  96. },
  97. methods: {
  98. // 获取订单信息
  99. getOrderDetail() {
  100. let that = this;
  101. let params = {
  102. order_id: that.order_id
  103. };
  104. myPro
  105. .wxRequest('user/v2/order/detail', 'GET', params)
  106. .then((res) => {
  107. that.setData({
  108. orderInfo: res.result
  109. });
  110. })
  111. .catch((err) => {
  112. console.log('报错信息', err);
  113. uni.showToast({
  114. title: err,
  115. icon: 'none'
  116. });
  117. });
  118. },
  119. // 去订单详情
  120. toOrderDetail(event) {
  121. let that = this;
  122. uni.redirectTo({
  123. url: '/pages/user/order/detail/index?order_id=' + that.order_id
  124. });
  125. }
  126. }
  127. };
  128. </script>
  129. <style>
  130. /**index.wxss**/
  131. .page_title {
  132. width: 750rpx;
  133. height: 64rpx;
  134. display: flex;
  135. align-items: center;
  136. justify-content: center;
  137. position: fixed;
  138. left: 0;
  139. color: #ffffff;
  140. font-size: 36rpx;
  141. }
  142. .wrap {
  143. min-height: 100vh;
  144. background: #f6f6f6;
  145. }
  146. .wrap_t .banner {
  147. width: 750rpx;
  148. height: 501rpx;
  149. }
  150. .order_wrap {
  151. width: 690rpx;
  152. /* background: #FFFFFF; */
  153. margin: -300rpx auto 0;
  154. position: relative;
  155. display: flex;
  156. flex-direction: column;
  157. }
  158. .order_wrap .banner_wenzi {
  159. width: 514rpx;
  160. height: 203rpx;
  161. position: absolute;
  162. top: -180rpx;
  163. left: 50%;
  164. transform: translateX(-50%);
  165. }
  166. .order_t {
  167. padding: 40rpx 0 30rpx;
  168. text-align: center;
  169. background: #ffffff;
  170. border-radius: 10rpx 10rpx 0 0;
  171. }
  172. .order_t .icon_success {
  173. width: 177rpx;
  174. height: 124rpx;
  175. }
  176. .order_t .tips {
  177. font-size: 44rpx;
  178. font-weight: 500;
  179. color: #2d5f59;
  180. padding-top: 20rpx;
  181. }
  182. .order_t .desc {
  183. font-size: 30rpx;
  184. color: rgba(0, 0, 0, 0.54);
  185. padding-top: 10rpx;
  186. }
  187. .order_t .price {
  188. font-size: 60rpx;
  189. color: #000000;
  190. padding-top: 20rpx;
  191. }
  192. .order_t .price .unit {
  193. font-size: 40rpx;
  194. }
  195. .order_wrap .order_nr_t {
  196. width: 690rpx;
  197. height: 28rpx;
  198. }
  199. .order_nr {
  200. padding: 40rpx 0 18rpx;
  201. background: #ffffff;
  202. border-radius: 0 0 10rpx 10rpx;
  203. }
  204. .order_nr .order_item {
  205. padding: 0 30rpx 28rpx;
  206. font-size: 26rpx;
  207. color: rgba(0, 0, 0, 0.54);
  208. }
  209. .order_nr .order_item .item_r {
  210. padding-left: 20rpx;
  211. color: rgba(0, 0, 0, 0.87);
  212. }
  213. .btn_wrap {
  214. margin-top: 90rpx;
  215. }
  216. .btn_wrap .btn {
  217. width: 405rpx;
  218. height: 98rpx;
  219. margin: 0 auto;
  220. background: #2d5f59;
  221. border-radius: 10rpx;
  222. font-size: 28rpx;
  223. color: #fefefe;
  224. display: flex;
  225. align-items: center;
  226. justify-content: center;
  227. }
  228. </style>