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

代码整理

上级 2c105cc5
......@@ -3,7 +3,6 @@
<div class="back-btn" @click="backTop">
<img src="../../images/backTop.png"/>
</div>
</section>
</template>
......@@ -31,21 +30,16 @@
}
}
},
methods: {
backTop:function(){
if(this.burialPoint == 'activity'){
this.pageBurialPoin(this.objPoint);
}
var osTop = document.documentElement.scrollTop || document.body.scrollTop;
if(osTop > 0){
document.documentElement.scrollTop = document.body.scrollTop = 0;
}
}
},
}
</script>
......@@ -64,8 +58,6 @@
height: 100%;
display: block;
}
}
</style>
......@@ -38,13 +38,6 @@ export default {
default: false
}
},
watch: {
// searchFix:function(n){
// if(n){
// alert(this.searchFix)
// }
// }
},
created() {
let _this = this;
window.__getStatusBarHeight = function(parm) {
......@@ -56,7 +49,6 @@ export default {
_this.ptop = _this.popHeight + "px";
_this.bPtop = _this.popHeight + 2 + "px"
_this.menuptop = _this.popHeight + "px";
// alert(parm.statusBarHeight);
};
this.getStatusHight();
},
......
......@@ -13,7 +13,7 @@
</span>
</div>
<span class="disp-blc lect-ks">{{item.department}}</span>
<span class="disp-blc study-num">{{item.joinNum | formatNumber}}人已学</span>
<span class="disp-blc study-num">{{item.joinNum | yLocalString}}人已学</span>
</div>
</div>
</div>
......@@ -21,7 +21,6 @@
</template>
<script>
// import { setEventByModuleCode } from '@/utils/index'
import { teacher } from '../../utils/buryingPoint';
export default {
data() {
......@@ -47,7 +46,6 @@ export default {
}
},
methods: {
// 跳转到详情页面
gotoDetail(item){
this.$router.push({
......@@ -62,7 +60,6 @@ export default {
labelValue: item.doctorName
})
},
//热门讲师
getData(){
let _this = this,
......
......@@ -72,23 +72,12 @@ export default {
default: true
}
},
computed: {
// ...mapGetters({
// orderNum: 'orderNum'
// })
},
watch: {
// orderNum(val) {
// this.showOrderIndex = 1
// }
},
methods: {
toggle() {
this.showTitle = !showTitle
this.showOrder = !showOrder
},
order(index, orderType, orderName) {
console.log(index, orderType, orderName)
this.showOrderIndex = index
this[orderType] = !this[orderType]
this.$emit('order', orderName, this[orderType])
......@@ -96,9 +85,6 @@ export default {
reset() {
this.showOrderIndex = 1
}
// resetShowOrderIndex(){
// this.showOrderIndex = 1
// }
}
}
</script>
......
<template>
<mt-popup
v-model="isShowSelection"
position="top"
>
<!-- <section v-show="isShowSelection" style="position:fixed;top:0;z-index:201;background:#fff;height:100%;overflow-x:auto;"> -->
<article class="lect-selection">
<section class="lect-selection-title">
<img @click="closeSelectedPage" src="../../images/lecturer/select-delete.png"/>
<span>{{selectedTitle}}</span>
<span class="no-content"></span>
</section>
</article>
<article class="group-title">
<section class="group-title-order">
<div @click="selectedType(1)" class="group-title-order-item">
<span :class="{'active': selectedTypeIndex === 1}">{{selectedTitleTitle}}</span>
<img v-show="selectedTypeIndex === 1" src="../../images/lecturer/select-up.png"/>
<img v-show="selectedTypeIndex !== 1" src="../../images/lecturer/select-down.png"/>
</div>
<div @click="selectedType(2)" class="group-title-order-item">
<span :class="{'active': selectedTypeIndex === 2}">{{selectedLevelName}}</span>
<img v-show="selectedTypeIndex === 2" src="../../images/lecturer/select-up.png"/>
<img v-show="selectedTypeIndex !== 2" src="../../images/lecturer/select-down.png"/>
</div>
<div @click="selectedType(3)" class="group-title-order-item">
<span :class="{'active': selectedTypeIndex === 3}">{{selectedDepartName}}</span>
<img v-show="selectedTypeIndex === 3" src="../../images/lecturer/select-up.png"/>
<img v-show="selectedTypeIndex !== 3" src="../../images/lecturer/select-down.png"/>
</div>
</section>
</article>
<section class="lect-selection-content">
<article class="lect-selection-content-region" v-show="selectedTypeIndex === 1">
<table class="lect-selection-content-rp-tb">
<tr>
<td style="width: 40%" >
<table class="lect-selection-content-rp-tb-left">
<tr v-for="(item, index) in allAreaList" :class="{'bg-white': selectedAreaIndex === index}" @click="selectAreaAction(item, index)" :key="index">
<td >{{item.name}}</td>
</tr>
</table>
</td>
<td style="width: 4%"></td>
<td class="lect-selection-content-rp-tb-tb" style="width: 55%" >
<table >
<tr v-for="(item, index) in allAreaSubList"
@click="selectAreaSubAction(item, index)" :key="index"
>
<td >{{item.name}}</td>
<td style="text-align: right;"><img v-show="item.name && selectedAreaSubIndex === index" src="../../images/lecturer/select-selected.png"/></td>
</tr>
</table>
</td>
</tr>
</table>
</article>
<article class="lect-selection-content-level" v-show="selectedTypeIndex === 2">
<table class="lect-selection-content-rp-tb">
<tr>
<td class="lect-selection-content-rp-tb-tb-2" >
<table>
<tr @click="selectLevelAction(item, index)" v-for="(item, index) in allLevelList" :key="index">
<td >{{item.value}}</td>
<td style="text-align: right;"><img v-show="selectedLevelIndex === index" src="../../images/lecturer/select-selected.png"/></td>
</tr>
</table>
</td>
</tr>
</table>
</article>
<article class="lect-selection-content-region" v-show="selectedTypeIndex === 3">
<table class="lect-selection-content-rp-tb">
<tr>
<td class="lect-selection-content-rp-tb-tb-2">
<table>
<tr @click="selectDepartAction(item, index)" v-for="(item, index) in allDepartList" :key="index">
<td >{{item.name}}</td>
<td style="text-align: right;"><img v-show="selectedDepartIndex === index" src="../../images/lecturer/select-selected.png"/></td>
</tr>
</table>
</td>
</tr>
</table>
</article>
</section>
<!-- </section> -->
</mt-popup>
</template>
<script>
// import {mapState, mapMutations, mapActions} from 'vuex'
// import BackTop from '@/homecom/components/common/backTop';
export default {
data(){
return {
isShowSelection: false,
parmDataDoctList: [],
selectedTypeIndex: 1,
allAreaList: [],
allAreaSubList: [],
allAreaListHandles: [],
allLevelList: [],
allDepartList: [],
selectedAreaIndex: 0,
selectedAreaSubIndex: 0,
selectedLevelIndex: 0,
selectedDepartIndex: 0,
selectedTitleTitle: '全国',
selectedAreaName: '全国',
selectedAreaSubName: '',
selectedLevelName: '全部等级',
selectedDepartName: '全部科室',
provinceId: 0,
cityId: 0,
countyId: 0,
levelGrade : 0,
departmentId: 0,
oldProinveId: -1,
oldCityId: -1,
oldCountyId: -1,
oldSelectedAreaSubIndex: -1,
}
},
props: {
// selectedTypeIndex: {
// type: Number,
// default: 1
// }
},
computed: {
// isShowSelection() {
// return this.isShowSelection;
// },
selectedTitle() {
return this.selectedTypeIndex === 1 ? '选择地区' : this.selectedTypeIndex === 2 ? '选择等级' : '选择科室'
}
},
components:{
},
// computed: {
// selectedTitle() {
// return this.selectedTypeIndex === 1 ? '选择地区' : this.selectedTypeIndex === 2 ? '选择等级' : '选择科室'
// }
// },
beforeCreate() {
},
created () {
this.initAll()
},
beforeMount() {
},
mounted(){
},
beforeDestroyed(){
},
watch:{
},
methods:{
// ...mapActions({
// 'setAdjustList': 'setAdjustList'
// }),
show() {
this.isShowSelection = true
},
selectedTypeFromTitle(index) {
this.selectedTypeIndex = index
this.isShowSelection = true
},
closeSelectedPage() {
this.isShowSelection = false
},
selectedType(index) {
this.selectedTypeIndex = index
// this.$emit('selectedType', index)
},
initAll(){
// this.getSwiper()
// this.getYqDoctorDataByCD()
this.getAreas()
this.getLevels()
this.getDeparts()
},
//根据条件获取讲师列表
getYqDoctorDataByCD(){
let _this = this,
para = {
provinceId: this.provinceId,
cityId: this.cityId,
countyId: this.countyId,
levelGrade: this.levelGrade,
departmentId: this.departmentId,
setEntry: 'headers'
}
this.GET('contents/courseDoctor/v1/getAllTeacher', para).then(res => {
if(res.code == '000000'){
// _this.parmDataDoctList = res.data && res.data.list || []
let selTitle = this.selectedAreaSubName || this.selectedAreaName
if (selTitle === '全部'){
selTitle = this.selectedAreaName
}
this.selectedTitleTitle = selTitle
this.$emit('selectedData',
res.data && res.data.list || [],
selTitle,
this.selectedLevelName, this.selectedDepartName)
}
})
},
// 获取所有区域数据
getAreas() {
let param = {
setEntry: 'headers'
}
this.GET('contents/courseDoctor/listAreas', param).then(res => {
if(res.code == '000000'){
this.allAreaList = this.handleAreaData(res.data && res.data.list || [])
this.allAreaSubList = this.allAreaList[0].cities
}
})
},
// 寻找数据最大值,用于定义表格高度
getMaxRowNum(orginAreaList) {
console.log(orginAreaList)
let maxRowNum = orginAreaList.length || 31
orginAreaList.forEach((element, index) => {
// if (element.length > maxRowNum){
maxRowNum = element.cities.length > maxRowNum ? element.cities.length : maxRowNum
// }
})
return maxRowNum
},
// 处理区域数据
handleAreaData (orginAreaList) {
let handleList = [], maxRowNum = this.getMaxRowNum(orginAreaList);
console.log(maxRowNum)
orginAreaList.forEach((element, index) => {
// debugger
if( index === 0 ){
handleList.push({id: element.id, name: element.name,
cities: this.decorateCitiesData({}, element.cities, maxRowNum + 1, false)})
} else {
handleList.push({id: element.id, name: element.name,
cities: this.decorateCitiesData({id: 0, name: '全部', provinceId: element.id}, element.cities, maxRowNum)})
}
});
handleList.unshift({id:'0',name:'全国',cities: this.decorateCitiesData({id: 0, name: '全国', provinceId: 0}, [], maxRowNum)})
for (let i = orginAreaList.length; i < maxRowNum; i++) {
handleList.push({id:'',name:'',cities: []})
}
console.log('handleList: ', handleList)
return handleList
},
// 装饰城市数据
decorateCitiesData(appendInitData, cities, dataNum = 31, needAppend = true) {
let appendCities = [], appendLength = dataNum - cities.length;
if(needAppend){
appendCities.unshift(appendInitData)
}
appendCities = appendCities.concat(cities)
for(let i = 0; i < appendLength; i ++){
appendCities.push({id: '', name: '', provinceId: ''})
}
return appendCities
},
// 获取医院等级
getLevels() {
let param = {
setEntry: 'headers'
}
this.GET('contents/courseDoctor/listLevels', param).then(res => {
if(res.code == '000000'){
this.allLevelList = res.data && res.data.list || []
this.allLevelList.unshift({no: 0, value: "全部等级"})
}
})
},
// 获取医院科室
getDeparts() {
let param = {
setEntry: 'headers'
}
this.GET('contents/courseDoctor/listDeparts', param).then(res => {
if(res.code == '000000'){
this.allDepartList = res.data && res.data.list || []
this.allDepartList.unshift({id: 0, name: "全部科室"})
}
})
},
// 选中省或直辖市
selectAreaAction(item, index) {
// debugger
if (item.name) {
this.selectedAreaIndex = index
if (this.oldProinveId = item.provinceId) {
if (item.isMunicipality) {
this.selectedAreaSubIndex = this.oldCountyId
} else {
this.selectedAreaSubIndex = this.oldCityId
}
} else {
this.selectedAreaSubIndex = -1
}
this.allAreaSubList = item.cities
this.selectedAreaName = item.name
}
},
// 选中市或区
selectAreaSubAction(item, index) {
// this.selectedAreaIndex = index
// this.allAreaSubList = item.cities
if(item.name){
this.selectedAreaSubIndex = index
this.selectedAreaSubName = item.name
if(item.isMunicipality){
this.cityId = item.cityId
this.countyId = item.id
this.provinceId = item.provinceId
this.oldProinveId = item.provinceId
this.oldCityId = item.cityId
this.oldCountyId = item.id
} else {
this.cityId = item.id
this.countyId = 0
this.provinceId = item.provinceId
this.oldProinveId = item.provinceId
this.oldCityId = item.id
this.oldCountyId = 0
}
this.closeSelectedPage()
this.getYqDoctorDataByCD()
}
},
// 选中医院等级
selectLevelAction(item, index) {
this.selectedLevelIndex = index
this.selectedLevelName = item.value
this.levelGrade = item.no
this.closeSelectedPage()
this.getYqDoctorDataByCD()
},
// 选中医院科室
selectDepartAction(item, index) {
this.selectedDepartIndex = index
this.selectedDepartName = item.name
this.departmentId = item.id
this.closeSelectedPage()
this.getYqDoctorDataByCD()
}
},
}
</script>
<style>
.mint-popup.mint-popup-top {
height: 100%;
z-index: 2001;
/* overflow: auto; */
}
.swiper .mint-swipe-indicators{
right: 6px;
top:50%;
bottom: inherit;
left:inherit;
width:10px;
text-align: center;
transform: translateX(0%);
transform: translateY(-50%);
}
.swiper .mint-swipe-item img{
width: 100%;
height: 100%;
}
.swiper .mint-swipe-indicator{
width:2px;
height: 8px;
background: #fff;
opacity: 0.4;
float: left;
margin-top:3px;
border-radius: 0;
}
.swiper .is-active{
opacity: 1;
}
.mint-loadmore-top .mint-loadmore-text{font-size: 12px;}
.banner-container.swiper-container-horizontal>.swiper-pagination-bullets{
width: 2px;
left: inherit;
transform: translateY(-50%);
position: absolute;
right: 6px;
top:50%;
}
.banner-container.swiper-container-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet{
width: 2px;
height: 7px;
background: #fff;
margin:6px 0 0 0;
float: left;
opacity: 0.4;
}
.banner-container.swiper-container-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet-active{
opacity: 1
}
.banner-pagination{
width: 2px;
z-index: 100;
right: 10px;
top:10px;
position: absolute;
}
/* .swiper-pagination-bullet{
} */
.swiper-slide img{
width: 100%;
height: 100%;
}
</style>
<style lang="scss" scoped>
@import '../../style/mixin';
@import '../../style/swiper.min.css';
.banner-container{
height: px2rem(210px)
}
.main-body{
position: relative;
}
.box-BG{
width: 100%;
height: 100%;
position: absolute;
top:0;
left: 0;
z-index: 10000
}
.mint-header {
background-color: rgba($color: #000000, $alpha: 0)
}
.font-style {
@include sc(0.6rem, #666);
}
@keyframes myPullDown{
from {padding-top: 0;}
to {padding-top:px2rem(225px)}
}
@keyframes myPullUp{
from {padding-top: px2rem(225px);}
to {padding-top:0}
}
.pull-down{
-webkit-animation: myPullDown 1.2s;
animation: myPullDown 1.2s;
padding-top:px2rem(225px)
}
.pull-up{
-webkit-animation: myPullUp 1.2s;
animation: myPullUp 1.2s;
padding-top:0
}
.news-update{
display: block;
position: fixed;
background: #F9F6EF;
right: 0;
bottom: px2rem(140px);
height: px2rem(27px);
padding:0 px2rem(12px);;
line-height: px2rem(27px);
border:1px solid RGBA(162, 129, 60, 0.2);
font-size: px2rem(13px);
box-shadow: 0 px2rem(2px) px2rem(3px) RGBA(202, 168, 97, 0.4);
border-radius: px2rem(14px) 0 0 px2rem(14px);
z-index: 101;
.news-info{
color: #A2813C;
position: relative;
display: inline-block;
i{
position: absolute;
right: -(px2rem(6px));
top:px2rem(4px);
display: inline-block;
width: px2rem(4px);
height: px2rem(4px);
border-radius: 100%;
background: #F47A48
}
}
}
.home-topMenu{
width: 100%;
text-align:center;
top:0;
position: absolute;
z-index: 10;
}
.home-header {
height: px2rem(234px); // banner图片变高了
// height: px2rem(210px);
.swiper{
height: 100%;
/* @include bis('../../images/552064153@2x.png');*/
}
.logo_img{
height: px2rem(85px);
width: px2rem(345px);
text-align: center;
}
}
.home-body{
background: #fff
}
.pathologic-list{
width: 100%;
height: px2rem(52px);
padding: 0 px2rem(15px);
margin-top: px2rem(15px);
.pathologic-item{
float: left;
width: 48%;
box-shadow: 0 px2rem(2px) px2rem(8px) rgba(49, 127, 119, 0.2);
border-radius: px2rem(3px);
background: #fff;
/* padding: px2rem(12px) 0 px2rem(12px) 0;*/
margin-right: 4%;
text-align: center;
.pathologic-icon{
height: px2rem(52px);
/* height: px2rem(20px);*/
img{
width: 100%;
height: px2rem(52px);
padding-bottom: px2rem(8px);
vertical-align: middle;
display: inline-block;
}
}
.pathologic-txt{
font-size: px2rem(14px);
line-height: px2rem(20px);
font-weight: 700;
display: inline-block;
vertical-align: middle;
}
}
.clear{
clear: both;
}
}
</style>
<style lang="scss" scoped>
@import '../../style/mixin';
.lect-selection-content {
// position: absolute;
// top: px2rem(122px);
// z-index: 201;
width: px2rem(375px);
height: 82%;
overflow: auto;
font-size: px2rem(14px);
color: #666666;
margin-right: px2rem(15px);
width: px2rem(360px);
table {
width: 100%;
border-collapse: collapse;
}
&-rp-tb {
padding: px2rem(4px) px2rem(15px);
&-left {
td {
padding-left: px2rem(15px);
border-bottom: 1px solid #F5F6F6;
}
background: #F5F6F6;
}
tr {
height: px2rem(40px);
line-height: px2rem(40px);
}
td {
height: px2rem(40px);
img {
position: relative;
top: px2rem(6px);
left: 0;
width: 20px;
height: 20px;
}
}
&-tb {
td {
padding-left: px2rem(8px);
border-bottom: 1px solid #f0f0f0;
}
}
&-tb-2 {
td {
padding-left: 0;
border-bottom: 1px solid #f0f0f0;
}
table {
width: 96%;
margin: 0 px2rem(15px);
}
}
}
}
.lect-selection {
display: flex;
background: #fff;
flex-direction: row;
&-title {
display: flex;
flex-direction: row;
padding: px2rem(33px) px2rem(15px) px2rem(13px);
width: px2rem(375px);
justify-content: space-between;
font-size: px2rem(13px);
height: px2rem(68px);
// line-height: px2rem(64px);
border-bottom: 1px solid #e7e7e7;
img {
position: relative;
top: px2rem(1px);
left: px2rem(1px);
height: px2rem(25px);
width: px2rem(25px);
}
span {
// height: px2rem(18px);
font-size: px2rem(18px);
color: #333;
}
}
}
.group-title {
// position: absolute;
// top: px2rem(80px);
// z-index: 202;
display: flex;
flex-direction: row;
padding: px2rem(16px) px2rem(25px) px2rem(16px);
border-bottom: 1px solid #f0f0f0;
&-order {
display: flex;
flex-direction: row;
width: px2rem(325px);
justify-content: space-between;
font-size: px2rem(13px);
&-item {
span {
font-size: px2rem(15px);
color: #333;
}
img {
position: relative;
top: 0;
left: px2rem(-1px);
height: px2rem(11px);
width: px2rem(11px);
}
}
}
}
.active {
color: #449284 !important;
}
.bg-white {
background: #fff;
}
</style>
......@@ -233,7 +233,6 @@ export default {
// 寻找数据最大值,用于定义表格高度
getMaxRowNum(orginAreaList) {
console.log(orginAreaList)
let maxRowNum = orginAreaList.length || 31
orginAreaList.forEach((element, index) => {
// if (element.length > maxRowNum){
......@@ -247,7 +246,6 @@ export default {
// 处理区域数据
handleAreaData (orginAreaList) {
let handleList = [], maxRowNum = this.getMaxRowNum(orginAreaList);
console.log(maxRowNum)
orginAreaList.forEach((element, index) => {
// debugger
if( index === 0 ){
......@@ -263,7 +261,6 @@ export default {
for (let i = orginAreaList.length; i < maxRowNum; i++) {
handleList.push({id:'',name:'',cities: []})
}
console.log('handleList: ', handleList)
return handleList
},
......@@ -582,9 +579,6 @@ export default {
<style lang="scss" scoped>
@import '../../style/mixin';
.lect-selection-content {
// position: absolute;
// top: px2rem(122px);
// z-index: 201;
width: px2rem(375px);
height: 81%;
overflow: auto;
......@@ -593,7 +587,6 @@ export default {
margin-right: px2rem(15px);
width: px2rem(360px);
-webkit-overflow-scrolling : touch;
// overflow-scrolling : touch;
overflow: auto;
table {
width: 100%;
......@@ -653,7 +646,6 @@ export default {
justify-content: space-between;
font-size: px2rem(13px);
height: px2rem(68px);
// line-height: px2rem(64px);
border-bottom: 1px solid #e7e7e7;
img {
position: relative;
......@@ -663,18 +655,13 @@ export default {
width: px2rem(25px);
}
span {
// height: px2rem(18px);
font-size: px2rem(18px);
color: #333;
}
}
}
.group-title {
// position: absolute;
// top: px2rem(80px);
// z-index: 202;
display: flex;
flex-direction: row;
padding: px2rem(16px) px2rem(25px) px2rem(16px);
......
......@@ -38,14 +38,8 @@ export default {
}
},
computed: {
// ...mapGetters({
// // orderNum: 'orderNum'
// })
},
watch: {
// orderNum(val) {
// this.showOrderIndex = 1
// }
},
methods: {
selectedType(index) {
......
......@@ -8,7 +8,7 @@
@click="gotoDetail(item)">
<div class="tea-img" :style="'background:'+ item.bgColor">
<img :src="item.doctorAvatarImg">
<span class="learn-p">{{item.totalNum | formatNumber}}人已学</span>
<span class="learn-p">{{item.totalNum | yLocalString}}人已学</span>
<span class="learn-p-cnum">课程: 共{{item.resourceNum}}</span>
<!-- <span class="learn-p">{{item.joinNum | yLocalString}}人已学</span> -->
</div>
......@@ -61,17 +61,8 @@ export default {
}
},
mounted() {
// window.__refresh = function (parm) {
// _this.getData();
// }
// window.addEventListener('scroll', this.handleScroll)
},
computed: {
...mapGetters({
// cSearchText: 'cSearchText',
// userInfo: 'userInfo',
}),
cParamData() {
if (this.parmData && this.parmData.length) {
return this.randomBg(this.parmData)
......@@ -80,8 +71,6 @@ export default {
}
}
},
watch: {
},
methods: {
// 跳转到详情页面
gotoDetail(item){
......
......@@ -54,9 +54,6 @@ export default {
}
},
mounted(){
// console.log(this.isShare);
console.log(shareUrl);
console.log(`${shareUrl}`+'?doctorId='+this.doctorId)
},
methods:{
// backPre(){
......
......@@ -7,13 +7,19 @@ const mixins = require('@/utils/mixins');
import '@/utils/rem' // 引入自适应
import '@/utils/yqyServerRegister' // 移动端服务
import FastClick from 'fastclick'
import Logger from './plugins/logger' // 日志插件
import Swiper from './plugins/swiper.min.js' // 日志插件
// import Logger from './plugins/logger' // 日志插件
// import Swiper from './plugins/swiper.min.js'
// 引入Mint
import Mint from 'mint-ui'
import 'mint-ui/lib/style.css'
// 可调试
// Vue.config.devtools = true;
// Vue.use(Logger, { prefix: new Date(), isDev: process.env.NODE_ENV === 'development', cLevel: 'debug' })
Vue.use(Mint)
import VueLazyload from 'vue-lazyload'
Vue.use(VueLazyload, {
preLoad: 3,
......@@ -32,22 +38,6 @@ Vue.filter('yLocalString', function(value){
var r = len % 3;
return r > 0 ? b.slice(0, r) + "," + b.slice(r, len).match(/\d{3}/g).join(",") : b.slice(r, len).match(/\d{3}/g).join(",");
})
Vue.filter('formatNumber', function(num, precision, separator) {
var parts;
if (!isNaN(parseFloat(num)) && isFinite(num)) {
num = Number(num);
num = (typeof precision !== 'undefined' ? num.toFixed(precision) : num).toString();
parts = num.split('.');
parts[0] = parts[0].toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1' + (separator || ','));
return parts.join('.');
}
return '';
})
// 可调试
Vue.config.devtools = true;
Vue.use(Mint)
Vue.use(Logger, { prefix: new Date(), isDev: process.env.NODE_ENV === 'development', cLevel: 'debug' })
if ('addEventListener' in document) {
document.addEventListener('DOMContentLoaded', function() {
......
......@@ -11,7 +11,6 @@ const service = axios.create({
// request拦截器
service.interceptors.request.use(config => {
// console.log('config: ', config, config.data.setEntry)
if (config.data && config.data.setEntry) {
config.headers['sysCode'] = config.data.sysCode || 10
if(config.data.token){
......@@ -20,13 +19,6 @@ service.interceptors.request.use(config => {
config.headers['deviceInfo'] = JSON.stringify({ "app_channel": "", "app_mac": "", "app_uuid": "", "app_version": "", "device_brand": "", "device_ip": "", "device_model": "", "device_net": "", "device_ops": "", "resolution_wh": "", "system_level": "", "device_type": '10' })
}
// if (config.data && config.data.setEntry) {
// config.headers['sysCode'] = config.data.sysCode || 10
// config.headers['token'] = config.data.token || '625D128F3DBA486AABE7CBA9BDF90E69'
// config.headers['deviceInfo'] = JSON.stringify({ "app_channel": "", "app_mac": "", "app_uuid": "", "app_version": "", "device_brand": "", "device_ip": "", "device_model": "", "device_net": "", "device_ops": "", "resolution_wh": "", "system_level": "", "device_type": '10' })
// }
return config
}, error => {
logger.debug('service.interceptors.request: ', error)
......
......@@ -18,12 +18,6 @@ export function setEventByModuleCode(itemData){
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 = []
......
import fetch from '@/utils/fetch'
import { getBaseUrl, getApiUrl } from '@/utils/index'
module.exports = {
data: function () {
return {
// isIpx: Utils.env.isIPhoneX(),//是不是iphoneX
// isAndroid: Utils.env.isAndroid(),
// isIOS: false,
// isWeb: false,
token: null
}
},
created: function () {
let query = this.$router.query
// this.token = this.getUrlSearch(location.href, 'token') || (query && query.token) || null
this.token = this.getUrlKey('token') || (query && query.token) || null
window.__getUserInfo = function (parm) {
alert(param)
}
console.log(this)
},
mounted() {
this.getUserInfo();
},
methods: {
//获取版本号
getUserInfo() {
alert(444)
rocNative.getUserInfo({
__funcName: '__getUserInfo'
})
},
getUrlPara(obj) {
let dataStr = ''
let list = [];
for (let attr in obj) {
if (obj.hasOwnProperty(attr) && attr != 'data') {
list.push(attr + '=' + obj[attr])
}
}
dataStr = list.join('&')
if (dataStr !== '') {
return '?' + dataStr
}
return ''
},
pageBurialPoin(options){
let opt = {
menuLevel:options.menuLevel || '',
functionCode:options.functionCode || '',
actionCode: options.actionCode || '',
// label:options.label || '',
labelId:options.labelId || '',
labelValue :options.labelValue || '',
createdTime: options.createdTime || new Date().getTime(),
//type: options.type || '0',
menuCode: options.menuCode || '',
// menuToCode:options.menuToCode || '',
duration: options.duration || 0,
menuFromCode:options.menuFromCode ||'',
params:options.params || '',
session:options.session || '',
}
console.log(opt);
rocNative.appBuryingPointEntrust(opt)
},
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;
},
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 ''
},
setEventByModuleCode(itemData){
console.log(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.getUrlParmByCode(paramList)
// paramList[0].value += urlPara;
paramList[0] && (paramList[0].value += urlPara);
}else if( modeCode === 'M400') {
let path = paramList[0]['key'];
let v = paramList[0]['value'];
let query = this.setRouterParm(paramList);
this.$router.push({
path: v,
query:query
})
}
if(typeof paramList === 'string' && !paramList){
paramList = []
}
return paramList;
},
// 通用GET请求
GET(api, para, callback,str) {
para.token = para.token || this.token || 'EA67293E35C249C1832583F7AD2669EC' //'AF3DFCF2DD4B4115AC47ACA25D5420E9''F90DF48D3EFA49DFAE1267A67DBEFB18'//token
let url = api + this.getUrlPara(para)
return fetch({
url: getBaseUrl(url),
method: 'get',
data: para
})
},
// 通用POST请求
POST(api, para, callback) {
para.token = para.token || this.token || 'EA67293E35C249C1832583F7AD2669EC' //'AF3DFCF2DD4B4115AC47ACA25D5420E9''F90DF48D3EFA49DFAE1267A67DBEFB18'//token
return fetch({
url: getBaseUrl(api),
method: 'post',
data: para
})
},
// 通用GET请求
API_GET(api, para, callback) {
para.token = para.token || this.token || '625D128F3DBA486AABE7CBA9BDF90E69' //'AF3DFCF2DD4B4115AC47ACA25D5420E9''F90DF48D3EFA49DFAE1267A67DBEFB18'//token
let url = api + this.getUrlPara(para)
return fetch({
url: getApiUrl(url),
method: 'get',
data: para
})
},
// 通用POST请求
API_POST(api, para, callback) {
para.token = para.token || this.token || '625D128F3DBA486AABE7CBA9BDF90E69' //'AF3DFCF2DD4B4115AC47ACA25D5420E9''F90DF48D3EFA49DFAE1267A67DBEFB18'//token
return fetch({
url: getApiUrl(api),
method: 'post',
data: para
})
},
// 从html参数
getUrlKey(name) {
if (decodeURIComponent && location.href) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null
} else {
return null
}
},
getUrlSearch(url, name) {
if (typeof name == 'undefined') {
name = url
url = location.href
}
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = url.slice(url.indexOf('?') + 1).match(reg);
if (r != null) {
try {
return decodeURIComponent(r[2]);
} catch (_e) {
return null
}
}
return null
},
}
}
......@@ -34,28 +34,7 @@ module.exports = {
}
return ''
},
// pageBurialPoin(options){
// let opt = {
// menuLevel:options.menuLevel || '',
// functionCode:options.functionCode || '',
// actionCode: options.actionCode || '',
// // label:options.label || '',
// labelId:options.labelId || '',
// labelValue :options.labelValue || '',
// createdTime: options.createdTime || new Date().getTime(),
// //type: options.type || '0',
// menuCode: options.menuCode || '',
// // menuToCode:options.menuToCode || '',
// duration: options.duration || 0,
// menuFromCode:options.menuFromCode ||'',
// params:options.params || '',
// session:options.session || '',
// }
// console.log(opt);
// rocNative.appBuryingPointEntrust(opt)
// },
// 埋点
pageBurialPoin(options){
rocNative.appBuryingPointEntrust(options)
},
......@@ -136,7 +115,6 @@ module.exports = {
},
setEventByModuleCode(itemData){
console.log(itemData);
let modeCode = itemData.appModuleInfo.code || '';
let paramList = itemData.appModuleInfo.paramList ? itemData.appModuleInfo.paramList : ''
......@@ -169,7 +147,6 @@ module.exports = {
if(typeof paramList === 'string' && !paramList){
paramList = []
}
console.log(paramList);
return paramList;
},
......
......@@ -21,11 +21,7 @@
</template>
<script>
// import { setEventByModuleCode } from '@/utils/index'
// import TopNav from '../../components/common/topNav';
import TopNav from '../../components/teacher/topNav';
// import teacherTop from '../../components/teachers/teach-top';
// import BackTop from '../../components/common/backTop';
import BackTop from '../../components/teacher/backTop';
import {activity_action} from '../../utils/buryingPoint';
import { deepCopy } from '../../utils';
......@@ -55,7 +51,6 @@ export default {
let _this = this;
this.id = this.$route.query.categoryId || 1
this.navTitle = this.id == 1 ? '专项合作' : '活动掠影'
// this.token = this.$route.query.userToken || this.$route.query.token
window.__getUserInfo = function(parm){
_this.token = parm.userToken
_this.getTabData()
......
......@@ -77,7 +77,6 @@
</template>
<script>
// import teacherTop from '../../components/teachers/teach-top';
import teacherTop from '../../components/teacher/teach-top';
import {teacher,teacher_info_collect} from '../../utils/buryingPoint';
export default {
......@@ -208,33 +207,6 @@ export default {
// this.$emit('collect',val,this.resourceData.item[val].favorFlag,id,name)
},
// collectFunOld(status, id, courseName){
// status = status == 1 ? 2 : 1;
// let _this = this,
// parm = {
// token: _this.token || '4A96FD82B250491683D17888482A1F96' || 'A76D20BE3C79409C9520AB5A997737DF',
// type: status,
// courseId: id,
// setEntry: 'headers'
// }
// alert(JSON.stringify(parm))
// // alert(this.token)
// _this.POST('contents/favors',parm).then(function(res){
// alert(JSON.stringify(res))
// if(res.code === '000000'){
// _this.handelData(id,status);
// } else {
// rocNative.showNativeToast({
// message: '请先登录'
// })
// }
// })
// this.appBuryingPointEntrust({
// ...teacher_info_collect,
// labelId: id,
// labelValue: courseName
// })
// },
// 埋点
appBuryingPointEntrust(val) {
rocNative.appBuryingPointEntrust(val)
......@@ -303,11 +275,9 @@ export default {
studyCount:res.data.studyCount,
doctor:res.data.doctor
}
}
})
}
}
}
......
<template>
<div class="main-body" ref="wrapper">
<section class="home-header">
<div class="home-topMenu">
<YqyHomeHeader :searchFix="searchFix"/>
</div>
<div class="swiper">
<mt-swipe :auto="3000" :speed="speedSwiper" :stopPropagation="prevent">
<mt-swipe-item v-for="(item, index) in listSwiper" :key="index" >
<img :src="item.imageUrl" @click="goLinkByswiper(item)"/>
</mt-swipe-item>
</mt-swipe>
</div>
</section>
<!-- 热门讲师 -->
<YqyHotLecturer />
<!-- 讲师标题 -->
<YqyLecturerTitle/>
<!-- 讲师选择标题 -->
<YqyLecturerSelect
@selectedType="selectedTypeFromTitle"
:selectedAreaName="selectedTitleTitle"
:selectedLevelName="selectedLevelName"
:selectedDepartName="selectedDepartName"
/>
<!-- 讲师排序 -->
<YqyLecturerOrder groupTitle="全部讲师" @order="orderAction"/>
<!-- 讲师列表 -->
<YqyTeacherList :parmData="parmDataDoctList"/>
<!-- 讲师选择组件 - 弹框 -->
<YqyLecturerSelectContent
ref="lecturerSelContRef"
:isShowSelectionB="showSelectedPage"
@selectedData="selectedLecturerList"
/>
<!--返回顶部-->
<BackTop v-if="searchFix"/>
</div>
</template>
<script>
import { Swipe, SwipeItem} from 'mint-ui';
import {mapState, mapMutations, mapActions} from 'vuex'
import BackTop from '@/components/business/backTop';
import YqyHomeHeader from '@/components/business/yqy-home-header';
import YqyLecturerTitle from '@/components/business/yqy-lecturer-title';
import YqyLecturerSelect from '@/components/business/yqy-lecturer-select';
import YqyLecturerOrder from '@/components/business/yqy-lecturer-order';
import YqyLecturerSelectContent from '@/components/business/yqy-lecturer-select-content';
import YqyHotLecturer from '@/components/business/yqy-hot-lecturer';
import YqyTeacherList from '@/components/business/yqy-teacher-list'
export default {
data(){
return {
showSelectedPage: false,
parmDataDoctList: [],
selectedTypeIndex: 1,
prevent: true,
isShowBackTop: false,
speedSwiper: 300,
//轮播图默认数据
listSwiper: [{
"imageUrl": require('../../images/lecturer/750420-1.png')
},{
"imageUrl": require('../../images/lecturer/750420-1.png')
},{
"imageUrl": require('../../images/lecturer/750420-1.png')
},{
"imageUrl": require('../../images/lecturer/750420-1.png')
},{
"imageUrl": require('../../images/lecturer/750420-1.png')
}],
scrollTimer: null,
scrollTop: 0,
userToken: '',
searchFix: false,
statusBarHeight: 0,
userMobile: '',
isFailSwiper: 1,
selectedTitleTitle: '全国',
selectedAreaName: '全国',
selectedAreaSubName: '',
selectedLevelName: '全部等级',
selectedDepartName: '全部科室',
}
},
components:{
Swipe,
SwipeItem,
BackTop,
YqyHomeHeader,
YqyLecturerTitle,
YqyLecturerSelect,
YqyLecturerOrder,
YqyLecturerSelectContent,
YqyHotLecturer,
YqyTeacherList,
},
computed: {
selectedTitle() {
return this.selectedTypeIndex === 1 ? '选择地区' : this.selectedTypeIndex === 2 ? '选择等级' : '选择科室'
}
},
beforeCreate() {
},
created () {
let _this = this;
_this.initAll()
_this.getUserInfo();
// window.__refresh = function(params){
// }
window.__getStatusBarHeight = function(parm){
// alert(JSON.stringify(parm))
_this.statusBarHeight = parm.statusBarHeight;
}
// alert("token之前");
window.__getUserInfo = function(parm){
// _this.systemType = parm.systemType;
// _this.appVersion = parm.appVersion;
// _this.token = parm.userToken;
// _this.userToken = parm.userToken;
// _this.userMobile = parm.userMobile;
// _this.initByToken(parm.userToken);
}
// _this.getStatusHight()
// _this.initByToken('593F679F62964076AF1C7489DA3343ED');
},
beforeMount() {
},
mounted(){
window.addEventListener('scroll', this.scrollFun);
},
beforeDestroyed(){
window.removeEventListener('scroll', this.scrollFun)
},
watch:{
},
methods: {
// 排序
orderAction(orderName, isSortUp) {
let orderType = isSortUp ? -1 : 1
let orderData = this.parmDataDoctList.slice()
orderData.sort((a, b)=> {
if (orderName === 'doctorFirstNameChar') {
return (a[orderName].charCodeAt(0) - b[orderName].charCodeAt(0)) * orderType
} else if(orderName === 'newTime') {
if(isSortUp) {
return ((new Date(a[orderName]).getTime())/1000 > (new Date(b[orderName]).getTime())/1000) ? 1 : -1
} else {
return ((new Date(a[orderName]).getTime())/1000 < (new Date(b[orderName]).getTime())/1000) ? 1 : -1
}
} else {
return (a[orderName] - b[orderName]) * orderType
}
})
this.parmDataDoctList = orderData
},
// 选择器组件回调
selectedLecturerList(paramList, selectedTitle, selectedLevelName, selectedDepartName) {
this.parmDataDoctList = paramList
this.selectedTitleTitle = selectedTitle
this.selectedLevelName = selectedLevelName
this.selectedDepartName = selectedDepartName
},
// 选择标题组件
selectedTypeFromTitle(index) {
this.selectedTypeIndex = index
this.$refs.lecturerSelContRef.selectedType(index)
this.$refs.lecturerSelContRef.show()
},
// 请求数据
initAll(){
this.getSwiper()
this.getYqDoctorDataByCD()
},
//获取状态栏高度
getStatusHight(){
rocNative.getStatusBarHeight({
__funcName: '__getStatusBarHeight'
})
},
//获取用户信息及版本号等()
getUserInfo(){
rocNative.getUserInfo({
__funcName: '__getUserInfo'
})
},
//轮播图跳转
goLinkByswiper(itemData){
this.pageBurialPoin({
menuLevel:1,
menuCode:'m_home',
functionCode:'f_banner',
actionCode:'c_banner',
labelId:itemData.id,
labelValue:itemData.name
})
let paramList = this.setEventByModuleCode(itemData);
rocNative.dispatchEventByModuleCode({
modeCode: itemData.appModuleInfo.code,
jsonString: paramList
})
},
//根据条件获取讲师列表
getYqDoctorDataByCD(){
let _this = this,
para = {
provinceId: 0,
cityId: 0,
countyId: 0,
levelGrade: 0,
departmentId: 0,
setEntry: 'headers'
}
this.GET('contents/courseDoctor/v1/getAllTeacher', para).then(res => {
if(res.code == '000000'){
_this.parmDataDoctList = res.data && res.data.list || []
_this.orderAction('doctorFirstNameChar', true)
}
})
},
scrollEndFun(){
let scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
// let newCourseTop = document.querySelector('#famus-teacher').offsetTop;
// let fivesTop = document.querySelector('#fiveBoxMenu').offsetTop;
},
scrollFun(){
let scrollTop = document.body.scrollTop || document.documentElement.scrollTop
// var clientHeight = document.querySelector('#famus-teacher').clientHeight;
// this.scrollTimer = setTimeout(this.scrollEndFun, 200);
// if(scrollTop > searchBox && scrollTop < adjustTop){
if(scrollTop > 20){
console.log(scrollTop);
this.searchFix = true;
}else{
this.searchFix = false;
}
},
// 获取轮播图数据
getSwiper(){
let _this = this,
para = {
setEntry: 'headers',
}
this.GET('contents/courseDoctorBanner/queryList', para).then(res => {
if(res.code == '000000'){
_this.listSwiper = res.data.bannerList || [];
}
if( _this.listSwiper.length == 0){
_this.isFailSwiper += 1;
}
_this.isFailSwiper = _this.listSwiper.length == 0 ? 2 : 1 ;
})
},
}
}
</script>
<style>
.mint-popup.mint-popup-top {
height: 100%;
z-index: 2001;
/* overflow: auto; */
}
.swiper .mint-swipe-indicators{
right: 6px;
top:50%;
bottom: inherit;
left:inherit;
width:10px;
text-align: center;
transform: translateX(0%);
transform: translateY(-50%);
}
.swiper .mint-swipe-item img{
width: 100%;
height: 100%;
}
.swiper .mint-swipe-indicator{
width:2px;
height: 8px;
background: #fff;
opacity: 0.4;
float: left;
margin-top:3px;
border-radius: 0;
}
.swiper .is-active{
opacity: 1;
}
.mint-loadmore-top .mint-loadmore-text{font-size: 12px;}
.banner-container.swiper-container-horizontal>.swiper-pagination-bullets{
width: 2px;
left: inherit;
transform: translateY(-50%);
position: absolute;
right: 6px;
top:50%;
}
.banner-container.swiper-container-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet{
width: 2px;
height: 7px;
background: #fff;
margin:6px 0 0 0;
float: left;
opacity: 0.4;
}
.banner-container.swiper-container-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet-active{
opacity: 1
}
.banner-pagination{
width: 2px;
z-index: 100;
right: 10px;
top:10px;
position: absolute;
}
/* .swiper-pagination-bullet{
} */
.swiper-slide img{
width: 100%;
height: 100%;
}
</style>
<style lang="scss" scoped>
@import '../../style/mixin';
@import '../../style/swiper.min.css';
.banner-container{
height: px2rem(210px)
}
.main-body{
position: relative;
}
.box-BG{
width: 100%;
height: 100%;
position: absolute;
top:0;
left: 0;
z-index: 10000
}
.mint-header {
background-color: rgba($color: #000000, $alpha: 0)
}
.font-style {
@include sc(0.6rem, #666);
}
.top-evaluat{
}
@keyframes myPullDown{
from {padding-top: 0;}
to {padding-top:px2rem(225px)}
}
@keyframes myPullUp{
from {padding-top: px2rem(225px);}
to {padding-top:0}
}
.pull-down{
-webkit-animation: myPullDown 1.2s;
animation: myPullDown 1.2s;
padding-top:px2rem(225px)
}
.pull-up{
-webkit-animation: myPullUp 1.2s;
animation: myPullUp 1.2s;
padding-top:0
}
.news-update{
display: block;
position: fixed;
background: #F9F6EF;
right: 0;
bottom: px2rem(140px);
height: px2rem(27px);
padding:0 px2rem(12px);;
line-height: px2rem(27px);
border:1px solid RGBA(162, 129, 60, 0.2);
font-size: px2rem(13px);
box-shadow: 0 px2rem(2px) px2rem(3px) RGBA(202, 168, 97, 0.4);
border-radius: px2rem(14px) 0 0 px2rem(14px);
z-index: 101;
.news-info{
color: #A2813C;
position: relative;
display: inline-block;
i{
position: absolute;
right: -(px2rem(6px));
top:px2rem(4px);
display: inline-block;
width: px2rem(4px);
height: px2rem(4px);
border-radius: 100%;
background: #F47A48
}
}
}
.home-topMenu{
width: 100%;
text-align:center;
top:0;
position: absolute;
z-index: 10;
}
.home-header {
height: px2rem(234px); // banner图片变高了
// height: px2rem(210px);
.swiper{
height: 100%;
/* @include bis('../../../images/552064153@2x.png');*/
}
.logo_img{
height: px2rem(85px);
width: px2rem(345px);
text-align: center;
}
}
.home-body{
background: #fff
}
.pathologic-list{
width: 100%;
height: px2rem(52px);
padding: 0 px2rem(15px);
margin-top: px2rem(15px);
.pathologic-item{
float: left;
width: 48%;
box-shadow: 0 px2rem(2px) px2rem(8px) rgba(49, 127, 119, 0.2);
border-radius: px2rem(3px);
background: #fff;
/* padding: px2rem(12px) 0 px2rem(12px) 0;*/
margin-right: 4%;
text-align: center;
.pathologic-icon{
height: px2rem(52px);
/* height: px2rem(20px);*/
img{
width: 100%;
height: px2rem(52px);
padding-bottom: px2rem(8px);
vertical-align: middle;
display: inline-block;
}
}
.pathologic-txt{
font-size: px2rem(14px);
line-height: px2rem(20px);
font-weight: 700;
display: inline-block;
vertical-align: middle;
}
}
.clear{
clear: both;
}
}
</style>
<style lang="scss" scoped>
@import '../../style/mixin.scss';
.lect-selection-content {
position: absolute;
top: px2rem(122px);
z-index: 201;
width: px2rem(375px);
height: 100%;
overflow: auto;
font-size: px2rem(14px);
color: #666666;
margin-right: px2rem(15px);
width: px2rem(360px);
table {
width: 100%;
border-collapse: collapse;
}
&-rp-tb {
padding: px2rem(4px) px2rem(15px);
&-left {
td {
padding-left: px2rem(15px);
border-bottom: 1px solid #F5F6F6;
}
background: #F5F6F6;
}
tr {
height: px2rem(40px);
line-height: px2rem(40px);
}
td {
height: px2rem(40px);
img {
position: relative;
top: px2rem(6px);
left: 0;
width: 20px;
height: 20px;
}
}
&-tb {
td {
padding-left: px2rem(8px);
border-bottom: 1px solid #f0f0f0;
}
}
&-tb-2 {
td {
padding-left: 0;
border-bottom: 1px solid #f0f0f0;
}
table {
width: 96%;
margin: 0 px2rem(15px);
}
}
}
}
.lect-selection {
display: flex;
background: #fff;
flex-direction: row;
&-title {
display: flex;
flex-direction: row;
padding: px2rem(33px) px2rem(15px) px2rem(13px);
width: px2rem(375px);
justify-content: space-between;
font-size: px2rem(13px);
height: px2rem(68px);
// line-height: px2rem(64px);
border-bottom: 1px solid #e7e7e7;
img {
position: relative;
top: px2rem(1px);
left: px2rem(1px);
height: px2rem(25px);
width: px2rem(25px);
}
span {
height: px2rem(18px);
font-size: px2rem(18px);
color: #333;
}
}
}
.group-title {
position: absolute;
top: px2rem(80px);
z-index: 202;
display: flex;
flex-direction: row;
padding: px2rem(4px) px2rem(25px) px2rem(16px);
border-bottom: 1px solid #f0f0f0;
&-order {
display: flex;
flex-direction: row;
width: px2rem(325px);
justify-content: space-between;
font-size: px2rem(13px);
&-item {
span {
font-size: px2rem(15px);
color: #333;
}
img {
position: relative;
top: 0;
left: px2rem(-1px);
height: px2rem(11px);
width: px2rem(11px);
}
}
}
}
.active {
color: #449284 !important;
}
.bg-white {
background: #fff;
}
</style>
......@@ -161,7 +161,6 @@ export default {
orderAction(orderName, isSortUp) {
let orderType = isSortUp ? -1 : 1
let orderData = this.oldParmDataDoctList.slice()
// let orderData = parmDataDoctList
orderData.sort((a, b)=> {
if (!a[orderName] || !b[orderName]) {
return 0
......@@ -175,34 +174,14 @@ export default {
return 0
}
} else if(orderName === 'newTime') {
// if ((new Date(a[orderName].replace(/-/g, "/")).getTime())/1000 > (new Date(b[orderName].replace(/-/g, "/")).getTime())/1000) {
// alert('1: ' + (new Date(a[orderName].replace(/-/g, "/")).getTime())/1000)
// return 1 * orderType
// } else if ( (new Date(a[orderName].replace(/-/g, "/")).getTime())/1000 < (new Date(b[orderName].replace(/-/g, "/")).getTime())/1000) {
// alert('2: ' + (new Date(a[orderName].replace(/-/g, "/")).getTime())/1000)
// return -1 * orderType
// } else {
// alert('3: ' + (new Date(a[orderName].replace(/-/g, "/")).getTime())/1000)
// return 0
// }
// return
// alert('1: ' + (new Date(a[orderName].replace(/-/g, "/")).getTime())/1000 (new Date(b[orderName].replace(/-/g, "/")).getTime())/1000)
// alert(JSON.stringify(a[orderName].replace(/-/g, "/")))
let aTime = (new Date((a[orderName]).replace(/-/g, "/")).getTime())/1000
let bTime = (new Date((b[orderName]).replace(/-/g, "/")).getTime())/1000
if(aTime == bTime) return 0
if(isSortUp) {
if(aTime == bTime) {
return 0
} else {
return aTime > bTime ? 1 : -1
}
} else {
if(aTime == bTime) {
return 0
} else {
return aTime > bTime ? -1 : 1
}
}
} else {
if (a[orderName] > b[orderName]) {
return 1 * orderType
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册