index.vue 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383
  1. <template>
  2. <view :data-theme="theme" class="discover_index">
  3. <view class="page_con" :style="{height: windowHeight + 'px'}">
  4. <view class="discover-header relative z-999">
  5. <!-- #ifdef APP || MP -->
  6. <view class="mp-header" :style="{ height: navH + 'rpx'}">
  7. <view class="sys-head" :style="{ height: sysHeight+'px' }"></view>
  8. <view class="select_nav flex justify-center align-center" id="home" :style="{top: sysHeight+6+'px'}">
  9. <text class="iconfont icon-fanhui2 px-20" @tap="returns"></text>
  10. <image @click="goUser" class="avatar" :src="userInfo.avatar ? userInfo.avatar : urlDomain+'crmebimage/presets/morenT.png'">
  11. </image>
  12. <!-- <text class="iconfont icon-gengduo5 px-20" @tap.stop="showNav"></text> -->
  13. <text class="nav_line"></text>
  14. </view>
  15. <view class="nav_title" :style="{ height: '80rpx',lineHeight: '80rpx', color: '#fff'}">
  16. 表白墙
  17. </view>
  18. </view>
  19. <!-- #endif -->
  20. <view class="discover-navTab acea-row row-middle bg--w111-fff" style="margin: 4rpx 0;">
  21. <view class="acea-row row-center-wrapper" :style="[textBoxStyle]">
  22. <view style="margin-right: 52rpx;" :class="tabActive == 0 ? 'on' : ''" class="nav-item" @click="tabActive=0;showCateDrawer = false">本校</view>
  23. <view :class="tabActive == 1 ? 'on' : ''" class="nav-item pb-10" @click="tabActive=1;">同城</view>
  24. </view>
  25. <!-- #ifndef MP -->
  26. <view style="width: 32rpx;"></view>
  27. <!-- #endif -->
  28. </view>
  29. <!-- 话题分类 -->
  30. <view class="longTab mb-10" scroll-y enhanced>
  31. <view class="flex h-116">
  32. <view class="flex-1 h-full flex-center longTab-item" :style="{background: index === tabClick ? '#EEF4FF' : ''}"
  33. v-for="(item, index) in categoryList" :key="index" :id="'id' + index" @click.stop="selectMenu(item, index, true)">
  34. <view class="flex-col flex-center">
  35. <image class="w-44 h-44 mb-10" :src="item.icon" mode=""></image>
  36. <view class="wall-font f-s-24 f-w-500">{{item.name}}</view>
  37. </view>
  38. </view>
  39. <view class="flex-1 h-full flex-center longTab-item">
  40. <navigator hover-class='none' url='/pages/merchant/user_sgin/index' class="item">
  41. <view class="flex-col flex-center">
  42. <image class="w-44 h-44 mb-10" :src="'/static/img/ic-wall-type-4.png'" mode=""></image>
  43. <view class="wall-font f-s-24 f-w-500">签到</view>
  44. </view>
  45. </navigator>
  46. </view>
  47. </view>
  48. </view>
  49. <!-- banner轮播图 -->
  50. <view class="mb-10" v-if="bannerList.length">
  51. <swiper :indicator-dots="true" :autoplay="true" :interval="2500" :duration="500" circular="true">
  52. <block v-for="(item,index) in bannerList" :key='item.id'>
  53. <swiper-item>
  54. <view class="swiper-item">
  55. <image class="banner-img" :src="item.imageUrl" mode="scaleToFill" />
  56. </view>
  57. </swiper-item>
  58. </block>
  59. </swiper>
  60. </view>
  61. <!-- 提示 -->
  62. <view v-if="wallHeadline.length" class="flex-y-center bg--w111-fff mb-10 pl-32">
  63. <!-- 左侧固定图片 -->
  64. <text class='iconfont icon-laba ' style="font-size: 24rpx;margin-right: 20rpx;"></text>
  65. <!-- 右侧文字轮播区域 -->
  66. <view class="flex-1 h-40 mt-10" style="overflow: hidden;">
  67. <swiper class="swiper" :indicator-dots="false" circular :autoplay="true" :interval="3000" vertical>
  68. <block v-for="(item,index) in wallHeadline" :key='index'>
  69. <swiper-item catchtouchmove='catchTouchMove'>
  70. <view class='newsTitle swiper-item'>
  71. {{item.synopsis}}
  72. </view>
  73. </swiper-item>
  74. </block>
  75. </swiper>
  76. </view>
  77. </view>
  78. <scroll-view class="bg--w111-fff pt-10 pb-10 pl-32" scroll-x style="white-space: nowrap; vertical-align: middle;border-top-right-radius: 23rpx;"
  79. show-scrollbar="false">
  80. <view class='flex-y-center'>
  81. <text v-for="(item,index) in navList" :key="index" class='wall-nav' :class='active==item.id ? "wall-nav-on": ""'
  82. @click.stop="tabSelect(item.id, index)">
  83. <text>{{item.name}}</text>
  84. </text>
  85. </view>
  86. </scroll-view>
  87. </view>
  88. <view class="discover-boxsss">
  89. <!-- 发现 -->
  90. <scroll-view scroll-y="true" @scroll="followScroll" class="main h-full">
  91. <view class="tab-cont h-full" id="main">
  92. <!-- 发现 -->
  93. <view class="h-full">
  94. <swiper class="h-full" :interval="interval" indicator-color="rgba(255,255,255,0.6)" :current="swiperCurrent"
  95. @change="swiperChange">
  96. <block v-for="(item,index) in categoryList" :key="index">
  97. <swiper-item class="h-full" :item-id="`${item.id}`">
  98. <scroll-view @scroll="scrollLeft" scroll-y="true" :show-scrollbar="false" class="scroll-view h-full" id="goods"
  99. refresher-enabled="true" :refresher-threshold="100" :refresher-triggered="triggeredDiscover"
  100. @refresherrefresh="onRefreshDiscover" @refresherpulling="onPulling" @refresherrestore="onRestore"
  101. @refresherabort="onAbort">
  102. <view class="goods padbottom">
  103. <view class="goods-wrap flex-1" id="goods" v-if="discoverList[item.id] && discoverList[item.id].goods.length">
  104. <view>
  105. <WaterfallsFlow :column="true" v-if="discoverList[item.id].goods.length" :wfList="discoverList[item.id].goods"
  106. :fromType="1">
  107. </WaterfallsFlow>
  108. </view>
  109. </view>
  110. <view class='loadingicon acea-row row-center-wrapper'>
  111. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{discoverList[item.id] &&discoverList[item.id].goods.length>0?loadTitle:''}}
  112. </view>
  113. <view class="empty-boxs noContent" v-if="discoverList[item.id] && discoverList[item.id].goods.length == 0 && !loading">
  114. <emptyPage title="暂无内容~" mTop="13%" :imgSrc="urlDomain+'crmebimage/presets/noguanzhu.png'">
  115. </emptyPage>
  116. </view>
  117. <view v-if="authorList.length>0 && !loadingfollow" class="author-list mt-24">
  118. <title-box title="为你推荐"></title-box>
  119. <view v-for="(val, authorIndex) in authorList" :key="authorIndex" class="author-item" @click="goAuthor(val)">
  120. <view class="acea-row row-between row-middle mb30">
  121. <view class="acea-row row-middle">
  122. <view class="author-head">
  123. <image :src="val.authorAvatar"></image>
  124. </view>
  125. <view class="author-info">
  126. <view class="author-name">{{val.authorName}}</view>
  127. <view v-show="val.authorSignature" class="author-sign line1">
  128. {{val.authorSignature}}
  129. </view>
  130. <view class="author-fans">
  131. 粉丝<text class="text-333 ml-8">{{ val.fansNum < 10000 ? val.fansNum : (val.fansNum / 10000).toFixed(2) }}</text>
  132. </view>
  133. </view>
  134. </view>
  135. <view @click.stop="followAuthor(val, authorIndex)" class="author-follow acea-row" :class="val.isConcerned ? 'focusBtn' : ''">
  136. <text v-if="!val.isConcerned" class="iconfont icon-shangpinshuliang-jia"></text>
  137. {{!val.isConcerned ? '关注' : '已关注'}}
  138. </view>
  139. </view>
  140. <scroll-view scroll-x="true" class="white-nowrap vertical-middle w-full" show-scrollbar="false">
  141. <view class="inline-block mr-20" v-for="(items, noteIndex) in val.noteList" :key="noteIndex">
  142. <view class="relative">
  143. <easy-loadimage :image-src="items.cover" width="184rpx" height="254rpx" :radius="8"></easy-loadimage>
  144. <view class="discover_video_icon" v-show="items.type == 2">
  145. <text class="iconfont icon-24gf-play"></text>
  146. </view>
  147. </view>
  148. </view>
  149. </scroll-view>
  150. </view>
  151. <view class='loadingicon acea-row row-center-wrapper'>
  152. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{authorList.length>0?loadTitle:''}}
  153. </view>
  154. </view>
  155. <view class="footerBottoms"></view>
  156. </view>
  157. </scroll-view>
  158. </swiper-item>
  159. </block>
  160. </swiper>
  161. </view>
  162. <!-- 关注 登录后 -->
  163. <!-- <view id="goods" v-if="isLogin&&tabActive == 0" class="discover-detail h-full">
  164. <scroll-view scroll-y="true" :show-scrollbar="false" class="scroll-view recommendList h-full" id="recommendList"
  165. @scrolltolower="onTouchmoveRecommend" :refresher-threshold="100" @scroll="followScroll" refresher-enabled="true"
  166. :refresher-triggered="triggered" @refresherrefresh="onRefresh" @refresherpulling="onPulling" @refresherrestore="onRestore"
  167. @refresherabort="onAbort">
  168. <view class="goods padbottom">
  169. <view class="goods-wrap flex-1" id="goods" v-if="noteRecommendList.length">
  170. <view>
  171. <WaterfallsFlow v-if="noteRecommendList.length" :wfList="noteRecommendList" :fromType="1">
  172. </WaterfallsFlow>
  173. </view>
  174. </view>
  175. <view :hidden='loadingfollow==false' class='loadingicon acea-row row-center-wrapper'>
  176. <text class='loading iconfont icon-jiazai'></text>{{noteRecommendList.length>0?loadTitleFollow:''}}
  177. </view>
  178. <view v-if="isLogin&&tabActive == 0 && noteRecommendList.length===0 &&!loadingfollow" class="empty-boxs noContent">
  179. <emptyPage title="暂无更多内容~" mTop="0%" :imgSrc="urlDomain+'crmebimage/presets/noguanzhu.png'"></emptyPage>
  180. </view>
  181. </view>
  182. <view v-if="authorList.length>0 && !loadingfollow" class="author-list mt-24">
  183. <title-box title="为你推荐"></title-box>
  184. <view v-for="(item, index) in authorList" :key="item.authorId" class="author-item" @click="goAuthor(item)">
  185. <view class="acea-row row-between row-middle mb30">
  186. <view class="acea-row row-middle">
  187. <view class="author-head">
  188. <image :src="item.authorAvatar"></image>
  189. </view>
  190. <view class="author-info">
  191. <view class="author-name">{{item.authorName}}</view>
  192. <view v-show="item.authorSignature" class="author-sign line1">
  193. {{item.authorSignature}}
  194. </view>
  195. <view class="author-fans">
  196. 粉丝<text class="text-333 ml-8">{{ item.fansNum < 10000 ? item.fansNum : (item.fansNum / 10000).toFixed(2) }}</text>
  197. </view>
  198. </view>
  199. </view>
  200. <view @click.stop="followAuthor(item, index)" class="author-follow acea-row" :class="item.isConcerned ? 'focusBtn' : ''">
  201. <text v-if="!item.isConcerned" class="iconfont icon-shangpinshuliang-jia"></text>
  202. {{!item.isConcerned ? '关注' : '已关注'}}
  203. </view>
  204. </view>
  205. <scroll-view scroll-x="true" class="white-nowrap vertical-middle w-full" show-scrollbar="false">
  206. <view class="inline-block mr-20" v-for="items in item.noteList" :key="items.id">
  207. <view class="relative">
  208. <easy-loadimage :image-src="items.cover" width="184rpx" height="254rpx" :radius="8"></easy-loadimage>
  209. <view class="discover_video_icon" v-show="items.type == 2">
  210. <text class="iconfont icon-24gf-play"></text>
  211. </view>
  212. </view>
  213. </view>
  214. </scroll-view>
  215. </view>
  216. <view class='loadingicon acea-row row-center-wrapper'>
  217. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{authorList.length>0?loadTitle:''}}
  218. </view>
  219. </view>
  220. <view class="footerBottoms"></view>
  221. </scroll-view>
  222. </view> -->
  223. <!-- 关注未登录 -->
  224. <view class="empty-boxs" v-if="!isLogin&&tabActive == 0">
  225. <emptyPage title="登录后可查看关注用户的内容哦~" mTop="30%" :imgSrc="urlDomain+'crmebimage/presets/nodenglu.png'"></emptyPage>
  226. <view class="btn" @click="openAuto">立即登录</view>
  227. </view>
  228. </view>
  229. </scroll-view>
  230. </view>
  231. <view class="publish" @click="publish" :class="bottomNavigationIsCustom?'bottom':''">
  232. <image class="w-116 h-116" src="/static/img/ic-fatie.png" mode=""></image>
  233. </view>
  234. </view>
  235. <!-- <pageFooter v-if="isShowFooter"></pageFooter> -->
  236. <!-- 评论 -->
  237. <uni-popup type="bottom" ref="comment">
  238. <view :style="'width: '+ windowWidth +'px; background-color: #fff; border-top-left-radius: 10px; border-top-right-radius: 10px;'">
  239. <discoverComment v-if="showComment" @getReplyNum="getReplyNum" :noteId="noteDetails.id" :noteDetails="noteDetails"
  240. @close="close">
  241. </discoverComment>
  242. </view>
  243. </uni-popup>
  244. <!-- 商品列表 -->
  245. <uni-popup type="bottom" ref="goods">
  246. <mentioned v-if="popupShow" :list="proList" @close="popup" class=""></mentioned>
  247. </uni-popup>
  248. <!-- 学校 -->
  249. <uni-popup ref="schoolRef" :is-mask-click="false">
  250. <view class="w-full flex-center" :style="{height: windowHeight + 'px'}">
  251. <navigator hover-class='none' url='/pages/discover/discover_user/index'>
  252. <image src="/static/img/ic-school.png" mode="heightFix" style="height: 694rpx;width: 616rpx;"></image>
  253. </navigator>
  254. </view>
  255. </uni-popup>
  256. </view>
  257. </template>
  258. <script>
  259. import {
  260. mapGetters
  261. } from "vuex";
  262. import {
  263. toLogin
  264. } from '@/libs/login.js';
  265. import {
  266. BACK_URL
  267. } from '@/config/cache';
  268. import {
  269. communityCategoryListApi,
  270. recommendAuthorListApi,
  271. discoverListApi,
  272. followListApi,
  273. getCommunityInfo
  274. } from '@/api/discover.js';
  275. import {
  276. discoverFollowAuthor,
  277. } from '@/libs/follow.js';
  278. import {
  279. tokenIsExistApi
  280. } from '@/api/api.js';
  281. import {
  282. silenceBindingSpread,
  283. getUserSpread
  284. } from '@/utils/index.js';
  285. import onShare from "@/mixins/onShare";
  286. import discoverComment from '@/components/discoverComment/index.vue';
  287. import animationType from '@/utils/animationType.js'
  288. import pageFooter from "@/components/pageFooter/index.vue";
  289. import navBar from '@/components/navBar';
  290. import emptyPage from '@/components/emptyPage.vue';
  291. import easyLoadimage from '@/components/base/easy-loadimage.vue';
  292. import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlow.vue'
  293. import WaterfallsFlowItem from '@/components/discoverFlowItem/discoverFlowItem.vue'
  294. import discoverDetails from '@/components/discoverDetails/index.vue'
  295. import mentioned from '@/components/mentioned.vue';
  296. import TitleBox from '@/components/titleBox/index.vue';
  297. let app = getApp();
  298. let sysHeight = uni.getSystemInfoSync().statusBarHeight;
  299. export default {
  300. mixins: [onShare],
  301. components: {
  302. pageFooter,
  303. navBar,
  304. emptyPage,
  305. easyLoadimage,
  306. WaterfallsFlowItem,
  307. WaterfallsFlow,
  308. discoverDetails,
  309. discoverComment,
  310. mentioned,
  311. TitleBox
  312. },
  313. computed: {
  314. ...mapGetters(['globalData', 'isLogin', 'userInfo', 'bottomNavigationIsCustom']),
  315. headerBoxStyle() {
  316. return {
  317. // #ifndef MP
  318. paddingTop: '4rpx',
  319. // #endif
  320. // #ifdef MP
  321. paddingTop: this.marTop + "px",
  322. marginRight: this.statusWidth + this.searchRight + 'px',
  323. // #endif
  324. }
  325. },
  326. textBoxStyle() {
  327. return {
  328. // #ifdef MP
  329. width: '100%',
  330. height: this.searchHeight + 'rpx',
  331. // lineHeight: this.searchHeight + 'rpx',
  332. // #endif
  333. }
  334. }
  335. },
  336. onLoad(options) {
  337. //分销码
  338. getUserSpread(options);
  339. this.windowWidth = uni.getSystemInfoSync().screenWidth; //获取屏幕宽度
  340. tokenIsExistApi().then(res => {
  341. this.tokenIsExist = res.data;
  342. if (this.tokenIsExist && this.isLogin) {
  343. this.getFollowList();
  344. setTimeout(() => {
  345. if (this.noteRecommendList.length === 0 || this.loadendfollow) this
  346. .getRecommendAuthorList();
  347. }, 500)
  348. }
  349. if (!this.tokenIsExist) {
  350. this.$store.commit('UPDATE_LOGIN', '');
  351. this.$store.commit('UPDATE_USERINFO', {});
  352. }
  353. })
  354. this.getDiscoverList();
  355. this.getCommunityCategoryList();
  356. this._freshing = false;
  357. },
  358. data() {
  359. return {
  360. returnShow: false,
  361. urlDomain: this.$Cache.get("imgHost"),
  362. sysHeight: sysHeight,
  363. navH: '',
  364. windowWidth: 0, //获取屏幕宽度🌟💗
  365. interval: 3000,
  366. swiperHeight: 0,
  367. listMarTop: 0,
  368. tabClick: 0, //设置导航点击了哪一个
  369. tabLeft: 0, //设置下划线位置
  370. isLeft: 0, //导航栏下划线位置
  371. isWidth: 0, //每个导航栏占位
  372. tabActive: 1, // 顶部关注、发现切换
  373. windowHeight: 0,
  374. theme: app.globalData.theme,
  375. marTop: 0,
  376. categoryList: [], //分类列表
  377. categoryId: '-1', //分类id
  378. swiperCurrent: 0, //分类索引
  379. isScroll: false, //是否是滑动
  380. params: { //推荐作者
  381. page: 1,
  382. limit: 10
  383. },
  384. followParams: { //关注内容
  385. page: 1,
  386. limit: 10
  387. },
  388. noteRecommendList: [], //关注内容
  389. loadendfollow: false, //关注内容
  390. loadingfollow: false, //关注内容
  391. where: {
  392. categoryId: 0,
  393. page: 1,
  394. limit: 10
  395. },
  396. loadend: false,
  397. loading: false,
  398. loadTitle: '加载更多',
  399. loadTitleFollow: '加载更多',
  400. onnnn: {
  401. good: [{
  402. authorId: 1
  403. }]
  404. },
  405. discoverList: {}, //内容信息
  406. authorList: [], //推荐作者列表
  407. isOpenRefresh: true, // 是否开启下拉
  408. triggered: false,
  409. triggeredDiscover: false,
  410. isShow: false, //加载完成
  411. tokenIsExist: false, //校验token是否有效,true为有效,false为无效
  412. isRefresher: false, //下拉刷新状态
  413. noteDetails: {}, //内容详情
  414. popupShow: false, //商品弹窗
  415. showComment: false, //评论弹窗
  416. proList: [], //提到的商品
  417. isShowFooter: true,
  418. loadingAuthor: false, //推荐作者
  419. showCateDrawer: false, //分类下拉展示
  420. searchRight: 0,
  421. statusWidth: 0,
  422. searchHeight: 0,
  423. bannerList: [],
  424. wallHeadline: [],
  425. navList: [{
  426. id: 0,
  427. name: '默认'
  428. }, {
  429. id: 1,
  430. name: '评论'
  431. }, {
  432. id: 2,
  433. name: '点赞'
  434. }, {
  435. id: 3,
  436. name: '有图'
  437. }],
  438. active: 0,
  439. }
  440. },
  441. // 滚动监听
  442. onPageScroll(e) {
  443. // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
  444. uni.$emit('scroll');
  445. },
  446. onShow() {
  447. this.getHandInfo();
  448. // this.reFresh()
  449. this.showCateDrawer = false;
  450. this.getTokenIsExist();
  451. //分销绑定
  452. silenceBindingSpread(this.isLogin, this.globalData.spread);
  453. },
  454. mounted() {
  455. this.$nextTick(function() {
  456. const query = uni.createSelectorQuery().in(this);
  457. query.select('.discover-header').boundingClientRect(data => {
  458. // #ifndef H5
  459. this.listMarTop = data.height
  460. // #endif
  461. // #ifdef H5
  462. this.listMarTop = data.height
  463. // #endif
  464. }).exec();
  465. });
  466. },
  467. created() {
  468. var pages = getCurrentPages();
  469. this.returnShow = pages.length === 1 ? false : true;
  470. var that = this;
  471. // 获取设备宽度
  472. uni.getSystemInfo({
  473. success(e) {
  474. that.isWidth = e.windowWidth / 6;
  475. that.windowHeight = e.windowHeight;
  476. that.swiperHeight = that.windowHeight - 205
  477. that.$set(that, 'swiperHeight', that.windowHeight - 55);
  478. }
  479. });
  480. // #ifdef MP || APP-PLUS
  481. // 获取导航高度;
  482. this.navH = this.globalData.navHeight;
  483. // #endif
  484. // #ifdef H5
  485. this.navH = 80;
  486. // #endif
  487. that.getNavH()
  488. // #ifdef MP
  489. const res = uni.getMenuButtonBoundingClientRect()
  490. const jnHeight = res.height //胶囊高度
  491. const statusHeight = res.top //胶囊距离顶部
  492. const statusRight = res.right //胶囊右边界坐标
  493. this.statusWidth = res.width
  494. this.searchHeight = 96
  495. console.log('999', statusHeight, this.sysHeight);
  496. this.marTop = statusHeight - this.sysHeight
  497. //搜索框宽度计算
  498. uni.getSystemInfo({
  499. success: res => {
  500. this.searchRight = res.windowWidth - statusRight
  501. }
  502. })
  503. // #endif
  504. },
  505. //uniapp小程序用deep重写组件样式不生效
  506. options: {
  507. styleIsolation: 'shared'
  508. },
  509. methods: {
  510. returns: function() {
  511. if (this.returnShow) {
  512. uni.navigateBack(-1);
  513. } else {
  514. uni.switchTab({
  515. url: '/pages/index/index'
  516. })
  517. }
  518. },
  519. getHandInfo() {
  520. getCommunityInfo().then(res => {
  521. this.bannerList = res.data.banner
  522. this.wallHeadline = res.data.headline
  523. console.log(res.data, 111111111111111)
  524. if (!res.data.school) {
  525. // this.$refs.schoolRef.open('top')
  526. } else {
  527. this.$refs.schoolRef.close()
  528. }
  529. }).catch(err => {
  530. console.log(err)
  531. })
  532. },
  533. getNavH(marTop) {
  534. // #ifdef H5
  535. this.marTop = 30;
  536. // #endif
  537. // #ifdef APP
  538. this.marTop = marTop - 60;
  539. // #endif
  540. },
  541. getPro(item) {
  542. this.noteDetails = item;
  543. this.proList = item.productList;
  544. this.$refs.goods.open('bottom');
  545. this.popupShow = true;
  546. setTimeout(() => {
  547. if (!this.bottomNavigationIsCustom) {
  548. uni.hideTabBar();
  549. } else {
  550. this.isShowFooter = false;
  551. }
  552. }, 50)
  553. },
  554. popup() {
  555. if (!this.bottomNavigationIsCustom) {
  556. uni.showTabBar();
  557. } else {
  558. this.isShowFooter = true;
  559. }
  560. setTimeout(() => {
  561. this.$refs.goods.close();
  562. this.popupShow = false;
  563. }, 100)
  564. },
  565. close() {
  566. if (!this.bottomNavigationIsCustom) {
  567. uni.showTabBar();
  568. } else {
  569. this.isShowFooter = true;
  570. }
  571. setTimeout(() => {
  572. this.$refs.comment.close();
  573. this.showComment = false;
  574. }, 100);
  575. },
  576. getReplyNum(n) {
  577. this.noteDetails.replyNum = n;
  578. },
  579. getComment(item) {
  580. this.noteDetails = item;
  581. this.$refs.comment.open('bottom');
  582. this.showComment = true;
  583. setTimeout(() => {
  584. if (!this.bottomNavigationIsCustom) {
  585. uni.hideTabBar();
  586. } else {
  587. this.isShowFooter = false;
  588. }
  589. }, 50)
  590. },
  591. //校验token是否有效,true为有效,false为无效
  592. getTokenIsExist() {
  593. tokenIsExistApi().then(res => {
  594. this.tokenIsExist = res.data;
  595. if (!this.tokenIsExist) {
  596. this.$store.commit('UPDATE_LOGIN', '');
  597. this.$store.commit('UPDATE_USERINFO', {});
  598. }
  599. })
  600. },
  601. // 去推荐作者个人主人
  602. goAuthor(item) {
  603. // #ifdef MP || H5
  604. uni.navigateTo({
  605. url: `/pages/discover/discover_user/index?id=${item.authorId}`
  606. })
  607. // #endif
  608. // #ifdef APP-PLUS
  609. uni.navigateTo({
  610. animationType: animationType.type,
  611. animationDuration: animationType.duration,
  612. url: `/pages/discover/discover_user/index?id=${item.authorId}`
  613. })
  614. // #endif
  615. },
  616. // 自定义下拉刷新被中止
  617. onAbort() {
  618. console.error("onAbort");
  619. },
  620. onPulling(e) {
  621. if (e.detail.deltaY < 0) return // 防止上滑页面也触发下拉
  622. if (this.tabActive == 1) {
  623. this.triggeredDiscover = true;
  624. } else {
  625. this.triggered = true;
  626. }
  627. },
  628. // 下拉刷新触发
  629. refresherpullingFun() {
  630. this.isRefresher = true
  631. },
  632. onRefreshDiscover() {
  633. if (this._freshing) return;
  634. this._freshing = true;
  635. setTimeout(() => {
  636. this._freshing = false;
  637. this.discoverList = {}
  638. this.getDiscoverList();
  639. this.triggeredDiscover = false;
  640. uni.stopPullDownRefresh();
  641. this._freshing = false;
  642. }, 1000)
  643. },
  644. onRefresh() {
  645. if (this._freshing) return;
  646. this._freshing = true;
  647. setTimeout(() => {
  648. this.loadendfollow = false;
  649. this.loadend = false;
  650. this.noteRecommendList = [];
  651. this.followParams.page = 1;
  652. this.authorList = [];
  653. this.params.page = 1;
  654. this.getFollowList();
  655. setTimeout(() => {
  656. if (this.noteRecommendList.length === 0 || this.loadendfollow) this
  657. .getRecommendAuthorList();
  658. }, 400)
  659. this.triggered = false
  660. uni.stopPullDownRefresh();
  661. this._freshing = false;
  662. }, 1000)
  663. },
  664. onRestore() {
  665. this.triggeredDiscover = false;
  666. },
  667. //关注内容
  668. getFollowList() {
  669. if (this.loadendfollow) {
  670. this.triggered = false;
  671. return;
  672. }
  673. this.loadingfollow = true;
  674. followListApi(this.followParams).then(res => {
  675. this.$set(this.followParams, 'page', this.followParams.page + 1);
  676. this.loadendfollow = this.followParams.page > res.data.totalPage;
  677. this.loadTitleFollow = this.loadendfollow ? '' : '加载更多';
  678. this.noteRecommendList = this.noteRecommendList.concat(res.data.list || []);
  679. this.loadingfollow = false
  680. this.triggered = false;
  681. }).catch(err => {
  682. this.loadingfollow = false;
  683. this.triggered = false;
  684. uni.showToast({
  685. title: err,
  686. icon: 'none'
  687. })
  688. });
  689. },
  690. // 关注作者
  691. followAuthor(item) {
  692. if (this.isLogin) {
  693. discoverFollowAuthor(item.authorId).then(() => {
  694. this.$set(item, 'isConcerned', !item.isConcerned);
  695. });
  696. } else {
  697. toLogin();
  698. }
  699. },
  700. //回退页面之后重新加载页面
  701. reFresh() {
  702. this.loading = true
  703. this.discoverList = {};
  704. this.getDiscoverList();
  705. },
  706. //发布内容
  707. publish() {
  708. if (this.isLogin) {
  709. // #ifdef MP || H5
  710. uni.navigateTo({
  711. url: `/pages/discover/discover_release/index`
  712. })
  713. // #endif
  714. // #ifdef APP-PLUS
  715. uni.navigateTo({
  716. animationType: animationType.type,
  717. animationDuration: animationType.duration,
  718. url: `/pages/discover/discover_release/index`
  719. })
  720. // #endif
  721. } else {
  722. toLogin();
  723. }
  724. },
  725. /**
  726. * 发现列表滑动中用到的方法
  727. */
  728. followScroll() {
  729. uni.$emit('scroll');
  730. },
  731. onTouchmoveRecommend(e) {
  732. if (!this.loadendfollow) this.getFollowList();
  733. if (this.loadendfollow && !this.loadend) this.getRecommendAuthorList();
  734. },
  735. onTouchmove(e) {
  736. this.getDiscoverList();
  737. },
  738. scrollLeft: function(e) {
  739. uni.$emit('scroll');
  740. if (e.detail.scrollTop > e.detail.scrollHeight - 1500) {
  741. this.getDiscoverList();
  742. }
  743. this.swiperHeight = this.windowHeight - 55
  744. },
  745. swiperChange(e) {
  746. let {
  747. current,
  748. source,
  749. currentItemId
  750. } = e.detail;
  751. if (source === 'autoplay' || source === 'touch') {
  752. this.categoryId = currentItemId;
  753. this.swiperCur = current
  754. this.selectMenu(this.categoryList[this.swiperCur], this.swiperCur, false)
  755. if (this.categoryList.length > 3) {
  756. var tempIndex = this.swiperCur - 2;
  757. tempIndex = tempIndex <= 0 ? 0 : tempIndex;
  758. let tabLeft = (this.swiperCur - 2) * this.isWidth; //设置下划线位置
  759. this.$nextTick(function() {
  760. this.$set(this, 'tabLeft', tabLeft);
  761. });
  762. }
  763. }
  764. },
  765. /*******************发现列表滑动中用到的方法结束*********************/
  766. // 去个人主人
  767. goUser() {
  768. if (!this.isLogin) {
  769. this.openAuto();
  770. } else {
  771. // #ifdef MP || H5
  772. uni.navigateTo({
  773. url: '/pages/discover/discover_user/index'
  774. })
  775. // #endif
  776. // #ifdef APP-PLUS
  777. uni.navigateTo({
  778. animationType: animationType.type,
  779. animationDuration: animationType.duration,
  780. url: '/pages/discover/discover_user/index'
  781. })
  782. // #endif
  783. }
  784. },
  785. // 打开授权
  786. openAuto() {
  787. this.$Cache.set(BACK_URL, '')
  788. toLogin();
  789. },
  790. //发现列表
  791. getDiscoverList() {
  792. let that = this;
  793. this.isShow = false;
  794. if (!this.discoverList[this.categoryId]) {
  795. this.$set(this.discoverList, this.categoryId, {
  796. where: {
  797. ...this.where,
  798. categoryId: this.categoryId,
  799. secondType: this.active
  800. },
  801. goods: []
  802. })
  803. }
  804. const data = this.discoverList[this.categoryId];
  805. const cateId = this.categoryId;
  806. if (data.loading || data.loadend) {
  807. this.triggeredDiscover = false;
  808. return
  809. };
  810. data.loading = true
  811. this.loading = true
  812. this.loadTitle = '';
  813. if (data.where.categoryId === 0) data.where.categoryId = ''
  814. discoverListApi(data.where).then(res => {
  815. data.loadend = res.data.list.length < that.where.limit;
  816. if (data.where.page == 1) {
  817. data.goods = [];
  818. }
  819. this.loadTitle = data.loadend ? '没有了' : '加载更多';
  820. data.goods.push.apply(data.goods, res.data.list);
  821. data.where.page = data.where.page + 1;
  822. that.$nextTick(() => {
  823. that.$set(that.discoverList, cateId, {
  824. ...data
  825. });
  826. });
  827. data.loading = false;
  828. this.loading = false;
  829. this.triggeredDiscover = false;
  830. this.$forceUpdate()
  831. console.log(that.discoverList)
  832. }).catch(err => {
  833. data.loading = false;
  834. this.loading = false;
  835. uni.showToast({
  836. title: err,
  837. icon: 'none'
  838. })
  839. this.$set(this.discoverList, cateId, data);
  840. });
  841. },
  842. //推荐作者列表
  843. getRecommendAuthorList() {
  844. if (this.loadend) return;
  845. this.loading = true
  846. recommendAuthorListApi(this.params).then(res => {
  847. this.$set(this.params, 'page', this.params.page + 1);
  848. this.loadend = this.params.page > res.data.totalPage;
  849. this.authorList = this.authorList.concat(res.data.list || []);
  850. this.loadTitle = this.loadend ? '没有了' : '加载更多';
  851. this.loading = false
  852. })
  853. },
  854. //分类列表
  855. getCommunityCategoryList() {
  856. let data = [{
  857. name: "全部",
  858. id: '-1',
  859. icon: '/static/img/ic-wall-type--1.png'
  860. }];
  861. communityCategoryListApi().then(res => {
  862. this.categoryList = Array.from(new Set([...data, ...res.data]));
  863. })
  864. },
  865. // 点击列表头部
  866. selectMenu(item, index, isScroll) {
  867. if (this.tabClick == index) return
  868. this.active = 0
  869. this.triggeredDiscover = false;
  870. this.categoryId = item.id;
  871. this.swiperCurrent = index;
  872. this.isScroll = isScroll;
  873. this.tabClick = index; //设置导航点击了哪一个
  874. this.isLeft = index * this.isWidth; //设置下划线位置
  875. this.where.categoryId = item.id;
  876. this.showCateDrawer = false
  877. this.getDiscoverList();
  878. },
  879. tabSelect(active, e) {
  880. if (this.active == active) return
  881. this.active = active;
  882. this.triggeredDiscover = false;
  883. this.discoverList[this.categoryId].loading = false
  884. this.discoverList[this.categoryId].loadend = false
  885. this.discoverList[this.categoryId].where.page = 1
  886. this.discoverList[this.categoryId].where.secondType = active
  887. this.getDiscoverList();
  888. },
  889. }
  890. }
  891. </script>
  892. <style lang="scss" scoped>
  893. /deep/.wf-page {
  894. background-color: #fff !important;
  895. }
  896. .discover_video_icon {
  897. top: 50% !important;
  898. left: 50% !important;
  899. right: 0 !important;
  900. -webkit-transform: translate(-50%, -50%);
  901. transform: translate(-50%, -50%);
  902. }
  903. .mp-header {
  904. background-color: $bg-color-primary;
  905. }
  906. .select_nav {
  907. width: 170rpx !important;
  908. height: 60rpx !important;
  909. border-radius: 33rpx;
  910. // background: rgba(255, 255, 255, 0.6);
  911. // border: 1rpx solid rgba(0, 0, 0, 0.1);
  912. color: #000;
  913. position: fixed;
  914. font-size: 18px;
  915. line-height: 58rpx;
  916. z-index: 1000;
  917. left: 14rpx;
  918. }
  919. .nav_title {
  920. // width: 200rpx;
  921. color: #fff;
  922. font-size: 36rpx;
  923. position: fixed;
  924. text-align: center;
  925. left: 0;
  926. right: 0;
  927. margin: auto;
  928. }
  929. .banner-img {
  930. width: 100%;
  931. height: 100%;
  932. }
  933. .newsTitle {
  934. font-weight: 400;
  935. font-size: 21rpx;
  936. color: #646464;
  937. }
  938. .active-topic {
  939. @include main_color(theme);
  940. @include coupons_light_color(theme);
  941. @include coupons_border_color(theme);
  942. }
  943. .padbottom {
  944. /* #ifndef H5 */
  945. padding-bottom: calc(100rpx+ constant(safe-area-inset-bottom)) !important; ///兼容 IOS<11.2/
  946. padding-bottom: calc(100rpx + env(safe-area-inset-bottom)) !important;
  947. /* #endif */
  948. }
  949. .bottom {
  950. bottom: 218rpx !important;
  951. }
  952. .footerBottoms {
  953. width: 100%;
  954. /* #ifndef H5 */
  955. height: calc(200rpx+ constant(safe-area-inset-bottom)) !important; ///兼容 IOS<11.2/
  956. height: calc(200rpx + env(safe-area-inset-bottom)) !important;
  957. /* #endif */
  958. /* #ifdef H5 */
  959. height: calc(100rpx+ constant(safe-area-inset-bottom)) !important; ///兼容 IOS<11.2/
  960. height: calc(100rpx + env(safe-area-inset-bottom)) !important;
  961. /* #endif */
  962. }
  963. .discover_index {
  964. /deep/.no-border {
  965. bottom: 40rpx;
  966. }
  967. /deep/.author-list {
  968. padding-left: 24rpx;
  969. padding-right: 24rpx;
  970. }
  971. }
  972. .menu {
  973. // padding: 20rpx 34rpx 0 34rpx;
  974. // box-sizing: border-box;
  975. width: 100%;
  976. }
  977. .page_con {
  978. // position: fixed;
  979. top: 0;
  980. right: 0;
  981. bottom: 0;
  982. left: 0;
  983. display: flex;
  984. flex-direction: column;
  985. }
  986. .empty-boxs {
  987. margin: auto;
  988. }
  989. .goods {
  990. display: flex;
  991. flex-direction: column;
  992. justify-content: space-between;
  993. padding: 24rpx 24rpx 0 24rpx;
  994. background: #ffffff;
  995. }
  996. .publish {
  997. position: fixed;
  998. z-index: 999;
  999. width: 100rpx;
  1000. height: 100rpx;
  1001. opacity: 1;
  1002. border-radius: 50%;
  1003. bottom: 142rpx;
  1004. right: 24rpx;
  1005. color: #fff;
  1006. line-height: 100rpx;
  1007. text-align: center;
  1008. @include linear-gradient(theme);
  1009. .iconfont {
  1010. font-size: 50rpx;
  1011. }
  1012. }
  1013. .main {
  1014. width: 100%;
  1015. }
  1016. .author {
  1017. &-item {
  1018. padding-bottom: 40rpx;
  1019. }
  1020. &-title {
  1021. height: 120rpx;
  1022. line-height: 120rpx;
  1023. font-size: 32rpx;
  1024. color: #333333;
  1025. .iconfont {
  1026. font-size: 170rpx;
  1027. color: #454545;
  1028. }
  1029. .lefticon {
  1030. transform: rotate(180deg);
  1031. }
  1032. }
  1033. .name {
  1034. margin: 0 28rpx;
  1035. }
  1036. &-head {
  1037. width: 80rpx;
  1038. height: 80rpx;
  1039. border-radius: 50%;
  1040. overflow: hidden;
  1041. image {
  1042. width: 100%;
  1043. height: 100%;
  1044. }
  1045. margin-right: 20rpx;
  1046. }
  1047. &-name {
  1048. font-size: 28rpx;
  1049. font-family: PingFang SC-Medium, PingFang SC;
  1050. font-weight: 600;
  1051. color: #282828;
  1052. }
  1053. &-sign,
  1054. &-fans {
  1055. font-size: 22rpx;
  1056. font-family: PingFang SC-Regular, PingFang SC;
  1057. font-weight: 400;
  1058. color: #999999;
  1059. }
  1060. &-sign {
  1061. width: 370rpx;
  1062. }
  1063. &-pictrue {
  1064. width: 222rpx;
  1065. height: 222rpx;
  1066. border-radius: 10px 10px 10px 10px;
  1067. opacity: 1;
  1068. margin-right: 18rpx;
  1069. /deep/image,
  1070. /deep/.easy-loadimage,
  1071. uni-image {
  1072. width: 100%;
  1073. height: 100%;
  1074. border-radius: 10px 10px 10px 10px;
  1075. overflow: hidden;
  1076. }
  1077. }
  1078. &-pictrue:nth-of-type(3n) {
  1079. margin-right: 0;
  1080. }
  1081. }
  1082. .noContent {
  1083. /deep/.empty-box {
  1084. padding-top: 80rpx !important;
  1085. }
  1086. }
  1087. .btn {
  1088. width: 440rpx;
  1089. height: 86rpx;
  1090. line-height: 86rpx;
  1091. text-align: center;
  1092. border-radius: 43rpx 43rpx 43rpx 43rpx;
  1093. opacity: 1;
  1094. border: 1px solid #E93323;
  1095. font-size: 32rpx;
  1096. margin: auto;
  1097. font-family: PingFang SC-Medium, PingFang SC;
  1098. @include main_color(theme);
  1099. @include coupons_border_color(theme);
  1100. font-weight: 600;
  1101. }
  1102. .cart_nav {
  1103. /deep/.nav_title {
  1104. font-size: 36rpx;
  1105. color: #333333;
  1106. }
  1107. }
  1108. .discover {
  1109. &-header {
  1110. background-size: cover;
  1111. top: 0;
  1112. left: 0;
  1113. .title {
  1114. font-size: 36rpx;
  1115. color: #333333;
  1116. }
  1117. }
  1118. &-navTab {
  1119. padding: 0 34rpx 0 34rpx;
  1120. justify-content: space-between;
  1121. .icon-xiazai5 {
  1122. color: #333;
  1123. }
  1124. .nav-item {
  1125. display: inline-block;
  1126. font-weight: 500;
  1127. font-size: 31rpx;
  1128. color: #B2B2B2;
  1129. &.on {
  1130. font-weight: 600;
  1131. font-size: 35rpx;
  1132. color: #141414;
  1133. border-bottom: 5rpx solid;
  1134. border-image: linear-gradient(90deg, #FFCA5F 0%, #FF1B95 100%);
  1135. border-image-slice: 1;
  1136. }
  1137. }
  1138. .release_btn {
  1139. width: 58rpx;
  1140. height: 58rpx;
  1141. border-radius: 100%;
  1142. background-image: linear-gradient(126deg, var(--view-bntColor21) 0%, var(--view-bntColor22) 100%);
  1143. color: #fff;
  1144. position: absolute;
  1145. top: 20rpx;
  1146. left: 0;
  1147. .iconfont {
  1148. font-size: 28rpx;
  1149. }
  1150. }
  1151. }
  1152. &-box {
  1153. flex: 1;
  1154. min-height: 83vh;
  1155. height: auto;
  1156. width: 100%;
  1157. background-color: #fff;
  1158. left: 0;
  1159. }
  1160. }
  1161. .avatar {
  1162. width: 64rpx;
  1163. height: 64rpx;
  1164. border-radius: 50%;
  1165. }
  1166. .h96 {
  1167. height: 96rpx;
  1168. }
  1169. .h36 {
  1170. /* #ifdef H5 */
  1171. height: 28rpx;
  1172. /* #endif */
  1173. /* #ifndef H5 */
  1174. height: 18rpx;
  1175. /* #endif */
  1176. }
  1177. .longTab {
  1178. width: 100%;
  1179. background: #fff;
  1180. border-radius: 16rpx 16rpx 0 0;
  1181. .longTab-item {
  1182. /*解决ios上滑动不流畅*/
  1183. -webkit-overflow-scrolling: touch;
  1184. position: relative;
  1185. }
  1186. .longItem {
  1187. height: 50upx;
  1188. display: inline-block;
  1189. text-align: center;
  1190. font-size: 30rpx;
  1191. color: #999999;
  1192. // margin-right: 56rpx;
  1193. text {
  1194. display: block;
  1195. max-width: 326rpx;
  1196. white-space: nowrap;
  1197. overflow: hidden;
  1198. text-overflow: ellipsis;
  1199. }
  1200. &:last-child {
  1201. margin-right: 0;
  1202. }
  1203. /*解决ios上滑动不流畅*/
  1204. -webkit-overflow-scrolling: touch;
  1205. position: relative;
  1206. &.click {
  1207. background: #EEF4FF;
  1208. // font-weight: bold;
  1209. // font-size: 34rpx;
  1210. // @include main_color(theme);
  1211. // &::after {
  1212. // content: "";
  1213. // display: block;
  1214. // width: 40rpx;
  1215. // height: 5rpx;
  1216. // @include main_bg_color(theme);
  1217. // display: flex;
  1218. // position: absolute;
  1219. // left: 50%;
  1220. // margin-left: -22rpx;
  1221. // bottom: -8rpx;
  1222. // }
  1223. // .underline {
  1224. // opacity: 1;
  1225. // }
  1226. }
  1227. }
  1228. .underlineBox {
  1229. height: 3px;
  1230. width: 20%;
  1231. display: flex;
  1232. align-content: center;
  1233. justify-content: center;
  1234. .underline {
  1235. opacity: 0;
  1236. width: 60rpx;
  1237. height: 4rpx;
  1238. background-color: #e93323;
  1239. }
  1240. }
  1241. }
  1242. .author-fans {
  1243. font-size: 24rpx !important;
  1244. }
  1245. .container {
  1246. overflow: hidden;
  1247. /* 隐藏超出部分 */
  1248. }
  1249. .swiper {
  1250. display: flex;
  1251. /* 使用flex布局 */
  1252. animation: scrollRight 10s linear infinite;
  1253. /* 应用动画 */
  1254. }
  1255. .swiper-item {
  1256. flex-shrink: 0;
  1257. /* 不允许缩小 */
  1258. width: 100%;
  1259. /* 每个item占满一行 */
  1260. height: 100%;
  1261. }
  1262. @keyframes scrollRight {
  1263. from {
  1264. transform: translateX(100%);
  1265. }
  1266. /* 从右向左移动 */
  1267. to {
  1268. transform: translateX(-100%);
  1269. }
  1270. /* 移出视图 */
  1271. }
  1272. .wall-nav {
  1273. font-weight: 500;
  1274. font-size: 23rpx;
  1275. color: #999999;
  1276. }
  1277. .wall-nav~.wall-nav {
  1278. margin-left: 38rpx;
  1279. }
  1280. .wall-nav-on {
  1281. font-weight: 600;
  1282. font-size: 27rpx;
  1283. color: #141414;
  1284. }
  1285. .discover-boxsss {
  1286. background-color: #fff;
  1287. width: 100%;
  1288. flex: 1;
  1289. }
  1290. </style>