diff --git a/App.vue b/App.vue index 0b7ced7..cb4d3fc 100644 --- a/App.vue +++ b/App.vue @@ -71,7 +71,34 @@ border-right: 1px solid #bdbdbd; transform: rotate(45deg); } - + uni-modal { + .uni-modal { + width: 288px !important; + max-width: 288px !important; + border-radius: 26upx; + .uni-modal__bd{ + font-size: 36upx; + font-weight: 600; + color: #333333; + padding: 33px 25px 33px 25px; + } + .uni-modal__ft{ + font-size: 32upx; + .uni-modal__btn_default{ + color: #333333; + } + .uni-modal__btn_primary{ + color: #387DF7; + } + } + } + } + uni-toast .uni-toast{ + img{ + width: 38px; + height: 18px; + } + } /**统一样式*/ .fixed-field{ width: 180px; diff --git a/api/ajax.js b/api/ajax.js new file mode 100644 index 0000000..e24799c --- /dev/null +++ b/api/ajax.js @@ -0,0 +1,169 @@ +import config from '@/config/index.js' +import {getToken,removeToken} from '@/utils/token.js' +import qs from 'qs' + +const ReLoginUrl="/login"; + +const formatUrl=function(url){ + return url; + // if(url.startsWith('http') || url.startsWith('https')){ + // //console.log(url,"我拿到的url值,我想知道下面有啥方法") + // return url; + // }else{ + // return config.apiBaseUrl+url + // } +} +const formRequest=function(method,url,data){ + let token=getToken(); + if(!token){ + token=''; + } + let headers={ + 'content-type':'application/x-www-form-urlencoded', + 'XBOE-Access-Token':token + } + let reUrl=formatUrl(url); + return new Promise(function(resolve, reject){ + uni.request({ + url: reUrl, + method, + data: data, + xhrFields: {withCredentials: true}, + dataType: 'json', + header: headers, + success:function(rs,statusCode){ + if(rs.statusCode==200){ + if(rs.data.status==401 || rs.data.status==402){ + removeToken(); + let loginPath=config.loginPath; + if(loginPath.startsWith('http')){ + // #ifdef APP-PLUS + plus.runtime.openURL(loginPath) //这里默认使用外部浏览器打开而不是内部web-view组件打开 + // #endif + // #ifdef H5 + //window.open(loginPath) + let returnUrl=window.location.protocol+'//'+window.location.host+config.context; + location.href=config.loginPath+"?returnUrl="+encodeURIComponent(returnUrl+'/pages/login/loading'); + // #endif + }else{ + uni.redirectTo({ + url:loginPath + }) + } + }else{ + resolve(rs.data); + } + }else{ + reject("API请求错误"); + } + }, + fail:function(err){ + reject(err); + } + }); + }); + +} +const jsonRequest=function(method,url,data){ + let token=getToken(); + if(!token){ + token=''; + } + let headers={ + 'XBOE-Access-Token':token + } + let reUrl=formatUrl(url); + return new Promise(function(resolve, reject){ + + uni.request({ + url: reUrl, + method, + data: data, + xhrFields: {withCredentials: true}, + dataType: 'json', + header: headers, + success:function(rs,statusCode){ + if(rs.statusCode==200){ + if(rs.data.status==401 || rs.data.status==402){ + removeToken(); + let loginPath=config.loginPath; + if(loginPath.startsWith('http')){ + // #ifdef APP-PLUS + plus.runtime.openURL(loginPath) //这里默认使用外部浏览器打开而不是内部web-view组件打开 + // #endif + // #ifdef H5 + let returnUrl=window.location.protocol+'//'+window.location.host+config.context; + location.href=config.loginPath+"?returnUrl="+encodeURIComponent(returnUrl+'/pages/login/loading'); + // #endif + }else{ + uni.redirectTo({ + url:loginPath + }) + } + }else{ + resolve(rs.data); + } + }else{ + reject("API请求错误"); + } + }, + fail:function(err){ + reject(err); + } + }); + }); +} +//get请求 +const get=function(baseURL,url){ + return formRequest('GET',baseURL+url,''); +} +//post请求 +const post=function(baseURL,url,data){ + if(data){ + data=qs.stringify(data); + } + return formRequest('POST',baseURL+url,data); +} +//postJson请求 +const postJson=function(baseURL,url,json){ + return jsonRequest('POST',baseURL+url,json); +} +//put请求 +const put=function(baseURL,url,data){ + if(data){ + data=qs.stringify(data); + } + return formRequest('PUT',baseURL+url,data); +} +//putJson请求 +const putJson=function(baseURL,url,json){ + return jsonRequest('PUT',baseURL+url,json); +} +//patch请求 +const patch=function(baseURL,url,data){ + if(data){ + data=qs.stringify(data); + } + return formRequest('PATCH',baseURL+url,data); +} +//patchJson请求 +const patchJson=function(baseURL,url,json){ + return jsonRequest('PATCH',baseURL+url,json); +} +//delete请求 +const del=function(baseURL,url,data){ + if(data){ + data=qs.stringify(data); + } + return formRequest('DELETE',baseURL+url,data); +} +export default { + get, + post, + postJson, + put, + putJson, + patch, + patchJson, + del +} \ No newline at end of file diff --git a/api/boe/boeApiAjax.js b/api/boe/boeApiAjax.js index c743cdc..51ffb6c 100644 --- a/api/boe/boeApiAjax.js +++ b/api/boe/boeApiAjax.js @@ -42,7 +42,8 @@ const formRequest=function(method,url,data){ // #endif // #ifdef H5 //window.open(loginPath) - location.href=loginPath + let returnUrl=window.location.protocol+'//'+window.location.host+config.context; + location.href=config.loginPath+"?returnUrl="+encodeURIComponent(returnUrl+'/pages/login/loading'); // #endif }else{ uni.redirectTo({ @@ -91,7 +92,8 @@ const jsonRequest=function(method,url,data){ // #endif // #ifdef H5 //window.open(loginPath) - location.href=loginPath + let returnUrl=window.location.protocol+'//'+window.location.host+config.context; + location.href=config.loginPath+"?returnUrl="+encodeURIComponent(returnUrl+'/pages/login/loading'); // #endif }else{ uni.redirectTo({ diff --git a/api/modules/comments.js b/api/modules/comments.js index 697c571..494cfae 100644 --- a/api/modules/comments.js +++ b/api/modules/comments.js @@ -28,6 +28,9 @@ send 姓名 const pagelist=function(query){ return ajax.post('/xboe/m/comment/tome/page',query); } +const mobilepage=function(query){ + return ajax.post('/xboe/m/comment/tome/mobilepage',query); +} /* 保存评论 {Object } @@ -87,5 +90,6 @@ export default{ pageQuery, reply, replyList, - delReply + delReply, + mobilepage } diff --git a/api/modules/courseGrade.js b/api/modules/courseGrade.js index 08e683f..cfdc76e 100644 --- a/api/modules/courseGrade.js +++ b/api/modules/courseGrade.js @@ -16,7 +16,16 @@ const has=function(id){ return ajax.get(`/xboe/m/grade/has?courseId=${id}`); } +/** + * courseId,aid + * aid不传默认当前账户 + */ +const score=function (query){ + return ajax.post('/xboe/m/grade/score',query); +} + export default{ grade, - has + has, + score } \ No newline at end of file diff --git a/api/modules/coursePortal.js b/api/modules/coursePortal.js index 0c0bcfe..d6f9d40 100644 --- a/api/modules/coursePortal.js +++ b/api/modules/coursePortal.js @@ -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 } diff --git a/api/modules/courseStudy.js b/api/modules/courseStudy.js index bc1b47b..d29faad 100644 --- a/api/modules/courseStudy.js +++ b/api/modules/courseStudy.js @@ -58,6 +58,10 @@ const importSignup = function(data) { return ajax.post('/xboe/school/study/signup/import',data); } +/**进入学习首页的后的调用*/ +const studyIndex = function(courseId) { + return ajax.get('/xboe/school/study/course/studyIndex?cid='+courseId+'&addView=true'); +} /** * 课程学习,根据课程id来获取, @@ -322,12 +326,19 @@ const deleteSignUp=function(id,courseId){ return ajax.post(`/xboe/school/study/course/delete-signup?id=${id}&couserId=${courseId}`); } +/**课程详细页面的推荐课程*/ +const courseRecommends=function(query) { + return ajax.post('/xboe/portal/index/course-for-recommend',query); +} + + export default { hasSignup, signup, findSignup, deleteSignup, importSignup, + studyIndex, studyInfo, studyVideoTime, lastStudy, @@ -348,5 +359,6 @@ export default { myExamList, myAssessList, myExamList2, - deleteSignUp + deleteSignUp, + courseRecommends } diff --git a/api/modules/shares.js b/api/modules/shares.js index 55d723c..b862c18 100644 --- a/api/modules/shares.js +++ b/api/modules/shares.js @@ -13,6 +13,16 @@ import ajax from '@/utils/xajax.js' const save=function(data){ return ajax.post('/xboe/m/share/add',data); } +/** + * 我分享的全部 + * @param pageIndex 第几页 + * @param pageSize 每页多少行 + * @param keyword 关键字搜索 + * @param isRead 是否已读 + * */ +const findMeShare=function (query){ + return ajax.post('/xboe/m/share/findMeShare',query); +} // 删除分享 // 参数 id const del=function(id){ @@ -65,6 +75,16 @@ const myqalist=function(query){ const myarticlelist=function(query){ return ajax.post('/xboe/m/share/myArticleList',query); } +/** + * 分享给我的全部 + * @param pageIndex 第几页 + * @param pageSize 每页多少行 + * @param keyword 关键字搜索 + * @param isRead 是否已读 + * */ +const findShareMe=function (query){ + return ajax.post('/xboe/m/share/findShareMe',query); +} /*分页查询 我分享的课程信息 @param {Object} query @param type 查询的条件,暂时未确定 @@ -134,5 +154,7 @@ const updateIsRead=function(id){ mymecourselist, mymearticlelist, deleteshares, + findShareMe, + findMeShare, updateIsRead } \ No newline at end of file diff --git a/api/phase2/guestbook.js b/api/phase2/guestbook.js new file mode 100644 index 0000000..374d5f5 --- /dev/null +++ b/api/phase2/guestbook.js @@ -0,0 +1,70 @@ +import config from '@/config/index.js' +import ajax from '../ajax'; +const baseURL = config.socialApiBaseUrl; + + +/** + * 保存或者编辑留言 + * @param{ + * content,留言内容 + * aid 要留言的人的id + * + * } + * */ +const save=function (data){ + return ajax.postJson(baseURL,'/xboe/subgroup/m/guest/save',data); +} + +/** + * 删除留言 + * */ +const del=function (id){ + return ajax.get(baseURL,'/xboe/subgroup/m/guest/delete?id='+id); +} + +/** + * 回复或者删除留言 + * @param{ + * id + * reply 回复内容 + * } + * */ +const answer=function (data){ + return ajax.post(baseURL,'/xboe/subgroup/m/guest/answer',data); +} + +/** + * 给我的留言 + * @param{ + * pageIndex + * pageSize + * aid + * } + * */ +const givelist=function (query){ + return ajax.post(baseURL,'/xboe/subgroup/m/guest/givelist',query); +} + +/** + * 我的留言 + * @param{ + * pageIndex + * pageSize + * aid + * } + * */ +const mylist=function (query){ + return ajax.post(baseURL,'/xboe/subgroup/m/guest/mylist',query); +} + +export default { + save, + answer, + del, + givelist, + mylist +} + + + + diff --git a/api/phase2/guide.js b/api/phase2/guide.js new file mode 100644 index 0000000..3e05303 --- /dev/null +++ b/api/phase2/guide.js @@ -0,0 +1,32 @@ +// import ajax from '@/utils/xajax.js' +import config from '@/config/index.js' +import ajax from '../ajax'; +const baseURL = config.socialApiBaseUrl; + + +/** + * 显示提取,一次性 + * */ +const list=function (){ + return ajax.get(baseURL,'/xboe/subgroup/m/guide/list'); +} + +/** + * 保存或编辑 + * */ +const save=function (data){ + return ajax.postJson(baseURL,'/xboe/subgroup/m/guide/save',data); +} + +/** + * 判断当前用户是否登录过 + * */ +const hasUser=function (){ + return ajax.get(baseURL,'/xboe/subgroup/m/guide/hasUser'); +} + +export default { + list, + save, + hasUser +} diff --git a/api/phase2/index.js b/api/phase2/index.js new file mode 100644 index 0000000..56729e9 --- /dev/null +++ b/api/phase2/index.js @@ -0,0 +1,77 @@ +import ajax from '@/utils/xajax.js' + + +/** + * 首页推荐案例 + * @param type 2最热 1最新 + * */ +const cases=function (type){ + return ajax.get('/xboe/portal/index/cases?type='+type); +} + +/** + * 首页文章排行榜 + * @param num 条数 不传默认5条 + * */ +const articleViews=function (num){ + return ajax.get('/xboe/portal/index/article-views?num='+num); +} + +/** + * 首页问答排行榜 + * @param num 条数 不传默认5条 + * */ +const qaAnswers=function (num){ + return ajax.get('/xboe/portal/index/qa-answers?num='+num); +} + +/** + * 1最新 2最热 + * */ +const articlelist=function (type){ + return ajax.get('/xboe/portal/index/articlelist?type='+type); +} + +/** + * 首页课程排行榜 + * 参数和原接口一样,只需要换接口名称就可以 + * */ +const courselist=function (data){ + return ajax.post('/xboe/portal/index/courselist',data); +} +// 移动端首页课程 +const mobileIndex=function(data){return ajax.post('/xboe/portal/index/mobile-courseindex',data);} +/* +评分榜 +@param num 要几条传几条 不传默认五条 + */ +const scorelist=function(num,p){ + return ajax.get(`/xboe/m/course/portal/score-list?num=${num}&index=${p}`); +} +/**首页查询问答 + * pageSize + * orderField + * orderAsc +*/ +const indexList=function(query) { + return ajax.post('/xboe/m/qa/question/query-random',query); +} +// 1最新 2最热 +const mobieArticle=function (type){ + return ajax.get('/xboe/portal/index/mobile-article?type='+type); +} + + + + +export default { + cases, + articleViews, + qaAnswers, + articlelist, + courselist, + mobileIndex, + scorelist, + indexList, + mobieArticle +} diff --git a/api/phase2/place.js b/api/phase2/place.js new file mode 100644 index 0000000..a2660e9 --- /dev/null +++ b/api/phase2/place.js @@ -0,0 +1,27 @@ +import config from '@/config/index.js' +import ajax from '../ajax'; +const baseURL = config.socialApiBaseUrl; + + +/** + * 添加或编辑 + * @param 参数见设计文档 + * */ +const saveOrUpdate=function (data){ + return ajax.postJson(baseURL,'/xboe/subgroup/m/pageplace/saveOrUpdate',data); +} + +/** + * 根据key获取资源信息 + * */ + +const detail=function (key){ + return ajax.get(baseURL,'/xboe/subgroup/m/pageplace/detail-key?key='+key); +} + + + +export default { + saveOrUpdate, + detail +} diff --git a/api/phase2/stat.js b/api/phase2/stat.js new file mode 100644 index 0000000..f66e6b7 --- /dev/null +++ b/api/phase2/stat.js @@ -0,0 +1,178 @@ +/**文章模块的相关处理*/ +// import ajax from '@/utils/xajax.js' +import config from '@/config/index.js' +import ajax from '../ajax'; +const baseURL = config.statApiBaseUrl; +/** + * 发送事件,具体事件参考后台管理的事件查看 + *参数如下: + { + "key": "ReadCase",//后台的事件key + "title": "浏览案例【案例名称】",//事件的标题 + "parameters":"",//用户自定义参数 name:value,name:value + "content": "案例名称",//事件的内容 + "source":"页面事件", + "objId": "案例id",//关联的id + "objType": "3",//关联的类型 + "objInfo": "记录一般折内容部分", + "aid": "用户的id", //当前登录人的id + "aname": "用户的名称,用于显示",//当前人的姓名 + "status": 1 //状态,直接写1 + } + * + */ +const sendEvent = function(data) { + return ajax.postJson(baseURL,'/xboe/m/stat/event/send',data); +} + +/** + * 用户的统计信息 + * @param {Object} aid 主页人的id + * @param {Object} data 参数 []数组,10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数,空数组 返回用户的全部类型统计。 + */ +const userTotal = function(aid,data) { + return ajax.postJson(baseURL,'/xboe/m/stat/user/total/'+aid,data); +} + +/** + * 用户动态,分页查询 + * + * @param { + pageIndex, + pageSize, + contentType:'',内容类型 + aid:'', //指定用户的动态, + hidden:true/false,//是否隐藏,不指定,查询全部 + } data + */ +const userDynamicList = function(data) { + return ajax.post(baseURL,'/xboe/m/stat/userdynamic/list',data); +} + +/** + * 用户动态,分页查询 + * + * @param { + pageIndex, + pageSize, + contentType:'',内容类型 + aid 数组 + } data + */ +const userDynamicfollows = function(data) { + return ajax.postJson(baseURL,'/xboe/m/stat/userdynamic/follow',data); +} + +/** + * 获取用户全部勋章 + * @param {String} aid 用户的id + * + */ + const userMedal = function(aid) { + return ajax.get(baseURL,'/xboe/m/stat/medal/user-medal?aid='+aid); +} + + +/** + * 勋章信息 + * 页面上不能修改,删除 + */ +// const userMedalConfig = function() { +// return ajax.get(baseURL,'/xboe/m/stat/medalinfo/config'); +// } +// get 获取勋章配置,返回的是列表 +const userMedalConfig = function() { + return ajax.get(baseURL,'/xboe/m/stat/medal/config'); +} + +/** + * 查询勋章下等级所对应的用户数量 + * @author wn + * @param {String} medalId 勋章id(必填) + */ +const userMedalLevelInfo = function(medalId) { + return ajax.get(baseURL,'/xboe/m/stat/medal/getUserMedalLevelInfo?medalId='+medalId); +} + +/** + * 隐藏动态 + * @author wn + * @param {String} id 动态id(必填) + */ +const dynamicHide = function(id) { + return ajax.post(baseURL,'/xboe/m/stat/userdynamic/hide?id='+id); +} + +/** + * 导出用户近7天的U币记录 + * @author wn + * @param {String} aid 用户aid + */ +const exportUserCoinRecord = function(aid) { + return ajax.get(baseURL,'/xboe/m/stat/usercoinrecord/export?aid='+aid); +} + +/** + * 获取用户最近 x 天的U币记录 + * @param {String} aid 用户的id + * @param {Integer} days x天的记录,默认为7天 + */ + const userCoinList = function(aid,days) { + return ajax.get(baseURL,'/xboe/m/stat/usercoinrecord/list?aid='+aid+'&days='+days); +} + +/** + * 查询排名数据 + * @author wn + * @params { + "aid":"952948626497724414", #用户id + "statType":20, #统计类型 10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数 + "field":"total", #统计周期 todays-当天,weeks-周,months-月,years-年 total-总计 + "num":8 #显示的条数 + } + */ +const getRanking = function(queryData) { + return ajax.postJson(baseURL,'/xboe/m/stat/user/ranking',queryData); +} + + +/** + * 查询统计用户经验值等级、累计学习时长、累计U币数量、累计经验值 + * @author wn + * @param {String} aid 用户的id + */ + const getUserStatTotalInfo = function(aid) { + return ajax.get(baseURL,'/xboe/m/stat/user/statinfo?aid='+aid); +} + +/** + * 用户的登录勋章,新版上线,15天内登录过一次 + * @author wn + */ + const getUserLoginMedal = function() { + return ajax.get(baseURL,'/xboe/m/stat/medal/login-medal'); +} + +/** + * 提取需要提示的勋章 + */ +const getUserMedalTips = function() { + return ajax.get(baseURL,'/xboe/m/stat/medal/tips'); +} + +export default { + sendEvent, + userTotal, + userDynamicList, + userCoinList, + userMedal, + userMedalConfig, + userMedalLevelInfo, + dynamicHide, + exportUserCoinRecord, + getRanking, + getUserStatTotalInfo, + userDynamicfollows, + getUserLoginMedal, + getUserMedalTips +} diff --git a/api/phase2/userfollow.js b/api/phase2/userfollow.js new file mode 100644 index 0000000..0a0f42f --- /dev/null +++ b/api/phase2/userfollow.js @@ -0,0 +1,103 @@ +import config from '@/config/index.js' +import ajax from '../ajax'; +const baseURL = config.socialApiBaseUrl; + + +/** + * 添加关注 + * @param{ + * followId + * } + * */ +const save=function (followId){ + return ajax.get(baseURL,'/xboe/subgroup/m/userfollow/save?followId='+followId); +} + +/** + * 检查是否已关注 + * @param{ + * followId + * } + * */ +const checkFllow=function (followId){ + return ajax.get(baseURL,'/xboe/subgroup/m/userfollow/checkFllow?followId='+followId); +} + +/** + * 取消关注 + * + * */ +const remove=function (followId){ + return ajax.get(baseURL,'/xboe/subgroup/m/userfollow/remove?followId='+followId); +} + +/** + * 我关注的人列表 + * @param{ + * pageIndex + * pageSize, + * aid + * } + * */ +const page=function (query){ + return ajax.post(baseURL,'/xboe/subgroup/m/userfollow/page',query); +} + +/** + * 我关注的人列表 + * @param{ + * pageIndex + * pageSize, + * aid + * } + * */ +const mypage=function (query){ + return ajax.post(baseURL,'/xboe/subgroup/m/userfollow/mypage',query); +} + +/** + * 二次查询 + * */ +const ids=function (data){ + return ajax.postJson(baseURL,'/xboe/subgroup/m/userfollow/ids',data); +} + +/** + * 被关注数 + * 关注数 + * @pram{ + * aid + * } + * */ +const counts=function (aid){ + return ajax.get(baseURL,'/xboe/subgroup/m/userfollow/counts?aid='+aid); +} + +/** + * 查询是否已关注 + * @param{ + * followId 关注人的id + * } + * */ +const has=function (followId){ + return ajax.get(baseURL,'/xboe/subgroup/m/userfollow/has?followId='+followId); +} + +/** + * 我的关注二次查询 + * */ +const list=function (){ + return ajax.get(baseURL,'/xboe/subgroup/m/userfollow/list'); +} + +export default { + save, + remove, + page, + mypage, + ids, + counts, + has, + checkFllow, + list +} diff --git a/api/phase2/userhobby.js b/api/phase2/userhobby.js new file mode 100644 index 0000000..6dab853 --- /dev/null +++ b/api/phase2/userhobby.js @@ -0,0 +1,59 @@ +import config from '@/config/index.js' +import ajax from '../ajax'; +const baseURL = config.socialApiBaseUrl; + + +/** + * 用户采集的添加 + * @param{ + * type 类型 1表课程分类 + * refId 关联的id + * refCode 关联的code + * } + * */ +const save=function (data){ + return ajax.postJson(baseURL,'/xboe/subgroup/m/userhobby/save',data); +} + +/** + * 同兴趣人匹配查询 + * 参数:下面那个接口的返回值直接传 + * */ +const list=function (aid){ + return ajax.get(baseURL,'/xboe/subgroup/m/userhobby/list?aid='+aid); +} + +/** + * 获取用户兴趣关联的id + * */ +const info=function (aid){ + return ajax.get(baseURL,'/xboe/subgroup/m/userhobby/info?aid='+aid); +} + +/** + * 修改用户兴趣爱好兴趣爱好, + * 参数是上一个接口 info查出来的返回值 + * */ +const update=function (data){ + return ajax.postJson(baseURL,'/xboe/subgroup/m/userhobby/update',data); +} + +/** + * 删除 + * */ +const del=function (id){ + return ajax.get(baseURL,'/xboe/subgroup/m/userhobby/delete?id='+id); +} +const has=function(){ + return ajax.get(baseURL,'/xboe/subgroup/m/userhobby/has'); +} + +export default { + save, + list, + info, + update, + del, + has +} + diff --git a/api/system/message.js b/api/system/message.js index 9ab4269..34a755f 100644 --- a/api/system/message.js +++ b/api/system/message.js @@ -10,6 +10,10 @@ import ajax from '@/utils/xajax.js' const list=function(query){ return ajax.post('/xboe/sys/message/list',query); } +const mobilelist=function(query){ + return ajax.post('/xboe/sys/message/mobilelist',query); +} +// mobilelist /* 删除消息 @param ids 勾选的多个消息id @@ -42,11 +46,25 @@ const isRead=function(){ const updateIsRead=function(ids){ return ajax.postJson('/xboe/sys/message/updateIsRead',ids) } + +/**把当前人所有未读消息设置为已读*/ +const readAll=function(){ + return ajax.get('/xboe/sys/message/readall') +} + +/**清空当前人的接收到的所有的消息*/ +const cleanAll=function(){ + return ajax.get('/xboe/sys/message/clearall') +} + export default{ list, del, detail, save, isRead, - updateIsRead + updateIsRead, + readAll, + cleanAll, + mobilelist } diff --git a/components/at-my/at-my.vue b/components/at-my/at-my.vue new file mode 100644 index 0000000..a224572 --- /dev/null +++ b/components/at-my/at-my.vue @@ -0,0 +1,160 @@ + + + + + diff --git a/components/author-img/author-img.vue b/components/author-img/author-img.vue new file mode 100644 index 0000000..d9dff48 --- /dev/null +++ b/components/author-img/author-img.vue @@ -0,0 +1,120 @@ + + + + + diff --git a/components/author-info/author-info.vue b/components/author-info/author-info.vue index 3d68131..3f46458 100644 --- a/components/author-info/author-info.vue +++ b/components/author-info/author-info.vue @@ -1,17 +1,17 @@ - + sex:author.sex + }; + if(author.avatar!=''){ + item.authorInfo.avatar=$this.fileUrl+author.avatar; + } + + return true; + } + return false; + }) + }) + }else{ + console.log('查询用户信息失败:'+res.error); + } + }) + } + } + } + + + diff --git a/pages/login/loading.vue b/pages/login/loading.vue index d2ad12e..2ed1ae5 100644 --- a/pages/login/loading.vue +++ b/pages/login/loading.vue @@ -27,57 +27,48 @@ plus.runtime.openURL(this.$config.loginPath) //这里默认使用外部浏览器打开而不是内部web-view组件打开 // #endif // #ifdef H5 - window.open(this.$config.loginPath) + //console.log('this.$config.loginPath',this.$config.loginPath); + if(this.$config.loginPath.startsWith('http')){ + let returnUrl=window.location.protocol+'//'+window.location.host+this.$config.context; + location.href=this.$config.loginPath+"?returnUrl="+encodeURIComponent(returnUrl+'/pages/login/loading'); + }else{ + location.href=this.$config.loginPath; + } + // #endif }else{ - console.log('获取用户信息'); apiLogin.boeLogin(token).then(rs=>{ if(rs.status==200){ - console.log('获取用户信息成功'); //setToken(rs.result.access_token); //加载用户信息 - this.$store.dispatch("InitData").then(res => { - //console.log(res) - //this.$watermark.set(res.result.name + res.result.loginName); - // uni.switchTab({ - // url:'/pages/index/index' - // }) - uni.setStorageSync("boe_new_login",1);//记录新登录 - let openUrl=$this.toUrl; - if(openUrl){ - console.log('跳转url='+openUrl); - if(openUrl.startsWith('http')){ - //alert('跳转url0='+openUrl) - location.href=openUrl + this.$store.dispatch("InitData").then(res => { + //console.log(res) + //this.$watermark.set(res.result.name + res.result.loginName); + // uni.switchTab({ + // url:'/pages/index/index' + // }) + uni.setStorageSync("boe_new_login",1);//记录新登录 + let openUrl=$this.toUrl; + if(openUrl){ + if(openUrl.startsWith('http')){ + location.href=openUrl + }else{ + if(openUrl=='/pages/index/index' || openUrl=='/pages/study/index' || openUrl=='/pages/plus/index' || openUrl=='/pages/my/index'){ + uni.switchTab({ + url:openUrl + }) }else{ - if(openUrl=='/pages/index/index' || openUrl=='/pages/study/index' || openUrl=='/pages/plus/index' || openUrl=='/pages/my/index'){ - //alert('跳转url1='+openUrl) - uni.switchTab({ - url:openUrl - }) - }else{ - //alert('跳转url2='+openUrl) - uni.navigateTo({url:openUrl}) - } + uni.navigateTo({url:openUrl}) } - }else{ - console.log('跳转到首页'); - //alert('跳转到首页') - uni.switchTab({ - url:'/pages/index/index' - }) - } - - }).catch(error => { - console.log('加载用户信息错误:',error); - //alert('加载用户信息错误') - uni.showModal({ - title:'错误', - content:error - }) - }) + } + }else{ + uni.switchTab({ + url:'/pages/index/index' + }) + } + + }); }else{ - //alert('加载用户错误') console.log(rs.message+','+rs.error); //#ifdef APP-PLUS plus.runtime.openURL(this.$config.loginPath) //这里默认使用外部浏览器打开而不是内部web-view组件打开 @@ -89,7 +80,6 @@ } }).catch(err=>{ // - //alert('请求超时') uni.showToast({ title:'请求超时' }) diff --git a/pages/login/login.vue b/pages/login/login.vue index aaa684b..47af6a7 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -39,6 +39,8 @@ mounted() { //对cookies进行操作,这里是写 //document.cookie = "mytest=qweqwe131231; path=/; max-age=" + 30*24*60*60; + console.log('process.env.NODE_ENV',process.env.NODE_ENV); + console.log('process.env.ENV_TYPE',process.env.ENV_TYPE); }, methods: { submitLogin(){ @@ -62,7 +64,7 @@ // url:'/pages/index/index' // }) uni.switchTab({ - url:'/pages/study/index' + url:'/pages/index/index' }) }); }else{ diff --git a/pages/login/next.vue b/pages/login/next.vue index c5c3540..b212913 100644 --- a/pages/login/next.vue +++ b/pages/login/next.vue @@ -2,32 +2,30 @@ 修改密码 - - - + + + - - + + - - + + - + - - - 如有问题请联系管理员 + + + 如有问题联系管理员 - - + - - 李玉冰 - 00004409 - 01060965462 + + 李玉冰0000 4409 + 0106 0965 462 @@ -173,5 +171,10 @@ export default { .u-button { width: 350px; + background-color: rgba(0, 125, 255, 1); + border-radius: 23px; } + + + diff --git a/pages/login/nickName.vue b/pages/login/nickName.vue index d980bfa..7724e11 100644 --- a/pages/login/nickName.vue +++ b/pages/login/nickName.vue @@ -34,7 +34,8 @@ if(res.status==200){ uni.showToast({ title:"修改成功" , - duration: 1000 + duration: 1000, + image:'../../static/images/icon/ok-icon.png' }); setTimeout(()=>{ uni.navigateTo({ diff --git a/pages/my/follow.vue b/pages/my/follow.vue new file mode 100644 index 0000000..9a98e36 --- /dev/null +++ b/pages/my/follow.vue @@ -0,0 +1,382 @@ + + + + + diff --git a/pages/my/index.vue b/pages/my/index.vue index f4e0515..dfe4979 100644 --- a/pages/my/index.vue +++ b/pages/my/index.vue @@ -38,9 +38,61 @@ - + + + + + + + + + + + + + + {{userInfoObj.name}} + + + {{ statData.level }} + + {{statData.evalue}}/{{statData.levelMaxValue}} + + + + 编辑资料 + + + + + + + {{statData.uvalue}} + U币 + + + + + {{ statData.totalStudyHour }}h + 学习时长 + + + + + {{ concernme }} + 关注我的 + + + + {{ myconcern }} + 我的关注 + + + + +