index.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <div class="point-index">
  3. <div class="bg">
  4. <div class="top">
  5. <nuxt-link class="text" to="/point/list" tag="h4">我的积分</nuxt-link>
  6. <h2 class="point">{{this.pointInfo.points}}</h2>
  7. <div class="earn">
  8. <div>赚积分</div>
  9. </div>
  10. </div>
  11. </div>
  12. <div class="container">
  13. <div class="menu">
  14. <nuxt-link class="item item1" to="/point/shop" tag="div">
  15. <img src="../../static/point/shangcheng.png" alt="" />
  16. <span>积分商城</span>
  17. </nuxt-link>
  18. <nuxt-link class="item item2" to="/point/bill" tag="div">
  19. <img src="../../static/point/mingxi.png" alt="" />
  20. <span>积分明细</span>
  21. </nuxt-link>
  22. <nuxt-link class="item item3" to="/point/list" tag="div">
  23. <img src="../../static/point/dingdan.png" alt="" />
  24. <span>积分订单</span>
  25. </nuxt-link>
  26. </div>
  27. <nuxt-link class="news" to="/point/shop" tag="div">
  28. <span class="title">积分商城上线啦!</span>
  29. <span class="des">多重好礼等着你</span>
  30. </nuxt-link>
  31. <div class="show">
  32. <product-list />
  33. </div>
  34. </div>
  35. </div>
  36. </template>
  37. <script>
  38. import ProductList from "../../components/ProductList";
  39. import { mapState, mapActions } from "vuex"
  40. export default {
  41. head() {
  42. return {
  43. title: "积分主页",
  44. };
  45. },
  46. data() {
  47. return {
  48. images: [],
  49. list: [],
  50. loading: false, //加载状态
  51. finished: false, //是否完成加载
  52. refreshing: false, //是否正在上拉刷新
  53. };
  54. },
  55. components: {
  56. ProductList,
  57. },
  58. computed:{
  59. ...mapState({
  60. pointInfo:state=>state.point.pointInfo
  61. })
  62. },
  63. mounted() {
  64. this.getPointInfo();
  65. },
  66. methods: {
  67. ...mapActions({
  68. getPointInfo:"point/getPointInfo"
  69. })
  70. },
  71. };
  72. </script>
  73. <style>
  74. .point-index {
  75. position: relative;
  76. }
  77. .point-index .bg {
  78. background-color: #f3b335;
  79. width: 7.5rem;
  80. height: 3.72rem;
  81. position: relative;
  82. background: url("../../static/point/bj.png") no-repeat 0px 0px;
  83. background-size: 100% 100%;
  84. z-index: -1;
  85. }
  86. .point-index .bg .top .text {
  87. position: absolute;
  88. left: 4vw;
  89. top: 8vw;
  90. margin: 0;
  91. padding: 0;
  92. height: 0.4rem;
  93. font-size: 0.28rem;
  94. font-family: PingFangSC-Regular, PingFang SC;
  95. font-weight: 400;
  96. color: #ffffff;
  97. line-height: 0.4rem;
  98. }
  99. .point-index .bg .top .point {
  100. position: absolute;
  101. margin: 0;
  102. padding: 0;
  103. left: 4vw;
  104. top: 15.33vw;
  105. width: 36vw;
  106. height: 16.8vw;
  107. font-size: 12vw;
  108. font-family: PingFangSC-Regular, PingFang SC;
  109. font-weight: 400;
  110. color: #ffffff;
  111. line-height: 14vw;
  112. }
  113. .point-index .bg .earn {
  114. position: absolute;
  115. right: 0;
  116. top: 20.66vw;
  117. width: 1.6rem;
  118. height: 0.55rem;
  119. font-size: 3.46vw;
  120. font-family: PingFangSC-Regular, PingFang SC;
  121. font-weight: 400;
  122. background: url("../../static/point/jifen.png") no-repeat;
  123. background-size: cover;
  124. box-sizing: border-box;
  125. }
  126. .point-index .bg .earn div {
  127. position: absolute;
  128. top: 1.5vw;
  129. right: 2vw;
  130. height: 4.93vw;
  131. font-size: 3.46vw;
  132. font-family: PingFangSC-Regular, PingFang SC;
  133. font-weight: 400;
  134. color: #f3b235;
  135. line-height: 4.93vw;
  136. }
  137. .point-index .container {
  138. margin-top: -13.33vw;
  139. width: 100%;
  140. padding: 0 4vw;
  141. box-sizing: border-box;
  142. display: flex;
  143. flex-direction: column;
  144. z-index: 99;
  145. }
  146. .point-index .container .menu {
  147. width: 100%;
  148. height: 26.66vw;
  149. background: #ffffff;
  150. box-shadow: 0px 2px 10px 5px rgba(227, 227, 227, 0.5);
  151. border-radius: 20px;
  152. display: flex;
  153. flex-direction: row;
  154. justify-content: space-around;
  155. align-items: center;
  156. }
  157. .point-index .container .menu .item {
  158. width: 14.93vw;
  159. height: 14.93vw;
  160. }
  161. .point-index .container .menu .item img {
  162. display: block;
  163. width: 12vw;
  164. height: 12vw;
  165. margin: 0 auto;
  166. }
  167. .point-index .container .menu .item span {
  168. display: inline-block;
  169. font-family: PingFangSC-Regular, PingFang SC;
  170. font-weight: 400;
  171. color: #666666;
  172. text-align: center;
  173. margin-top: 3vw;
  174. width: 1.3rem;
  175. height: 0.4rem;
  176. font-size: 0.28rem;
  177. font-family: PingFangSC-Regular, PingFang SC;
  178. font-weight: 400;
  179. color: #666666;
  180. line-height: 0.4rem;
  181. }
  182. .point-index .container .news {
  183. margin-top: 4vw;
  184. width: 100%;
  185. height: 21.33vw;
  186. background: url("../../static/point/banner.png") no-repeat;
  187. background-size: 100% 100%;
  188. position: relative;
  189. }
  190. .point-index .container .news img {
  191. width: 100%;
  192. height: 100%;
  193. }
  194. .point-index .container .news .title{
  195. font-size:.4rem;
  196. color:#f9f9e5;
  197. font-weight:700;
  198. position: absolute;
  199. left:.75rem;
  200. top:.38rem;
  201. }
  202. .point-index .container .news .des{
  203. font-size:.24rem;
  204. color:#f9d996;
  205. font-weight:600;
  206. position: absolute;
  207. left:2.2rem;
  208. top:.9rem;
  209. }
  210. </style>