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. 5
      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
export function FetchInitReaderMessage(data) {
// libcode openId page phone readCardNo readName size title
export function FetchInitReaderMessage(data) {
return request({
url: '/api/weixin/initReaderMessage',
data
@ -138,18 +139,3 @@ export function FetchReaderMessage(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>
<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
class="book-cover"
:src="item.base64Cover || '/static/images/default-book.png'"

4
static/iconfont.css

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

BIN
static/iconfont.ttf

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

@ -3,13 +3,14 @@
<view class="section">
<text class="subject">{{ detail.title }}</text>
<view class="section-content">{{ detail.suggestion }}</view>
<text class="time">{{ formatTimestamp(detail.suggestionTime) }}</text>
<text class="time">{{ formatTimestamp(detail.suggestionTime) }}</text>
</view>
<view class="section reply-section">
<view class="section-title">馆方回复</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>
</template>

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

@ -20,6 +20,7 @@
<text class="subject">{{ item.title }}</text>
<text class="create-time">{{ formatTimestamp(item.suggestionTime) }}</text>
</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 class="loading-more" v-if="loading">
<text>加载中...</text>
@ -180,6 +181,7 @@ export default {
}
.feedback-item {
position: relative;
background-color: #fff;
border-radius: 8px;
padding: 15px;

26
subpkg/pages/ranking/ranking.vue

@ -16,8 +16,14 @@
</view>
<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>
<text style="margin-top: 20px;">暂无读者排行数据</text>
</view>
@ -31,6 +37,7 @@
]"
v-for="(item, index) in rankingData"
: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>
@ -78,6 +85,7 @@ export default {
return {
rankingData: [],
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 params = {
'libcode': config.LIB_CODE,
'libcode': 'GD',
'starttime': formattedDate,
'endtime': this.getFormattedDate(new Date()),
'rownum': 10,
@ -132,9 +140,11 @@ export default {
} else {
this.rankingData = [];
}
this.loading = false;
}).catch(error => {
console.error('排行接口错误', error)
this.rankingData = [];
this.loading = false;
})
}
}
@ -194,6 +204,18 @@ export default {
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 {
height: 50vh;

Loading…
Cancel
Save