合并master

master
lemon橪 2022-05-31 11:17:29 +08:00
commit 0e921de6c3
5 changed files with 123 additions and 40 deletions

View File

@ -9,27 +9,54 @@ import storage from "@/plugins/storage";
import { getBaseSite } from "@/api/common.js"; import { getBaseSite } from "@/api/common.js";
export default { export default {
name: "App", name: "App",
mounted() { mounted() {
this.init();
},
methods:{
init(){
if(!localStorage.getItem("siteName")||!localStorage.getItem("logoImg")||!localStorage.getItem("sitelogo_expiration_time")) {
this.getSite();
}else{
//
if (new Date() > localStorage.getItem("sitelogo_expiration_time")) {
this.getSite();
return;
}else{
window.document.title = localStorage.getItem("siteName");
//icon
let link =document.querySelector("link[rel*='icon']") ||document.createElement("link");
link.type = "image/x-icon";
link.href = localStorage.getItem("logoImg");
link.rel = "shortcut icon";
document.getElementsByTagName("head")[0].appendChild(link);
}
}
},
getSite(){
// //
getBaseSite().then((res) => { getBaseSite().then((res) => {
if (res.success && res.result.settingValue) { if (res.success && res.result.settingValue) {
let data = JSON.parse(res.result.settingValue); let data = JSON.parse(res.result.settingValue);
this.$store.commit("SET_LOGOIMG", data.buyerSideLogo); //
this.$store.commit("SET_SITENAME", data.siteName); var expirationTime = new Date().setHours(new Date().getHours() + 1);
storage.setItem("siteName", data.siteName); //
localStorage.setItem("sitelogo_expiration_time", expirationTime);
//
localStorage.setItem('siteName', data.siteName);
localStorage.setItem('logoImg', data.buyerSideLogo);
window.document.title = data.siteName; window.document.title = data.siteName;
//icon //icon
let link = let link =document.querySelector("link[rel*='icon']") ||document.createElement("link");
document.querySelector("link[rel*='icon']") ||
document.createElement("link");
link.type = "image/x-icon"; link.type = "image/x-icon";
link.href = data.buyerSideLogo; link.href = data.buyerSideLogo;
link.rel = "shortcut icon"; link.rel = "shortcut icon";
document.getElementsByTagName("head")[0].appendChild(link); document.getElementsByTagName("head")[0].appendChild(link);
} }
}); });
}, }
}
}; };
</script> </script>
<style lang="scss"> <style lang="scss">

View File

@ -122,7 +122,16 @@
" "
/> />
<div> <div>
<p>{{ goods.goodsSku.goodsName }}</p> <p>
{{ goods.goodsSku.goodsName }}
</p>
<p><Tag
v-if="goods.goodsSku.salesModel === 'WHOLESALE'"
class="goods-show-tag"
color="purple"
>
批发商品
</Tag></p>
<template <template
v-for="(promotion, promotionIndex) in goods.promotions" v-for="(promotion, promotionIndex) in goods.promotions"
> >

View File

@ -62,6 +62,13 @@
</span> </span>
</div> </div>
<div class="goods-show-detail"> <div class="goods-show-detail">
<Tag
v-if="item.content.salesModel === 'WHOLESALE'"
class="goods-show-tag"
color="purple"
>
批发
</Tag>
<span>{{ item.content.goodsName }}</span> <span>{{ item.content.goodsName }}</span>
</div> </div>
<div class="goods-show-num"> <div class="goods-show-num">
@ -85,7 +92,9 @@
</div> </div>
<div <div
class="goods-show-middle" class="goods-show-middle"
v-else-if="goodsListType.content.goodsType == 'PHYSICAL_GOODS'" v-else-if="
goodsListType.content.goodsType == 'PHYSICAL_GOODS'
"
> >
实物 实物
</div> </div>
@ -203,6 +212,7 @@ export default {
this.params.pageSize = val; this.params.pageSize = val;
this.getGoodsList(); this.getGoodsList();
}, },
// //
getGoodsList() { getGoodsList() {
this.loading = true; this.loading = true;
@ -255,6 +265,17 @@ export default {
padding: 0 3px; padding: 0 3px;
background-color: #e23a3a; background-color: #e23a3a;
} }
.goods-show-tag {
height: 18px;
width: 32px;
line-height: 14px;
white-space: nowrap;
text-align: center;
align-items: center;
padding: 0 3px;
}
.goods-show-seller { .goods-show-seller {
// padding:3px 0; // padding:3px 0;
vertical-align: middle; vertical-align: middle;

View File

@ -129,24 +129,27 @@ export default {
if (currWidth <= 1200) { if (currWidth <= 1200) {
this.sliceNum = 2; this.sliceNum = 2;
} }
//domainLogo
getBaseSite().then((res) => {
const { domainLogo, siteName } = JSON.parse(res.result.settingValue);
this.domainLogo = domainLogo; if(!localStorage.getItem("icon")||!localStorage.getItem("title")||!localStorage.getItem("icontitle_expiration_time")) {
//icon this.getSite();
this.setStore("icon", this.domainLogo); }else{
//
if (new Date() > localStorage.getItem("icontitle_expiration_time")) {
this.getSite();
return;
}else{
this.domainLogo = localStorage.getItem("icon");
let link = let link =
document.querySelector("link[rel*='icon']") || document.querySelector("link[rel*='icon']") ||
document.createElement("link"); document.createElement("link");
link.type = "image/x-icon"; link.type = "image/x-icon";
link.href = this.domainLogo; link.href = localStorage.getItem("icon");
link.rel = "shortcut icon"; link.rel = "shortcut icon";
document.getElementsByTagName("head")[0].appendChild(link); document.getElementsByTagName("head")[0].appendChild(link);
//siteName window.document.title = localStorage.getItem("title") + " - 运营后台";
this.setStore("title", siteName);
window.document.title = siteName + " - 运营后台"; }
}), }
// //
getNoticePage({}).then((res) => { getNoticePage({}).then((res) => {
@ -157,6 +160,28 @@ export default {
} }
}); });
}, },
getSite(){
//domainLogo
getBaseSite().then((res) => {
const { domainLogo, siteName } = JSON.parse(res.result.settingValue);
this.domainLogo = domainLogo;
//
var expirationTime = new Date().setHours(new Date().getHours() + 1);
//
localStorage.setItem("icontitle_expiration_time", expirationTime);
//
localStorage.setItem('icon', domainLogo);
localStorage.setItem('title', siteName);
let link =
document.querySelector("link[rel*='icon']") ||
document.createElement("link");
link.type = "image/x-icon";
link.href = domainLogo;
link.rel = "shortcut icon";
document.getElementsByTagName("head")[0].appendChild(link);
window.document.title = siteName + " - 运营后台";
})
},
// //
handleClickUserDropdown(name) { handleClickUserDropdown(name) {
// //

View File

@ -984,7 +984,8 @@ export default {
if (this.wholesaleData.length < 3) { if (this.wholesaleData.length < 3) {
this.wholesaleData.push({ this.wholesaleData.push({
price: price:
Number(this.wholesaleData[this.wholesaleData.length - 1].price) - 0.01, Number(this.wholesaleData[this.wholesaleData.length - 1].price) -
0.01,
num: num:
Number(this.wholesaleData[this.wholesaleData.length - 1].num) + 1, Number(this.wholesaleData[this.wholesaleData.length - 1].num) + 1,
goodsId: this.goodsId, goodsId: this.goodsId,
@ -1459,7 +1460,7 @@ export default {
cost: skus[index].cost, cost: skus[index].cost,
price: skus[index].price, price: skus[index].price,
[cloneTemp[0].name]: specItem.value, [cloneTemp[0].name]: specItem.value,
images: this.baseInfoForm.goodsGalleryFiles || [], images: skus[index].images || this.baseInfoForm.goodsGalleryFiles || [],
}; };
if (specItem.value !== "") { if (specItem.value !== "") {
obj.id = skus[index].id; obj.id = skus[index].id;