Commit 3f0ac42c authored by baixian's avatar baixian

打卡数据中心

parent f060b3c1
......@@ -36,6 +36,7 @@ import {
LocalStorage,
copyContent,
// deepCopy
delHtmlBlank,
} from '../../../utilities/index.js';
import {
screenshot
......@@ -279,10 +280,20 @@ Page({
let _content = [];
try {
_content = JSON.parse(data.content);
if (_content.length>0){
_content.forEach((item)=> {
switch (item.type) {
case 'text':
item.value = delHtmlBlank(item.value);
break;
default:
break;
}
})
}
} catch (error) {
_content = []
}
console.log(_content, '_content');
Object.assign(this.data, {
noClockTotal: Number(data.not_record_count || 0),
hadClockTotal: Number(data.record_count || 0),
......@@ -306,7 +317,7 @@ Page({
noCommentTotal: Number(data.not_review_count || 0),
'remindTips.pushStatus': data.subject_status
})
console.log(_content, '44444444444');
this.getCircleDetail()
}
}).catch((err) => {
......
......@@ -10,7 +10,7 @@
</btn-drag>
<view class="theme-index-container">
<view class="page-topbg">
<view class="top-title">{{params.title}}</view>
......
......@@ -112,7 +112,7 @@ function formatDateToSecond (date) {
}
function timeCompare (date) {
var startTimestamp = date * 1000;
var nowTimestamp = getDate().getTime();
var nowTimestamp = getDate().getTime();
var oneHourTimestamp = 1 * 60 * 60 * 1000;
var oneDayTimestamp = 24 * 60 * 60 * 1000;
var timestampCompare = nowTimestamp - startTimestamp;
......@@ -128,8 +128,8 @@ function timeCompare (date) {
return text
}
function bulletTimeCompare (date) {
var startTimestamp = getDate(date).getTime();
var nowTimestamp = getDate().getTime();
var startTimestamp = getDate(date).getTime();
var nowTimestamp = getDate().getTime();
var oneMinuteTimestamp = 60 * 1000;
var oneHourTimestamp = 1 * 60 * 60 * 1000;
var oneDayTimestamp = 24 * 60 * 60 * 1000;
......@@ -159,7 +159,7 @@ function imagify (src, params) {
if (!src) return '';
var _src = src;
if (src.indexOf('cdn.img.shangjiadao.cn') == -1) {
_src = 'https://cdn.img.shangjiadao.cn/' + src;
_src = 'https://cdn.img.shangjiadao.cn/' + src;
}
if(src.indexOf('x-oss-process') != -1){
return _src;
......@@ -174,7 +174,7 @@ function ossVideofy (src) {
if (!src) return '';
var _src = src;
if (src.indexOf('omedia.shangjiadao.cn') == -1) {
_src = 'https://omedia.shangjiadao.cn/' + src;
_src = 'https://omedia.shangjiadao.cn/' + src;
}
return _src
}
......@@ -183,15 +183,15 @@ function transformOssVideofy (src,mode) {
var _src = src;
var _mode = mode;
if(!mode){
_mode = 'mp4'
_mode = 'mp4'
}
if (src.indexOf('media.shangjiadao.cn') == -1) {
_src = 'https://media.shangjiadao.cn/' + src + '.' + _mode;
_src = 'https://media.shangjiadao.cn/' + src + '.' + _mode;
}
// if (src.indexOf('media.shangjiadao.cn') == -1) {
// _src = 'https://media.shangjiadao.cn/' + src + '.mp4';
// // _src = 'https://media.shangjiadao.cn/' + src + '_1.m3u8';
// _src = 'https://media.shangjiadao.cn/' + src + '.mp4';
// // _src = 'https://media.shangjiadao.cn/' + src + '_1.m3u8';
// }
return _src
}
......@@ -199,7 +199,7 @@ function transformOssVideofyM3u8 (src) {
if (!src) return '';
var _src = src;
if (src.indexOf('media.shangjiadao.cn') == -1) {
_src = 'https://media.shangjiadao.cn/' + src + '.m3u8';
_src = 'https://media.shangjiadao.cn/' + src + '.m3u8';
}
return _src
}
......@@ -211,7 +211,7 @@ function videoPoster (src, params) {
return src;
}
if (src.indexOf('media.shangjiadao.cn') == -1) {
_src = 'https://media.shangjiadao.cn/' + src + '.jpg';
_src = 'https://media.shangjiadao.cn/' + src + '.jpg';
}
if (params) {
_src = _src + '?x-oss-process=' + params;
......@@ -222,7 +222,7 @@ function mediaPng (src, params) {
if (!src) return '';
var _src = src;
if (src.indexOf('media.shangjiadao.cn') == -1) {
_src = 'https://media.shangjiadao.cn/' + src;
_src = 'https://media.shangjiadao.cn/' + src;
}
if (params) {
_src = _src + '?x-oss-process=' + params;
......@@ -233,7 +233,7 @@ function gifvideoPoster (src, params) {
if (!src) return '';
var _src = src;
if (src.indexOf('media.shangjiadao.cn') == -1) {
_src = 'https://media.shangjiadao.cn/' + src + '.gif';
_src = 'https://media.shangjiadao.cn/' + src + '.gif';
}
if (params) {
_src = _src + '?x-oss-process=' + params;
......@@ -244,7 +244,7 @@ function jpgvideoPoster (src, params) {
if (!src) return '';
var _src = src;
if (src.indexOf('media.shangjiadao.cn') == -1) {
_src = 'https://media.shangjiadao.cn/' + src + '.jpg';
_src = 'https://media.shangjiadao.cn/' + src + '.jpg';
}
if (params) {
_src = _src + '?x-oss-process=' + params;
......@@ -269,7 +269,7 @@ function actionFilter (type) {
text = '点评了';
break;
default:
break
break
}
return text
}
......@@ -343,7 +343,7 @@ function courseFilter (type) {
text = '未到';
break;
default:
break
break
}
return text
}
......@@ -363,18 +363,18 @@ function courseColor(type){
case 4:
text = '#38E0C9';
break;
case 5:
case 5:
text = '#BD9FFF';
break;
case 6:
case 6:
text = '#ffd338';
break;
case 7:
case 7:
text = '#35c13a';
break;
default:
text = '#fff'
break
break
}
return text
}
......@@ -410,7 +410,7 @@ function courseMode(status){
}
// 多选 保存id
function checkSelect (subject, subjects) {
var i = 0, _length = subjects.length;
var i = 0, _length = subjects.length;
var flag = false;
for (i=0;i < _length; i++) {
if (subject.id == subjects[i]) {
......@@ -420,7 +420,7 @@ function checkSelect (subject, subjects) {
return flag
}
function checkStudentSelect (subject, subjects) {
var i = 0, _length = subjects.length;
var i = 0, _length = subjects.length;
var flag = false;
for (i=0;i < _length; i++) {
if (subject.student_id == subjects[i]) {
......@@ -431,7 +431,7 @@ function checkStudentSelect (subject, subjects) {
}
// 多选 保存整个对象
function checkSelectObj (subject, subjects) {
var i = 0, _length = subjects.length;
var i = 0, _length = subjects.length;
var flag = false;
for (i=0;i < _length; i++) {
if (subject.id == subjects[i].id) {
......@@ -670,7 +670,7 @@ function numberToCn(num){
unit = '0万'
flag = parseInt(num / 100000)
}
return flag + unit + '余'
}
return num;
......@@ -727,5 +727,5 @@ module.exports = {
numberToCn: numberToCn,
formatClueFrom: formatClueFrom,
formatClueStatus: formatClueStatus,
jsonStringify: jsonStringify
}
\ No newline at end of file
jsonStringify: jsonStringify,
}
......@@ -540,6 +540,12 @@ function deepCopy (obj, cache = []) {
return copy
}
// 删除空格
function delHtmlBlank(str) {
var str = str.replace(/<\/?[^>]*>/gim, "");//去掉所有的html标记
var result = str.replace(/(^\s+)|(\s+$)/g, "");//去掉前后空格
return result.replace(/\s/g, "");//去除文章中间空格
}
export {
encode,
decode,
......@@ -570,4 +576,5 @@ export {
transformOssVideofy,
deepCopy,
newScenQueryGet,
delHtmlBlank,
}
\ No newline at end of file
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