图书馆小程序
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.

855 lines
24 KiB

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