提交修改

This commit is contained in:
daihh
2022-11-14 14:20:41 +08:00
parent f098615ec5
commit 4bbb616a1d
4 changed files with 149 additions and 36 deletions

View File

@@ -76,6 +76,18 @@ const courseSearch=function(query){
return ajax.post('/xboe/m/course/fulltext/search',query); return ajax.post('/xboe/m/course/fulltext/search',query);
} }
/*
* 课程详情页推荐列表
* @param num 条数
* 以下参数 详情中有就传,没有就不传
* @param sysType1
* @param sysType2
* @param sysType3
* */
const recommendList=function (data){
return ajax.post('/xboe/m/course/portal/mobile-recommend',data);
}
export default { export default {
courseSearch, courseSearch,
list, list,
@@ -83,5 +95,6 @@ export default {
detail, detail,
ranking, ranking,
scorelist, scorelist,
recommendList,
getTeacherByCourseIDs getTeacherByCourseIDs
} }

View File

@@ -1,19 +1,28 @@
<template> <template>
<view> <view>
<u-toast ref="messager"></u-toast> <u-toast ref="messager" style="z-index:100090"></u-toast>
<!--分享窗口--> <!--分享窗口-->
<u-popup :show="show" @close="closeShare" @open="openShare" mode="bottom"> <u-popup :show="show" :closeOnClickOverlay="false" @close="closeShare" :round="14" @open="openShare" mode="bottom">
<view style="padding: 10px 20px;line-height: 60upx;"> <view style="padding: 20px 20px;line-height: 60upx;">
<view style="padding: 10upx;">请输入要分享给人的姓名</view> <view style="padding: 30upx 20upx;color:#666666;text-align: center;">
<text>请输入要分享给人的姓名/工号</text>
<text @click="closeShare" style="float: right;"><image src="/static/images/close.png" style="width: 50upx;height: 50upx;"></image> </text>
</view>
<view style="padding: 10upx;"> <view style="padding: 10upx;">
<u--input placeholder="请输入人员姓名" border="surround" v-model="keyword"></u--input> <u-search @search="findUsers()" height="40px" bgColor="#ffffff" borderColor="rgba(153,153,153,0.3)" :showAction="false" shape="round" v-model="keyword" placeholder="姓名/工号"></u-search>
</view> </view>
<view style="padding-top:20upx;"> <!-- <view style="padding-top:20upx;">
<u-button @click="findUsers()" type="primary" text="查询"></u-button> <u-button @click="findUsers()" type="primary" text="查询"></u-button>
</view> </view> -->
<view style="padding-top: 50upx;"> <view style="padding-top: 50upx;">
<!--查询内容列表--> <view v-if="users.length>0" style="overflow-x: auto;height: 160upx;white-space: nowrap;overflow-y: hidden;">
<view style="line-height: 60upx;" v-for="(su,suidx) in users" :key="suidx" @click="confirmShare(su)">{{suidx+1}}, {{su.name}} {{su.code}}</view> <view style="line-height: 60upx;display: inline-block;margin: 10upx;" v-for="(su,suidx) in users" :key="suidx" @click="confirmShare(su)">
<view style="text-align: center;"><!--用户头像-->
<image src="/static/images/man.png" shape="circle" style="width: 80upx;height: 80upx;"></image>
</view>
<view style="text-align: center;font-size: 22upx;">{{su.name}}({{su.code}})</view>
</view>
</view>
</view> </view>
</view> </view>
</u-popup> </u-popup>
@@ -22,6 +31,8 @@
<script> <script>
import apiShares from '@/api/modules/shares.js' import apiShares from '@/api/modules/shares.js'
import apiUser from '@/api/system/user.js'
import apiMessage from '@/api/system/message.js'
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
export default { export default {
props: { props: {
@@ -51,13 +62,42 @@
} }
}, },
methods:{ methods:{
messageSave(refId,title,sendName,acceptName,acceptId,typeText){
let content='';
let conType;
if(this.type==1){ content='课程'; conType = this.data.type; }
if(this.type==2){ content='文章' }
if(this.type==3){ content='案例' }
if(this.type==4){ content='问答' }
content=sendName+typeText+content+'-'+title
let message={
content,
refId,
refType:this.type,
sendName,
acceptName,
acceptId,
title:'系统消息',
sendType:1,
conType,
content,
source:1,
sendAid:this.userInfo.aid,
}
apiMessage.save(message).then(res=>{
if(res.status==200){
}
})
},
openShare(){ openShare(){
this.show=true; this.show=true;
}, },
findUsers(){ findUsers(){
this.users=[]; this.users=[];
if(!this.keyword){ if(!this.keyword){
return this.$refs.messager.show({message:'请输入工号或姓名',type:'warning'}); this.$refs.messager.show({message:'请输入工号或姓名',type:'warning'});
return
} }
var name=this.keyword; var name=this.keyword;
var regPos = /^\d+(\.\d+)?$/; //非负浮点数 var regPos = /^\d+(\.\d+)?$/; //非负浮点数
@@ -83,7 +123,7 @@
//uni.showToast({title: rs.message,icon: 'none'}); //uni.showToast({title: rs.message,icon: 'none'});
this.$refs.messager.show({message:rs.message,type:'error'}); this.$refs.messager.show({message:rs.message,type:'error'});
}else{ }else{
this.shareInfo.users=rs.result; this.users=rs.result;
} }
}else{ }else{
//uni.showToast({ title: rs.message, icon: 'none' }); //uni.showToast({ title: rs.message, icon: 'none' });
@@ -96,6 +136,10 @@
this.show=false; this.show=false;
}, },
confirmShare(u){ confirmShare(u){
if(this.type==0){
this.$refs.messager.show({message:'未指定源类型',type:'error'});
return;
}
let conType; let conType;
if(this.type == 1) { if(this.type == 1) {
conType = this.data.type; conType = this.data.type;
@@ -111,7 +155,7 @@
} }
if(this.userInfo.aid==postData.toAid){ if(this.userInfo.aid==postData.toAid){
//uni.showToast({title: '不能分享给自己', icon: 'none' }); //uni.showToast({title: '不能分享给自己', icon: 'none' });
this.$refs.messager.show({message:'不能分享给自己',type:'error'}); this.$refs.messager.show({message:'不能分享给自己',type:'error',zIndex:100090});
} }
apiShares.save(postData).then(rs=>{ apiShares.save(postData).then(rs=>{
if(rs.status==200){ if(rs.status==200){
@@ -122,19 +166,20 @@
if(this.type!=3){ if(this.type!=3){
if(this.type==1){ if(this.type==1){
//发送消息 //发送消息
//this.messageSave(this.data.id,this.data.name,this.userInfo.name,u.name,u.aid,'分享给我的'); this.messageSave(this.data.id,this.data.name,this.userInfo.name,u.name,u.aid,'分享给我的');
}else{ }else{
//this.messageSave(this.data.id,this.data.title,this.userInfo.name,u.name,u.aid,'分享给我的'); this.messageSave(this.data.id,this.data.title,this.userInfo.name,u.name,u.aid,'分享给我的');
} }
} }
this.show=false;
}else{ }else{
//uni.showToast({title: '分享失败,您不能将同一资源多次分享给同一个人',icon: 'none'}); this.$refs.messager.show({message:'已分享过,不能再分享',type:'warning'});
this.$refs.messager.show({message:'分享失败,您不能将同一资源多次分享给同一个人',type:'warning'});
} }
}else{ }else{
// this.$message({message:'分享失败',type:'success'}); // this.$message({message:'分享失败',type:'success'});
this.$refs.interactToast.show({message:'分享处理失败',type:'error'}); this.$refs.messager.show({message:rs.message,type:'error',zIndex:100090});
console.log(rs.message);
} }
}); });
}, },

View File

@@ -16,7 +16,7 @@ if(process.env.NODE_ENV === 'development'){
oldApiBaseUrl = '/uboeApi'; oldApiBaseUrl = '/uboeApi';
statApiBaseUrl='/statApi'; statApiBaseUrl='/statApi';
socialApiBaseUrl='/socialApi'; socialApiBaseUrl='/socialApi';
fileUrl = 'http://192.168.0.11:9090/cdn/upload'; fileUrl = 'http://127.0.0.1:9090/cdn/upload';
loginPath='/pages/login/login'; loginPath='/pages/login/login';
}else if(process.env.NODE_ENV === 'preview'){ }else if(process.env.NODE_ENV === 'preview'){
// 预发布环境,当前配置未使用上 // 预发布环境,当前配置未使用上

View File

@@ -118,7 +118,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="contentbox"> <view class="contentbox" v-if="courseInfo.name">
<view v-if="!catalogShow"> <view v-if="!catalogShow">
<view class="tabrow"> <view class="tabrow">
<view class="tabrow-item" @click="changeTab(1)"><text :class="{'tabrow-active':tabIndex==1}">简介</text></view> <view class="tabrow-item" @click="changeTab(1)"><text :class="{'tabrow-active':tabIndex==1}">简介</text></view>
@@ -128,8 +128,9 @@
<view v-if="tabIndex==1" class="cinfo"> <view v-if="tabIndex==1" class="cinfo">
<view class="cinfo-title"> <view class="cinfo-title">
{{courseInfo.name}} {{courseInfo.name}}
<text class="cinfo-tag1">通用力</text> <text class="cinfo-tag1">{{convertTypeName(courseInfo.sysType1)}}</text>
<text class="cinfo-tag2">职场技能</text> <text v-if="courseInfo.sysType2" class="cinfo-tag2">{{convertTypeName(courseInfo.sysType2)}}</text>
<text v-if="courseInfo.sysType3" class="cinfo-tag2">{{convertTypeName(courseInfo.sysType3)}}</text>
</view> </view>
<view class="desrow"> <view class="desrow">
<view> <view>
@@ -357,26 +358,26 @@
</u-popup> </u-popup>
<!-- 评分赞和踩 --> <!-- 评分赞和踩 -->
<u-popup :show="scoreInfo.dlgShow" mode="center" :closeable="false" :closeOnClickOverlay="false" :round="14" @close="closeScore" @open="openScore"> <u-popup :show="scoreInfo.dlgShow" mode="center" :closeable="false" :closeOnClickOverlay="false" :round="14" @close="closeScore" @open="openScore">
<view> <view class="dlgscore">
<view style="text-align: center;padding: 50upx 100upx 0upx 100upx;"> <view class="dlgscore-top">
<view style="text-align: center;font-size: 36upx;">课程评价</view> <view class="dlgscore-title">课程评价</view>
<view style="text-align: center;color: #999999;font-size: 24upx;padding-top: 10upx;">对课程进行评分吧</view> <view class="dlgscore-desc">对课程进行评分吧</view>
<view style="padding-top: 40upx;display: flex;justify-content: center;"> <view class="dlgscore-score">
<u-rate :count="5" :size="35" activeColor="#F37101" v-model="scoreInfo.score"></u-rate> <u-rate :count="5" :size="35" activeColor="#F37101" v-model="scoreInfo.score"></u-rate>
</view> </view>
</view> </view>
<view style="margin-top: 60upx;height: 100upx;display: flex;justify-content: center;border-top: 1px solid rgba(153,153,153,0.14);"> <view class="dlgscore-btns">
<view style="text-align: center;width: 49%;border-right:1px solid rgba(153,153,153,0.14);line-height: 100upx;"> <view class="dlgscore-cancel">
<text @click="closeScore" style="color: #666666;">取消</text> <text @click="closeScore">取消</text>
</view> </view>
<view style="text-align: center;width: 50%;line-height: 100upx;"> <view class="dlgscore-submit">
<text @click="addScore()" style="color: #387DF7;">提交</text> <text @click="addScore()">提交</text>
</view> </view>
<!-- <u-button type="primary" @click="addScore()" text="提交评分"></u-button> --> <!-- <u-button type="primary" @click="addScore()" text="提交评分"></u-button> -->
</view> </view>
</view> </view>
</u-popup> </u-popup>
<interact-share ref="comShare" :data="courseInfo"></interact-share> <interact-share ref="comShare" :data="courseInfo":type="1"></interact-share>
</view> </view>
</template> </template>
@@ -395,7 +396,7 @@
import {getContentType} from "@/utils/tools.js"; import {getContentType} from "@/utils/tools.js";
import studyUtil from '@/utils/study.js'; import studyUtil from '@/utils/study.js';
import {toScore,cutOrgNamePath,formatUserNumber} from '@/utils/tools.js'; import {toScore,cutOrgNamePath,formatUserNumber} from '@/utils/tools.js';
import {mapGetters} from 'vuex' import {mapGetters,mapActions} from 'vuex'
export default { export default {
data(){ data(){
return{ return{
@@ -463,7 +464,7 @@
} }
}, },
computed: { computed: {
...mapGetters(['userInfo']), ...mapGetters(['userInfo','sysTypeMap']),
catalogTree(){ catalogTree(){
let treeList=[]; let treeList=[];
let $this=this; let $this=this;
@@ -515,6 +516,8 @@
this.courseId=options.id; this.courseId=options.id;
this.courseInfo.id=options.id; this.courseInfo.id=options.id;
this.loadDetail();//加载课程数据 this.loadDetail();//加载课程数据
this.getSysTypeTree();
this.loadSysTypes();
this.loadReCourses();//加载推荐课程 this.loadReCourses();//加载推荐课程
this.loadIsData();//加载关注,收藏,评价等信息 this.loadIsData();//加载关注,收藏,评价等信息
}, },
@@ -526,6 +529,16 @@
this.videoPlayer=uni.createVideoContext("myVideo", this); this.videoPlayer=uni.createVideoContext("myVideo", this);
}, },
methods:{ methods:{
...mapActions({
// getResOwnerTree:'resOwner/getResOwnerTree',
// loadResOwners:'resOwner/loadResOwners',
getSysTypeTree:'sysType/getSysTypeTree',
loadSysTypes:'sysType/loadSysTypes'
}),
convertTypeName(code){
if(!code){return '';}
return this.sysTypeMap.get(code);
},
loadDetail(){ loadDetail(){
let $this=this; let $this=this;
uni.showLoading({title:'加载中...'}) uni.showLoading({title:'加载中...'})
@@ -731,7 +744,7 @@
sysType2:this.courseInfo.sysType2, sysType2:this.courseInfo.sysType2,
sysType3:this.courseInfo.sysType3 sysType3:this.courseInfo.sysType3
} }
apiCourseStudy.courseRecommends(dto).then(rs=>{ apiCoursePortal.recommendList(dto).then(rs=>{
if(rs.status==200){ if(rs.status==200){
this.recommendCourses=rs.result; this.recommendCourses=rs.result;
} }
@@ -876,6 +889,7 @@
this.$refs.comments.loadData(false); this.$refs.comments.loadData(false);
}, },
openShare(){ openShare(){
this.$refs.messager.show({message:'打开分享',type:'success'});
//console.log(this.$refs.fiexdbar,'this.$refs.fiexdbar'); //console.log(this.$refs.fiexdbar,'this.$refs.fiexdbar');
//因为开始是v-if控制的所以这里获取不到必须显示时才会获取到所以需要单独的弄一个分享组件 //因为开始是v-if控制的所以这里获取不到必须显示时才会获取到所以需要单独的弄一个分享组件
this.$refs.comShare.openShare(); this.$refs.comShare.openShare();
@@ -1580,4 +1594,45 @@
} }
} }
} }
.dlgscore{ //评分的样式
.dlgscore-top{
text-align: center;
padding: 50upx 100upx 0upx 100upx;
.dlgscore-title{
text-align: center;
font-size: 36upx;
}
.dlgscore-desc{
text-align: center;
color: #999999;
font-size: 24upx;
padding-top: 10upx;
}
.dlgscore-score{
padding-top: 40upx;
display: flex;
justify-content: center;
}
}
.dlgscore-btns{
margin-top: 60upx;
height: 100upx;
display: flex;
justify-content: center;
border-top: 1px solid rgba(153,153,153,0.14);
.dlgscore-cancel{
text-align: center;
width: 49%;
border-right:1px solid rgba(153,153,153,0.14);
line-height: 100upx;
color: #666666;
}
.dlgscore-submit{
text-align: center;
width: 50%;
line-height: 100upx;
color: #387DF7;
}
}
}
</style> </style>