站点图标与logo分开添加与展示

master
chc 2022-12-22 15:17:13 +08:00
parent 2e4246e63b
commit d9e1a4a491
7 changed files with 119 additions and 96 deletions

174
buyer/package-lock.json generated
View File

@ -477,6 +477,70 @@
"webpack-merge": "^4.2.2"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"json5": {
"version": "2.2.2",
"resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.2.tgz",
"integrity": "sha512-46Tk9JiOL2z7ytNQWFLpj99RZkVgeHf87yGQKsIkaPz1qSH9UczKH1rO7K3wgRselo0tYMUNfecYpm/p1vC7tQ==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.4",
"resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.4.tgz",
"integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"postcss-loader": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/postcss-loader/-/postcss-loader-3.0.0.tgz",
@ -521,6 +585,28 @@
"ajv-errors": "^1.0.0",
"ajv-keywords": "^3.1.0"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
}
}
},
@ -10192,94 +10278,6 @@
}
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"json5": {
"version": "2.2.1",
"resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.1.tgz",
"integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.4",
"resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.4.tgz",
"integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-piczoom": {
"version": "1.0.6",
"resolved": "https://registry.npmmirror.com/vue-piczoom/-/vue-piczoom-1.0.6.tgz",

View File

@ -26,7 +26,7 @@ export default {
//icon
let link =document.querySelector("link[rel*='icon']") ||document.createElement("link");
link.type = "image/x-icon";
link.href = storage.getItem("logoImg");
link.href = storage.getItem("siteIcon");
link.rel = "shortcut icon";
document.getElementsByTagName("head")[0].appendChild(link);
}
@ -45,12 +45,12 @@ export default {
//
storage.setItem('siteName', data.siteName);
storage.setItem('logoImg', data.buyerSideLogo);
storage.setItem("siteIcon",data.buyerSideIcon);
window.document.title = data.siteName;
//icon
let link =document.querySelector("link[rel*='icon']") ||document.createElement("link");
link.type = "image/x-icon";
link.href = data.buyerSideLogo;
link.href = data.buyerSideIcon;
link.rel = "shortcut icon";
document.getElementsByTagName("head")[0].appendChild(link);
}

View File

@ -134,7 +134,7 @@ export default {
document.querySelector("link[rel*='icon']") ||
document.createElement("link");
link.type = "image/x-icon";
link.href = localStorage.getItem("icon");
link.href = localStorage.getItem("domainIcon");
link.rel = "shortcut icon";
document.getElementsByTagName("head")[0].appendChild(link);
window.document.title = localStorage.getItem("title") + " - 运营后台";

View File

@ -43,7 +43,7 @@ export default {
getSite() {
//domainLogo
getBaseSite().then((res) => {
const { domainLogo, siteName } = JSON.parse(res.result.settingValue);
const { domainLogo, domainIcon, siteName } = JSON.parse(res.result.settingValue);
this.domainLogo = domainLogo;
//
var expirationTime = new Date().setHours(new Date().getHours() + 1);
@ -51,6 +51,7 @@ export default {
localStorage.setItem("icontitle_expiration_time", expirationTime);
//
localStorage.setItem("icon", domainLogo);
localStorage.setItem("domainIcon", domainIcon);
localStorage.setItem("title", siteName);
let link =
document.querySelector("link[rel*='icon']") ||

View File

@ -18,6 +18,14 @@
<Button @click="onClickImg('domainLogo')"></Button>
</div>
</FormItem>
<FormItem label="后台Icon" prop="domainIcon">
<div class="label-item-upload">
<img v-if="formValidate.domainIcon" class="img" :src="formValidate.domainIcon" />
<img v-else class="img" src="../../../../assets/emptyImg.png" alt="">
<Button @click="onClickImg('domainIcon')"></Button>
</div>
</FormItem>
<FormItem label="买家端Logo" prop="buyerSideLogo">
<div class="label-item-upload">
<img v-if="formValidate.buyerSideLogo" class="img" :src="formValidate.buyerSideLogo" />
@ -25,6 +33,13 @@
<Button @click="onClickImg('buyerSideLogo')"></Button>
</div>
</FormItem>
<FormItem label="买家端Icon" prop="buyerSideIcon">
<div class="label-item-upload">
<img v-if="formValidate.buyerSideIcon" class="img" :src="formValidate.buyerSideIcon" />
<img v-else class="img" src="../../../../assets/emptyImg.png" alt="">
<Button @click="onClickImg('buyerSideIcon')"></Button>
</div>
</FormItem>
<FormItem label="商家端Logo" prop="storeSideLogo">
<div class="label-item-upload">
<img v-if="formValidate.storeSideLogo" class="img" :src="formValidate.storeSideLogo" />
@ -32,6 +47,13 @@
<Button @click="onClickImg('storeSideLogo')"></Button>
</div>
</FormItem>
<FormItem label="商家端Icon" prop="storeSideIcon">
<div class="label-item-upload">
<img v-if="formValidate.storeSideIcon" class="img" :src="formValidate.storeSideIcon" />
<img v-else class="img" src="../../../../assets/emptyImg.png" alt="">
<Button @click="onClickImg('storeSideIcon')"></Button>
</div>
</FormItem>
<FormItem label="站点地址" prop="staticPageAddress">
<Input v-model="formValidate.staticPageAddress" />

View File

@ -124,7 +124,7 @@ export default {
document.querySelector("link[rel*='icon']") ||
document.createElement("link");
link.type = "image/x-icon";
link.href = localStorage.getItem("sellerlogoImg");
link.href = localStorage.getItem("sellerIconImg");
link.rel = "shortcut icon";
document.getElementsByTagName("head")[0].appendChild(link);

View File

@ -20,6 +20,7 @@ export default {
if (
!localStorage.getItem("sellersiteName") ||
!localStorage.getItem("sellerlogoImg") ||
!localStorage.getItem("sellerIconImg") ||
!localStorage.getItem("seller_expiration_time")
) {
this.getSite();
@ -36,7 +37,7 @@ export default {
document.querySelector("link[rel*='icon']") ||
document.createElement("link");
link.type = "image/x-icon";
link.href = localStorage.getItem("sellerlogoImg");
link.href = localStorage.getItem("sellerIconImg");
link.rel = "shortcut icon";
document.getElementsByTagName("head")[0].appendChild(link);
}
@ -54,6 +55,7 @@ export default {
//
localStorage.setItem("sellersiteName", data.siteName);
localStorage.setItem("sellerlogoImg", data.storeSideLogo);
localStorage.setItem("sellerIconImg", data.storeSideIcon);
console.log(data, "datadadada");
window.document.title = data.siteName;
//icon
@ -61,7 +63,7 @@ export default {
document.querySelector("link[rel*='icon']") ||
document.createElement("link");
link.type = "image/x-icon";
link.href = data.storeSideLogo;
link.href = data.storeSideIcon;
link.rel = "shortcut icon";
document.getElementsByTagName("head")[0].appendChild(link);
}