This commit is contained in:
lnn19986213 2023-08-04 13:59:39 +08:00
parent 42ecbb5beb
commit 69c08cf877
2 changed files with 41 additions and 17 deletions

View File

@ -91,7 +91,8 @@
<view class="worksPart" v-if="workList.length > 0">
<view class="workItems" v-for="(v,i) in workList" :key="i" @click="goWorkDetail(v.id)">
<view class="sort" v-if="data.status != 0">
NO.<text>{{ i+1 }}</text>
<text>NO.<text style="font-size: 32rpx;">{{ i+1 }}</text></text>
<text>{{ v.averageScore }}</text>
</view>
<view class="workImg">
<image :src="v.file" style="width: 100%; height: 100%;"></image>
@ -100,7 +101,6 @@
{{v.name}}
</view>
</view>
</view>
<view v-else>
<u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
@ -129,13 +129,13 @@
onReady() {
const systemMsg = uni.getSystemInfoSync();
this.statusHeight = systemMsg.statusBarHeight
// #ifdef MP-WEIXIN
const menuButtonInfo = uni.getMenuButtonBoundingClientRect() //
this.titleHeight = menuButtonInfo.height + (menuButtonInfo.top - systemMsg.statusBarHeight) * 2
this.topHeight = this.statusHeight + this.titleHeight
// #endif
// #ifndef MP-WEIXIN
//
this.topHeight = this.statusHeight + this.titleHeight
@ -173,7 +173,7 @@
if (res.data.file) {
this.list = res.data.file.split(',')
}
if(res.data.list && res.data.list.length > 0){
if (res.data.list && res.data.list.length > 0) {
res.data.list.forEach(function(item) {
if (item.file) {
let fileArr = item.file.split(',')
@ -182,6 +182,7 @@
that.workList.push(item)
})
}
this.workList = this.workList.sort(this.sortBy('averageScore', false))
this.data = res.data
this.load = false
}
@ -191,9 +192,29 @@
icon: "none",
});
})
},
sortBy(attr, rev) {
//
if (rev == undefined) {
rev = 1;
} else {
rev = (rev) ? 1 : -1;
}
return function(a, b) {
a = a[attr];
b = b[attr];
if (a < b) {
return rev * -1;
}
if (a > b) {
return rev * 1;
}
return 0;
}
}
},
}
</script>
@ -355,7 +376,7 @@
.workItems {
width: 320rpx;
height: 240rpx;
height: 280rpx;
margin-bottom: 24rpx;
.workImg {
@ -367,6 +388,12 @@
width: 320rpx;
height: 40rpx;
}
.sort{
width: 320rpx;
height: 40rpx;
display: flex;
justify-content: space-between;
}
}
}

View File

@ -29,7 +29,13 @@
<view class="textList" v-if="isExpert">
<view class="type">
<img class='textImg' src="../../static/detailIcon/icon10.png" alt="">
<view class="text1">您的评分<text class="redText">{{ data.score }}</text></view>
<view class="text1">您的评分<text class="redText">{{ data.myScore }}</text></view>
</view>
</view>
<view class="textList" v-if="isExpert">
<view class="type">
<img class='textImg' src="../../static/detailIcon/icon10.png" alt="">
<view class="text1">作品平均分<text class="redText">{{ data.averageScore }}</text></view>
</view>
</view>
</view>
@ -134,15 +140,6 @@
if (res.data.file) {
this.list = res.data.file.split(',')
}
if (res.data.list && res.data.list.length > 0) {
res.data.list.forEach(function(item) {
if (item.file) {
let fileArr = item.file.split(',')
item.file = fileArr[0]
}
that.workList.push(item)
})
}
this.data = res.data
this.load = false
}