Skip to content

Commit

Permalink
升级uniapp端
Browse files Browse the repository at this point in the history
  • Loading branch information
virus010101 committed Sep 2, 2024
1 parent a7503b2 commit c511c62
Show file tree
Hide file tree
Showing 4 changed files with 160 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<text v-if="item.userInfo.type == 1" class="official">官方</text>
<text class="username">{{ item.userInfo.username.substring(0, 10) }}</text>
</view>
<view class="">
<view>
<text v-if="item.postTop>0" class="officials">置顶</text>
<text v-if="item.status==1" class="officials">审核中</text>
<text v-if="item.status==2" class="officials">已下架</text>
Expand Down Expand Up @@ -152,12 +152,9 @@
jump(e) {
let url;
// 图文
if (e.type == 1 || e.type == 4) {
if (e.type == 1) {
url = '/pages/post/post?id=' + e.id;
}
uni.navigateTo({
url: url
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<u-icon class="u-icon" name="arrow-right"></u-icon>
</view>
<view class="button-style">
<u-button v-if="form.type == 1" :custom-style="btnStyle" @click="uploadImg" shape="circle">发布</u-button>
<u-button :custom-style="btnStyle" @click="uploadImg" shape="circle">发布</u-button>
</view>
</view>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,40 @@
</view>
<!-- 发帖达人(查询本月发帖活跃用户) -->
<view v-show="pageCurrent == 1">
<navigator :url="'/pages/user/home?uid=' + item.uid" class="user-item" hover-class="none"
v-for="(item, index) in userList" :key="index">
<view v-if="index < 3" class="user-index-hot">{{ index + 1 }}</view>
<view v-else class="user-index-common">{{ index + 1 }}</view>
<image class="avatar" mode="aspectFill" :src="item.avatar"></image>
<view class="right">
<text class="username">{{ item.username }}</text>
<view class="tag-wrap">
<text class="tag" :key="index2">{{ item.intro }}</text>
<text class="post-num" :key="index2">+{{ item.postNumber }}</text>
<view style="background-color: #aaaaff;">
<view class="tab">
<!-- <view :class="{'tab-active' : currentRank === 0}" @click="tabChangeRank()"><text>发帖周排行</text></view> -->
<!-- <view :class="{'tab-active' : currentRank === 1}" @click="tabChangeRank()"><text>发帖月排行</text></view> -->
</view>
<view class="top" v-if="userList.length > 0">
<view class="top-item" v-if="userList.length >= 2 && userList[1]">
<image class="top-item-avatar" :src="userList[1].avatar"></image>
<text class="top-item-name">{{userList[1].username}}</text>
<text class="top-item-score">+{{userList[1].postNumber}}</text>
</view>
<view class="top-item" >
<image class="top-item-avatar" :src="userList[0].avatar"></image>
<text class="top-item-name">{{userList[0].username}}</text>
<text class="top-item-score">+{{userList[0].postNumber}}</text>
</view>
<view class="top-item" v-if="userList.length >= 3 && userList[2]">
<image class="top-item-avatar" :src="userList[2].avatar"></image>
<text class="top-item-name">{{userList[2].username}}</text>
<text class="top-item-score">+{{userList[2].postNumber}}</text>
</view>
</view>
</navigator>
<view class="ranking">
<view class="ranking-list-item" v-if="userList.length > 0" v-for="(item,index) in userList" :key="index">
<text class="ranking-list-number">{{index+1}}</text>
<view class="ranking-list-nickname" @click="goUser(item.uid)">
<image :src="item.avatar"></image>
<text>{{item.username}}</text>
</view>
<text class="ranking-list-score">+{{item.postNumber}}</text>
</view>
</view>
</view>

<!-- 加载状态 -->
<block v-if="userList.length === 0 && loadStatus == 'nomore'">
<u-empty margin-top="100" text="暂无内容" mode="favor"></u-empty>
Expand Down Expand Up @@ -74,7 +95,8 @@
classId: 0,
page: 1,
userList: [],
loadStatus: 'nomore'
loadStatus: 'nomore',
currentRank: 0
}
},
onLoad() {
Expand Down Expand Up @@ -112,6 +134,9 @@
}
},
methods: {
tabChangeRank() {
this.currentRank = this.currentRank ? 0 : 1;
},
getBannerList() {
this.$H.get('link/list').then(res => {
if (res.code == 0) {
Expand All @@ -130,6 +155,12 @@
url: '/pages/post/add'
})
},
goUser(uid){
console.log(uid)
uni.navigateTo({
url: "/pages/user/home?uid="+uid
})
},
goLogin() {
// #ifdef MP-WEIXIN
uni.navigateTo({
Expand Down Expand Up @@ -202,84 +233,129 @@
padding: 0 40rpx;
}
// 用户列表
.user-item {
margin: 30rpx;
padding: 20rpx;
.tab {
display: flex;
border-bottom: 1px solid #f5f5f5;
.user-index-hot {
margin: 20rpx 20rpx 0rpx 0rpx;
color: #fff;
background-image: linear-gradient(#e64340, #ffaac3);
width: 55rpx;
height: 55rpx;
border-radius: 50%;
justify-content: center;
align-items: center;
padding: 25rpx;
color: #fff;
margin-bottom: 25rpx;
view {
height: 70rpx;
width: 220rpx;
line-height: 70rpx;
box-sizing: border-box;
border: 1px solid #fff;
font-size: 16px;
text-align: center;
line-height: 55rpx;
font-weight: bold;
&:nth-child(1) {
border-radius: 35rpx 0 0 35rpx;
}
&:nth-child(2) {
border-radius: 0 35rpx 35rpx 0;
}
}
.user-index-common {
margin: 20rpx 20rpx 0rpx 0rpx;
color: #fff;
background-image: linear-gradient(#000000, #949494);
width: 55rpx;
height: 55rpx;
border-radius: 50%;
text-align: center;
line-height: 55rpx;
.tab-active {
background: #fff;
color: #000000;
}
.user-index {
margin-right: 20rpx;
color: #aaaaff;
font-weight: bold;
}
.top {
width: 660rpx;
margin: auto;
display: flex;
justify-content: space-between;
align-items: flex-end;
.top-item {
width: 200rpx;
height: 300rpx;
display: flex;
justify-content: center;
flex-direction: column;
position: relative;
align-items: center;
border-radius: 100rpx 100rpx 0 0;
color: #fff;
&:nth-child(1) {
.top-item-avatar {
border: 8rpx solid #c7c7c7;
}
}
&:nth-child(2) {
height: 320rpx;
.top-item-avatar {
border: 8rpx solid #ffff00;
}
}
&:nth-child(3) {
.top-item-avatar {
border: 8rpx solid #aa5500;
}
}
.top-item-avatar {
border-radius: 50%;
width: 140rpx;
height: 140rpx;
}
.top-item-score{
font-size: 16px;
}
.top-item-name{
margin: 10rpx 0;
}
}
.avatar {
width: 100rpx;
height: 100rpx;
border-radius: 10rpx;
margin-right: 20rpx;
}
.right {
flex: 1;
.username {
font-weight: bold;
}
.ranking{
width: 700rpx;
border-radius: 30rpx;
margin: auto;
background: #fff;
box-sizing: border-box;
padding: 20rpx;
.ranking-list-item{
height: 110rpx;
display: flex;
align-items: center;
font-size: 14px;
.ranking-list-number{
display: block;
width: 70rpx;
color: #777;
}
.tag-wrap {
font-size: 24rpx;
.tag {
display: inline-block;
border-radius: 10rpx;
.ranking-list-score{
display: block;
width: 70rpx;
color: #E28935;
font-size: 16px;
}
.ranking-list-nickname{
display: flex;
align-items: center;
width: calc(100% - 140rpx);
image{
width: 80rpx;
height: 80rpx;
border-radius: 50%;
margin-right: 20rpx;
margin-top: 40rpx;
color: #a3a3a3;
font-size: 22rpx;
}
.post-num {
display: inline-block;
border-radius: 10rpx;
margin-right: 20rpx;
margin-top: 40rpx;
color: #aaaaff;
font-size: 36rpx;
font-weight: 800;
text{
width: auto;
}
}
}
.no-info {
margin: 30rpx 0;
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,15 @@
display: flex;
align-items: center;
justify-content: center;
color: #737373;
color: #888888;
font-size: 32rpx;
font-weight: 600;
font-weight: 400;
}
.bottom-info-t{
display: flex;
align-items: center;
justify-content: center;
color: #1f1f1f;
color: #888888;
font-size: 28rpx;
font-weight: 400;
}
Expand Down

0 comments on commit c511c62

Please sign in to comment.