Commit b9837a89 by 庄欣

f

parent 80ed80bd
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
...@@ -94,9 +94,7 @@ ...@@ -94,9 +94,7 @@
margin-top: -6vh; margin-top: -6vh;
} }
#___container .userinfo {
margin-top: 10px;
}
#___container .allcen { #___container .allcen {
display: flex; display: flex;
......
...@@ -59,5 +59,5 @@ var Manager = { ...@@ -59,5 +59,5 @@ var Manager = {
"若有任何疑问请联系米拍锁屏微信:mepai100。", "若有任何疑问请联系米拍锁屏微信:mepai100。",
smsContent: "您的作品非常符合有米计划标准,米拍期望使用它进行流量增值运营,若有收益会与您分成,目前有事项还需和您确认,详情请在米拍-通知内查看", smsContent: "您的作品非常符合有米计划标准,米拍期望使用它进行流量增值运营,若有收益会与您分成,目前有事项还需和您确认,详情请在米拍-通知内查看",
pushContentN: "亲爱的摄影师,您的作品内容非常符合米拍有米计划的投稿标准,但目前图片在云端已被压缩,因图片分辨率较小或噪点较为明显,而无法通过第三方审核,我们期望您能将相应大图发送至米拍锁屏邮箱laigao@mepai.me,邮件标题请注明:【米拍锁屏】-米拍社区内昵称,若有任何疑问请联系米拍锁屏微信:mepai100。", pushContentN: "亲爱的摄影师,您的作品内容非常符合米拍有米计划的投稿标准,但目前图片在云端已被压缩,因图片分辨率较小或噪点较为明显,而无法通过第三方审核,我们期望您能将相应大图发送至米拍锁屏邮箱laigao@mepai.me,邮件标题请注明:【米拍锁屏】-米拍社区内昵称,若有任何疑问请联系米拍锁屏微信:mepai100。",
authType: "auth", //auth, pic authType: "pic", //auth, pic
} }
...@@ -44,15 +44,61 @@ fetch(UI).then(function(res) { ...@@ -44,15 +44,61 @@ fetch(UI).then(function(res) {
$(".wxIcon").attr("src", chrome.runtime.getURL("images/weixin.png")); $(".wxIcon").attr("src", chrome.runtime.getURL("images/weixin.png"));
$(".emailIcon").attr("src", chrome.runtime.getURL("images/email.png")); $(".emailIcon").attr("src", chrome.runtime.getURL("images/email.png"));
}).then(() => { }).then(() => {
bindEvent(); $(".pushContent[name=pushContentAuth]").text(Manager.authContent);
$(".pushContent[name=pushContentPic]").text(Manager.picContent);
$(".pushContent[name=pushContentN]").text(Manager.pushContentN);
$(".pushSmsContent").text(Manager.smsContent);
$(".pushContent[name=pushContentAuth]").bind("input propertychange", function () {
Manager.authContent = $(this).text();
});
$(".pushContent[name=pushContentPic]").bind("input propertychange", function () {
Manager.picContent = $(this).text();
});
$(".pushContent[name=pushContentN]").bind("input propertychange", function () {
Manager.pushContentN = $(this).text();
});
onload();
openUi(); openUi();
}); });
function bindEvent() { function onload() {
$(".showUi").on("click", function () { $(".showUi").on("click", function () {
console.log("showUi")
showUi(); showUi();
}); });
$(".show-tab").click(function () {
changeTab($(this).data("auth"));
});
$(".submitUserRemark").click(function () {
submitUserRemark();
})
$(".openMessageBox").click(function () {
openMessageBox();
})
$(".closeMessageBox").click(function () {
closeMessageBox();
})
$(".sendAll").click(function () {
sendAll();
})
$(".sendPushOnly").click(function () {
sendPushOnly();
})
$(".addZone").click(function () {
addZone() ;
});
$(".removeZone").click(function () {
removeZone();
});
$(".setUserPermission").click(function () {
var value = $(this).data("permission");
setUserPermission(value);
});
$(".setPermission").click(function () {
var value = $(this).data("permission");
setPermission(value);
});
changeTab(Manager.authType);
} }
let urlCircle = []; let urlCircle = [];
......
...@@ -205,7 +205,7 @@ function openUi() { ...@@ -205,7 +205,7 @@ function openUi() {
type: Manager.type type: Manager.type
}, res => { }, res => {
if (res.code.toString() === "100001") { if (res.code.toString() === "100001") {
if (res.data.toString() !== "") { if (!res.data instanceof Array) {
Manager.remark = res.data.remark; Manager.remark = res.data.remark;
Manager.permission = res.data.permission; Manager.permission = res.data.permission;
Manager.token = res.data.lock_token; Manager.token = res.data.lock_token;
...@@ -233,15 +233,17 @@ function openUi() { ...@@ -233,15 +233,17 @@ function openUi() {
type: TYPE_USER type: TYPE_USER
}, res => { }, res => {
if (res.code.toString() === "100001") { if (res.code.toString() === "100001") {
if (res.data.toString() !== "{}") { if (!res.data instanceof Array) {
Manager.userRemark = res.data.remark; Manager.userRemark = res.data.remark;
Manager.userYyRemark = res.data.operate_remark; Manager.userYyRemark = res.data.operate_remark;
Manager.userPermission = res.data.permission; Manager.userPermission = res.data.permission;
Manager.userToken = res.data.lock_token Manager.userToken = res.data.lock_token
} }
Manager.authType = "now";
show();
} }
}) })
Manager.authType = "now";
} }
if (Manager.isWorks) { if (Manager.isWorks) {
getData(API.getIsYoumi, { getData(API.getIsYoumi, {
...@@ -255,11 +257,11 @@ function openUi() { ...@@ -255,11 +257,11 @@ function openUi() {
} else { } else {
Manager.isYoumi = 0; Manager.isYoumi = 0;
} }
Manager.picContent = Manager.picContent.replace("{url}",
"https://m.mepai.me/works/" + Manager.objectId)
Manager.authType = "pic";
show();
}); });
Manager.picContent = Manager.picContent.replace("{url}",
"https://m.mepai.me/works/" + Manager.objectId)
Manager.authType = "pic";
} }
if (Manager.isReading) { if (Manager.isReading) {
getData(API.getIsYoumi, { getData(API.getIsYoumi, {
...@@ -273,8 +275,9 @@ function openUi() { ...@@ -273,8 +275,9 @@ function openUi() {
} else { } else {
Manager.isYoumi = 0; Manager.isYoumi = 0;
} }
Manager.authType = "now";
show();
}); });
Manager.authType = "now";
} }
if (Manager.isReading || Manager.isWorks) { if (Manager.isReading || Manager.isWorks) {
getData(API.getZone, { getData(API.getZone, {
...@@ -287,26 +290,36 @@ function openUi() { ...@@ -287,26 +290,36 @@ function openUi() {
} else { } else {
Manager.inZone = true; Manager.inZone = true;
} }
show();
}) })
} }
} else { } else {
Manager.err = "不在个人中心或作品详情或文章详情页"; Manager.err = "不在个人中心或作品详情或文章详情页";
show();
} }
}
function setUserPermission(value) {
Manager.userPermission = value;
show(); show();
} }
function setPermission(value) {
Manager.permission = value;
show();
}
function sendAll() { //发送SMS function sendAll() { //发送SMS
var $this = this;
if (confirm("确定发送")) { if (confirm("确定发送")) {
$this._pushContent(); _pushContent();
var api = API.pushContactSms; var api = API.pushContactSms;
sendData(api, { sendData(api, {
uid: this.user.id, uid: Manager.user.id,
tid: 901349 tid: 901349
}, (res) => { }, (res) => {
if (res.code === "100001") { if (res.code === "100001") {
$this.setInfo("发送短信成功"); setInfo("发送短信成功");
return; return;
} else { } else {
showToast("发送短信操作失败:" + res.message + ";请联系管理员!"); showToast("发送短信操作失败:" + res.message + ";请联系管理员!");
...@@ -359,6 +372,26 @@ function showUi() { ...@@ -359,6 +372,26 @@ function showUi() {
function changeTab(type) { function changeTab(type) {
Manager.authType = type; Manager.authType = type;
$(".show-tab").removeClass("activeCls_on");
$(".show-tab").addClass("activeCls_off");
$(".pushContent").addClass("hidden");
switch(Manager.authType) {
case "auth":
$(".show-tab-auth").removeClass("activeCls_off");
$(".show-tab-auth").addClass("activeCls_on");
$(".pushContent[name=pushContentAuth]").removeClass("hidden");
break;
case "pic":
$(".show-tab-pic").removeClass("activeCls_off");
$(".show-tab-pic").addClass("activeCls_on");
$(".pushContent[name=pushContentPic]").removeClass("hidden");
break;
case "now":
$(".show-tab-now").removeClass("activeCls_off");
$(".show-tab-now").addClass("activeCls_on");
$(".pushContent[name=pushContentN]").removeClass("hidden");
break;
}
} }
function setInfo(message) { function setInfo(message) {
...@@ -374,6 +407,35 @@ function sendPushOnly() { ...@@ -374,6 +407,35 @@ function sendPushOnly() {
} }
} }
function openMessageBox() {
Manager.sendPush = true
if (Manager.sendPush) {
$(".worksInfoBox").addClass("hidden");
$(".userInfoBox").addClass("hidden");
$(".MessageBox").removeClass("hidden");
} else {
$(".worksInfoBox").removeClass("hidden");
$(".userInfoBox").removeClass("hidden");
$(".MessageBox").addClass("hidden");
}
show();
}
function closeMessageBox() {
Manager.sendPush = false;
if (Manager.sendPush) {
$(".worksInfoBox").addClass("hidden");
$(".userInfoBox").addClass("hidden");
$(".MessageBox").removeClass("hidden");
} else {
$(".worksInfoBox").removeClass("hidden");
$(".userInfoBox").removeClass("hidden");
$(".MessageBox").addClass("hidden");
}
show();
}
function showUserInfo(user) { function showUserInfo(user) {
$(".userEmail").text(user.email); $(".userEmail").text(user.email);
$(".userId").text(user.id); $(".userId").text(user.id);
...@@ -384,5 +446,81 @@ function showUserInfo(user) { ...@@ -384,5 +446,81 @@ function showUserInfo(user) {
function show() { function show() {
$(".objectId").text(Manager.objectId); $(".objectId").text(Manager.objectId);
if (!Manager.sendPush) {
$(".NotSendPushStatus").removeClass("hidden");
$(".SendPushStatus").addClass("hidden");
} else {
$(".NotSendPushStatus").addClass("hidden");
$(".SendPushStatus").removeClass("hidden");
}
if (Manager.isYoumi.toString() === "1") {
$(".isYoumi").removeClass("hidden");
var youmiDom = $(".youmiTime");
if (Manager.dateyoumiCreateTime > Date.parse('2021-04-02')) {
youmiDom.removeClass("col-red") ;
youmiDom.addClass("col-green") ;
} else {
youmiDom.addClass("col-red") ;
youmiDom.removeClass("col-green") ;
}
youmiDom.text(Manager.youmiCreateTime);
} else {
$(".isYoumi").addClass("hidden");
}
if (Manager.inZone === false) {
$(".addZone").removeClass("hidden");
$(".removeZone").addClass("hidden");
} else {
$(".addZone").addClass("hidden");
$(".removeZone").removeClass("hidden");
}
var userPermissionDom = $(".userPermission");
userPermissionDom.removeClass("userPermission_on");
userPermissionDom.addClass("userPermission_off");
if (Manager.userPermission === undefined) {
Manager.userPermission = -1;
}
switch (Manager.userPermission.toString()) {
case "-1":
userPermissionDom.removeClass("userPermission_on");
$(".userPermission-2").removeClass("userPermission_off");
$(".userPermission-2").addClass("userPermission_on");
break;
case "0":
userPermissionDom.removeClass("userPermission_on");
$(".userPermission-0").removeClass("userPermission_off");
$(".userPermission-0").addClass("userPermission_on");
break;
case "1":
userPermissionDom.removeClass("userPermission_on");
$(".userPermission-1").removeClass("userPermission_off");
$(".userPermission-1").addClass("userPermission_on");
break;
}
var permissionDom = $(".permission");
permissionDom.removeClass("userPermission_on");
permissionDom.addClass("userPermission_off");
if (Manager.permission === undefined) {
Manager.permission = -1;
}
switch (Manager.permission.toString()) {
case "-1":
permissionDom.removeClass("userPermission_on");
$(".permission-2").removeClass("userPermission_off");
$(".permission-2").addClass("userPermission_on");
break;
case "0":
permissionDom.removeClass("userPermission_on");
$(".permission-0").removeClass("userPermission_off");
$(".permission-0").addClass("userPermission_on");
break;
case "1":
permissionDom.removeClass("userPermission_on");
$(".permission-1").removeClass("userPermission_off");
$(".permission-1").addClass("userPermission_on");
break;
}
} }
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