bill.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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.getPointsRecordList();
  84. },
  85. beforeUpdate() {},
  86. updated() {},
  87. beforeDestroy() {},
  88. destroyed() {},
  89. methods: {
  90. getPointsRecordList(){
  91. this.$axios.$get("/getCustomerPointsRecordList",{
  92. params:{
  93. unionId:this.unionId,
  94. stationId:this.stationId
  95. }
  96. }).then((res)=>{
  97. this.recordList = res.data.map((ele)=>{
  98. ele.createTime = moment(ele.createTime,'MMM DD, YYYY HH:mm:ss A').utc().format("YYYY/MM/DD HH:mm:ss")
  99. return ele
  100. })
  101. })
  102. }
  103. },
  104. };
  105. </script>
  106. <style>
  107. .point-bill {
  108. width: 100%;
  109. }
  110. .point-bill .top {
  111. width: 100%;
  112. height: 3.98rem;
  113. background: url("../../static/point/bj@2x.png") no-repeat 0 0;
  114. background-size: 100% 100%;
  115. position: relative;
  116. z-index: -1;
  117. }
  118. .point-bill .top .icon {
  119. background: url("../../static/point/chengzhnagzhi@2x.png") no-repeat 0 0;
  120. background-size: 100% 100%;
  121. width: 0.35rem;
  122. height: 0.35rem;
  123. position: absolute;
  124. right: 0.3rem;
  125. top: 0.3rem;
  126. }
  127. .point-bill .top .num {
  128. width: 2.12rem;
  129. height: 0.98rem;
  130. font-size: 0.7rem;
  131. font-family: PingFangSC-Regular, PingFang SC;
  132. font-weight: 400;
  133. color: #ffffff;
  134. line-height: 0.98rem;
  135. text-align: center;
  136. position: absolute;
  137. left: calc(50% - 1.06rem);
  138. top: 0.6rem;
  139. }
  140. .point-bill .top .text {
  141. width: 1.12rem;
  142. height: 0.4rem;
  143. font-size: 0.28rem;
  144. font-family: PingFangSC-Regular, PingFang SC;
  145. font-weight: 400;
  146. color: #ffffff;
  147. line-height: 0.4rem;
  148. position: absolute;
  149. left: calc(50% - 0.56rem);
  150. top: 1.68rem;
  151. }
  152. .point-bill .bottom {
  153. width: 100%;
  154. min-height:2rem;
  155. background: #ffffff;
  156. box-shadow: 0rem 0.02rem 0.1rem 0.05rem rgba(227, 227, 227, 0.5);
  157. border-radius: 0.25rem;
  158. margin-top: -1.3rem;
  159. padding: 0.4rem 0.3rem;
  160. box-sizing: border-box;
  161. }
  162. .point-bill .bottom .no-img{
  163. width: 100%;
  164. height: 100%;
  165. position: relative;
  166. display: flex;
  167. flex-direction: column;
  168. justify-content: center;
  169. align-items: center;
  170. }
  171. .point-bill .bottom .no-img div{
  172. width: 2.29rem;
  173. height:1.87rem;
  174. background: url("../../static/common/wu@2x.png") no-repeat 0 0;
  175. background-size: 100% 100%;
  176. }
  177. .point-bill .bottom .no-img span{
  178. width: 2.29rem;
  179. height: .4rem;
  180. font-size: .28rem;
  181. font-weight: 500;
  182. color: #AAAAAA;
  183. line-height: .4rem;
  184. text-align: center;
  185. }
  186. .point-bill .bottom .item {
  187. width: 100%;
  188. height: 1.56rem;
  189. padding: 0.3rem 0;
  190. border-bottom: 0.01rem solid #e0e0e0;
  191. box-sizing: border-box;
  192. }
  193. .point-bill .bottom .item:nth-last-child(1){
  194. border-bottom:none;
  195. }
  196. .point-bill .bottom .item .content {
  197. font-family: PingFangSC-Regular, PingFang SC;
  198. display: flex;
  199. justify-content: space-between;
  200. }
  201. .point-bill .bottom .item .content .text {
  202. display: inline-block;
  203. height: 0.45rem;
  204. font-size: 0.32rem;
  205. font-weight: 400;
  206. color: #111111;
  207. line-height: 0.45rem;
  208. }
  209. .point-bill .bottom .item .content .amount {
  210. display: inline-block;
  211. height: 0.45rem;
  212. font-size: 0.32rem;
  213. font-weight: 500;
  214. color: #111111;
  215. line-height: 0.45rem;
  216. }
  217. .point-bill .bottom .item .content .add {
  218. color: #f3b235;
  219. }
  220. .point-bill .bottom .item .time {
  221. height: 0.4rem;
  222. font-size: 0.28rem;
  223. font-family: PingFangSC-Regular, PingFang SC;
  224. font-weight: 400;
  225. color: #aaaaaa;
  226. line-height: 0.4rem;
  227. }
  228. </style>