index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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. beforeCreate() {},
  63. created() {},
  64. beforeMount() {},
  65. mounted() {
  66. this.getPointInfo();
  67. },
  68. beforeUpdate() {},
  69. updated() {},
  70. beforeDestroy() {},
  71. destroyed() {},
  72. methods: {
  73. ...mapActions({
  74. getPointInfo:"point/getPointInfo"
  75. })
  76. },
  77. };
  78. </script>
  79. <style>
  80. .point-index {
  81. position: relative;
  82. }
  83. .point-index .background {
  84. background-color: #f3b335;
  85. width: 7.5rem;
  86. height: 49.46vw;
  87. position: relative;
  88. background: url("../../static/point/bj.png") no-repeat 0px 0px;
  89. background-size: 100% 100%;
  90. z-index: -1;
  91. }
  92. .point-index .background .top .text {
  93. position: absolute;
  94. left: 4vw;
  95. top: 8vw;
  96. margin: 0;
  97. padding: 0;
  98. height: 0.4rem;
  99. font-size: 0.28rem;
  100. font-family: PingFangSC-Regular, PingFang SC;
  101. font-weight: 400;
  102. color: #ffffff;
  103. line-height: 0.4rem;
  104. }
  105. .point-index .background .top .point {
  106. position: absolute;
  107. margin: 0;
  108. padding: 0;
  109. left: 4vw;
  110. top: 15.33vw;
  111. width: 36vw;
  112. height: 16.8vw;
  113. font-size: 12vw;
  114. font-family: PingFangSC-Regular, PingFang SC;
  115. font-weight: 400;
  116. color: #ffffff;
  117. line-height: 14vw;
  118. }
  119. .point-index .background .earn {
  120. position: absolute;
  121. right: 0;
  122. top: 20.66vw;
  123. width: 1.6rem;
  124. height: 0.55rem;
  125. font-size: 3.46vw;
  126. font-family: PingFangSC-Regular, PingFang SC;
  127. font-weight: 400;
  128. background: url("../../static/point/jifen.png") no-repeat;
  129. background-size: cover;
  130. box-sizing: border-box;
  131. }
  132. .point-index .background .earn div {
  133. position: absolute;
  134. top: 1.5vw;
  135. right: 2vw;
  136. width: 10.4vw;
  137. height: 4.93vw;
  138. font-size: 3.46vw;
  139. font-family: PingFangSC-Regular, PingFang SC;
  140. font-weight: 400;
  141. color: #f3b235;
  142. line-height: 4.93vw;
  143. }
  144. .point-index .container {
  145. margin-top: -13.33vw;
  146. width: 100%;
  147. padding: 0 4vw;
  148. box-sizing: border-box;
  149. display: flex;
  150. flex-direction: column;
  151. z-index: 99;
  152. }
  153. .point-index .container .menu {
  154. width: 100%;
  155. height: 26.66vw;
  156. background: #ffffff;
  157. box-shadow: 0px 2px 10px 5px rgba(227, 227, 227, 0.5);
  158. border-radius: 20px;
  159. display: flex;
  160. flex-direction: row;
  161. justify-content: space-around;
  162. align-items: center;
  163. }
  164. .point-index .container .menu .item {
  165. width: 14.93vw;
  166. height: 14.93vw;
  167. }
  168. .point-index .container .menu .item img {
  169. display: block;
  170. width: 12vw;
  171. height: 12vw;
  172. margin: 0 auto;
  173. }
  174. .point-index .container .menu .item span {
  175. display: inline-block;
  176. font-family: PingFangSC-Regular, PingFang SC;
  177. font-weight: 400;
  178. color: #666666;
  179. text-align: center;
  180. margin-top: 3vw;
  181. width: 1.3rem;
  182. height: 0.4rem;
  183. font-size: 0.28rem;
  184. font-family: PingFangSC-Regular, PingFang SC;
  185. font-weight: 400;
  186. color: #666666;
  187. line-height: 0.4rem;
  188. }
  189. .point-index .container .news {
  190. margin-top: 4vw;
  191. width: 100%;
  192. height: 21.33vw;
  193. }
  194. .point-index .container .news img {
  195. width: 100%;
  196. height: 100%;
  197. }
  198. </style>