图书馆小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

710 lines
20 KiB

6 months ago
​
​
​
​
6 months ago
6 months ago
​
6 months ago
6 months ago
​
​
6 months ago
6 months ago
6 months ago
6 months ago
​
​
6 months ago
6 months ago
6 months ago
6 months ago
​
​
​
​
6 months ago
6 months ago
​
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
6 months ago
​
​
6 months ago
​
​
6 months ago
​
6 months ago
6 months ago
​
​
6 months ago
​
6 months ago
6 months ago
​
​
6 months ago
6 months ago
​
​
​
​
​
6 months ago
6 months ago
6 months ago
​
​
6 months ago
​
​
6 months ago
​
​
6 months ago
​
​
6 months ago
​
​
6 months ago
​
6 months ago
6 months ago
​
​
6 months ago
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
6 months ago
6 months ago
​
6 months ago
6 months ago
​
​
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
​
​
​
​
​
​
6 months ago
6 months ago
​
6 months ago
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
6 months ago
​
​
6 months ago
6 months ago
​
6 months ago
​
​
​
6 months ago
​
​
​
6 months ago
6 months ago
6 months ago
​
6 months ago
​
6 months ago
​
​
​
6 months ago
​
​
​
​
6 months ago
​
​
​
​
​
6 months ago
​
​
​
​
​
​
6 months ago
6 months ago
6 months ago
6 months ago
​
6 months ago
​
​
​
​
​
6 months ago
6 months ago
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
6 months ago
6 months ago
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
6 months ago
​
6 months ago
6 months ago
6 months ago
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
6 months ago
6 months ago
6 months ago
​
6 months ago
6 months ago
6 months ago
6 months ago
​
6 months ago
​
6 months ago
​
​
​
​
6 months ago
6 months ago
​
​
​
​
6 months ago
​
​
​
​
​
6 months ago
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
6 months ago
6 months ago
​
​
​
​
​
​
​
​
6 months ago
6 months ago
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
6 months ago
6 months ago
​
6 months ago
​
​
6 months ago
​
​
​
​
6 months ago
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
6 months ago
​
​
​
​
​
6 months ago
6 months ago
​
​
​
6 months ago
​
​
​
​
​
​
​
6 months ago
​
​
6 months ago
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
6 months ago
​
​
6 months ago
6 months ago
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
  1. <template>
  2. <view style="padding-bottom: 20px;">
  3. <view class="top-bar">
  4. <image class="top-bar-bg" src="@/static/images/mingqi-beij@2x.png" mode="aspectFill"></image>
  5. <view class="library-info">
  6. <image class="avatar" src="@/static/images/logo.jpg" mode="aspectFill"></image>
  7. <view class="library-name">葛店经济技术开发区图书馆</view>
  8. </view>
  9. <uni-icons class="search-icon" type="search" size="30" @click="onToSearch"></uni-icons>
  10. </view>
  11. <view class="status-cards">
  12. <view class="status-card" @click="toBorrowPage(0)">
  13. <view class="status-icon icon-color1" >
  14. <uni-icons custom-prefix="iconfont" type="icon-daiban02" size="22"></uni-icons>
  15. </view>
  16. <view class="status-label">在借中</view>
  17. </view>
  18. <!-- <view class="status-card" @click="toBorrowPage(2)">
  19. <view class="status-icon icon-color2" >
  20. <uni-icons custom-prefix="iconfont" type="icon-zuofei05" size="22"></uni-icons>
  21. </view>
  22. <view class="status-label">将过期</view>
  23. </view>
  24. <view class="status-card" @click="toBorrowPage(3)">
  25. <view class="status-icon icon-color3" >
  26. <uni-icons custom-prefix="iconfont" type="icon-yuqi04" size="22"></uni-icons>
  27. </view>
  28. <view class="status-label">已过期</view>
  29. </view> -->
  30. <view class="status-card" @click="toBorrowPage(1)">
  31. <view class="status-icon icon-color4" >
  32. <uni-icons custom-prefix="iconfont" type="icon-a-zhidu4" size="22"></uni-icons>
  33. </view>
  34. <view class="status-label">历史借阅</view>
  35. </view>
  36. </view>
  37. <swiper class="banner-swiper" interval="3000" circular :vertical="false" :indicator-dots="true" :autoplay="true">
  38. <swiper-item>
  39. <image data-post-id="3" src="https://qiniu.aiyxlib.com/1605060269830"></image>
  40. </swiper-item>
  41. <swiper-item>
  42. <image data-post-id="4" src="https://qiniu.aiyxlib.com/1605060269830"></image>
  43. </swiper-item>
  44. </swiper>
  45. <!-- :indicator-dots="true" -->
  46. <swiper class="menu-swiper" interval="6000" :vertical="false" :autoplay="false">
  47. <swiper-item>
  48. <view class="menu-grid">
  49. <view class="menu-item" @click="onToSearch">
  50. <view class="menu-icon">
  51. <uni-icons custom-prefix="iconfont" type="icon-ziyuan" size="22"></uni-icons>
  52. </view>
  53. <view class="menu-label">书目检索</view>
  54. </view>
  55. <view class="menu-item" @click="onToLendCar">
  56. <view class="menu-icon">
  57. <uni-icons custom-prefix="iconfont" type="icon-z_renew_normal" size="24"></uni-icons>
  58. </view>
  59. <view class="menu-label">图书续借</view>
  60. </view>
  61. <!-- <view class="menu-item" >
  62. <view class="menu-icon">
  63. <uni-icons custom-prefix="iconfont" type="icon-guanwaizhuanjie1" size="26"></uni-icons>
  64. </view>
  65. <view class="menu-label">图书转借</view>
  66. </view> -->
  67. <view class="menu-item" @click="toLibraryCard">
  68. <view class="menu-icon">
  69. <uni-icons custom-prefix="iconfont" type="icon-duzhezheng" size="26"></uni-icons>
  70. </view>
  71. <view class="menu-label">电子证</view>
  72. </view>
  73. <view class="menu-item" @click="toRanking">
  74. <view class="menu-icon">
  75. <uni-icons custom-prefix="iconfont" type="icon-paihangbang" size="22"></uni-icons>
  76. </view>
  77. <view class="menu-label">借阅排行</view>
  78. </view>
  79. <view class="menu-item" @click="toActivityList">
  80. <view class="menu-icon">
  81. <uni-icons custom-prefix="iconfont" type="icon-remenhuodong" size="26"></uni-icons>
  82. </view>
  83. <view class="menu-label">活动报名</view>
  84. </view>
  85. <view class="menu-item" @click="toFeedback">
  86. <view class="menu-icon">
  87. <uni-icons custom-prefix="iconfont" type="icon-duzheliuyan" size="26"></uni-icons>
  88. </view>
  89. <view class="menu-label">读者留言</view>
  90. </view>
  91. <view class="menu-item" @click="onToUser">
  92. <view class="menu-icon">
  93. <uni-icons custom-prefix="iconfont" type="icon-yonghuxinxi-gerenxinxi" size="20"></uni-icons>
  94. </view>
  95. <view class="menu-label">个人中心</view>
  96. </view>
  97. </view>
  98. </swiper-item>
  99. </swiper>
  100. <!-- 已有绑定:滑动切换多个借阅证 -->
  101. <view v-if="isBindLibraryCard" class="library-card-has">
  102. <view class="section-title">我的借阅证</view>
  103. <!-- 左右滑动切换证件 -->
  104. <!-- :indicator-dots="readerCardList.length > 1"
  105. indicator-color="#d1d1d1"
  106. indicator-active-color="#01a4fe" -->
  107. <swiper
  108. class="card-swiper"
  109. :circular="false"
  110. >
  111. <swiper-item v-for="item in readerCardList" :key="item.id">
  112. <view class="card-item" @click.stop="showQrcode(item.bindValue)">
  113. <image class="card-left-img" src="@/static/images/card-img2.png" mode="widthFix" />
  114. <view class="card-right-info">
  115. <text class="info-title">读者证号</text>
  116. <text class="info-num">{{ formatCardNo(item.bindValue) }}</text>
  117. </view>
  118. <view class="default-tag" v-if="item.bindDefault">默认证</view>
  119. <uni-icons class="erweima-style" custom-prefix="iconfont" type="icon-erweima" size="28"></uni-icons>
  120. </view>
  121. </swiper-item>
  122. </swiper>
  123. </view>
  124. <!-- 未绑定借阅证 -->
  125. <view class="library-card-section" @click="toCheckLogin" v-else>
  126. <view class="section-title">借阅证</view>
  127. <image class="card-icon" src="@/static/images/card-img2.png"></image>
  128. <view class="card-tip">您还没有绑定读者证哦~</view>
  129. <button class="bind-btn">立即绑定</button>
  130. </view>
  131. <root-portal>
  132. <uni-popup
  133. ref="popup"
  134. type="center"
  135. :mask-click="true"
  136. @maskClick="closePopup"
  137. :custom-style="popupFixedStyle"
  138. >
  139. <view class="qrcode-popup">
  140. <view class="qrcode-title">读者证二维码</view>
  141. <w-qrcode
  142. v-if="qrcodeText"
  143. :value="qrcodeText"
  144. :size="160"
  145. foreground="#333"
  146. background="#ffffff"
  147. />
  148. <view class="qrcode-num">{{ qrcodeText }}</view>
  149. <view class="close-btn" @click="closePopup">关闭</view>
  150. </view>
  151. </uni-popup>
  152. </root-portal>
  153. <view class="recommendation-section">
  154. <view class="section-title">
  155. <text class="left-txt">图书推荐</text>
  156. <view class="more-link" @click="getMoreBoook" v-if="!(recommendedBooks.length === 0 && !isLoading)">
  157. <text style="margin-right: 5px;">查看更多</text>
  158. <uni-icons custom-prefix="iconfont" type="icon-gengduo" size="12"></uni-icons>
  159. </view>
  160. </view>
  161. <view class="recommendation-list">
  162. <uni-load-more status="loading" v-if="isLoading"></uni-load-more>
  163. <view v-else class="book-item" v-for="(item,index) in recommendedBooks.slice(0,3)" @click="goToBookDetail(item)" :key="index" >
  164. <image
  165. class="book-cover"
  166. :src="item.base64Cover || '/static/images/default-book.png'"
  167. @error="onImgError"
  168. ></image>
  169. <view class="book-title">{{item.name}}</view>
  170. </view>
  171. </view>
  172. <view class="empty-box" v-if="recommendedBooks.length === 0 && !isLoading">
  173. <uni-icons custom-prefix="iconfont" type="icon-kongshuju" size="80"></uni-icons>
  174. <text style="margin-top: 20px;">暂无推荐书籍~</text>
  175. </view>
  176. </view>
  177. </view>
  178. </template>
  179. <script>
  180. import { FetchOpenId, FetchFindAllReaderBindByOpenId} from '@/api/user';
  181. import { FetchInitScreenBookRecommend } from '@/api/book';
  182. import config from '@/utils/config';
  183. const READLIST = 'reader-card-list';
  184. export default {
  185. data() {
  186. return {
  187. isLoading: true,
  188. recommendedBooks: [],
  189. token: "",
  190. userInfo: {},
  191. isBindLibraryCard: false,
  192. readerCardList: [], // 多个借阅证
  193. baseUrl: config.baseUrl,
  194. qrcodeText: '', // 二维码内容
  195. popupFixedStyle: 'position:fixed;top:0;left:0;right:0;bottom:0;'
  196. };
  197. },
  198. onLoad() {
  199. this.getRecommendBooks();
  200. },
  201. onShow() {
  202. this.initUserAndCheckBind();
  203. },
  204. methods:{
  205. // 格式化读者证号
  206. formatCardNo(cardNo) {
  207. if (!cardNo) return '';
  208. const str = String(cardNo);
  209. const len = str.length;
  210. if (len > 8) {
  211. // 前2位 + 中间全部* + 后2位
  212. const front = str.substring(0, 2);
  213. const end = str.substring(len - 2);
  214. const star = '*'.repeat(len - 4); // 中间全部隐藏
  215. return front + star + end;
  216. } else {
  217. // 小于等于8:*** + 后2位
  218. return '***' + str.substring(len - 2);
  219. }
  220. },
  221. onImgError(e) {
  222. e.target.src = "/static/images/default-book.png";
  223. },
  224. // 初始化:登录 → 获取openid → 查是否绑定
  225. async initUserAndCheckBind() {
  226. try {
  227. // 1. 先看缓存有没有 openId
  228. let openId = uni.getStorageSync('wx_login_code');
  229. // 2. 没有 → 走微信登录流程
  230. if (!openId) {
  231. const loginRes = await new Promise((resolve, reject) => {
  232. uni.login({
  233. success: resolve,
  234. fail: reject
  235. });
  236. });
  237. if (!loginRes.code) {
  238. uni.showToast({ title: '授权失败', icon: 'none' });
  239. return;
  240. }
  241. // 3. 获取 openId
  242. const openRes = await FetchOpenId({
  243. libcode: '1201',
  244. code: loginRes.code
  245. });
  246. if (openRes.code !== 200 || !openRes.data) {
  247. return;
  248. }
  249. openId = openRes.data;
  250. uni.setStorageSync('wx_login_code', openId);
  251. }
  252. // 4. 有了 openId → 查绑定状态
  253. const res = await FetchFindAllReaderBindByOpenId({
  254. libcode: '1201',
  255. openId: openId
  256. });
  257. if (res.code === 200 && res.data.length > 0) {
  258. this.isBindLibraryCard = true;
  259. // 👉 默认证排第一位
  260. const defaultCard = res.data.find(item => item.bindDefault === true);
  261. const otherCards = res.data.filter(item => !item.bindDefault);
  262. // 合并:默认在前,其他在后
  263. this.readerCardList = defaultCard ? [defaultCard, ...otherCards] : res.data;
  264. uni.setStorageSync(READLIST, this.readerCardList);
  265. uni.setStorageSync('currentReaderCard', defaultCard);
  266. } else {
  267. this.isBindLibraryCard = false;
  268. this.readerCardList = [];
  269. uni.setStorageSync(READLIST, []);
  270. }
  271. } catch (err) {
  272. console.error('初始化失败:', err);
  273. const list = uni.getStorageSync(READLIST) || [];
  274. // 同样默认排第一
  275. const defaultCard = list.find(item => item.bindDefault === true);
  276. const otherCards = list.filter(item => !item.bindDefault);
  277. this.readerCardList = defaultCard ? [defaultCard, ...otherCards] : list;
  278. this.isBindLibraryCard = list.length > 0;
  279. }
  280. },
  281. // 获取图书推荐 + 封面转 base64
  282. async getRecommendBooks() {
  283. try {
  284. const res = await FetchInitScreenBookRecommend({ libcode: '1201' });
  285. let books = res.data || [];
  286. // 只遍历前3条,做Base64转换
  287. const limit = 3;
  288. for (let i = 0; i < books.length && i < limit; i++) {
  289. let item = books[i];
  290. if (item.imgPath) {
  291. const imageUrl = this.baseUrl + '/api/fileRelevant/getImg?imgType=2&imgId=' + item.imgPath;
  292. try {
  293. const base64 = await this.urlToBase64(imageUrl);
  294. item.base64Cover = base64;
  295. } catch (err) {
  296. item.base64Cover = '';
  297. }
  298. } else {
  299. item.base64Cover = '';
  300. }
  301. }
  302. // 第3条之后直接赋空,用默认图
  303. for (let i = limit; i < books.length; i++) {
  304. books[i].base64Cover = '';
  305. }
  306. this.recommendedBooks = books;
  307. this.isLoading = false;
  308. } catch (err) {
  309. console.error('获取图书推荐失败:', err);
  310. this.isLoading = false;
  311. }
  312. },
  313. goToBookDetail(item) {
  314. // 把整个图书对象 转成字符串 带过去
  315. uni.navigateTo({
  316. url: "/subpkg/pages/book-detail/book-detail?bookData=" + encodeURIComponent(JSON.stringify(item))
  317. })
  318. },
  319. // 查看更多 → 进入图书列表页
  320. getMoreBoook(){
  321. uni.navigateTo({
  322. url: "/subpkg/pages/book-list/book-list"
  323. })
  324. },
  325. // 去图书检索页
  326. onToSearch() {
  327. uni.switchTab({
  328. url: "/pages/search/search"
  329. });
  330. },
  331. // 去图书借阅车页
  332. onToLendCar() {
  333. uni.switchTab({
  334. url: "/pages/lendCar/lendCar"
  335. });
  336. },
  337. // 点击未绑定借阅证区域 触发跳转
  338. toCheckLogin() {
  339. uni.navigateTo({
  340. url: "/pages/login/login"
  341. });
  342. },
  343. toRanking(){
  344. uni.navigateTo({
  345. url: "/subpkg/pages/ranking/ranking"
  346. })
  347. },
  348. toActivityList(){
  349. uni.navigateTo({
  350. url: "/subpkg/pages/activity-list/activity-list"
  351. })
  352. },
  353. toBorrowPage(index) {
  354. uni.setStorageSync('switch_tab_index', index);
  355. uni.navigateTo({
  356. url: '/subpkg/pages/myLending/myLending'
  357. });
  358. },
  359. toBorrowCar() {
  360. uni.switchTab({
  361. url: '/pages/lendCar/lendCar'
  362. });
  363. },
  364. toFeedback() {
  365. uni.navigateTo({
  366. url: '/subpkg/pages/feedback-list/feedback-list'
  367. });
  368. },
  369. // 去借阅证列表页
  370. toLibraryCard() {
  371. // 已绑定 → 进列表
  372. if (this.isBindLibraryCard) {
  373. uni.navigateTo({ url: '/subpkg/pages/reader-card/reader-card' });
  374. }
  375. // 未绑定 → 进绑定页
  376. else {
  377. uni.navigateTo({ url: "/pages/login/login" });
  378. }
  379. },
  380. // 去个人中心页
  381. onToUser() {
  382. uni.switchTab({
  383. url: "/pages/user/user"
  384. });
  385. },
  386. showQrcode(bindValue) {
  387. this.qrcodeText = bindValue;
  388. this.$refs.popup.open();
  389. },
  390. closePopup() {
  391. console.log('关闭弹窗');
  392. this.qrcodeText = '';
  393. this.$refs.popup.close();
  394. },
  395. urlToBase64(url) {
  396. return new Promise((resolve, reject) => {
  397. uni.request({
  398. url,
  399. method: 'GET',
  400. responseType: 'arraybuffer',
  401. success: (res) => {
  402. try {
  403. const buffer = new Uint8Array(res.data);
  404. let binary = '';
  405. for (let i = 0; i < buffer.length; i++) {
  406. binary += String.fromCharCode(buffer[i]);
  407. }
  408. const base64 = uni.arrayBufferToBase64(res.data);
  409. const dataUri = 'data:image/jpeg;base64,' + base64;
  410. resolve(dataUri);
  411. } catch (e) {
  412. reject(e);
  413. }
  414. },
  415. fail: reject
  416. });
  417. });
  418. },
  419. }
  420. }
  421. </script>
  422. <style lang="scss" scoped>
  423. .top-bar{
  424. .search-icon{
  425. position: absolute;
  426. right: 16px;
  427. top: 15px;
  428. z-index: 22;
  429. ::v-deep .uni-icons{
  430. color: #fff !important;
  431. }
  432. }
  433. }
  434. .status-cards {
  435. display: flex;
  436. background-color: #fff;
  437. margin: 10px;
  438. border-radius: 8px;
  439. padding: 20px 10px;
  440. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
  441. .status-card {
  442. flex: 1;
  443. display: flex;
  444. flex-direction: column;
  445. align-items: center;
  446. }
  447. .status-icon {
  448. display: flex;
  449. justify-content: center;
  450. align-items: center;
  451. width: 40px;
  452. height: 40px;
  453. margin-bottom: 6px;
  454. border-radius: 50%;
  455. }
  456. .icon-color1{
  457. background-color: #e4f2ff;
  458. }
  459. .icon-color2{
  460. background-color: #ffeff0;
  461. }
  462. .icon-color3{
  463. background-color: #e4fff4;
  464. }
  465. .icon-color4{
  466. background-color: #fef8e2;
  467. }
  468. .status-label {
  469. font-size: 12px;
  470. color: #333;
  471. }
  472. }
  473. swiper.banner-swiper{
  474. width: 100%;
  475. height: 130px;
  476. }
  477. swiper.banner-swiper image{
  478. width: 100%;
  479. height: 130px;
  480. }
  481. swiper.menu-swiper{
  482. width:100%;
  483. margin-top: 10px;
  484. background-color: #fff;
  485. }
  486. .menu-grid {
  487. display: grid;
  488. grid-template-columns: repeat(4, 1fr);
  489. .menu-item {
  490. flex: 1;
  491. display: flex;
  492. flex-direction: column;
  493. align-items: center;
  494. padding: 10px 0;
  495. .menu-icon{
  496. display: flex;
  497. flex-direction: column;
  498. justify-content: center;
  499. height: 30px;
  500. ::v-deep .uni-icons{
  501. color: #01a4fe !important;
  502. }
  503. }
  504. .menu-label {
  505. font-size: 12px;
  506. color: #333;
  507. text-align: center;
  508. }
  509. }
  510. }
  511. .library-card-section {
  512. display: flex;
  513. flex-direction: column;
  514. justify-content: space-between;
  515. align-items: center;
  516. width: 100%;
  517. padding: 20px 0;
  518. .section-title {
  519. font-size: 22px;
  520. font-weight: bold;
  521. background: linear-gradient(140deg, #01a4ff, #2ec8fe);
  522. -webkit-background-clip: text;
  523. color: transparent;
  524. letter-spacing: 0.1em;
  525. margin-bottom: 5px;
  526. }
  527. .card-icon {
  528. width: 80px;
  529. height: 80px;
  530. }
  531. .card-tip {
  532. font-size: 12px;
  533. color: #999;
  534. margin: 5px 0;
  535. }
  536. .bind-btn {
  537. display: flex;
  538. flex-direction: row;
  539. align-items: center;
  540. justify-content: center;
  541. border: 1px solid #06a8ff ;
  542. width: 128px !important;
  543. height: 28px;
  544. border-radius: 28px;
  545. background: linear-gradient(140deg, #01a4ff, #2ec8fe);
  546. font-size: 14px;
  547. color: #fff;
  548. line-height: 28px;
  549. }
  550. }
  551. .recommendation-section {
  552. background-color: #fff;
  553. margin: 10px;
  554. border-radius: 8px;
  555. padding: 0 0 10px 0;
  556. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
  557. .section-title{
  558. display: flex;
  559. flex-direction: row;
  560. justify-content: space-between;
  561. align-items: center;
  562. height: 40px;
  563. padding: 0 10px;
  564. .left-txt{
  565. color: #343434;
  566. font-size: 15px;
  567. font-weight: 700;
  568. }
  569. .more-link{
  570. display: flex;
  571. flex-direction: row;
  572. justify-content: flex-start;
  573. align-items: center;
  574. color: #999;
  575. font-size: 11px;
  576. }
  577. }
  578. }
  579. .library-card-has {
  580. width: 100%;
  581. padding: 20px 10px;
  582. box-sizing: border-box;
  583. .section-title {
  584. font-size: 22px;
  585. font-weight: bold;
  586. background: linear-gradient(140deg, #01a4ff, #2ec8fe);
  587. -webkit-background-clip: text;
  588. color: transparent;
  589. letter-spacing: 0.1em;
  590. margin-bottom: 10px;
  591. padding-left: 5px;
  592. }
  593. .card-list {
  594. width: 100%;
  595. }
  596. }
  597. .card-swiper {
  598. height: 106px;
  599. .card-item{
  600. display: flex;
  601. justify-content: space-between;
  602. align-items: center;
  603. padding: 10px;
  604. border: 2px solid #C6C6E2;
  605. border-radius: 8px;
  606. background: rgba(241,241,249,0.4);
  607. cursor: pointer;
  608. &.active{
  609. border-color: #01a4fe;
  610. background: rgba(1, 164, 254, 0.1);
  611. }
  612. .card-left-img{
  613. width: 80px;
  614. margin-right: 12px;
  615. display: block;
  616. }
  617. .card-right-info{
  618. flex: 1;
  619. display: flex;
  620. flex-direction: column;
  621. .info-title{
  622. font-size: 16px;
  623. color: #333;
  624. font-weight: bold;
  625. padding-bottom: 12px;
  626. }
  627. .info-num{
  628. font-size: 14px;
  629. color: #999;
  630. }
  631. }
  632. .default-tag {
  633. position: absolute;
  634. right: 12px;
  635. top: 12px;
  636. font-size: 11px;
  637. color: #01a4fe;
  638. border: 1px solid #01a4fe;
  639. border-radius: 4px;
  640. padding: 2px 6px;
  641. }
  642. }
  643. }
  644. .erweima-style{
  645. position: absolute;
  646. right: 12px;
  647. bottom: 22px;
  648. ::v-deep .icon-erweima{
  649. // font-weight: bold;
  650. color: #999 !important;
  651. }
  652. }
  653. /* 空状态 */
  654. .empty-box {
  655. display: flex;
  656. flex-direction: column;
  657. justify-content: center;
  658. align-items: center;
  659. color: #999;
  660. font-size: 15px;
  661. padding: 20px;
  662. }
  663. </style>