index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. <template>
  2. <view class="template-study tn-safe-area-inset-bottom">
  3. <!-- 顶部自定义导航 -->
  4. <tn-nav-bar fixed alpha customBack>
  5. <view slot="back" class='tn-custom-nav-bar__back'
  6. @click="goBack">
  7. <text class='icon tn-icon-left'></text>
  8. <text class='icon tn-icon-home-capsule-fill'></text>
  9. </view>
  10. </tn-nav-bar>
  11. <swiper class="card-swiper" :circular="true"
  12. :autoplay="true" duration="500" interval="18000" @change="cardSwiper">
  13. <swiper-item v-for="(item,index) in swiperList" :key="index" :class="cardCur==index?'cur':''">
  14. <view class="swiper-item image-banner">
  15. <image :src="item.url" mode="aspectFill" v-if="item.type=='image'"></image>
  16. </view>
  17. <view class="swiper-item2 image-banner">
  18. <image class="png-sussuspension" :src="item.pngurl" mode="heightFix" v-if="item.type=='image'"></image>
  19. </view>
  20. <view class="swiper-item-text">
  21. <view class="text-sussuspension">
  22. <view class="tn-text-xxl tn-text-bold tn-color-white">{{item.title}}</view>
  23. <view class="tn-text-bold tn-color-white tn-padding-top-xs" style="font-size: 60rpx;">{{item.name}}</view>
  24. <view class="tn-text-sm tn-text-bold tn-color-white tn-padding-top-sm tn-padding-bottom-sm">{{item.text}}</view>
  25. </view>
  26. </view>
  27. </swiper-item>
  28. </swiper>
  29. <view class="indication">
  30. <block v-for="(item,index) in swiperList" :key="index">
  31. <view class="spot" :class="cardCur==index?'active':''"></view>
  32. </block>
  33. </view>
  34. <!-- 方式10 start-->
  35. <view class="tn-flex tn-margin-top">
  36. <view class="tn-flex-1 tn-padding-sm tn-radius tn-margin-xs">
  37. <view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
  38. <view class="icon10__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur tn-bg-blue tn-color-white">
  39. <view class="tn-icon-gloves-fill"></view>
  40. </view>
  41. <view class="tn-color-black tn-text-df tn-text-center tn-padding-top-xs">
  42. <text class="tn-text-ellipsis">学习</text>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="tn-flex-1 tn-padding-sm tn-radius tn-margin-xs">
  47. <view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
  48. <view class="icon10__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur tn-bg-red tn-color-white">
  49. <view class="tn-icon-live-stream-fill"></view>
  50. </view>
  51. <view class="tn-color-black tn-text-df tn-text-center tn-padding-top-xs">
  52. <text class="tn-text-ellipsis">视频</text>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="tn-flex-1 tn-padding-sm tn-radius tn-margin-xs">
  57. <view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
  58. <view class="icon10__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur tn-bg-orange tn-color-white">
  59. <view class="tn-icon-image-text-fill"></view>
  60. </view>
  61. <view class="tn-color-black tn-text-df tn-text-center tn-padding-top-xs">
  62. <text class="tn-text-ellipsis">日志</text>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="tn-flex-1 tn-padding-sm tn-radius tn-margin-xs">
  67. <view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
  68. <view class="icon10__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur tn-bg-purple tn-color-white">
  69. <view class="tn-icon-topics-fill"></view>
  70. </view>
  71. <view class="tn-color-black tn-text-df tn-text-center tn-padding-top-xs">
  72. <text class="tn-text-ellipsis">话题</text>
  73. </view>
  74. </view>
  75. </view>
  76. <view class="tn-flex-1 tn-padding-sm tn-radius tn-margin-xs">
  77. <view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
  78. <view class="icon10__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur tn-bg-cyan tn-color-white">
  79. <view class="tn-icon-chemistry"></view>
  80. </view>
  81. <view class="tn-color-black tn-text-df tn-text-center tn-padding-top-xs">
  82. <text class="tn-text-ellipsis">沉淀</text>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. <!-- 方式10 end-->
  88. <view class="tn-margin study-shadow" v-for="(item, index) in 6" :key="index">
  89. <view class="tn-padding tn-flex tn-flex-col-center">
  90. <view class="tn-tag-content tn-shadow-blur tn-cool-bg-color-15 tn-margin-right tn-text-sm tn-text-bold">
  91. <text class="tn-padding-right-sm">#</text> 前端
  92. </view>
  93. <view class="tn-text-bold tn-text-lg">
  94. Flex前端基础布局知识一览
  95. </view>
  96. </view>
  97. <view class="tn-flex tn-flex-col-center tn-flex-row-between tn-padding">
  98. <view class="tn-flex tn-flex-2 justify-content-item tn-text-bold tn-text-lg">
  99. <view class="">
  100. <tn-avatar-group :lists="groupList" size="sm"></tn-avatar-group>
  101. </view>
  102. <view class="tn-padding-left-sm">
  103. <text>286人已学习</text>
  104. </view>
  105. </view>
  106. <view class="tn-flex-1 justify-content-item tn-text-lg tn-text-right">
  107. <view class="tn-padding-bottom-xs tn-color-gray">
  108. 免费
  109. </view>
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. </template>
  115. <script>
  116. import template_page_mixin from '@/libs/mixin/template_page_mixin.js'
  117. export default {
  118. name: 'TemplateStudy',
  119. mixins: [template_page_mixin],
  120. data(){
  121. return {
  122. cardCur: 0,
  123. swiperList: [{
  124. id: 0,
  125. type: 'image',
  126. title: '一起学习',
  127. name: '文案之类的',
  128. text: '小文案小文案小文案',
  129. url: 'https://tnuiimage.tnkjapp.com/swiper/banner-animate3.png',
  130. pngurl: 'https://tnuiimage.tnkjapp.com/login/1/login_top3.png'
  131. }, {
  132. id: 1,
  133. type: 'image',
  134. title: '图鸟南南',
  135. name: '欢迎加入东东们',
  136. text: '如果你也有不错的作品',
  137. url: 'https://tnuiimage.tnkjapp.com/swiper/banner-animate2.png',
  138. pngurl: 'https://tnuiimage.tnkjapp.com/swiper/c4d1.png'
  139. }, {
  140. id: 2,
  141. type: 'image',
  142. title: '图鸟西西',
  143. name: '一起玩转scss',
  144. text: '用最少的代码做最骚的效果',
  145. url: 'https://tnuiimage.tnkjapp.com/swiper/deer.jpg',
  146. pngurl: 'https://tnuiimage.tnkjapp.com/swiper/c4d1.png'
  147. }, {
  148. id: 3,
  149. type: 'image',
  150. title: '图鸟北北',
  151. name: '微信号 tnkewo',
  152. text: '商业合作请联系作者',
  153. url: 'https://tnuiimage.tnkjapp.com/swiper/banner-animate.png',
  154. pngurl: 'https://tnuiimage.tnkjapp.com/swiper/c4d1.png'
  155. }, {
  156. id: 4,
  157. type: 'image',
  158. title: '图鸟猪猪',
  159. name: '努力成为大佬',
  160. text: '一起加油吖',
  161. url: 'https://tnuiimage.tnkjapp.com/shop/banner2.jpg',
  162. pngurl: 'https://tnuiimage.tnkjapp.com/swiper/c4d1.png'
  163. }],
  164. groupList: [
  165. {src: 'https://tnuiimage.tnkjapp.com/blogger/avatar_1.jpeg'},
  166. {src: 'https://tnuiimage.tnkjapp.com/blogger/avatar_2.jpeg'},
  167. {src: 'https://tnuiimage.tnkjapp.com/blogger/avatar_3.jpeg'},
  168. {src: 'https://tnuiimage.tnkjapp.com/blogger/avatar_4.jpeg'},
  169. {src: 'https://tnuiimage.tnkjapp.com/blogger/blogger_beibei.jpg'},
  170. ]
  171. }
  172. },
  173. methods: {
  174. // cardSwiper
  175. cardSwiper(e) {
  176. this.cardCur = e.detail.current
  177. },
  178. }
  179. }
  180. </script>
  181. <style lang="scss" scoped>
  182. /* 胶囊*/
  183. .tn-custom-nav-bar__back {
  184. width: 100%;
  185. height: 100%;
  186. position: relative;
  187. display: flex;
  188. justify-content: space-evenly;
  189. align-items: center;
  190. box-sizing: border-box;
  191. background-color: rgba(0, 0, 0, 0.15);
  192. border-radius: 1000rpx;
  193. border: 1rpx solid rgba(255, 255, 255, 0.5);
  194. color: #FFFFFF;
  195. font-size: 18px;
  196. .icon {
  197. display: block;
  198. flex: 1;
  199. margin: auto;
  200. text-align: center;
  201. }
  202. &:before {
  203. content: " ";
  204. width: 1rpx;
  205. height: 110%;
  206. position: absolute;
  207. top: 22.5%;
  208. left: 0;
  209. right: 0;
  210. margin: auto;
  211. transform: scale(0.5);
  212. transform-origin: 0 0;
  213. pointer-events: none;
  214. box-sizing: border-box;
  215. opacity: 0.7;
  216. background-color: #FFFFFF;
  217. }
  218. }
  219. /* 内容 */
  220. .study-wrap {
  221. position: relative;
  222. z-index: 1;
  223. margin-top: -90rpx;
  224. }
  225. /* 阴影 start*/
  226. .study-shadow {
  227. border-radius: 15rpx;
  228. box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.07);
  229. }
  230. /* 悬浮 */
  231. .png-sussuspension{
  232. animation: suspension 3s ease-in-out infinite;
  233. }
  234. @keyframes suspension {
  235. 0%, 100% {
  236. transform: translate(0 , 0);
  237. }
  238. 50% {
  239. transform: translate(-0.8rem , 1rem);
  240. }
  241. }
  242. .text-sussuspension{
  243. animation: suspension2 4s ease-in-out infinite;
  244. }
  245. @keyframes suspension2 {
  246. 0%, 100% {
  247. transform: translate(0 , 0);
  248. }
  249. 50% {
  250. transform: translate(0rem , 1rem);
  251. }
  252. }
  253. /* 轮播视觉差 start */
  254. .card-swiper {
  255. height: 800rpx !important;
  256. }
  257. .card-swiper swiper-item {
  258. width: 750rpx !important;
  259. left: 0rpx;
  260. box-sizing: border-box;
  261. // padding: 0rpx 30rpx 90rpx 30rpx;
  262. overflow: initial;
  263. }
  264. .card-swiper swiper-item .swiper-item {
  265. width: 100%;
  266. display: block;
  267. height: 100%;
  268. transform: scale(1);
  269. transition: all 0.2s ease-in 0s;
  270. overflow: hidden;
  271. }
  272. .card-swiper swiper-item.cur .swiper-item {
  273. transform: none;
  274. transition: all 0.2s ease-in 0s;
  275. }
  276. .card-swiper swiper-item .swiper-item2 {
  277. margin-top: -540rpx;
  278. width: 100%;
  279. display: block;
  280. height: 100%;
  281. border-radius: 0rpx;
  282. transform: translate(140rpx, 20rpx) scale(0.3, 0.3);
  283. transition: all 0.6s ease 0s;
  284. overflow: hidden;
  285. }
  286. .card-swiper swiper-item.cur .swiper-item2 {
  287. margin-top: -650rpx;
  288. width: 100%;
  289. transform: translate(180rpx, 0rpx) scale(0.5, 0.5);
  290. transition: all 0.6s ease 0s;
  291. }
  292. .card-swiper swiper-item .swiper-item-text {
  293. margin-top: -550rpx;
  294. width: 100%;
  295. display: block;
  296. height: 50%;
  297. border-radius: 10rpx;
  298. transform: translate(100rpx, -60rpx) scale(0.9, 0.9);
  299. transition: all 0.6s ease 0s;
  300. overflow: hidden;
  301. }
  302. .card-swiper swiper-item.cur .swiper-item-text {
  303. margin-top: -610rpx;
  304. width: 100%;
  305. transform: translate(0rpx, 60rpx) scale(0.9, 0.9);
  306. transition: all 0.6s ease 0s;
  307. }
  308. .image-banner{
  309. display: flex;
  310. align-items: center;
  311. justify-content: center;
  312. }
  313. .image-banner image{
  314. width: 100%;
  315. height: 100%;
  316. }
  317. /* 轮播指示点 start*/
  318. .indication{
  319. z-index: 9999;
  320. width: 100%;
  321. height: 36rpx;
  322. position: absolute;
  323. display:flex;
  324. flex-direction:row;
  325. align-items:center;
  326. justify-content:center;
  327. }
  328. .spot{
  329. background-color: #FFFFFF;
  330. opacity: 0.6;
  331. width: 10rpx;
  332. height: 10rpx;
  333. border-radius: 20rpx;
  334. left: -265rpx;
  335. top: -150rpx;
  336. margin: 0 8rpx !important;
  337. position: relative;
  338. }
  339. .spot.active{
  340. opacity: 1;
  341. width: 30rpx;
  342. background-color: #FFFFFF;
  343. }
  344. /* 圆角*/
  345. .study-radius{
  346. border-radius: 15rpx;
  347. }
  348. /* 阴影*/
  349. .study-shadow{
  350. box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.07);
  351. }
  352. /* 图标容器10 start */
  353. .icon10 {
  354. &__item {
  355. width: 30%;
  356. background-color: #FFFFFF;
  357. border-radius: 10rpx;
  358. padding: 30rpx;
  359. margin: 20rpx 10rpx;
  360. transform: scale(1);
  361. transition: transform 0.3s linear;
  362. transform-origin: center center;
  363. &--icon {
  364. width: 84rpx;
  365. height: 65rpx;
  366. font-size: 45rpx;
  367. border-radius: 200rpx;
  368. margin-bottom: 18rpx;
  369. position: relative;
  370. z-index: 1;
  371. &::after {
  372. content: " ";
  373. position: absolute;
  374. z-index: -1;
  375. width: 100%;
  376. height: 100%;
  377. left: 0;
  378. bottom: 0;
  379. border-radius: inherit;
  380. opacity: 1;
  381. transform: scale(1, 1);
  382. background-size: 100% 100%;
  383. background-image: url(https://tnuiimage.tnkjapp.com/cool_bg_image/icon_bg6.png);
  384. }
  385. }
  386. }
  387. }
  388. /* 图标容器10 end */
  389. /* 标签内容 start*/
  390. .tn-tag-content {
  391. border-radius: 8rpx 25rpx 25rpx 8rpx;
  392. display: inline-block;
  393. line-height: 35rpx;
  394. padding: 8rpx 25rpx;
  395. color: rgba(255,255,255,0.8);
  396. }
  397. </style>