|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
- <view :style="{ height: windowHeight + 'px'}">
|
|
|
|
- <view style="display: flex;justify-content: flex-end;">
|
|
|
|
|
|
+ <view :style="{ height: windowHeight + 'px' }">
|
|
|
|
+ <view style="display: flex; justify-content: flex-end">
|
|
<view class="view0 step1"></view>
|
|
<view class="view0 step1"></view>
|
|
</view>
|
|
</view>
|
|
<view class="view1 step2"></view>
|
|
<view class="view1 step2"></view>
|
|
@@ -8,35 +8,35 @@
|
|
<view class="view3 step4"></view>
|
|
<view class="view3 step4"></view>
|
|
<view class="view4 step5"></view>
|
|
<view class="view4 step5"></view>
|
|
<view class="view5 step6"></view>
|
|
<view class="view5 step6"></view>
|
|
- <view style="display: flex;justify-content: flex-end;">
|
|
|
|
|
|
+ <view style="display: flex; justify-content: flex-end">
|
|
<view class="view6 step7"></view>
|
|
<view class="view6 step7"></view>
|
|
</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 - 80 + 'px'}"
|
|
|
|
|
|
+ <z-paging ref="paging" v-model="dataList" @query="queryList" :style="{ height: windowHeight - 80 + 'px' }"
|
|
:show-scrollbar="false">
|
|
:show-scrollbar="false">
|
|
- <template #top>
|
|
|
|
|
|
+ <template #top >
|
|
<page-navbar>
|
|
<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>
|
|
<template #navCenter>
|
|
- <view style="width: 520rpx;height: 50rpx;margin-left:126rpx;">
|
|
|
|
|
|
+ <view class="top" style=" display: flex;">
|
|
|
|
+ <view class="topBox">
|
|
|
|
+
|
|
|
|
+ <text style="margin-left: 10rpx; font-size: 44rpx;font-weight: 600;"> 杭州 </text>
|
|
|
|
+ <image src="@/static/home/home-bom.png"
|
|
|
|
+ style="width: 36rpx; height: 36rpx;margin-left: 15rpx;margin-right: 30rpx;"></image>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="weather">
|
|
|
|
+ <p>多云🌤️20℃</p>
|
|
|
|
+ <p>星期五</p>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="search">
|
|
<uv-input placeholder="“潮玩大作战” 派对季重磅开启!" border="none"
|
|
<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>
|
|
|
|
|
|
+ :custom-style="{ background: '#fff', paddingLeft: '25rpx' }" shape="circle">
|
|
|
|
+
|
|
|
|
+ <image src="@/static/icon/fiery.png" style="width: 22rpx; height: 30rpx"></image>
|
|
|
|
+
|
|
<template #suffix>
|
|
<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;">
|
|
|
|
|
|
+ <view class="input-box">
|
|
|
|
+ <image src="@/static/icon/search.png" style="width: 32rpx; height: 32rpx">
|
|
</image>
|
|
</image>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
@@ -45,15 +45,39 @@
|
|
</template>
|
|
</template>
|
|
</page-navbar>
|
|
</page-navbar>
|
|
</template>
|
|
</template>
|
|
- <z-paging-cell>
|
|
|
|
- <sortble :default-sorts="['uvSwiper','classModel','uvSwiperCard']">
|
|
|
|
|
|
+ <z-paging-cell class="benner-box">
|
|
|
|
+ <sortble :default-sorts="['uvSwiper', 'classModel', 'uvSwiperCard']">
|
|
<template #uvSwiper>
|
|
<template #uvSwiper>
|
|
<uv-swiper :list="bannerList" :autoplay="true" circular :interval="5000" indicator
|
|
<uv-swiper :list="bannerList" :autoplay="true" circular :interval="5000" indicator
|
|
- indicator-mode="dot" height='380' radius='0'></uv-swiper>
|
|
|
|
|
|
+ indicator-mode="dot" height="200" radius="0"></uv-swiper>
|
|
</template>
|
|
</template>
|
|
|
|
+
|
|
<template #classModel>
|
|
<template #classModel>
|
|
<view class="classModel">
|
|
<view class="classModel">
|
|
- <view class="classModel-bg classModel-bg1" ref="classModel1"
|
|
|
|
|
|
+ <image src="@/static/home/benner-iconBom.png" class="benner-iconBom" mode=""></image>
|
|
|
|
+ <image src="@/static/home/benner-icontop.png" class="benner-icontop" mode=""></image>
|
|
|
|
+ <view class="benner-box benner-left-box">
|
|
|
|
+ <view class="text1">
|
|
|
|
+ 获取奖励
|
|
|
|
+ </view>
|
|
|
|
+ <view class="btn">
|
|
|
|
+ 立即前往
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="benner-box benner-right-box" ref="classModel1"
|
|
|
|
+ @click="goPage('/pages/my/job')">
|
|
|
|
+ <view class="guard">
|
|
|
|
+ <view class="text">
|
|
|
|
+ 潮玩IP
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="match">
|
|
|
|
+ <view class="text">
|
|
|
|
+ 社交
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <!-- <view class="classModel-bg classModel-bg1" ref="classModel1"
|
|
@click="goPage('/pages/my/job')">
|
|
@click="goPage('/pages/my/job')">
|
|
<image class="classModel-img" src="@/static/zhHans-text-icon/text-2.png" mode="">
|
|
<image class="classModel-img" src="@/static/zhHans-text-icon/text-2.png" mode="">
|
|
</image>
|
|
</image>
|
|
@@ -65,27 +89,10 @@
|
|
<view class="classModel-bg" ref="classModel3">
|
|
<view class="classModel-bg" ref="classModel3">
|
|
<image class="classModel-img" src="@/static/zhHans-text-icon/text-4.png" mode="">
|
|
<image class="classModel-img" src="@/static/zhHans-text-icon/text-4.png" mode="">
|
|
</image>
|
|
</image>
|
|
- </view>
|
|
|
|
|
|
+ </view> -->
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</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>
|
|
</sortble>
|
|
</z-paging-cell>
|
|
</z-paging-cell>
|
|
<z-paging-cell>
|
|
<z-paging-cell>
|
|
@@ -93,32 +100,49 @@
|
|
<view v-for="(tab, index) in tabs" :key="index"
|
|
<view v-for="(tab, index) in tabs" :key="index"
|
|
:class="['tab-item', currentTab === index ? 'active' : '']" @click="switchTab(index)">
|
|
:class="['tab-item', currentTab === index ? 'active' : '']" @click="switchTab(index)">
|
|
{{ tab }}
|
|
{{ tab }}
|
|
|
|
+ <view class="indicator-triangle">
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<view v-if="currentTab === 2" class="hot-topics">
|
|
<view v-if="currentTab === 2" class="hot-topics">
|
|
<view class="hot-topics-header">
|
|
<view class="hot-topics-header">
|
|
- <text class="hot-topics-title">热搜资讯!</text>
|
|
|
|
|
|
+ <!-- <text class="hot-topics-title">热搜资讯!</text> -->
|
|
|
|
+ <image class="hot-topics-title" src="@/static/home/hot-topics-title.png" mode=""></image>
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
<swiper class="hot-topics-swiper" :current="currentTopicPage" @change="handleTopicPageChange">
|
|
<swiper class="hot-topics-swiper" :current="currentTopicPage" @change="handleTopicPageChange">
|
|
<swiper-item v-for="(page, pageIndex) in topicPages" :key="pageIndex">
|
|
<swiper-item v-for="(page, pageIndex) in topicPages" :key="pageIndex">
|
|
<view class="hot-topics-list">
|
|
<view class="hot-topics-list">
|
|
<view v-for="(topic, index) in page" :key="index" class="topic-item"
|
|
<view v-for="(topic, index) in page" :key="index" class="topic-item"
|
|
@click="goToArticleDetail(topic.id)">
|
|
@click="goToArticleDetail(topic.id)">
|
|
- <text class="topic-index">{{ pageIndex * 5 + index + 1 }}</text>
|
|
|
|
|
|
+ <view class="hot-topics-left">
|
|
|
|
+ <image v-if="(pageIndex * 4 + index) ==0" src="@/static/icon/icon-first.png" class="topic-index topic-index-img" mode=""></image>
|
|
|
|
+ <image v-else-if="(pageIndex * 4 + index) ==1" src="@/static/icon/icon-second.png" class="topic-index topic-index-img" mode=""></image>
|
|
|
|
+ <image v-else-if="(pageIndex * 4 + index) ==2" src="@/static/icon/icon-third.png" class="topic-index topic-index-img" mode=""></image>
|
|
|
|
+ <text v-else class="topic-index">{{ pageIndex * 4 + index + 1 }}</text>
|
|
|
|
+
|
|
|
|
+ <view class="topic-content toe">
|
|
|
|
+ {{ topic.title }}
|
|
|
|
+ </view>
|
|
|
|
+ <image v-if="topic.isHot" src="@/static/icon/icon-hot.png" class="hot-tag" mode=""></image>
|
|
|
|
+ </view>
|
|
|
|
+ <text class="topic-participants">{{ topic.num_like }}人正在热议</text>
|
|
|
|
+ <!-- <text class="topic-index">{{ pageIndex * 5 + index + 1 }}</text>
|
|
<view class="topic-content">
|
|
<view class="topic-content">
|
|
<view class="topic-title-row">
|
|
<view class="topic-title-row">
|
|
<text class="topic-title">{{ topic.title }}</text>
|
|
<text class="topic-title">{{ topic.title }}</text>
|
|
<text v-if="topic.isHot" class="hot-tag">HOT</text>
|
|
<text v-if="topic.isHot" class="hot-tag">HOT</text>
|
|
</view>
|
|
</view>
|
|
<text class="topic-participants">{{ topic.num_like }}人正在热议</text>
|
|
<text class="topic-participants">{{ topic.num_like }}人正在热议</text>
|
|
- </view>
|
|
|
|
|
|
+ </view> -->
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</swiper-item>
|
|
</swiper-item>
|
|
</swiper>
|
|
</swiper>
|
|
<view class="indicator-dots">
|
|
<view class="indicator-dots">
|
|
- <view v-for="i in 2" :key="i" :class="['dot', currentTopicPage === i-1 ? 'active' : '']"></view>
|
|
|
|
|
|
+ <view v-for="i in 2" :key="i" :class="['dot', currentTopicPage === i - 1 ? 'active' : '']">
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
@@ -126,13 +150,21 @@
|
|
<!-- 关注列表 - 类似my.vue -->
|
|
<!-- 关注列表 - 类似my.vue -->
|
|
<view v-show="currentTab === 0" class="follow-list">
|
|
<view v-show="currentTab === 0" class="follow-list">
|
|
<block v-if="followList.length > 0">
|
|
<block v-if="followList.length > 0">
|
|
- <view class="works-list">
|
|
|
|
|
|
+ <!-- <view class="works-list">
|
|
<view class="work-item" v-for="(item, index) in followList" :key="index"
|
|
<view class="work-item" v-for="(item, index) in followList" :key="index"
|
|
@click="goWork(item)">
|
|
@click="goWork(item)">
|
|
<image class="work-image" :src="item.images || item.img_url" mode="aspectFill"></image>
|
|
<image class="work-image" :src="item.images || item.img_url" mode="aspectFill"></image>
|
|
- <view class="work-title">{{item.title || '作品'+index}}</view>
|
|
|
|
|
|
+ <view class="work-title">{{
|
|
|
|
+ item.title || "作品" + index
|
|
|
|
+ }}</view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
|
|
+ </view> -->
|
|
|
|
+ <w-waterfall :data="followList">
|
|
|
|
+ <template v-slot:content="{ item, width }">
|
|
|
|
+ <card :item="formatItem(item)" :width="width" :custom-style="{ background: '#fff' }"
|
|
|
|
+ textColor="#000"></card>
|
|
|
|
+ </template>
|
|
|
|
+ </w-waterfall>
|
|
</block>
|
|
</block>
|
|
<view class="no-data" v-else-if="!isLoadingFollow">
|
|
<view class="no-data" v-else-if="!isLoadingFollow">
|
|
<text>暂无关注数据</text>
|
|
<text>暂无关注数据</text>
|
|
@@ -141,31 +173,37 @@
|
|
|
|
|
|
<!-- 推荐列表 - 瀑布流样式 -->
|
|
<!-- 推荐列表 - 瀑布流样式 -->
|
|
<w-waterfall v-show="currentTab === 1 && recommendList.length > 0" :data="recommendList">
|
|
<w-waterfall v-show="currentTab === 1 && recommendList.length > 0" :data="recommendList">
|
|
- <template v-slot:content="{item,width}">
|
|
|
|
- <card :item="formatItem(item)" :width="width" :custom-style="{background:'#fff'}"
|
|
|
|
|
|
+ <template v-slot:content="{ item, width }">
|
|
|
|
+ <card :item="formatItem(item)" :width="width" :custom-style="{ background: '#fff' }"
|
|
textColor="#000"></card>
|
|
textColor="#000"></card>
|
|
</template>
|
|
</template>
|
|
</w-waterfall>
|
|
</w-waterfall>
|
|
|
|
|
|
<!-- 探索列表 - 热点新闻已经有现成的热搜资讯组件,只需添加新闻列表 -->
|
|
<!-- 探索列表 - 热点新闻已经有现成的热搜资讯组件,只需添加新闻列表 -->
|
|
<view v-show="currentTab === 2 && newsList.length > 0" class="news-list">
|
|
<view v-show="currentTab === 2 && newsList.length > 0" class="news-list">
|
|
- <view class="news-grid">
|
|
|
|
|
|
+ <!-- <view class="news-grid">
|
|
<view class="news-item" v-for="(item, index) in newsList" :key="index"
|
|
<view class="news-item" v-for="(item, index) in newsList" :key="index"
|
|
@click="goToArticleDetail(item.id)">
|
|
@click="goToArticleDetail(item.id)">
|
|
<image class="news-image" :src="item.img_url || item.images" mode="aspectFill"></image>
|
|
<image class="news-image" :src="item.img_url || item.images" mode="aspectFill"></image>
|
|
- <view class="news-title">{{item.title || '新闻标题'}}</view>
|
|
|
|
|
|
+ <view class="news-title">{{ item.title || "新闻标题" }}</view>
|
|
<view class="news-footer">
|
|
<view class="news-footer">
|
|
- <view class="news-author">{{item.author || '作者'}}</view>
|
|
|
|
|
|
+ <view class="news-author">{{ item.author || "作者" }}</view>
|
|
<view class="news-views">
|
|
<view class="news-views">
|
|
<image src="/static/icon/icon-4.png" class="view-icon"></image>
|
|
<image src="/static/icon/icon-4.png" class="view-icon"></image>
|
|
- <text>{{item.num_view || '0'}}</text>
|
|
|
|
|
|
+ <text>{{ item.num_view || "0" }}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
|
|
+ </view> -->
|
|
|
|
+ <w-waterfall v-show="currentTab === 2 && newsList.length > 0" :data="newsList">
|
|
|
|
+ <template v-slot:content="{ item, width }">
|
|
|
|
+ <card :item="formatItem(item)" :width="width" :custom-style="{ background: '#fff' }"
|
|
|
|
+ textColor="#000"></card>
|
|
|
|
+ </template>
|
|
|
|
+ </w-waterfall>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
- <view class="no-data" v-if="currentTab === 1 && recommendList.length === 0 && !isLoadingRecommend">
|
|
|
|
|
|
+ <view class="no-data" v-if=" currentTab === 1 && recommendList.length === 0 && !isLoadingRecommend ">
|
|
<text>暂无推荐数据</text>
|
|
<text>暂无推荐数据</text>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
@@ -206,56 +244,66 @@
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
step: {
|
|
step: {
|
|
- name: 'workbenchSet5',
|
|
|
|
|
|
+ name: "workbenchSet5",
|
|
guideList: [{
|
|
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: '完成',
|
|
|
|
- }]
|
|
|
|
|
|
+ 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,
|
|
windowHeight: uni.getWindowInfo().windowHeight,
|
|
bannerList: [
|
|
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',
|
|
|
|
|
|
+ "../../static/dome/home-swper.png",
|
|
|
|
+ "../../static/dome/home-swper.png",
|
|
|
|
+ "../../static/dome/home-swper.png",
|
|
],
|
|
],
|
|
cardList: [{
|
|
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'
|
|
|
|
- }, ],
|
|
|
|
|
|
+ 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: [], // 瀑布流全部数据
|
|
list: [], // 瀑布流全部数据
|
|
dataList: [],
|
|
dataList: [],
|
|
- tabs: ['关注', '推荐', '探索'],
|
|
|
|
|
|
+ tabs: ["关注", "推荐", "探索"],
|
|
currentTab: 1,
|
|
currentTab: 1,
|
|
currentTopicPage: 0,
|
|
currentTopicPage: 0,
|
|
followList: [], // 关注列表数据
|
|
followList: [], // 关注列表数据
|
|
@@ -276,7 +324,7 @@
|
|
isLoadingExplore: false, // 是否正在加载探索列表
|
|
isLoadingExplore: false, // 是否正在加载探索列表
|
|
isLoadingNews: false, // 是否正在加载新闻列表
|
|
isLoadingNews: false, // 是否正在加载新闻列表
|
|
hotTopics: [],
|
|
hotTopics: [],
|
|
- }
|
|
|
|
|
|
+ };
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
currentList() {
|
|
currentList() {
|
|
@@ -293,11 +341,11 @@
|
|
},
|
|
},
|
|
topicPages() {
|
|
topicPages() {
|
|
const pages = [];
|
|
const pages = [];
|
|
- for (let i = 0; i < this.hotTopics.length; i += 5) {
|
|
|
|
- pages.push(this.hotTopics.slice(i, i + 5));
|
|
|
|
|
|
+ for (let i = 0; i < this.hotTopics.length; i += 4) {
|
|
|
|
+ pages.push(this.hotTopics.slice(i, i + 4));
|
|
}
|
|
}
|
|
return pages;
|
|
return pages;
|
|
- }
|
|
|
|
|
|
+ },
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
let that = this;
|
|
let that = this;
|
|
@@ -349,43 +397,41 @@
|
|
getData() {
|
|
getData() {
|
|
return new Promise((resolve) => {
|
|
return new Promise((resolve) => {
|
|
const imgs = [{
|
|
const imgs = [{
|
|
- url: 'https://e.zhichao.art/AI_images/a_1112_10.png',
|
|
|
|
|
|
+ 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_108.png",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- url: 'https://e.zhichao.art/AI_images/a_1112_113.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_13.png",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- url: 'https://e.zhichao.art/AI_images/a_1112_137.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_1112_141.png",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- url: 'https://e.zhichao.art/AI_images/a_1114__562.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__568.png",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- url: 'https://e.zhichao.art/AI_images/a_1114__569.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__570.png",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- url: 'https://e.zhichao.art/AI_images/a_1114__571.png',
|
|
|
|
|
|
+ url: "https://e.zhichao.art/AI_images/a_1114__571.png",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- url: 'https://e.zhichao.art/AI_images/a_1114__575.png',
|
|
|
|
|
|
+ url: "https://e.zhichao.art/AI_images/a_1114__575.png",
|
|
},
|
|
},
|
|
-
|
|
|
|
-
|
|
|
|
];
|
|
];
|
|
let list = [];
|
|
let list = [];
|
|
const doFn = (i) => {
|
|
const doFn = (i) => {
|
|
@@ -397,8 +443,8 @@
|
|
h: imgs[randomIndex].height,
|
|
h: imgs[randomIndex].height,
|
|
title: i % 2 == 0 ? `玛丽` : `凌音`,
|
|
title: i % 2 == 0 ? `玛丽` : `凌音`,
|
|
desc: i % 2 == 0 ?
|
|
desc: i % 2 == 0 ?
|
|
- `欢迎使用uv-ui,uni-app生态专用的UI框架` : `开发者编写一套代码, 可发布到iOS、Android、H5、以及各种小程序`
|
|
|
|
- }
|
|
|
|
|
|
+ `欢迎使用uv-ui,uni-app生态专用的UI框架` : `开发者编写一套代码, 可发布到iOS、Android、H5、以及各种小程序`,
|
|
|
|
+ };
|
|
};
|
|
};
|
|
// 模拟异步
|
|
// 模拟异步
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
@@ -406,10 +452,10 @@
|
|
list.push(doFn(i));
|
|
list.push(doFn(i));
|
|
}
|
|
}
|
|
resolve({
|
|
resolve({
|
|
- data: list
|
|
|
|
|
|
+ data: list,
|
|
});
|
|
});
|
|
- }, 200)
|
|
|
|
- })
|
|
|
|
|
|
+ }, 200);
|
|
|
|
+ });
|
|
},
|
|
},
|
|
switchTab(index) {
|
|
switchTab(index) {
|
|
this.currentTab = index;
|
|
this.currentTab = index;
|
|
@@ -450,21 +496,25 @@
|
|
this.isLoadingFollow = true;
|
|
this.isLoadingFollow = true;
|
|
|
|
|
|
uni.request({
|
|
uni.request({
|
|
- url: this.$apiHost + '/Work/getlist',
|
|
|
|
|
|
+ url: this.$apiHost + "/Work/getlist",
|
|
data: {
|
|
data: {
|
|
uuid: getApp().globalData.uuid,
|
|
uuid: getApp().globalData.uuid,
|
|
skey: getApp().globalData.skey,
|
|
skey: getApp().globalData.skey,
|
|
- type: 'attention', // 关注列表
|
|
|
|
- offset: this.followOffset
|
|
|
|
|
|
+ type: "attention", // 关注列表
|
|
|
|
+ offset: this.followOffset,
|
|
},
|
|
},
|
|
header: {
|
|
header: {
|
|
"content-type": "application/json",
|
|
"content-type": "application/json",
|
|
- 'sign': getApp().globalData.headerSign
|
|
|
|
|
|
+ sign: getApp().globalData.headerSign,
|
|
},
|
|
},
|
|
success: (res) => {
|
|
success: (res) => {
|
|
console.log("关注列表数据:", res.data);
|
|
console.log("关注列表数据:", res.data);
|
|
// 确保在任何情况下都完成加载
|
|
// 确保在任何情况下都完成加载
|
|
- if (res.data.success == 'yes' && res.data.list && res.data.list.length > 0) {
|
|
|
|
|
|
+ if (
|
|
|
|
+ res.data.success == "yes" &&
|
|
|
|
+ res.data.list &&
|
|
|
|
+ res.data.list.length > 0
|
|
|
|
+ ) {
|
|
// 只有当列表有数据时才追加
|
|
// 只有当列表有数据时才追加
|
|
this.followList = [...this.followList, ...res.data.list];
|
|
this.followList = [...this.followList, ...res.data.list];
|
|
this.followOffset += res.data.list.length;
|
|
this.followOffset += res.data.list.length;
|
|
@@ -492,7 +542,7 @@
|
|
if (this.$refs.paging) {
|
|
if (this.$refs.paging) {
|
|
this.$refs.paging.complete(false);
|
|
this.$refs.paging.complete(false);
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ },
|
|
});
|
|
});
|
|
},
|
|
},
|
|
loadRecommendList() {
|
|
loadRecommendList() {
|
|
@@ -500,20 +550,24 @@
|
|
this.isLoadingRecommend = true;
|
|
this.isLoadingRecommend = true;
|
|
|
|
|
|
uni.request({
|
|
uni.request({
|
|
- url: this.$apiHost + '/Work/getlist',
|
|
|
|
|
|
+ url: this.$apiHost + "/Work/getlist",
|
|
data: {
|
|
data: {
|
|
uuid: getApp().globalData.uuid,
|
|
uuid: getApp().globalData.uuid,
|
|
skey: getApp().globalData.skey,
|
|
skey: getApp().globalData.skey,
|
|
- type: 'recommend', // 推荐列表
|
|
|
|
- offset: this.recommendOffset
|
|
|
|
|
|
+ type: "recommend", // 推荐列表
|
|
|
|
+ offset: this.recommendOffset,
|
|
},
|
|
},
|
|
header: {
|
|
header: {
|
|
"content-type": "application/json",
|
|
"content-type": "application/json",
|
|
- 'sign': getApp().globalData.headerSign
|
|
|
|
|
|
+ sign: getApp().globalData.headerSign,
|
|
},
|
|
},
|
|
success: (res) => {
|
|
success: (res) => {
|
|
console.log("推荐列表数据:", res.data);
|
|
console.log("推荐列表数据:", res.data);
|
|
- if (res.data.success == 'yes' && res.data.list && res.data.list.length > 0) {
|
|
|
|
|
|
+ if (
|
|
|
|
+ res.data.success == "yes" &&
|
|
|
|
+ res.data.list &&
|
|
|
|
+ res.data.list.length > 0
|
|
|
|
+ ) {
|
|
this.recommendList = [...this.recommendList, ...res.data.list];
|
|
this.recommendList = [...this.recommendList, ...res.data.list];
|
|
this.recommendOffset += res.data.list.length;
|
|
this.recommendOffset += res.data.list.length;
|
|
|
|
|
|
@@ -539,7 +593,7 @@
|
|
if (this.$refs.paging) {
|
|
if (this.$refs.paging) {
|
|
this.$refs.paging.complete(false);
|
|
this.$refs.paging.complete(false);
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ },
|
|
});
|
|
});
|
|
},
|
|
},
|
|
loadHotNews() {
|
|
loadHotNews() {
|
|
@@ -547,30 +601,34 @@
|
|
this.isLoadingExplore = true;
|
|
this.isLoadingExplore = true;
|
|
|
|
|
|
uni.request({
|
|
uni.request({
|
|
- url: this.$apiHost + '/Article/getlist',
|
|
|
|
|
|
+ url: this.$apiHost + "/Article/getlist",
|
|
data: {
|
|
data: {
|
|
uuid: getApp().globalData.uuid,
|
|
uuid: getApp().globalData.uuid,
|
|
skey: getApp().globalData.skey,
|
|
skey: getApp().globalData.skey,
|
|
- type: 'hot' // 热点新闻
|
|
|
|
|
|
+ type: "hot", // 热点新闻
|
|
},
|
|
},
|
|
header: {
|
|
header: {
|
|
"content-type": "application/json",
|
|
"content-type": "application/json",
|
|
- 'sign': getApp().globalData.headerSign
|
|
|
|
|
|
+ sign: getApp().globalData.headerSign,
|
|
},
|
|
},
|
|
success: (res) => {
|
|
success: (res) => {
|
|
console.log("热点新闻数据:", res.data);
|
|
console.log("热点新闻数据:", res.data);
|
|
- if (res.data.success == 'yes' && res.data.list && res.data.list.length > 0) {
|
|
|
|
|
|
+ if (
|
|
|
|
+ res.data.success == "yes" &&
|
|
|
|
+ res.data.list &&
|
|
|
|
+ res.data.list.length > 0
|
|
|
|
+ ) {
|
|
this.hotNewsList = res.data.list;
|
|
this.hotNewsList = res.data.list;
|
|
-
|
|
|
|
|
|
+
|
|
// 如果有热点新闻数据,更新热搜资讯
|
|
// 如果有热点新闻数据,更新热搜资讯
|
|
if (this.hotNewsList.length > 0) {
|
|
if (this.hotNewsList.length > 0) {
|
|
// 将API返回的热点新闻转换为热搜资讯格式
|
|
// 将API返回的热点新闻转换为热搜资讯格式
|
|
this.hotTopics = this.hotNewsList.map((item, index) => {
|
|
this.hotTopics = this.hotNewsList.map((item, index) => {
|
|
return {
|
|
return {
|
|
id: item.id,
|
|
id: item.id,
|
|
- title: item.title || '热门话题',
|
|
|
|
|
|
+ title: item.title || "热门话题",
|
|
num_like: item.num_like || 0,
|
|
num_like: item.num_like || 0,
|
|
- isHot: index % 2 === 0 // 偶数索引的设为热点
|
|
|
|
|
|
+ isHot: index % 2 === 0, // 偶数索引的设为热点
|
|
};
|
|
};
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -579,10 +637,10 @@
|
|
complete: () => {
|
|
complete: () => {
|
|
this.isLoadingExplore = false;
|
|
this.isLoadingExplore = false;
|
|
},
|
|
},
|
|
- fail: (e) => {
|
|
|
|
|
|
+ fail: (e) => {
|
|
console.log("请求热点新闻失败:", e);
|
|
console.log("请求热点新闻失败:", e);
|
|
this.isLoadingExplore = false;
|
|
this.isLoadingExplore = false;
|
|
- }
|
|
|
|
|
|
+ },
|
|
});
|
|
});
|
|
},
|
|
},
|
|
loadNewsList() {
|
|
loadNewsList() {
|
|
@@ -590,20 +648,24 @@
|
|
this.isLoadingNews = true;
|
|
this.isLoadingNews = true;
|
|
|
|
|
|
uni.request({
|
|
uni.request({
|
|
- url: this.$apiHost + '/Article/getlist',
|
|
|
|
|
|
+ url: this.$apiHost + "/Article/getlist",
|
|
data: {
|
|
data: {
|
|
uuid: getApp().globalData.uuid,
|
|
uuid: getApp().globalData.uuid,
|
|
skey: getApp().globalData.skey,
|
|
skey: getApp().globalData.skey,
|
|
- type: 'list', // 新闻列表
|
|
|
|
- offset: this.newsOffset
|
|
|
|
|
|
+ type: "list", // 新闻列表
|
|
|
|
+ offset: this.newsOffset,
|
|
},
|
|
},
|
|
header: {
|
|
header: {
|
|
"content-type": "application/json",
|
|
"content-type": "application/json",
|
|
- 'sign': getApp().globalData.headerSign
|
|
|
|
|
|
+ sign: getApp().globalData.headerSign,
|
|
},
|
|
},
|
|
success: (res) => {
|
|
success: (res) => {
|
|
console.log("新闻列表数据:", res.data);
|
|
console.log("新闻列表数据:", res.data);
|
|
- if (res.data.success == 'yes' && res.data.list && res.data.list.length > 0) {
|
|
|
|
|
|
+ if (
|
|
|
|
+ res.data.success == "yes" &&
|
|
|
|
+ res.data.list &&
|
|
|
|
+ res.data.list.length > 0
|
|
|
|
+ ) {
|
|
this.newsList = [...this.newsList, ...res.data.list];
|
|
this.newsList = [...this.newsList, ...res.data.list];
|
|
this.newsOffset += res.data.list.length;
|
|
this.newsOffset += res.data.list.length;
|
|
|
|
|
|
@@ -629,7 +691,7 @@
|
|
if (this.$refs.paging) {
|
|
if (this.$refs.paging) {
|
|
this.$refs.paging.complete(false);
|
|
this.$refs.paging.complete(false);
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ },
|
|
});
|
|
});
|
|
},
|
|
},
|
|
loadMoreData() {
|
|
loadMoreData() {
|
|
@@ -655,7 +717,16 @@
|
|
handleTopicPageChange(e) {
|
|
handleTopicPageChange(e) {
|
|
this.currentTopicPage = e.detail.current;
|
|
this.currentTopicPage = e.detail.current;
|
|
},
|
|
},
|
|
|
|
+
|
|
formatItem(item) {
|
|
formatItem(item) {
|
|
|
|
+
|
|
|
|
+ this.downloadAndProcessImage(item.images)
|
|
|
|
+ .then((color) => {
|
|
|
|
+ console.log(`平均颜色: R=${color.r}, G=${color.g}, B=${color.b}`);
|
|
|
|
+ })
|
|
|
|
+ .catch((error) => {
|
|
|
|
+ console.error("获取图像失败:", error);
|
|
|
|
+ });
|
|
// 处理接口返回的数据,使其适配card组件
|
|
// 处理接口返回的数据,使其适配card组件
|
|
return {
|
|
return {
|
|
id: item.id,
|
|
id: item.id,
|
|
@@ -666,51 +737,104 @@
|
|
image: item.images || item.img_url || item.image, // 优先使用images字段
|
|
image: item.images || item.img_url || item.image, // 优先使用images字段
|
|
w: item.width,
|
|
w: item.width,
|
|
h: item.height,
|
|
h: item.height,
|
|
- title: item.title || '',
|
|
|
|
- desc: item.desc || ''
|
|
|
|
- }
|
|
|
|
|
|
+ title: item.title || "",
|
|
|
|
+ desc: item.desc || "",
|
|
|
|
+ backgroundColor: "#f6f6f6",
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ downloadAndProcessImage(imageUrl, width = 10, height = 10) {
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
+ uni.downloadFile({
|
|
|
|
+ url: imageUrl,
|
|
|
|
+ success: (downloadResult) => {
|
|
|
|
+ if (downloadResult.statusCode === 200) {
|
|
|
|
+ const tempFilePath = downloadResult.tempFilePath;
|
|
|
|
+ const ctx = uni.createCanvasContext('myCanvas', this);
|
|
|
|
+ ctx.drawImage(tempFilePath, 0, 0, width, height);
|
|
|
|
+ ctx.draw(false, () => {
|
|
|
|
+ uni.canvasGetImageData({
|
|
|
|
+ canvasId: 'myCanvas',
|
|
|
|
+ x: 0,
|
|
|
|
+ y: 0,
|
|
|
|
+ width: width,
|
|
|
|
+ height: height,
|
|
|
|
+ success: (res) => {
|
|
|
|
+ const data = res.data;
|
|
|
|
+ let r = 0,
|
|
|
|
+ g = 0,
|
|
|
|
+ b = 0;
|
|
|
|
+ for (let i = 0; i < data.length; i +=
|
|
|
|
+ 4) {
|
|
|
|
+ r += data[i];
|
|
|
|
+ g += data[i + 1];
|
|
|
|
+ b += data[i + 2];
|
|
|
|
+ }
|
|
|
|
+ const count = width * height;
|
|
|
|
+ r = Math.floor(r / count);
|
|
|
|
+ g = Math.floor(g / count);
|
|
|
|
+ b = Math.floor(b / count);
|
|
|
|
+ resolve({
|
|
|
|
+ r,
|
|
|
|
+ g,
|
|
|
|
+ b
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ fail: (err) => {
|
|
|
|
+ reject(err);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ reject(new Error('下载图像失败'));
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ fail: (err) => {
|
|
|
|
+ reject(err);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
},
|
|
},
|
|
goToArticleDetail(id) {
|
|
goToArticleDetail(id) {
|
|
if (!id) {
|
|
if (!id) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
- title: '文章ID不存在',
|
|
|
|
- icon: 'none'
|
|
|
|
|
|
+ title: "文章ID不存在",
|
|
|
|
+ icon: "none",
|
|
});
|
|
});
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- uni.$emit('check_login', () => {
|
|
|
|
|
|
+ uni.$emit("check_login", () => {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url: '/pages/index/articleDetail?id=' + id
|
|
|
|
|
|
+ url: "/pages/index/articleDetail?id=" + id,
|
|
});
|
|
});
|
|
- })
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
goWork(item) {
|
|
goWork(item) {
|
|
console.log("skeylogin", "xxx");
|
|
console.log("skeylogin", "xxx");
|
|
- uni.$emit('check_login', () => {
|
|
|
|
|
|
+ uni.$emit("check_login", () => {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url: '/pages/index/workDetail?id=' + item.id
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
|
|
+ url: "/pages/index/workDetail?id=" + item.id,
|
|
|
|
+ });
|
|
|
|
+ });
|
|
},
|
|
},
|
|
goToMake() {
|
|
goToMake() {
|
|
console.log("skeylogin", "xxx2");
|
|
console.log("skeylogin", "xxx2");
|
|
- uni.$emit('check_login', () => {
|
|
|
|
|
|
+ uni.$emit("check_login", () => {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url: '/pages/make/make'
|
|
|
|
|
|
+ url: "/pages/make/make",
|
|
});
|
|
});
|
|
- })
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
goPage(page) {
|
|
goPage(page) {
|
|
- uni.$emit('check_login', () => {
|
|
|
|
|
|
+ uni.$emit("check_login", () => {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url: page
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ url: page,
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ };
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
- @import 'index.scss';
|
|
|
|
|
|
+ @import "index.scss";
|
|
</style>
|
|
</style>
|