bill.vue 5.5 KB

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