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

代码整理

上级 2c105cc5
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
<div class="back-btn" @click="backTop"> <div class="back-btn" @click="backTop">
<img src="../../images/backTop.png"/> <img src="../../images/backTop.png"/>
</div> </div>
</section> </section>
</template> </template>
...@@ -31,21 +30,16 @@ ...@@ -31,21 +30,16 @@
} }
} }
}, },
methods: { methods: {
backTop:function(){ backTop:function(){
if(this.burialPoint == 'activity'){ if(this.burialPoint == 'activity'){
this.pageBurialPoin(this.objPoint); this.pageBurialPoin(this.objPoint);
} }
var osTop = document.documentElement.scrollTop || document.body.scrollTop; var osTop = document.documentElement.scrollTop || document.body.scrollTop;
if(osTop > 0){ if(osTop > 0){
document.documentElement.scrollTop = document.body.scrollTop = 0; document.documentElement.scrollTop = document.body.scrollTop = 0;
} }
} }
}, },
} }
</script> </script>
...@@ -64,8 +58,6 @@ ...@@ -64,8 +58,6 @@
height: 100%; height: 100%;
display: block; display: block;
} }
} }
</style> </style>
...@@ -38,13 +38,6 @@ export default { ...@@ -38,13 +38,6 @@ export default {
default: false default: false
} }
}, },
watch: {
// searchFix:function(n){
// if(n){
// alert(this.searchFix)
// }
// }
},
created() { created() {
let _this = this; let _this = this;
window.__getStatusBarHeight = function(parm) { window.__getStatusBarHeight = function(parm) {
...@@ -56,7 +49,6 @@ export default { ...@@ -56,7 +49,6 @@ export default {
_this.ptop = _this.popHeight + "px"; _this.ptop = _this.popHeight + "px";
_this.bPtop = _this.popHeight + 2 + "px" _this.bPtop = _this.popHeight + 2 + "px"
_this.menuptop = _this.popHeight + "px"; _this.menuptop = _this.popHeight + "px";
// alert(parm.statusBarHeight);
}; };
this.getStatusHight(); this.getStatusHight();
}, },
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</span> </span>
</div> </div>
<span class="disp-blc lect-ks">{{item.department}}</span> <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> </div>
</div> </div>
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
</template> </template>
<script> <script>
// import { setEventByModuleCode } from '@/utils/index'
import { teacher } from '../../utils/buryingPoint'; import { teacher } from '../../utils/buryingPoint';
export default { export default {
data() { data() {
...@@ -47,7 +46,6 @@ export default { ...@@ -47,7 +46,6 @@ export default {
} }
}, },
methods: { methods: {
// 跳转到详情页面 // 跳转到详情页面
gotoDetail(item){ gotoDetail(item){
this.$router.push({ this.$router.push({
...@@ -62,7 +60,6 @@ export default { ...@@ -62,7 +60,6 @@ export default {
labelValue: item.doctorName labelValue: item.doctorName
}) })
}, },
//热门讲师 //热门讲师
getData(){ getData(){
let _this = this, let _this = this,
......
...@@ -72,23 +72,12 @@ export default { ...@@ -72,23 +72,12 @@ export default {
default: true default: true
} }
}, },
computed: {
// ...mapGetters({
// orderNum: 'orderNum'
// })
},
watch: {
// orderNum(val) {
// this.showOrderIndex = 1
// }
},
methods: { methods: {
toggle() { toggle() {
this.showTitle = !showTitle this.showTitle = !showTitle
this.showOrder = !showOrder this.showOrder = !showOrder
}, },
order(index, orderType, orderName) { order(index, orderType, orderName) {
console.log(index, orderType, orderName)
this.showOrderIndex = index this.showOrderIndex = index
this[orderType] = !this[orderType] this[orderType] = !this[orderType]
this.$emit('order', orderName, this[orderType]) this.$emit('order', orderName, this[orderType])
...@@ -96,9 +85,6 @@ export default { ...@@ -96,9 +85,6 @@ export default {
reset() { reset() {
this.showOrderIndex = 1 this.showOrderIndex = 1
} }
// resetShowOrderIndex(){
// this.showOrderIndex = 1
// }
} }
} }
</script> </script>
......
...@@ -233,7 +233,6 @@ export default { ...@@ -233,7 +233,6 @@ export default {
// 寻找数据最大值,用于定义表格高度 // 寻找数据最大值,用于定义表格高度
getMaxRowNum(orginAreaList) { getMaxRowNum(orginAreaList) {
console.log(orginAreaList)
let maxRowNum = orginAreaList.length || 31 let maxRowNum = orginAreaList.length || 31
orginAreaList.forEach((element, index) => { orginAreaList.forEach((element, index) => {
// if (element.length > maxRowNum){ // if (element.length > maxRowNum){
...@@ -247,7 +246,6 @@ export default { ...@@ -247,7 +246,6 @@ export default {
// 处理区域数据 // 处理区域数据
handleAreaData (orginAreaList) { handleAreaData (orginAreaList) {
let handleList = [], maxRowNum = this.getMaxRowNum(orginAreaList); let handleList = [], maxRowNum = this.getMaxRowNum(orginAreaList);
console.log(maxRowNum)
orginAreaList.forEach((element, index) => { orginAreaList.forEach((element, index) => {
// debugger // debugger
if( index === 0 ){ if( index === 0 ){
...@@ -263,7 +261,6 @@ export default { ...@@ -263,7 +261,6 @@ export default {
for (let i = orginAreaList.length; i < maxRowNum; i++) { for (let i = orginAreaList.length; i < maxRowNum; i++) {
handleList.push({id:'',name:'',cities: []}) handleList.push({id:'',name:'',cities: []})
} }
console.log('handleList: ', handleList)
return handleList return handleList
}, },
...@@ -582,9 +579,6 @@ export default { ...@@ -582,9 +579,6 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../../style/mixin'; @import '../../style/mixin';
.lect-selection-content { .lect-selection-content {
// position: absolute;
// top: px2rem(122px);
// z-index: 201;
width: px2rem(375px); width: px2rem(375px);
height: 81%; height: 81%;
overflow: auto; overflow: auto;
...@@ -593,7 +587,6 @@ export default { ...@@ -593,7 +587,6 @@ export default {
margin-right: px2rem(15px); margin-right: px2rem(15px);
width: px2rem(360px); width: px2rem(360px);
-webkit-overflow-scrolling : touch; -webkit-overflow-scrolling : touch;
// overflow-scrolling : touch;
overflow: auto; overflow: auto;
table { table {
width: 100%; width: 100%;
...@@ -653,7 +646,6 @@ export default { ...@@ -653,7 +646,6 @@ export default {
justify-content: space-between; justify-content: space-between;
font-size: px2rem(13px); font-size: px2rem(13px);
height: px2rem(68px); height: px2rem(68px);
// line-height: px2rem(64px);
border-bottom: 1px solid #e7e7e7; border-bottom: 1px solid #e7e7e7;
img { img {
position: relative; position: relative;
...@@ -663,18 +655,13 @@ export default { ...@@ -663,18 +655,13 @@ export default {
width: px2rem(25px); width: px2rem(25px);
} }
span { span {
// height: px2rem(18px);
font-size: px2rem(18px); font-size: px2rem(18px);
color: #333; color: #333;
} }
} }
} }
.group-title { .group-title {
// position: absolute;
// top: px2rem(80px);
// z-index: 202;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
padding: px2rem(16px) px2rem(25px) px2rem(16px); padding: px2rem(16px) px2rem(25px) px2rem(16px);
......
...@@ -38,14 +38,8 @@ export default { ...@@ -38,14 +38,8 @@ export default {
} }
}, },
computed: { computed: {
// ...mapGetters({
// // orderNum: 'orderNum'
// })
}, },
watch: { watch: {
// orderNum(val) {
// this.showOrderIndex = 1
// }
}, },
methods: { methods: {
selectedType(index) { selectedType(index) {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
@click="gotoDetail(item)"> @click="gotoDetail(item)">
<div class="tea-img" :style="'background:'+ item.bgColor"> <div class="tea-img" :style="'background:'+ item.bgColor">
<img :src="item.doctorAvatarImg"> <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-cnum">课程: 共{{item.resourceNum}}</span>
<!-- <span class="learn-p">{{item.joinNum | yLocalString}}人已学</span> --> <!-- <span class="learn-p">{{item.joinNum | yLocalString}}人已学</span> -->
</div> </div>
...@@ -61,17 +61,8 @@ export default { ...@@ -61,17 +61,8 @@ export default {
} }
}, },
mounted() { mounted() {
// window.__refresh = function (parm) {
// _this.getData();
// }
// window.addEventListener('scroll', this.handleScroll)
}, },
computed: { computed: {
...mapGetters({
// cSearchText: 'cSearchText',
// userInfo: 'userInfo',
}),
cParamData() { cParamData() {
if (this.parmData && this.parmData.length) { if (this.parmData && this.parmData.length) {
return this.randomBg(this.parmData) return this.randomBg(this.parmData)
...@@ -80,8 +71,6 @@ export default { ...@@ -80,8 +71,6 @@ export default {
} }
} }
}, },
watch: {
},
methods: { methods: {
// 跳转到详情页面 // 跳转到详情页面
gotoDetail(item){ gotoDetail(item){
......
...@@ -54,9 +54,6 @@ export default { ...@@ -54,9 +54,6 @@ export default {
} }
}, },
mounted(){ mounted(){
// console.log(this.isShare);
console.log(shareUrl);
console.log(`${shareUrl}`+'?doctorId='+this.doctorId)
}, },
methods:{ methods:{
// backPre(){ // backPre(){
......
...@@ -7,13 +7,19 @@ const mixins = require('@/utils/mixins'); ...@@ -7,13 +7,19 @@ const mixins = require('@/utils/mixins');
import '@/utils/rem' // 引入自适应 import '@/utils/rem' // 引入自适应
import '@/utils/yqyServerRegister' // 移动端服务 import '@/utils/yqyServerRegister' // 移动端服务
import FastClick from 'fastclick' import FastClick from 'fastclick'
import Logger from './plugins/logger' // 日志插件 // import Logger from './plugins/logger' // 日志插件
import Swiper from './plugins/swiper.min.js' // 日志插件 // import Swiper from './plugins/swiper.min.js'
// 引入Mint // 引入Mint
import Mint from 'mint-ui' import Mint from 'mint-ui'
import 'mint-ui/lib/style.css' 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' import VueLazyload from 'vue-lazyload'
Vue.use(VueLazyload, { Vue.use(VueLazyload, {
preLoad: 3, preLoad: 3,
...@@ -32,22 +38,6 @@ Vue.filter('yLocalString', function(value){ ...@@ -32,22 +38,6 @@ Vue.filter('yLocalString', function(value){
var r = len % 3; 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(","); 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) { if ('addEventListener' in document) {
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
......
...@@ -11,7 +11,6 @@ const service = axios.create({ ...@@ -11,7 +11,6 @@ const service = axios.create({
// request拦截器 // request拦截器
service.interceptors.request.use(config => { service.interceptors.request.use(config => {
// console.log('config: ', config, config.data.setEntry)
if (config.data && config.data.setEntry) { if (config.data && config.data.setEntry) {
config.headers['sysCode'] = config.data.sysCode || 10 config.headers['sysCode'] = config.data.sysCode || 10
if(config.data.token){ if(config.data.token){
...@@ -19,14 +18,7 @@ service.interceptors.request.use(config => { ...@@ -19,14 +18,7 @@ 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' }) 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 return config
}, error => { }, error => {
logger.debug('service.interceptors.request: ', error) logger.debug('service.interceptors.request: ', error)
......
...@@ -18,12 +18,6 @@ export function setEventByModuleCode(itemData){ ...@@ -18,12 +18,6 @@ export function setEventByModuleCode(itemData){
let path = paramList[0]['key']; let path = paramList[0]['key'];
let v = paramList[0]['value']; let v = paramList[0]['value'];
let query = setRouterParm(paramList); let query = setRouterParm(paramList);
//console.log(Vue);
// this.$router.push({
// path: v,
// query:query
// })
} }
if(typeof paramList === 'string' && !paramList){ if(typeof paramList === 'string' && !paramList){
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 = { ...@@ -34,28 +34,7 @@ module.exports = {
} }
return '' 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){ pageBurialPoin(options){
rocNative.appBuryingPointEntrust(options) rocNative.appBuryingPointEntrust(options)
}, },
...@@ -136,7 +115,6 @@ module.exports = { ...@@ -136,7 +115,6 @@ module.exports = {
}, },
setEventByModuleCode(itemData){ setEventByModuleCode(itemData){
console.log(itemData);
let modeCode = itemData.appModuleInfo.code || ''; let modeCode = itemData.appModuleInfo.code || '';
let paramList = itemData.appModuleInfo.paramList ? itemData.appModuleInfo.paramList : '' let paramList = itemData.appModuleInfo.paramList ? itemData.appModuleInfo.paramList : ''
...@@ -169,7 +147,6 @@ module.exports = { ...@@ -169,7 +147,6 @@ module.exports = {
if(typeof paramList === 'string' && !paramList){ if(typeof paramList === 'string' && !paramList){
paramList = [] paramList = []
} }
console.log(paramList);
return paramList; return paramList;
}, },
......
...@@ -21,11 +21,7 @@ ...@@ -21,11 +21,7 @@
</template> </template>
<script> <script>
// import { setEventByModuleCode } from '@/utils/index'
// import TopNav from '../../components/common/topNav';
import TopNav from '../../components/teacher/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 BackTop from '../../components/teacher/backTop';
import {activity_action} from '../../utils/buryingPoint'; import {activity_action} from '../../utils/buryingPoint';
import { deepCopy } from '../../utils'; import { deepCopy } from '../../utils';
...@@ -55,7 +51,6 @@ export default { ...@@ -55,7 +51,6 @@ export default {
let _this = this; let _this = this;
this.id = this.$route.query.categoryId || 1 this.id = this.$route.query.categoryId || 1
this.navTitle = this.id == 1 ? '专项合作' : '活动掠影' this.navTitle = this.id == 1 ? '专项合作' : '活动掠影'
// this.token = this.$route.query.userToken || this.$route.query.token
window.__getUserInfo = function(parm){ window.__getUserInfo = function(parm){
_this.token = parm.userToken _this.token = parm.userToken
_this.getTabData() _this.getTabData()
......
...@@ -77,7 +77,6 @@ ...@@ -77,7 +77,6 @@
</template> </template>
<script> <script>
// import teacherTop from '../../components/teachers/teach-top';
import teacherTop from '../../components/teacher/teach-top'; import teacherTop from '../../components/teacher/teach-top';
import {teacher,teacher_info_collect} from '../../utils/buryingPoint'; import {teacher,teacher_info_collect} from '../../utils/buryingPoint';
export default { export default {
...@@ -207,34 +206,7 @@ export default { ...@@ -207,34 +206,7 @@ export default {
}) })
// this.$emit('collect',val,this.resourceData.item[val].favorFlag,id,name) // 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) { appBuryingPointEntrust(val) {
rocNative.appBuryingPointEntrust(val) rocNative.appBuryingPointEntrust(val)
...@@ -303,11 +275,9 @@ export default { ...@@ -303,11 +275,9 @@ export default {
studyCount:res.data.studyCount, studyCount:res.data.studyCount,
doctor:res.data.doctor doctor:res.data.doctor
} }
} }
}) })
} }
} }
} }
......
此差异已折叠。
...@@ -161,7 +161,6 @@ export default { ...@@ -161,7 +161,6 @@ export default {
orderAction(orderName, isSortUp) { orderAction(orderName, isSortUp) {
let orderType = isSortUp ? -1 : 1 let orderType = isSortUp ? -1 : 1
let orderData = this.oldParmDataDoctList.slice() let orderData = this.oldParmDataDoctList.slice()
// let orderData = parmDataDoctList
orderData.sort((a, b)=> { orderData.sort((a, b)=> {
if (!a[orderName] || !b[orderName]) { if (!a[orderName] || !b[orderName]) {
return 0 return 0
...@@ -175,33 +174,13 @@ export default { ...@@ -175,33 +174,13 @@ export default {
return 0 return 0
} }
} else if(orderName === 'newTime') { } 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 aTime = (new Date((a[orderName]).replace(/-/g, "/")).getTime())/1000
let bTime = (new Date((b[orderName]).replace(/-/g, "/")).getTime())/1000 let bTime = (new Date((b[orderName]).replace(/-/g, "/")).getTime())/1000
if(aTime == bTime) return 0
if(isSortUp) { if(isSortUp) {
if(aTime == bTime) { return aTime > bTime ? 1 : -1
return 0
} else {
return aTime > bTime ? 1 : -1
}
} else { } else {
if(aTime == bTime) { return aTime > bTime ? -1 : 1
return 0
} else {
return aTime > bTime ? -1 : 1
}
} }
} else { } else {
if (a[orderName] > b[orderName]) { if (a[orderName] > b[orderName]) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册