list.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. <template>
  2. <section class="List-container">
  3. <img class="banner-img" src="http://res.training.luojigou.vip/FphsjI9yxTarY2GnAEiKY3ZKEPxc?imageView2/0/q/50|imageslim" alt="" srcset="">
  4. <div class="content">
  5. <div class="tabs">
  6. <div class="tab-box">
  7. <div :class="['tabs-item', 'cp', currentTabId === tab.id ? 'selectTabs': '']" @click="handleTag(tab)" v-for="tab in ListData" :key="tab.id">
  8. {{tab.label}}
  9. </div>
  10. </div>
  11. <div class="bottom-line">
  12. <div class="bottom-line-img">
  13. <img :style="lineStyle" src="http://res.training.luojigou.vip/Fl4dXmckxC8m0Lm2-GPbl5-Cp9Rv?imageView2/0/q/50|imageslim" alt="">
  14. </div>
  15. </div>
  16. </div>
  17. <div class="screen">
  18. <div class="left">
  19. <div class="screen-label">排序:</div>
  20. <div class="cp screen-item">默认</div>
  21. <div class="cp screen-item">价格</div>
  22. <div class="cp screen-item">销量</div>
  23. <div class="cp screen-item">最新上架</div>
  24. </div>
  25. <div class="right">
  26. <img src="http://res.training.luojigou.vip/Fmzni1iBgNG7OKMenDAm1JPkntZY?imageView2/0/q/50|imageslim" alt="">
  27. <a href="https://luojigou.tmall.com/view_shop.htm?spm=a220m.1000858.0.0.7ab635e3dkMJPU&shop_id=116502316&rn=73bef63c0bdf2ed0304c3fded46b96a7" target="_blank" class="enter-label cp">进入商城</a>
  28. </div>
  29. </div>
  30. <div class="goods">
  31. <!-- (index + 1) % 3 === 0 ? 'animate__fadeIn' : '',
  32. index % 3 === 0 ? 'animate__fadeIn' : '' -->
  33. <div :class="['goods-item', 'wow', 'animate__animated',
  34. 'animate__lightSpeedInLeft'
  35. ]"
  36. v-for="(item, index) in goodsData" :key="index">
  37. <div class="top">
  38. <img class="flag-img" :src="item.flagImg" alt="">
  39. <img class="goods-img" :src="item.goodsImg" alt="" />
  40. </div>
  41. <div class="bottom">
  42. <div class="left">
  43. <div class="label th">
  44. {{item.label}}
  45. </div>
  46. <div class="text th">
  47. {{item.text}}
  48. </div>
  49. <div class="price">
  50. <div class="price-now">
  51. <span style="fontSize: 20px">¥</span> {{ item.pirceNew}}
  52. </div>
  53. <div class="price-old">
  54. <span> <span style="fontSize: 18px"> ¥</span>{{item.priceOld}}</span>
  55. <span class="lineation"></span>
  56. </div>
  57. </div>
  58. </div>
  59. <div class="right ">
  60. 销量{{item.sales}}笔
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. <h1 class="">ceshi1</h1>
  67. </section>
  68. </template>
  69. <script>
  70. if (process.browser) {
  71. var {WOW} = require('wowjs')
  72. }
  73. const ListData = Object.freeze([
  74. {
  75. id: 0,
  76. label: '全部'
  77. },
  78. {
  79. id: 1,
  80. label: '幼儿网络版'
  81. },
  82. {
  83. id: 2,
  84. label: '数学起跑线'
  85. },
  86. {
  87. id: 3,
  88. label: '小学基础班'
  89. },
  90. {
  91. id: 4,
  92. label: '小学提升版'
  93. },
  94. {
  95. id: 5,
  96. label: '幼小衔接'
  97. }
  98. ])
  99. const goodsData = Object.freeze([
  100. {
  101. flagImg: require('~/assets/images/index/product_tag.png'),
  102. goodsImg: require('~/assets/images/index/product.png'),
  103. label: '逻辑狗得儿童绘画成本很低得故事',
  104. text: '逻辑狗得儿童绘画成本很低得故事得介绍解释觉得我空气jade哦亲',
  105. pirceNew: 89,
  106. priceOld: 109.00,
  107. sales: 88
  108. }
  109. ])
  110. let arr = []
  111. for(let i = 0; i < 20; i ++) {
  112. arr.push(...goodsData)
  113. }
  114. export default {
  115. name: 'ListPage',
  116. computed: {
  117. lineStyle () {
  118. let site = 190 * this.currentTabId + 40* ( (this.currentTabId === 0 ? 1 : this.currentTabId) - 1 )
  119. if( site === 0 ) {
  120. site = -5
  121. }
  122. return `transform: translateX(${site + 'px'})`
  123. }
  124. },
  125. data () {
  126. return {
  127. ListData,
  128. currentTabId: 0,
  129. goodsData: arr
  130. }
  131. },
  132. mounted () {
  133. if (process.browser) {
  134. new WOW({
  135. offset: 0,
  136. live: true
  137. }).init()
  138. }
  139. },
  140. methods: {
  141. handleTag(tab) {
  142. this.currentTabId = tab.id
  143. }
  144. }
  145. }
  146. </script>
  147. <style scoped lang="scss">
  148. .List-container {
  149. background-color: #F0F2F5;
  150. }
  151. .banner-img {
  152. width: 100%;
  153. height: 878px;
  154. margin-bottom: 193px;
  155. }
  156. .content {
  157. padding-bottom: 300px;
  158. margin: 0 auto;
  159. width: 1214px;
  160. .tabs {
  161. .tab-box {
  162. width: 1214px;
  163. display: flex;
  164. justify-content: space-between;
  165. margin: 0 auto;
  166. .tabs-item {
  167. color: #747885;
  168. font-size: 32px;
  169. font-family:PingFangSC-Regular,PingFang SC;
  170. font-weight:400;
  171. }
  172. }
  173. .bottom-line {
  174. display: flex;
  175. justify-content: center;
  176. .bottom-line-img {
  177. width: 1214px;
  178. img {
  179. width: 75px;
  180. height: 30px;
  181. transition: transform 1s;
  182. }
  183. }
  184. }
  185. }
  186. .screen {
  187. margin-top: 121px;
  188. display: flex;
  189. justify-content: space-between;
  190. align-items: center;
  191. color: #7F7F7F;
  192. font-size: 18px;
  193. .left {
  194. display: flex;
  195. align-items: center;
  196. .screen-label {
  197. margin-right: 30px;
  198. }
  199. .screen-item {
  200. color: #ccc;
  201. padding: 6px 18px;
  202. border: 1px solid #cccccc;
  203. font-size: 16px;
  204. margin-right: 36px;
  205. }
  206. }
  207. .right {
  208. width: 141px;
  209. display: flex;
  210. justify-content: space-between;
  211. align-items: center;
  212. img {
  213. width: 42px;
  214. height: 42px;
  215. }
  216. .enter-labe {
  217. color: #2F2F2F;
  218. font-size: 25px;
  219. font-family:PingFangSC-Medium,PingFang SC;
  220. font-weight:500;
  221. }
  222. .enter-labe :hover {
  223. color: red;
  224. }
  225. }
  226. }
  227. .goods {
  228. margin-top: 81px;
  229. display: grid;
  230. grid-template-columns: auto auto auto;
  231. grid-template-rows: auto auto auto;
  232. .goods-item {
  233. width: 372px;
  234. height: 372px;
  235. border-radius: 18px;
  236. position: relative;
  237. margin-top: 39px;
  238. .top {
  239. overflow: hidden;
  240. .flag-img {
  241. width: 52px;
  242. height: 24px;
  243. position: absolute;
  244. top: 0;
  245. left: 0;
  246. z-index: 1;
  247. }
  248. .goods-img {
  249. width: 372px;
  250. height: 250px;
  251. }
  252. .goods-img:hover {
  253. transform: scale(1.2);
  254. transition: transform 1s;
  255. }
  256. }
  257. .bottom {
  258. display: flex;
  259. justify-content: space-between;
  260. padding: 10px 15px;
  261. background: #FFFFFF;
  262. border-bottom-left-radius: 18px;
  263. border-bottom-right-radius: 18px;
  264. .left {
  265. width: 250px;
  266. font-family:PingFangSC-Regular,PingFang SC;
  267. .label {
  268. color: #343E30;
  269. font-size: 20px;
  270. width: 108px;
  271. }
  272. .text {
  273. color: #898A8C;
  274. font-size: 12px;
  275. width: 100%;
  276. }
  277. .price {
  278. width: 140px;
  279. display: flex;
  280. justify-content: space-between;
  281. align-items: center;
  282. margin-top: 9px;
  283. .price-now {
  284. color: #EA0B4A;
  285. font-size: 34px;
  286. font-family:PingFangSC-Semibold,PingFang SC;
  287. font-weight:600;
  288. }
  289. .price-old {
  290. color: #D4D7D9;
  291. font-size: 22px;
  292. position: relative;
  293. .lineation {
  294. height: 1px;
  295. width: 55px !important;
  296. position: absolute;
  297. top: 50%;
  298. border-top: solid #D4D7D9 1px;
  299. display: block;
  300. }
  301. }
  302. }
  303. }
  304. .right {
  305. display: flex;
  306. align-items: flex-end;
  307. margin-bottom: 10px;
  308. color: #0D5CFA;
  309. font-size: 13px;
  310. font-family:PingFangSC-Semibold,PingFang SC;
  311. font-weight:600;
  312. }
  313. }
  314. }
  315. }
  316. }
  317. .selectTabs {
  318. color: #0D5CFA !important;
  319. // font-size: 42px !important;
  320. font-family:PingFangSC-Semibold,PingFang SC;
  321. font-weight:600
  322. }
  323. .cp {
  324. cursor: pointer;
  325. }
  326. .th {
  327. overflow: hidden;
  328. text-overflow:ellipsis;
  329. white-space: nowrap;
  330. }
  331. .fade {
  332. animation: fadeOutDown;
  333. }
  334. @keyframes fadeOutDown {
  335. from {
  336. opacity: 1;
  337. }
  338. to {
  339. opacity: 0;
  340. -webkit-transform: translate3d(0, 100%, 0);
  341. transform: translate3d(0, 100%, 0);
  342. }
  343. }
  344. </style>