Commit f64bc3f9 by 庄欣

f

parent e981a565
......@@ -12,8 +12,6 @@
<div class="mask" v-if="err != ''">
<div class="wei-600 " style="font-size: 24px;color: #FF542E;">{{err}}</div>
</div>
<div class="flex-c" style="width: 100%;height: 100%;justify-content: flex-start;">
<div v-if="(isUserInfo||isReading) && canOpen && isAuth" class="cuizhi"
style="width: 250px;height: 100%;background: linear-gradient(142deg, #0C7BB3, #F2BAE8);padding: 24px 0;padding-left: 12px;position: relative;">
......
.cicon {
position: fixed;
right: 20px;
bottom: 20px;
background-color: #fffccc;
border-radius: 30px;
width: 50px;
height: 50px;
border: 1px solid #ff8528;
display: flex;
text-align: center;
justify-items: center;
justify-content: center;
align-items: center;
align-content: center;
}
.x {
width: 30px;
height: 30px;
background-color: white;
color: #666600;
display: flex;
border-radius: 15px;
justify-content: center;
align-items: center;
align-content: center;
justify-items: center;
position: absolute;
right: 0px;
top: -15px;
z-index: 999;
}
.cicon img {
height: 40px;
width: 40px;
}
.out_boxInChajian {
position: fixed;
top: 0px;
width: 100vw;
display: flex;
align-items: center;
justify-content: center;
z-index: 888;
height: 100vh;
margin: 0 auto;
}
.out_backMoadlBox {
position: fixed;
top: 0px;
width: 100vw;
z-index: 900;
height: 100vh;
margin: 0 auto;
background-color: rgba(0, 0, 0, 0.4);
}
.___container-anim-opacity {
animation: 0.22s opacityOut;
-webkit-animation: 0.22s opacityOut;
-moz-animation: 0.22s opacityOut;
}
@keyframes opacityOut {
0% {
opacity: 0
}
50% {
opacity: .8;
}
100% {
opacity: 1;
}
}
#___container {
/* background: linear-gradient(80deg, #fff4b5, #ffd217); */
font-size: 14px;
/* color: #666; */
border-radius: 10px;
height: 540px;
width: 810px;
z-index: 999;
overflow-y: auto;
overflow-x: hidden;
position: absolute;
box-shadow: 0px 0px 12px 2px rgba(0, 0, 0, 0.2);
margin-top: -6vh;
}
#___container .userinfo {
margin-top: 10px;
}
#___container .allcen {
display: flex;
align-items: center;
justify-content: center;
}
#___container .flex-c {
display: flex;
align-items: center;
}
#___container .cuizhi {
display: flex;
flex-direction: column;
}
#___container .cuizhi-cc {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
#___container .jube {
display: flex;
justify-content: space-between;
}
#___container .jube-a {
display: flex;
justify-content: space-around;
}
#___container .hr {
height: 1px;
width: 100%;
background-color: #bbb;
margin: 10px 0;
}
#___container .wei-500 {
font-weight: 500;
}
#___container .wei-600 {
font-weight: 600;
}
#___container .col-fff {
color: #fff;
}
#___container .col-333 {
color: #333;
}
#___container .col-666 {
color: #666;
}
#___container .col-999 {
color: #999;
}
#___container .col-red {
color: #FF542E;
}
#___container .col-green {
color: #1dd923;
}
#___container .title_Out_Back_line {
background: linear-gradient(142deg, #0C7BB3, #8FCBFF);
}
#___container .userPermission_on {
background: linear-gradient(34deg, #76B3FF, #0C7BB3);
border: 1px solid #fff;
}
#___container .userPermission_off {
background: linear-gradient(245deg, #fff, #fff);
border: 1px solid #fff;
}
#___container .userinfo .form-group {
display: flex;
align-content: center;
align-items: center;
width: 100%;
}
#___container .userinfo .headSbox .form-group {
width: 50%;
}
#___container .userinfo .form-group .label {
width: 16%;
display: flex;
justify-content: flex-start;
}
#___container .userinfo .headSbox .form-group .label {
width: max-content;
margin-right: 10px;
}
#___container .userinfo .form-group .input {
/* width: 80%; */
width: max-content;
}
#___container .userinfo .headSbox .form-group .input {
max-width: 140px;
}
#___container button {
cursor: pointer;
background: linear-gradient(0deg, #0089ff, #1960ff) !important;
}
#___container .userinfo .form-group .input input {
width: max-content;
background-color: transparent;
}
#___container textarea {
padding: 12px;
border-radius: 6px;
margin: 8px 0;
}
#___container input[type=radio] {
background-color: #fffccc;
-webkit-appearance: checkbox !important;
height: 15px;
width: 15px;
}
#___container .id-flex {
display: flex;
justify-content: center;
width: 100%;
align-content: center;
align-items: center;
flex-wrap: wrap;
}
#___container a {
text-decoration: underline;
}
#___container div.danger {
display: flex;
align-content: center;
align-items: center;
text-align: center;
color: #ff0000;
justify-content: center;
}
#___container div.primary {
display: flex;
align-content: center;
align-items: center;
text-align: center;
color: #0277bd;
justify-content: center;
}
#___container button.primary {
display: flex;
align-content: center;
align-items: center;
text-align: center;
padding: 5px 10px 5px 10px;
background-color: #0277bd;
color: white;
border-radius: 5px;
}
#___container button.danger {
display: flex;
align-content: center;
align-items: center;
text-align: center;
padding: 5px 10px 5px 10px;
background-color: #ff0000;
color: white;
border-radius: 5px;
}
#___container .zone {
display: flex;
justify-content: center;
align-content: center;
margin: 0 8px;
}
#___container .mask {
position: absolute;
width: 100%;
height: 100%;
z-index: 999;
top: 0;
background-color: rgba(0, 0, 0, 0.2);
display: flex;
justify-content: center;
align-items: center;
align-content: center;
justify-items: center;
color: #ffffff;
}
#___container .xuanzhuan {
animation: xz 1s linear infinite;
}
@keyframes xz {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
#___container .__messagebox_container {
margin: 0 auto;
z-index: 999;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
}
#___container ._button_groups {
margin: 10px auto;
display: flex;
justify-content: space-around;
width: 100%;
}
#___container ._button_groups button {
border-radius: 5px;
}
#___container .btn {
width: auto;
padding-left: 20px;
padding-right: 20px;
background: #0277bd;
border: none;
height: 30px;
color: white;
border-radius: 2px;
}
#___container .pushContent {
margin: 0 auto;
width: 100%;
text-align: left;
}
#___container .activeCls {
background-color: #FF9F2A !important;
color: #FFFF99 !important;
}
#___container .activeCls_on {
background: linear-gradient(72deg, #f9957f, #f2f5d0);
}
#___container .activeCls_off {
background: linear-gradient(72deg, #C1C1C1, #8C8C8C);
}
#___container .upload {
height: 100px;
display: flex;
justify-content: left;
align-content: center;
align-items: center;
padding-left: 30px;
}
#___container .info {
display: flex;
justify-self: left;
padding-left: 20px;
color: #0277bd;
}
#___container .btn-default {
background-color: #ffffff;
color: #333333;
width: auto;
padding-left: 20px;
padding-right: 20px;
border: none;
height: 30px;
border-radius: 2px;
}
.hidden {
display: none!important;
}
\ No newline at end of file
chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {
chrome.cookies.get({
url: "https://www.mepai.me/",
name: "auth"
}, cookie => {
if (cookie === undefined || cookie === null || cookie === "") {
sendResponse({access_token: ""});
} else {
sendResponse({access_token: cookie.value});
}
});
return true;
});
\ No newline at end of file
let host = "https://api.mepai.me/manage";
let API = {
addZone: host + "/youmi/add-zone",
getZone: host + "/youmi/get-zone",
removeZone: host + "/youmi/remove-zone",
setRemark: host + "/youmi/set-remark",
getRemark: host + "/youmi/get-remark",
getUserInfo: host + "/youmi/user",
getIsYoumi: host + "/youmi/is-youmi",
auth: host + "/youmi/is-auth",
pushContactSms: host + "/push/sms",
pushContact: host + "/push",
}
var Manager = {
fade: false,
canOpen: false,
showUiProp: false,
token: "",
permission: "-1",
remark: "",
info: [],
user: {
id: "",
mobile: "",
wx: "",
qq: "",
email: "",
nickname: ""
},
isAuth: false,
objectId: null,
type: null,
isUserInfo: false,
isWorks: false,
isYoumi: 0,
isReading: false,
access_token: "",
inZone: false,
userId: "",
userRemark: "",
userPermission: "-1",
userToken: "",
userYyRemark: "",
yyRemark: "",
err: "",
loading: false,
youmiCreateTime: "",
youmitime:Date.parse('2021-04-02'),
sendPush: false,
authContent: "亲爱的摄影师,您的作品非常符合米拍有米计划的投稿标准," +
"我们期望获得您的授权,允许我们在有米计划中使用您的作品," +
"发布到vivo、OPPO、小米、华为锁屏等平台进行内容流量增值。" +
"若上架的平台有现金收益,我们将在社区内给予结算。若您同意使用," +
"请联系米拍锁屏微信:mepai100,进行详细沟通。",
picContent: "亲爱的摄影师,您的作品 {url} 中的第x张图,内容非常符合米拍有米计划的投稿标准," +
"但目前图片在云端已被压缩,因图片分辨率较小或噪点较为明显," +
"而无法通过第三方审核,我们期望您能将大图发送至米拍锁屏邮箱laigao@mepai.me,邮件标题请注明:【米拍锁屏】-米拍社区内昵称," +
"若有任何疑问请联系米拍锁屏微信:mepai100。",
smsContent: "您的作品非常符合有米计划标准,米拍期望使用它进行流量增值运营,若有收益会与您分成,目前有事项还需和您确认,详情请在米拍-通知内查看",
pushContentN: "亲爱的摄影师,您的作品内容非常符合米拍有米计划的投稿标准,但目前图片在云端已被压缩,因图片分辨率较小或噪点较为明显,而无法通过第三方审核,我们期望您能将相应大图发送至米拍锁屏邮箱laigao@mepai.me,邮件标题请注明:【米拍锁屏】-米拍社区内昵称,若有任何疑问请联系米拍锁屏微信:mepai100。",
authType: "auth", //auth, pic
}
var UI = chrome.runtime.getURL("ui.html");
var icon = chrome.runtime.getURL("images/icon.png");
let extendDom = document.createElement("div");
let app = null;
extendDom.id = "__extend_dom"
var iconDom = document.createElement("div")
iconDom.innerHTML = "<div><img src='" + icon + "'/></div>"
iconDom.setAttribute("class", "cicon");
iconDom.onclick = function () {
showUi();
}
extendDom.appendChild(iconDom)
extendDom.style = "z-index:999;";
const TYPE_WORK = 1;
const TYPE_READING = 2;
const TYPE_USER = 3;
let ACCESS_TOKEN = "";
chrome.runtime.sendMessage({}, function(response) {
ACCESS_TOKEN = response.access_token;
});
var body = document.getElementById("__nuxt");
fetch(UI).then(function(res) {
return res.text();
}).then(html => {
let container = document.createElement("div");
container.id = "container";
container.innerHTML = html;
extendDom.appendChild(container)
body.appendChild(extendDom);
$(".closeBtn2").attr("src", chrome.runtime.getURL("images/close2.png"));
$(".loadingImg").attr("src", chrome.runtime.getURL("images/loading.png"));
$(".close").attr("src", chrome.runtime.getURL("images/close.png"));
$(".nicknameIcon").attr("src", chrome.runtime.getURL("images/nickname.png"));
$(".userIdIcon").attr("src", chrome.runtime.getURL("images/user_id.png"));
$(".phoneIcon").attr("src", chrome.runtime.getURL("images/phone.png"));
$(".qqIcon").attr("src", chrome.runtime.getURL("images/qq.png"));
$(".wxIcon").attr("src", chrome.runtime.getURL("images/weixin.png"));
$(".emailIcon").attr("src", chrome.runtime.getURL("images/email.png"));
}).then(() => {
bindEvent();
openUi();
});
function bindEvent() {
$(".showUi").on("click", function () {
console.log("showUi")
showUi();
});
}
let urlCircle = [];
setInterval(function() {
let currentUrl = window.location.href;
if (urlCircle.length > 0 && urlCircle.shift() !== currentUrl) {
window.location.reload();
}
urlCircle.push(currentUrl)
}, 1000);
function showToast(msg) {
let $this = this;
$this.err = msg;
if (msg === "操作成功") {
setTimeout(function() {
$this.err = "";
}, 800);
} else {
setTimeout(function() {
$this.err = "";
}, 1500);
}
}
function base64Decode(data) {
if (!isNaN(data)) {
return data;
}
var rv = window.atob(data);
rv = escape(rv);
rv = decodeURIComponent(rv);
return rv;
}
function sendData(api, data, callback) {
let $this = app;
$this.loading = true;
var header = {
method: "POST",
headers: {
accesstoken: ACCESS_TOKEN,
"Content-Type": "application/json; charset=UTF-8",
"Accept-Encoding": "gzip, deflate, br"
},
keepalive: true,
body: JSON.stringify(data)
};
fetch(api, header).then(res => {
$this.loading = false;
return res.json()
}).then(final => {
return callback(final);
})
}
function getData(api, data, callback) {
api = api + "?";
for (var i in data) {
api = api + "&" + i + "=" + data[i]
}
var header = {
method: "GET",
headers: {
accesstoken: ACCESS_TOKEN
},
};
fetch(api, header).then(res => {
return res.json()
}).then(final => {
if (final.code.toString() === "100002") {
showToast("请先登录,若登录账号没有操作权限,请向公司管理员申请");
}
return callback(final);
}).catch(e => {
console.log(api)
console.error(e);
});
}
function propLoading() {
}
\ No newline at end of file
{
"manifest_version": 3,
"name": "mepai-user-remark",
"description": "米拍用户备注小工具",
"version": "1.1",
"permissions": [
"tabs",
"webRequest",
"cookies"
],
"host_permissions": [
"*://*.mepai.me/"
],
"background": {
"service_worker": "js/background.js"
},
"content_scripts": [
{
"matches": ["https://*.mepai.me/*"],
"css": ["/css/main.css"],
"js": ["/js/jquery.min.js", "/js/consts.js", "/js/service.js", "/js/util.js", "/js/index.js"],
"run_at": "document_end"
}
],
"web_accessible_resources": [
{
"resources": [
"ui.html",
"images/icon.png",
"images/close.png",
"images/loading.png",
"images/close2.png",
"images/nickname.png",
"images/phone.png",
"images/qq.png",
"images/weixin.png",
"images/email.png",
"images/user_id.png"
],
"matches": [
"*://*.mepai.me/*"
]
}
]
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body {
width:100px;
}
</style>
</head>
<body>
<div>米拍快速引用工具</div>
<div>v0.0.1</div>
</body>
</html>
\ 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