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

format

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