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

isFirstTime

上级 745beaa9
......@@ -103,16 +103,19 @@ export default {
},
goToPage(){
// alert("000");
this.$emit('setAppMsg',false)
this.$emit('jumpToSS',false)
this.pageBurialPoin({
menuLevel:1,
menuCode:'m_home',
functionCode:'f_notification',
actionCode:'c_notification',
this.$router.push({
path: '/search'
})
rocNative.readMessage();
// alert("000");
// this.$emit('setAppMsg',false)
// this.$emit('jumpToSS',false)
// this.pageBurialPoin({
// menuLevel:1,
// menuCode:'m_home',
// functionCode:'f_notification',
// actionCode:'c_notification',
// })
// rocNative.readMessage();
}
},
......
......@@ -2,13 +2,21 @@
<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="删除">
<span v-show="showDelete" class="history-labels-title-all">
<span @click="deleteLabels(true)">全部删除</span><span>|</span><span @click="toggleDelete">取消</span>
</span>
<img @click="toggleDelete" v-show="!showDelete" src="../../images/sousuo/recicle.png" alt="删除">
</section>
<section class="history-labels-item"
@click="searchAction"
@click="searchAction(item)"
v-for="(item, index) in allLabels" :key="index" >
<span class="history-labels-item-name">{{item.doctorName}}</span>
<span class="history-labels-item-name">
<span>{{item}}</span>
<img @click="deleteLabels(false, index)" v-show="showDelete"
src="../../images/sousuo/delete.png" alt=""
>
</span>
</section>
</article>
</template>
......@@ -17,37 +25,81 @@
export default {
name: 'HistoryLabels',
props: {
allLabels: {
type: Array
},
// allLabels: {
// type: Array
// },
title: {
type: String,
default: '历史搜索'
},
showDelete: {
type: Boolean,
default: true
}
},
data () {
return {
allLabels: [],
showDelete: false
}
},
mounted(){
this.getData()
},
methods: {
searchAction() {
searchAction(searchText) {
if(this.showDelete) return
console.log(22222)
this.$router.push({
path: '/result'
path: '/result',
query: {
searchText: searchText
}
})
},
// 获取历史搜索
getData() {
let _this = this,
para = {
token: _this.token,
setEntry: 'headers'
}
let url = 'contents/searchHistory/listHistory'
this.GET(url, para).then(res => {
if (res.code == '000000') {
this.allLabels = res.data.list
console.log(res)
}
})
},
// 删除关键词
deleteLabels(isAll, index=0, length=1) {
let _this = this,
para = {
token: _this.token,
setEntry: 'headers',
keywords: []
};
let url = 'contents/searchHistory/deleteHistory'
if (isAll) {
para.keywords = this.allLabels
} else {
para.keywords.push(this.allLabels[index])
}
this.POST(url, para).then(res => {
if (res.code == '000000') {
// this.allLabels = res.data.list
this.allLabels.splice(index,length)
}
})
},
toggleDelete() {
this.showDelete = !this.showDelete
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
@import '../../style/mixin.scss';
.history-labels {
......@@ -62,13 +114,20 @@ export default {
justify-content: space-between;
span {
font-size: px2rem(12px);
color: 6;
color: #666;
}
img {
width: px2rem(20px);
height: px2rem(20px);
padding: px2rem(4px);
}
&-all {
span {
padding: px2rem(4px) px2rem(5px);
font-size: px2rem(12px);
color: #999;
}
}
}
&-item {
display: inline-flex;
......@@ -77,11 +136,22 @@ export default {
text-align: center;
align-items: center;
&-name {
position: relative;
top: 0;
left: 0;
padding: px2rem(6px) px2rem(15px) px2rem(8px);
border-radius: px2rem(15px);
background-color: #F8F8F8;
color: #999;
font-size: px2rem(13px);
img {
position: absolute;
top: px2rem(-10px);
right: px2rem(-10px);
width: px2rem(20px);
height: px2rem(20px);
padding: px2rem(4px);
}
}
}
}
......
<template>
<article v-if="allLabels && allLabels.length > 0" class="history-labels">
<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 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.keyword}}</span>
</section>
</article>
</article>
</template>
<script>
import {mapMutations} from 'vuex'
import {
mapMutations
} from 'vuex'
export default {
name: 'YqyHotLabel',
name: 'HotLabels',
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
default: '热门搜索'
}
},
data () {
data() {
return {
allLabels: []
}
},
mounted(){
mounted() {
this.getData()
},
methods: {
...mapMutations([
'SET_CLEAR_VUEX'
]),
hotLabel(val,id,url,name,item){
this.$emit('hotLabel',id,name)
// ...mapMutations([
// 'SET_CLEAR_VUEX'
// ]),
hotLabel(val, id, url, name, item) {
this.$emit('hotLabel', id, name)
//讲师集
switch (val) {
case 1:
......@@ -63,11 +45,16 @@ export default {
case 2:
this.SET_CLEAR_VUEX()
//window.location.href=url;
this.jumpToCartoon(url,name)
this.jumpToCartoon(url, name)
break;
case 3:
this.SET_CLEAR_VUEX()
this.$router.push({path:'/lecturer',query:{id:id}})
this.$router.push({
path: '/lecturer',
query: {
id: id
}
})
break;
default:
break;
......@@ -76,13 +63,13 @@ export default {
dispatchEventByModuleCode(itemData) {
let modeCode = itemData.appModuleInfo.code
let paramList = itemData.appModuleInfo.paramList ? itemData.appModuleInfo.paramList : ''
if( modeCode === 'M001' || modeCode === 'M002' || modeCode === 'M003') {
if (modeCode === 'M001' || modeCode === 'M002' || modeCode === 'M003') {
paramList = ''
} else if( modeCode === 'M100' || modeCode === 'M300' ) {
} else if (modeCode === 'M100' || modeCode === 'M300') {
let urlPara = this.getUrlPara(paramList)
paramList[0].value += urlPara
}
if(typeof paramList === 'string' && !paramList){
if (typeof paramList === 'string' && !paramList) {
paramList = []
}
rocNative.dispatchEventByModuleCode({
......@@ -92,27 +79,26 @@ export default {
},
//跳到相应的课程
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
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
"key": "courseId",
"value": `${id}`,
"type": 1,
"seqNo": 2
}
]
}
......@@ -120,72 +106,93 @@ export default {
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",
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",
"type": 4,
"seqNo": 1
}, {
"key": "showTitle",
"value": true,
"type":1,
"seqNo":2
},{
"key":"title",
"type": 1,
"seqNo": 2
}, {
"key": "title",
"value": name,
"type":1,
"seqNo":2
}
]
"type": 1,
"seqNo": 2
}]
}
};
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: itemData.appModuleInfo.paramList
})
},
// 获取历史搜索
getData() {
let _this = this,
para = {
type: 2,
token: _this.token,
setEntry: 'headers'
}
let url = '/contents/searchKeyword/listKeywords'
this.GET(url, para).then(res => {
if (res.code == '000000') {
this.allLabels = res.data
console.log(res)
}
})
}
}
}
</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;
color: #666;
}
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);
......@@ -195,5 +202,4 @@ export default {
}
}
}
</style>
<template>
<article class="search-wrapper">
<section class="search-wrapper-input">
<form action="" @submit.stop="search">
<!-- <form action="" @submit.stop.prevent="search"> -->
<img src='../../images/search-grey.png'>
<input type="search" v-model="searchText"/>
</form>
<input type="search" v-model="currentText" @keydown.enter="search"/>
<!-- <button type="submit" v-show="false"/> -->
<!-- </form> -->
</section>
<section class="search-wrapper-cancle">
<span @click="cancel">取消</span>
......@@ -15,18 +16,39 @@
export default {
data() {
return {
searchText: '搜索疾病、课程、讲师'
currentText: ''
}
},
props: {
searchText: {
type: String,
default: ''
}
},
// computed: {
// currentText() {
// return this.searchText
// }
// },
watch: {
searchText(val) {
this.currentText = val
console.log(val)
}
},
mounted() {
// this.getData()
},
methods: {
// 取消
cancel() {
console.log('in cancel')
this.searchText = ''
this.currentText = ''
},
// 搜索
search() {
this.$emit('search', this.searchText)
console.log(this.currentText)
this.$emit('search', this.currentText)
}
}
}
......@@ -40,13 +62,14 @@ export default {
position: fixed;
top: 0;
left: 0;
z-index: 1;
z-index: 2;
width: 100%;
background: #fff;
flex-direction: row;
padding: px2rem(20px) px2rem(10px) px2rem(10px) px2rem(15px);
text-align: center;
align-items: center;
background: #fff;
border-bottom: 1px solid #F8F8F8;
&-input {
width: px2rem(290px);
height: px2rem(30px);
......@@ -55,21 +78,22 @@ export default {
background: rgba(245, 246, 246, 1);
img {
position: relative;
top: px2rem(-18px);
top: px2rem(-13px);
left: px2rem(0px);
width: px2rem(14px);
height: px2rem(14px);
}
input {
position: relative;
top: px2rem(-20px);
top: px2rem(-15px);
left: px2rem(-8px);
width: px2rem(240px);
text-decoration-color: #bbb;
color: #bbb;
color: #666;
font-size: px2rem(13px);
font-weight: 400;
background: rgba(245, 246, 246, 1);
user-select: all;
&[type="search"]::-webkit-search-cancel-button{
display: none;
}
......
* {
-webkit-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
}
// * {
// -webkit-user-select: none;
// -moz-user-select: none;
// -o-user-select: none;
// user-select: none;
// }
body, div, span, header, footer, nav, section, aside, article, ul, dl, dt, dd, li, a, p, h1, h2, h3, h4,h5, h6, i, b, textarea, button, input, select, figure, figcaption, {
padding: 0;
......
......@@ -226,11 +226,14 @@ export function jumpEvaluatPage(){
return evaluatPageUrl
}
// // dev地址
// dev地址
// const baseUrl = 'http://192.168.140.14:10201/'
const baseUrl = 'http://10.177.10.149:10201/'
// const baseUrl = 'http://192.168.140.14:10201/'
// const baseUrl = 'https://dev-sc.yunqueyi.com/'
// const apiUrl = 'https://dev-api.yunqueyi.com/'
// const evaluatPageUrl = 'https://dev-phome.yunqueyi.com/gpr/#/home'
// export const jumpWebPageUrl = 'https://dev-phome.yunqueyi.com/appl/#/'
const apiUrl = 'https://dev-api.yunqueyi.com/'
const evaluatPageUrl = 'https://dev-phome.yunqueyi.com/gpr/#/home'
export const jumpWebPageUrl = 'https://dev-phome.yunqueyi.com/appl/#/'
// // test1地址
// const baseUrl = 'https://test1-sc.yunqueyi.com/'
......@@ -243,11 +246,11 @@ export function jumpEvaluatPage(){
// const evaluatPageUrl = 'https://uat-phome.yunqueyi.com/gpr/#/home'
// export const jumpWebPageUrl = 'https://uat-phome.yunqueyi.com/appl/#/'
// pro地址
const baseUrl = 'https://sc.yunqueyi.com/'
const apiUrl = 'https://api.yunqueyi.com/'
const evaluatPageUrl = 'https://phome.yunqueyi.com/gpr/#/home'
export const jumpWebPageUrl = 'https://phome.yunqueyi.com/appl/#/'
// // pro地址
// const baseUrl = 'https://sc.yunqueyi.com/'
// const apiUrl = 'https://api.yunqueyi.com/'
// const evaluatPageUrl = 'https://phome.yunqueyi.com/gpr/#/home'
// export const jumpWebPageUrl = 'https://phome.yunqueyi.com/appl/#/'
// 获取BaseUrl
......
......@@ -117,13 +117,9 @@ module.exports = {
return paramList;
},
// 通用GET请求
GET(api, para, callback,str) {
if(para.token){
para.token = para.token || this.token || 'EA67293E35C249C1832583F7AD2669EC'
}
para.token = para.token || this.token || 'FA95BE7379684E419050F72BCEB0DE12'
let url = api + this.getUrlPara(para)
return fetch({
url: getBaseUrl(url),
......@@ -134,10 +130,7 @@ module.exports = {
// 通用POST请求
POST(api, para, callback) {
if(para.token){
para.token = para.token || this.token || 'EA67293E35C249C1832583F7AD2669EC'
}
//para.token = para.token || this.token || 'EA67293E35C249C1832583F7AD2669EC' //'AF3DFCF2DD4B4115AC47ACA25D5420E9''F90DF48D3EFA49DFAE1267A67DBEFB18'//token
para.token = para.token || this.token || 'FA95BE7379684E419050F72BCEB0DE12'
return fetch({
url: getBaseUrl(api),
method: 'post',
......
......@@ -29,6 +29,9 @@
if(t == 'getToken'){
__getToken(n);
}
if(t == '__isFirstTime'){
window.__isFirstTime(n)
}
},
__callNative: function (t, a, o) {
"function" == typeof o && (n++ , i[n] = o);
......@@ -75,7 +78,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");
}("isFirstTime","setFirstTime","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) {
e.__isAndroid = true
e.__isIOS = false
......
此差异已折叠。
此差异已折叠。
<template>
<section>
<SearchHeader @search="search"/>
<SearchHeader @search="search" :searchText="searchText"/>
<!-- <SplitLine/> -->
<!-- 没有结果页面 -->
<section v-show="!hasResult" class="mt-100">
......@@ -105,12 +105,49 @@ export default {
this.searchText = this.$route.query.searchText || ''
},
mounted(){
this.search()
this.search(this.searchText)
},
methods: {
// 搜索
search() {
console.log('in result search: ' + this.searchText)
// 搜索结果
search(searchText) {
let _this = this,
para = {
searchCategory: '1,2,3,4',
searchValue: searchText,
sortItem: 1,
pageNo: 1,
pageSize: 4,
token: _this.token,
setEntry: 'headers',
}
let url = 'contents/searchKeyword/searchContent'
this.GET(url, para).then(res => {
if (res.code == '000000') {
// 课程
this.contentAppModels = this.data.contentAppModels
this.contentAppModelCount = this.data.contentAppModelCount
// 健康漫画
this.educationContents = this.data.educationContents
this.educationContentCount = this.data.educationContentCount
// 五分钟医学
this.fiveMinutesMedicalContentList = this.data.fiveMinutesMedicalContentList
this.fiveMinutesMedicalContentListCount = this.data.fiveMinutesMedicalContentListCount
// 讲师
this.pCourseDoctorModels = this.data.pCourseDoctorModels
this.pCourseDoctorModelCount = this.data.pCourseDoctorModelCount
// contentAppModelCount: 0
// contentAppModels: []
// educationContentCount: 0
// educationContents: []
// fiveMinutesMedicalContentList: []
// fiveMinutesMedicalContentListCount: 0
// pCourseDoctorModelCount: 0
// pCourseDoctorModels: []
}
})
},
showIndex(index) {
console.log(index)
......
<template>
<div>
<SearchHeader @search="search"/>
<SplitLine />
<HisttoryLabels :allLabels="allLabels" :hasResult="hasResult"/>
<HotLabels title="热门搜索" :showDelete="false" :allLabels="allLabels" :hasResult="hasResult"/>
<SearchHeader @search="search" :searchText="searchText"/>
<!-- <SplitLine /> -->
<div class="mt-100"></div>
<HistoryLabels/>
<HotLabels/>
</div>
</template>
<script>
import SearchHeader from '../components/business/search-header';
import SplitLine from '../components/business/split-line';
import HisttoryLabels from '../components/business/history-labels';
import HistoryLabels from '../components/business/history-labels';
import HotLabels from '../components/business/hot-labels';
export default {
data() {
return {
showDelete: false,
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}]
searchText: ''
}
},
components: {
SearchHeader,
SplitLine,
HisttoryLabels,
HistoryLabels,
HotLabels
},
created(){
......@@ -32,7 +31,7 @@ export default {
},
mounted(){
this.getData()
},
methods: {
// 跳转到结果页面,并
......@@ -45,6 +44,24 @@ export default {
searchText: searchText
}
})
},
// 获取历史搜索
getData() {
let _this = this,
para = {
type: 1,
token: _this.token,
setEntry: 'headers'
}
let url = '/contents/searchKeyword/listKeywords'
this.GET(url, para).then(res => {
if (res.code == '000000') {
if (res.data && res.data.length) {
let index = Math.floor(Math.random() * res.data.length)
this.searchText = res.data[index].keyword
}
}
})
}
},
}
......@@ -54,5 +71,7 @@ export default {
<style lang="scss" scoped>
@import '../style/mixin.scss';
@import '../style/global.scss';
.mt-100 {
padding-top: px2rem(63px) !important;
}
</style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册