index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <div class="point-index">
  3. <div class="background">
  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. <img src="../../static/test/new.png" alt="" />
  29. </nuxt-link>
  30. <div class="show">
  31. <product-list />
  32. </div>
  33. </div>
  34. </div>
  35. </template>
  36. <script>
  37. import ProductList from "../../components/ProductList";
  38. import { mapState, mapActions } from "vuex"
  39. export default {
  40. head() {
  41. return {
  42. title: "积分主页",
  43. };
  44. },
  45. data() {
  46. return {
  47. images: [],
  48. list: [],
  49. loading: false, //加载状态
  50. finished: false, //是否完成加载
  51. refreshing: false, //是否正在上拉刷新
  52. };
  53. },
  54. components: {
  55. ProductList,
  56. },
  57. computed:{
  58. ...mapState({
  59. pointInfo:state=>state.point.pointInfo
  60. })
  61. },
  62. mounted() {
  63. this.getPointInfo();
  64. },
  65. methods: {
  66. ...mapActions({
  67. getPointInfo:"point/getPointInfo"
  68. })
  69. },
  70. };
  71. </script>
  72. <style>
  73. .point-index {
  74. position: relative;
  75. }
  76. .point-index .background {
  77. background-color: #f3b335;
  78. width: 7.5rem;
  79. height: 49.46vw;
  80. position: relative;
  81. background: url("../../static/point/bj.png") no-repeat 0px 0px;
  82. background-size: 100% 100%;
  83. z-index: -1;
  84. }
  85. .point-index .background .top .text {
  86. position: absolute;
  87. left: 4vw;
  88. top: 8vw;
  89. margin: 0;
  90. padding: 0;
  91. height: 0.4rem;
  92. font-size: 0.28rem;
  93. font-family: PingFangSC-Regular, PingFang SC;
  94. font-weight: 400;
  95. color: #ffffff;
  96. line-height: 0.4rem;
  97. }
  98. .point-index .background .top .point {
  99. position: absolute;
  100. margin: 0;
  101. padding: 0;
  102. left: 4vw;
  103. top: 15.33vw;
  104. width: 36vw;
  105. height: 16.8vw;
  106. font-size: 12vw;
  107. font-family: PingFangSC-Regular, PingFang SC;
  108. font-weight: 400;
  109. color: #ffffff;
  110. line-height: 14vw;
  111. }
  112. .point-index .background .earn {
  113. position: absolute;
  114. right: 0;
  115. top: 20.66vw;
  116. width: 1.6rem;
  117. height: 0.55rem;
  118. font-size: 3.46vw;
  119. font-family: PingFangSC-Regular, PingFang SC;
  120. font-weight: 400;
  121. background: url("../../static/point/jifen.png") no-repeat;
  122. background-size: cover;
  123. box-sizing: border-box;
  124. }
  125. .point-index .background .earn div {
  126. position: absolute;
  127. top: 1.5vw;
  128. right: 2vw;
  129. width: 10.4vw;
  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. }
  187. .point-index .container .news img {
  188. width: 100%;
  189. height: 100%;
  190. }
  191. </style>