Merge branch 'stat' into preview

This commit is contained in:
daihh
2022-12-08 18:02:09 +08:00
4 changed files with 100 additions and 82 deletions

View File

@@ -10,7 +10,7 @@
<!-- <text v-if="textShow && isTextShow == 1" class="text mid" style="color: #fff !important;" v-html="name"></text> <!-- <text v-if="textShow && isTextShow == 1" class="text mid" style="color: #fff !important;" v-html="name"></text>
<text v-if="textShow && isTextShow ==2" class="text mini" style="color: #fff !important;" v-html="name"></text> <text v-if="textShow && isTextShow ==2" class="text mini" style="color: #fff !important;" v-html="name"></text>
<text v-if="textShow && isTextShow ==3" class="text max" style="color: #fff !important;" v-html="name"></text> --> <text v-if="textShow && isTextShow ==3" class="text max" style="color: #fff !important;" v-html="name"></text> -->
<text class="text" style="color: #fff !important;" v-html="name"></text> <!-- <text class="text" style="color: #fff !important;" v-html="name"></text> -->
</view> </view>
</template> </template>

View File

@@ -3,7 +3,7 @@
<view style="line-height: 34upx;height: 35upx;padding-right: 40upx;font-size: 32upx;"> <view style="line-height: 34upx;height: 35upx;padding-right: 40upx;font-size: 32upx;">
<!-- <text style="color: #666;font-size: 30rpx;">筛选</text> --> <!-- <text style="color: #666;font-size: 30rpx;">筛选</text> -->
<image @click="showFilter()" src="../../static/images/filter.png" style="width: 36upx;height: 36upx;vertical-align: middle;"></image> <image @click="showFilter()" src="../../static/images/filter.png" style="width: 36upx;height: 36upx;vertical-align: middle;"></image>
<text class="clearsift" @click="clearsf()">清除筛选</text> <text v-if="clearswitch" class="clearsift" @click="clearsf()">清除筛选</text>
</view> </view>
<!-- ${filterWidth} --> <!-- ${filterWidth} -->
<u-popup :show="filterShow" mode="center" @close="closeFilter" :safeAreaInsetTop="true" :closeable="false"> <u-popup :show="filterShow" mode="center" @close="closeFilter" :safeAreaInsetTop="true" :closeable="false">
@@ -105,6 +105,7 @@
}, },
data(){ data(){
return{ return{
clearswitch:false,
courseSysTypeTree:[], courseSysTypeTree:[],
courseScenceList:[], courseScenceList:[],
filterShow:false,//是否显示过虑器 filterShow:false,//是否显示过虑器
@@ -132,6 +133,8 @@
mounted() { mounted() {
// this.filterWidth=(this.$width-100)+'px'; //右边出来的抽屉宽度控制 // this.filterWidth=(this.$width-100)+'px'; //右边出来的抽屉宽度控制
this.loadData(); this.loadData();
this.clswitch();
}, },
computed:{ computed:{
filterTags(){ //过滤标签 filterTags(){ //过滤标签
@@ -194,7 +197,22 @@
} }
}, },
methods:{ methods:{
clswitch(){
if(JSON.stringify(this.course.sysType1) !== '{}'){
this.clearswitch = true;
console.log(this.course,this.filterTags.length)
}else if(JSON.stringify(this.course.sysType2) !== '{}'){
this.clearswitch = true;
}else if(JSON.stringify(this.course.sysType2) !== '{}'){
this.clearswitch = true;
}else if(this.filterTags.length !== 0 && 3){
this.clearswitch = true;
}
},
// 清除筛选
clearsf(){ clearsf(){
console.log(this.filterTags);
if(this.type==1){//生成课程查询条件 if(this.type==1){//生成课程查询条件
let params={ let params={
pageIndex:1, pageIndex:1,
@@ -213,6 +231,7 @@
cateName:'' cateName:''
} }
this.$emit('submit',this.filterTags,params); this.$emit('submit',this.filterTags,params);
this.clearswitch = false;
} }
this.course.sysType1 = ''; this.course.sysType1 = '';
this.course.sysType2 = ''; this.course.sysType2 = '';
@@ -414,7 +433,8 @@
this.$emit('submit',this.filterTags,params); this.$emit('submit',this.filterTags,params);
} }
// console.log(this.filterTags.length,'llll')
this.clswitch();
} }
} }
} }

View File

@@ -453,7 +453,7 @@
let query = { let query = {
pageIndex:curData.pageIndex, pageIndex:curData.pageIndex,
pageSize:10, pageSize:10,
orderField:'', orderField:'studys',
topOrder:true, topOrder:true,
orderAsc:false, orderAsc:false,
device:2, device:2,
@@ -474,7 +474,7 @@
if(this.conType==0){ if(this.conType==0){
query.orderField='studys'; query.orderField='studys';
}else if(this.conType==1){ }else if(this.conType==1){
query.orderField='publishTime'; query.orderField='studys';
} }
if(this.dataFilter.courseParams.scenes){ if(this.dataFilter.courseParams.scenes){

View File

@@ -12,7 +12,7 @@
color: '#333333', color: '#333333',
fontWeight: '600', fontWeight: '600',
}"></u-tabs> }"></u-tabs>
<view v-show="activeTab == 0"> <!-- <view v-show="activeTab == 0">
<view class="box-info-top"> <view class="box-info-top">
<text class="top-text">我的排名<text class="text-num">{{experience.data.rankingNo}}</text></text> <text class="top-text">我的排名<text class="text-num">{{experience.data.rankingNo}}</text></text>
<text class="top-text" style="margin-left: 30upx;">我的经验值<text class="text-num">{{experience.data.total}}</text></text> <text class="top-text" style="margin-left: 30upx;">我的经验值<text class="text-num">{{experience.data.total}}</text></text>
@@ -48,15 +48,14 @@
</view> </view>
<view class="table-cell-tow"> <view class="table-cell-tow">
<author-img :avatar="userInfo.avatar" :sex="userInfo.sex"></author-img> <author-img :avatar="userInfo.avatar" :sex="userInfo.sex"></author-img>
<!-- <image style="width: 80upx;height:80upx;vertical-align: middle;" src="../../static/images/woman.png" mode=""></image> -->
<text class="table-cell-tow-name" style="color:#326DFF">{{userInfo.name}}</text> <text class="table-cell-tow-name" style="color:#326DFF">{{userInfo.name}}</text>
<text class="table-cell-tow-org" style="color:#326DFF">{{cutOrgNamePath(userInfo.departFullName)}}</text> <text class="table-cell-tow-org" style="color:#326DFF">{{cutOrgNamePath(userInfo.departFullName)}}</text>
</view> </view>
<view class="table-cell-three" style="color:#326DFF">{{experience.data.total}}</view> <view class="table-cell-three" style="color:#326DFF">{{experience.data.total}}</view>
</view> </view>
</view> </view>
</view> </view> -->
<view v-show="activeTab == 1"> <!-- <view v-show="activeTab == 1">
<view class="box-info-top"> <view class="box-info-top">
<text class="top-text">我的排名<text class="text-num">{{learningDuration.data.rankingNo}}</text></text> <text class="top-text">我的排名<text class="text-num">{{learningDuration.data.rankingNo}}</text></text>
<text class="top-text" style="margin-left: 30upx;">我的学习时长<text class="text-num">{{formatSecondToHour(learningDuration.data.total)}}</text>h</text> <text class="top-text" style="margin-left: 30upx;">我的学习时长<text class="text-num">{{formatSecondToHour(learningDuration.data.total)}}</text>h</text>
@@ -92,14 +91,13 @@
</view> </view>
<view class="table-cell-tow"> <view class="table-cell-tow">
<author-img :avatar="userInfo.avatar" :sex="userInfo.sex"></author-img> <author-img :avatar="userInfo.avatar" :sex="userInfo.sex"></author-img>
<!-- <image style="width: 80upx;height:80upx;vertical-align: middle;" src="../../static/images/woman.png" mode=""></image> -->
<text class="table-cell-tow-name" style="color:#326DFF">{{userInfo.name}}</text> <text class="table-cell-tow-name" style="color:#326DFF">{{userInfo.name}}</text>
<text class="table-cell-tow-org" style="color:#326DFF">{{cutOrgNamePath(userInfo.departFullName)}}</text> <text class="table-cell-tow-org" style="color:#326DFF">{{cutOrgNamePath(userInfo.departFullName)}}</text>
</view> </view>
<view class="table-cell-three" style="color:#326DFF">{{formatSecondToHour(learningDuration.data.total)}}</view> <view class="table-cell-three" style="color:#326DFF">{{formatSecondToHour(learningDuration.data.total)}}</view>
</view> </view>
</view> </view>
</view> </view> -->
<view v-show="activeTab == 2"> <view v-show="activeTab == 2">
<view class="box-info-top"> <view class="box-info-top">
<text class="top-text">我的排名<text class="text-num">{{learningDays.data.rankingNo}}</text></text> <text class="top-text">我的排名<text class="text-num">{{learningDays.data.rankingNo}}</text></text>
@@ -158,11 +156,11 @@
formatSecondToHour, formatSecondToHour,
cutOrgNamePath, cutOrgNamePath,
tabList:[ tabList:[
{ name: '经验值'}, // { name: '经验值'},
{ name: '学习时长'}, // { name: '学习时长'},
{ name: '学习天数'}, { name: '学习天数'},
], ],
activeTab:0, activeTab:2,
rankingList:{}, rankingList:{},
userInfo:{}, userInfo:{},
learningDays:{ learningDays:{
@@ -203,8 +201,8 @@
onLoad(options) { onLoad(options) {
this.$store.dispatch('GetUserInfo').then(rs => { this.$store.dispatch('GetUserInfo').then(rs => {
this.userInfo = rs; this.userInfo = rs;
this.getExperience(); // this.getExperience();
this.getDuration(); // this.getDuration();
this.getDays(); this.getDays();
this.userInfo.avatar = this.userInfo.avatar.substring(this.userInfo.avatar.indexOf("upload")+6); this.userInfo.avatar = this.userInfo.avatar.substring(this.userInfo.avatar.indexOf("upload")+6);
}); });
@@ -214,72 +212,72 @@
back(){ back(){
uni.navigateBack(); uni.navigateBack();
}, },
clickTabs(item) { // clickTabs(item) {
this.activeTab = item.index; // this.activeTab = item.index;
}, // },
getExperience() {//经验值 // getExperience() {//经验值
let data = { // let data = {
aid:this.userInfo.aid,// #用户id // aid:this.userInfo.aid,// #用户id
statType:20, // #统计类型 10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数 // statType:20, // #统计类型 10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数
field:'total',// #统计周期 todays-当天,weeks-周,months-月,years-年 total-总计 // field:'total',// #统计周期 todays-当天,weeks-周,months-月,years-年 total-总计
num:5,// #显示的条数 // num:5,// #显示的条数
} // }
apiStat.getRanking(data).then(res=>{ // apiStat.getRanking(data).then(res=>{
if(res.status==200){ // if(res.status==200){
if(res.result.currentUserRankingData) { // if(res.result.currentUserRankingData) {
res.result.currentUserRankingData.authorInfo={ // res.result.currentUserRankingData.authorInfo={
aid: "", // aid: "",
name: "", // name: "",
orgInfo: "", // orgInfo: "",
avatar: "", // avatar: "",
sex: null // sex: null
} // }
this.experience.data = res.result.currentUserRankingData; // this.experience.data = res.result.currentUserRankingData;
} // }
const ids= []; // const ids= [];
res.result.rankingData.forEach(item=>{ // res.result.rankingData.forEach(item=>{
ids.push(item.aid) // ids.push(item.aid)
item.authorInfo = { // item.authorInfo = {
aid: "", // aid: "",
name: "", // name: "",
orgInfo: "", // orgInfo: "",
avatar: "", // avatar: "",
sex: null // sex: null
} // }
}) // })
this.getUserData(ids,res.result.rankingData) // this.getUserData(ids,res.result.rankingData)
this.experience.list = res.result.rankingData; // this.experience.list = res.result.rankingData;
} // }
}) // })
}, // },
getDuration() {//学习时长 // getDuration() {//学习时长
let data = { // let data = {
aid:this.userInfo.aid,// #用户id // aid:this.userInfo.aid,// #用户id
statType:10, // #统计类型 10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数 // statType:10, // #统计类型 10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数
field:'total',// #统计周期 todays-当天,weeks-周,months-月,years-年 total-总计 // field:'total',// #统计周期 todays-当天,weeks-周,months-月,years-年 total-总计
num:5,// #显示的条数 // num:5,// #显示的条数
} // }
apiStat.getRanking(data).then(res=>{ // apiStat.getRanking(data).then(res=>{
if(res.status==200){ // if(res.status==200){
if(res.result.currentUserRankingData) { // if(res.result.currentUserRankingData) {
this.learningDuration.data = res.result.currentUserRankingData; // this.learningDuration.data = res.result.currentUserRankingData;
} // }
const ids= []; // const ids= [];
res.result.rankingData.forEach(item=>{ // res.result.rankingData.forEach(item=>{
ids.push(item.aid) // ids.push(item.aid)
item.authorInfo = { // item.authorInfo = {
aid: "", // aid: "",
name: "", // name: "",
orgInfo: "", // orgInfo: "",
avatar: "", // avatar: "",
sex: null // sex: null
} // }
}) // })
this.getUserData(ids,res.result.rankingData) // this.getUserData(ids,res.result.rankingData)
this.learningDuration.list = res.result.rankingData; // this.learningDuration.list = res.result.rankingData;
} // }
}) // })
}, // },
//学习天数 //学习天数
getDays() { getDays() {
let data = { let data = {