提交 e68fa07b 编写于 作者: 杨广俊's avatar 杨广俊

format

上级 816853b3
<template> <template>
<section> <section>
<TopNav :bgColor="bgColor" :title="navTitle" :isNavFix="isNavFix" :burialPoint="pointStyle"></TopNav> <TopNav :bgColor="bgColor" :title="navTitle" :isNavFix="isNavFix" :burialPoint="pointStyle"></TopNav>
<!-- <teacherTop :backMethod="backMethod"></teacherTop> --> <!-- <teacherTop :backMethod="backMethod"></teacherTop> -->
<section class="activity-box"> <section class="activity-box">
<div class="activity-count">{{list.length}}个活动</div> <div class="activity-count">{{list.length}}个活动</div>
<div class="activity-list"> <div class="activity-list">
<div class="activity-item" v-for="(item,index) in list" :key="index" @click="goToPage(item)"> <div
<img v-lazy="item.imageUrl" class="img" :key="item.imageUrl"/> class="activity-item"
<!-- <div class="time">活动时间:9月3日-9月9日</div> --> v-for="(item,index) in list"
</div> :key="index"
<div class="no-show" v-if="list.length.length == 0"> @click="goToPage(item)"
暂无数据 >
</div> <img v-lazy="item.imageUrl" class="img" :key="item.imageUrl">
</div> <!-- <div class="time">活动时间:9月3日-9月9日</div> -->
<BackTop v-if="isShowBackTop" :burialPoint="pointStyle"></BackTop> </div>
</section> <div class="no-show" v-if="list.length.length == 0">暂无数据</div>
</div>
<BackTop v-if="isShowBackTop" :burialPoint="pointStyle"></BackTop>
</section> </section>
</section>
</template> </template>
<script> <script>
import TopNav from '../../components/teacher/topNav'; import TopNav from "../../components/teacher/topNav";
import BackTop from '../../components/teacher/backTop'; import BackTop from "../../components/teacher/backTop";
import {activity_action} from '../../utils/buryingPoint'; import { activity_action } from "../../utils/buryingPoint";
import { deepCopy } from '../../utils'; import { deepCopy } from "../../utils";
export default { export default {
data(){ data() {
return { return {
backMethod: 'native', backMethod: "native",
tittle: '', tittle: "",
list: [], list: [],
bgColor: '#fff', bgColor: "#fff",
navTitle:' 专项合作', navTitle: " 专项合作",
isBorder: true, isBorder: true,
isNavFix: true, isNavFix: true,
id: 1, id: 1,
tabName:'活动', tabName: "活动",
tabList: [], tabList: [],
isShowBackTop: false, isShowBackTop: false,
pointStyle: 'activity', pointStyle: "activity",
token: null token: null
} };
}, },
components:{
TopNav,
BackTop
},
created(){
let _this = this;
this.id = this.$route.query.categoryId || 1
this.navTitle = this.id == 1 ? '专项合作' : '活动掠影'
window.__getUserInfo = function(parm){
_this.token = parm.userToken
_this.getTabData()
}
window.addEventListener('scroll', this.scrollFun);
if( window.__isWeb) {
this.getTabData()
}
this.getUserInfo()
},
mounted(){
},
beforeDestroyed(){
window.removeEventListener('scroll', this.scrollFun)
},
methods:{ components: {
TopNav,
BackTop
},
//获取版本号 created() {
getUserInfo(){ let _this = this;
rocNative.getUserInfo({ this.id = this.$route.query.categoryId || 1;
__funcName: '__getUserInfo' this.navTitle = this.id == 1 ? "专项合作" : "活动掠影";
}) window.__getUserInfo = function(parm) {
}, _this.token = parm.userToken;
scrollFun(){ _this.getTabData();
let scrollTop = document.documentElement.scrollTop; };
this.isShowBackTop = scrollTop > 0 ? true : false; window.addEventListener("scroll", this.scrollFun);
}, if (window.__isWeb) {
goToPage(itemData){ this.getTabData();
let paramList = deepCopy(this.setEventByModuleCode(itemData)) }
let isStrokeUrl = paramList[0] && paramList[0]['value'] && paramList[0]['value'].indexOf('stroke.js') !== -1 this.getUserInfo();
let strokeUrl = '' },
if ( isStrokeUrl ) {
strokeUrl = paramList[0]['value'] + '&token=' + this.token
paramList[0]['value'] = strokeUrl
}
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: paramList
})
this.appBuryingPointEntrust({
...activity_action,
labelId: itemData.id,
functionCode: this.id == 1 ? 'c_project' : 'f_activity',
actionCode: this.id == 1 ? 'c_project_tab' : 'c_activity_tab',
labelValue: itemData.title,
createdTime: new Date().getTime()
})
},
// 埋点 mounted() {},
appBuryingPointEntrust(val) {
rocNative.appBuryingPointEntrust(val)
},
//查询tab
getTabData(){
let _this = this,
parm = {
id: _this.id || 1,
setEntry: 'headers',
token: _this.token,
}
_this.GET('contents/contentList/tabById',parm).then(function(res){
if(res.code === '000000'){
_this.navTitle = res.data.name || '';
_this.tabName = _this.tabList[0] || '';
// if(_this.tabList.length>0){
// _this.tabName = _this.tabList[0] || '';
// }
_this.getData();
}else{
//alert(res.message)
}
})
},
//查询内容 beforeDestroyed() {
getData(){ window.removeEventListener("scroll", this.scrollFun);
let _this = this, },
parm = {
id: _this.id,
tabName : _this.tabName,
setEntry: 'headers',
token: _this.token
}
// if(_this.tabName != ''){
// parm.tabName = _this.tabName
// }
_this.GET('contents/contentList/contentById',parm).then(function(res){
if(res.code === '000000'){ methods: {
_this.list = res.data.contentList && res.data.contentList.contentList || []; //获取版本号
} getUserInfo() {
}) rocNative.getUserInfo({
} __funcName: "__getUserInfo"
});
},
scrollFun() {
let scrollTop = document.documentElement.scrollTop;
this.isShowBackTop = scrollTop > 0 ? true : false;
},
goToPage(itemData) {
let paramList = deepCopy(this.setEventByModuleCode(itemData));
let isStrokeUrl =
paramList[0] &&
paramList[0]["value"] &&
paramList[0]["value"].indexOf("stroke.js") !== -1;
let strokeUrl = "";
if (isStrokeUrl) {
strokeUrl = paramList[0]["value"] + "&token=" + this.token;
paramList[0]["value"] = strokeUrl;
}
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: paramList
});
this.appBuryingPointEntrust({
...activity_action,
labelId: itemData.id,
functionCode: this.id == 1 ? "c_project" : "f_activity",
actionCode: this.id == 1 ? "c_project_tab" : "c_activity_tab",
labelValue: itemData.title,
createdTime: new Date().getTime()
});
}, },
}
</script>
<style lang="scss" scoped> // 埋点
@import '../../style/mixin'; appBuryingPointEntrust(val) {
.activity-box{ rocNative.appBuryingPointEntrust(val);
padding: px2rem(15px); },
background: #fff; //查询tab
} getTabData() {
.no-show{ let _this = this,
font-size: px2rem(15px); parm = {
color: #999; id: _this.id || 1,
text-align: center; setEntry: "headers",
} token: _this.token
.activity-count{ };
color: #999; _this.GET("contents/contentList/tabById", parm).then(function(res) {
font-size: px2rem(15px); if (res.code === "000000") {
padding-bottom: px2rem(15px); _this.navTitle = res.data.name || "";
} _this.tabName = _this.tabList[0] || "";
.activity-item{ // if(_this.tabList.length>0){
// position: relative; // _this.tabName = _this.tabList[0] || '';
width: px2rem(345px); // }
max-height: px2rem(170px); _this.getData();
margin-bottom:px2rem(10px); } else {
// box-shadow: 0 px2rem(2px) px2rem(6px) RGBA(42, 94, 161, 0.15); //alert(res.message)
display: block;
overflow: hidden;
.img{
width: 100%;
max-height: 100%;
} }
.time{ });
position: absolute; },
color:#fff;
height: px2rem(25px); //查询内容
line-height: px2rem(25px); getData() {
background: RGBA(0, 0, 0, 0.1); let _this = this,
border-radius: 0 0 px2rem(5px) px2rem(5px); parm = {
width: 100%; id: _this.id,
bottom: 0; tabName: _this.tabName,
left: 0; setEntry: "headers",
z-index: 10; token: _this.token
font-size: px2rem(14px); };
padding-left: px2rem(5px); // if(_this.tabName != ''){
// parm.tabName = _this.tabName
// }
_this.GET("contents/contentList/contentById", parm).then(function(res) {
if (res.code === "000000") {
_this.list =
(res.data.contentList && res.data.contentList.contentList) || [];
} }
});
} }
}
};
</script>
<style lang="scss" scoped>
@import "../../style/mixin";
.activity-box {
padding: px2rem(15px);
background: #fff;
}
.no-show {
font-size: px2rem(15px);
color: #999;
text-align: center;
}
.activity-count {
color: #999;
font-size: px2rem(15px);
padding-bottom: px2rem(15px);
}
.activity-item {
// position: relative;
width: px2rem(345px);
max-height: px2rem(170px);
margin-bottom: px2rem(10px);
// box-shadow: 0 px2rem(2px) px2rem(6px) RGBA(42, 94, 161, 0.15);
display: block;
overflow: hidden;
.img {
width: 100%;
max-height: 100%;
}
.time {
position: absolute;
color: #fff;
height: px2rem(25px);
line-height: px2rem(25px);
background: RGBA(0, 0, 0, 0.1);
border-radius: 0 0 px2rem(5px) px2rem(5px);
width: 100%;
bottom: 0;
left: 0;
z-index: 10;
font-size: px2rem(14px);
padding-left: px2rem(5px);
}
}
</style> </style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册