list.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  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. </section>
  67. </template>
  68. <script>
  69. if (process.browser) {
  70. var {WOW} = require('wowjs')
  71. }
  72. const ListData = Object.freeze([
  73. {
  74. id: 0,
  75. label: '全部'
  76. },
  77. {
  78. id: 1,
  79. label: '幼儿网络版'
  80. },
  81. {
  82. id: 2,
  83. label: '数学起跑线'
  84. },
  85. {
  86. id: 3,
  87. label: '小学基础班'
  88. },
  89. {
  90. id: 4,
  91. label: '小学提升版'
  92. },
  93. {
  94. id: 5,
  95. label: '幼小衔接'
  96. }
  97. ])
  98. const goodsData = Object.freeze([
  99. {
  100. flagImg: require('~/assets/images/index/product_tag.png'),
  101. goodsImg: require('~/assets/images/index/product.png'),
  102. label: '逻辑狗得儿童绘画成本很低得故事',
  103. text: '逻辑狗得儿童绘画成本很低得故事得介绍解释觉得我空气jade哦亲',
  104. pirceNew: 89,
  105. priceOld: 109.00,
  106. sales: 88
  107. }
  108. ])
  109. let arr = []
  110. for(let i = 0; i < 20; i ++) {
  111. arr.push(...goodsData)
  112. }
  113. export default {
  114. name: 'ListPage',
  115. computed: {
  116. lineStyle () {
  117. let site = 190 * this.currentTabId + 40* ( (this.currentTabId === 0 ? 1 : this.currentTabId) - 1 )
  118. if( site === 0 ) {
  119. site = -5
  120. }
  121. return `transform: translateX(${site + 'px'})`
  122. }
  123. },
  124. head() {
  125. return {
  126. title: "逻辑狗官网-中德智慧教育",
  127. meta: [
  128. {
  129. name: "keywords",
  130. hid: "keywords",
  131. content: `逻辑狗官网、逻辑狗教材、 幼儿园教材、逻辑狗课程、逻辑狗思维训练课程、儿童思维教育、0-12岁儿童`,
  132. },
  133. {
  134. name: "description",
  135. hid: "description",
  136. content: `逻辑狗官方网站,专为0-12岁儿童设计的思维训练课程,中德智慧教育,全球优质教育内容输出平台`,
  137. },
  138. ],
  139. };
  140. },
  141. data () {
  142. return {
  143. ListData,
  144. currentTabId: 0,
  145. goodsData: arr
  146. }
  147. },
  148. mounted () {
  149. if (process.browser) {
  150. new WOW({
  151. offset: 0,
  152. live: true
  153. }).init()
  154. }
  155. },
  156. methods: {
  157. handleTag(tab) {
  158. this.currentTabId = tab.id
  159. }
  160. }
  161. }
  162. </script>
  163. <style scoped lang="scss">
  164. .List-container {
  165. background-color: #F0F2F5;
  166. }
  167. .banner-img {
  168. width: 100%;
  169. height: 878px;
  170. margin-bottom: 193px;
  171. }
  172. .content {
  173. padding-bottom: 300px;
  174. margin: 0 auto;
  175. width: 1214px;
  176. .tabs {
  177. .tab-box {
  178. width: 1214px;
  179. display: flex;
  180. justify-content: space-between;
  181. margin: 0 auto;
  182. .tabs-item {
  183. color: #747885;
  184. font-size: 32px;
  185. font-family:PingFangSC-Regular,PingFang SC;
  186. font-weight:400;
  187. }
  188. }
  189. .bottom-line {
  190. display: flex;
  191. justify-content: center;
  192. .bottom-line-img {
  193. width: 1214px;
  194. img {
  195. width: 75px;
  196. height: 30px;
  197. transition: transform 1s;
  198. }
  199. }
  200. }
  201. }
  202. .screen {
  203. margin-top: 121px;
  204. display: flex;
  205. justify-content: space-between;
  206. align-items: center;
  207. color: #7F7F7F;
  208. font-size: 18px;
  209. .left {
  210. display: flex;
  211. align-items: center;
  212. .screen-label {
  213. margin-right: 30px;
  214. }
  215. .screen-item {
  216. color: #ccc;
  217. padding: 6px 18px;
  218. border: 1px solid #cccccc;
  219. font-size: 16px;
  220. margin-right: 36px;
  221. }
  222. }
  223. .right {
  224. width: 141px;
  225. display: flex;
  226. justify-content: space-between;
  227. align-items: center;
  228. img {
  229. width: 42px;
  230. height: 42px;
  231. }
  232. .enter-labe {
  233. color: #2F2F2F;
  234. font-size: 25px;
  235. font-family:PingFangSC-Medium,PingFang SC;
  236. font-weight:500;
  237. }
  238. .enter-labe :hover {
  239. color: red;
  240. }
  241. }
  242. }
  243. .goods {
  244. margin-top: 81px;
  245. display: grid;
  246. grid-template-columns: auto auto auto;
  247. grid-template-rows: auto auto auto;
  248. .goods-item {
  249. width: 372px;
  250. height: 372px;
  251. border-radius: 18px;
  252. position: relative;
  253. margin-top: 39px;
  254. .top {
  255. overflow: hidden;
  256. .flag-img {
  257. width: 52px;
  258. height: 24px;
  259. position: absolute;
  260. top: 0;
  261. left: 0;
  262. z-index: 1;
  263. }
  264. .goods-img {
  265. width: 372px;
  266. height: 250px;
  267. }
  268. .goods-img:hover {
  269. transform: scale(1.2);
  270. transition: transform 1s;
  271. }
  272. }
  273. .bottom {
  274. display: flex;
  275. justify-content: space-between;
  276. padding: 10px 15px;
  277. background: #FFFFFF;
  278. border-bottom-left-radius: 18px;
  279. border-bottom-right-radius: 18px;
  280. .left {
  281. width: 250px;
  282. font-family:PingFangSC-Regular,PingFang SC;
  283. .label {
  284. color: #343E30;
  285. font-size: 20px;
  286. width: 108px;
  287. }
  288. .text {
  289. color: #898A8C;
  290. font-size: 12px;
  291. width: 100%;
  292. }
  293. .price {
  294. width: 140px;
  295. display: flex;
  296. justify-content: space-between;
  297. align-items: center;
  298. margin-top: 9px;
  299. .price-now {
  300. color: #EA0B4A;
  301. font-size: 34px;
  302. font-family:PingFangSC-Semibold,PingFang SC;
  303. font-weight:600;
  304. }
  305. .price-old {
  306. color: #D4D7D9;
  307. font-size: 22px;
  308. position: relative;
  309. .lineation {
  310. height: 1px;
  311. width: 55px !important;
  312. position: absolute;
  313. top: 50%;
  314. border-top: solid #D4D7D9 1px;
  315. display: block;
  316. }
  317. }
  318. }
  319. }
  320. .right {
  321. display: flex;
  322. align-items: flex-end;
  323. margin-bottom: 10px;
  324. color: #0D5CFA;
  325. font-size: 13px;
  326. font-family:PingFangSC-Semibold,PingFang SC;
  327. font-weight:600;
  328. }
  329. }
  330. }
  331. }
  332. }
  333. .selectTabs {
  334. color: #0D5CFA !important;
  335. // font-size: 42px !important;
  336. font-family:PingFangSC-Semibold,PingFang SC;
  337. font-weight:600
  338. }
  339. .cp {
  340. cursor: pointer;
  341. }
  342. .th {
  343. overflow: hidden;
  344. text-overflow:ellipsis;
  345. white-space: nowrap;
  346. }
  347. .fade {
  348. animation: fadeOutDown;
  349. }
  350. @keyframes fadeOutDown {
  351. from {
  352. opacity: 1;
  353. }
  354. to {
  355. opacity: 0;
  356. -webkit-transform: translate3d(0, 100%, 0);
  357. transform: translate3d(0, 100%, 0);
  358. }
  359. }
  360. </style>