list.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  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. head() {
  126. return {
  127. title: "逻辑狗官网-中德智慧教育",
  128. meta: [
  129. {
  130. name: "keywords",
  131. hid: "keywords",
  132. content: `逻辑狗官网、逻辑狗教材、 幼儿园教材、逻辑狗课程、逻辑狗思维训练课程、儿童思维教育、0-12岁儿童`,
  133. },
  134. {
  135. name: "description",
  136. hid: "description",
  137. content: `逻辑狗官方网站,专为0-12岁儿童设计的思维训练课程,中德智慧教育,全球优质教育内容输出平台`,
  138. },
  139. ],
  140. };
  141. },
  142. data () {
  143. return {
  144. ListData,
  145. currentTabId: 0,
  146. goodsData: arr
  147. }
  148. },
  149. mounted () {
  150. if (process.browser) {
  151. new WOW({
  152. offset: 0,
  153. live: true
  154. }).init()
  155. }
  156. },
  157. methods: {
  158. handleTag(tab) {
  159. this.currentTabId = tab.id
  160. }
  161. }
  162. }
  163. </script>
  164. <style scoped lang="scss">
  165. .List-container {
  166. background-color: #F0F2F5;
  167. }
  168. .banner-img {
  169. width: 100%;
  170. height: 878px;
  171. margin-bottom: 193px;
  172. }
  173. .content {
  174. padding-bottom: 300px;
  175. margin: 0 auto;
  176. width: 1214px;
  177. .tabs {
  178. .tab-box {
  179. width: 1214px;
  180. display: flex;
  181. justify-content: space-between;
  182. margin: 0 auto;
  183. .tabs-item {
  184. color: #747885;
  185. font-size: 32px;
  186. font-family:PingFangSC-Regular,PingFang SC;
  187. font-weight:400;
  188. }
  189. }
  190. .bottom-line {
  191. display: flex;
  192. justify-content: center;
  193. .bottom-line-img {
  194. width: 1214px;
  195. img {
  196. width: 75px;
  197. height: 30px;
  198. transition: transform 1s;
  199. }
  200. }
  201. }
  202. }
  203. .screen {
  204. margin-top: 121px;
  205. display: flex;
  206. justify-content: space-between;
  207. align-items: center;
  208. color: #7F7F7F;
  209. font-size: 18px;
  210. .left {
  211. display: flex;
  212. align-items: center;
  213. .screen-label {
  214. margin-right: 30px;
  215. }
  216. .screen-item {
  217. color: #ccc;
  218. padding: 6px 18px;
  219. border: 1px solid #cccccc;
  220. font-size: 16px;
  221. margin-right: 36px;
  222. }
  223. }
  224. .right {
  225. width: 141px;
  226. display: flex;
  227. justify-content: space-between;
  228. align-items: center;
  229. img {
  230. width: 42px;
  231. height: 42px;
  232. }
  233. .enter-labe {
  234. color: #2F2F2F;
  235. font-size: 25px;
  236. font-family:PingFangSC-Medium,PingFang SC;
  237. font-weight:500;
  238. }
  239. .enter-labe :hover {
  240. color: red;
  241. }
  242. }
  243. }
  244. .goods {
  245. margin-top: 81px;
  246. display: grid;
  247. grid-template-columns: auto auto auto;
  248. grid-template-rows: auto auto auto;
  249. .goods-item {
  250. width: 372px;
  251. height: 372px;
  252. border-radius: 18px;
  253. position: relative;
  254. margin-top: 39px;
  255. .top {
  256. overflow: hidden;
  257. .flag-img {
  258. width: 52px;
  259. height: 24px;
  260. position: absolute;
  261. top: 0;
  262. left: 0;
  263. z-index: 1;
  264. }
  265. .goods-img {
  266. width: 372px;
  267. height: 250px;
  268. }
  269. .goods-img:hover {
  270. transform: scale(1.2);
  271. transition: transform 1s;
  272. }
  273. }
  274. .bottom {
  275. display: flex;
  276. justify-content: space-between;
  277. padding: 10px 15px;
  278. background: #FFFFFF;
  279. border-bottom-left-radius: 18px;
  280. border-bottom-right-radius: 18px;
  281. .left {
  282. width: 250px;
  283. font-family:PingFangSC-Regular,PingFang SC;
  284. .label {
  285. color: #343E30;
  286. font-size: 20px;
  287. width: 108px;
  288. }
  289. .text {
  290. color: #898A8C;
  291. font-size: 12px;
  292. width: 100%;
  293. }
  294. .price {
  295. width: 140px;
  296. display: flex;
  297. justify-content: space-between;
  298. align-items: center;
  299. margin-top: 9px;
  300. .price-now {
  301. color: #EA0B4A;
  302. font-size: 34px;
  303. font-family:PingFangSC-Semibold,PingFang SC;
  304. font-weight:600;
  305. }
  306. .price-old {
  307. color: #D4D7D9;
  308. font-size: 22px;
  309. position: relative;
  310. .lineation {
  311. height: 1px;
  312. width: 55px !important;
  313. position: absolute;
  314. top: 50%;
  315. border-top: solid #D4D7D9 1px;
  316. display: block;
  317. }
  318. }
  319. }
  320. }
  321. .right {
  322. display: flex;
  323. align-items: flex-end;
  324. margin-bottom: 10px;
  325. color: #0D5CFA;
  326. font-size: 13px;
  327. font-family:PingFangSC-Semibold,PingFang SC;
  328. font-weight:600;
  329. }
  330. }
  331. }
  332. }
  333. }
  334. .selectTabs {
  335. color: #0D5CFA !important;
  336. // font-size: 42px !important;
  337. font-family:PingFangSC-Semibold,PingFang SC;
  338. font-weight:600
  339. }
  340. .cp {
  341. cursor: pointer;
  342. }
  343. .th {
  344. overflow: hidden;
  345. text-overflow:ellipsis;
  346. white-space: nowrap;
  347. }
  348. .fade {
  349. animation: fadeOutDown;
  350. }
  351. @keyframes fadeOutDown {
  352. from {
  353. opacity: 1;
  354. }
  355. to {
  356. opacity: 0;
  357. -webkit-transform: translate3d(0, 100%, 0);
  358. transform: translate3d(0, 100%, 0);
  359. }
  360. }
  361. </style>