bill.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <div class="point-bill">
  3. <div class="top">
  4. <span class="icon"></span>
  5. <span class="num">{{pointInfo.points}}</span>
  6. <span class="text">我的积分</span>
  7. </div>
  8. <div class="bottom">
  9. <div class="item" v-for="item in recordList" :key="item.id">
  10. <div class="content">
  11. <span class="text">{{item.recordType === '+'? '加油': '兑换商品'}}</span>
  12. <span class="amount" :class="item.recordType==='+'?'add':'' ">{{item.recordType + ' ' + item.integral}}</span>
  13. </div>
  14. <div class="time">{{item.createTime}}</div>
  15. </div>
  16. <!-- <div class="item">
  17. <div class="content">
  18. <span class="text">兑换商品</span>
  19. <span class="amount">- 10</span>
  20. </div>
  21. <div class="time">2018/09/20 18:00:00</div>
  22. </div>
  23. <div class="item">
  24. <div class="content">
  25. <span class="text">加油</span>
  26. <span class="amount add">+ 10</span>
  27. </div>
  28. <div class="time">2018/09/20 18:00:00</div>
  29. </div>
  30. <div class="item">
  31. <div class="content">
  32. <span class="text">兑换商品</span>
  33. <span class="amount">- 10</span>
  34. </div>
  35. <div class="time">2018/09/20 18:00:00</div>
  36. </div>
  37. <div class="item">
  38. <div class="content">
  39. <span class="text">加油</span>
  40. <span class="amount add">+ 10</span>
  41. </div>
  42. <div class="time">2018/09/20 18:00:00</div>
  43. </div> -->
  44. </div>
  45. </div>
  46. </template>
  47. <script>
  48. import ProductList from "../../components/ProductList";
  49. import moment from "moment"
  50. import { mapState, mapActions } from "vuex"
  51. export default {
  52. head() {
  53. return {
  54. title: "积分明细",
  55. };
  56. },
  57. data() {
  58. return {
  59. images: [],
  60. list: [],
  61. loading: false, // 加载状态
  62. finished: false, // 是否完成加载
  63. refreshing: false, // 是否正在上拉刷新
  64. img: "/test/1_a01_class_2@2x.png",
  65. recordList:[]
  66. };
  67. },
  68. components: {
  69. ProductList,
  70. },
  71. computed:{
  72. ...mapState({
  73. pointInfo:state=>state.point.pointInfo
  74. })
  75. },
  76. mounted() {
  77. this.getPointsRecordList();
  78. },
  79. beforeUpdate() {},
  80. updated() {},
  81. beforeDestroy() {},
  82. destroyed() {},
  83. methods: {
  84. getPointsRecordList(){
  85. this.$axios.$get("/getCustomerPointsRecordList",{
  86. params:{
  87. unionId:this.unionId,
  88. stationId:this.stationId
  89. }
  90. }).then((res)=>{
  91. this.recordList = res.data.map((ele)=>{
  92. ele.createTime = moment().utc(ele.createTime).format("YYYY.MM.DD HH:mm:ss")
  93. return ele
  94. })
  95. })
  96. }
  97. },
  98. };
  99. </script>
  100. <style>
  101. .point-bill {
  102. width: 100%;
  103. }
  104. .point-bill .top {
  105. width: 100%;
  106. height: 3.98rem;
  107. background: url("../../static/point/bj@2x.png") no-repeat 0 0;
  108. background-size: 100% 100%;
  109. position: relative;
  110. z-index: -1;
  111. }
  112. .point-bill .top .icon {
  113. background: url("../../static/point/chengzhnagzhi@2x.png") no-repeat 0 0;
  114. background-size: 100% 100%;
  115. width: 0.35rem;
  116. height: 0.35rem;
  117. position: absolute;
  118. right: 0.3rem;
  119. top: 0.3rem;
  120. }
  121. .point-bill .top .num {
  122. width: 2.12rem;
  123. height: 0.98rem;
  124. font-size: 0.7rem;
  125. font-family: PingFangSC-Regular, PingFang SC;
  126. font-weight: 400;
  127. color: #ffffff;
  128. line-height: 0.98rem;
  129. text-align: center;
  130. position: absolute;
  131. left: calc(50% - 1.06rem);
  132. top: 0.6rem;
  133. }
  134. .point-bill .top .text {
  135. width: 1.12rem;
  136. height: 0.4rem;
  137. font-size: 0.28rem;
  138. font-family: PingFangSC-Regular, PingFang SC;
  139. font-weight: 400;
  140. color: #ffffff;
  141. line-height: 0.4rem;
  142. position: absolute;
  143. left: calc(50% - 0.56rem);
  144. top: 1.68rem;
  145. }
  146. .point-bill .bottom {
  147. width: 100%;
  148. min-height:2rem;
  149. background: #ffffff;
  150. box-shadow: 0rem 0.02rem 0.1rem 0.05rem rgba(227, 227, 227, 0.5);
  151. border-radius: 0.25rem;
  152. margin-top: -1.3rem;
  153. padding: 0.4rem 0.3rem;
  154. box-sizing: border-box;
  155. }
  156. .point-bill .bottom .item {
  157. width: 100%;
  158. height: 1.56rem;
  159. padding: 0.3rem 0;
  160. border-bottom: 0.01rem solid #e0e0e0;
  161. box-sizing: border-box;
  162. }
  163. .point-bill .bottom .item:nth-last-child(1){
  164. border-bottom:none;
  165. }
  166. .point-bill .bottom .item .content {
  167. font-family: PingFangSC-Regular, PingFang SC;
  168. display: flex;
  169. justify-content: space-between;
  170. }
  171. .point-bill .bottom .item .content .text {
  172. display: inline-block;
  173. height: 0.45rem;
  174. font-size: 0.32rem;
  175. font-weight: 400;
  176. color: #111111;
  177. line-height: 0.45rem;
  178. }
  179. .point-bill .bottom .item .content .amount {
  180. display: inline-block;
  181. height: 0.45rem;
  182. font-size: 0.32rem;
  183. font-weight: 500;
  184. color: #111111;
  185. line-height: 0.45rem;
  186. }
  187. .point-bill .bottom .item .content .add {
  188. color: #f3b235;
  189. }
  190. .point-bill .bottom .item .time {
  191. height: 0.4rem;
  192. font-size: 0.28rem;
  193. font-family: PingFangSC-Regular, PingFang SC;
  194. font-weight: 400;
  195. color: #aaaaaa;
  196. line-height: 0.4rem;
  197. }
  198. </style>