Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
wechatapp.shangjiadao.com
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxuelai
wechatapp.shangjiadao.com
Commits
3f0ac42c
Commit
3f0ac42c
authored
Mar 23, 2020
by
baixian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
打卡数据中心
parent
f060b3c1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
29 deletions
+47
-29
index.js
business/pages/themeindex/index.js
+13
-2
index.wxml
business/pages/themeindex/index.wxml
+1
-1
index.wxs
filter/index.wxs
+26
-26
index.js
utilities/index.js
+7
-0
No files found.
business/pages/themeindex/index.js
View file @
3f0ac42c
...
@@ -36,6 +36,7 @@ import {
...
@@ -36,6 +36,7 @@ import {
LocalStorage
,
LocalStorage
,
copyContent
,
copyContent
,
// deepCopy
// deepCopy
delHtmlBlank
,
}
from
'../../../utilities/index.js'
;
}
from
'../../../utilities/index.js'
;
import
{
import
{
screenshot
screenshot
...
@@ -279,10 +280,20 @@ Page({
...
@@ -279,10 +280,20 @@ Page({
let
_content
=
[];
let
_content
=
[];
try
{
try
{
_content
=
JSON
.
parse
(
data
.
content
);
_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
)
{
}
catch
(
error
)
{
_content
=
[]
_content
=
[]
}
}
console
.
log
(
_content
,
'_content'
);
Object
.
assign
(
this
.
data
,
{
Object
.
assign
(
this
.
data
,
{
noClockTotal
:
Number
(
data
.
not_record_count
||
0
),
noClockTotal
:
Number
(
data
.
not_record_count
||
0
),
hadClockTotal
:
Number
(
data
.
record_count
||
0
),
hadClockTotal
:
Number
(
data
.
record_count
||
0
),
...
@@ -306,7 +317,7 @@ Page({
...
@@ -306,7 +317,7 @@ Page({
noCommentTotal
:
Number
(
data
.
not_review_count
||
0
),
noCommentTotal
:
Number
(
data
.
not_review_count
||
0
),
'remindTips.pushStatus'
:
data
.
subject_status
'remindTips.pushStatus'
:
data
.
subject_status
})
})
console
.
log
(
_content
,
'44444444444'
);
this
.
getCircleDetail
()
this
.
getCircleDetail
()
}
}
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
...
...
business/pages/themeindex/index.wxml
View file @
3f0ac42c
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
</btn-drag>
</btn-drag>
<view class="theme-index-container">
<view class="theme-index-container">
<view class="page-topbg">
<view class="page-topbg">
<view class="top-title">{{params.title}}</view>
<view class="top-title">{{params.title}}</view>
...
...
filter/index.wxs
View file @
3f0ac42c
...
@@ -112,7 +112,7 @@ function formatDateToSecond (date) {
...
@@ -112,7 +112,7 @@ function formatDateToSecond (date) {
}
}
function timeCompare (date) {
function timeCompare (date) {
var startTimestamp = date * 1000;
var startTimestamp = date * 1000;
var nowTimestamp = getDate().getTime();
var nowTimestamp = getDate().getTime();
var oneHourTimestamp = 1 * 60 * 60 * 1000;
var oneHourTimestamp = 1 * 60 * 60 * 1000;
var oneDayTimestamp = 24 * 60 * 60 * 1000;
var oneDayTimestamp = 24 * 60 * 60 * 1000;
var timestampCompare = nowTimestamp - startTimestamp;
var timestampCompare = nowTimestamp - startTimestamp;
...
@@ -128,8 +128,8 @@ function timeCompare (date) {
...
@@ -128,8 +128,8 @@ function timeCompare (date) {
return text
return text
}
}
function bulletTimeCompare (date) {
function bulletTimeCompare (date) {
var startTimestamp = getDate(date).getTime();
var startTimestamp = getDate(date).getTime();
var nowTimestamp = getDate().getTime();
var nowTimestamp = getDate().getTime();
var oneMinuteTimestamp = 60 * 1000;
var oneMinuteTimestamp = 60 * 1000;
var oneHourTimestamp = 1 * 60 * 60 * 1000;
var oneHourTimestamp = 1 * 60 * 60 * 1000;
var oneDayTimestamp = 24 * 60 * 60 * 1000;
var oneDayTimestamp = 24 * 60 * 60 * 1000;
...
@@ -159,7 +159,7 @@ function imagify (src, params) {
...
@@ -159,7 +159,7 @@ function imagify (src, params) {
if (!src) return '';
if (!src) return '';
var _src = src;
var _src = src;
if (src.indexOf('cdn.img.shangjiadao.cn') == -1) {
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){
if(src.indexOf('x-oss-process') != -1){
return _src;
return _src;
...
@@ -174,7 +174,7 @@ function ossVideofy (src) {
...
@@ -174,7 +174,7 @@ function ossVideofy (src) {
if (!src) return '';
if (!src) return '';
var _src = src;
var _src = src;
if (src.indexOf('omedia.shangjiadao.cn') == -1) {
if (src.indexOf('omedia.shangjiadao.cn') == -1) {
_src = 'https://omedia.shangjiadao.cn/' + src;
_src = 'https://omedia.shangjiadao.cn/' + src;
}
}
return _src
return _src
}
}
...
@@ -183,15 +183,15 @@ function transformOssVideofy (src,mode) {
...
@@ -183,15 +183,15 @@ function transformOssVideofy (src,mode) {
var _src = src;
var _src = src;
var _mode = mode;
var _mode = mode;
if(!mode){
if(!mode){
_mode = 'mp4'
_mode = 'mp4'
}
}
if (src.indexOf('media.shangjiadao.cn') == -1) {
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) {
// if (src.indexOf('media.shangjiadao.cn') == -1) {
// _src = 'https://media.shangjiadao.cn/' + src + '.mp4';
// _src = 'https://media.shangjiadao.cn/' + src + '.mp4';
// // _src = 'https://media.shangjiadao.cn/' + src + '_1.m3u8';
// // _src = 'https://media.shangjiadao.cn/' + src + '_1.m3u8';
// }
// }
return _src
return _src
}
}
...
@@ -199,7 +199,7 @@ function transformOssVideofyM3u8 (src) {
...
@@ -199,7 +199,7 @@ function transformOssVideofyM3u8 (src) {
if (!src) return '';
if (!src) return '';
var _src = src;
var _src = src;
if (src.indexOf('media.shangjiadao.cn') == -1) {
if (src.indexOf('media.shangjiadao.cn') == -1) {
_src = 'https://media.shangjiadao.cn/' + src + '.m3u8';
_src = 'https://media.shangjiadao.cn/' + src + '.m3u8';
}
}
return _src
return _src
}
}
...
@@ -211,7 +211,7 @@ function videoPoster (src, params) {
...
@@ -211,7 +211,7 @@ function videoPoster (src, params) {
return src;
return src;
}
}
if (src.indexOf('media.shangjiadao.cn') == -1) {
if (src.indexOf('media.shangjiadao.cn') == -1) {
_src = 'https://media.shangjiadao.cn/' + src + '.jpg';
_src = 'https://media.shangjiadao.cn/' + src + '.jpg';
}
}
if (params) {
if (params) {
_src = _src + '?x-oss-process=' + params;
_src = _src + '?x-oss-process=' + params;
...
@@ -222,7 +222,7 @@ function mediaPng (src, params) {
...
@@ -222,7 +222,7 @@ function mediaPng (src, params) {
if (!src) return '';
if (!src) return '';
var _src = src;
var _src = src;
if (src.indexOf('media.shangjiadao.cn') == -1) {
if (src.indexOf('media.shangjiadao.cn') == -1) {
_src = 'https://media.shangjiadao.cn/' + src;
_src = 'https://media.shangjiadao.cn/' + src;
}
}
if (params) {
if (params) {
_src = _src + '?x-oss-process=' + params;
_src = _src + '?x-oss-process=' + params;
...
@@ -233,7 +233,7 @@ function gifvideoPoster (src, params) {
...
@@ -233,7 +233,7 @@ function gifvideoPoster (src, params) {
if (!src) return '';
if (!src) return '';
var _src = src;
var _src = src;
if (src.indexOf('media.shangjiadao.cn') == -1) {
if (src.indexOf('media.shangjiadao.cn') == -1) {
_src = 'https://media.shangjiadao.cn/' + src + '.gif';
_src = 'https://media.shangjiadao.cn/' + src + '.gif';
}
}
if (params) {
if (params) {
_src = _src + '?x-oss-process=' + params;
_src = _src + '?x-oss-process=' + params;
...
@@ -244,7 +244,7 @@ function jpgvideoPoster (src, params) {
...
@@ -244,7 +244,7 @@ function jpgvideoPoster (src, params) {
if (!src) return '';
if (!src) return '';
var _src = src;
var _src = src;
if (src.indexOf('media.shangjiadao.cn') == -1) {
if (src.indexOf('media.shangjiadao.cn') == -1) {
_src = 'https://media.shangjiadao.cn/' + src + '.jpg';
_src = 'https://media.shangjiadao.cn/' + src + '.jpg';
}
}
if (params) {
if (params) {
_src = _src + '?x-oss-process=' + params;
_src = _src + '?x-oss-process=' + params;
...
@@ -269,7 +269,7 @@ function actionFilter (type) {
...
@@ -269,7 +269,7 @@ function actionFilter (type) {
text = '点评了';
text = '点评了';
break;
break;
default:
default:
break
break
}
}
return text
return text
}
}
...
@@ -343,7 +343,7 @@ function courseFilter (type) {
...
@@ -343,7 +343,7 @@ function courseFilter (type) {
text = '未到';
text = '未到';
break;
break;
default:
default:
break
break
}
}
return text
return text
}
}
...
@@ -363,18 +363,18 @@ function courseColor(type){
...
@@ -363,18 +363,18 @@ function courseColor(type){
case 4:
case 4:
text = '#38E0C9';
text = '#38E0C9';
break;
break;
case 5:
case 5:
text = '#BD9FFF';
text = '#BD9FFF';
break;
break;
case 6:
case 6:
text = '#ffd338';
text = '#ffd338';
break;
break;
case 7:
case 7:
text = '#35c13a';
text = '#35c13a';
break;
break;
default:
default:
text = '#fff'
text = '#fff'
break
break
}
}
return text
return text
}
}
...
@@ -410,7 +410,7 @@ function courseMode(status){
...
@@ -410,7 +410,7 @@ function courseMode(status){
}
}
// 多选 保存id
// 多选 保存id
function checkSelect (subject, subjects) {
function checkSelect (subject, subjects) {
var i = 0, _length = subjects.length;
var i = 0, _length = subjects.length;
var flag = false;
var flag = false;
for (i=0;i < _length; i++) {
for (i=0;i < _length; i++) {
if (subject.id == subjects[i]) {
if (subject.id == subjects[i]) {
...
@@ -420,7 +420,7 @@ function checkSelect (subject, subjects) {
...
@@ -420,7 +420,7 @@ function checkSelect (subject, subjects) {
return flag
return flag
}
}
function checkStudentSelect (subject, subjects) {
function checkStudentSelect (subject, subjects) {
var i = 0, _length = subjects.length;
var i = 0, _length = subjects.length;
var flag = false;
var flag = false;
for (i=0;i < _length; i++) {
for (i=0;i < _length; i++) {
if (subject.student_id == subjects[i]) {
if (subject.student_id == subjects[i]) {
...
@@ -431,7 +431,7 @@ function checkStudentSelect (subject, subjects) {
...
@@ -431,7 +431,7 @@ function checkStudentSelect (subject, subjects) {
}
}
// 多选 保存整个对象
// 多选 保存整个对象
function checkSelectObj (subject, subjects) {
function checkSelectObj (subject, subjects) {
var i = 0, _length = subjects.length;
var i = 0, _length = subjects.length;
var flag = false;
var flag = false;
for (i=0;i < _length; i++) {
for (i=0;i < _length; i++) {
if (subject.id == subjects[i].id) {
if (subject.id == subjects[i].id) {
...
@@ -670,7 +670,7 @@ function numberToCn(num){
...
@@ -670,7 +670,7 @@ function numberToCn(num){
unit = '0万'
unit = '0万'
flag = parseInt(num / 100000)
flag = parseInt(num / 100000)
}
}
return flag + unit + '余'
return flag + unit + '余'
}
}
return num;
return num;
...
@@ -727,5 +727,5 @@ module.exports = {
...
@@ -727,5 +727,5 @@ module.exports = {
numberToCn: numberToCn,
numberToCn: numberToCn,
formatClueFrom: formatClueFrom,
formatClueFrom: formatClueFrom,
formatClueStatus: formatClueStatus,
formatClueStatus: formatClueStatus,
jsonStringify: jsonStringify
jsonStringify: jsonStringify,
}
}
\ No newline at end of file
utilities/index.js
View file @
3f0ac42c
...
@@ -540,6 +540,12 @@ function deepCopy (obj, cache = []) {
...
@@ -540,6 +540,12 @@ function deepCopy (obj, cache = []) {
return
copy
return
copy
}
}
// 删除空格
function
delHtmlBlank
(
str
)
{
var
str
=
str
.
replace
(
/<
\/?[^
>
]
*>/gim
,
""
);
//去掉所有的html标记
var
result
=
str
.
replace
(
/
(
^
\s
+
)
|
(\s
+$
)
/g
,
""
);
//去掉前后空格
return
result
.
replace
(
/
\s
/g
,
""
);
//去除文章中间空格
}
export
{
export
{
encode
,
encode
,
decode
,
decode
,
...
@@ -570,4 +576,5 @@ export {
...
@@ -570,4 +576,5 @@ export {
transformOssVideofy
,
transformOssVideofy
,
deepCopy
,
deepCopy
,
newScenQueryGet
,
newScenQueryGet
,
delHtmlBlank
,
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment