recharge_order.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <template>
  2. <div class="box">
  3. <div class="null-page" v-show="yes"></div>
  4. <el-card class="box-card">
  5. <div slot="header" class="clearfix">
  6. <el-breadcrumb separator="/">
  7. <el-breadcrumb-item :to="{ path: '/member/account' }">账户余额</el-breadcrumb-item>
  8. <el-breadcrumb-item :to="{ path: '/member/recharge_list' }">充值套餐列表</el-breadcrumb-item>
  9. <el-breadcrumb-item>充值记录</el-breadcrumb-item>
  10. </el-breadcrumb>
  11. </div>
  12. <div v-loading="loading">
  13. <div class="order-list">
  14. <nav>
  15. <li>套餐名称</li>
  16. <li>面值</li>
  17. <li>购买价格</li>
  18. <li>赠送积分</li>
  19. <li>赠送成长值</li>
  20. </nav>
  21. <div class="list" v-if="orderList.length > 0">
  22. <div class="item" v-for="(orderItem, orderIndex) in orderList" :key="orderIndex">
  23. <div class="head">
  24. <span class="create-time">{{ $util.timeStampTurnTime(orderItem.create_time) }}</span>
  25. <span class="order-no">订单号:{{ orderItem.order_no }}</span>
  26. </div>
  27. <ul>
  28. <li>
  29. <div class="img-wrap"><el-image :src="$img(orderItem.cover_img)" fit="cover" @error="imageError(orderIndex)"></el-image></div>
  30. <div class="info-wrap">
  31. <h5 :title="orderItem.recharge_name">{{ orderItem.recharge_name }}</h5>
  32. <!-- <span>规格:规格值</span> -->
  33. </div>
  34. </li>
  35. <li>
  36. <span>¥{{ orderItem.face_value }}</span>
  37. </li>
  38. <li>
  39. <span>¥{{ orderItem.buy_price }}</span>
  40. </li>
  41. <li>
  42. <span>{{ orderItem.point }}</span>
  43. </li>
  44. <li>
  45. <span>{{ orderItem.growth }}</span>
  46. </li>
  47. </ul>
  48. </div>
  49. </div>
  50. <div v-else-if="!loading && orderList.length == 0" class="empty-wrap">暂无相关订单</div>
  51. </div>
  52. <div class="pager">
  53. <el-pagination
  54. background
  55. :pager-count="5"
  56. :total="total"
  57. prev-text="上一页"
  58. next-text="下一页"
  59. :current-page.sync="currentPage"
  60. :page-size.sync="pageSize"
  61. @size-change="handlePageSizeChange"
  62. @current-change="handleCurrentPageChange"
  63. hide-on-single-page
  64. ></el-pagination>
  65. </div>
  66. </div>
  67. </el-card>
  68. </div>
  69. </template>
  70. <script>
  71. import { rechargeOrder } from "@/api/member/account"
  72. import { mapGetters } from 'vuex';
  73. export default {
  74. name: "recharge_list",
  75. layout: "member",
  76. components: {},
  77. data: () => {
  78. return {
  79. orderList: [],
  80. total: 0,
  81. currentPage: 1,
  82. pageSize: 10,
  83. loading: true,
  84. yes: true
  85. }
  86. },
  87. created() {
  88. this.getListData()
  89. },
  90. mounted() {
  91. let self = this;
  92. setTimeout(function() {
  93. self.yes = false
  94. }, 300)
  95. },
  96. computed: {
  97. ...mapGetters(['defaultGoodsImage'])
  98. },
  99. methods: {
  100. handlePageSizeChange(size) {
  101. this.pageSize = size
  102. this.refresh()
  103. },
  104. handleCurrentPageChange(page) {
  105. this.currentPage = page
  106. this.refresh()
  107. },
  108. refresh() {
  109. this.loading = true
  110. this.getListData()
  111. },
  112. getListData() {
  113. rechargeOrder({
  114. page: this.currentPage,
  115. page_size: this.pageSize
  116. }).then(res => {
  117. if (res.code == 0 && res.data) {
  118. this.orderList = res.data.list;
  119. } else {
  120. this.$message.warning(res.message)
  121. }
  122. this.loading = false
  123. }).catch(err => {
  124. this.loading = false
  125. })
  126. },
  127. imageError(index) {
  128. this.orderList[index].cover_img = this.defaultGoodsImage;
  129. },
  130. }
  131. }
  132. </script>
  133. <style lang="scss" scoped>
  134. .box {
  135. width: 100%;
  136. position: relative;
  137. }
  138. .null-page {
  139. width: 100%;
  140. height: 730px;
  141. background-color: #FFFFFF;
  142. position: absolute;
  143. top: 0;
  144. left: 0;
  145. z-index: 9;
  146. }
  147. .el-card.is-always-shadow,
  148. .el-card.is-hover-shadow:focus,
  149. .el-card.is-hover-shadow:hover {
  150. box-shadow: unset;
  151. }
  152. .el-card {
  153. border: 0;
  154. }
  155. .order-list {
  156. nav {
  157. overflow: hidden;
  158. padding: 10px;
  159. background: #fff;
  160. margin-bottom: 10px;
  161. border-bottom: 1px solid #eeeeee;
  162. li {
  163. float: left;
  164. &:nth-child(1) {
  165. width: 40%;
  166. }
  167. &:nth-child(2) {
  168. width: 15%;
  169. }
  170. &:nth-child(3) {
  171. width: 15%;
  172. }
  173. &:nth-child(4) {
  174. width: 15%;
  175. }
  176. &:nth-child(5) {
  177. width: 15%;
  178. }
  179. }
  180. }
  181. .list {
  182. .item {
  183. margin-bottom: 20px;
  184. border: 1px solid #eeeeee;
  185. border-top: 0;
  186. .head {
  187. padding: 8px 10px;
  188. background: #f7f7f7;
  189. font-size: 12px;
  190. .create-time {
  191. margin-right: 10px;
  192. }
  193. border-bottom: 1px solid #eeeeee;
  194. a {
  195. margin: 0 10px 0 20px;
  196. }
  197. .order-type {
  198. margin-left: 30px;
  199. }
  200. }
  201. }
  202. ul {
  203. background-color: #fff;
  204. padding: 10px;
  205. overflow: hidden;
  206. li {
  207. float: left;
  208. line-height: 60px;
  209. &:nth-child(1) {
  210. width: 40%;
  211. line-height: inherit;
  212. .img-wrap {
  213. width: 60px;
  214. height: 60px;
  215. float: left;
  216. margin-right: 10px;
  217. border-radius: 5px;
  218. overflow: hidden;
  219. .el-image {
  220. width: 100%;
  221. height: 100%;
  222. }
  223. }
  224. .info-wrap {
  225. margin-left: 70px;
  226. h5 {
  227. font-weight: normal;
  228. font-size: $ns-font-size-base;
  229. display: -webkit-box;
  230. -webkit-box-orient: vertical;
  231. -webkit-line-clamp: 2;
  232. overflow: hidden;
  233. margin-right: 10px;
  234. }
  235. }
  236. }
  237. &:nth-child(2) {
  238. width: 15%;
  239. }
  240. &:nth-child(3) {
  241. width: 15%;
  242. }
  243. &:nth-child(4) {
  244. width: 15%;
  245. }
  246. &:nth-child(5) {
  247. width: 15%;
  248. }
  249. }
  250. }
  251. }
  252. .empty-wrap {
  253. text-align: center;
  254. padding: 10px;
  255. }
  256. }
  257. </style>