提交修改

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

View File

@@ -1,19 +1,28 @@
<template>
<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">
<view style="padding: 10px 20px;line-height: 60upx;">
<view style="padding: 10upx;">请输入要分享给人的姓名</view>
<u-popup :show="show" :closeOnClickOverlay="false" @close="closeShare" :round="14" @open="openShare" mode="bottom">
<view style="padding: 20px 20px;line-height: 60upx;">
<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;">
<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 style="padding-top:20upx;">
<!-- <view style="padding-top:20upx;">
<u-button @click="findUsers()" type="primary" text="查询"></u-button>
</view>
</view> -->
<view style="padding-top: 50upx;">
<!--查询内容列表-->
<view style="line-height: 60upx;" v-for="(su,suidx) in users" :key="suidx" @click="confirmShare(su)">{{suidx+1}}, {{su.name}} {{su.code}}</view>
<view v-if="users.length>0" style="overflow-x: auto;height: 160upx;white-space: nowrap;overflow-y: hidden;">
<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>
</u-popup>
@@ -22,6 +31,8 @@
<script>
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';
export default {
props: {
@@ -51,13 +62,42 @@
}
},
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(){
this.show=true;
},
findUsers(){
this.users=[];
if(!this.keyword){
return this.$refs.messager.show({message:'请输入工号或姓名',type:'warning'});
this.$refs.messager.show({message:'请输入工号或姓名',type:'warning'});
return
}
var name=this.keyword;
var regPos = /^\d+(\.\d+)?$/; //非负浮点数
@@ -83,7 +123,7 @@
//uni.showToast({title: rs.message,icon: 'none'});
this.$refs.messager.show({message:rs.message,type:'error'});
}else{
this.shareInfo.users=rs.result;
this.users=rs.result;
}
}else{
//uni.showToast({ title: rs.message, icon: 'none' });
@@ -96,6 +136,10 @@
this.show=false;
},
confirmShare(u){
if(this.type==0){
this.$refs.messager.show({message:'未指定源类型',type:'error'});
return;
}
let conType;
if(this.type == 1) {
conType = this.data.type;
@@ -111,7 +155,7 @@
}
if(this.userInfo.aid==postData.toAid){
//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=>{
if(rs.status==200){
@@ -122,19 +166,20 @@
if(this.type!=3){
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{
//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{
//uni.showToast({title: '分享失败,您不能将同一资源多次分享给同一个人',icon: 'none'});
this.$refs.messager.show({message:'分享失败,您不能将同一资源多次分享给同一个人',type:'warning'});
this.$refs.messager.show({message:'已分享过,不能再分享',type:'warning'});
}
}else{
// this.$message({message:'分享失败',type:'success'});
this.$refs.interactToast.show({message:'分享处理失败',type:'error'});
console.log(rs.message);
this.$refs.messager.show({message:rs.message,type:'error',zIndex:100090});
}
});
},

View File

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

View File

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