bill.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <div class="point-bill">
  3. <nuxt-link to="/personal/charge" tag="span">查看订单jjjjj</nuxt-link>
  4. <div class="top">
  5. <span class="icon"></span>
  6. <span class="num">{{pointInfo.points}}</span>
  7. <span class="text">我的积分</span>
  8. </div>
  9. <div class="bottom">
  10. <div v-if="recordList.length === 0" class="no-img">
  11. <div></div>
  12. <span>无订单</span>
  13. </div>
  14. <template v-else>
  15. <div class="item" v-for="item in recordList" :key="item.id">
  16. <div class="content">
  17. <span class="text">{{item.recordType === '+'? '加油': '兑换商品'}}</span>
  18. <span class="amount" :class="item.recordType==='+'?'add':'' ">{{item.recordType + ' ' + item.integral}}</span>
  19. </div>
  20. <div class="time">{{item.createTime}}</div>
  21. </div>
  22. </template>
  23. <!-- <div class="item">
  24. <div class="content">
  25. <span class="text">兑换商品</span>
  26. <span class="amount">- 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 add">+ 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">- 10</span>
  41. </div>
  42. <div class="time">2018/09/20 18:00:00</div>
  43. </div>
  44. <div class="item">
  45. <div class="content">
  46. <span class="text">加油</span>
  47. <span class="amount add">+ 10</span>
  48. </div>
  49. <div class="time">2018/09/20 18:00:00</div>
  50. </div> -->
  51. </div>
  52. </div>
  53. </template>
  54. <script>
  55. import ProductList from "../../components/ProductList";
  56. import moment from "moment"
  57. import { mapState, mapActions } from "vuex"
  58. export default {
  59. head() {
  60. return {
  61. title: "积分明细",
  62. };
  63. },
  64. data() {
  65. return {
  66. images: [],
  67. list: [],
  68. loading: false, // 加载状态
  69. finished: false, // 是否完成加载
  70. refreshing: false, // 是否正在上拉刷新
  71. img: "/test/1_a01_class_2@2x.png",
  72. recordList:[]
  73. };
  74. },
  75. components: {
  76. ProductList,
  77. },
  78. computed:{
  79. ...mapState({
  80. pointInfo:state=>state.point.pointInfo
  81. })
  82. },
  83. mounted() {
  84. this.getPointsRecordList();
  85. },
  86. beforeUpdate() {},
  87. updated() {},
  88. beforeDestroy() {},
  89. destroyed() {},
  90. methods: {
  91. getPointsRecordList(){
  92. this.$axios.$get("/getCustomerPointsRecordList",{
  93. params:{
  94. unionId:this.unionId,
  95. stationId:this.stationId
  96. }
  97. }).then((res)=>{
  98. this.recordList = res.data.map((ele)=>{
  99. ele.createTime = moment(ele.createTime,'MMM DD, YYYY HH:mm:ss A').utc().format("YYYY/MM/DD HH:mm:ss")
  100. return ele
  101. })
  102. })
  103. }
  104. },
  105. };
  106. </script>
  107. <style>
  108. .point-bill {
  109. width: 100%;
  110. }
  111. .point-bill .top {
  112. width: 100%;
  113. height: 3.98rem;
  114. background: url("../../static/point/bj@2x.png") no-repeat 0 0;
  115. background-size: 100% 100%;
  116. position: relative;
  117. z-index: -1;
  118. }
  119. .point-bill .top .icon {
  120. background: url("../../static/point/chengzhnagzhi@2x.png") no-repeat 0 0;
  121. background-size: 100% 100%;
  122. width: 0.35rem;
  123. height: 0.35rem;
  124. position: absolute;
  125. right: 0.3rem;
  126. top: 0.3rem;
  127. }
  128. .point-bill .top .num {
  129. width: 2.12rem;
  130. height: 0.98rem;
  131. font-size: 0.7rem;
  132. font-family: PingFangSC-Regular, PingFang SC;
  133. font-weight: 400;
  134. color: #ffffff;
  135. line-height: 0.98rem;
  136. text-align: center;
  137. position: absolute;
  138. left: calc(50% - 1.06rem);
  139. top: 0.6rem;
  140. }
  141. .point-bill .top .text {
  142. width: 1.12rem;
  143. height: 0.4rem;
  144. font-size: 0.28rem;
  145. font-family: PingFangSC-Regular, PingFang SC;
  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>