Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
national_museum_vod-H5
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
fubaole
national_museum_vod-H5
Commits
f857ef34
Commit
f857ef34
authored
Apr 14, 2021
by
乐宝呗666
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加必填星号展示
parent
a0bcb34d
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
187 additions
and
191 deletions
+187
-191
index.js
src/router/index.js
+1
-5
admin.vue
src/views/user/admin.vue
+4
-13
commit.vue
src/views/user/commit.vue
+2
-10
adminInfo.vue
src/views/user/components/adminInfo.vue
+7
-2
commitTab.vue
src/views/user/components/commitTab.vue
+51
-51
historyTab.vue
src/views/user/components/historyTab.vue
+117
-99
learnDetail.vue
src/views/user/components/learnDetail.vue
+4
-1
editPsd.vue
src/views/user/editPsd.vue
+0
-9
learn.vue
src/views/user/learn.vue
+1
-1
No files found.
src/router/index.js
View file @
f857ef34
...
...
@@ -75,14 +75,10 @@ const routes = [
},
]
function
getAbsolutePath
()
{
let
path
=
location
.
pathname
return
path
.
substring
(
0
,
path
.
lastIndexOf
(
'/'
)
+
1
)
}
const
router
=
new
VueRouter
({
routes
:
routes
,
mode
:
"history"
,
base
:
getAbsolutePath
()
base
:
process
.
env
.
BASE_URL
})
const
whiteList
=
[
'/login'
,
'/success'
,
'/screen'
]
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
...
...
src/views/user/admin.vue
View file @
f857ef34
...
...
@@ -63,19 +63,10 @@ export default {
});
},
goDetail
(
item
)
{
if
(
item
.
id
===
this
.
currentUserId
)
{
// 修改页面
this
.
$router
.
push
({
path
:
"/adminInfo"
,
query
:
{
id
:
item
.
id
,
disabled
:
false
},
});
}
else
{
// 详情页面
this
.
$router
.
push
({
path
:
"/adminInfo"
,
query
:
{
id
:
item
.
id
,
disabled
:
true
},
});
}
this
.
$router
.
push
({
path
:
"/adminInfo"
,
query
:
{
id
:
item
.
id
,
disabled
:
item
.
id
!==
this
.
currentUserId
},
});
},
},
};
...
...
src/views/user/commit.vue
View file @
f857ef34
...
...
@@ -5,7 +5,7 @@
<van-tabs
type=
"card"
v-model=
"activeTab"
>
<van-tab
title=
"观影互动"
>
<div
class=
"commit-page"
>
<commit-tab
@
updateActive=
"updateActive"
/>
<commit-tab
/>
</div>
</van-tab>
<van-tab
title=
"互动历史"
>
...
...
@@ -32,18 +32,10 @@ export default {
data
()
{
return
{
activeTab
:
1
,
form
:
{},
show
:
false
,
fileList
:
[],
imgFileList
:
[],
};
},
mounted
()
{},
methods
:
{
updateActive
(
active
)
{
this
.
activeTab
=
active
;
},
},
methods
:
{},
};
</
script
>
...
...
src/views/user/components/adminInfo.vue
View file @
f857ef34
<
template
>
<div
class=
"admin-detail-content"
>
<Header
title=
"管理员详情"
/>
<van-form
validate-first
ref=
'form'
@
submit=
"onSubmit"
>
<van-form
@
submit=
"onSubmit"
>
<div
class=
"input-box"
>
<van-field
required
label=
"管理员姓名"
:disabled=
"disabled"
v-model=
"form.userName"
...
...
@@ -15,6 +16,7 @@
]"
/>
<van-field
required
label=
"手机号码"
:disabled=
"disabled"
v-model=
"form.phone"
...
...
@@ -150,7 +152,6 @@ export default {
<
style
lang=
"scss"
scoped
>
.admin-detail-content
{
padding
:
50px
24px
0
;
// height: calc(100% - 150px);
overflow-y
:
auto
;
.input-box
{
padding-bottom
:
32px
;
...
...
@@ -194,6 +195,10 @@ export default {
width
:
100%
;
}
}
::v-deep
.van-cell--required
::before
{
left
:
-10px
;
color
:
#A4151D
;
}
.van-field__control
,
.van-cell__value
{
color
:
#333
;
...
...
src/views/user/components/commitTab.vue
View file @
f857ef34
...
...
@@ -9,6 +9,7 @@
class=
"field-form-item"
readonly
clickable
required
name=
"boardName"
input-align=
"right"
:value=
"form.boardName"
...
...
@@ -37,6 +38,7 @@
class=
"field-form-item"
readonly
clickable
required
name=
"studyTime"
input-align=
"right"
:value=
"form.studyTime || ''"
...
...
@@ -57,6 +59,7 @@
/>
</van-popup>
<van-field
required
label=
"观影人数"
v-model=
"form.num"
placeholder=
"请输入观影人数"
...
...
@@ -64,6 +67,7 @@
:rules=
"[
{ pattern: /^[1-9]\d{0,9}$/, message: '请输入正确内容,最多10位数',trigger:'blur'}]"
/>
<van-field
required
label=
"管理员账号"
v-model=
"form.name"
placeholder=
"请输入管理员账号"
...
...
@@ -71,6 +75,7 @@
:rules=
"[
{ required: true }]"
/>
<van-field
required
type=
"password"
label=
"管理员密码"
v-model=
"form.password"
...
...
@@ -141,6 +146,7 @@
</div>
<div
class=
"field-content"
>
<van-field
required
class=
"field-textarea"
type=
"textarea"
v-model=
"form.content"
...
...
@@ -207,20 +213,6 @@ export default {
this
.
form
.
boardId
=
this
.
boardList
[
index
].
id
;
this
.
showBoard
=
false
;
},
beforeVideo
(
file
)
{
let
isOver
=
true
if
(
Array
.
isArray
(
file
)){
isOver
=
file
.
every
(
item
=>
item
<=
10
*
1024
*
1024
)
}
else
{
isOver
=
file
.
size
<=
10
*
1024
*
1024
}
if
(
!
isOver
){
this
.
$toast
.
fail
(
"上传文件大小不能超过 10MB"
);
return
false
}
else
{
return
true
}
},
// 打开日历
onDisplay
()
{
this
.
show
=
true
;
...
...
@@ -328,6 +320,21 @@ export default {
console
.
log
(
err
);
});
},
// 上传视频size限制
beforeVideo
(
file
)
{
let
isOver
=
true
if
(
Array
.
isArray
(
file
)){
isOver
=
file
.
every
(
item
=>
item
<=
10
*
1024
*
1024
)
}
else
{
isOver
=
file
.
size
<=
10
*
1024
*
1024
}
if
(
!
isOver
){
this
.
$toast
.
fail
(
"上传文件大小不能超过 10MB"
);
return
false
}
else
{
return
true
}
},
// 删除视频
async
deleteVideo
(
file
,
detail
){
this
.
form
.
videos
.
splice
(
detail
.
index
,
1
)
...
...
@@ -408,7 +415,6 @@ export default {
param
.
images
=
[...
param
.
images
,
...
param
.
videos
];
param
.
images
=
param
.
images
.
join
(
","
);
delete
param
.
videos
;
console
.
log
(
param
);
vm
.
$https
(
{
url
:
"interaction/add"
,
...
...
@@ -459,6 +465,32 @@ export default {
}
.field-content
{
padding-bottom
:
32px
;
.upload-content
{
.avatar-plus
{
width
:
48px
;
height
:
48px
;
line-height
:
48px
;
text-align
:
center
;
background-color
:
#f5f5f5
;
border-radius
:
1px
;
font-size
:
25px
;
color
:
#999
;
margin-bottom
:
12px
;
}
.tips
{
img
{
width
:
12px
;
height
:
12px
;
vertical-align
:
middle
;
}
span
{
margin-left
:
4px
;
color
:
#666
;
font-size
:
12px
;
vertical-align
:
middle
;
}
}
}
}
.input-box
{
padding-bottom
:
32px
;
...
...
@@ -472,16 +504,6 @@ export default {
display
:
none
;
}
}
.calendar-icon
{
.van-icon
{
position
:
absolute
;
width
:
20px
;
height
:
20px
;
right
:
0
;
bottom
:
22px
;
z-index
:
2
;
}
}
.commit-page-button
{
position
:
fixed
;
bottom
:
50px
;
...
...
@@ -522,32 +544,10 @@ export default {
padding
:
0
;
}
}
.upload-content
{
.avatar-plus
{
width
:
48px
;
height
:
48px
;
line-height
:
48px
;
text-align
:
center
;
background-color
:
#f5f5f5
;
border-radius
:
1px
;
font-size
:
25px
;
color
:
#999
;
margin-bottom
:
12px
;
}
.tips
{
img
{
width
:
12px
;
height
:
12px
;
vertical-align
:
middle
;
}
span
{
margin-left
:
4px
;
color
:
#666
;
font-size
:
12px
;
vertical-align
:
middle
;
}
}
::v-deep
.van-cell--required
::before
{
left
:
-10px
;
color
:
#A4151D
;
}
}
</
style
>
\ No newline at end of file
src/views/user/components/historyTab.vue
View file @
f857ef34
...
...
@@ -8,25 +8,32 @@
@
load=
"onLoad"
offset=
"50"
>
<van-cell
v-for=
"(item,index) in tableData"
:key=
"index"
>
<van-cell
v-for=
"(item,
index) in tableData"
:key=
"index"
>
<div
class=
"field-title"
>
<span>
{{
item
.
createTime
}}
</span>
<span>
{{
item
.
createTime
}}
</span>
</div>
<van-collapse
v-model=
"activeNames"
>
<van-collapse-item
:name=
"item.id"
>
<template
#
title
>
<div>
{{
item
.
boardName
}}
<span
class=
"author"
>
{{
item
.
username
}}
</span>
<div>
{{
item
.
boardName
}}
<span
class=
"author"
>
{{
item
.
username
}}
</span>
</div>
</
template
>
<div
class=
"content"
>
<div
class=
"learnvideo"
>
<div
class=
"learn-title"
>
学习视频
</div>
<div
class=
"learn-body"
v-if=
"item.videos.length"
>
<span
v-for=
"(s,i) in item.videos"
:key=
"i"
>
<video
controls
width=
'100%'
height=
'100%'
poster=
"@/assets/images/applets/video.png"
>
<source
:src=
"s"
/>
</video>
<!-- autoplay="autoplay"
<div
class=
"learnvideo"
>
<div
class=
"learn-title"
>
学习视频
</div>
<div
class=
"learn-body"
v-if=
"item.videos.length"
>
<span
v-for=
"(s, i) in item.videos"
:key=
"i"
>
<video
controls
width=
"100%"
height=
"100%"
poster=
"@/assets/images/applets/video.png"
>
<source
:src=
"s"
/>
</video>
<!-- autoplay="autoplay"
x5-playsinline='true'
webkit-playsinline='true'
playsinline='true'
...
...
@@ -34,24 +41,33 @@
x5-video-player-type='h5-page'
x5-video-player-fullscreen='true'
x5-video-ignore-metadata='true' -->
</span>
</div>
<div
class=
"learn-body"
v-if=
"!item.videos.length"
>
暂无数据
</div>
</span>
</div>
<div
class=
"learnphoto"
>
<div
class=
"learn-title"
>
学习照片
</div>
<div
class=
"learn-body"
v-if=
"item.images.length"
>
<span
v-for=
"(s,i) in item.images"
:key=
"i"
>
<img
:src=
"s"
alt=
""
@
click=
"sceneImg(item.images,i)"
v-if=
"s"
>
<span
v-else
>
暂无数据
</span>
</span>
</div>
<div
class=
"learn-body"
v-if=
"!item.images.length"
>
暂无数据
</div>
<div
class=
"learn-body"
v-if=
"!item.videos.length"
>
暂无数据
</div>
<div
class=
"learntextarea"
>
<div
class=
"learn-title"
>
有话对党说
</div>
<div
class=
"learn-body"
>
{{item.content|| '暂无数据'}}
</div>
</div>
<div
class=
"learnphoto"
>
<div
class=
"learn-title"
>
学习照片
</div>
<div
class=
"learn-body"
v-if=
"item.images.length"
>
<span
v-for=
"(s, i) in item.images"
:key=
"i"
>
<img
:src=
"s"
alt=
""
@
click=
"sceneImg(item.images, i)"
v-if=
"s"
/>
<span
v-else
>
暂无数据
</span>
</span>
</div>
<div
class=
"learn-body"
v-if=
"!item.images.length"
>
暂无数据
</div>
</div>
<div
class=
"learntextarea"
>
<div
class=
"learn-title"
>
有话对党说
</div>
<div
class=
"learn-body"
>
{{ item.content || "暂无数据" }}
</div>
</div>
</div>
</van-collapse-item>
</van-collapse>
...
...
@@ -66,83 +82,85 @@ import { ImagePreview } from "vant"; // 引入Vant图片预览组件
export
default
{
data
()
{
return
{
activeNames
:
[
'1'
],
pageNum
:
1
,
pageSize
:
8
,
tableData
:
[],
loading
:
false
,
finished
:
false
,
refreshing
:
false
,
flag
:
true
,
activeNames
:
[
"1"
],
pageNum
:
1
,
pageSize
:
8
,
tableData
:
[],
loading
:
false
,
finished
:
false
,
refreshing
:
false
,
flag
:
true
,
};
},
mounted
()
{
this
.
getList
()
this
.
getList
()
;
},
methods
:
{
// 图片预览
sceneImg
(
images
,
index
)
{
sceneImg
(
images
,
index
)
{
ImagePreview
({
images
:
images
,
//需要预览的图片 URL 数组
showIndex
:
true
,
//是否显示页码
loop
:
false
,
//是否开启循环播放
startPosition
:
index
//图片预览起始位置索引
})
images
:
images
,
//需要预览的图片 URL 数组
showIndex
:
true
,
//是否显示页码
loop
:
false
,
//是否开启循环播放
startPosition
:
index
,
//图片预览起始位置索引
})
;
},
// 获得数据接口
getList
()
{
let
vm
=
this
;
let
param
=
{
_index
:
this
.
pageNum
,
_size
:
this
.
pageSize
,
orgId
:
JSON
.
parse
(
sessionStorage
.
getItem
(
"userInfo"
)).
orgId
_index
:
this
.
pageNum
,
_size
:
this
.
pageSize
,
orgId
:
JSON
.
parse
(
sessionStorage
.
getItem
(
"userInfo"
)).
orgId
,
};
vm
.
$https
(
{
url
:
"interaction/getList"
,
method
:
"post"
,
authType
:
this
.
backToken
authType
:
this
.
backToken
,
},
vm
.
$qs
.
stringify
(
param
)
).
then
(
res
=>
{
if
(
res
.
data
.
resultCode
===
'200'
){
vm
.
loading
=
false
)
.
then
((
res
)
=>
{
if
(
res
.
data
.
resultCode
===
"200"
)
{
vm
.
loading
=
false
;
let
data
=
res
.
data
.
data
;
let
arr
=
[]
data
.
records
.
forEach
(
item
=>
{
arr
=
item
.
images
.
split
(
','
)
item
.
videos
=
[]
item
.
images
=
[]
item
.
audio
=
[]
arr
.
forEach
((
result
)
=>
{
if
(
/
\.(
MP4|mp4
)
/
.
test
(
result
)){
item
.
videos
.
push
(
result
)
}
else
if
(
/
\.(
MP3|mp3
)
/
.
test
(
result
)){
item
.
audio
.
push
(
result
)
}
else
{
item
.
images
.
push
(
result
)
}
})
})
vm
.
tableData
=
vm
.
flag
?
data
.
records
:
vm
.
tableData
.
concat
(
data
.
records
)
vm
.
flag
=
false
let
arr
=
[];
data
.
records
.
forEach
((
item
)
=>
{
arr
=
item
.
images
.
split
(
","
);
item
.
videos
=
[];
item
.
images
=
[];
item
.
audio
=
[];
arr
.
forEach
((
result
)
=>
{
if
(
/
\.(
MP4|MPEG|Ogg|WebM
)
/i
.
test
(
result
))
{
item
.
videos
.
push
(
result
);
}
else
if
(
/
\.(
MP3|Wav|Ogg
)
/i
.
test
(
result
))
{
item
.
audio
.
push
(
result
);
}
else
{
item
.
images
.
push
(
result
);
}
});
});
vm
.
tableData
=
vm
.
flag
?
data
.
records
:
vm
.
tableData
.
concat
(
data
.
records
);
vm
.
flag
=
false
;
vm
.
refreshing
=
false
;
vm
.
pageNum
=
vm
.
pageNum
+
1
vm
.
finished
=
data
.
records
.
length
<
vm
.
pageSize
?
true
:
false
vm
.
tableData
=
[...
vm
.
tableData
]
}
else
{
vm
.
$toast
(
res
.
data
.
message
)
vm
.
pageNum
=
vm
.
pageNum
+
1
;
vm
.
finished
=
data
.
records
.
length
<
vm
.
pageSize
?
true
:
false
;
vm
.
tableData
=
[...
vm
.
tableData
]
;
}
else
{
vm
.
$toast
(
res
.
data
.
message
)
;
}
})
.
catch
(
function
(
err
)
{
.
catch
(
function
(
err
)
{
console
.
log
(
err
);
})
})
;
},
// 列表的load上拉加载事件
onLoad
()
{
if
(
!
this
.
flag
)
{
if
(
!
this
.
flag
)
{
console
.
log
(
"加载数据"
);
this
.
loading
=
true
;
this
.
flag
=
false
;
...
...
@@ -154,10 +172,10 @@ export default {
this
.
finished
=
false
;
this
.
flag
=
true
;
this
.
loading
=
true
;
this
.
pageNum
=
1
;
this
.
pageNum
=
1
;
this
.
getList
();
},
}
}
,
};
</
script
>
...
...
@@ -191,7 +209,7 @@ export default {
content
:
""
;
height
:
16px
;
width
:
16px
;
background-image
:
url(
'~@/assets/images/applets/timer.png'
)
;
background-image
:
url(
"~@/assets/images/applets/timer.png"
)
;
background-size
:
cover
;
position
:
absolute
;
left
:
0
;
...
...
@@ -200,30 +218,30 @@ export default {
}
}
.author
{
float
:
right
;
margin-right
:
20px
;
float
:
right
;
margin-right
:
20px
;
}
.content
{
.learn-title
{
font-size
:
14px
;
color
:
#333333
;
padding
:
16px
0
;
}
.learn-body
{
padding-bottom
:
12px
;
img
,
video
{
width
:
30%
;
height
:
auto
;
padding
:
0
5px
;
box-sizing
:
border-bo
x
;
}
.learn-title
{
font-size
:
14px
;
color
:
#333333
;
padding
:
16px
0
;
}
.learn-body
{
padding-bottom
:
12px
;
img
,
video
{
width
:
30%
;
height
:
auto
;
padding
:
0
5p
x
;
box-sizing
:
border-box
;
}
.learntextarea
{
.learn-body
{
line-height
:
1
.5
}
}
.learntextarea
{
.learn-body
{
line-height
:
1
.5
;
}
}
}
}
</
style
>
\ No newline at end of file
src/views/user/components/learnDetail.vue
View file @
f857ef34
...
...
@@ -60,7 +60,7 @@
<div
class=
"learn-title"
>
展板音频
</div>
<div
class=
"learn-body"
>
<span
class=
"file-box"
class=
"file-box
audio
"
v-for=
"(s, i) in item.audioList"
:key=
"i"
>
...
...
@@ -188,6 +188,9 @@ export default {
padding
:
10px
;
box-sizing
:
border-box
;
}
.file-box.audio
{
width
:
100%
;
}
img
{
width
:
32px
;
height
:
auto
;
...
...
src/views/user/editPsd.vue
View file @
f857ef34
...
...
@@ -37,7 +37,6 @@
/>
</div>
<div
class=
"admin-detail-button"
>
<!--
<van-button
type=
"default"
plain
native-type=
"button"
@
click=
"onCancle"
>
取消
</van-button>
-->
<van-button
type=
"default"
native-type=
"submit"
>
提交
</van-button>
</div>
</van-form>
...
...
@@ -61,11 +60,6 @@ export default {
// 查询管理员信息
},
methods
:
{
onCancle
()
{
this
.
form
=
{
username
:
JSON
.
parse
(
sessionStorage
.
getItem
(
"userInfo"
)).
userName
,
};
},
// 提交数据
onSubmit
()
{
if
(
this
.
form
.
password
!==
this
.
form
.
againPsd
)
{
...
...
@@ -116,9 +110,6 @@ export default {
display
:
flex
;
flex-direction
:
column
;
box-sizing
:
border-box
;
.edit-container
{
}
.input-box
{
padding-bottom
:
32px
;
.van-cell
{
...
...
src/views/user/learn.vue
View file @
f857ef34
...
...
@@ -33,7 +33,7 @@ export default {
finished
:
false
,
pageNum
:
1
,
pageSize
:
10
,
flag
:
true
,
flag
:
true
,
// 是否是第一次加载
list
:
[],
refreshing
:
false
,
};
...
...
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