_id.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <div class="point-detail">
  3. <div class="good">
  4. <img :src="ware.waresPic" alt="" srcset="" />
  5. </div>
  6. <div class="title">
  7. <div class="text">{{ ware.waresName }}</div>
  8. <div class="price">
  9. <span class="icon"></span>
  10. <span class="amount">{{ ware.saleIntegral }}</span>
  11. </div>
  12. <div class="sold">已兑换 {{ ware.waresOutCount }}</div>
  13. </div>
  14. <!-- <div class="selected">
  15. <div class="text">已选</div>
  16. <div class="content">儿童情商课+智慧课堂,1</div>
  17. <div class="icon"></div>
  18. </div> -->
  19. <!-- <div class="pictures">
  20. <div class="text">- 图文详情 -</div>
  21. </div> -->
  22. <div class="buy">
  23. <nuxt-link :to="'/point/pay/' + this.id" tag="button">立刻兑换</nuxt-link>
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. import { mapActions, mapGetters } from 'vuex'
  29. export default {
  30. validate({ params }) {
  31. // 必须是number类型
  32. return /^\d{1,}$/.test(params.id);
  33. },
  34. head() {
  35. return {
  36. title: "积分商品详情页",
  37. };
  38. },
  39. data() {
  40. return {
  41. ware:{},
  42. id:this.$route.params.id
  43. };
  44. },
  45. mounted() {
  46. this.getPointInfo();
  47. this.init();
  48. },
  49. computed: {
  50. ...mapGetters({
  51. findWare: "point/findWare",
  52. }),
  53. },
  54. methods: {
  55. ...mapActions({
  56. getPointInfo:"point/getPointInfo"
  57. }),
  58. init(){
  59. this.ware = this.findWare(this.id)
  60. }
  61. },
  62. };
  63. </script>
  64. <style>
  65. .point-detail {
  66. display: flex;
  67. width: 100vw;
  68. flex-direction: column;
  69. box-sizing: border-box;
  70. background: #f8f8f8;
  71. }
  72. .point-detail .good {
  73. box-sizing: border-box;
  74. width: 100vw;
  75. height: 100vw;
  76. padding: 15vw;
  77. background: #ffffff;
  78. }
  79. .point-detail .good img {
  80. width: 100%;
  81. height: 100%;
  82. }
  83. .point-detail .title {
  84. width: 100%;
  85. height: 26.66vw;
  86. padding: 4vw;
  87. background: #ffffff;
  88. position: relative;
  89. box-sizing: border-box;
  90. }
  91. .point-detail .title .text {
  92. width: 3.6rem;
  93. height: 0.5rem;
  94. font-size: 0.36rem;
  95. font-family: PingFangSC-Medium, PingFang SC;
  96. font-weight: 800;
  97. color: #111111;
  98. line-height: 0.5rem;
  99. position: absolute;
  100. left: 0.3rem;
  101. top: 0.3rem;
  102. }
  103. .point-detail .title .price {
  104. height: 0.7rem;
  105. font-size: 0.28rem;
  106. font-family: PingFangSC-Semibold, PingFang SC;
  107. font-weight: 600;
  108. color: #fe9700;
  109. line-height: 0.7rem;
  110. position: absolute;
  111. left: 0.57rem;
  112. bottom: 0.27rem;
  113. }
  114. .point-detail .title .price .icon {
  115. display: inline-block;
  116. width: 0.3rem;
  117. height: 0.3rem;
  118. background: url("../../../static/common/a01_jifen@2x.png") no-repeat;
  119. background-size: cover;
  120. margin-right: 0.1rem;
  121. }
  122. .point-detail .title .price .amount {
  123. display: inline-block;
  124. font-size: 0.5rem;
  125. }
  126. .point-detail .title .sold {
  127. height: 0.4rem;
  128. font-size: 0.28rem;
  129. font-family: PingFangSC-Regular, PingFang SC;
  130. font-weight: 400;
  131. color: #666666;
  132. line-height: 0.4rem;
  133. position: absolute;
  134. right: 0.45rem;
  135. bottom: 0.3rem;
  136. }
  137. .point-detail .selected {
  138. width: 100%;
  139. height: 1.1rem;
  140. background: #ffffff;
  141. margin-top: 0.2rem;
  142. position: relative;
  143. }
  144. .point-detail .selected .text {
  145. width: 0.56rem;
  146. height: 1.1rem;
  147. font-size: 0.28rem;
  148. font-family: PingFangSC-Regular, PingFang SC;
  149. font-weight: 400;
  150. color: #aaaaaa;
  151. line-height: 1.1rem;
  152. position: absolute;
  153. left: 0.31rem;
  154. top: 0rem;
  155. }
  156. .point-detail .selected .content {
  157. width: 3.09rem;
  158. height: 1.1rem;
  159. font-size: 0.28rem;
  160. font-family: PingFangSC-Regular, PingFang SC;
  161. font-weight: 500;
  162. color: #111111;
  163. line-height: 1.1rem;
  164. position: absolute;
  165. left: 1.17rem;
  166. }
  167. .point-detail .selected .icon {
  168. width: 0.42rem;
  169. height: 0.1rem;
  170. background: url("../../../static/point/6_d02_more.png") no-repeat 0px 0px;
  171. background-size: cover;
  172. position: absolute;
  173. left: 6.3rem;
  174. top: 0.49rem;
  175. }
  176. .point-detail .pictures {
  177. width: 100%;
  178. height: 3.2rem;
  179. background: #ffffff;
  180. margin-top: 0.21rem;
  181. position: relative;
  182. }
  183. .point-detail .pictures .text {
  184. width: 1.74rem;
  185. height: 1.1rem;
  186. font-size: 0.28rem;
  187. font-family: PingFangSC-Regular, PingFang SC;
  188. font-weight: 400;
  189. color: #aaaaaa;
  190. line-height: 1.1rem;
  191. position: absolute;
  192. top: 0rem;
  193. left: 2.88rem;
  194. }
  195. .point-detail .buy {
  196. position: fixed;
  197. bottom: 0.83rem;
  198. left: 0;
  199. right: 0;
  200. height: 1.03rem;
  201. }
  202. .point-detail .buy button {
  203. border: none;
  204. background-color: transparent;
  205. outline: none;
  206. display: block;
  207. width: 6.9rem;
  208. height: 0.8rem;
  209. background: #fe9700;
  210. border-radius: 0.45rem;
  211. font-size: 0.28rem;
  212. font-family: PingFangSC-Regular, PingFang SC;
  213. font-weight: 400;
  214. color: #ffffff;
  215. line-height: 0.4rem;
  216. margin: 0 auto;
  217. }
  218. </style>