Commit 0951c511 by kyle

Merge branch 'master' of http://139.224.139.2:9091/chaosun/CFFP

parents 5e6b8a2a 76785289
<template>
<view class="search">
<input class="searchInput" type="text" name="" id="" v-model="queryName"/>
<text class="iconfont icon-sousuo" @click="searchBtn()"></text>
<text class="iconfont icon-xiaoxi"></text>
<text class="system_msg" @click="jumpToSystemMsg()">{{messageUnreadCount}}</text>
</view>
</template>
<script>
import api from "../../api/api";
import common from '../../common/common';
export default{
props:['isSearch'],
data(){
return {
messageUnreadCount:null,
queryName:null
}
},
name:'search',
components:{},
onLoad(){
},
methods:{
jumpToSystemMsg(){
uni.navigateTo({
url:'../systemMsg/system_msg'
})
},
querySystemMessage(){
api.querySystemMessage({systemType:1,userId:uni.getStorageSync('cffp_userId')}).then((res)=>{
if(res['success']){
this.messageUnreadCount = res['data']['unReadcount'];
if(Number(this.messageUnreadCount) > 99){
this.messageUnreadCount = '99+';
}
}else{
this.messageUnreadCount = null;
}
})
},
searchBtn(){
if(this.isSearch == 1){
//掉查询
this.$emit("send",this.queryName)
}else{
//有参数就掉查询否则直接跳转到课程列表页
if(this.queryName){
this.$emit("send",this.queryName)
}else{
uni.navigateTo({
url:'/pages/courselist/courselist'
})
}
}
}
},
mounted() {
this.querySystemMessage();
this.queryName = common.getQueryString('queryName');
}
}
</script>
<style lang="scss">
.search{
position: relative;
display: flex;
margin: 30rpx auto;
align-items: center;
.searchInput{
border-radius: 60rpx;
width: 95%;
background: linear-gradient(to right,#E6F5FC,#FDE9F2);
margin-right: 20rpx;
padding: 15rpx;
}
.icon-sousuo{
font-size: 60rpx;
position: absolute;
right: 80rpx;
top: 10rpx;
opacity: .7;
}
.icon-xiaoxi{
font-size: 50rpx;
}
.system_msg{
position: absolute;
color: #fff;
background: #fb4e40;
width: 40rpx;
height: 40rpx;
line-height: 40rpx;
border-radius: 50%;
text-align: center;
font-size: 16rpx;
right: -20rpx;
top: -5rpx;
}
}
</style>
\ No newline at end of file
<template>
<view :class="{pad:onlyShowList!=0}">
<!--搜索组件-->
<search :isSearch="1" v-if="onlyShowList!=0" @send="getCourseList"></search>
<!--轮播组件-->
<carousel :carouselList="fileUploadItemCFFPList" v-if="onlyShowList!=0"></carousel>
<h4 v-if="cffpCourseInfos.length<=0" class="noListTip">暂无课程列表</h4>
<view class="ulBox" v-if="cffpCourseInfos.length>0">
......@@ -15,21 +18,24 @@
import api from "../../api/api";
import courseItem from "@/components/courseItem/courseItem.vue";
import tabBar from '../../components/tabBar/tabBar.vue';
import carousel from '@/components/carousel/carousel.vue'
import carousel from '@/components/carousel/carousel.vue';
import search from '@/components/search/search.vue';
export default{
props:['tagIds','onlyShowList'],
data(){
return{
cffpCourseInfos:[],
currentPage:'courselist',
fileUploadItemCFFPList:[]
fileUploadItemCFFPList:[],
queryName:null
}
},
name:'courselist',
components:{
courseItem,
tabBar,
carousel
carousel,
search
},
onLoad(){
this.fileUploadItemCFFPList = uni.getStorageSync('fileUploadItemCFFPList');
......@@ -41,7 +47,10 @@
});
},
courseList(){
api.courseList().then(res=>{
const param = {
queryName:this.queryName
}
api.courseList(param).then(res=>{
if(res['success']){
this.cffpCourseInfos = res['data']['data'];
}else{
......@@ -59,7 +68,12 @@
}else{
return [].concat(v2,val)
}
}
},
getCourseList: function(res){
console.log("res=========",res)
this.queryName = res;
this.courseList()
}
},
mounted() {
this.courseList();
......
......@@ -6,12 +6,8 @@
<text class="name">{{cffpUserInfo.name}}</text>
<text class="iconfont icon-31tishi" @click="getIntroduce('center')"></text>
</view>
<view class="search">
<input class="searchInput" type="text" name="" id="" />
<text class="iconfont icon-sousuo" @click="searchBtn()"></text>
<text class="iconfont icon-xiaoxi"></text>
<text class="system_msg" @click="jumpToSystemMsg()">{{messageUnreadCount}}</text>
</view>
<!--搜索组件-->
<search :isSearch="0"></search>
<!--轮播组件-->
<carousel :carouselList="cffpUserInfo.fileUploadItemList"></carousel>
</view>
......@@ -56,6 +52,7 @@
import api from "../../api/api";
import tabBar from '../../components/tabBar/tabBar.vue';
import carousel from '@/components/carousel/carousel.vue';
import search from '@/components/search/search.vue';
export default {
data() {
return {
......@@ -78,7 +75,6 @@
type:''//类型1,区域中心,2工作室
},
announcementInfo:null,
messageUnreadCount:null,
tagIds:123,
currentPage:'index',
carouselList:[]
......@@ -87,12 +83,12 @@
components:{
courselist,
tabBar,
carousel
carousel,
search
},
onLoad() {
this.queryAreaCenterInfo();
this.announcementQuery();
this.querySystemMessage();
},
methods: {
featureSelect(featureItem){
......@@ -140,31 +136,11 @@
url:`../announcement/announcement`
})
},
jumpToSystemMsg(){
uni.navigateTo({
url:'../systemMsg/system_msg'
})
},
querySystemMessage(){
api.querySystemMessage({systemType:1,userId:uni.getStorageSync('cffp_userId')}).then((res)=>{
if(res['success']){
this.messageUnreadCount = res['data']['unReadcount'];
if(Number(this.messageUnreadCount) > 99){
this.messageUnreadCount = '99+';
}
}else{
this.messageUnreadCount = null;
}
})
},
goToCourselist(){
uni.navigateTo({
url:'../../pages/courselist/courselist'
})
},
searchBtn(){
}
},
onShow() {
if(!uni.getStorageSync('isLogin')){
......@@ -198,42 +174,6 @@
border-radius: 20rpx;
overflow: hidden;
}
.search{
position: relative;
display: flex;
margin: 30rpx auto;
align-items: center;
.searchInput{
border-radius: 60rpx;
width: 95%;
background: linear-gradient(to right,#E6F5FC,#FDE9F2);
margin-right: 20rpx;
padding: 15rpx;
}
.icon-sousuo{
font-size: 60rpx;
position: absolute;
right: 80rpx;
top: 10rpx;
opacity: .7;
}
.icon-xiaoxi{
font-size: 50rpx;
}
.system_msg{
position: absolute;
color: #fff;
background: #fb4e40;
width: 40rpx;
height: 40rpx;
line-height: 40rpx;
border-radius: 50%;
text-align: center;
font-size: 16rpx;
right: -20rpx;
top: -5rpx;
}
}
}
.message{
display: flex;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment