index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <view class="content">
  3. <custom-layout ref="layout" :showBottom="true" :back="{show:false,logoShow:true}" v-model="dataList"
  4. @layoutquery="onQueryList" @scroll="onScroll">
  5. <template #navBarLeft>
  6. <view class="search-bar_top ml10">
  7. <up-search placeholder="卡皮巴拉" :showAction="false" borderColor="rgba(0, 224, 176, 1)"
  8. v-model="searchValue"></up-search>
  9. </view>
  10. </template>
  11. <template #content>
  12. <!-- 导航标签 -->
  13. <up-sticky offset-top="0" customNav-height="0" :bg-color="scrollTop > 40 ? bgColor:''">
  14. <up-tabs :list="tabs" :line-height="0" :active-style="{'fontSize':'30rpx','fontWeight':'600'}"></up-tabs>
  15. </up-sticky>
  16. <view class="demo-uni-row">
  17. <view class="demo-uni-col" v-for="(item,index) in 10" :key="index">
  18. <view class="list_left">
  19. <up-image :show-loading="true" :src="ceshiimage" radius="20rpx" width="161.95rpx"
  20. height="155.87rpx"></up-image>
  21. </view>
  22. <view class="list_center">
  23. <view class="list_c_t">语气贴贴</view>
  24. <view class="list_c_b">
  25. <view v-for="(items,indexs) in 3" :key="indexs" class="list_c_b_item">
  26. <up-image :show-loading="true" :src="ceshiicon" radius="20rpx" width="114rpx"
  27. height="106rpx"></up-image>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="list_right">
  32. <view class="mini_btn">下载</view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. </custom-layout>
  38. </view>
  39. </template>
  40. <script setup>
  41. import {
  42. ref,
  43. onMounted,
  44. computed
  45. } from 'vue';
  46. import {
  47. onShow,
  48. onPageScroll
  49. } from "@dcloudio/uni-app";
  50. import {
  51. storeToRefs
  52. } from 'pinia'
  53. import {
  54. useSystemStore
  55. } from "@/store/index.js"
  56. const store = useSystemStore()
  57. // 引入组件
  58. // 引入状态管理参数
  59. const {
  60. bgColor
  61. } = storeToRefs(store)
  62. // 定义变量内容
  63. const ceshiimage = 'https://img.js.design/assets/img/66f77cb0c6ebda7a2a394736.png#846fab95fed56db08fcbc92025765a68'
  64. const ceshiicon = 'https://img.js.design/assets/img/66f7f501b50663ba27c0adc7.png#5e31df675fe6a23fe7219d6fe07b48b4'
  65. const searchValue = ref('卡皮巴拉')
  66. const tabs = ref([{
  67. state: -1,
  68. name: '热门',
  69. },
  70. {
  71. state: 1,
  72. name: '爱情'
  73. },
  74. {
  75. state: 2,
  76. name: '生日'
  77. },
  78. {
  79. state: 3,
  80. name: '友谊'
  81. },
  82. {
  83. state: 4,
  84. name: '手帐'
  85. },
  86. {
  87. state: 5,
  88. name: '宝宝'
  89. }, {
  90. state: 6,
  91. name: '婚礼'
  92. }, {
  93. state: 7,
  94. name: '校园'
  95. }
  96. ])
  97. const activeIndex = ref(-1)
  98. const tabClick = (index, name) => {
  99. console.log(index, name);
  100. }
  101. // 业务列表
  102. const dataList = ref([{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, ])
  103. const num = ref(1)
  104. const layout = ref()
  105. const onQueryList = (event) => {
  106. const {
  107. pageNo,
  108. pageSize
  109. } = event
  110. if (pageNo > 1) {
  111. if (num.value < 2) {
  112. num.value++
  113. layout.value.complete(dataList.value);
  114. } else {
  115. layout.value.complete([]);
  116. }
  117. } else {
  118. num.value = 2
  119. layout.value.complete(dataList.value);
  120. }
  121. }
  122. // 检测页面滚动
  123. const scrollTop = ref(0)
  124. const onScroll = (event) => {
  125. scrollTop.value = event
  126. }
  127. // 生命中期
  128. onMounted(() => {
  129. })
  130. </script>
  131. <style lang="scss" scoped>
  132. .search-bar_top {
  133. width: 46vw;
  134. }
  135. // ======导航标签right标签=======
  136. .tabs_list_box {
  137. padding: 0 26rpx;
  138. width: 100vw;
  139. box-sizing: border-box;
  140. background: var(--bgColor);
  141. .tabs-rigth-fixed {
  142. background: rgba(149, 250, 213, 1);
  143. border-radius: 50rpx;
  144. height: 40rpx;
  145. line-height: 40rpx;
  146. display: flex;
  147. align-items: center;
  148. padding: 0 6rpx;
  149. box-sizing: border-box;
  150. font-size: 20rpx;
  151. font-family: SmileySans-Oblique-2;
  152. text {
  153. font-weight: 600;
  154. }
  155. }
  156. }
  157. // ======liet样式=======
  158. .demo-uni-row {
  159. width: 100%;
  160. padding: 0 26rpx;
  161. margin-top: 20rpx;
  162. box-sizing: border-box;
  163. display: flex;
  164. flex-wrap: wrap;
  165. .demo-uni-col {
  166. width: 100%;
  167. border-radius: 13px;
  168. margin-bottom: 10rpx;
  169. background-color: #fff;
  170. padding: 13rpx 20rpx 13rpx 10rpx;
  171. box-sizing: border-box;
  172. display: flex;
  173. .list_left {
  174. width: 161.95rpx;
  175. height: 155.87rpx;
  176. }
  177. .list_center {
  178. width: calc(100% - 161.95rpx - 80rpx);
  179. height: 155.87rpx;
  180. padding: 0 10rpx;
  181. display: flex;
  182. flex-direction: column;
  183. justify-content: space-between;
  184. .list_c_t {
  185. font-size: 28rpx;
  186. font-weight: 600;
  187. letter-spacing: 0rpx;
  188. line-height: 38.42rpx;
  189. color: rgba(0, 0, 0, 1);
  190. text-align: left;
  191. vertical-align: top;
  192. margin-top: 10rpx;
  193. }
  194. .list_c_b {
  195. display: flex;
  196. .list_c_b_item {
  197. width: 114rpx;
  198. height: 106rpx;
  199. background-image: url(var(--iconImage));
  200. background-size: 100% 100%;
  201. }
  202. }
  203. }
  204. .list_right {
  205. width: 80rpx;
  206. display: flex;
  207. flex-direction: column;
  208. justify-content: center;
  209. .mini_btn {
  210. width: 100%;
  211. border-radius: 50rpx;
  212. padding: 4rpx 0;
  213. background-color: #000;
  214. color: #fff;
  215. text-align: center;
  216. font-size: 24rpx;
  217. }
  218. }
  219. }
  220. }
  221. </style>