123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- <template>
- <view class="content">
- <custom-layout ref="layout" :showBottom="true" title="启运" v-model="dataList"
- @layoutquery="onQueryList" @scroll="onScroll">
- <template #content>
- <fortune-info />
- <up-sticky offset-top="0" customNav-height="0" :bg-color="scrollTop > 170 ? bgColor:''">
- <up-tabs :list="tabs" :line-height="0" :active-style="{'fontSize':'30rpx','fontWeight':'600'}"></up-tabs>
- </up-sticky>
- <view class="demo-uni-row">
- <view class="demo-uni-col" v-for="(item,index) in dataList" :key="index"></view>
- </view>
- </template>
- </custom-layout>
- </view>
- </template>
- <script setup>
- import {
- ref,
- computed,
- onMounted
- } from 'vue';
- import {
- onShow
- } from "@dcloudio/uni-app";
- import {
- storeToRefs
- } from 'pinia'
- import {
- useSystemStore
- } from "@/store/index.js"
- const store = useSystemStore()
- // 引入组件
- import fortuneInfo from './components/fortuneInfo.vue'
- // 引入状态管理参数
- const {
- bgColor
- } = storeToRefs(store)
- // 定义变量内容
- const searchValue = ref(1)
- const tabs = ref([{
- state: -1,
- name: '热门新款',
- },
- {
- state: 1,
- name: '简约'
- },
- {
- state: 2,
- name: '卡通'
- },
- {
- state: 3,
- name: '复古'
- },
- {
- state: 4,
- name: '运动'
- },
- {
- state: 5,
- name: '艺术'
- }, {
- state: 6,
- name: '节日'
- }
- ])
- const activeIndex = ref(-1)
- const tabClick = (index, name) => {
- console.log(index, name);
- }
-
- // 业务列表
- const dataList = ref([{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, ])
- const num = ref(1)
- const layout = ref()
- const onQueryList = (event) => {
- const {
- pageNo,
- pageSize
- } = event
- if (pageNo > 1) {
- if (num.value < 2) {
- num.value++
- layout.value.complete(dataList.value);
- } else {
- layout.value.complete([]);
- }
- } else {
- num.value = 2
- layout.value.complete(dataList.value);
- }
- }
-
- // 检测页面滚动
- const scrollTop = ref(0)
- const onScroll = (event) => {
- scrollTop.value = event
- }
- // 生命中期
- onMounted(() => {
- })
- </script>
- <style lang="scss" scoped>
- .fortune_list {
- margin-top: 30rpx;
- background-color: #fff;
- border-radius: 40rpx 40rpx 0rpx 0rpx;
- }
- // ======导航标签right标签=======
- .tabs_list_box {
- padding: 0 26rpx;
- width: 100vw;
- box-sizing: border-box;
- background: var(--bgColor);
- .tabs-rigth-fixed {
- background: rgba(149, 250, 213, 1);
- border-radius: 50rpx;
- height: 40rpx;
- line-height: 40rpx;
- display: flex;
- align-items: center;
- padding: 0 6rpx;
- box-sizing: border-box;
- font-size: 20rpx;
- font-family: SmileySans-Oblique-2;
- text {
- font-weight: 600;
- }
- }
- }
- // ======liet样式=======
- .demo-uni-row {
- width: 100%;
- padding: 0 26rpx;
- margin-top: 20rpx;
- box-sizing: border-box;
- display: flex;
- flex-wrap: wrap;
- .demo-uni-col {
- width: calc((100% / 3) - 8rpx);
- height: 400rpx;
- background-color: #ccc;
- border-radius: 13px;
- margin-bottom: 10rpx;
- &:nth-child(3n - 1) {
- margin-right: 10rpx;
- margin-left: 10rpx;
- }
- }
- }
- </style>
|