Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tools
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
tools
Commits
fb7dbea6
Commit
fb7dbea6
authored
Jan 11, 2021
by
庄欣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成
parent
f30430c6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
38 deletions
+76
-38
mp-remark/css/main.css
+16
-7
mp-remark/js/index.js
+37
-10
mp-remark/ui.html
+23
-21
No files found.
mp-remark/css/main.css
View file @
fb7dbea6
...
...
@@ -74,29 +74,38 @@
input
[
type
=
radio
]
{
background-color
:
#fffccc
;
-webkit-appearance
:
checkbox
!important
;
height
:
20
px
;
width
:
20
px
;
height
:
15
px
;
width
:
15
px
;
}
.id-flex
{
display
:
flex
;
justify-content
:
center
;
width
:
100%
;
align-content
:
center
;
align-items
:
center
;
}
#___container
a
{
text-decoration
:
underline
;
}
#___container
.danger
{
#___container
div
.danger
{
display
:
flex
;
align-content
:
center
;
align-items
:
center
;
text-align
:
center
;
color
:
#ff0000
;
width
:
100%
;
justify-content
:
center
;
}
#___container
.primary
{
#___container
div
.primary
{
display
:
flex
;
align-content
:
center
;
align-items
:
center
;
text-align
:
center
;
background-
color
:
#0277bd
;
color
:
white
;
color
:
#0277bd
;
justify-content
:
center
;
}
#___container
button
.primary
{
...
...
mp-remark/js/index.js
View file @
fb7dbea6
...
...
@@ -42,11 +42,12 @@ fetch(UI).then(function(res){
email
:
""
,
nickname
:
""
},
isAuth
:
false
,
objectId
:
null
,
type
:
null
,
isUserInfo
:
false
,
isWorks
:
false
,
isYoumi
:
false
,
isYoumi
:
0
,
isReading
:
false
,
access_token
:
""
,
inZone
:
false
,
...
...
@@ -64,7 +65,9 @@ fetch(UI).then(function(res){
getRemark
:
"https://api.mepai.me/manage/youmi/get-remark"
,
getUserInfo
:
"https://api.mepai.me/v5/user/info"
,
getReadingInfo
:
"https://api.mepai.me/v5/reading/info"
,
getWorksInfo
:
"https://api.mepai.me/v5/works/info"
getWorksInfo
:
"https://api.mepai.me/v5/works/info"
,
getIsYoumi
:
"https://api.mepai.me/manage/youmi/is-youmi"
,
auth
:
"https://api.mepai.me/manage/youmi/is-auth"
}
},
methods
:
{
...
...
@@ -114,20 +117,33 @@ fetch(UI).then(function(res){
}
})
}
if
(
$this
.
isWorks
)
{
$this
.
getData
(
$this
.
API
.
getWorksInfo
,
{
if
(
$this
.
isWorks
)
{
/*
$this.getData($this.API.getWorksInfo, {
works_id: $this.objectId
}, data => {
let works = data.data;
$this.isYoumi = works.is_youmi;
});*/
$this
.
getData
(
$this
.
API
.
getIsYoumi
,
{
object_id
:
$this
.
objectId
,
type
:
$this
.
type
},
data
=>
{
$this
.
isYoumi
=
data
.
data
;
});
}
if
(
$this
.
isReading
)
{
$this
.
getData
(
this
.
API
.
getReadingInfo
,
{
/*
$this.getData(this.API.getReadingInfo, {
reading_id: $this.objectId
}, data => {
let reading = data.data;
$this.isYoumi = reading.is_youmi;
});*/
$this
.
getData
(
$this
.
API
.
getIsYoumi
,
{
object_id
:
$this
.
objectId
,
type
:
$this
.
type
},
data
=>
{
$this
.
isYoumi
=
data
.
data
;
});
}
if
(
$this
.
isReading
||
$this
.
isWorks
)
{
...
...
@@ -172,11 +188,24 @@ fetch(UI).then(function(res){
}
else
{
canOpen
=
true
;
}
if
(
this
.
isUserInfo
)
{
$this
.
getAuth
();
if
(
$this
.
isUserInfo
)
{
$this
.
getUserIdFromAvatar
(
$
(
avatar
).
attr
(
"src"
));
}
return
canOpen
;
},
getAuth
:
function
()
{
let
$this
=
this
;
this
.
getData
(
this
.
API
.
auth
,
{},
(
res
)
=>
{
if
(
res
.
code
.
toString
()
===
"100001"
)
{
$this
.
isAuth
=
true
;
}
if
(
res
.
code
.
toString
()
===
"100002"
)
{
$this
.
isAuth
=
false
;
$this
.
err
=
"权限不足"
;
}
});
},
getData
:
function
(
api
,
data
,
callback
)
{
let
$this
=
this
;
api
=
api
+
"?"
;
...
...
@@ -192,16 +221,14 @@ fetch(UI).then(function(res){
fetch
(
api
,
header
).
then
(
res
=>
{
return
res
.
json
()
}).
then
(
final
=>
{
if
(
final
.
code
.
toString
()
===
"100001"
)
{
return
callback
(
final
);
}
if
(
final
.
code
.
toString
()
===
"100002"
)
{
$this
.
err
=
"请您先在网站登录,或者请确定您的操作权限"
;
}
else
{
$this
.
err
=
final
.
message
;
}
return
callback
(
final
);
}).
catch
(
e
=>
{
console
.
log
(
"error"
,
e
.
getMessage
())
console
.
log
(
e
);
});
},
sendData
:
function
(
api
,
data
,
callback
)
{
...
...
mp-remark/ui.html
View file @
fb7dbea6
...
...
@@ -2,7 +2,7 @@
<div
class=
"x"
v-on:click=
"showUi"
><img
:src=
"closeX"
></div>
<div
class=
"danger"
v-if=
"err != ''"
>
{{err}}
</div>
<!------------------- 用户开始 -------->
<div
class=
"userinfo row"
v-if=
"isUserInfo && canOpen"
>
<div
class=
"userinfo row"
v-if=
"isUserInfo && canOpen
&& isAuth
"
>
<div
class=
"col-md-12"
>
<div
class=
"form-group"
>
<div
class=
"label"
>
用户id:
</div>
...
...
@@ -28,7 +28,7 @@
<div
class=
"label"
>
邮箱:
</div>
<div
class=
"input"
><input
class=
"form-control"
:value=
"user.email"
disabled
/></div>
</div>
<div
class=
"
form-group"
style=
"display: block!important;
margin-top: 10px;"
>
<div
class=
"
id-flex"
style=
"
margin-top: 10px;"
>
<div
class=
""
>
用户内容是否可被有米计划使用
</div>
<div
class=
""
>
<input
type=
"radio"
name=
"userPermission"
value=
"-1"
v-model=
"userPermission"
/>
未设置
...
...
@@ -55,26 +55,25 @@
</div>
<!------------------- 用户结束 作品开始 -------->
<div
class=
"workinfo row"
v-if=
"isWorks && canOpen"
style=
"margin-top:20px;"
>
<div>
作品id:{{objectId}}
</div>
<div
class=
"workinfo row"
v-if=
"isWorks && canOpen && isAuth"
style=
"margin-top:20px;"
>
<div
class=
"col-md-12"
>
<div
v-if=
"isYoumi === 1"
class=
"primary"
>
此作品已参加有米计划
</div>
<div
v-if=
"isYoumi === 0"
class=
"danger"
>
此作品未参加有米计划
</div>
<div><a
href=
"https://www.mepai.me/mp/secret/youmibeixuan"
target=
"_blank"
>
跳转到备选库
</a></div>
<div
v-if=
"inZone === false"
class=
"form-group zone"
>
<div
class=
"label"
>
此作品未在有米计划备选公共库:
</div>
<div
class=
"input"
>
<button
class=
"btn btn-primary primary small"
v-on:click=
"addZone"
>
+添加
</button>
<div
class=
"id-flex"
>
<div>
作品id:{{objectId}}
</div>
<div
v-if=
"isYoumi == 1"
class=
"primary"
>
(此作品已参加有米计划)
</div>
<div
v-if=
"isYoumi == 0"
class=
"danger"
>
(此作品未参加有米计划)
</div>
</div>
<div
class=
"id-flex"
>
<div
class=
"label"
>
推荐作品到
<a
href=
"https://www.mepai.me/mp/secret/youmibeixuan"
target=
"_blank"
>
编辑备选库
</a>
:
</div>
<div
v-if=
"inZone === false"
class=
"form-group zone"
>
<button
class=
"btn btn-primary primary small"
v-on:click=
"addZone"
>
+推荐入库
</button>
</div>
<div
v-if=
"inZone === true"
class=
"form-group zone"
>
<div
class=
"label"
>
此作品已在有米计划备选公共库:
</div>
<div
class=
"input"
>
<button
class=
"btn btn-danger danger small"
v-on:click=
"removeZone"
>
-移除
</button>
<button
class=
"btn btn-danger danger small"
v-on:click=
"removeZone"
>
-已推入,点击移除
</button>
</div>
</div>
<div
class=
"
form-group
"
>
<div
class=
"
id-flex
"
>
<div
class=
"label"
>
该作品是否可被有米计划使用:
</div>
<div
class=
"input"
>
<input
type=
"radio"
name=
"permission"
value=
"-1"
v-model=
"permission"
/>
未设置
...
...
@@ -93,18 +92,21 @@
</div>
</div>
<div
class=
"form-group"
style=
"display: flex;justify-items: center;justify-content: center"
>
<button
class=
"btn btn-primary primary large"
v-on:click=
"submitRemark"
>
提交
</button>
<button
class=
"btn btn-primary primary large"
v-on:click=
"submitRemark"
>
提交
作品备注
</button>
</div>
</div>
</div>
<!------------------- 作品结束 文章开始 -------->
<div
class=
"readinginfo row"
v-if=
"isReading && canOpen"
style=
"margin-top:20px"
>
<div>
文章id:{{objectId}}
</div>
<div
class=
"readinginfo row"
v-if=
"isReading && canOpen
&& isAuth
"
style=
"margin-top:20px"
>
<div
class=
"col-md-12"
>
<div
v-if=
"isYoumi === 1"
class=
"primary"
>
此作品已参加有米计划
</div>
<div
v-if=
"isYoumi === 0"
class=
"danger"
>
此作品未参加有米计划
</div>
<div
class=
"id-flex"
>
<div>
文章id:{{objectId}}
</div>
<div
v-if=
"isYoumi == 1"
class=
"primary"
>
(此文章已参加有米计划)
</div>
<div
v-if=
"isYoumi == 0"
class=
"danger"
>
(此文章未参加有米计划)
</div>
</div>
<!--<div v-if="inZone === false" class="form-group zone">
<div class="label">此文章未在有米计划备选公共库:</div>
<div class="input">
...
...
@@ -117,7 +119,7 @@
<button class="btn btn-danger danger small" v-on:click="removeZone">-移除</button>
</div>
</div>-->
<div
class=
"
form-group
"
>
<div
class=
"
id-flex
"
>
<div
class=
"label"
>
该文章是否可被有米计划使用
</div>
<div
class=
"input"
>
<input
type=
"radio"
name=
"permission"
value=
"-1"
v-model=
"permission"
/>
未设置
...
...
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