提交 996f8eb7 编写于 作者: gjyang's avatar gjyang

1.整理项目

2.搜索页面
上级 b35e212e
<template> <template>
<div :class="searchFix?'header fixed' : 'header' " id="search-top" :style="{height:menuptop}"> <div :class="searchFix?'header fixed' : 'header' " id="search-top" :style="{height:menuptop}">
<div class="search-menu"> <div class="search-menu">
<!-- <div :class="isTransparent?'search-transparent':'bgWhite'" class="search"> <div :class="isTransparent?'search-transparent':'bgWhite'" class="search">
<input type="search" :class="isTransparent?'search-transparent':''" class="input" v-model="searchVal" :placeholder="placeholder" :disabled="disabled" /> <input type="search" :class="isTransparent?'search-transparent':''" class="input" v-model="searchVal" :placeholder="placeholder" :disabled="disabled" />
<img v-if="searchFix" class="search-img" src='../../images/search-grey.png'> <img v-if="searchFix" class="search-img" src='../../images/search-grey.png'>
<img v-else class="search-img" src='../../images/search-white.png'> <img v-else class="search-img" src='../../images/search-white.png'>
</div> --> </div>
<div class="bgFill" :style="{height:ptop}"></div> <div class="bgFill" :style="{height:ptop}"></div>
<div class="fixBox"> <!-- <div class="fixBox">
<div class="header-right" @click="goToPage"> <div class="header-right" @click="goToPage">
<img v-if="searchFix" class="info" src='../../images/msg1.png'> <img v-if="searchFix" class="info" src='../../images/msg1.png'>
<img v-else class="info" src='../../images/msg1.png'> <img v-else class="info" src='../../images/msg1.png'>
<div :class="isMax?'num-max':'num-min'" class="info-count fs10" v-show="msgCount>0">{{msgCount>99?'99+':msgCount}}</div> <div :class="isMax?'num-max':'num-min'" class="info-count fs10" v-show="msgCount>0">{{msgCount>99?'99+':msgCount}}</div>
</div> </div>
</div> </div> -->
</div> </div>
</div> </div>
</template> </template>
......
<template>
<article class="history-search">
<header class="history-search-title">
<span>历史搜索</span>
<img src="../../images/search-grey.png" alt="删除">
</header>
<section class="history-search-content">
<span v-for="(item, index) in sourceData" :key="index">{{item.name}}</span>
</section>
</article>
</template>
<script>
export default {
props: {
sourceData: {
type: Array,
default: () => [{name:'222'},{name:'222'},{name:'222'},{name:'222'},{name:'222'},{name:'222'},{name:'222'}]
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
@import '../../style/mixin.scss';
// @import '../../style/global.scss';
.history-search {
margin: px2rem(15px);
&-title {
width: 100%;
justify-content: space-between;
display: inline-flex;
span {
padding: px2rem(4px) px2rem(4px);
font-size: px2rem(12px);
color: 6;
}
}
&-content {
}
}
</style>
<template>
<div id="search-top" :style="{height:menuptop}">
<div class="search-menu">
<div class="search-transparent search">
<input type="search" :class="isTransparent?'search-transparent':''" class="input" v-model="searchVal" :placeholder="placeholder" :disabled="disabled" />
<img class="search-img" src='../../images/search-grey.png'>
</div>
<div class="bgFill" :style="{height:ptop}"></div>
<div class="fixBox">
<div class="header-right" @click="goToPage">
取消
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data(){
return {
placeholder: '即将上线,敬请期待',
disabled: 'disabled',
searchVal: '',
isTransparent: false, //更改颜色 背景
isMax: false,//消息数量是否大于99
count: '',
isShowMsg: true,
ptop: 0,
menuptop: 0,
popHeight: 0
}
},
props:{
msgCount:{
type:String,
default:''
},
statusBarHeight:{
type:Number,
default:0
},
searchFix:{
type: Boolean,
default: false,
}
},
watch:{
// searchFix:function(n){
// if(n){
// alert(this.searchFix)
// }
// }
},
created(){
let _this = this;
window.__getStatusBarHeight = function(parm){
//lert(parm.statusBarHeight)
if(window.__isAndroid){
_this.popHeight = parseInt(parm.statusBarHeight)/2.5
}else{
_this.popHeight = parm.statusBarHeight
}
_this.ptop = _this.popHeight+'px';
_this.menuptop = _this.popHeight+'px'
// alert(parm.statusBarHeight);
}
this.getStatusHight()
},
mounted(){
// this.getStatusHight();
// if(window.__isAndroid){
// this.popHeight = this.statusBarHeight/2
// }else{
// this.popHeight = this.statusBarHeight
// }
// this.count = this.msgCount;
// this.ptop = this.popHeight+7+'px';
// this.menuptop = this.popHeight+7+'px'
// console.log(this.statusBarHeight);
// if(this.msgCount == ''){
// this.isShowMsg = false
// }
// if(this.count>=99){
// this.count += '+';
// this.isMax = true
// }
},
methods: {
getStatusHight(){
rocNative.getStatusBarHeight({
__funcName: '__getStatusBarHeight'
})
},
goToPage(){
// alert("000");
this.$emit('setAppMsg',false)
this.pageBurialPoin({
menuLevel:1,
menuCode:'m_home',
functionCode:'f_notification',
actionCode:'c_notification',
})
rocNative.readMessage();
}
},
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
@import '../../style/mixin.scss';
@import '../../style/global.scss';
.search-transparent{
background: transparent;
border: 1px solid rgba(255, 255, 255, 0.5);
color: #fff;
}
.search-transparent::-webkit-input-placeholder{
color:#fff;
}
.white{
color: #fff;
}
.header-right{
width: px2rem(20px);
height: px2rem(20px);
// position: relative;
// margin-top: px2rem(5px);
float: right;
font-size: px2rem(5px);
// img {
// width: 100%;
// height: 100%;
// display: block;
// }
}
.bgFill{
background: inherit;
height: 20px;
}
.fs30{
font-size: px2rem(15px);
}
.gxy-study{
margin-right: px2rem(19px);
}
.gxy{
font-size: px2rem(25px);
margin: px2rem(25px) 0 px2rem(11px) 0;
}
.header{
width: 100%;
/*//height: px2rem(50px);*/
position: relative;
}
.fixed {
.search-menu{
position: fixed;
z-index: 110;
top:0;
left: 0;
}
.fixBox{
background: #44A99B;
height:px2rem(30px);
padding:0 px2rem(25px);
/* padding-top: px2rem(7px)*/
}
.bgFill{
background: #44A99B;
}
.search-transparent::-webkit-input-placeholder{
color:#666;
}
.search{
border-color:#ddd;
}
.info-count{
background: #FB5B52;
color: #fff
}
}
.fixBox{
padding:0 px2rem(25px);
height: px2rem(30px);
/* padding-top: px2rem(7px)*/
}
.search-menu{
width: 100%;
position: absolute;
}
.search{
width: px2rem(290px);
height: px2rem(30px);
border-radius: px2rem(19px);
float: left;
}
.input{
outline: none;
border: none;
float: left;
font-size: px2rem(13px);
margin: px2rem(6px) 0 px2rem(6px) px2rem(15px);
line-height: px2rem(18px);
width: 80%;
}
.search-img{
width: px2rem(16px);
height: px2rem(16px);
margin: px2rem(6px) px2rem(15px) px2rem(9px) 0;
float: right;
}
.info-count{
position:absolute;
top: -(px2rem(5px));
left: (px2rem(10px));
/*max-width: px2rem(25px);*/
padding:0 px2rem(3px);
height: px2rem(15px);
line-height: px2rem(15px);
border-radius: px2rem(15px);
text-align: center;
font-size:px2rem(12px);
font-weight: bold;
background-color: #fff;
color: RGBA(53, 134, 126, 1);
}
.num-min{
max-width: px2rem(25px);
min-width: px2rem(15px);
/*padding:0;*/
}
.num-max{
width: auto;
/* background-color: RGBA(251, 91, 82, 1);
color: #fff;*/
}
.hot-tag{
width: 100%;
height: px2rem(150px);
}
.hotTagTitle{
font-size: px2rem(18px);
padding: px2rem(73px) px2rem(15px);
float: left;
background-color: #fff;
}
.cource{
width: 100%;
height: px2rem(350px);
}
.font-title{
font-size: px2rem(18px);
padding: 0 0 px2rem(21px) px2rem(15px);
float: left;
width: 100%;
text-align: left;
}
.title{
font-size: px2rem(16px);
}
.cource-left{
float: left;
padding-left: px2rem(15px);
}
.need-left{
float: left;
padding: 0 0 px2rem(40px) px2rem(15px);
}
.cource-time{
float: left;
}
.cource-img{
width: px2rem(170px);
height: px2rem(96px);
margin-bottom: px2rem(10px);
}
.cource-more{
font-size: px2rem(15px);
color: #999999;
}
.need{
width: 100%;
height: px2rem(325px);
margin-top: px2rem(35px);
}
</style>
<template>
<article class="search-wrapper">
<section class="search-wrapper-input">
<img src='../../images/search-grey.png'>
<input value="搜索疾病、课程、讲师"/>
</section>
<section class="search-wrapper-cancle">
<span>取消</span>
</section>
</article>
</template>
<script>
export default {
methods: {
cancel() {
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
@import '../../style/mixin.scss';
// @import '../../style/global.scss';
.search-wrapper {
display: flex;
position: relative;
top: 0;
left: 0;
flex-direction: row;
padding: px2rem(20px) px2rem(10px) px2rem(10px) px2rem(15px);
text-align: center;
align-items: center;
&-input {
width: px2rem(290px);
height: px2rem(30px);
border: 1px solid #efefef;
border-radius: px2rem(18px);
background: rgba(245, 246, 246, 1);
img {
position: relative;
top: px2rem(-18px);
left: px2rem(0px);
width: px2rem(14px);
height: px2rem(14px);
}
input {
position: relative;
top: px2rem(-20px);
left: px2rem(-8px);
width: px2rem(240px);
text-decoration-color: #bbb;
color: #bbb;
font-size: px2rem(13px);
font-weight: 400;
background: rgba(245, 246, 246, 1);
}
}
&-cancle {
position: relative;
top: 0;
left: px2rem(15px);
// width: px2rem(60px);
font-size: px2rem(14px);
color: #999;
span {
padding: px2rem(4px);
}
}
}
</style>
<template>
<article v-if="allTags&&allTags.length>0" class="search-tag search-label">
<!-- <section :style="{'text-align': direction}" class="search-tag-title">
{{title}}
</section> -->
<header class="history-search-title">
<span>{{title}}</span>
<img v-show="showDelete" src="../../images/sousuo/recicle.png" alt="删除">
</header>
<div class="search-tag-item"
@click="hotLabel(item.resourceType, item.structureId, item.resourceUrl, item.labelName, item)"
v-for="(item, index) in allTags" :key="index" >
<span class="item-name">{{item.doctorName}}</span>
</div>
</article>
</template>
<script>
import {mapMutations} from 'vuex'
export default {
name: 'YqyHotLabel',
props: {
allTags: {
type: Array
},
direction: {
type: String,
default: 'left'
},
title: {
type: String,
default: '历史搜索'
},
hasBanner: {
type: Boolean,
default: false
},
hasInfo: {
type: Boolean,
default: false
},
showDelete: {
type: Boolean,
default: true
}
},
data () {
return {
}
},
mounted(){
},
methods: {
...mapMutations([
'SET_CLEAR_VUEX'
]),
hotLabel(val,id,url,name,item){
this.$emit('hotLabel',id,name)
//讲师集
switch (val) {
case 1:
this.SET_CLEAR_VUEX()
this.jumpToCourse(item.resourceId);
break;
case 2:
this.SET_CLEAR_VUEX()
//window.location.href=url;
this.jumpToCartoon(url,name)
break;
case 3:
this.SET_CLEAR_VUEX()
this.$router.push({path:'/lecturer',query:{id:id}})
break;
default:
break;
}
},
dispatchEventByModuleCode(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.getUrlPara(paramList)
paramList[0].value += urlPara
}
if(typeof paramList === 'string' && !paramList){
paramList = []
}
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: paramList
})
},
//跳到相应的课程
jumpToCourse(id){
let itemData={
"title":"测试课介绍页",
"imageUrl":"https://test-file.yunqueyi.com/image/jpeg/2018/09/18/20180918103322254-f8bba621.jpg",
"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":`${id}`,
"type":1,
"seqNo":2
}
]
}
};
this.dispatchEventByModuleCode(itemData);
},
// 跳到漫画详情页
jumpToCartoon(url,name) {
let itemData={
"title":"测试课介绍页",
"imageUrl":"https://test-file.yunqueyi.com/image/jpeg/2018/09/18/20180918103322254-f8bba621.jpg",
"appModuleInfo":{
"code":"M300",
"type":4,
"name":"课程介绍页",
"paramFlag":1,
"paramList":[
{
"key":"pageUrl",
"value": url,
"type":4,
"seqNo":1
},{
"key":"showTitle",
"value": true,
"type":1,
"seqNo":2
},{
"key":"title",
"value": name,
"type":1,
"seqNo":2
}
]
}
};
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: itemData.appModuleInfo.paramList
})
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
@import '../../style/mixin.scss';
.search-tag {
padding: 0 px2rem(15px) 0;
}
.search-label {
width: 100%;
background-color: #fff;
margin-bottom: px2rem(6px);
}
.search-tag-title {
font-size: px2rem(12px);
font-weight: bold;
}
.search-tag-item {
display: inline-flex;
height: px2rem(30px);
margin: px2rem(0px) px2rem(15px) 0 0;
text-align: center;
align-items: center;
.item-name {
padding: px2rem(6px) px2rem(15px) px2rem(8px);
border-radius: px2rem(15px);
background-color: #F8F8F8;
color: #999;
font-size: px2rem(13px);
}
}
.history-search-title {
display: inline-flex;
width: 100%;
align-items: center;
justify-content: space-between;
span {
// padding: px2rem(4px) px2rem(4px);
font-size: px2rem(12px);
color: 6;
}
img {
width: px2rem(20px);
height: px2rem(20px);
padding: px2rem(4px);
}
}
</style>
<template>
<section :style="{'line-width':lineWidth, 'border-color': borderColor, 'border-style': borderStyle, 'border-width': borderWidth}">
</section>
</template>
<script>
export default {
props: {
lineWidth: {
type: String,
default: 'px2rem(375px)'
},
borderWidth: {
type: String,
default: '1px'
},
borderStyle: {
type: String,
default: 'solid'
},
borderColor: {
type: String,
default: '#e7e7e7'
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
@import '../../style/mixin.scss';
// @import '../../style/global.scss';
</style>
<template>
<section :style="{'line-width':lineWidth, 'border-color': borderColor, 'border-style': borderStyle, 'border-width': borderWidth}">
</section>
</template>
<script>
export default {
props: {
lineWidth: {
type: String,
default: 'px2rem(375px)'
},
borderWidth: {
type: String,
default: '1px'
},
borderStyle: {
type: String,
default: 'solid'
},
borderColor: {
type: String,
default: '#e7e7e7'
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
@import '../../style/mixin.scss';
// @import '../../style/global.scss';
</style>
<template>
<div class="teach-top">
<span class="back" @click="backPre">
<img src="../../images/left-icon.png">
</span>
<div class="tc title">{{parmObj}}</div>
<div class="tc count" v-if="isShowCount">{{studyCount.toLocaleString()}}人学习&nbsp;&nbsp;&nbsp;&nbsp;{{followCount.toLocaleString()}}人关注</div>
</div>
</template>
<script>
export default {
data () {
return {
parmObj:''
}
},
props:{
isShowCount:{
default:false,
type:Boolean
},
followCount:{
type:Number,
default:0
},
studyCount:{
type:Number,
default:0
},
statusBarHeight:{
type:Number,
default:0
},
},
mounted(){
this.parmObj = this.isShowCount ? '讲师集' : '讲师之'
///console.log(this.followCount);
},
methods: {
backPre(){
///alert("999");
rocNative.goBack()
// this.$router.back(-1);
},
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
@import '../../style/mixin.scss';
@import '../../style/global.scss';
.teach-top{
width: 100%;
height: px2rem(185px);
position: relative;
@include bis('../../images/headerTop.png');
.tc{
text-align: center;
}
.back{
position: absolute;
left:px2rem(18px);
top: px2rem(25px);
display: inline-block;
width: px2rem(50px);
height: px2rem(50px);
img{
width: px2rem(25px);
height: px2rem(25px);
}
}
.title{
font-size: px2rem(25px);
color: #fff;
padding: px2rem(55px) 0 px2rem(8px) 0;
font-weight: 500
}
.count{
font-size: px2rem(15px);
line-height: px2rem(21px);
color: #fff;
}
}
</style>
...@@ -16,7 +16,6 @@ import 'mint-ui/lib/style.css' ...@@ -16,7 +16,6 @@ import 'mint-ui/lib/style.css'
import VueLazyload from 'vue-lazyload' import VueLazyload from 'vue-lazyload'
Vue.use(VueLazyload, { Vue.use(VueLazyload, {
preLoad: 3, preLoad: 3,
// loading: 'http://pica-pro.oss-cn-shanghai.aliyuncs.com/h5/app_home/2018/12/5-121204193935-51.gif',
// loading: 'images/change.png', // loading: 'images/change.png',
// error: 'https://file.yunqueyi.com/File/course_doctor/2018-11/20/web_454.png', // error: 'https://file.yunqueyi.com/File/course_doctor/2018-11/20/web_454.png',
error: require('./images/evaluatBg.png'), error: require('./images/evaluatBg.png'),
......
import App from '../App' import App from '../App'
const home = r => require.ensure([], () => r(require('../views/home/home-new')), 'home') const index = r => require.ensure([], () => r(require('../views/index')), 'index')
const activity = r => require.ensure([], () => r(require('../views/activity/activity')), 'activity') const search = r => require.ensure([], () => r(require('../views/search-index')), 'search')
const teachers = r => require.ensure([], () => r(require('../views/teachers/index')), 'teachers')
const teachersDetail = r => require.ensure([], () => r(require('../views/teachers/detail')), 'teachersDetail')
const spCooperation = r => require.ensure([], () => r(require('../views/spCooperation/spCooperation')), 'spCooperation')
//const gpranking = r => require.ensure([], () => r(require('../views/gpranking/gpranking.vue')), 'gpranking')
export default [{ export default [{
path: '/', path: '/',
...@@ -16,34 +10,17 @@ export default [{ ...@@ -16,34 +10,17 @@ export default [{
//地址为空时跳转home页面 //地址为空时跳转home页面
{ {
path: '', path: '',
redirect: '/home' redirect: '/index'
}, },
//首页城市列表页 //首页城市列表页
{ {
path: '/home', path: '/index',
component: home component: index
}, },
//首页城市列表页
{ {
path: '/activity', path: '/search',
component: activity component: search
},
{
path: '/teachers',
component: teachers
},
{
path: '/teachersDetail',
component: teachersDetail
},
{
path: '/spCooperation',
component: spCooperation
}, },
//学习评价gpranking页面
// {
// path: '/gpranking',
// component: gpranking
// }
] ]
}] }]
...@@ -28,7 +28,7 @@ body, div, span, header, footer, nav, section, aside, article, ul, dl, dt, dd, l ...@@ -28,7 +28,7 @@ body, div, span, header, footer, nav, section, aside, article, ul, dl, dt, dd, l
{ {
width: 0px; width: 0px;
height: 0px; height: 0px;
background-color: #F5F5F5; background-color: #fff;
} }
/*定义滚动条轨道 内阴影+圆角*/ /*定义滚动条轨道 内阴影+圆角*/
...@@ -36,7 +36,7 @@ body, div, span, header, footer, nav, section, aside, article, ul, dl, dt, dd, l ...@@ -36,7 +36,7 @@ body, div, span, header, footer, nav, section, aside, article, ul, dl, dt, dd, l
{ {
-webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0); -webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0);
border-radius: 10px; border-radius: 10px;
background-color: #F5F5F5; background-color: #fff;
} }
/*定义滑块 内阴影+圆角*/ /*定义滑块 内阴影+圆角*/
...@@ -56,10 +56,9 @@ textarea { -webkit-appearance: none;} ...@@ -56,10 +56,9 @@ textarea { -webkit-appearance: none;}
html,body{ html,body{
height: 100%; height: 100%;
width: 100%; width: 100%;
background-color: #F5F5F5; background-color: #fff;
} }
.clear:after{ .clear:after{
content: ''; content: '';
display: block; display: block;
......
/**
* Created by Anndy Yang on 18/03/18.
*/
Date.prototype.format = function (fmt) {
var o = {
'M+': this.getMonth() + 1, // 月份
'd+': this.getDate(), // 日
'h+': this.getHours(), // 小时
'm+': this.getMinutes(), // 分
's+': this.getSeconds(), // 秒
'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
'S': this.getMilliseconds() // 毫秒
}
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
}
for (var k in o) {
if (new RegExp('(' + k + ')').test(fmt)) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
}
}
return fmt
}
export function parseTime(time, cFormat) {
if (arguments.length === 0) {
return null
}
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if (('' + time).length === 10) time = parseInt(time) * 1000
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key]
if (key === 'a') return ['一', '二', '三', '四', '五', '六', '日'][value - 1]
if (result.length > 0 && value < 10) {
value = '0' + value
}
return value || 0
})
return time_str
}
export function formatTime(time, option) {
time = +time * 1000
const d = new Date(time)
const now = Date.now()
const diff = (now - d) / 1000
let des = ''
if (diff < 30) {
des = '刚刚'
} else if (diff < 3600) { // less 1 hour
des = Math.ceil(diff / 60) + '分钟前'
} else if (diff < 3600 * 24) {
des = Math.ceil(diff / 3600) + '小时前'
} else if (diff < 3600 * 24 * 2) {
des = '1天前'
}
if (option) {
return parseTime(time, option)
} else {
if (des) {
return des + ' (' + (d.getMonth() + 1) + '/' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds() + ')'
} else {
return d.getMonth() + 1 + '/' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds()
}
}
}
// 将树形结构任意两个key修改成对应的特定key
// {id: '', name: ''} => {id: '', label: ''}
export function convertTreeData(originData, orgId = 'id', orgLabel = 'name', targetId = 'id', targetLabel = 'label') {
const targetData = []
let targetObj = {}
for (let i = 0; i < originData.length; i++) {
targetObj = {}
targetObj[targetId] = originData[i][orgId]
targetObj[targetLabel] = originData[i][orgLabel]
targetData.push(targetObj)
if (originData[i].children && originData[i].children.length > 0) {
targetObj.children = convertTreeData(originData[i].children, orgId, orgLabel, targetId, targetLabel)
}
}
return targetData
}
/**
* JSON数组去重
* @param: [array] json Array
* @param: [string] 唯一的key名,根据此键名进行去重
*/
export function uniqueArray(array, key) {
const result = [array[0]]
for (let i = 1; i < array.length; i++) {
const item = array[i]
let repeat = false
for (let j = 0; j < result.length; j++) {
if (item[key] === result[j][key]) {
repeat = true
break
}
}
if (!repeat) {
result.push(item)
}
}
return result
}
export function resizeHeight(cMinusHeight = 152, iMinuxHeight = 210, refHeightId = 'sidebarWrapperId',
containerHeightId = 'appContainerId', innerHeightId = 'elTableId') {
if (!p_getElm(refHeightId) || !p_getElm(containerHeightId) || !p_getElm(innerHeightId)) {
// window.onresize = null
logger.warn('No certain dom id!!!');
}
let containerHeight = p_getElm(refHeightId).getBoundingClientRect().height - 50
p_getElm(containerHeightId).style.height = containerHeight - cMinusHeight + 'px'
p_getElm(innerHeightId).style.height = containerHeight - iMinuxHeight + 'px'
if (p_getElm('elTableIdInner')) {
p_getElm('elTableIdInner').style.height = containerHeight - iMinuxHeight + 'px'
}
window.onresize = function () {
containerHeight = p_getElm(refHeightId).getBoundingClientRect().height - 50
p_getElm(containerHeightId).style.height = containerHeight - cMinusHeight + 'px'
p_getElm(innerHeightId).style.height = containerHeight - iMinuxHeight + 'px'
if (p_getElm('elTableIdInner')) {
p_getElm('elTableIdInner').style.height = containerHeight - iMinuxHeight + 'px'
}
}
}
function p_getElm(elmId) {
return document.getElementById(elmId)
}
export function getHostnameAndPort() {
const NODE_ENV = process.env.NODE_ENV
if (NODE_ENV === 'production') {
return location.hostname + ':' + location.port
} else {
return '192.168.80.191:8080'
}
}
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) {
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 = getUrlParmByCode(paramList);
paramList[0] && (paramList[0].value += urlPara);
} else if (modeCode === 'M400') {
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 = []
}
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() {
let url = {
pageListUrl: 'https://test1-contents.yunqueyi.com/content_list',
detailUrl: 'https://test1-contents.yunqueyi.com/content_detail'
};
return url;
}
// test1地址
const baseUrl = 'http://dev-sc.yunqueyi.com/' || 'http://10.177.10.238:10201/' || 'http://test1-sc.yunqueyi.com/'
const apiUrl = 'http://dev-api.yunqueyi.com/' || 'http://10.177.10.238:10201' || 'http://test1-api.yunqueyi.com/'
const devApiUri = 'http://dev-api.yunqueyi.com/'
// // uat地址
// const baseUrl = 'http://uat-sc.yunqueyi.com/'
// const apiUrl = 'http://uat-api.yunqueyi.com/'
// // pro地址
// const baseUrl = 'http://sc.yunqueyi.com/'
// const apiUrl = 'http://api.yunqueyi.com/'
// 为每个URL添加应用校验密钥
export function getBaseUrl(url, str) {
if (str == 'dev-api') {
return devApiUri + url
}
return baseUrl + url
}
export function getApiUrl(url) {
return apiUrl + url
}
/**
* Created by Anndy Yang on 18/03/18.
*/
Date.prototype.format = function(fmt) {
var o = {
'M+': this.getMonth() + 1, // 月份
'd+': this.getDate(), // 日
'h+': this.getHours(), // 小时
'm+': this.getMinutes(), // 分
's+': this.getSeconds(), // 秒
'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
'S': this.getMilliseconds() // 毫秒
}
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
}
for (var k in o) {
if (new RegExp('(' + k + ')').test(fmt)) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
}
}
return fmt
}
export function parseTime(time, cFormat) {
if (arguments.length === 0) {
return null
}
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if (('' + time).length === 10) time = parseInt(time) * 1000
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key]
if (key === 'a') return ['一', '二', '三', '四', '五', '六', '日'][value - 1]
if (result.length > 0 && value < 10) {
value = '0' + value
}
return value || 0
})
return time_str
}
export function formatTime(time, option) {
time = +time * 1000
const d = new Date(time)
const now = Date.now()
const diff = (now - d) / 1000
let des = ''
if (diff < 30) {
des = '刚刚'
} else if (diff < 3600) { // less 1 hour
des = Math.ceil(diff / 60) + '分钟前'
} else if (diff < 3600 * 24) {
des = Math.ceil(diff / 3600) + '小时前'
} else if (diff < 3600 * 24 * 2) {
des = '1天前'
}
if (option) {
return parseTime(time, option)
} else {
if (des) {
return des + ' (' + (d.getMonth() + 1) + '/' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds() + ')'
} else {
return d.getMonth() + 1 + '/' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds()
}
}
}
// 将树形结构任意两个key修改成对应的特定key
// {id: '', name: ''} => {id: '', label: ''}
export function convertTreeData(originData, orgId = 'id', orgLabel = 'name', targetId = 'id', targetLabel = 'label') {
const targetData = []
let targetObj = {}
for (let i = 0; i < originData.length; i++) {
targetObj = {}
targetObj[targetId] = originData[i][orgId]
targetObj[targetLabel] = originData[i][orgLabel]
targetData.push(targetObj)
if (originData[i].children && originData[i].children.length > 0) {
targetObj.children = convertTreeData(originData[i].children, orgId, orgLabel, targetId, targetLabel)
}
}
return targetData
}
/**
* JSON数组去重
* @param: [array] json Array
* @param: [string] 唯一的key名,根据此键名进行去重
*/
export function uniqueArray(array, key) {
const result = [array[0]]
for (let i = 1; i < array.length; i++) {
const item = array[i]
let repeat = false
for (let j = 0; j < result.length; j++) {
if (item[key] === result[j][key]) {
repeat = true
break
}
}
if (!repeat) {
result.push(item)
}
}
return result
}
export function resizeHeight(cMinusHeight = 152, iMinuxHeight = 210, refHeightId = 'sidebarWrapperId',
containerHeightId = 'appContainerId', innerHeightId = 'elTableId'){
if (!p_getElm(refHeightId) || !p_getElm(containerHeightId) || !p_getElm(innerHeightId)) {
// window.onresize = null
logger.warn('No certain dom id!!!');
}
let containerHeight = p_getElm(refHeightId).getBoundingClientRect().height - 50
p_getElm(containerHeightId).style.height = containerHeight - cMinusHeight + 'px'
p_getElm(innerHeightId).style.height = containerHeight - iMinuxHeight + 'px'
if(p_getElm('elTableIdInner')){
p_getElm('elTableIdInner').style.height = containerHeight - iMinuxHeight + 'px'
}
window.onresize = function() {
containerHeight = p_getElm(refHeightId).getBoundingClientRect().height - 50
p_getElm(containerHeightId).style.height = containerHeight - cMinusHeight + 'px'
p_getElm(innerHeightId).style.height = containerHeight - iMinuxHeight + 'px'
if (p_getElm('elTableIdInner')) {
p_getElm('elTableIdInner').style.height = containerHeight - iMinuxHeight + 'px'
}
}
}
function p_getElm(elmId) {
return document.getElementById(elmId)
}
export function getHostnameAndPort() {
const NODE_ENV = process.env.NODE_ENV
if (NODE_ENV === 'production') {
return location.hostname + ':' + location.port
} else {
return '192.168.80.191:8080'
}
}
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){
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 = getUrlParmByCode(paramList);
paramList[0] && (paramList[0].value += urlPara);
}else if( modeCode === 'M400') {
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 = []
}
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(){
let url = {
pageListUrl : 'https://test1-contents.yunqueyi.com/content_list',
detailUrl : 'https://test1-contents.yunqueyi.com/content_detail'
};
return url;
}
// test1地址
// const baseUrl = 'http://dev-sc.yunqueyi.com/' || 'http://10.177.10.238:10201/' || 'http://test1-sc.yunqueyi.com/'
// const apiUrl = 'http://dev-api.yunqueyi.com'http://dev-sc.yunqueyi.com/'/'||'http://10.177.10.238:10201' || 'http://test1-api.yunqueyi.com/'
// const devApiUri = 'http://dev-api.yunqueyi.com/'
// // uat地址
const baseUrl = 'http://test1-sc.yunqueyi.com/'
const apiUrl = 'http://test1-api.yunqueyi.com/'
// // pro地址
// const baseUrl = 'http://sc.yunqueyi.com/'
// const apiUrl = 'http://api.yunqueyi.com/'
// 为每个URL添加应用校验密钥
export function getBaseUrl(url,str) {
return baseUrl + url
}
export function getApiUrl(url) {
return apiUrl + url
}
/** /**
* Created by Anndy Yang on 18/03/18. * Created by Anndy Yang on 18/03/18.
*/ */
Date.prototype.format = function(fmt) { Date.prototype.format = function(fmt) {
var o = { var o = {
'M+': this.getMonth() + 1, // 月份 'M+': this.getMonth() + 1, // 月份
...@@ -55,8 +54,6 @@ export function parseTime(time, cFormat) { ...@@ -55,8 +54,6 @@ export function parseTime(time, cFormat) {
return time_str return time_str
} }
export function formatTime(time, option) { export function formatTime(time, option) {
time = +time * 1000 time = +time * 1000
const d = new Date(time) const d = new Date(time)
...@@ -241,8 +238,6 @@ export const jumpWebPageUrl = 'https://dev-phome.yunqueyi.com/appl/#/' ...@@ -241,8 +238,6 @@ export const jumpWebPageUrl = 'https://dev-phome.yunqueyi.com/appl/#/'
// const evaluatPageUrl = 'http://10.177.10.225:9001/#/home' || 'https://test1-phome.yunqueyi.com/gpr/#/home' // const evaluatPageUrl = 'http://10.177.10.225:9001/#/home' || 'https://test1-phome.yunqueyi.com/gpr/#/home'
// export const jumpWebPageUrl = 'https://test1-phome.yunqueyi.com/appl/#/' // export const jumpWebPageUrl = 'https://test1-phome.yunqueyi.com/appl/#/'
// const baseUrl = 'https://uat-sc.yunqueyi.com/' // const baseUrl = 'https://uat-sc.yunqueyi.com/'
// const apiUrl = 'https://uat-api.yunqueyi.com/' // const apiUrl = 'https://uat-api.yunqueyi.com/'
// const evaluatPageUrl = 'https://uat-phome.yunqueyi.com/gpr/#/home' // const evaluatPageUrl = 'https://uat-phome.yunqueyi.com/gpr/#/home'
...@@ -255,15 +250,11 @@ export const jumpWebPageUrl = 'https://dev-phome.yunqueyi.com/appl/#/' ...@@ -255,15 +250,11 @@ export const jumpWebPageUrl = 'https://dev-phome.yunqueyi.com/appl/#/'
// export const jumpWebPageUrl = 'https://phome.yunqueyi.com/appl/#/' // export const jumpWebPageUrl = 'https://phome.yunqueyi.com/appl/#/'
// 为每个URL添加应用校验密钥 // 获取BaseUrl
export function getBaseUrl(url,str) { export function getBaseUrl(url,str) {
return baseUrl + url return baseUrl + url
} }
export function getApiUrl(url) { export function getApiUrl(url) {
return apiUrl + url return apiUrl + url
} }
...@@ -4,12 +4,6 @@ ...@@ -4,12 +4,6 @@
e.rocNative = { e.rocNative = {
// 参数说明 e:回传回来的移动端服务名称; t:前端自己传递的回调JS方法 // 参数说明 e:回传回来的移动端服务名称; t:前端自己传递的回调JS方法
__nativeCall: function (e, t, n) { __nativeCall: function (e, t, n) {
///alert(t);
// if (t === '__gotoAuthentication') {
// __gotoAuthentication()
// }
// var a = i[e];
// delete i[e], "function" == typeof a && a(t, n)
if(t == '__nativeCallMsg'){ if(t == '__nativeCallMsg'){
__nativeCallMsg(n) __nativeCallMsg(n)
} }
...@@ -35,9 +29,6 @@ ...@@ -35,9 +29,6 @@
if(t == 'getToken'){ if(t == 'getToken'){
__getToken(n); __getToken(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);
...@@ -46,21 +37,15 @@ ...@@ -46,21 +37,15 @@
var param = a === undefined ? {} : a; var param = a === undefined ? {} : a;
var r = JSON.stringify({ var r = JSON.stringify({
name: t, name: t,
// callbackId: "function" == typeof o ? n : -1,
callbackId: __funcName, callbackId: __funcName,
param: param param: param
}); });
//alert(r);
if (e.__rocAndroid) { if (e.__rocAndroid) {
// alert(r);
e.__rocAndroid.postMessage(r); e.__rocAndroid.postMessage(r);
// e.__isAndroid = true;
return true; return true;
} }
if (e.webkit && window.webkit.messageHandlers.rociOS) { if (e.webkit && window.webkit.messageHandlers.rociOS) {
//alert(r)
window.webkit.messageHandlers.rociOS.postMessage(r) window.webkit.messageHandlers.rociOS.postMessage(r)
// e.__isIOS = true;
return true; return true;
} }
return false; return false;
...@@ -90,7 +75,7 @@ ...@@ -90,7 +75,7 @@
}) })
} }
}) })
}("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","pauseAudioView") }("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","pauseAudioView");
if (e.__rocAndroid) { if (e.__rocAndroid) {
e.__isAndroid = true e.__isAndroid = true
e.__isIOS = false e.__isIOS = false
...@@ -107,13 +92,4 @@ ...@@ -107,13 +92,4 @@
if(window.__isIOS){ if(window.__isIOS){
rocNative.appInit() rocNative.appInit()
} }
}(window); }(window);
window.__gotoAuthentication = function (params) {
alert('I am in __gotoAuthentication')
}
// console.log(33344)
// if (__isIOS){
// // rocNative.appInit()
// }
<template>
<section>
<TopNav :bgColor="bgColor" :title="navTitle" :isNavFix="isNavFix" :burialPoint="pointStyle"></TopNav>
<section class="activity-box">
<div class="activity-count">{{list.length}}个活动</div>
<div class="activity-list">
<div class="activity-item" v-for="(item,index) in list" :key="index" @click="goToPage(item)">
<img v-lazy="item.imageUrl" class="img"/>
<!-- <div class="time">活动时间:9月3日-9月9日</div> -->
</div>
<div class="no-show" v-if="list.length.length == 0">
暂无数据
</div>
</div>
<BackTop v-if="isShowBackTop" :burialPoint="pointStyle"></BackTop>
</section>
</section>
</template>
<script>
// import { setEventByModuleCode } from '@/utils/index'
import TopNav from '../../components/common/topNav';
import BackTop from '../../components/common/backTop';
export default {
data(){
return {
tittle:'',
list:[],
bgColor:'#fff',
navTitle:'活动',
isBorder:true,
isNavFix:true,
id:'1',
tabName:'测试',
tabList:[],
isShowBackTop:false,
pointStyle:'activity',
userToken:null
}
},
components:{
TopNav,
BackTop
},
created(){
let _this = this;
window.__getUserInfo = function(parm){
let jh = JSON.stringify(parm)
_this.token = parm.userToken;
}
//_this.token = 'AF22B142535B440883135309BBF3F3B0'
this.getBaseInfo();
},
mounted(){
this.getTabData();
window.addEventListener('scroll', this.scrollFun);
},
beforeDestroyed(){
window.removeEventListener('scroll', this.scrollFun)
},
methods:{
//获取版本号
getBaseInfo(){
rocNative.getUserInfo({
__funcName: '__getUserInfo'
})
},
scrollFun(){
let scrollTop = document.documentElement.scrollTop;
this.isShowBackTop = scrollTop > 0 ? true : false;
// if(scrollTop > 0){
// this.isShowBackTop = true;
// }
},
goToPage(itemData){
this.pageBurialPoin({
menuLevel:2,
menuFromCode:'m_home',
menuCode:'m_content_list',
functionCode:'f_activity',
actionCode:'c_title',
labelId:itemData.id,
labelValue :itemData.title,
})
let paramList = this.setEventByModuleCode(itemData);
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: paramList
})
},
//查询tab
getTabData(){
let _this = this,
parm = {
id:_this.id,
setEntry: 'headers',
}
_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)
}
})
},
//查询内容
getData(){
let _this = this,
parm = {
id:_this.id,
tabName : _this.tabName,
setEntry: 'headers',
token:_this.userToken
}
// 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);
}
.activity-item{
position: relative;
width: px2rem(345px);
max-height: px2rem(170px);
margin-top:px2rem(15px);
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>
<template>
<div>
<!-- 类型4:常规样式:左三右三 -->
<div v-if="type==4" class="rank-table-content">
<!-- 我的 -->
<div class="my-rank-content content">
<div class="item" v-for="(value,index) in cmpTableData.self" :key="index">
<div class="normal" v-if="!value.isMessage">
<span class="num">{{index+1}}</span>
<span class="text">{{value.name}}</span>
</div>
<div class="special" v-if="value.isMessage">
{{value.name}}
</div>
</div>
</div>
<!-- 学院/省内/国内 -->
<div class="other-rank-content content">
<div class="item" v-for="(value,index) in cmpTableData.other" :key="index">
<div class="normal">
<span class="num">{{index+1}}</span>
<span class="text">{{value.name}}</span>
</div>
</div>
</div>
</div>
<!-- 类型5:左二右三,类型6:左一右三 -->
<div v-if="type==5||type==6" class="rank-table-content">
<!-- 我的 -->
<div class="my-rank-content content">
<!-- 左侧为两个:一小一大 -->
<div v-if="type==5" class="item">
<div class="normal">
<span class="num">1</span>
<span class="text">{{cmpTableData.self[0].name}}</span>
</div>
</div>
<div v-if="type==5" class="multi-row double-row">{{cmpTableData.self[1].name}}</div>
<!-- 左侧只有一个框 -->
<div v-if="type==6" class="multi-row triple-row">{{cmpTableData.self[0].name}}</div>
</div>
<!-- 学院/省内/国内 -->
<div class="other-rank-content content">
<div class="item" v-for="(value,index) in cmpTableData.other" :key="index">
<div class="normal">
<span class="num">{{index+1}}</span>
<span class="text">{{value.name}}</span>
</div>
</div>
</div>
</div>
<!-- 类型1:左二右二下一,类型2:左一右一下一 -->
<div v-if="type==1||type==2||type==3">
<!-- 上 -->
<div class="rank-table-content" v-if="type==1||type==2">
<!-- 我的 -->
<div class="my-rank-content content">
<div class="item" v-for="(value,index) in cmpTableData.self" :key="index">
<div class="normal" v-if="!value.isMessage">
<span class="num">{{index+1}}</span>
<span class="text">{{value.name}}</span>
</div>
<div class="special" v-if="value.isMessage">
{{value.name}}
</div>
</div>
</div>
<!-- 学院/省内/国内 -->
<div class="other-rank-content content">
<div class="item" v-for="(value,index) in cmpTableData.other" :key="index">
<div class="normal">
<span class="num">{{index+1}}</span>
<span class="text">{{value.name}}</span>
</div>
</div>
</div>
</div>
<!-- 下 -->
<div v-if="type==1" class="multi-col single-row special-message">
{{cmpTableData.commonMessage}}
</div>
<div v-if="type==2" class="multi-col double-row special-message">
{{cmpTableData.commonMessage}}
</div>
<div v-if="type==3" class="multi-col triple-row special-message">
{{cmpTableData.commonMessage}}
</div>
</div>
</div>
</template>
<script>
export default {
name:'CompareTable',
created(){
console.log(this.cmpTableData);
},
props:{
cmpTableData:{
type:Object,
default:{
self:[
{isMessage:false,name:'治疗药物检测的临床意义'},
{isMessage:false,name:'遗传性耳聋诊断与咨询遗传性耳聋诊断与咨询'},
{isMessage:true,name:'您获得的证书太少了,赶紧去考证吧!'}
],
other:[
{name:'聚集糖尿病治疗与管理'},
{name:'治疗药物检测的临床意义是什么'},
{name:'治疗药物检测的临床意义'}
]
}
},
type:{
type:Number,
default:4//type===4时为正常的样式
}
},
}
</script>
<style lang="scss" scoped>
@import 'src/style/mixin';
/*公用的样式*/
.rank-table-content{
display:flex;
display:-webkit-flex;
flex-direction:row;
}
.rank-table-content .content.my-rank-content{
width:px2rem(157.5px);//包含右边的border
}
.rank-table-content .content.other-rank-content{
width:px2rem(157px);
}
.content.my-rank-content .item{
border-top:px2rem(0.5px) solid rgb(236,238,241);
border-right:px2rem(0.5px) solid rgb(236,238,241);
}
.content.other-rank-content .item{
border-top:px2rem(0.5px) solid rgb(236,238,241);
}
.rank-table-content .content .item{
height:px2rem(58px);
display:flex;display:-webkit-flex;justify-content:center;align-items:center;
.normal span{
font-size:px2rem(12px);
display:inline-block;
vertical-align:middle;//行内块垂直居中
}
.normal span.num{
width:px2rem(13px);
height:px2rem(13px);
line-height:px2rem(13px);
text-align:center;
background-color: rgb(202,168,97);
border-radius: px2rem(6.5px);
color:#fff;
font-weight:400;
}
.normal span.text{
width:px2rem(114px);
line-height:px2rem(16px);
text-align:center;
// padding-left:px2rem(10px);
font-weight:400;
}
.special{
font-size:px2rem(12px);
text-align:center;
padding:px2rem(20px);
color:#999;
}
}
//多行公共代码:type5/type6/
.rank-table-content .content .multi-row{
display:table-cell;
vertical-align: middle;
font-size:px2rem(12px);
text-align:center;
padding:0 px2rem(20px);
color:#999;
}
//type5
.rank-table-content .my-rank-content.content .multi-row.double-row{
height:px2rem(116.5px);//58*2+0.5
border-top:px2rem(0.5px) solid rgb(236,238,241);
border-right:px2rem(0.5px) solid rgb(236,238,241);
}
//type6
.rank-table-content .my-rank-content.content .multi-row.triple-row{
height:px2rem(175px);//58*2+0.5
border-top:px2rem(0.5px) solid rgb(236,238,241);
border-right:px2rem(0.5px) solid rgb(236,238,241);
}
//多行公共代码:type1/type2/type3
.special-message{
display:table-cell;
vertical-align: middle;
font-size:px2rem(12px);
text-align:center;
padding:0 px2rem(20px);
color:#999;
}
.multi-col{
border-top:px2rem(0.5px) solid rgb(236,238,241);
width:px2rem(315px);
}
.multi-col.single-row{
height:px2rem(58px);
}
.multi-col.double-row{
height:px2rem(116.5px);
}
.multi-col.triple-row{
height:px2rem(175px);
}
</style>
此差异已折叠。
此差异已折叠。
<template>
<section class="font-style">
<section class="home-header">
<mt-header>
<router-link to="/" slot="left">
<mt-button icon="back"></mt-button>
</router-link>
<mt-button icon="more" slot="right"></mt-button>
</mt-header>
<article style="width: 100%;text-align:center;">
<YqyHomeHeader/>
<img class="logo_img" src='../../images/header-bg-2.png' />
</article>
</section>
<section class="home-body">
<span @click="pushView('http://10.177.10.121:8080/yqy/index.html?1')"> pushView 1</span>
<span @click="goBack"> goBack 2</span>
<span @click="toast('Hi, 你好,宾宾!')"> toast 3</span>
<YqyHotLabel/>
<YqyHomePorter/>
<YqyHomeBanner/>
<YqyHomeKeepon/>
<YqyHomeAdv/>
<YqyCategoryThree1/>
<YqyFiveMinutes/>
<YqyHotTeacher/>
<YqyTeacherList/>
<!-- <YqyTeacherInfo/> -->
</section>
<section class="home-bottom">
<!-- <yqyTest/> -->
</section>
</section>
</template>
<script>
import { Header } from 'mint-ui';
// import yqyTest from '@/components/common/yqy/yqyTest'
import YqyHotLabel from '../../components/business/yqy-hot-label';
import YqyHotTeacher from '../../components/business/yqy-hot-teacher';
import YqyTeacherList from '../../components/business/yqy-teacher-list';
import YqyTeacherInfo from '../../components/business/yqy-teacher-info';
import YqyHomeHeader from '../../components/business/yqy-home-header';
import YqyHomeAdv from '../../components/business/yqy-home-adv';
import YqyFiveMinutes from '../../components/business/yqy-five-minutes';
import YqyCategoryThree1 from '../../components/business/yqy-category-three-1';
import YqyHomeBanner from '../../components/business/yqy-home-banner';
import YqyHomeKeepon from '../../components/business/yqy-home-keepon';
import YqyHomePorter from '../../components/business/yqy-home-porter';
export default {
data(){
return {
}
},
components:{
Header,
// yqyTest
YqyHotLabel,
YqyHotTeacher,
YqyTeacherList,
YqyTeacherInfo,
YqyHomeHeader,
YqyHomeAdv,
YqyFiveMinutes,
YqyCategoryThree1,
YqyHomeBanner,
YqyHomeKeepon,
YqyHomePorter
},
mounted(){
// this.init()
},
computed:{
},
methods:{
init() {
this.API_GET('contents/homeButton/msg', {}).then( res => {
logger.debug(res)
this.$log.debug(res)
})
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)
})
},
pushView : function(page){
console.log('pushView');
rocNative.pushView({
url : page
}).then(function(res) {
console.log('pushView then' + JSON.stringify(res));
}).catch(function(res){
console.log('pushView catch' + JSON.stringify(res));
});
},
goBack: function (msg) {
console.log('goBack');
rocNative.goBack()
.then(function(res) {
console.log('goBack then' + JSON.stringify(res));
}).catch(function(res){
console.log('goBack catch' + JSON.stringify(res));
});
},
toast : function(msg){
console.log('toast');
rocNative.toast({
msg: msg
}).then(function(res) {
console.log('toast then' + JSON.stringify(res));
}).catch(function(res){
console.log('toast catch' + JSON.stringify(res));
});
},
},
}
</script>
<style lang="scss" scoped>
@import '../../style/mixin';
.mint-header {
background-color: rgba($color: #000000, $alpha: 0)
}
.font-style {
@include sc(0.6rem, #666);
}
.home-header {
height: px2rem(202px);
@include bis('../../images/552064153@2x.png');
.logo_img{
height: px2rem(85px);
width: px2rem(345px);
text-align: center;
}
}
</style>
此差异已折叠。
...@@ -74,19 +74,19 @@ ...@@ -74,19 +74,19 @@
<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 pullRefresh from '../../components/common/pullrefresh' // import pullRefresh from '../components/common/pullrefresh'
import {mapState, mapMutations} from 'vuex' import {mapState, mapMutations} from 'vuex'
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';
import YqyHomeHeader from '../../components/business-new/yqy-home-header'; import YqyHomeHeader from '../components/business-new/yqy-home-header';
import YqyHomeAdv from '../../components/business-new/yqy-home-adv'; import YqyHomeAdv from '../components/business-new/yqy-home-adv';
import YqyFiveMinutes from '../../components/business-new/yqy-five-minutes'; import YqyFiveMinutes from '../components/business-new/yqy-five-minutes';
import YqyCategoryThree1 from '../../components/business-new/yqy-category-three-1'; import YqyCategoryThree1 from '../components/business-new/yqy-category-three-1';
import YqyHomeBanner from '../../components/business-new/yqy-home-banner'; import YqyHomeBanner from '../components/business-new/yqy-home-banner';
import YqyHomeKeepon from '../../components/business-new/yqy-home-keepon'; import YqyHomeKeepon from '../components/business-new/yqy-home-keepon';
import YqyHomePorter from '../../components/business-new/yqy-home-porter'; import YqyHomePorter from '../components/business-new/yqy-home-porter';
import YqyHomeAdjust from '../../components/business-new/yqy-adjust'; import YqyHomeAdjust from '../components/business-new/yqy-adjust';
export default { export default {
data(){ data(){
return { return {
...@@ -104,15 +104,15 @@ export default { ...@@ -104,15 +104,15 @@ export default {
keeponData:{}, //继续学习 keeponData:{}, //继续学习
isShowKeep:false, isShowKeep:false,
listCategory:[{ listCategory:[{
"imageUrl": require('../../images/error.png') "imageUrl": require('../images/error.png')
},{ },{
"imageUrl": require('../../images/error.png') "imageUrl": require('../images/error.png')
},{ },{
"imageUrl": require('../../images/error.png') "imageUrl": require('../images/error.png')
},{ },{
"imageUrl": require('../../images/error.png') "imageUrl": require('../images/error.png')
},{ },{
"imageUrl": require('../../images/error.png') "imageUrl": require('../images/error.png')
}], //专题分类数据 }], //专题分类数据
yqDoctorList:[],//云雀名师数据 yqDoctorList:[],//云雀名师数据
newsDatalist:[],//最新课程 newsDatalist:[],//最新课程
...@@ -123,20 +123,20 @@ export default { ...@@ -123,20 +123,20 @@ export default {
stopPropagation:true, stopPropagation:true,
isIntStyle:'', isIntStyle:'',
listSwiper:[{ listSwiper:[{
"imageUrl": require('../../images/error.png') "imageUrl": require('../images/error.png')
},{ },{
"imageUrl": require('../../images/error.png') "imageUrl": require('../images/error.png')
},{ },{
"imageUrl": require('../../images/error.png') "imageUrl": require('../images/error.png')
},{ },{
"imageUrl": require('../../images/error.png') "imageUrl": require('../images/error.png')
},{ },{
"imageUrl": require('../../images/error.png') "imageUrl": require('../images/error.png')
}],//轮播图数据 }],//轮播图数据
listMiddle: [{ listMiddle: [{
"imageUrl": require('../../images/error.png') "imageUrl": require('../images/error.png')
},{ },{
"imageUrl": require('../../images/error.png') "imageUrl": require('../images/error.png')
}],//中间栏数据 }],//中间栏数据
scrollTimer:null, scrollTimer:null,
scrollTop:0, scrollTop:0,
...@@ -890,8 +890,8 @@ export default { ...@@ -890,8 +890,8 @@ export default {
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../../style/mixin'; @import '../style/mixin';
@import '../../style/swiper.min.css'; @import '../style/swiper.min.css';
.banner-container{ .banner-container{
height: px2rem(210px) height: px2rem(210px)
} }
...@@ -976,7 +976,7 @@ export default { ...@@ -976,7 +976,7 @@ export default {
height: px2rem(202px); height: px2rem(202px);
.swiper{ .swiper{
height: 100%; height: 100%;
/* @include bis('../../images/552064153@2x.png');*/ /* @include bis('../images/552064153@2x.png');*/
} }
......
<template>
<div>
<SearchHeader/>
<SplitLine/>
<!-- <HistorySearch/> -->
<SearchLabel :allTags="allTags"/>
<SearchLabel title="热门搜索" :showDelete="false" :allTags="allTags"/>
</div>
</template>
<script>
import SearchHeader from '../components/business/search-header';
import SplitLine from '../components/business/split-line';
import HistorySearch from '../components/business/history-search';
import SearchLabel from '../components/business/search-label';
export default {
data(){
return {
showDelete: false,
allTags: [{"doctorId":452,"doctorName":"刘飞刘","doctorImg":"https://file.yunqueyi.com/File/course_doctor/2018-11/19/452.png","doctorAvatarImg":"https://file.yunqueyi.com/image/jpeg/2018/10/12/20181012134114808-5339c711.jpg","doctorHospital":"沈阳市第四人民医院","joinNum":818,"resourceNum":1,"structureId":132},{"doctorId":424,"doctorName":"阮园阮园阮园","doctorImg":"https://file.yunqueyi.com/File/course_doctor/2018-11/19/424.png","doctorAvatarImg":"https://file.yunqueyi.com/image/jpeg/2018/08/30/20180830111232896-de2f9015.jpg","doctorHospital":"浙江医院","joinNum":533,"resourceNum":2,"structureId":132},{"doctorId":351,"doctorName":"李翔李翔李翔","doctorImg":"https://file.yunqueyi.com/File/course_doctor/2018-11/19/351.png","doctorAvatarImg":"https://file.yunqueyi.com/File/course_doctor/2017-04/06/lixiang.jpg","doctorHospital":"解放军306医院全军糖尿病中心","joinNum":503,"resourceNum":2,"structureId":132},{"doctorId":360,"doctorName":"高蕾莉","doctorImg":"https://file.yunqueyi.com/File/course_doctor/2018-11/20/360.png","doctorAvatarImg":"https://file.yunqueyi.com/File/course_doctor/2018-11/20/web_360.png","doctorHospital":"北京大学人民医院","joinNum":376,"resourceNum":1,"structureId":132}]
}
},
components: {
SearchHeader,
SplitLine,
HistorySearch,
SearchLabel
},
created(){
},
mounted(){
},
methods: {
getStatusHight(){
rocNative.getStatusBarHeight({
__funcName: '__getStatusBarHeight'
})
},
goToPage(){
// alert("000");
this.$emit('setAppMsg',false)
this.pageBurialPoin({
menuLevel:1,
menuCode:'m_home',
functionCode:'f_notification',
actionCode:'c_notification',
})
rocNative.readMessage();
}
},
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
@import '../style/mixin.scss';
@import '../style/global.scss';
</style>
<template>
<section>
<TopNav :bgColor="bgColor" :title="navTitle"></TopNav>
<section class="cooper-box">
<div class="cooper-count">共4个活动</div>
<div class="cooper-list">
<div class="cooper-item" v-for="(item,index) in list" :key="index">
<img src="../../images/Shape@2x.png" class="tag-img"/>
<div class="txt">国家基本公共卫生服务项目基层高血压管理办公室</div>
<span class="throw-img">
<img src="../../images/grey-throw.png" />
</span>
</div>
</div>
<BackTop></BackTop>
</section>
</section>
</template>
<script>
import BackTop from '../../components/common/backTop';
import TopNav from '../../components/common/topNav';
export default {
data(){
return {
//tittle:'转型合作',
navTitle:'转型合作',
bgColor:'#fff',
list:[{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}]
}
},
components:{
BackTop,
TopNav
},
mounted(){
document.tittle = this.tittle;
},
methods:{
},
}
</script>
<style lang="scss" scoped>
@import '../../style/mixin';
.cooper-box{
padding: px2rem(15px);
background: #fff;
}
.cooper-count{
color: #999;
font-size: px2rem(15px);
}
.cooper-item{
position: relative;
width: px2rem(345px);
margin-top:px2rem(15px);
box-shadow: 0 px2rem(2px) px2rem(6px) RGBA(42, 94, 161, 0.15);
padding:px2rem(14px) px2rem(30px) px2rem(14px) px2rem(17px);
.img{
width: 100%;
height: 100%;
}
.tag-img{
width:px2rem(48px);
height: px2rem(48px);
float: left;
}
.txt{
font-size: px2rem(15px);
margin-left:px2rem(59px);
}
.throw-img{
position: absolute;
top:50%;
right: px2rem(11px);;
width:px2rem(14px);
height: px2rem(14px);
margin-top:-(px2rem(7px));
img{
display: block;
width: 100%;
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>
此差异已折叠。
<template>
<section class="font-style">
<teacherTop :isShowCount="isShowCount" :studyCount="studyCount" :followCount="followCount"></teacherTop>
<div class="teach-opt">
<div class="teach-title">讲师名录</div>
<div class="opt-span">
<span class="" @click="sortFun">人气
<img src="../../images/sort-u.png" v-if="dir == 1">
<img src="../../images/sort-d.png" v-if="dir == 2">
</span>
</div>
<div class="teach-list">
<div :class="index%2==1?'list-item mr0':'list-item'" v-for="(item,index) in list" @click="goToDetail(item.doctorId)">
<div class="tea-img" :style="'background:'+item.bgColor">
<img v-lazy="item.doctorImg">
<span class="learn-p">{{item.joinNum}}人已学</span>
</div>
<div class="tea-txt">
<p class="tea-name">{{item.doctorName}}</p>
<div class="tea-position">
{{item.doctorHospital}}
</div>
</div>
</div>
</div>
</div>
</section>
</template>
<script>
import teacherTop from '../../components/teachers/teach-top';
export default {
components:{
teacherTop
},
data(){
return {
list:[{},{},{}],
isShowCount:true,
followCount:0,
studyCount:0,
col:1, //0综合,1人气,2资源数,3姓名首字母
dir:2,//1:正序 2:逆序
}
},
mounted(){
this.getData();
},
computed:{
},
methods:{
goToDetail(id){
let _this = this;
this.$router.push({
path: '/teachersDetail',
query:{
id:id
}
})
},
//排序
sortFun(){
this.dir = this.dir == 1 ? 2 : 1;
this.getData()
},
randomBg(d){
for(let i=0;i<d.length;i++){
if(i%4 == 0){
d[i].bgColor = '#EBF6F1'
}else if(i%4 == 1){
d[i].bgColor = '#EDF3FA'
}else if(i%4 == 2){
d[i].bgColor = '#F0F0FA'
}else if(i%4 == 3){
d[i].bgColor = '#F6EFE6'
}
}
/// console.log(d);
},
getData(){
let _this = this,
para = {
token:_this.$route.query.userToken,
setEntry: 'headers'
}
let url = '/contents/courseDoctor/getAllTeacher/orderby/'+_this.col+'/dir/'+_this.dir
this.GET(url, para).then(res => {
if(res.code == '000000'){
_this.list = res.data.teacherList || [];
_this.followCount = res.data.followCount || 0;
_this.studyCount = res.data.studyCount || 0;
if(_this.list.length>0){
_this.randomBg(_this.list);
}
}
})
}
}
}
</script>
<style>
body{background: #fff}
</style>
<style lang="scss" scoped>
body{background: #fff}
@import '../../style/mixin';
.mint-header {
background-color: rgba($color: #000000, $alpha: 0)
}
.font-style {
width: 100%;
overflow: hidden;
@include sc(0.6rem, #666);
}
.teach-opt{
padding:px2rem(26px) px2rem(15px) px2rem(15px) px2rem(15px);
.teach-title{
font-size: px2rem(18px);
padding-bottom: px2rem(15px);
color:#333;
}
.teach-list{
overflow: hidden;
}
.opt-span{
span{
color:#449284;
font-size: px2rem(13px);
display: inline-block;
vertical-align: middle;
height: px2rem(15px);
line-height: px2rem(15px);
img{
display: inline-block;
width: px2rem(15px);
height: px2rem(15px);
vertical-align: middle;
}
}
}
.list-item{
width: px2rem(170px);
margin-right: px2rem(5px);
margin-top: px2rem(15px);
float: left;
box-shadow: 0 px2rem(4px) px2rem(6px) RGBA(0, 0, 0, 0.06);
}
.mr0{
margin-right: 0
}
.tea-txt{
padding:px2rem(7px);
}
.tea-img{
width: px2rem(170px);
height: px2rem(83px);
position: relative;
img{
width: 100%;
height: 100%;
display: block;
border-radius: px2rem(3px) px2rem(3px) 0 0 ;
}
.learn-p{
padding-left: px2rem(5px);
position: absolute;
width: 100%;
left:0;
bottom: 0;
background: #333;
background: -webkit-linear-gradient(left, RGBA(0, 0, 0, 0.2),RGBA(0, 0, 0, 0));
background: -o-linear-gradient(right, RGBA(0, 0, 0, 0.2),RGBA(0, 0, 0, 0));
background: -moz-linear-gradient(right, RGBA(0, 0, 0, 0.2),RGBA(0, 0, 0, 0));
background: linear-gradient(to right, RGBA(0, 0, 0, 0.2),RGBA(0, 0, 0, 0));
color:#fff;
font-size: px2rem(11px);
height: px2rem(20px);
line-height: px2rem(20px);
}
}
.tea-name{
color:#333;
font-size: px2rem(14px);
padding: px2rem(7px) 0 px2rem(3px) 0;
}
.tea-position{
height: px2rem(30px);
font-size: px2rem(12px);
line-height: px2rem(15px);
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
}
}
.home-header {
height: px2rem(185px);
@include bis('../../images/headerTop.png');
.logo_img{
height: px2rem(85px);
width: px2rem(345px);
text-align: center;
}
}
</style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册