orderdes.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <template>
  2. <view class="page">
  3. <loadSke :loading='loading'>
  4. <view class="remind-top">首页->我的->我的订单</view>
  5. <view class="des-box">
  6. <view>
  7. <view v-if="true" class="code-box">
  8. <image class="qrcode" :src="orderDes.goodsPictureUrl" mode="widthFix"></image>
  9. <view class="code">
  10. <text>充值用户</text>
  11. <text>{{orderDes.charge_account}}</text>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="order-num">
  16. <text>订单号:{{outTradeNo}}</text>
  17. <text>{{orderDes.orderStatusDesc}}</text>
  18. <text v-if="orderDes.orderStatus==3">{{orderDes.recharge_description}}</text>
  19. </view>
  20. <view class="des">
  21. <text class="film-name">充值商品</text>
  22. <view class="film-time">
  23. <text>购买时间</text>
  24. <text>{{orderDes.create_time}}</text>
  25. </view>
  26. <view class="film-address">
  27. <text>购买商品</text>
  28. <text>{{orderDes.product_name}}</text>
  29. </view>
  30. <view class="film-video">
  31. <text>购买数量</text>
  32. <text>{{orderDes.buy_num}}</text>
  33. </view>
  34. <view class="film-seat">
  35. <text>购买价格</text>
  36. <text>{{orderDes.total}}</text>
  37. </view>
  38. </view>
  39. </view>
  40. </loadSke>
  41. </view>
  42. </template>
  43. <script>
  44. export default {
  45. data: () => ({
  46. orderDes: {},
  47. loading: true,
  48. outTradeNo: null,
  49. pollingTiemId: null
  50. }),
  51. onLoad: function(option) {
  52. this.outTradeNo = option.outTradeNo
  53. },
  54. mounted() {
  55. this.init()
  56. },
  57. methods: {
  58. async init() {
  59. let orderRes = await this.$api.order.getWxOrder(this.outTradeNo)
  60. this.orderDes = orderRes.data
  61. // 直接查询的接口
  62. // await this.$api.fulu.orderInfoGet({
  63. // customer_order_no: this.outTradeNo
  64. // })
  65. this.loading = false
  66. if (this.orderDes.orderStatus == 1) {
  67. this.polling()
  68. }
  69. },
  70. polling() {
  71. this.pollingTiemId = setInterval(async () => {
  72. let orderRes = await this.$api.order.getWxOrder(this.outTradeNo)
  73. this.orderDes = orderRes.data
  74. if (this.orderDes.orderStatus != 1) {
  75. clearInterval(this.pollingTiemId)
  76. }
  77. }, 3000)
  78. }
  79. },
  80. beforeDestroy() {
  81. clearInterval(this.pollingTiemId)
  82. }
  83. }
  84. </script>
  85. <style lang="scss">
  86. .page {
  87. padding-bottom: 20rpx;
  88. }
  89. .remind {
  90. padding-top: 36rpx;
  91. font-size: 26rpx;
  92. font-weight: 400;
  93. color: #0F0404;
  94. text-align: center;
  95. }
  96. .remind-top {
  97. margin-top: 36rpx;
  98. font-size: 26rpx;
  99. font-weight: 400;
  100. color: #ff0000;
  101. text-align: center;
  102. }
  103. .des-box {
  104. width: 564rpx;
  105. background: #FFFFFF;
  106. border-radius: 20rpx;
  107. margin: auto;
  108. margin-top: 30rpx;
  109. .code-box {
  110. display: flex;
  111. flex-direction: column;
  112. align-items: center;
  113. padding-bottom: 38rpx;
  114. .code {
  115. margin-top: 43rpx;
  116. text {
  117. font-size: 26rpx;
  118. font-weight: 400;
  119. color: #666666;
  120. margin-right: 20rpx;
  121. &:nth-child(2) {
  122. color: #0F0404;
  123. }
  124. }
  125. }
  126. .qrcode {
  127. margin-top: 43rpx;
  128. width: 360rpx;
  129. height: 360rpx;
  130. }
  131. .qrcode-loading {
  132. margin-top: 43rpx;
  133. width: 100%;
  134. }
  135. }
  136. .order-num {
  137. display: flex;
  138. flex-direction: column;
  139. justify-content: space-between;
  140. align-items: center;
  141. padding: 34rpx 31rpx;
  142. border-top: 1rpx dashed #D9D9D9;
  143. border-bottom: 1rpx dashed #D9D9D9;
  144. position: relative;
  145. &::after {
  146. content: '';
  147. width: 24rpx;
  148. height: 24rpx;
  149. border-radius: 50%;
  150. background-color: #F1F1F1;
  151. position: absolute;
  152. top: 0;
  153. left: 0;
  154. transform: translate(-50%, -50%);
  155. }
  156. &::before {
  157. content: '';
  158. width: 24rpx;
  159. height: 24rpx;
  160. border-radius: 50%;
  161. background-color: #F1F1F1;
  162. position: absolute;
  163. top: 0;
  164. right: 0;
  165. transform: translate(50%, -50%);
  166. }
  167. text {
  168. &:nth-child(1) {
  169. margin-top: 60rpx;
  170. word-break: break-all;
  171. font-size: 22rpx;
  172. font-weight: 400;
  173. color: #666666;
  174. }
  175. &:nth-child(2) {
  176. margin-top: 10rpx;
  177. padding: 10rpx;
  178. display: flex;
  179. justify-content: center;
  180. align-items: center;
  181. background: #FFE5E5;
  182. border-radius: 20rpx;
  183. border-top-left-radius: 0;
  184. border-bottom-left-radius: 0;
  185. font-size: 20rpx;
  186. font-weight: 400;
  187. color: #E31818;
  188. position: absolute;
  189. left: 0;
  190. top: 20rpx;
  191. }
  192. &:nth-child(3) {
  193. margin-top: 10rpx;
  194. padding: 10rpx;
  195. display: flex;
  196. justify-content: center;
  197. align-items: center;
  198. font-size: 20rpx;
  199. font-weight: 400;
  200. color: #E31818;
  201. }
  202. }
  203. }
  204. .des {
  205. padding: 45rpx 30rpx;
  206. border-bottom: 1rpx dashed #D9D9D9;
  207. display: flex;
  208. flex-direction: column;
  209. .film-name {
  210. font-size: 30rpx;
  211. font-weight: 400;
  212. color: #0F0404;
  213. }
  214. text {
  215. font-size: 26rpx;
  216. font-weight: 400;
  217. color: #666666;
  218. margin-right: 20rpx;
  219. white-space: nowrap;
  220. }
  221. .film-time {
  222. text:nth-child(2) {
  223. color: #999999;
  224. }
  225. }
  226. .film-address {
  227. display: flex;
  228. justify-content: flex-start;
  229. align-items: stretch;
  230. text:nth-child(2) {
  231. color: #999999;
  232. white-space: pre-wrap;
  233. }
  234. }
  235. .film-video {
  236. display: flex;
  237. justify-content: flex-start;
  238. align-items: stretch;
  239. text:nth-child(2) {
  240. color: #999999;
  241. white-space: pre-wrap;
  242. }
  243. }
  244. .film-seat {
  245. display: flex;
  246. justify-content: flex-start;
  247. align-items: stretch;
  248. margin-top: 10rpx;
  249. .seat-box {
  250. display: flex;
  251. flex-wrap: wrap;
  252. text {
  253. height: 40rpx;
  254. padding: 4rpx 15rpx;
  255. margin-bottom: 10rpx;
  256. background: #EBEBEB;
  257. border-radius: 4rpx;
  258. color: #999999;
  259. }
  260. }
  261. }
  262. }
  263. .price {
  264. padding: 40rpx 30rpx;
  265. text {
  266. font-size: 26rpx;
  267. font-weight: 400;
  268. color: #666666;
  269. margin-right: 20rpx;
  270. &:nth-child(2) {
  271. color: #E31818;
  272. }
  273. }
  274. }
  275. }
  276. </style>