提交 5844cb68 编写于 作者: gjyang's avatar gjyang

test

上级 db00c2e3
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<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" @click="goToPage"/>
<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>
...@@ -105,6 +105,7 @@ export default { ...@@ -105,6 +105,7 @@ export default {
goToPage(){ goToPage(){
// alert("000"); // alert("000");
this.$emit('setAppMsg',false) this.$emit('setAppMsg',false)
this.$emit('jumpToSS',false)
this.pageBurialPoin({ this.pageBurialPoin({
menuLevel:1, menuLevel:1,
menuCode:'m_home', menuCode:'m_home',
......
<template>
<article v-if="allLabels && allLabels.length > 0" class="history-labels">
<section class="history-labels-title">
<span>{{title}}</span>
<img v-show="showDelete" src="../../images/sousuo/recicle.png" alt="删除">
</section>
<section class="history-labels-item"
@click="searchAction"
v-for="(item, index) in allLabels" :key="index" >
<span class="history-labels-item-name">{{item.doctorName}}</span>
</section>
</article>
</template>
<script>
export default {
name: 'HistoryLabels',
props: {
allLabels: {
type: Array
},
title: {
type: String,
default: '历史搜索'
},
showDelete: {
type: Boolean,
default: true
}
},
data () {
return {
}
},
mounted(){
},
methods: {
searchAction() {
console.log(22222)
this.$router.push({
path: '/result'
})
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
@import '../../style/mixin.scss';
.history-labels {
width: 100%;
padding: 0 px2rem(15px) 0;
margin-bottom: px2rem(6px);
background-color: #fff;
&-title {
display: inline-flex;
width: 100%;
align-items: center;
justify-content: space-between;
span {
font-size: px2rem(12px);
color: 6;
}
img {
width: px2rem(20px);
height: px2rem(20px);
padding: px2rem(4px);
}
}
&-item {
display: inline-flex;
height: px2rem(30px);
margin: px2rem(0px) px2rem(15px) 0 0;
text-align: center;
align-items: center;
&-name {
padding: px2rem(6px) px2rem(15px) px2rem(8px);
border-radius: px2rem(15px);
background-color: #F8F8F8;
color: #999;
font-size: px2rem(13px);
}
}
}
</style>
<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>
<article v-if="allLabels && allLabels.length > 0" class="history-labels">
<section class="history-labels-title">
<span>{{title}}</span>
</section>
<section class="history-labels-item"
@click="hotLabel(item.resourceType, item.structureId, item.resourceUrl, item.labelName, item)"
v-for="(item, index) in allLabels" :key="index" >
<span class="history-labels-item-name">{{item.doctorName}}</span>
</section>
</article>
</template>
<script>
import {mapMutations} from 'vuex'
export default {
name: 'YqyHotLabel',
props: {
allLabels: {
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>
<style lang="scss" scoped>
@import '../../style/mixin.scss';
.history-labels {
width: 100%;
padding: 0 px2rem(15px) 0;
margin-bottom: px2rem(6px);
background-color: #fff;
&-title {
display: inline-flex;
width: 100%;
align-items: center;
justify-content: space-between;
span {
font-size: px2rem(12px);
color: 6;
}
img {
width: px2rem(20px);
height: px2rem(20px);
padding: px2rem(4px);
}
}
&-item {
display: inline-flex;
height: px2rem(30px);
margin: px2rem(0px) px2rem(15px) 0 0;
text-align: center;
align-items: center;
&-name {
padding: px2rem(6px) px2rem(15px) px2rem(8px);
border-radius: px2rem(15px);
background-color: #F8F8F8;
color: #999;
font-size: px2rem(13px);
}
}
}
</style>
...@@ -2,18 +2,28 @@ ...@@ -2,18 +2,28 @@
<article class="search-wrapper"> <article class="search-wrapper">
<section class="search-wrapper-input"> <section class="search-wrapper-input">
<img src='../../images/search-grey.png'> <img src='../../images/search-grey.png'>
<input value="搜索疾病、课程、讲师"/> <form action="" @submit="search">
<input type="search" v-model="searchText"/>
</form>
</section> </section>
<section class="search-wrapper-cancle"> <section class="search-wrapper-cancle">
<span>取消</span> <span @click="cancel">取消</span>
</section> </section>
</article> </article>
</template> </template>
<script> <script>
export default { export default {
data() {
return {
searchText: '搜索疾病、课程、讲师'
}
},
methods: { methods: {
cancel() { cancel() {
this.searchText = ''
},
search() {
this.$emit('search', this.searchText)
} }
} }
} }
......
<template> <template>
<article v-if="allTags&&allTags.length>0" class="search-tag search-label"> <article v-if="allLabels&&allLabels.length>0" class="search-tag search-label">
<!-- <section :style="{'text-align': direction}" class="search-tag-title"> <!-- <section :style="{'text-align': direction}" class="search-tag-title">
{{title}} {{title}}
</section> --> </section> -->
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<div class="search-tag-item" <div class="search-tag-item"
@click="hotLabel(item.resourceType, item.structureId, item.resourceUrl, item.labelName, item)" @click="hotLabel(item.resourceType, item.structureId, item.resourceUrl, item.labelName, item)"
v-for="(item, index) in allTags" :key="index" > v-for="(item, index) in allLabels" :key="index" >
<span class="item-name">{{item.doctorName}}</span> <span class="item-name">{{item.doctorName}}</span>
</div> </div>
</article> </article>
...@@ -21,7 +21,7 @@ import {mapMutations} from 'vuex' ...@@ -21,7 +21,7 @@ import {mapMutations} from 'vuex'
export default { export default {
name: 'YqyHotLabel', name: 'YqyHotLabel',
props: { props: {
allTags: { allLabels: {
type: Array type: Array
}, },
direction: { direction: {
......
...@@ -18,7 +18,7 @@ Vue.use(VueLazyload, { ...@@ -18,7 +18,7 @@ Vue.use(VueLazyload, {
preLoad: 3, preLoad: 3,
// 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/error.png'),
attempt: 1 attempt: 1
// lazyComponent: true // lazyComponent: true
}) })
......
...@@ -2,6 +2,7 @@ import App from '../App' ...@@ -2,6 +2,7 @@ import App from '../App'
const index = r => require.ensure([], () => r(require('../views/index')), 'index') const index = r => require.ensure([], () => r(require('../views/index')), 'index')
const search = r => require.ensure([], () => r(require('../views/search-index')), 'search') const search = r => require.ensure([], () => r(require('../views/search-index')), 'search')
const result = r => require.ensure([], () => r(require('../views/search-index')), 'result')
export default [{ export default [{
path: '/', path: '/',
...@@ -22,5 +23,10 @@ export default [{ ...@@ -22,5 +23,10 @@ export default [{
path: '/search', path: '/search',
component: search component: search
}, },
//首页城市列表页
{
path: '/result',
component: result
},
] ]
}] }]
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<section class="home-header"> <section class="home-header">
<div class="home-topMenu"> <div class="home-topMenu">
<YqyHomeHeader :msgCount="msgCount" :searchFix="searchFix" v-on:setAppMsg="goAppMsg"/> <YqyHomeHeader :msgCount="msgCount" :searchFix="searchFix" v-on:setAppMsg="goAppMsg" @jumpToSS="jumpToSS"/>
</div> </div>
<div class="swiper"> <div class="swiper">
<mt-swipe :auto="3000" :speed="speedSwiper" :stopPropagation="prevent"> <mt-swipe :auto="3000" :speed="speedSwiper" :stopPropagation="prevent">
...@@ -300,7 +300,11 @@ export default { ...@@ -300,7 +300,11 @@ export default {
...mapMutations([ ...mapMutations([
'SET_DATA' 'SET_DATA'
]), ]),
jumpToSS() {
this.$router.push({
path:'/search'
})
},
goAppMsg(){ goAppMsg(){
this.isRefrshMsg = true; this.isRefrshMsg = true;
...@@ -892,6 +896,9 @@ export default { ...@@ -892,6 +896,9 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../style/mixin'; @import '../style/mixin';
@import '../style/swiper.min.css'; @import '../style/swiper.min.css';
img {
@include bis('../images/icon-p3-2.png');
}
.banner-container{ .banner-container{
height: px2rem(210px) height: px2rem(210px)
} }
......
<template> <template>
<div> <div>
<SearchHeader/> <SearchHeader @search="search"/>
<SplitLine/> <SplitLine/>
<!-- <HistorySearch/> --> <!-- <HistorySearch/> -->
<SearchLabel :allTags="allTags"/> <HisttoryLabels :allLabels="allLabels" :hasResult="hasResult"/>
<SearchLabel title="热门搜索" :showDelete="false" :allTags="allTags"/> <HotLabels title="热门搜索" :showDelete="false" :allLabels="allLabels" :hasResult="hasResult"/>
</div> </div>
</template> </template>
<script> <script>
import SearchHeader from '../components/business/search-header'; import SearchHeader from '../components/business/search-header';
import SplitLine from '../components/business/split-line'; import SplitLine from '../components/business/split-line';
import HistorySearch from '../components/business/history-search'; import HisttoryLabels from '../components/business/history-labels';
import SearchLabel from '../components/business/search-label'; import HotLabels from '../components/business/hot-labels';
export default { export default {
data(){ data() {
return { return {
showDelete: false, 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}] hasResult: true,
allLabels: [{"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: { components: {
SearchHeader, SearchHeader,
SplitLine, SplitLine,
HistorySearch, HisttoryLabels,
SearchLabel HotLabels
}, },
created(){ created(){
}, },
mounted(){ mounted(){
}, },
methods: { methods: {
getStatusHight(){ search(searchText) {
rocNative.getStatusBarHeight({ console.log(searchText)
__funcName: '__getStatusBarHeight'
})
},
goToPage(){
// alert("000");
this.$emit('setAppMsg',false)
this.pageBurialPoin({
menuLevel:1,
menuCode:'m_home',
functionCode:'f_notification',
actionCode:'c_notification',
})
rocNative.readMessage();
} }
}, },
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册