From 672575a32ecd7f8e0bcd76152040657e9e57328a Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期五, 12 四月 2024 16:36:41 +0800 Subject: [PATCH] 骨架屏样式优化 --- packageBookService/pages/bookServices/detail/components/relatedBooks/index.wxml | 25 +++++++++--- packageBookService/pages/bookServices/detail/components/relatedBooks/index.wxss | 2 + packageBookService/pages/bookServices/detail/index.wxml | 2 packageBookService/pages/bookServices/detail/index.js | 15 +++++++ pages/bookServices/assort/index.js | 59 +++++++++++++++-------------- pages/bookServices/assort/index.wxss | 3 - packageBookService/pages/bookServices/examination/examination.wxml | 2 packageBookService/pages/bookServices/detail/components/relatedBooks/index.js | 9 +++- pages/bookServices/assort/index.skeleton.wxml | 2 9 files changed, 78 insertions(+), 41 deletions(-) diff --git a/packageBookService/pages/bookServices/detail/components/relatedBooks/index.js b/packageBookService/pages/bookServices/detail/components/relatedBooks/index.js index c316c24..59b8bde 100644 --- a/packageBookService/pages/bookServices/detail/components/relatedBooks/index.js +++ b/packageBookService/pages/bookServices/detail/components/relatedBooks/index.js @@ -18,7 +18,12 @@ /** * 缁勪欢鐨勫垵濮嬫暟鎹� */ - data: {}, + data: { + rowCol: [{ + size: '200rpx', + borderRadius: '12rpx' + }, 1], + }, /** * 缁勪欢鐨勬柟娉曞垪琛� @@ -37,4 +42,4 @@ this.triggerEvent("goBookDetails", myEventDetail, myEventOption); }, }, -}); +}); \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/components/relatedBooks/index.wxml b/packageBookService/pages/bookServices/detail/components/relatedBooks/index.wxml index 1bca4e8..f082a49 100644 --- a/packageBookService/pages/bookServices/detail/components/relatedBooks/index.wxml +++ b/packageBookService/pages/bookServices/detail/components/relatedBooks/index.wxml @@ -1,5 +1,5 @@ <!--packageBookService/pages/bookServices/detail/components/relatedBooks/index.wxml--> -<view class="reletedBooks fl "> +<view class="reletedBooks fl"> <view wx:for="{{relatedBookData}}" wx:key="id" @@ -19,11 +19,24 @@ <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> <view class="loading-box" wx:if="{{relatedBookLoading}}"> + <!-- relatedBookLoading --> <t-skeleton - row-col="{{[1,1,1,1,1,1]}}" - theme="paragraph" - animation="gradient" - loading="{{relatedBookLoading}}" - ></t-skeleton> + rowCol="{{rowCol}}" + theme="paragraph" + animation="gradient" + loading="{{true}}" + ></t-skeleton> + <t-skeleton + rowCol="{{rowCol}}" + theme="paragraph" + animation="gradient" + loading="{{true}}" + ></t-skeleton> + <t-skeleton + rowCol="{{rowCol}}" + theme="paragraph" + animation="gradient" + loading="{{true}}" + ></t-skeleton> </view> </view> diff --git a/packageBookService/pages/bookServices/detail/components/relatedBooks/index.wxss b/packageBookService/pages/bookServices/detail/components/relatedBooks/index.wxss index d954c93..286ff63 100644 --- a/packageBookService/pages/bookServices/detail/components/relatedBooks/index.wxss +++ b/packageBookService/pages/bookServices/detail/components/relatedBooks/index.wxss @@ -50,6 +50,8 @@ } .loading-box { + display: flex; + justify-content: space-between; width: 100%; height: min-content; } diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js index ec8d5e4..152b211 100644 --- a/packageBookService/pages/bookServices/detail/index.js +++ b/packageBookService/pages/bookServices/detail/index.js @@ -134,6 +134,21 @@ icon1: { name: "/static/images/bookService/detail/dangdang.png", }, + rowCol: [{ + width: '50%', + }, + { + width: '100%' + }, + { + width: '80%' + }, + { + width: '100%' + }, { + width: '100%' + }, + ] }, resetTree: function (e) { diff --git a/packageBookService/pages/bookServices/detail/index.wxml b/packageBookService/pages/bookServices/detail/index.wxml index 5d74563..86bf948 100644 --- a/packageBookService/pages/bookServices/detail/index.wxml +++ b/packageBookService/pages/bookServices/detail/index.wxml @@ -230,7 +230,7 @@ /> --> <view wx:if="{{loading}}" style="width: 100%; height: min-content"> <t-skeleton - row-col="{{[1,1,2,1,1,2]}}" + row-col="{{rowCol}}" theme="paragraph" animation="gradient" loading="{{loading}}" diff --git a/packageBookService/pages/bookServices/examination/examination.wxml b/packageBookService/pages/bookServices/examination/examination.wxml index 39086b0..4ea7c17 100644 --- a/packageBookService/pages/bookServices/examination/examination.wxml +++ b/packageBookService/pages/bookServices/examination/examination.wxml @@ -1,7 +1,7 @@ <!--pages/examination/examination.wxml--> <import src="examination.skeleton.wxml" /> -<template is="skeleton" wx:if="{{true}}" /> +<template is="skeleton" wx:if="{{loading}}" /> <!--瀵艰埅鍖哄煙 --> <view diff --git a/pages/bookServices/assort/index.js b/pages/bookServices/assort/index.js index ad80311..888e96e 100644 --- a/pages/bookServices/assort/index.js +++ b/pages/bookServices/assort/index.js @@ -1,5 +1,7 @@ // pages/bookServices/assort/index.js -import { getPublicImage } from "../../../assets/js/middleGround/tool"; +import { + getPublicImage +} from "../../../assets/js/middleGround/tool"; const app = getApp(); Page({ /** @@ -88,18 +90,19 @@ }); const query = { path: "*", - filterList: [ - { - value: "Normal", - field: "state", - }, - ], + filterList: [{ + value: "Normal", + field: "state", + }, ], queryType: "\\", searchList: [], size: "30", start: "0", storeRefCode: app.config.goodsStore, - sort: { type: "Asc", field: "LinkOrder" }, + sort: { + type: "Asc", + field: "LinkOrder" + }, }; app.MG.store.getStoreChannelList(query).then((res) => { const list = res.datas.filter( @@ -135,29 +138,29 @@ }); const query = { path, - filterList: [ - { - value: "Normal", - field: "state", - }, - ], + filterList: [{ + value: "Normal", + field: "state", + }, ], queryType: "\\", searchList: [], size: "30", start: "0", storeRefCode: app.config.goodsStore, - sort: { type: "Asc", field: "LinkOrder" }, + sort: { + type: "Asc", + field: "LinkOrder" + }, }; app.MG.store.getStoreChannelList(query).then(async (res) => { // 鑾峰彇浜岀骇鍒嗙被 for (let index = 0; index < res.datas.length; index++) { const item = res.datas[index]; - item.icon - ? (item.icon = getPublicImage(item.icon, 500)) - : (item.icon = item.icon); + item.icon ? + (item.icon = getPublicImage(item.icon, 500)) : + (item.icon = item.icon); item.children = await this.getSecondList(item); } - console.log(res.datas); // 涓�绾у垎绫昏祴鍊� this.setData({ startList: res.datas, @@ -174,12 +177,10 @@ let datas; const query = { path, - filterList: [ - { - value: "Normal", - field: "state", - }, - ], + filterList: [{ + value: "Normal", + field: "state", + }, ], coverSize: { width: 500, }, @@ -188,7 +189,10 @@ size: "30", start: "0", storeRefCode: app.config.goodsStore, - sort: { type: "Asc", field: "LinkOrder" }, + sort: { + type: "Asc", + field: "LinkOrder" + }, }; await app.MG.store.getStoreChannelList(query).then((res) => { for (let index = 0; index < res.datas.length; index++) { @@ -205,7 +209,6 @@ "startCheck.id": data.id, "startCheck.code": data.refCode, }); - console.log(data); }, // 璺宠浆鍒楄〃椤� goPageList(e) { @@ -231,4 +234,4 @@ url: `/packageBookService/pages/bookServices/list/index?assorName=${this.data.assortCheck.name}&assortCode=${this.data.assortCheck.code}&stairCode=${this.data.startCheck.code}&searchValue=${e.detail.value}`, }); }, -}); +}); \ No newline at end of file diff --git a/pages/bookServices/assort/index.skeleton.wxml b/pages/bookServices/assort/index.skeleton.wxml index 02cf977..77b6a25 100644 --- a/pages/bookServices/assort/index.skeleton.wxml +++ b/pages/bookServices/assort/index.skeleton.wxml @@ -21,7 +21,7 @@ <view style="width: 100%; height: 47px"></view> <view class="nacigationBar" style="width: 100%; height: 40px"> <view - class="navbar-title sk-transparent sk-text-14-2857-436 sk-text" + class="navbar-title " style="background-position-x: 50%" >鍥句功鏈嶅姟</view > diff --git a/pages/bookServices/assort/index.wxss b/pages/bookServices/assort/index.wxss index 98f6321..000d8f7 100644 --- a/pages/bookServices/assort/index.wxss +++ b/pages/bookServices/assort/index.wxss @@ -10,8 +10,7 @@ .navbar-title { text-align: center; color: #0F1214; - font-size: 40rpx; - font-weight: bold; + font-size: 36rpx; } .page-header { -- Gitblit v1.9.1