list.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  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').default,
  102. goodsImg: require('../../assets/images/index/tab-right-pic-nanjing.png').default,
  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. // boxClass: 'wow',
  136. // animateClass: 'animated',
  137. offset: 0,
  138. // mobile: true,
  139. live: true
  140. }).init()
  141. }
  142. },
  143. methods: {
  144. handleTag(tab) {
  145. this.currentTabId = tab.id
  146. }
  147. }
  148. }
  149. </script>
  150. <style scoped lang="scss">
  151. .List-container {
  152. background-color: #F0F2F5;
  153. }
  154. .banner-img {
  155. width: 100%;
  156. height: 878px;
  157. margin-bottom: 193px;
  158. }
  159. .content {
  160. padding-bottom: 300px;
  161. margin: 0 auto;
  162. width: 1214px;
  163. .tabs {
  164. .tab-box {
  165. width: 1214px;
  166. display: flex;
  167. justify-content: space-between;
  168. margin: 0 auto;
  169. .tabs-item {
  170. color: #747885;
  171. font-size: 32px;
  172. font-family:PingFangSC-Regular,PingFang SC;
  173. font-weight:400;
  174. }
  175. }
  176. .bottom-line {
  177. display: flex;
  178. justify-content: center;
  179. .bottom-line-img {
  180. width: 1214px;
  181. img {
  182. width: 75px;
  183. height: 30px;
  184. transition: transform 1s;
  185. }
  186. }
  187. }
  188. }
  189. .screen {
  190. margin-top: 121px;
  191. display: flex;
  192. justify-content: space-between;
  193. align-items: center;
  194. color: #7F7F7F;
  195. font-size: 18px;
  196. .left {
  197. display: flex;
  198. align-items: center;
  199. .screen-label {
  200. margin-right: 30px;
  201. }
  202. .screen-item {
  203. color: #ccc;
  204. padding: 6px 18px;
  205. border: 1px solid #cccccc;
  206. font-size: 16px;
  207. margin-right: 36px;
  208. }
  209. }
  210. .right {
  211. width: 141px;
  212. display: flex;
  213. justify-content: space-between;
  214. align-items: center;
  215. img {
  216. width: 42px;
  217. height: 42px;
  218. }
  219. .enter-labe {
  220. color: #2F2F2F;
  221. font-size: 25px;
  222. font-family:PingFangSC-Medium,PingFang SC;
  223. font-weight:500;
  224. }
  225. .enter-labe :hover {
  226. color: red;
  227. }
  228. }
  229. }
  230. .goods {
  231. margin-top: 81px;
  232. display: grid;
  233. grid-template-columns: auto auto auto;
  234. grid-template-rows: auto auto auto;
  235. .goods-item {
  236. width: 372px;
  237. height: 372px;
  238. border-radius: 18px;
  239. position: relative;
  240. margin-top: 39px;
  241. .top {
  242. overflow: hidden;
  243. .flag-img {
  244. width: 52px;
  245. height: 24px;
  246. position: absolute;
  247. top: 0;
  248. left: 0;
  249. z-index: 1;
  250. }
  251. .goods-img {
  252. width: 372px;
  253. height: 250px;
  254. }
  255. .goods-img:hover {
  256. transform: scale(1.2);
  257. transition: transform 1s;
  258. }
  259. }
  260. .bottom {
  261. display: flex;
  262. justify-content: space-between;
  263. padding: 10px 15px;
  264. background: #FFFFFF;
  265. border-bottom-left-radius: 18px;
  266. border-bottom-right-radius: 18px;
  267. .left {
  268. width: 250px;
  269. font-family:PingFangSC-Regular,PingFang SC;
  270. .label {
  271. color: #343E30;
  272. font-size: 20px;
  273. width: 108px;
  274. }
  275. .text {
  276. color: #898A8C;
  277. font-size: 12px;
  278. width: 100%;
  279. }
  280. .price {
  281. width: 140px;
  282. display: flex;
  283. justify-content: space-between;
  284. align-items: center;
  285. margin-top: 9px;
  286. .price-now {
  287. color: #EA0B4A;
  288. font-size: 34px;
  289. font-family:PingFangSC-Semibold,PingFang SC;
  290. font-weight:600;
  291. }
  292. .price-old {
  293. color: #D4D7D9;
  294. font-size: 22px;
  295. position: relative;
  296. .lineation {
  297. height: 1px;
  298. width: 55px !important;
  299. position: absolute;
  300. top: 50%;
  301. border-top: solid #D4D7D9 1px;
  302. display: block;
  303. }
  304. }
  305. }
  306. }
  307. .right {
  308. display: flex;
  309. align-items: flex-end;
  310. margin-bottom: 10px;
  311. color: #0D5CFA;
  312. font-size: 13px;
  313. font-family:PingFangSC-Semibold,PingFang SC;
  314. font-weight:600;
  315. }
  316. }
  317. }
  318. }
  319. }
  320. .selectTabs {
  321. color: #0D5CFA !important;
  322. // font-size: 42px !important;
  323. font-family:PingFangSC-Semibold,PingFang SC;
  324. font-weight:600
  325. }
  326. .cp {
  327. cursor: pointer;
  328. }
  329. .th {
  330. overflow: hidden;
  331. text-overflow:ellipsis;
  332. white-space: nowrap;
  333. }
  334. .fade {
  335. animation: fadeOutDown;
  336. }
  337. @keyframes fadeOutDown {
  338. from {
  339. opacity: 1;
  340. }
  341. to {
  342. opacity: 0;
  343. -webkit-transform: translate3d(0, 100%, 0);
  344. transform: translate3d(0, 100%, 0);
  345. }
  346. }
  347. </style>