Search.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847
  1. <template>
  2. <view class="search-container">
  3. <!-- 搜索框 -->
  4. <view class="search-header">
  5. <view class="cancel-btn" @click="goBack">
  6. <uni-icons type="left" size="22" color="#1F1F1F"></uni-icons>
  7. </view>
  8. <view class="search-box">
  9. <!-- <uni-icons type="search" size="16" color="#999"></uni-icons> -->
  10. <input type="text" v-model="searchKeyword" placeholder="请输入关键词" confirm-type="search" @confirm="handleSearch"
  11. @input="handleInput" />
  12. <uni-icons v-if="searchKeyword" type="clear" size="16" color="#999" @click="clearKeyword"></uni-icons>
  13. <view class="searchImgBox" @click="handleSearch">
  14. <image class="image" src="@/static/home/sy_icon_sousuo.png"></image>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="reserveASeat"></view>
  19. <!-- 搜索历史 -->
  20. <view class="search-history" v-if="searchStatus && historyList.length > 0">
  21. <view class="history-header">
  22. <text class="title">搜索历史</text>
  23. <uni-icons type="trash" size="17" color="#999" @click="clearHistory"></uni-icons>
  24. </view>
  25. <view class="history-list">
  26. <view class="history-item" v-for="(item, index) in displayedHistoryList" :key="index"
  27. @click="useHistoryKeyword(item)">
  28. <view>
  29. <uni-icons type="clock" size="14" color="#999"></uni-icons>
  30. <view class="history-text">
  31. <image src="@/static/home/sy_icon_lishijilu.png"></image> {{ item }}
  32. </view>
  33. </view>
  34. <image class="deleteBtn" @click.stop="deleteHistoryItem(item)" src="@/static/icon/close.png"></image>
  35. </view>
  36. <view class="expandBtn" @click="toggleHistory">
  37. <view v-if="!isExpanded">
  38. 查看全部
  39. <image src="@/static/home/sy_icon_chakanquanbu.png"></image>
  40. </view>
  41. <view v-else class="fold">
  42. 折叠历史记录
  43. <image src="@/static/home/sy_icon_chakanquanbu.png"></image>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <!-- 搜索结果 -->
  49. <view class="search-result" v-if="searchKeyword && !searchStatus">
  50. <!-- <view class="search-result"> -->
  51. <!-- 这里添加搜索结果的展示逻辑 -->
  52. <view>
  53. <view class="tab-nav">
  54. <view v-for="(tab, index) in ['作品', '作者']" :key="index"
  55. :class="['tab-item', currentTab === index ? 'active' : '']" @click="switchTab(index)">
  56. {{ tab }}
  57. <view class="indicator-triangle">
  58. </view>
  59. </view>
  60. </view>
  61. <!-- 关注列表 - 类似my.vue -->
  62. <view v-show="currentTab === 0" class="follow-list">
  63. <block v-if="followList.length > 0">
  64. <w-waterfall :data="followList">
  65. <template v-slot:content="{ item, width }">
  66. <card :item="formatItem(item)" findType="search" :width="width" :custom-style="{ background: '#fff' }" textColor="#000">
  67. </card>
  68. </template>
  69. </w-waterfall>
  70. </block>
  71. <view class="no-data" v-else-if="!isLoadingFollow">
  72. <text>暂无作品数据</text>
  73. </view>
  74. </view>
  75. <view v-show="currentTab === 1" class="follow-list">
  76. <block v-if="recommendList.length > 0">
  77. <view class="follow-item" v-for="(item, index) in recommendList" :key="index" @click="goToUserHomepage(item.id)">
  78. <CircleAvatar @click="goToUserHomepage(item.user_id)" class="avator" :src="item.avator"></CircleAvatar>
  79. <view class="info">
  80. <view class="top-box" @click="goToUserHomepage(item.user_id)">
  81. <view class="name one-omit">{{ item.nickname }}</view>
  82. <image src="../../static/icon/wd_icon_nan.png" mode="widthFix" v-if="item.sex_id == 1" />
  83. <image src="../../static/icon/wd_icon_nv.png" mode="widthFix" v-else-if="item.sex_id == 2" />
  84. <view class="level">Lv{{ item.level }}</view>
  85. </view>
  86. <!-- <view class="desc">{{ item.description }}</view> -->
  87. </view>
  88. <view :class="item.is_attention ? 'unfollow-btn active' : 'unfollow-btn'" @click="toggleFollow(item)">
  89. <image src="../../static/me/wd_icon_guanzhu.png"></image>
  90. {{ item.is_attention == 0 ? '取消关注' : '关注' }}
  91. </view>
  92. </view>
  93. </block>
  94. <view class="no-data" v-else-if="!isLoadingFollow">
  95. <text>暂无作者数据</text>
  96. </view>
  97. </view>
  98. <!-- avator: "http://e.yujianmate.com/images/avator/b1.jpg"
  99. is_attention: 0
  100. level: 0
  101. nickname: "刘畅"
  102. sex_id: 2 -->
  103. </view>
  104. </view>
  105. <DialogBox ref="DialogBox"></DialogBox>
  106. </view>
  107. </template>
  108. <script>
  109. const HISTORY_KEY = 'search_history';
  110. const MAX_HISTORY = 20;
  111. export default {
  112. data() {
  113. return {
  114. searchKeyword: '', // 搜索关键词
  115. historyList: [], // 搜索历史
  116. searchResult: [], // 搜索结果
  117. primaryHistoryList: [],
  118. isExpanded: false, // 添加展开/折叠状态变量
  119. currentTab: 0, // 当前激活的标签页
  120. followList: [], // 关注列表数据
  121. followOffset: 0, // 关注列表偏移量
  122. hasMoreFollow: true, // 是否有更多关注列表数据
  123. recommendList: [], // 推荐列表数据
  124. recommendOffset: 0, // 推荐列表偏移量
  125. hasMoreRecommend: true, // 是否有更多推荐列表数据
  126. isLoadingFollow: false, // 是否正在加载关注列表
  127. isLoadingRecommend: false, // 是否正在加载推荐列表
  128. searchStatus: true,//显示搜索历史 false显示搜索结果
  129. }
  130. },
  131. onLoad() {
  132. // 加载历史记录
  133. this.loadHistory();
  134. },
  135. onReachBottom() {
  136. // 触底加载更多数据
  137. if (!(hasMoreFollow || hasMoreRecommend)) {
  138. switch (this.currentTab) {
  139. case 0:
  140. this.loadFollowList();
  141. break;
  142. case 1:
  143. this.loadRecommendList();
  144. break;
  145. }
  146. } else {
  147. uni.hideToast();
  148. uni.showToast({
  149. title:'没有更多数据了',
  150. icon: 'none'
  151. });
  152. return;
  153. }
  154. },
  155. computed: {
  156. // 添加计算属性以控制显示的历史记录数量
  157. displayedHistoryList() {
  158. return this.isExpanded ? this.historyList : this.historyList.slice(0, 5);
  159. }
  160. },
  161. methods: {
  162. // 加载历史记录
  163. loadHistory() {
  164. try {
  165. const history = uni.getStorageSync(HISTORY_KEY);
  166. this.historyList = history ? JSON.parse(history) : [];
  167. } catch (e) {
  168. console.error('Failed to load search history:', e);
  169. this.historyList = [];
  170. }
  171. // this.primaryHistoryList = JSON.parse(JSON.stringify(this.historyList));
  172. },
  173. // 保存历史记录
  174. saveHistory() {
  175. try {
  176. // 将当前搜索词添加到历史记录开头
  177. if (this.searchKeyword && !this.historyList.includes(this.searchKeyword)) {
  178. console.log(this.historyList, 11111);
  179. this.historyList.unshift(this.searchKeyword);
  180. console.log(this.historyList, 11111);
  181. // 限制历史记录数量
  182. if (this.historyList.length > MAX_HISTORY) {
  183. this.historyList = this.historyList.slice(0, MAX_HISTORY);
  184. }
  185. uni.setStorageSync(HISTORY_KEY, JSON.stringify(this.historyList));
  186. }
  187. } catch (e) {
  188. console.error('Failed to save search history:', e);
  189. }
  190. },
  191. // 清空历史记录
  192. clearHistory() {
  193. uni.showModal({
  194. title: '提示',
  195. content: '确定要清空搜索历史吗?',
  196. success: (res) => {
  197. if (res.confirm) {
  198. this.historyList = [];
  199. uni.setStorageSync(HISTORY_KEY, '[]');
  200. }
  201. }
  202. });
  203. },
  204. // 清空单个历史记录
  205. deleteHistoryItem(item) {
  206. console.log(item, '删除历史记录');
  207. this.$refs['DialogBox'].confirm({
  208. title: '提示',
  209. content: '确定要删除搜索历史吗?',
  210. DialogType: 'inquiry',
  211. btn1: '否',
  212. btn2: '是',
  213. animation: 0
  214. }).then((res) => {
  215. if (res.isConfirm) {
  216. const index = this.historyList.indexOf(item);
  217. if (index !== -1) {
  218. this.historyList.splice(index, 1);
  219. }
  220. uni.setStorageSync(HISTORY_KEY, JSON.stringify(this.historyList));
  221. }
  222. })
  223. },
  224. // 使用历史记录中的关键词
  225. useHistoryKeyword(keyword) {
  226. this.searchKeyword = keyword;
  227. this.handleSearch();
  228. },
  229. // 处理搜索
  230. handleSearch() {
  231. if (!this.searchKeyword.trim()) return;
  232. // 保存到历史记录
  233. this.saveHistory();
  234. this.searchStatus = false;
  235. // this.loadHistory()
  236. // TODO: 实现搜索逻辑
  237. console.log('Searching for:', this.searchKeyword);
  238. this.queryList()
  239. },
  240. // 清空搜索框
  241. clearKeyword() {
  242. this.searchKeyword = '';
  243. },
  244. // 处理输入
  245. handleInput(e) {
  246. this.searchKeyword = e.detail.value;
  247. // this.historyList = this.primaryHistoryList.filter(item => {
  248. // if (item.includes(e.detail.value)) {
  249. // return item;
  250. // }
  251. // })
  252. if (this.searchKeyword.trim() == '') {
  253. this.searchStatus = true;
  254. }
  255. console.log(this.historyList, e.detail.value);
  256. },
  257. // 返回上一页
  258. goBack() {
  259. uni.navigateBack();
  260. },
  261. // 添加展开/折叠方法
  262. toggleHistory() {
  263. this.isExpanded = !this.isExpanded;
  264. },
  265. switchTab(index) {
  266. this.currentTab = index;
  267. this.searchRequest(index);
  268. this.queryList()
  269. },
  270. formatItem(item) {
  271. this.downloadAndProcessImage(item.images)
  272. .then((color) => {
  273. console.log(`平均颜色: R=${color.r}, G=${color.g}, B=${color.b}`);
  274. })
  275. .catch((error) => {
  276. console.error("获取图像失败:", error);
  277. });
  278. // 处理接口返回的数据,使其适配card组件
  279. return {
  280. id: item.id,
  281. allowEdit: false,
  282. nickname: item.nickname,
  283. avator: item.avator,
  284. num_like: item.num_like,
  285. num_view: item.num_view,
  286. image: item.images || item.img_url || item.image, // 优先使用images字段
  287. w: item.width,
  288. h: item.height,
  289. title: item.title || "",
  290. desc: item.desc || "",
  291. backgroundColor: "#f6f6f6",
  292. };
  293. },
  294. downloadAndProcessImage(imageUrl, width = 10, height = 10) {
  295. return new Promise((resolve, reject) => {
  296. uni.downloadFile({
  297. url: imageUrl,
  298. success: (downloadResult) => {
  299. if (downloadResult.statusCode === 200) {
  300. const tempFilePath = downloadResult.tempFilePath;
  301. const ctx = uni.createCanvasContext('myCanvas', this);
  302. ctx.drawImage(tempFilePath, 0, 0, width, height);
  303. ctx.draw(false, () => {
  304. uni.canvasGetImageData({
  305. canvasId: 'myCanvas',
  306. x: 0,
  307. y: 0,
  308. width: width,
  309. height: height,
  310. success: (res) => {
  311. const data = res.data;
  312. let r = 0,
  313. g = 0,
  314. b = 0;
  315. for (let i = 0; i < data.length; i +=
  316. 4) {
  317. r += data[i];
  318. g += data[i + 1];
  319. b += data[i + 2];
  320. }
  321. const count = width * height;
  322. r = Math.floor(r / count);
  323. g = Math.floor(g / count);
  324. b = Math.floor(b / count);
  325. resolve({
  326. r,
  327. g,
  328. b
  329. });
  330. },
  331. fail: (err) => {
  332. reject(err);
  333. }
  334. });
  335. });
  336. } else {
  337. reject(new Error('下载图像失败'));
  338. }
  339. },
  340. fail: (err) => {
  341. reject(err);
  342. }
  343. });
  344. });
  345. },
  346. queryList() {
  347. // 根据当前标签刷新数据
  348. switch (this.currentTab) {
  349. case 0:
  350. // 重置作品列表
  351. this.followList = [];
  352. this.followOffset = 0;
  353. this.hasMoreFollow = true;
  354. // this.loadFollowList();
  355. this.loadFollowList();
  356. break;
  357. case 1:
  358. // 重置作者列表
  359. this.recommendList = [];
  360. this.recommendOffset = 0;
  361. this.hasMoreRecommend = true;
  362. // this.loadRecommendList();
  363. this.loadRecommendList();
  364. break;
  365. }
  366. },
  367. loadFollowList() {
  368. if (this.isLoadingFollow) return;
  369. this.isLoadingFollow = true;
  370. uni.request({
  371. url: this.$apiHost + "/Work/getlist",
  372. data: {
  373. uuid: getApp().globalData.uuid,
  374. skey: getApp().globalData.skey,
  375. offset: this.followOffset,
  376. search: this.searchKeyword,
  377. },
  378. header: {
  379. "content-type": "application/json",
  380. sign: getApp().globalData.headerSign,
  381. },
  382. success: (res) => {
  383. console.log("作品列表数据:", res.data);
  384. // 确保在任何情况下都完成加载
  385. if (
  386. res.data.success == "yes" &&
  387. res.data.list &&
  388. res.data.list.length > 0
  389. ) {
  390. // 只有当列表有数据时才追加
  391. this.followList = [...this.followList, ...res.data.list];
  392. this.followOffset += res.data.list.length;
  393. console.log(this.followOffset, "作品列表数据");
  394. if (res.data.list.length < 20) {
  395. this.hasMoreFollow = false;
  396. }
  397. } else {
  398. // 如果列表为空,确保标记没有更多数据
  399. this.hasMoreFollow = false;
  400. }
  401. // 无论是否有数据,都需要通知z-paging组件完成刷新
  402. if (this.$refs.paging) {
  403. this.$refs.paging.complete(this.followList);
  404. }
  405. },
  406. complete: () => {
  407. this.isLoadingFollow = false;
  408. },
  409. fail: (e) => {
  410. console.log("请求关注列表失败:", e);
  411. this.isLoadingFollow = false;
  412. // 加载失败时也要通知组件完成
  413. if (this.$refs.paging) {
  414. this.$refs.paging.complete(false);
  415. }
  416. },
  417. });
  418. },
  419. loadRecommendList() {
  420. console.log(this.recommendOffset, 666);
  421. if (this.isLoadingRecommend) return;
  422. this.isLoadingRecommend = true;
  423. uni.request({
  424. url: this.$apiHost + "/User/getlist",
  425. data: {
  426. uuid: getApp().globalData.uuid,
  427. skey: getApp().globalData.skey,
  428. offset: this.recommendOffset,
  429. search: this.searchKeyword,
  430. },
  431. header: {
  432. "content-type": "application/json",
  433. sign: getApp().globalData.headerSign,
  434. },
  435. success: (res) => {
  436. console.log("作者列表数据:", res.data);
  437. if (
  438. res.data.success == "yes" &&
  439. res.data.list &&
  440. res.data.list.length > 0
  441. ) {
  442. this.recommendList = [...this.recommendList, ...res.data.list];
  443. this.recommendOffset += res.data.list.length;
  444. console.log(this.recommendOffset, "作者列表数据");
  445. if (res.data.list.length < 20) {
  446. this.hasMoreRecommend = false;
  447. }
  448. } else {
  449. this.hasMoreRecommend = false;
  450. }
  451. // 无论是否有数据,都需要通知z-paging组件完成刷新
  452. if (this.$refs.paging) {
  453. this.$refs.paging.complete(this.recommendList);
  454. }
  455. },
  456. complete: () => {
  457. this.isLoadingRecommend = false;
  458. },
  459. fail: (e) => {
  460. console.log("请求推荐列表失败:", e);
  461. this.isLoadingRecommend = false;
  462. // 加载失败时也要通知组件完成
  463. if (this.$refs.paging) {
  464. this.$refs.paging.complete(false);
  465. }
  466. },
  467. });
  468. },
  469. toggleFollow(item) {
  470. uni.request({
  471. url: this.$apiHost + '/Member/attention',
  472. data: {
  473. uuid: getApp().globalData.uuid,
  474. id: item.user_id,
  475. },
  476. header: {
  477. "content-type": "application/json",
  478. 'sign': getApp().globalData.headerSign
  479. },
  480. success: (res) => {
  481. console.log("关注结果:", res.data);
  482. uni.showToast({
  483. title: res.data.str,
  484. icon: 'none'
  485. });
  486. if (res.data.success === "yes") {
  487. if (res.data.str === "关注成功") {
  488. item.is_attention = false
  489. }
  490. if (res.data.str === "取消关注") {
  491. item.is_attention = true
  492. }
  493. }
  494. },
  495. fail: (e) => {
  496. console.log("关注失败:", e);
  497. uni.showToast({
  498. title: '网络请求失败',
  499. icon: 'none'
  500. });
  501. }
  502. });
  503. // 这里可以添加调用后端API的逻辑
  504. },
  505. // 搜索请求
  506. searchRequest() {
  507. },
  508. goToUserHomepage(id) {
  509. if (!id) {
  510. return;
  511. }
  512. uni.navigateTo({
  513. url: "/pages/my/userHomepage?id=" + id,
  514. });
  515. },
  516. }
  517. }
  518. </script>
  519. <style lang="scss">
  520. .search-container {
  521. background-color: #ffffff;
  522. min-height: 100vh;
  523. .search-header {
  524. background-color: #ffffff;
  525. padding: 16rpx 30rpx;
  526. display: flex;
  527. align-items: center;
  528. padding-top: calc(16rpx + var(--status-bar-height));
  529. padding-left: 40rpx;
  530. padding-right: 28rpx;
  531. padding-bottom: 16rpx;
  532. position: fixed;
  533. left: 0;
  534. top: 0;
  535. z-index: 9;
  536. .search-box {
  537. flex: 1;
  538. height: 72rpx;
  539. background-color: #f1f1f1;
  540. border-radius: 36rpx;
  541. display: flex;
  542. align-items: center;
  543. padding: 0 24rpx;
  544. width: 622rpx;
  545. height: 72rpx;
  546. background: #FFFFFF;
  547. border-radius: 36rpx;
  548. border: 4rpx solid #000000;
  549. position: relative;
  550. left: 0;
  551. top: 0;
  552. input {
  553. flex: 1;
  554. height: 100%;
  555. margin: 0 16rpx;
  556. font-size: 24rpx;
  557. font-family: 'PingFang SC-Medium';
  558. }
  559. .searchImgBox {
  560. width: 88rpx;
  561. height: 56rpx;
  562. background: #1F1F1F;
  563. border-radius: 32rpx;
  564. display: flex;
  565. align-items: center;
  566. justify-content: center;
  567. position: absolute;
  568. top: 50%;
  569. right: 4rpx;
  570. transform: translateY(-50%);
  571. .image {
  572. width: 36rpx;
  573. height: 36rpx;
  574. }
  575. }
  576. }
  577. .cancel-btn {
  578. color: #1f1f1f;
  579. width: 36rpx;
  580. height: 100%;
  581. margin-right: 24rpx;
  582. font-weight: 700;
  583. }
  584. }
  585. .reserveASeat {
  586. width: 100vh;
  587. height: calc(108rpx + var(--status-bar-height));
  588. }
  589. .search-history {
  590. background-color: #ffffff;
  591. margin-top: 20rpx;
  592. padding: 30rpx;
  593. .history-header {
  594. display: flex;
  595. justify-content: space-between;
  596. align-items: center;
  597. margin-bottom: 15rpx;
  598. .title {
  599. font-size: 30rpx;
  600. color: #333;
  601. font-weight: bold;
  602. }
  603. }
  604. .history-list {
  605. transition: all 1s;
  606. overflow: hidden;
  607. .history-item {
  608. display: flex;
  609. align-items: center;
  610. padding: 13rpx 0;
  611. justify-content: space-between;
  612. .history-text {
  613. font-size: 28rpx;
  614. color: #666;
  615. display: flex;
  616. align-items: center;
  617. justify-content: flex-start;
  618. font-weight: 400;
  619. color: #1F1F1F;
  620. margin-left: 6rpx;
  621. font-family: 'PingFang SC-Bold';
  622. image {
  623. width: 32rpx;
  624. height: 32rpx;
  625. margin-right: 16rpx;
  626. }
  627. }
  628. .deleteBtn {
  629. width: 30rpx;
  630. height: 30rpx;
  631. }
  632. }
  633. }
  634. .expandBtn {
  635. view {
  636. font-family: 'PingFang SC-Bold';
  637. color: #999999;
  638. display: flex;
  639. align-items: center;
  640. justify-content: center;
  641. &.fold {
  642. image {
  643. transform: rotate(180deg) translateY(-2rpx);
  644. }
  645. }
  646. image {
  647. width: 28rpx;
  648. height: 28rpx;
  649. }
  650. }
  651. }
  652. }
  653. .search-result {
  654. background-color: #ffffff;
  655. margin-top: 20rpx;
  656. min-height: 200rpx;
  657. .tab-nav {
  658. display: flex;
  659. justify-content: flex-start;
  660. padding: 20rpx 20rpx;
  661. box-sizing: border-box;
  662. background: #ffffff;
  663. .tab-item {
  664. padding: 10rpx 38rpx;
  665. color: #1F1F1F;
  666. font-size: 28rpx;
  667. background: #F2F6F2;
  668. margin-right: 20rpx;
  669. border-radius: 30rpx;
  670. position: relative;
  671. left: 0;
  672. top: 0;
  673. .indicator-triangle {
  674. position: absolute;
  675. bottom: -10rpx;
  676. left: 50%;
  677. transform: translateX(-50%);
  678. width: 0;
  679. height: 0;
  680. border-left: 10rpx solid transparent;
  681. border-right: 10rpx solid transparent;
  682. border-top: 10rpx solid #ACF934;
  683. display: none;
  684. }
  685. &.active {
  686. background: #ACF934;
  687. font-family: "CustomFont" !important;
  688. .indicator-triangle {
  689. display: block;
  690. }
  691. }
  692. }
  693. }
  694. .follow-list {
  695. padding: 0 20px;
  696. .follow-item {
  697. display: flex;
  698. align-items: center;
  699. padding: 15px 0;
  700. .avator {
  701. width: 120rpx;
  702. height: 120rpx;
  703. margin-right: 24rpx;
  704. }
  705. .info {
  706. flex: 1;
  707. .top-box {
  708. display: flex;
  709. align-items: center;
  710. .name {
  711. font-size: 32rpx;
  712. font-weight: 500;
  713. margin-bottom: 8rpx;
  714. max-width: 200rpx;
  715. }
  716. >image {
  717. width: 36rpx;
  718. margin-left: 8rpx;
  719. margin-right: 10rpx;
  720. }
  721. .level {
  722. font-weight: 400;
  723. font-size: 20rpx;
  724. font-family: "PingFang SC-Bold";
  725. background: linear-gradient(360deg, #acf934 0%, #ffe439 100%);
  726. border-radius: 8rpx;
  727. padding: 2rpx 8rpx;
  728. display: inline-block;
  729. }
  730. }
  731. .desc {
  732. font-size: 24rpx;
  733. color: #999;
  734. }
  735. }
  736. .unfollow-btn {
  737. font-size: 24rpx;
  738. width: 144rpx;
  739. height: 52rpx;
  740. display: flex;
  741. justify-content: center;
  742. align-items: center;
  743. color: #666;
  744. background: #fff;
  745. border: 2rpx solid #000;
  746. border-radius: 112rpx;
  747. margin: 0;
  748. font-family: 'PingFang SC-Bold';
  749. image {
  750. display: none;
  751. width: 16rpx;
  752. height: 16rpx;
  753. margin-right: 5rpx;
  754. }
  755. &.active {
  756. color: #ACF934;
  757. background: #000;
  758. image {
  759. display: inline-block;
  760. }
  761. }
  762. }
  763. }
  764. }
  765. }
  766. .no-data {
  767. display: flex;
  768. flex-direction: column;
  769. align-items: center;
  770. justify-content: center;
  771. padding: 60rpx 0;
  772. background-color: #fff;
  773. text {
  774. color: #808080;
  775. font-size: 28rpx;
  776. }
  777. }
  778. }
  779. </style>