123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537 |
- <template>
- <view :style="{ height: windowHeight + 'px'}">
- <view style="display: flex;justify-content: flex-end;">
- <view class="view0 step1"></view>
- </view>
- <view class="view1 step2"></view>
- <view class="view2 step3"></view>
- <view class="view3 step4"></view>
- <view class="view4 step5"></view>
- <view class="view5 step6"></view>
- <view style="display: flex;justify-content: flex-end;">
- <view class="view6 step7"></view>
- </view>
- <image src="@/static/image/white-bg.png" :style="{ height: windowHeight + 'px',width:'750rpx'}"></image>
- <z-paging ref="paging" v-model="dataList" @query="queryList" :style="{ height: windowHeight - 50 + 'px'}"
- :show-scrollbar="false">
- <template #top>
- <page-navbar>
- <template #navLeft>
- <view style="display:flex;flex-direction: row;justify-content: center; align-items: center;">
- <image src="@/static/icon/loacltion.png" style="width: 30rpx; height: 38rpx;"></image>
- <text style="margin-left:10rpx;font-size: 28rpx;">
- 杭州
- </text>
- <image src="@/static/icon/down.png" style="width: 30rpx; height: 16rpx;"></image>
- </view>
- </template>
- <template #navCenter>
- <view style="width: 520rpx;height: 50rpx;margin-left:126rpx;">
- <uv-input placeholder="“潮玩大作战” 派对季重磅开启!" border="none"
- :custom-style="{background:'#8BDB67',paddingLeft:'20rpx'}" shape="circle">
- <template #prefix>
- <image src="@/static/icon/fiery.png" style="width: 14px;height: 18px;"></image>
- </template>
- <template #suffix>
- <view style="width: 77rpx;height: 42rpx;
- background-color: #57A335;border-radius: 20rpx;
- margin-right: 5rpx;display: flex;align-items: center;justify-content: center;">
- <image src="@/static/icon/search.png" style="width: 32rpx;height: 32rpx;">
- </image>
- </view>
- </template>
- </uv-input>
- </view>
- </template>
- </page-navbar>
- </template>
- <z-paging-cell>
- <sortble :default-sorts="['uvSwiper','classModel','uvSwiperCard']">
- <template #uvSwiper>
- <uv-swiper :list="bannerList" :autoplay="true" circular :interval="5000" indicator
- indicator-mode="dot" height='380' radius='0'></uv-swiper>
- </template>
- <template #classModel>
- <view class="classModel">
- <view class="classModel-bg classModel-bg1" ref="classModel1">
- <image class="classModel-img" src="@/static/zhHans-text-icon/text-2.png" mode="">
- </image>
- </view>
- <view class="classModel-bg classModel-bg2" ref="classModel2">
- <image class="classModel-img" src="@/static/zhHans-text-icon/text-3.png" mode="">
- </image>
- </view>
- <view class="classModel-bg" ref="classModel3">
- <image class="classModel-img" src="@/static/zhHans-text-icon/text-4.png" mode="">
- </image>
- </view>
- </view>
- </template>
- <template #uvSwiperCard>
- <view style="background: #fff;padding: 30rpx 0;">
- <image src="/static/zhHans-text-icon/text-1.png" ref="classModel4"
- style="width: 432rpx;height: 34rpx;margin-left: 28rpx;margin-bottom: 43rpx"></image>
- <swiper-card :width="257" :height="290">
- <template v-for="(item,index) in cardList" :slot="`card-${index}`">
- <view style="position: relative;align-items: center;"
- :style="{width:`${257}rpx`,height:`${290}rpx`}">
- <image style="position: absolute;top:15px;" :src="item.img"
- :style="{width:`${257}rpx`,height:`${290}rpx`}">
- </image>
- <image style="position: absolute;" :src="item.bgimg"
- :style="{width:`${257}rpx`,height:`${290}rpx`}"></image>
- </view>
- </template>
- </swiper-card>
- </view>
- </template>
- </sortble>
- </z-paging-cell>
- <z-paging-cell>
- <view class="tab-nav">
- <view
- v-for="(tab, index) in tabs"
- :key="index"
- :class="['tab-item', currentTab === index ? 'active' : '']"
- @click="switchTab(index)"
- >
- {{ tab }}
- </view>
- </view>
- <view v-if="currentTab === 2" class="hot-topics">
- <view class="hot-topics-header">
- <text class="hot-topics-title">热搜资讯!</text>
- </view>
- <swiper
- class="hot-topics-swiper"
- :current="currentTopicPage"
- @change="handleTopicPageChange"
- >
- <swiper-item v-for="(page, pageIndex) in topicPages" :key="pageIndex">
- <view class="hot-topics-list">
- <view v-for="(topic, index) in page" :key="index" class="topic-item">
- <text class="topic-index">{{ pageIndex * 5 + index + 1 }}</text>
- <view class="topic-content">
- <view class="topic-title-row">
- <text class="topic-title">{{ topic.title }}</text>
- <text v-if="topic.isHot" class="hot-tag">HOT</text>
- </view>
- <text class="topic-participants">{{ topic.participants }}人正在热议</text>
- </view>
- </view>
- </view>
- </swiper-item>
- </swiper>
- <view class="indicator-dots">
- <view
- v-for="i in 2"
- :key="i"
- :class="['dot', currentTopicPage === i-1 ? 'active' : '']"
- ></view>
- </view>
- </view>
- <w-waterfall :data="currentList">
- <template v-slot:content="{item,width}">
- <card :item="item" :width="width" :custom-style="{background:'#fff'}" textColor="#000"></card>
- </template>
- </w-waterfall>
- </z-paging-cell>
- </z-paging>
- <tabbar-vue :tabbars="tabbars" :currentIndex="0" ref="tabbar"></tabbar-vue>
- <novice-guidance :step="step"></novice-guidance>
- </view>
- </template>
- <script>
- import sortble from "@/components/sortble/sortble.vue";
- import tabbarVue from "@/components/tabbar/tabbar.vue";
- import pageNavbar from "@/components/page-navbar/page-navbar.vue";
- import wWaterfall from "@/components/w-waterfall/w-waterfall.vue";
- import tabbar from "@/mixins/tabbar";
- import card from "@/components/card/card.vue";
- // import noviceGuidance from "@/components/novice-guidance/index.vue";
- export default {
- components: {
- sortble,
- tabbarVue,
- pageNavbar,
- wWaterfall,
- // noviceGuidance
- },
- mixins: [tabbar],
- data() {
- return {
- step: {
- name: 'workbenchSet5',
- guideList: [{
- el: '.step1',
- tips: '这里是第一步的介绍~',
- next: '下一步',
- }, {
- el: '.step2',
- tips: '这里是第二步的介绍~',
- next: '下一步',
- }, {
- el: '.step3',
- tips: '这里是第三步的介绍~',
- next: '下一步',
- }, {
- el: '.step4',
- tips: '这里是第四步的介绍~',
- next: '下一步',
- }, {
- el: '.step5',
- tips: '这里是第五步的介绍~',
- next: '下一步',
- }, {
- el: '.step6',
- tips: '这里是第六步的介绍~',
- next: '下一步',
- }, {
- el: '.step7',
- tips: '最后一步啦~',
- next: '完成',
- }]
- },
- windowHeight: uni.getWindowInfo().windowHeight,
- bannerList: [
- 'https://e.zhichao.art/AI_images/a_1112_10.png',
- 'https://e.zhichao.art/AI_images/a_1112_108.png',
- 'https://e.zhichao.art/AI_images/a_1112_113.png',
- ],
- cardList: [{
- img: '/static/img/img-1.png',
- bgimg: '/static/image/bg-2.png'
- }, {
- img: '/static/img/img-3.png',
- bgimg: '/static/image/bg-3.png'
- }, {
- img: '/static/img/img-2.png',
- bgimg: '/static/image/bg-1.png'
- }, ],
- list: [], // 瀑布流全部数据
- dataList: [],
- tabs: ['关注', '推荐', '探索'],
- currentTab: 1,
- currentTopicPage: 0,
- followList: [], // 关注列表数据
- recommendList: [], // 推荐列表数据
- exploreList: [], // 探索列表数据
- hotTopics: [
- { title: '今日热门话题一', participants: 275, isHot: true },
- { title: '人气话题二', participants: 183, isHot: false },
- { title: '热门讨论三', participants: 156, isHot: true },
- { title: '今日话题四', participants: 142, isHot: false },
- { title: '热门话题五', participants: 138, isHot: true },
- { title: '今日热点六', participants: 127, isHot: false },
- { title: '热门讨论七', participants: 119, isHot: true },
- { title: '人气话题八', participants: 108, isHot: false },
- { title: '今日话题九', participants: 96, isHot: true },
- { title: '热门话题十', participants: 89, isHot: false },
- ],
- }
- },
- computed: {
- currentList() {
- switch(this.currentTab) {
- case 0: return this.followList;
- case 1: return this.list; // 使用原有的list作为推荐列表
- case 2: return this.exploreList;
- default: return [];
- }
- },
- topicPages() {
- const pages = [];
- for (let i = 0; i < this.hotTopics.length; i += 5) {
- pages.push(this.hotTopics.slice(i, i + 5));
- }
- return pages;
- }
- },
- onLoad() {
- let that = this;
- // this.$nextTick(() => {
- // let step = [{
- // el: '.step1',
- // tips: '这里是第一步的介绍~',
- // next: '下一步',
- // }, {
- // el: '.step2',
- // tips: '这里是第二步的介绍~',
- // next: '下一步',
- // }, {
- // el: '.step3',
- // tips: '这里是第三步的介绍~',
- // next: '下一步',
- // }, {
- // el: '.step4',
- // tips: '这里是第四步的介绍~',
- // next: '下一步',
- // }, {
- // el: '.step5',
- // tips: '这里是第五步的介绍~',
- // next: '下一步',
- // }, {
- // el: '.step6',
- // tips: '这里是第六步的介绍~',
- // next: '下一步',
- // }, {
- // el: '.step7',
- // tips: '最后一步啦~',
- // next: '完成',
- // }]
- // for (var i = 0; i < step.length; i++) {
- // that.step.guideList.push(step[i])
- // }
- // setTimeout(() => {
- // // that.$refs.guidance.start(that.step)
- // }, 1000)
- // })
- this.getData().then(res => {
- this.list = res.data;
- });
- },
- // 下拉刷新数据
- methods: {
- queryList() {
- this.getData().then(res => {
- this.list = res.data;
- this.$refs.paging.complete(this.list);
- });
- },
- async init() {
- const {
- data
- } = await this.getData();
- this.list.push.apply(this.list, data);
- },
- // 模拟的后端数据
- getData() {
- return new Promise((resolve) => {
- const imgs = [{
- url: 'https://e.zhichao.art/AI_images/a_1112_10.png',
- },
- {
- url: 'https://e.zhichao.art/AI_images/a_1112_108.png',
- },
- {
- url: 'https://e.zhichao.art/AI_images/a_1112_113.png',
- },
- {
- url: 'https://e.zhichao.art/AI_images/a_1112_13.png',
- },
- {
- url: 'https://e.zhichao.art/AI_images/a_1112_137.png',
- },
- {
- url: 'https://e.zhichao.art/AI_images/a_1112_141.png',
- },
- {
- url: 'https://e.zhichao.art/AI_images/a_1114__562.png',
- },
- {
- url: 'https://e.zhichao.art/AI_images/a_1114__568.png',
- },
- {
- url: 'https://e.zhichao.art/AI_images/a_1114__569.png',
- },
- {
- url: 'https://e.zhichao.art/AI_images/a_1114__570.png',
- },
- {
- url: 'https://e.zhichao.art/AI_images/a_1114__571.png',
- },
- {
- url: 'https://e.zhichao.art/AI_images/a_1114__575.png',
- },
- ];
- let list = [];
- const doFn = (i) => {
- const randomIndex = Math.floor(Math.random() * 10);
- return {
- allowEdit: i == 0,
- image: imgs[randomIndex].url,
- w: imgs[randomIndex].width,
- h: imgs[randomIndex].height,
- title: i % 2 == 0 ? `玛丽` : `凌音`,
- desc: i % 2 == 0 ?
- `欢迎使用uv-ui,uni-app生态专用的UI框架` : `开发者编写一套代码, 可发布到iOS、Android、H5、以及各种小程序`
- }
- };
- // 模拟异步
- setTimeout(() => {
- for (let i = 0; i < 20; i++) {
- list.push(doFn(i));
- }
- resolve({
- data: list
- });
- }, 200)
- })
- },
- switchTab(index) {
- this.currentTab = index;
- // 根据需要加载对应标签的数据
- this.loadTabData(index);
- },
- loadTabData(index) {
- // 这里添加加载不同标签数据的逻辑
- switch(index) {
- case 0:
- if (!this.followList.length) {
- this.getData().then(res => {
- this.followList = res.data;
- });
- }
- break;
- case 2:
- if (!this.exploreList.length) {
- this.getData().then(res => {
- this.exploreList = res.data;
- });
- }
- break;
- }
- },
- handleTopicPageChange(e) {
- this.currentTopicPage = e.detail.current;
- },
- }
- }
- </script>
- <style lang="scss">
- .classModel {
- width: 750rpx;
- height: 110rpx;
- // #ifndef APP-NVUE
- display: flex;
- // #endif
- // #ifdef APP-NVUE
- flex-direction: row;
- // #endif
- justify-content: space-around;
- margin-bottom: 20rpx;
- .classModel-bg {
- width: 210rpx;
- height: 90rpx;
- background-color: #3F4141;
- border-radius: 60rpx;
- box-shadow: 3px 3px 2px rgba(174, 230, 93, 1);
- .classModel-img {
- width: 175rpx;
- height: 75rpx;
- }
- }
- }
- .tab-nav {
- display: flex;
- justify-content: center;
- padding: 20rpx 0;
- background: #161616;
-
- .tab-item {
- padding: 0 30rpx;
- color: #808080;
- font-size: 28rpx;
-
- &.active {
- color: #ffffff;
- font-weight: bold;
- }
- }
- }
- .hot-topics {
- padding: 20rpx;
- background: #28292D;
- margin: 20rpx;
- border-radius: 16rpx;
-
- .hot-topics-header {
- margin-bottom: 20rpx;
-
- .hot-topics-title {
- font-size: 32rpx;
- font-weight: bold;
- color: #ffffff;
- }
- }
-
- .hot-topics-swiper {
- height: 400rpx; // Adjust this value based on your content
- }
-
- .hot-topics-list {
- padding: 10rpx 0;
- }
-
- .topic-item {
- display: flex;
- align-items: center;
- padding: 15rpx 0;
-
- .topic-index {
- width: 40rpx;
- color: #808080;
- }
-
- .topic-content {
- flex: 1;
-
- .topic-title-row {
- display: flex;
- align-items: center;
-
- .topic-title {
- color: #ffffff;
- font-size: 28rpx;
- }
-
- .hot-tag {
- margin-left: 10rpx;
- padding: 4rpx 10rpx;
- background: #FF4B4B;
- color: #ffffff;
- font-size: 20rpx;
- border-radius: 8rpx;
- }
- }
-
- .topic-participants {
- font-size: 24rpx;
- color: #808080;
- margin-top: 6rpx;
- }
- }
- }
-
- .indicator-dots {
- display: flex;
- justify-content: center;
- margin-top: 20rpx;
-
- .dot {
- width: 12rpx;
- height: 12rpx;
- border-radius: 50%;
- background: #808080;
- margin: 0 6rpx;
-
- &.active {
- background: #ffffff;
- }
- }
- }
- }
- </style>
|