detail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487
  1. <template>
  2. <view class="template-advertise">
  3. <!-- 顶部自定义导航 -->
  4. <tn-nav-bar fixed alpha customBack>
  5. <view slot="back" class='tn-custom-nav-bar__back tn-navbg'
  6. @click="goBack">
  7. <text class='icon tn-icon-home-smile-fill'></text>
  8. </view>
  9. </tn-nav-bar>
  10. <!-- <view :style="{paddingTop: `${topInfo.height}px`}"></view> -->
  11. <view class="banner">
  12. <swiper class="card-swiper" :circular="true"
  13. :autoplay="true" duration="500" interval="5000" @change="cardSwiper">
  14. <swiper-item v-for="(item,index) in swiperList" :key="index" :class="cardCur==index?'cur':''">
  15. <view class="swiper-item image-banner">
  16. <image :src="item.url" mode="aspectFill" v-if="item.type=='image'"></image>
  17. </view>
  18. <view class="swiper-item-text">
  19. <view class="tn-text-xxl tn-text-bold tn-color-white">{{item.title}}</view>
  20. <view class="tn-text-bold tn-color-white tn-padding-top-xs" style="font-size: 60rpx;">{{item.name}}</view>
  21. <view class="tn-text-sm tn-text-bold tn-color-white tn-padding-top-sm tn-padding-bottom-sm">{{item.text}}</view>
  22. </view>
  23. </swiper-item>
  24. </swiper>
  25. <view class="indication">
  26. <block v-for="(item,index) in swiperList" :key="index">
  27. <view class="spot" :class="cardCur==index?'active':''"></view>
  28. </block>
  29. </view>
  30. </view>
  31. <!-- <view class="tn-padding" >
  32. <view class="tn-text-bold tn-text-xl tn-padding-top-sm">
  33. 创新设计·全球首发
  34. </view>
  35. <view class="tn-padding-top-sm">
  36. <text class="tn-color-black tn-text-bold">北北</text>
  37. <text class="tn-color-grey tn-padding-left-sm">2022-05-21 10:03:45</text>
  38. <text class="tn-padding-left tn-color-indigo--dark" >投诉</text>
  39. </view>
  40. </view> -->
  41. <view class="adver-wrap tn-bg-white">
  42. <view class="tn-flex tn-flex-row-between tn-padding-top-lg" @tap="showLandscape">
  43. <view class="tn-flex-3 tn-padding tn-margin-left-sm">
  44. <view class="tn-flex">
  45. <view class="tn-flex tn-flex-row-center tn-flex-col-center">
  46. <view class="tn-padding-right tn-text-ellipsis tn-text-left">
  47. <view class="tn-padding-right tn-color-black tn-text-bold tn-text-xxl">
  48. 让我们一同探索未知
  49. </view>
  50. <view class="tn-padding-right tn-padding-top tn-text-df">一同前往无限可能</view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="tn-flex-1 justify-content-item tn-padding tn-text-center">
  56. <view class="">
  57. <text class="tn-icon-qr-code" style="font-size: 70rpx;"></text>
  58. </view>
  59. <view class=" tn-padding-top-xs">
  60. 探 索
  61. </view>
  62. </view>
  63. </view>
  64. <view class="detail-img tn-padding">
  65. <image src='https://tnuiimage.tnkjapp.com/advertise/1.jpg' mode='widthFix' class=''></image>
  66. <image src='https://tnuiimage.tnkjapp.com/advertise/2.jpg' mode='widthFix' class=''></image>
  67. <image src='https://tnuiimage.tnkjapp.com/advertise/3.jpg' mode='widthFix' class=''></image>
  68. <image src='https://tnuiimage.tnkjapp.com/advertise/4.jpg' mode='widthFix' class=''></image>
  69. <image src='https://tnuiimage.tnkjapp.com/advertise/5.jpg' mode='widthFix' class=''></image>
  70. <image src='https://tnuiimage.tnkjapp.com/advertise/tabbar1.jpg' mode='widthFix' class=''></image>
  71. <image src='https://tnuiimage.tnkjapp.com/advertise/tabbar2.jpg' mode='widthFix' class=''></image>
  72. <image src='https://tnuiimage.tnkjapp.com/advertise/tabbar3.jpg' mode='widthFix' class=''></image>
  73. <image src='https://tnuiimage.tnkjapp.com/advertise/tabbar4.jpg' mode='widthFix' class=''></image>
  74. <image src='https://tnuiimage.tnkjapp.com/advertise/tabbar5.jpg' mode='widthFix' class=''></image>
  75. <image src='https://tnuiimage.tnkjapp.com/advertise/7.jpg' mode='widthFix' class=''></image>
  76. <image src='https://tnuiimage.tnkjapp.com/advertise/8.jpg' mode='widthFix' class=''></image>
  77. <image src='https://tnuiimage.tnkjapp.com/advertise/10.jpg' mode='widthFix' class=''></image>
  78. </view>
  79. </view>
  80. <view id="top-info" class="tn-footerfixed tn-flex tn-flex-row-between tn-flex-col-center tn-padding tn-safe-area-inset-bottom dd-glass" :style="{transform: `translateY(${topInfoTranslateY}px)`}" @click="showModal">
  81. <view class="justify-content-item tn-padding-bottom">
  82. <view class="tn-flex tn-flex-col-center tn-flex-row-left">
  83. <view class="user-pic">
  84. <view class="user-image">
  85. <view class="tn-shadow-blur" style="background-image:url('https://tnuiimage.tnkjapp.com/blogger/blogger_beibei.jpg');width: 100rpx;height: 100rpx;background-size: cover;">
  86. </view>
  87. </view>
  88. </view>
  89. <view class="tn-padding-right tn-color-black">
  90. <view class="tn-padding-right tn-padding-left-sm">
  91. <text class="tn-text-lg tn-text-bold">图鸟北北</text>
  92. <text class="tn-padding-left-sm">打杂UI</text>
  93. </view>
  94. <view class="tn-padding-right tn-padding-top-xs tn-padding-left-sm tn-text-ellipsis">
  95. <text class="tn-color-blue--dark tn-text-bold">抓住那只猪科技有限公司</text>
  96. </view>
  97. </view>
  98. </view>
  99. </view>
  100. <view class="justify-content-item tn-flex-col-center tn-flex-row-center tn-text-center tn-padding-bottom">
  101. <view class="">
  102. <text class="tn-icon-wechat-fill tn-color-green--dark" style="font-size: 50rpx;"></text>
  103. </view>
  104. <view class="">
  105. <text class="tn-text-sm">加微信</text>
  106. </view>
  107. </view>
  108. </view>
  109. <tn-modal v-model="show1" :custom="true">
  110. <view class="custom-modal-content">
  111. <image @tap="previewQRCodeImage" src='https://tnuiimage.tnkjapp.com/advertise/qrcode.jpg' mode='aspectFill' style="width: 100%;"></image>
  112. <view class="tn-text-center tn-padding-top">作者微信:tnkewo</view>
  113. <view class="tn-text-center tn-padding-top tn-text-lg">点击上图,可识别微信二维码</view>
  114. </view>
  115. </tn-modal>
  116. <!-- 压屏窗-->
  117. <tn-landscape :show="show2" @close="closeLandscape">
  118. <view class="tn-text-center" @click="navTuniaoUI">
  119. <image src="https://tnuiimage.tnkjapp.com/landscape/2022-new-year.png" mode="widthFix"></image>
  120. <text class="tn-text-lg tn-color-white tn-padding-top-lg">—— 图鸟UI,2022年已上线 ——</text>
  121. </view>
  122. </tn-landscape>
  123. <!-- <view class='tn-tabbar-height'></view> -->
  124. </view>
  125. </template>
  126. <script>
  127. import template_page_mixin from '@/libs/mixin/template_page_mixin.js'
  128. export default {
  129. name: 'templateAdvertise',
  130. mixins: [template_page_mixin],
  131. data(){
  132. return {
  133. cardCur: 0,
  134. swiperList: [{
  135. id: 0,
  136. type: 'image',
  137. title: 'BUG再多',
  138. name: '也别忘了',
  139. text: '我无限续杯',
  140. url: 'https://tnuiimage.tnkjapp.com/shop/cup1.jpg',
  141. }, {
  142. id: 1,
  143. type: 'image',
  144. title: '图鸟南南',
  145. name: '欢迎加入东东们',
  146. text: '如果你也有不错的作品',
  147. url: 'https://tnuiimage.tnkjapp.com/swiper/read.jpg',
  148. }, {
  149. id: 2,
  150. type: 'image',
  151. title: '图鸟西西',
  152. name: '一起玩转scss',
  153. text: '用最少的代码做最骚的效果',
  154. url: 'https://tnuiimage.tnkjapp.com/swiper/deer.jpg',
  155. }, {
  156. id: 3,
  157. type: 'image',
  158. title: '图鸟北北',
  159. name: '微信号 tnkewo',
  160. text: '商业合作请联系作者',
  161. url: 'https://tnuiimage.tnkjapp.com/swiper/swiper3.jpg',
  162. }, {
  163. id: 4,
  164. type: 'image',
  165. title: '图鸟猪猪',
  166. name: '努力成为大佬',
  167. text: '一起加油吖',
  168. url: 'https://tnuiimage.tnkjapp.com/shop/banner2.jpg',
  169. }],
  170. show1: false,
  171. show2: false,
  172. maskCloseable: true,
  173. topInfo: {
  174. height: 0,
  175. },
  176. topInfoTranslateY: 0,
  177. prevScrollTop: 0
  178. }
  179. },
  180. onLoad() {
  181. },
  182. onReady() {
  183. this.getTopInfoRect()
  184. },
  185. onPageScroll(e) {
  186. this.handlePageScroll(e.scrollTop)
  187. },
  188. methods: {
  189. // cardSwiper
  190. cardSwiper(e) {
  191. this.cardCur = e.detail.current
  192. },
  193. // 预览作者图片
  194. previewQRCodeImage() {
  195. wx.previewImage({
  196. urls: ['https://tnuiimage.tnkjapp.com/advertise/qrcode.jpg']
  197. })
  198. },
  199. // 获取顶部销售信息容器相关信息
  200. getTopInfoRect() {
  201. this._tGetRect('#top-info').then((res) => {
  202. if (!res) {
  203. setTimeout(() => {
  204. this.getTopInfoRect()
  205. }, 50)
  206. return
  207. }
  208. this.topInfo.height = res.height
  209. })
  210. },
  211. // 处理页面滚动事件
  212. handlePageScroll(scrollTop) {
  213. console.log(scrollTop);
  214. if (this.prevScrollTop > scrollTop) {
  215. // 下滑
  216. this.topInfoTranslateY = 0
  217. } else {
  218. // 上滑
  219. if (scrollTop > this.topInfo.height) {
  220. this.topInfoTranslateY = this.topInfo.height
  221. }
  222. }
  223. this.prevScrollTop = scrollTop
  224. },
  225. // 弹出模态框
  226. showModal(event) {
  227. this.openModal()
  228. },
  229. // 打开模态框
  230. openModal() {
  231. this.show1 = true
  232. },
  233. // 弹出压屏窗
  234. showLandscape() {
  235. this.openLandscape()
  236. },
  237. // 打开压屏窗
  238. openLandscape() {
  239. this.show2 = true
  240. },
  241. // 关闭压屏窗
  242. closeLandscape() {
  243. this.show2 = false
  244. },
  245. // 跳转到图鸟UI
  246. navTuniaoUI() {
  247. uni.navigateToMiniProgram({
  248. appId: 'wxf3d81a452b88ff4b'
  249. })
  250. },
  251. }
  252. }
  253. </script>
  254. <style lang="scss" scoped>
  255. /* 胶囊*/
  256. .tn-custom-nav-bar__back {
  257. width: 36%;
  258. height: 100%;
  259. position: relative;
  260. display: flex;
  261. justify-content: space-evenly;
  262. align-items: center;
  263. box-sizing: border-box;
  264. background-color: rgba(0, 0, 0, 0.15);
  265. border-radius: 1000rpx;
  266. border: 1rpx solid rgba(255, 255, 255, 0.5);
  267. color: #FFFFFF;
  268. font-size: 18px;
  269. .icon {
  270. display: block;
  271. flex: 1;
  272. margin: auto;
  273. text-align: center;
  274. }
  275. }
  276. /* 渐变*/
  277. .tn-navbg {
  278. margin: 0;
  279. color: #fff;
  280. background: linear-gradient(-120deg, #F15BB5, #9A5CE5, #01BEFF, #00F5D4);
  281. /* background: linear-gradient(-120deg, #9A5CE5, #01BEFF, #00F5D4, #43e97b); */
  282. /* background: linear-gradient(-120deg,#c471f5, #ec008c, #ff4e50,#f9d423); */
  283. /* background: linear-gradient(-120deg, #0976ea, #c471f5, #f956b6, #ea7e0a); */
  284. background-size: 500% 500%;
  285. animation: gradientBG 15s ease infinite;
  286. }
  287. @keyframes gradientBG {
  288. 0% {
  289. background-position: 0% 50%;
  290. }
  291. 50% {
  292. background-position: 100% 50%;
  293. }
  294. 100% {
  295. background-position: 0% 50%;
  296. }
  297. }
  298. /* 内容 */
  299. .adver-wrap {
  300. position: relative;
  301. z-index: 1;
  302. // padding: 20rpx 30rpx;
  303. margin-top: 700rpx;
  304. border-radius: 80rpx 80rpx 0 0;
  305. }
  306. /* 毛玻璃*/
  307. .dd-glass {
  308. width: 100%;
  309. backdrop-filter: blur(20rpx);
  310. -webkit-backdrop-filter: blur(20rpx);
  311. }
  312. /* 用户头像 start */
  313. .user-image {
  314. width: 90rpx;
  315. height: 90rpx;
  316. position: relative;
  317. }
  318. .user-pic {
  319. background-size: cover;
  320. background-repeat: no-repeat;
  321. // background-attachment:fixed;
  322. background-position: top;
  323. border-radius: 50%;
  324. overflow: hidden;
  325. background-color: #FFFFFF;
  326. }
  327. /* 富文本图示意 start */
  328. .detail-img {
  329. z-index: -1;
  330. padding-bottom: 40rpx;
  331. image {
  332. width: 100%;
  333. margin: 20rpx 0;
  334. // height: 3373rpx;
  335. // z-index: -1;
  336. }
  337. }
  338. .banner{
  339. position: fixed;
  340. top: 0;
  341. width: 100%;
  342. transition: all 0.25s ease-out;
  343. z-index: -1;
  344. }
  345. /* 轮播视觉差 start */
  346. .card-swiper {
  347. height: 800rpx !important;
  348. }
  349. .card-swiper swiper-item {
  350. width: 750rpx !important;
  351. left: 0rpx;
  352. box-sizing: border-box;
  353. // padding: 0rpx 30rpx 90rpx 30rpx;
  354. overflow: initial;
  355. }
  356. .card-swiper swiper-item .swiper-item {
  357. width: 100%;
  358. display: block;
  359. height: 100%;
  360. transform: scale(1);
  361. transition: all 0.2s ease-in 0s;
  362. overflow: hidden;
  363. }
  364. .card-swiper swiper-item.cur .swiper-item {
  365. transform: none;
  366. transition: all 0.2s ease-in 0s;
  367. }
  368. .card-swiper swiper-item .swiper-item-text {
  369. margin-top: -320rpx;
  370. width: 100%;
  371. display: block;
  372. height: 50%;
  373. border-radius: 10rpx;
  374. transform: translate(100rpx, -60rpx) scale(0.9, 0.9);
  375. transition: all 0.6s ease 0s;
  376. overflow: hidden;
  377. }
  378. .card-swiper swiper-item.cur .swiper-item-text {
  379. margin-top: -380rpx;
  380. width: 100%;
  381. transform: translate(0rpx, 0rpx) scale(0.9, 0.9);
  382. transition: all 0.6s ease 0s;
  383. }
  384. .image-banner{
  385. display: flex;
  386. align-items: center;
  387. justify-content: center;
  388. }
  389. .image-banner image{
  390. width: 100%;
  391. height: 100%;
  392. }
  393. /* 轮播指示点 start*/
  394. .indication{
  395. z-index: 9999;
  396. width: 100%;
  397. height: 36rpx;
  398. position: absolute;
  399. display:flex;
  400. flex-direction:row;
  401. align-items:center;
  402. justify-content:center;
  403. }
  404. .spot{
  405. background-color: #FFFFFF;
  406. opacity: 0.6;
  407. width: 10rpx;
  408. height: 10rpx;
  409. border-radius: 20rpx;
  410. top: -150rpx;
  411. margin: 0 8rpx !important;
  412. position: relative;
  413. }
  414. .spot.active{
  415. opacity: 1;
  416. width: 30rpx;
  417. background-color: #FFFFFF;
  418. }
  419. /* 底部悬浮按钮 start*/
  420. .tn-tabbar-height {
  421. min-height: 120rpx;
  422. height: calc(140rpx + env(safe-area-inset-bottom) / 2);
  423. }
  424. .tn-footerfixed {
  425. position: fixed;
  426. background-color: rgba(255,255,255,0.5);
  427. box-shadow: 0rpx 0rpx 30rpx 0rpx rgba(0, 0, 0, 0.07);
  428. bottom: 0;
  429. width: 100%;
  430. transition: all 0.25s ease-out;
  431. z-index: 100;
  432. }
  433. </style>