提交 53300836 编写于 作者: chendeli's avatar chendeli

add

上级 7ac39bd4
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</div> </div>
<div class="loading-box" > <div class="loading-box" >
<span class="loading-more-txt" v-if="isLoading">努力加载中...</span> <span class="loading-more-txt" v-if="isLoading">努力加载中...</span>
<span class="no-more" v-if="noMore">没有更多了~</span> <span class="no-more" v-if="noMore">没有更多了......</span>
</div> </div>
</div> </div>
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<script> <script>
import { Loadmore,Spinner,InfiniteScroll } from 'mint-ui'; import { Loadmore,Spinner,InfiniteScroll } from 'mint-ui';
import { setEventByModuleCode } from '@/utils/index' // import { setEventByModuleCode } from '@/utils/index'
// import LOADING from '../../components/common/loading-new'; // import LOADING from '../../components/common/loading-new';
export default { export default {
data () { data () {
...@@ -104,7 +104,7 @@ export default { ...@@ -104,7 +104,7 @@ export default {
] ]
} }
}; };
let paramList = setEventByModuleCode(itemData); let paramList = this.setEventByModuleCode(itemData);
rocNative.dispatchEventByModuleCode({ rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code, modeCode: itemData.appModuleInfo.code,
jsonString: paramList jsonString: paramList
...@@ -114,6 +114,9 @@ export default { ...@@ -114,6 +114,9 @@ export default {
//换一批 //换一批
changeFun(){ changeFun(){
this.clientHeight = document.documentElement.clientHeight+'px'; this.clientHeight = document.documentElement.clientHeight+'px';
document.documentElement.scrollTop = document.documentElement.scrollTop - 20;
document.body.scrollTop = document.body.scrollTop - 20;
//console.log(document.documentElement.scrollTop);
this.loading = true; this.loading = true;
this.noMore = false; this.noMore = false;
this.pageNo++; this.pageNo++;
...@@ -123,15 +126,17 @@ export default { ...@@ -123,15 +126,17 @@ export default {
//滑动加载更多 //滑动加载更多
loadMore(){ loadMore(){
// alert("0000");
let _this = this; let _this = this;
_this.pageNo += 1; if(!_this.noMore){
_this.isLoading = true; _this.pageNo += 1;
this.loading = true; _this.isLoading = true;
this.loading = true;
setTimeout(()=>{ setTimeout(()=>{
_this.getData('loadMore'); _this.getData('loadMore');
},500) },500)
}
}, },
//收藏 取消收藏 //收藏 取消收藏
...@@ -143,7 +148,7 @@ export default { ...@@ -143,7 +148,7 @@ export default {
courseId:id, courseId:id,
setEntry: 'headers' setEntry: 'headers'
} }
_this.POST('favors',parm).then(function(res){ _this.POST('contents/favors',parm).then(function(res){
if(res.code === '000000'){ if(res.code === '000000'){
status = status == 1 ? 2 : 1; status = status == 1 ? 2 : 1;
...@@ -174,16 +179,20 @@ export default { ...@@ -174,16 +179,20 @@ export default {
_this.GET('contents/courses/recommendCourseList',parm).then(function(res){ _this.GET('contents/courses/recommendCourseList',parm).then(function(res){
if(res.code === '000000'){ if(res.code === '000000'){
if(type == 'loadMore'){ if(type == 'loadMore'){
if(res.data == null || res.data.length == 0 && res.data.length <_this.pageSize){ if(res.data == null || !res.data){
this.isLoading = false;
this.noMore = true;
}
if(res.data == null){
res.data = []; res.data = [];
_this.isLoading = false;
_this.noMore = true;
_this.loading = false;
} }
_this.list = [..._this.list ,...res.data] || []; _this.list = [..._this.list ,...res.data] || [];
}else{ }else{
_this.noMore = false;
_this.isLoading = false;
_this.list = res.data || []; _this.list = res.data || [];
} }
}else{ }else{
...@@ -227,7 +236,7 @@ export default { ...@@ -227,7 +236,7 @@ export default {
} }
.loading-box{ .loading-box{
font-size: px2rem(16px); font-size: px2rem(16px);
padding:px2rem(10px) 0; padding:px2rem(10px) 0 px2rem(20px) 0;
text-align: center; text-align: center;
span{ span{
color:#999; color:#999;
...@@ -242,7 +251,7 @@ export default { ...@@ -242,7 +251,7 @@ export default {
border:1px solid #A9AEB7; border:1px solid #A9AEB7;
border-radius: px2rem(9px); border-radius: px2rem(9px);
vertical-align: middle; vertical-align: middle;
padding: px2rem(3px) px2rem(5px) px2rem(2px) px2rem(6px); padding: px2rem(3px) px2rem(5px) px2rem(4px) px2rem(6px);
img{ img{
width: px2rem(12px); width: px2rem(12px);
height: px2rem(12px); height: px2rem(12px);
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</template> </template>
<script> <script>
import { setEventByModuleCode } from '@/utils/index' // import { setEventByModuleCode } from '@/utils/index'
export default { export default {
data(){ data(){
return{ return{
...@@ -41,9 +41,7 @@ export default { ...@@ -41,9 +41,7 @@ export default {
}, },
methods: { methods: {
goToPage(itemData){ goToPage(itemData){
console.log(this.leftObj); let paramList = this.setEventByModuleCode(itemData);
let paramList = setEventByModuleCode(itemData);
rocNative.dispatchEventByModuleCode({ rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code, modeCode: itemData.appModuleInfo.code,
jsonString: paramList jsonString: paramList
...@@ -58,9 +56,9 @@ export default { ...@@ -58,9 +56,9 @@ export default {
} }
this.GET('contents/HomeColumn/Information', para).then(res => { this.GET('contents/HomeColumn/Information', para).then(res => {
if(res.code == '000000'){ if(res.code == '000000'){
console.log(res); //console.log(res);
_this.list = res.data && res.data.iconColumnInformationModels || []; _this.list = res.data && res.data.iconColumnInformationModels || [];
console.log(_this.list); /// console.log(_this.list);
_this.leftObj = _this.list[0] || {}; _this.leftObj = _this.list[0] || {};
_this.rightTop = _this.list[1] || {}; _this.rightTop = _this.list[1] || {};
_this.rightBottom = _this.list[2] || {}; _this.rightBottom = _this.list[2] || {};
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
更多<img src="../../images/right-throw.png" class="thorw-icon"/> 更多<img src="../../images/right-throw.png" class="thorw-icon"/>
</div> </div>
</div> </div>
<div class="teacher-item" :key="index" v-for="(item,index) in list"> <div class="teacher-item" :key="index" v-for="(item,index) in list" @click="goToPage(item)">
<div class="teacher-itemimg"> <div class="teacher-itemimg">
<img :src="item.appImageUrl"/> <img :src="item.appImageUrl"/>
</div> </div>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<div class="teacher-itemname fs14">{{item.title}}</div> <div class="teacher-itemname fs14">{{item.title}}</div>
<div class="five-tag fs11"> <div class="five-tag fs11">
<span class="m-tag">#{{item.categoryName}}</span> <span class="m-tag">#{{item.categoryName}}</span>
<span class="m-play" @click="playFun(item)"> <span class="m-play" @click.stop="playFun(item)">
<img class="five-radio" src="../../images/play.png"/> <img class="five-radio" src="../../images/play.png"/>
</span> </span>
</div> </div>
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
</template> </template>
<script> <script>
import { pageJumpUrl} from '@/utils/index'
export default { export default {
name: 'YqyFiveMinutes', name: 'YqyFiveMinutes',
data(){ data(){
...@@ -36,17 +37,53 @@ export default { ...@@ -36,17 +37,53 @@ export default {
this.getData(); this.getData();
}, },
methods: { methods: {
goToPage(item){
let url = pageJumpUrl();
console.log(url);
let itemData={
"title":item.name,
"imageUrl":"",
"appModuleInfo":{
"code":"M300",
"type":4,
"name":"课程介绍页",
"paramFlag":1,
"paramList":[
{
"key":"pageUrl",
"value":url,
"type":4,
"seqNo":1
},
{
"key":"audioId",
"value":`${item.id}`,
"type":1,
"seqNo":2
}
]
}
};
let paramList = this.setEventByModuleCode(itemData);
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: paramList
})
},
//获取轮播图数据 //获取轮播图数据
getData(){ getData(){
let _this = this, let _this = this,
parm = { parm = {
pageNo: 1, pageNo: 1,
token: 'ACEEFAE765AA4D9EB68BE80735845BF9', // token: _this.token,
pageSize: 10 pageSize: 10
} }
this.GET('contents/fiveMinutes/contents',parm).then(res => { let res = {"fiveMinutesMedicalContentList":[{"id":109,"title":"1312312","fileType":4,"filePath":"http://test-file.yunqueyi.com/audio/mp3/2018/06/09/2018060917174163-ef5bf97c.mp3","appImageUrl":"https://test-file.yunqueyi.com/image/jpeg/2018/06/09/20180609171335722-06552629.jpg","size":15463892,"totalTime":642,"publishTime":1528534800000,"categoryName":"政策播报"},{"id":109,"title":"1312312","fileType":4,"filePath":"http://test-file.yunqueyi.com/audio/mp3/2018/06/09/2018060917174163-ef5bf97c.mp3","appImageUrl":"https://test-file.yunqueyi.com/image/jpeg/2018/06/09/20180609171335722-06552629.jpg","size":15463892,"totalTime":642,"publishTime":1528534800000,"categoryName":"政策播报"},{"id":109,"title":"1312312","fileType":4,"filePath":"http://test-file.yunqueyi.com/audio/mp3/2018/06/09/2018060917174163-ef5bf97c.mp3","appImageUrl":"https://test-file.yunqueyi.com/image/jpeg/2018/06/09/20180609171335722-06552629.jpg","size":15463892,"totalTime":642,"publishTime":1528534800000,"categoryName":"政策播报"}],"respMsg":"成功","respCode":200}
_this.list = res.fiveMinutesMedicalContentList || []
this.GET('rest/fiveMinutes/contents',parm).then(res => {
if(res.respCode == '200'){ if(res.respCode == '200'){
_this.list = res.fiveMinutesMedicalContentList || [] _this.list = res.fiveMinutesMedicalContentList || []
...@@ -145,13 +182,13 @@ export default { ...@@ -145,13 +182,13 @@ export default {
padding: 0 px2rem(5px); padding: 0 px2rem(5px);
color: #BF9E15; color: #BF9E15;
border-radius: 0 px2rem(3px) px2rem(3px) px2rem(3px); border-radius: 0 px2rem(3px) px2rem(3px) px2rem(3px);
background-color: px2rem(17px); /* background-color: px2rem(17px);*/
border:1px solid #FAE5AF; border:1px solid #FAE5AF;
} }
} }
.m-play{ .m-play{
width: px2rem(22px); width: px2rem(28px);
height: px2rem(22px); height: px2rem(28px);
display: inline-block; display: inline-block;
position:absolute; position:absolute;
right: 0; right: 0;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</div> </div>
<div class="tea-list"> <div class="tea-list">
<div class="tea-listbox"> <div class="tea-listbox">
<div class="tea-item" :key="index" v-for="(item,index) in list" @click="goToPage(item.id)"> <div class="tea-item" :key="index" v-for="(item,index) in list" @click="goToPage(item)">
<div class="head-pic"> <div class="head-pic">
<img class="tea-itemimg" :src="item.avatarImageUrl"/> <img class="tea-itemimg" :src="item.avatarImageUrl"/>
</div> </div>
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
</template> </template>
<script> <script>
// import { setEventByModuleCode } from '@/utils/index'
export default { export default {
data(){ data(){
return { return {
...@@ -37,18 +38,49 @@ export default { ...@@ -37,18 +38,49 @@ export default {
methods: { methods: {
//跳转 //跳转
goToPage(id,parm){ goToPage(item,parm){
let keyName = '',
val = '',
classNameVal = '';
if(parm == 'list'){ if(parm == 'list'){
rocNative.gotoNewActivity({ keyName = '';
"className": "com.picahealth.yunque.activitys.experienceshare.ExperienceShcom.picahealth.yunque.activitys.experienceshare.ExperienceSh" val = '';
}) classNameVal = 'com.picahealth.yunque.activitys.experienceshare.ExperienceShareDetailActivity###SharedExperienceViewController'
}else{ }else{
rocNative.gotoNewActivityWithParams({ keyName = 'id';
"className": "com.picahealth.yunque.activitys.playvideo.PlayVideoFullScrenA", val = item.id;
"params": { "id": id } classNameVal = 'com.picahealth.yunque.activitys.playvideo.PlayVideoFullScrenActivity###VideoPlayerViewController'
})
} }
let itemData = {
"title":item.name,
"imageUrl":"",
"appModuleInfo":{
"code":"M200",
"type":4,
"name":"名师风采个人展示",
"paramFlag":1,
"paramList":[
{
"key":"className",
"value":classNameVal,
"type":4,
"seqNo":1
},
{
"key":keyName,
"value":`${val}`,
"type":1,
"seqNo":2
}
]
}
};
let paramList = this.setEventByModuleCode(itemData);
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: paramList
})
}, },
...@@ -78,12 +110,13 @@ export default { ...@@ -78,12 +110,13 @@ export default {
background-color: #fff; background-color: #fff;
padding: 0 0 px2rem(26px) px2rem(15px); padding: 0 0 px2rem(26px) px2rem(15px);
.titleTop{ .titleTop{
padding: 0 px2rem(15px) px2rem(15px) 0; padding: 0 px2rem(15px) px2rem(15px) 0;
overflow: hidden; overflow: hidden;
height: px2rem(40px);
} }
.title{ .title{
font-size: px2rem(18px); font-size: px2rem(18px);
float: left;
font-weight: bold; font-weight: bold;
} }
.get-more{ .get-more{
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</template> </template>
<script> <script>
import { setEventByModuleCode } from '@/utils/index' // import { setEventByModuleCode } from '@/utils/index'
export default { export default {
name: 'YqyHomeBanner', name: 'YqyHomeBanner',
data(){ data(){
...@@ -27,7 +27,7 @@ export default { ...@@ -27,7 +27,7 @@ export default {
}, },
methods: { methods: {
goToPage(itemData){ goToPage(itemData){
let paramList = setEventByModuleCode(itemData); let paramList = this.setEventByModuleCode(itemData);
// alert(JSON.stringify({ // alert(JSON.stringify({
// modeCode: itemData.appModuleInfo.code, // modeCode: itemData.appModuleInfo.code,
// jsonString: paramList // jsonString: paramList
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
</div> </div>
<div class="header-right"> <div class="header-right">
<img class="info" src='../../images/msg1.png'> <img class="info" src='../../images/msg1.png'>
<div :class="isMax?'num-max':'num-min'" class="info-count fs10">{{count}}</div> <div :class="isMax?'num-max':'num-min'" class="info-count fs10" v-show="isShowMsg">{{count}}</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -20,10 +20,22 @@ export default { ...@@ -20,10 +20,22 @@ export default {
searchVal:'', searchVal:'',
isTransparent: true, //更改颜色 背景 isTransparent: true, //更改颜色 背景
isMax:false,//消息数量是否大于99 isMax:false,//消息数量是否大于99
count:"99" count:'',
isShowMsg:true,
} }
}, },
props:{
msgCount:{
type:String,
default:''
}
},
mounted(){ mounted(){
this.count = this.msgCount;
if(this.msgCount == ''){
this.isShowMsg = false
}
if(this.count>=99){ if(this.count>=99){
this.count += '+'; this.count += '+';
this.isMax = true this.isMax = true
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<div> <div>
<span class="gray fs24 keepon-right">已学习:{{parmObj.day}}</span> <span class="gray fs24 keepon-right">已学习:{{parmObj.day}}</span>
<span class="gray fs24 keepon-right">剩余:{{parmObj.remanentCourseNum}}%</span> <span class="gray fs24 keepon-right">剩余:{{parmObj.remanentCourseNum}}%</span>
<span class="gray fs24 continue-study" @click="continueStudy">继续学习></span> <span class="gray fs24 continue-study" @click="continueStudy(parmObj)">继续学习></span>
</div> </div>
</div> </div>
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
</template> </template>
<script> <script>
// import { setEventByModuleCode } from '@/utils/index'
export default { export default {
name: 'YqyHomeKeepon', name: 'YqyHomeKeepon',
data(){ data(){
...@@ -31,11 +32,40 @@ export default { ...@@ -31,11 +32,40 @@ export default {
this.getData(); this.getData();
}, },
methods: { methods: {
continueStudy(){ continueStudy(item){
this.isShow = false;
let itemData={
"title":item.name,
"imageUrl":"",
"appModuleInfo":{
"code":"M200",
"type":4,
"name":"课程介绍页",
"paramFlag":1,
"paramList":[
{
"key":"className",
"value":"com.picahealth.yunque.activitys.courseplaynew.CourseIntroduceActivity###WeexCourseIntroViewController",
"type":4,
"seqNo":1
},
{
"key":"courseId",
"value":`${item.id}`,
"type":1,
"seqNo":2
}
]
}
};
let paramList = this.setEventByModuleCode(itemData);
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: paramList
})
}, },
cancel(){ cancel(){
this.isShow = false
}, },
getData(){ getData(){
let _this = this, let _this = this,
...@@ -52,7 +82,7 @@ export default { ...@@ -52,7 +82,7 @@ export default {
if(_this.parmObj.remanentCourseNum == 0){ if(_this.parmObj.remanentCourseNum == 0){
_this.isShow = false; _this.isShow = false;
}else{ }else{
_this.isShow = _this.parmObj.showFlag ? true : false; _this.isShow = true || _this.parmObj.showFlag ? true : false;
} }
} }
}) })
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</template> </template>
<script> <script>
import { setEventByModuleCode } from '@/utils/index' //import { setEventByModuleCode } from '@/utils/index'
export default { export default {
name: 'YqyTeacherList', name: 'YqyTeacherList',
data () { data () {
...@@ -69,12 +69,12 @@ export default { ...@@ -69,12 +69,12 @@ export default {
] ]
} }
}; };
let paramList = setEventByModuleCode(itemData); let paramList = this.setEventByModuleCode(itemData);
rocNative.dispatchEventByModuleCode({ rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code, modeCode: itemData.appModuleInfo.code,
jsonString: paramList jsonString: paramList
}) })
}, },
//收藏 取消收藏 //收藏 取消收藏
...@@ -86,7 +86,7 @@ export default { ...@@ -86,7 +86,7 @@ export default {
courseId:id, courseId:id,
setEntry: 'headers' setEntry: 'headers'
} }
_this.POST('favors',parm).then(function(res){ _this.POST('contents/favors',parm).then(function(res){
if(res.code === '000000'){ if(res.code === '000000'){
status = status == 1 ? 2 : 1; status = status == 1 ? 2 : 1;
...@@ -94,6 +94,14 @@ export default { ...@@ -94,6 +94,14 @@ export default {
} }
}) })
}, },
handelData(id,status){
let d = this.list;
for(let i=0;i<d.length;i++){
if(id == d[i].id){
d[i].whetherFavors = status;
}
}
},
getData(){ getData(){
let _this = this, let _this = this,
parm = { parm = {
......
...@@ -14,13 +14,18 @@ ...@@ -14,13 +14,18 @@
<script> <script>
export default { export default {
name: 'header', name: 'header',
data(){ data () {
return { return {
message: ''
} }
}, },
components: { mounted(){
}, },
methods: {
},
props: { props: {
resourceData: { resourceData: {
type: Object, type: Object,
...@@ -34,20 +39,8 @@ export default { ...@@ -34,20 +39,8 @@ export default {
} }
} }
}, },
watch: {
message(val){
console.log('val',val);
}
},
data () {
return {
message: ''
}
},
mounted(){
},
methods: {
}
} }
</script> </script>
......
...@@ -49,7 +49,8 @@ ...@@ -49,7 +49,8 @@
//返回 //返回
goBack(){ goBack(){
rocNative.backPreviousPage(); //rocNative.backPreviousPage();
rocNative.goBack();
}, },
//分享 //分享
......
...@@ -159,20 +159,15 @@ export function getHostnameAndPort() { ...@@ -159,20 +159,15 @@ export function getHostnameAndPort() {
} }
} }
function getUrlParmByCode(paramList) { function setRouterParm(paramList){
if ( paramList.length <= 1) { let parm = {};
return '' if(paramList.length<=1){
} return '';
let dataStr = '' }
let list = []; for(let i=1;i<paramList.length;i++){
for( let i = 1; i < paramList.length; i ++) { parm[paramList[i].key] = paramList[i].value;
list.push(paramList[i].key + '=' + paramList[i].value) }
} return parm;
dataStr = list.join('&')
if (dataStr !== '') {
return '?' + dataStr
}
return ''
} }
export function setEventByModuleCode(itemData){ export function setEventByModuleCode(itemData){
...@@ -182,20 +177,20 @@ export function setEventByModuleCode(itemData){ ...@@ -182,20 +177,20 @@ export function setEventByModuleCode(itemData){
paramList = '' paramList = ''
}else if( modeCode === 'M100' || modeCode === 'M300' ) { }else if( modeCode === 'M100' || modeCode === 'M300' ) {
let urlPara = this.getUrlParm(paramList) let urlPara = getUrlParmByCode(paramList);
paramList[0].value += urlPara; paramList[0] && (paramList[0].value += urlPara);
}else if( modeCode === 'M400') { }else if( modeCode === 'M400') {
//单独跳转
this.$route.push({
path:'/certain',
query: {
} let path = paramList[0]['key'];
}) let v = paramList[0]['value'];
///let url = '' let query = setRouterParm(paramList);
// let urlPara = this.getUrlParm(paramList)
// paramList[0].value += urlPara //console.log(Vue);
// this.$router.push({
// path: v,
// query:query
// })
} }
if(typeof paramList === 'string' && !paramList){ if(typeof paramList === 'string' && !paramList){
paramList = [] paramList = []
...@@ -204,12 +199,33 @@ export function setEventByModuleCode(itemData){ ...@@ -204,12 +199,33 @@ export function setEventByModuleCode(itemData){
return paramList; return paramList;
} }
function getUrlParmByCode(paramList) {
if ( paramList.length <= 1) {
return ''
}
let dataStr = ''
let list = [];
for( let i = 1; i < paramList.length; i ++) {
list.push(paramList[i].key + '=' + paramList[i].value)
}
dataStr = list.join('&')
if (dataStr !== '') {
return '?' + dataStr
}
return ''
}
export function pageJumpUrl(){
const pageJumpUrl = 'https://test1-contents.yunqueyi.com/content_list';
return pageJumpUrl;
}
// test1地址 // test1地址
const baseUrl = 'http://10.177.10.238:10201/' || 'http://test1-sc.yunqueyi.com/' const baseUrl = 'http://10.177.10.238:10201/' || 'http://test1-sc.yunqueyi.com/'
const apiUrl = 'http://10.177.10.238:10201' || 'http://test1-api.yunqueyi.com/' const apiUrl = 'http://10.177.10.238:10201' || 'http://test1-api.yunqueyi.com/'
// // uat地址 // // uat地址
// const baseUrl = 'http://uat-sc.yunqueyi.com/' // const baseUrl = 'http://uat-sc.yunqueyi.com/'
// const apiUrl = 'http://uat-api.yunqueyi.com/' // const apiUrl = 'http://uat-api.yunqueyi.com/'
......
...@@ -35,6 +35,65 @@ module.exports = { ...@@ -35,6 +35,65 @@ module.exports = {
return '' return ''
}, },
setRouterParm(paramList){
let parm = {};
if(paramList.length<=1){
return '';
}
for(let i=1;i<paramList.length;i++){
parm[paramList[i].key] = paramList[i].value;
}
return parm;
},
getUrlParmByCode(paramList) {
if ( paramList.length <= 1) {
return ''
}
let dataStr = ''
let list = [];
for( let i = 1; i < paramList.length; i ++) {
list.push(paramList[i].key + '=' + paramList[i].value)
}
dataStr = list.join('&')
if (dataStr !== '') {
return '?' + dataStr
}
return ''
},
setEventByModuleCode(itemData){
let modeCode = itemData.appModuleInfo.code || '';
let paramList = itemData.appModuleInfo.paramList ? itemData.appModuleInfo.paramList : ''
if( modeCode === 'M001' || modeCode === 'M002' || modeCode === 'M003') {
paramList = ''
}else if( modeCode === 'M100' || modeCode === 'M300' ) {
let urlPara = this.getUrlParmByCode(paramList)
// paramList[0].value += urlPara;
paramList[0] && (paramList[0].value += urlPara);
}else if( modeCode === 'M400') {
let path = paramList[0]['key'];
let v = paramList[0]['value'];
let query = this.setRouterParm(paramList);
console.log(this);
this.$router.push({
path: v,
query:query
})
}
if(typeof paramList === 'string' && !paramList){
paramList = []
}
return paramList;
},
// 通用GET请求 // 通用GET请求
GET(api, para, callback) { GET(api, para, callback) {
para.token = para.token || this.token || 'EA67293E35C249C1832583F7AD2669EC' //'AF3DFCF2DD4B4115AC47ACA25D5420E9''F90DF48D3EFA49DFAE1267A67DBEFB18'//token para.token = para.token || this.token || 'EA67293E35C249C1832583F7AD2669EC' //'AF3DFCF2DD4B4115AC47ACA25D5420E9''F90DF48D3EFA49DFAE1267A67DBEFB18'//token
...@@ -48,7 +107,7 @@ module.exports = { ...@@ -48,7 +107,7 @@ module.exports = {
// 通用POST请求 // 通用POST请求
POST(api, para, callback) { POST(api, para, callback) {
para.token = para.token || this.token || '625D128F3DBA486AABE7CBA9BDF90E69' //'AF3DFCF2DD4B4115AC47ACA25D5420E9''F90DF48D3EFA49DFAE1267A67DBEFB18'//token para.token = para.token || this.token || 'EA67293E35C249C1832583F7AD2669EC' //'AF3DFCF2DD4B4115AC47ACA25D5420E9''F90DF48D3EFA49DFAE1267A67DBEFB18'//token
return fetch({ return fetch({
url: getBaseUrl(api), url: getBaseUrl(api),
method: 'post', method: 'post',
......
...@@ -9,6 +9,14 @@ ...@@ -9,6 +9,14 @@
// } // }
// var a = i[e]; // var a = i[e];
// delete i[e], "function" == typeof a && a(t, n) // delete i[e], "function" == typeof a && a(t, n)
if(t == '__nativeCallMsg'){
__nativeCallMsg(n)
}
if(t == '__getUserInfo'){
__getUserInfo(n);
}
}, },
__callNative: function (t, a, o) { __callNative: function (t, a, o) {
"function" == typeof o && (n++ , i[n] = o); "function" == typeof o && (n++ , i[n] = o);
...@@ -21,6 +29,7 @@ ...@@ -21,6 +29,7 @@
callbackId: __funcName, callbackId: __funcName,
param: param param: param
}); });
//alert(r);
if (e.__rocAndroid) { if (e.__rocAndroid) {
alert(r); alert(r);
e.__rocAndroid.postMessage(r); e.__rocAndroid.postMessage(r);
...@@ -28,7 +37,7 @@ ...@@ -28,7 +37,7 @@
return true; return true;
} }
if (e.webkit && window.webkit.messageHandlers.rociOS) { if (e.webkit && window.webkit.messageHandlers.rociOS) {
// alert(r) alert(r)
window.webkit.messageHandlers.rociOS.postMessage(r) window.webkit.messageHandlers.rociOS.postMessage(r)
// e.__isIOS = true; // e.__isIOS = true;
return true; return true;
...@@ -60,11 +69,12 @@ ...@@ -60,11 +69,12 @@
}) })
} }
}) })
}("dispatchEventByModuleCode", "gotoAuthentication", "shareWechat", "backPreviousPage", "bindingWechat", "gotoLogin", "getDeviceInfo", "goBack", "appBuryingPointEntrust", "getAuthPermission", "getAppVersionCode", "getToken", "gotoNewActivity", "gotoNewActivityWithParams", "gotoNewWebActivity", "gotoYidianActivity", "readMessage", "openFiveMintusAudio", "getStatusBarSize", "showNativeDialog", "showNativeToast", "gotoViewTop", "appInit", "checkPermissions", "getStatusBarHeight") }("dispatchEventByModuleCode", "gotoAuthentication", "shareWechat", "backPreviousPage", "bindingWechat", "gotoLogin", "getDeviceInfo", "goBack", "appBuryingPointEntrust", "getAuthPermission", "getAppVersionCode", "getToken", "gotoNewActivity", "gotoNewActivityWithParams", "gotoNewWebActivity", "gotoYidianActivity", "readMessage", "openFiveMintusAudio", "getStatusBarSize", "showNativeDialog", "showNativeToast", "gotoViewTop", "appInit", "checkPermissions", "getStatusBarHeight","setTabMiniIcon","getUserInfo")
}(window); }(window);
window.__gotoAuthentication = function (params) { window.__gotoAuthentication = function (params) {
alert('I am in __gotoAuthentication') alert('I am in __gotoAuthentication')
} }
// console.log(33344) // console.log(33344)
// if (__isIOS){ // if (__isIOS){
// // rocNative.appInit() // // rocNative.appInit()
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</template> </template>
<script> <script>
import { setEventByModuleCode } from '@/utils/index' // import { setEventByModuleCode } from '@/utils/index'
import TopNav from '../../components/common/topNav'; import TopNav from '../../components/common/topNav';
import BackTop from '../../components/common/backTop'; import BackTop from '../../components/common/backTop';
export default { export default {
...@@ -39,13 +39,15 @@ export default { ...@@ -39,13 +39,15 @@ export default {
BackTop BackTop
}, },
mounted(){ mounted(){
console.log(this.$route.query);
this.id = this.$route.query.categoryId
this.getTabData(); this.getTabData();
}, },
methods:{ methods:{
goToPage(itemData){ goToPage(itemData){
let paramList = setEventByModuleCode(itemData); let paramList = this.setEventByModuleCode(itemData);
rocNative.dispatchEventByModuleCode({ rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code, modeCode: itemData.appModuleInfo.code,
jsonString: paramList jsonString: paramList
...@@ -61,10 +63,10 @@ export default { ...@@ -61,10 +63,10 @@ export default {
_this.GET('contents/contentList/tabById',parm).then(function(res){ _this.GET('contents/contentList/tabById',parm).then(function(res){
if(res.code === '000000'){ if(res.code === '000000'){
_this.tabList = res.data.tabList || []; _this.tabName = res.data.name || '';
if(_this.tabList.length>0){ // if(_this.tabList.length>0){
_this.tabName = _this.tabList[0] // _this.tabName = _this.tabList[0] || '';
} // }
_this.getData(); _this.getData();
}else{ }else{
//alert(res.message) //alert(res.message)
...@@ -77,8 +79,11 @@ export default { ...@@ -77,8 +79,11 @@ export default {
let _this = this, let _this = this,
parm = { parm = {
id:_this.id, id:_this.id,
tabName:_this.tabName tabName : _this.tabName
} }
// if(_this.tabName != ''){
// parm.tabName = _this.tabName
// }
_this.GET('contents/contentList/contentById',parm).then(function(res){ _this.GET('contents/contentList/contentById',parm).then(function(res){
if(res.code === '000000'){ if(res.code === '000000'){
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<section class="home-header"> <section class="home-header">
<div class="home-topMenu"> <div class="home-topMenu">
<YqyHomeHeader/> <YqyHomeHeader :msgCount="msgCount"/>
</div> </div>
<div class="swiper"> <div class="swiper">
<mt-swipe :auto="0" :stopPropagation="stopPropagation" :prevent="stopPropagation" :speed="speedSwiper"> <mt-swipe :auto="0" :stopPropagation="stopPropagation" :prevent="stopPropagation" :speed="speedSwiper">
...@@ -51,14 +51,14 @@ ...@@ -51,14 +51,14 @@
<YqyFiveMinutes/> <YqyFiveMinutes/>
<!--为你推荐--> <!--为你推荐-->
<YqyHomeAdjust :isFixed="isFixed" v-on:getAdjust="fromAdjust"/> <YqyHomeAdjust :isFixed="isFixed"/>
<!--返回顶部--> <!--返回顶部-->
<BackTop v-if="isShowBackTop"/> <BackTop v-if="isShowBackTop"/>
<a class="news-update" href="#new-course" v-if="showNewCorse"> <a class="news-update" @click="goAnchors" v-show="showNewCorse">
<span class="news-info"> <span class="news-info">
10个新内容 {{updateTotal}}个新内容
<i></i> <i></i>
</span> </span>
</a> </a>
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<script> <script>
import { Swipe, SwipeItem ,Header} from 'mint-ui'; import { Swipe, SwipeItem ,Header} from 'mint-ui';
import { setEventByModuleCode } from '@/utils/index' // import { setEventByModuleCode } from '@/utils/index'
import BackTop from '../../components/common/backTop'; import BackTop from '../../components/common/backTop';
import YqyTeacherList from '../../components/business-new/yqy-teacher-list'; import YqyTeacherList from '../../components/business-new/yqy-teacher-list';
import YqyTopEvaluat from '../../components/business-new/yqy-home-learn-evaluation'; import YqyTopEvaluat from '../../components/business-new/yqy-home-learn-evaluation';
...@@ -83,7 +83,7 @@ import YqyHomeAdjust from '../../components/business-new/yqy-adjust'; ...@@ -83,7 +83,7 @@ import YqyHomeAdjust from '../../components/business-new/yqy-adjust';
export default { export default {
data(){ data(){
return { return {
showNewCorse:true, // 是否显示新内容 默认显示 showNewCorse:false, // 是否显示新内容 默认不显示
isFixed:false, isFixed:false,
isShowBackTop:false, isShowBackTop:false,
isShowEvluat:true,//是否显示下拉 isShowEvluat:true,//是否显示下拉
...@@ -93,6 +93,14 @@ export default { ...@@ -93,6 +93,14 @@ export default {
isIntStyle:'', isIntStyle:'',
listSwiper:[],//轮播图数据 listSwiper:[],//轮播图数据
listMiddle:[],//中间栏数据 listMiddle:[],//中间栏数据
scrollTimer:null,
scrollTop:0,
hideNewCourse:true,
updateTotal:0,
msgCount:'',
systemType:'',
appVersion:'',
userToken:''
} }
}, },
components:{ components:{
...@@ -110,30 +118,119 @@ export default { ...@@ -110,30 +118,119 @@ export default {
YqyHomeKeepon, YqyHomeKeepon,
YqyHomePorter, YqyHomePorter,
YqyHomeAdjust YqyHomeAdjust
},
created () {
let _this = this;
window.__nativeCallMsg = function(params){
_this.msgCount = params.msgNum || '';
}
window.__getUserInfo = function(parm){
let params = JSON.parse(parm);
_this.systemType = params.systemType;
_this.appVersion = params.appVersion;
_this.userToken = params.userToken;
//alert(_this.appVersion);
if(!!_this.systemType && !!_this.appVersion){
_this.getSwiper();
}
}
}, },
mounted(){ mounted(){
window.addEventListener('scroll', this.scrollFun); window.addEventListener('scroll', this.scrollFun);
this.getSwiper(); this.getUserInfo();
this.getUpdateData();
this.getMiddel(); this.getMiddel();
// this.init()
}, },
beforeDestroyed(){ beforeDestroyed(){
window.removeEventListener('scroll', this.scrollFun) window.removeEventListener('scroll', this.scrollFun)
},
watch:{
//监听是否收起
isShowEvluat:function(n){
if(!n && this.isIntStyle == 'font-style pull-up'){
///alert("000");
rocNative.setTabMiniIcon({
tabIndex:3,
iconTitle:'学习评价',
iconColor:'#6c6c6c',
isSet:true
})
}
}
}, },
methods:{ methods:{
fromAdjust(){
window.removeEventListener('scroll', this.scrollFun); //获取版本号
getUserInfo(){
rocNative.getUserInfo({
__funcName: '__getUserInfo'
})
}, },
scrollFun(){ //有更新数据
var scrollTop = document.body.scrollTop || document.documentElement.scrollTop; getUpdateData(){
if(scrollTop > 0 && this.isIntStyle == 'font-style pull-down'){ let _this = this,
this.isIntStyle = 'font-style pull-up'; para = {
this.isShowEvluat = false;
token:_this.token
}
//alert("000");
this.GET('contents/courses/queryCourseCount', para).then(res => {
if(res.code == '000000'){
if(res.data != null){
_this.updateTotal = res.data.courseCount + res.data.fiveHospCount;
_this.showNewCorse = _this.updateTotal > 0 ? true : false
}
} }
})
},
goAnchors(){
document.documentElement.scrollTop = document.querySelector('#new-course').offsetTop;
document.body.scrollTop = document.querySelector('#new-course').offsetTop;
///alert("000");
this.hideNewCourse = false;
this.showNewCorse = false;
},
scrollEndFun(){
let scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
if(this.scrollTop != scrollTop){
this.showNewCorse = false;
}else{
//alert("000");
this.showNewCorse = true;
}
},
scrollFun(){
let scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
this.showNewCorse = false;
if(this.hideNewCourse){
this.scrollTop = scrollTop;
clearTimeout(this.scrollTimer);
this.scrollTimer = setTimeout(this.scrollEndFun, 100);
}
if(scrollTop > 0 && this.isIntStyle == 'font-style pull-down'){
this.isIntStyle = 'font-style pull-up';
this.isShowEvluat = false;
}
//滚动条滚动到最新课程 //滚动条滚动到最新课程
var newCourseTop = document.querySelector('#famus-teacher').offsetTop; var newCourseTop = document.querySelector('#famus-teacher').offsetTop;
var clientHeight = document.querySelector('#famus-teacher').clientHeight; var clientHeight = document.querySelector('#famus-teacher').clientHeight;
...@@ -141,7 +238,7 @@ export default { ...@@ -141,7 +238,7 @@ export default {
//console.log(newCourseTop); //console.log(newCourseTop);
if(scrollTop +clientHeight/2 >= newCourseTop){ if(scrollTop +clientHeight/2 >= newCourseTop){
//alert('scrollTop:'+scrollTop+'newCourseTop:'+newCourseTop); //alert('scrollTop:'+scrollTop+'newCourseTop:'+newCourseTop);
this.showNewCorse = false; //this.showNewCorse = false;
this.isShowBackTop = true; this.isShowBackTop = true;
}else{ }else{
this.isShowBackTop = false; this.isShowBackTop = false;
...@@ -154,10 +251,23 @@ export default { ...@@ -154,10 +251,23 @@ export default {
}, },
//五秒之后收起
fiveTimePull(){
let _this = this;
let setTimer = setInterval(function(){
_this.isIntStyle = 'font-style pull-up';
_this.isShowEvluat = false;
clearInterval(setTimer)
},5000);
},
getEluatFun(obj){ getEluatFun(obj){
///console.log(obj); ///console.log(obj);
if(obj.isPull == '1'){ if(obj.isPull == '1'){
this.isIntStyle = 'font-style pull-down' this.isIntStyle = 'font-style pull-down';
this.fiveTimePull()
}else if(obj.isPull == '2'){ }else if(obj.isPull == '2'){
this.isIntStyle = '' this.isIntStyle = ''
}else if(obj.isPull == '0'){ }else if(obj.isPull == '0'){
...@@ -170,9 +280,9 @@ export default { ...@@ -170,9 +280,9 @@ export default {
//version=3.7.3&systemType=3&token=364ED1F1C8064CEBABF745CFFFDE18CF //version=3.7.3&systemType=3&token=364ED1F1C8064CEBABF745CFFFDE18CF
let _this = this, let _this = this,
para = { para = {
version:"3.7.3", version:_this.appVersion,
systemType:3, systemType:_this.systemType,
token:'364ED1F1C8064CEBABF745CFFFDE18CF' token:_this.userToken
} }
//alert("000"); //alert("000");
this.GET('contents/carusels/home', para).then(res => { this.GET('contents/carusels/home', para).then(res => {
...@@ -200,7 +310,7 @@ export default { ...@@ -200,7 +310,7 @@ export default {
//中间栏跳转 //中间栏跳转
goToPatholo(itemData){ goToPatholo(itemData){
let paramList = setEventByModuleCode(itemData); let paramList = this.setEventByModuleCode(itemData);
// alert(JSON.stringify({ // alert(JSON.stringify({
// modeCode: itemData.appModuleInfo.code, // modeCode: itemData.appModuleInfo.code,
// jsonString: paramList // jsonString: paramList
...@@ -210,35 +320,6 @@ export default { ...@@ -210,35 +320,6 @@ export default {
jsonString: paramList jsonString: paramList
}) })
}, },
init() {
// this.API_GET('contents/homeButton/msg', {}).then( res => {
// logger.debug(res)
// this.$log.debug(res)
// })
// //console.log(this);
// let para = {
// sysCode: 27,
// token: this.token,
// setEntry: 'headers'
// }
// this.GET('analysis/activityDetail', para).then( res => {
// logger.debug(res)
// })
// para = {
// sysCode: 27,
// rankingType: 27,
// flag: 1,
// token: this.token,
// setEntry: 'headers'
// }
// this.GET('exams/rankings', para).then( res => {
// logger.debug(res)
// })
},
}, },
} }
...@@ -303,7 +384,7 @@ export default { ...@@ -303,7 +384,7 @@ export default {
position: fixed; position: fixed;
background: #F9F6EF; background: #F9F6EF;
right: 0; right: 0;
bottom: px2rem(100px); bottom: px2rem(140px);
height: px2rem(27px); height: px2rem(27px);
padding:0 px2rem(12px);; padding:0 px2rem(12px);;
line-height: px2rem(27px); line-height: px2rem(27px);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册