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

add

上级 7ac39bd4
......@@ -32,7 +32,7 @@
</div>
<div class="loading-box" >
<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>
......@@ -43,7 +43,7 @@
<script>
import { Loadmore,Spinner,InfiniteScroll } from 'mint-ui';
import { setEventByModuleCode } from '@/utils/index'
// import { setEventByModuleCode } from '@/utils/index'
// import LOADING from '../../components/common/loading-new';
export default {
data () {
......@@ -104,7 +104,7 @@ export default {
]
}
};
let paramList = setEventByModuleCode(itemData);
let paramList = this.setEventByModuleCode(itemData);
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: paramList
......@@ -114,6 +114,9 @@ export default {
//换一批
changeFun(){
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.noMore = false;
this.pageNo++;
......@@ -123,15 +126,17 @@ export default {
//滑动加载更多
loadMore(){
// alert("0000");
let _this = this;
_this.pageNo += 1;
_this.isLoading = true;
this.loading = true;
if(!_this.noMore){
_this.pageNo += 1;
_this.isLoading = true;
this.loading = true;
setTimeout(()=>{
_this.getData('loadMore');
},500)
setTimeout(()=>{
_this.getData('loadMore');
},500)
}
},
//收藏 取消收藏
......@@ -143,7 +148,7 @@ export default {
courseId:id,
setEntry: 'headers'
}
_this.POST('favors',parm).then(function(res){
_this.POST('contents/favors',parm).then(function(res){
if(res.code === '000000'){
status = status == 1 ? 2 : 1;
......@@ -174,16 +179,20 @@ export default {
_this.GET('contents/courses/recommendCourseList',parm).then(function(res){
if(res.code === '000000'){
if(type == 'loadMore'){
if(res.data == null || res.data.length == 0 && res.data.length <_this.pageSize){
this.isLoading = false;
this.noMore = true;
}
if(res.data == null){
if(res.data == null || !res.data){
res.data = [];
_this.isLoading = false;
_this.noMore = true;
_this.loading = false;
}
_this.list = [..._this.list ,...res.data] || [];
}else{
_this.noMore = false;
_this.isLoading = false;
_this.list = res.data || [];
}
}else{
......@@ -227,7 +236,7 @@ export default {
}
.loading-box{
font-size: px2rem(16px);
padding:px2rem(10px) 0;
padding:px2rem(10px) 0 px2rem(20px) 0;
text-align: center;
span{
color:#999;
......@@ -242,7 +251,7 @@ export default {
border:1px solid #A9AEB7;
border-radius: px2rem(9px);
vertical-align: middle;
padding: px2rem(3px) px2rem(5px) px2rem(2px) px2rem(6px);
padding: px2rem(3px) px2rem(5px) px2rem(4px) px2rem(6px);
img{
width: px2rem(12px);
height: px2rem(12px);
......
......@@ -23,7 +23,7 @@
</template>
<script>
import { setEventByModuleCode } from '@/utils/index'
// import { setEventByModuleCode } from '@/utils/index'
export default {
data(){
return{
......@@ -41,9 +41,7 @@ export default {
},
methods: {
goToPage(itemData){
console.log(this.leftObj);
let paramList = setEventByModuleCode(itemData);
let paramList = this.setEventByModuleCode(itemData);
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: paramList
......@@ -58,9 +56,9 @@ export default {
}
this.GET('contents/HomeColumn/Information', para).then(res => {
if(res.code == '000000'){
console.log(res);
//console.log(res);
_this.list = res.data && res.data.iconColumnInformationModels || [];
console.log(_this.list);
/// console.log(_this.list);
_this.leftObj = _this.list[0] || {};
_this.rightTop = _this.list[1] || {};
_this.rightBottom = _this.list[2] || {};
......
......@@ -6,7 +6,7 @@
更多<img src="../../images/right-throw.png" class="thorw-icon"/>
</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">
<img :src="item.appImageUrl"/>
</div>
......@@ -14,7 +14,7 @@
<div class="teacher-itemname fs14">{{item.title}}</div>
<div class="five-tag fs11">
<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"/>
</span>
</div>
......@@ -25,6 +25,7 @@
</template>
<script>
import { pageJumpUrl} from '@/utils/index'
export default {
name: 'YqyFiveMinutes',
data(){
......@@ -36,17 +37,53 @@ export default {
this.getData();
},
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(){
let _this = this,
parm = {
pageNo: 1,
token: 'ACEEFAE765AA4D9EB68BE80735845BF9',
// token: _this.token,
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'){
_this.list = res.fiveMinutesMedicalContentList || []
......@@ -145,13 +182,13 @@ export default {
padding: 0 px2rem(5px);
color: #BF9E15;
border-radius: 0 px2rem(3px) px2rem(3px) px2rem(3px);
background-color: px2rem(17px);
/* background-color: px2rem(17px);*/
border:1px solid #FAE5AF;
}
}
.m-play{
width: px2rem(22px);
height: px2rem(22px);
width: px2rem(28px);
height: px2rem(28px);
display: inline-block;
position:absolute;
right: 0;
......
......@@ -8,7 +8,7 @@
</div>
<div class="tea-list">
<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">
<img class="tea-itemimg" :src="item.avatarImageUrl"/>
</div>
......@@ -21,6 +21,7 @@
</template>
<script>
// import { setEventByModuleCode } from '@/utils/index'
export default {
data(){
return {
......@@ -37,18 +38,49 @@ export default {
methods: {
//跳转
goToPage(id,parm){
goToPage(item,parm){
let keyName = '',
val = '',
classNameVal = '';
if(parm == 'list'){
rocNative.gotoNewActivity({
"className": "com.picahealth.yunque.activitys.experienceshare.ExperienceShcom.picahealth.yunque.activitys.experienceshare.ExperienceSh"
})
keyName = '';
val = '';
classNameVal = 'com.picahealth.yunque.activitys.experienceshare.ExperienceShareDetailActivity###SharedExperienceViewController'
}else{
rocNative.gotoNewActivityWithParams({
"className": "com.picahealth.yunque.activitys.playvideo.PlayVideoFullScrenA",
"params": { "id": id }
})
keyName = 'id';
val = item.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 {
background-color: #fff;
padding: 0 0 px2rem(26px) px2rem(15px);
.titleTop{
padding: 0 px2rem(15px) px2rem(15px) 0;
padding: 0 px2rem(15px) px2rem(15px) 0;
overflow: hidden;
height: px2rem(40px);
}
.title{
font-size: px2rem(18px);
float: left;
font-weight: bold;
}
.get-more{
......
......@@ -14,7 +14,7 @@
</template>
<script>
import { setEventByModuleCode } from '@/utils/index'
// import { setEventByModuleCode } from '@/utils/index'
export default {
name: 'YqyHomeBanner',
data(){
......@@ -27,7 +27,7 @@ export default {
},
methods: {
goToPage(itemData){
let paramList = setEventByModuleCode(itemData);
let paramList = this.setEventByModuleCode(itemData);
// alert(JSON.stringify({
// modeCode: itemData.appModuleInfo.code,
// jsonString: paramList
......
......@@ -6,7 +6,7 @@
</div>
<div class="header-right">
<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>
</template>
......@@ -20,10 +20,22 @@ export default {
searchVal:'',
isTransparent: true, //更改颜色 背景
isMax:false,//消息数量是否大于99
count:"99"
count:'',
isShowMsg:true,
}
},
props:{
msgCount:{
type:String,
default:''
}
},
mounted(){
this.count = this.msgCount;
if(this.msgCount == ''){
this.isShowMsg = false
}
if(this.count>=99){
this.count += '+';
this.isMax = true
......
......@@ -6,7 +6,7 @@
<div>
<span class="gray fs24 keepon-right">已学习:{{parmObj.day}}</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>
......@@ -19,6 +19,7 @@
</template>
<script>
// import { setEventByModuleCode } from '@/utils/index'
export default {
name: 'YqyHomeKeepon',
data(){
......@@ -31,11 +32,40 @@ export default {
this.getData();
},
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(){
this.isShow = false
},
getData(){
let _this = this,
......@@ -52,7 +82,7 @@ export default {
if(_this.parmObj.remanentCourseNum == 0){
_this.isShow = false;
}else{
_this.isShow = _this.parmObj.showFlag ? true : false;
_this.isShow = true || _this.parmObj.showFlag ? true : false;
}
}
})
......
......@@ -28,7 +28,7 @@
</template>
<script>
import { setEventByModuleCode } from '@/utils/index'
//import { setEventByModuleCode } from '@/utils/index'
export default {
name: 'YqyTeacherList',
data () {
......@@ -69,12 +69,12 @@ export default {
]
}
};
let paramList = setEventByModuleCode(itemData);
let paramList = this.setEventByModuleCode(itemData);
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: paramList
})
},
//收藏 取消收藏
......@@ -86,7 +86,7 @@ export default {
courseId:id,
setEntry: 'headers'
}
_this.POST('favors',parm).then(function(res){
_this.POST('contents/favors',parm).then(function(res){
if(res.code === '000000'){
status = status == 1 ? 2 : 1;
......@@ -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(){
let _this = this,
parm = {
......
......@@ -14,13 +14,18 @@
<script>
export default {
name: 'header',
data(){
data () {
return {
message: ''
}
},
components: {
mounted(){
},
methods: {
},
props: {
resourceData: {
type: Object,
......@@ -34,20 +39,8 @@ export default {
}
}
},
watch: {
message(val){
console.log('val',val);
}
},
data () {
return {
message: ''
}
},
mounted(){
},
methods: {
}
}
</script>
......
......@@ -49,7 +49,8 @@
//返回
goBack(){
rocNative.backPreviousPage();
//rocNative.backPreviousPage();
rocNative.goBack();
},
//分享
......
......@@ -159,20 +159,15 @@ export function getHostnameAndPort() {
}
}
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 ''
function 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;
}
export function setEventByModuleCode(itemData){
......@@ -182,20 +177,20 @@ export function setEventByModuleCode(itemData){
paramList = ''
}else if( modeCode === 'M100' || modeCode === 'M300' ) {
let urlPara = this.getUrlParm(paramList)
paramList[0].value += urlPara;
let urlPara = getUrlParmByCode(paramList);
paramList[0] && (paramList[0].value += urlPara);
}else if( modeCode === 'M400') {
//单独跳转
this.$route.push({
path:'/certain',
query: {
}
})
///let url = ''
// let urlPara = this.getUrlParm(paramList)
// paramList[0].value += urlPara
let path = paramList[0]['key'];
let v = paramList[0]['value'];
let query = setRouterParm(paramList);
//console.log(Vue);
// this.$router.push({
// path: v,
// query:query
// })
}
if(typeof paramList === 'string' && !paramList){
paramList = []
......@@ -204,12 +199,33 @@ export function setEventByModuleCode(itemData){
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地址
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/'
// // uat地址
// const baseUrl = 'http://uat-sc.yunqueyi.com/'
// const apiUrl = 'http://uat-api.yunqueyi.com/'
......
......@@ -35,6 +35,65 @@ module.exports = {
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(api, para, callback) {
para.token = para.token || this.token || 'EA67293E35C249C1832583F7AD2669EC' //'AF3DFCF2DD4B4115AC47ACA25D5420E9''F90DF48D3EFA49DFAE1267A67DBEFB18'//token
......@@ -48,7 +107,7 @@ module.exports = {
// 通用POST请求
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({
url: getBaseUrl(api),
method: 'post',
......
......@@ -9,6 +9,14 @@
// }
// var a = i[e];
// delete i[e], "function" == typeof a && a(t, n)
if(t == '__nativeCallMsg'){
__nativeCallMsg(n)
}
if(t == '__getUserInfo'){
__getUserInfo(n);
}
},
__callNative: function (t, a, o) {
"function" == typeof o && (n++ , i[n] = o);
......@@ -21,6 +29,7 @@
callbackId: __funcName,
param: param
});
//alert(r);
if (e.__rocAndroid) {
alert(r);
e.__rocAndroid.postMessage(r);
......@@ -28,7 +37,7 @@
return true;
}
if (e.webkit && window.webkit.messageHandlers.rociOS) {
// alert(r)
alert(r)
window.webkit.messageHandlers.rociOS.postMessage(r)
// e.__isIOS = true;
return true;
......@@ -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.__gotoAuthentication = function (params) {
alert('I am in __gotoAuthentication')
}
// console.log(33344)
// if (__isIOS){
// // rocNative.appInit()
......
......@@ -16,7 +16,7 @@
</template>
<script>
import { setEventByModuleCode } from '@/utils/index'
// import { setEventByModuleCode } from '@/utils/index'
import TopNav from '../../components/common/topNav';
import BackTop from '../../components/common/backTop';
export default {
......@@ -39,13 +39,15 @@ export default {
BackTop
},
mounted(){
console.log(this.$route.query);
this.id = this.$route.query.categoryId
this.getTabData();
},
methods:{
goToPage(itemData){
let paramList = setEventByModuleCode(itemData);
let paramList = this.setEventByModuleCode(itemData);
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: paramList
......@@ -61,10 +63,10 @@ export default {
_this.GET('contents/contentList/tabById',parm).then(function(res){
if(res.code === '000000'){
_this.tabList = res.data.tabList || [];
if(_this.tabList.length>0){
_this.tabName = _this.tabList[0]
}
_this.tabName = res.data.name || '';
// if(_this.tabList.length>0){
// _this.tabName = _this.tabList[0] || '';
// }
_this.getData();
}else{
//alert(res.message)
......@@ -77,8 +79,11 @@ export default {
let _this = this,
parm = {
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){
if(res.code === '000000'){
......
......@@ -5,7 +5,7 @@
<section class="home-header">
<div class="home-topMenu">
<YqyHomeHeader/>
<YqyHomeHeader :msgCount="msgCount"/>
</div>
<div class="swiper">
<mt-swipe :auto="0" :stopPropagation="stopPropagation" :prevent="stopPropagation" :speed="speedSwiper">
......@@ -51,14 +51,14 @@
<YqyFiveMinutes/>
<!--为你推荐-->
<YqyHomeAdjust :isFixed="isFixed" v-on:getAdjust="fromAdjust"/>
<YqyHomeAdjust :isFixed="isFixed"/>
<!--返回顶部-->
<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">
10个新内容
{{updateTotal}}个新内容
<i></i>
</span>
</a>
......@@ -68,7 +68,7 @@
<script>
import { Swipe, SwipeItem ,Header} from 'mint-ui';
import { setEventByModuleCode } from '@/utils/index'
// import { setEventByModuleCode } from '@/utils/index'
import BackTop from '../../components/common/backTop';
import YqyTeacherList from '../../components/business-new/yqy-teacher-list';
import YqyTopEvaluat from '../../components/business-new/yqy-home-learn-evaluation';
......@@ -83,7 +83,7 @@ import YqyHomeAdjust from '../../components/business-new/yqy-adjust';
export default {
data(){
return {
showNewCorse:true, // 是否显示新内容 默认显示
showNewCorse:false, // 是否显示新内容 默认不显示
isFixed:false,
isShowBackTop:false,
isShowEvluat:true,//是否显示下拉
......@@ -93,6 +93,14 @@ export default {
isIntStyle:'',
listSwiper:[],//轮播图数据
listMiddle:[],//中间栏数据
scrollTimer:null,
scrollTop:0,
hideNewCourse:true,
updateTotal:0,
msgCount:'',
systemType:'',
appVersion:'',
userToken:''
}
},
components:{
......@@ -110,30 +118,119 @@ export default {
YqyHomeKeepon,
YqyHomePorter,
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(){
window.addEventListener('scroll', this.scrollFun);
this.getSwiper();
this.getUserInfo();
this.getUpdateData();
this.getMiddel();
// this.init()
},
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:{
fromAdjust(){
window.removeEventListener('scroll', this.scrollFun);
//获取版本号
getUserInfo(){
rocNative.getUserInfo({
__funcName: '__getUserInfo'
})
},
scrollFun(){
var scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
if(scrollTop > 0 && this.isIntStyle == 'font-style pull-down'){
this.isIntStyle = 'font-style pull-up';
this.isShowEvluat = false;
//有更新数据
getUpdateData(){
let _this = this,
para = {
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 clientHeight = document.querySelector('#famus-teacher').clientHeight;
......@@ -141,7 +238,7 @@ export default {
//console.log(newCourseTop);
if(scrollTop +clientHeight/2 >= newCourseTop){
//alert('scrollTop:'+scrollTop+'newCourseTop:'+newCourseTop);
this.showNewCorse = false;
//this.showNewCorse = false;
this.isShowBackTop = true;
}else{
this.isShowBackTop = false;
......@@ -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){
///console.log(obj);
if(obj.isPull == '1'){
this.isIntStyle = 'font-style pull-down'
this.isIntStyle = 'font-style pull-down';
this.fiveTimePull()
}else if(obj.isPull == '2'){
this.isIntStyle = ''
}else if(obj.isPull == '0'){
......@@ -170,9 +280,9 @@ export default {
//version=3.7.3&systemType=3&token=364ED1F1C8064CEBABF745CFFFDE18CF
let _this = this,
para = {
version:"3.7.3",
systemType:3,
token:'364ED1F1C8064CEBABF745CFFFDE18CF'
version:_this.appVersion,
systemType:_this.systemType,
token:_this.userToken
}
//alert("000");
this.GET('contents/carusels/home', para).then(res => {
......@@ -200,7 +310,7 @@ export default {
//中间栏跳转
goToPatholo(itemData){
let paramList = setEventByModuleCode(itemData);
let paramList = this.setEventByModuleCode(itemData);
// alert(JSON.stringify({
// modeCode: itemData.appModuleInfo.code,
// jsonString: paramList
......@@ -210,35 +320,6 @@ export default {
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 {
position: fixed;
background: #F9F6EF;
right: 0;
bottom: px2rem(100px);
bottom: px2rem(140px);
height: px2rem(27px);
padding:0 px2rem(12px);;
line-height: px2rem(27px);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册