index.vue 5.1 KB

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