index.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <view>
  3. <view class="top-sort ddflex">
  4. <view class="top-sort-item flex top-sort-item-active">海报</view>
  5. <view class="top-sort-item flex">产品宣传</view>
  6. </view>
  7. <view style="height: 85rpx;"></view>
  8. <view style="border-top: 20rpx solid #F4F5F9;">
  9. <view class="search-box ddflex">
  10. <view class="search-input ddflex fflex">
  11. <image src="/static/images/ssico.png"></image>
  12. <input @confirm="searchFn" confirm-type="search" @input="searchFn" v-model="searchVal" class="fflex"
  13. placeholder="请输入关键词" />
  14. </view>
  15. </view>
  16. <view class="ddflex" style="padding: 0 30rpx;">
  17. <view class="search-tag search-tag-active">全部</view>
  18. <view class="search-tag" v-for="item in 12">问候日签</view>
  19. </view>
  20. <view class="ddflex" style="padding: 30rpx;">
  21. <view class="poster-item" v-for="item in 6" @click="jumpUrl('/library/posterService/posterService')">
  22. <image class="poster-item-pic" src="http://img.zhiqiyun.com/test/2023/07/31/8b7ed072b68fe70f0d6f409a71a8b17b.png" mode="aspectFill"></image>
  23. <view class="poster-item-title tover">海报名称</view>
  24. <view class="poster-item-use">2056 人正在使用</view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. const app = getApp();
  32. const req = require("../../utils/request.js");
  33. export default {
  34. components: {},
  35. props: {},
  36. data() {
  37. return {
  38. systems: {},
  39. isTop:0,
  40. }
  41. },
  42. onLoad(options) {
  43. },
  44. onShow() {
  45. },
  46. methods: {
  47. jumpUrl(url){
  48. uni.navigateTo({
  49. url:url
  50. })
  51. }
  52. },
  53. mounted() {
  54. const systemInfo = uni.getSystemInfoSync();
  55. // px转换到rpx的比例
  56. let pxToRpxScale = 750 / systemInfo.windowWidth;
  57. let systems = {
  58. ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
  59. navigationHeight: 44 * pxToRpxScale // 导航栏的高度
  60. };
  61. systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
  62. this.systems = systems;
  63. },
  64. onPageScroll: function(e) {
  65. if (e.scrollTop > this.systems.barHeight) {
  66. this.isTop = 1;
  67. } else {
  68. this.isTop = 0;
  69. }
  70. }
  71. }
  72. </script>
  73. <style>
  74. @import "./index.css";
  75. </style>