Browse Source

优化需求

master
xuhuajiao 1 month ago
parent
commit
a4927af891
  1. 18
      api/user.js
  2. 1
      pages/home/home.vue
  3. 4
      static/iconfont.css
  4. BIN
      static/iconfont.ttf
  5. 3
      subpkg/pages/feedback-detail/feedback-detail.vue
  6. 2
      subpkg/pages/feedback-list/feedback-list.vue
  7. 26
      subpkg/pages/ranking/ranking.vue

18
api/user.js

@ -105,7 +105,8 @@ export function FetchUnbindReadCard(data) {
// 读者留言列表 // 读者留言列表
// ?libcode=1&openId=1&page=0&phone=1&readCardNo=1&readName=1&size=10&title=1 // ?libcode=1&openId=1&page=0&phone=1&readCardNo=1&readName=1&size=10&title=1
export function FetchInitReaderMessage(data) {
// libcode openId page phone readCardNo readName size title
export function FetchInitReaderMessage(data) {
return request({ return request({
url: '/api/weixin/initReaderMessage', url: '/api/weixin/initReaderMessage',
data data
@ -138,18 +139,3 @@ export function FetchReaderMessage(data) {
data data
}); });
} }
// 回复读者留言
// {
// "id": 0,
// "reply": "回复"
// }
export function FetchReplyReaderMessage(data) {
return request({
url: '/api/weixin/replyReaderMessage',
method: 'POST',
data
});
}

1
pages/home/home.vue

@ -172,6 +172,7 @@
<uni-load-more status="loading" v-if="isLoading"></uni-load-more> <uni-load-more status="loading" v-if="isLoading"></uni-load-more>
<view v-else class="book-item" v-for="(item,index) in recommendedBooks.slice(0,3)" @click="goToBookDetail(item)" :key="index" > <view v-else class="book-item" v-for="(item,index) in recommendedBooks.slice(0,3)" @click="goToBookDetail(item)" :key="index" >
<!-- :src="item.base64Cover || '/static/images/default-book.png'" -->
<image <image
class="book-cover" class="book-cover"
:src="item.base64Cover || '/static/images/default-book.png'" :src="item.base64Cover || '/static/images/default-book.png'"

4
static/iconfont.css

@ -11,6 +11,10 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-yihuifu1:before {
content: "\e676";
}
.icon-erweima:before { .icon-erweima:before {
content: "\e600"; content: "\e600";
} }

BIN
static/iconfont.ttf

3
subpkg/pages/feedback-detail/feedback-detail.vue

@ -9,7 +9,8 @@
<view class="section reply-section"> <view class="section reply-section">
<view class="section-title">馆方回复</view> <view class="section-title">馆方回复</view>
<view class="section-content" v-if="detail.reply">{{ detail.reply }}</view> <view class="section-content" v-if="detail.reply">{{ detail.reply }}</view>
<view class="section-content no-reply" v-else>未回复</view>
<view class="section-content no-reply" v-else>暂未回复~</view>
<text class="time" v-if="detail.reply">{{ formatTimestamp(detail.replyTime) }}</text>
</view> </view>
</view> </view>
</template> </template>

2
subpkg/pages/feedback-list/feedback-list.vue

@ -20,6 +20,7 @@
<text class="subject">{{ item.title }}</text> <text class="subject">{{ item.title }}</text>
<text class="create-time">{{ formatTimestamp(item.suggestionTime) }}</text> <text class="create-time">{{ formatTimestamp(item.suggestionTime) }}</text>
</view> </view>
<uni-icons v-if="item.reply" style="position: absolute; right: 0; top: 0;" custom-prefix="iconfont" type="icon-yihuifu1" size="40" color="#01a4fe"></uni-icons>
</view> </view>
<view class="loading-more" v-if="loading"> <view class="loading-more" v-if="loading">
<text>加载中...</text> <text>加载中...</text>
@ -180,6 +181,7 @@ export default {
} }
.feedback-item { .feedback-item {
position: relative;
background-color: #fff; background-color: #fff;
border-radius: 8px; border-radius: 8px;
padding: 15px; padding: 15px;

26
subpkg/pages/ranking/ranking.vue

@ -16,8 +16,14 @@
</view> </view>
<view class="ranking-list"> <view class="ranking-list">
<!-- 加载中状态 -->
<view class="loading" v-if="loading">
<uni-icons type="loading" size="40" color="#01a4fe" spin></uni-icons>
<text>加载中...</text>
</view>
<!-- 空状态 --> <!-- 空状态 -->
<view class="empty" v-if="rankingData.length === 0">
<view class="empty" v-else-if="rankingData.length === 0">
<uni-icons style="margin-left: 20px;" custom-prefix="iconfont" type="icon-kongshuju" size="80" color="#ccc"></uni-icons> <uni-icons style="margin-left: 20px;" custom-prefix="iconfont" type="icon-kongshuju" size="80" color="#ccc"></uni-icons>
<text style="margin-top: 20px;">暂无读者排行数据</text> <text style="margin-top: 20px;">暂无读者排行数据</text>
</view> </view>
@ -31,6 +37,7 @@
]" ]"
v-for="(item, index) in rankingData" v-for="(item, index) in rankingData"
:key="index" :key="index"
v-else
> >
<!-- 第一名 --> <!-- 第一名 -->
<uni-icons class="ranking-icon" v-if="index === 0" custom-prefix="iconfont" type="icon-TOP2" size="26" color="#E6CB97"></uni-icons> <uni-icons class="ranking-icon" v-if="index === 0" custom-prefix="iconfont" type="icon-TOP2" size="26" color="#E6CB97"></uni-icons>
@ -78,6 +85,7 @@ export default {
return { return {
rankingData: [], rankingData: [],
defaultCover: '/static/images/default-book.png', defaultCover: '/static/images/default-book.png',
loading: true,
}; };
}, },
@ -111,7 +119,7 @@ export default {
const formattedDate = `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}` const formattedDate = `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`
const params = { const params = {
'libcode': config.LIB_CODE,
'libcode': 'GD',
'starttime': formattedDate, 'starttime': formattedDate,
'endtime': this.getFormattedDate(new Date()), 'endtime': this.getFormattedDate(new Date()),
'rownum': 10, 'rownum': 10,
@ -132,9 +140,11 @@ export default {
} else { } else {
this.rankingData = []; this.rankingData = [];
} }
this.loading = false;
}).catch(error => { }).catch(error => {
console.error('排行接口错误', error) console.error('排行接口错误', error)
this.rankingData = []; this.rankingData = [];
this.loading = false;
}) })
} }
} }
@ -194,6 +204,18 @@ export default {
min-height: 60vh; min-height: 60vh;
} }
/* 加载中状态 */
.loading {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 50vh;
text-align: center;
color: #999;
font-size: 14px;
}
/* 空状态 */ /* 空状态 */
.empty { .empty {
height: 50vh; height: 50vh;

Loading…
Cancel
Save