Commit ab34825c by 李嘉林

feat: 动态设置门店文字颜色

parent bc7cb4c5
...@@ -55,13 +55,14 @@ export default { ...@@ -55,13 +55,14 @@ export default {
mounted() { mounted() {
this.bacImage = `url(${this.pageSettingData.backgroundImage})`; this.bacImage = `url(${this.pageSettingData.backgroundImage})`;
this.imgRgb = `${this.pageSettingData.backgroundColor}`; this.imgRgb = `${this.pageSettingData.backgroundColor}`;
this.mpApp.setStoreAddrColor(this.imgRgb);
}, },
computed: { computed: {
}, },
methods: { methods: {
setHomeBgImg({ backgroundImage, imgRgb }) { setHomeBgImg({ backgroundImage, imgRgb }) {
// this.bacImage = backgroundImage; this.mpApp.setStoreAddrColor(imgRgb);
if (this.pageCode != 1) return; if (this.pageCode != 1) return;
this.bacImage = ""; this.bacImage = "";
this.imgRgb = imgRgb; this.imgRgb = imgRgb;
......
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
<div class="logo"> <div class="logo">
<image :src="logoUrl" alt=""></image> <image :src="logoUrl" alt=""></image>
</div> </div>
<div class="contentInfo flex" v-if="name != ''"> <div class="contentInfo flex" v-if="name != ''" :style="{
'color': imgRgb,
}">
<p class="info">{{ name }}</p> <p class="info">{{ name }}</p>
<p class="addr" v-if="distanceForXinHua">{{ distanceForXinHua | formatDistance}}</p> <p class="addr" v-if="distanceForXinHua">{{ distanceForXinHua | formatDistance}}</p>
<p class="change"><i class="ant-fanhui-line"></i></p> <p class="change"><i class="ant-fanhui-line"></i></p>
...@@ -36,9 +38,11 @@ export default { ...@@ -36,9 +38,11 @@ export default {
logoUrl: "", logoUrl: "",
openThousandsStoresFlag: false, openThousandsStoresFlag: false,
distanceForXinHua: 0, distanceForXinHua: 0,
imgRgb: "",
}; };
}, },
async onLoad() { async onLoad() {
this.mpApp.setStoreAddrColor = this.setStoreAddrColor;
try { try {
this.getLocationHandle(() => { this.getLocationHandle(() => {
this.$emit("toUpdate"); this.$emit("toUpdate");
...@@ -63,6 +67,9 @@ export default { ...@@ -63,6 +67,9 @@ export default {
computed: { computed: {
}, },
methods: { methods: {
setStoreAddrColor(imgRgb) {
this.imgRgb = imgRgb;
},
reloadName() { reloadName() {
let { offlineShopName } = getStoreInfo(); let { offlineShopName } = getStoreInfo();
this.name = decodeURI(offlineShopName) || ""; this.name = decodeURI(offlineShopName) || "";
...@@ -135,23 +142,25 @@ export default { ...@@ -135,23 +142,25 @@ export default {
align-items: center; align-items: center;
.contentInfo { .contentInfo {
height: 0;
background-color: currentColor;
align-items: center; align-items: center;
p{
filter: grayscale(1) contrast(999) invert(1);
}
.info { .info {
font-size: 14px; font-size: 14px;
color: #333;
flex: 1; flex: 1;
} }
.addr{ .addr{
font-size: 12px; font-size: 12px;
margin-left: 4px; margin-left: 4px;
color: #333;
} }
.change { .change {
flex-shrink: 0; flex-shrink: 0;
padding-left: 6px; padding-left: 6px;
color: #333;
font-size: 14px; font-size: 14px;
align-items: center; align-items: center;
i{ i{
......
...@@ -106,7 +106,9 @@ mpApp.openSelectGoods = function () { } ...@@ -106,7 +106,9 @@ mpApp.openSelectGoods = function () { }
// 打开选择商品规格(2B)弹窗 // 打开选择商品规格(2B)弹窗
mpApp.openTwoBAddCart = function () { } mpApp.openTwoBAddCart = function () { }
// 动态设置首页背景图片 // 动态设置首页背景图片
mpApp.setHomeBgImg = function () {} mpApp.setHomeBgImg = function () { }
// 动态设置导航栏颜色
mpApp.setStoreAddrColor = function () {}
/** /**
* 组件点击行为收集 * 组件点击行为收集
......
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