feat(specialArea): 专区统一map处理,加入购物车添加动画效果

This commit is contained in:
woody 2025-05-07 11:57:58 +08:00
parent b80593f2b8
commit 8f9c980ad2
7 changed files with 89 additions and 84 deletions

20
i8n.js
View File

@ -579,17 +579,17 @@ module.exports = {
ENU_MENU_303: "免费注册", ENU_MENU_303: "免费注册",
ENU_MENU_310: "注册专区", ENU_MENU_310: "注册专区",
ENU_MENU_311: "自营专区", ENU_MENU_311: "自营专区",
ENU_MENU_312: "乐学易考", ENU_MENU_312: "乐学甄选",
ENU_MENU_320: "升级专区", ENU_MENU_320: "升级专区",
ENU_MENU_321: "自营专区", ENU_MENU_321: "自营专区",
ENU_MENU_322: "乐学易考", ENU_MENU_322: "乐学甄选",
ENU_MENU_323: "海粉专区", ENU_MENU_323: "海粉专区",
ENU_MENU_330: "复购专区", ENU_MENU_330: "复购专区",
ENU_MENU_331: "自营专区", ENU_MENU_331: "自营专区",
ENU_MENU_332: "复购合作", ENU_MENU_332: "复购合作",
ENU_MENU_333: "工具流", ENU_MENU_333: "工具流",
ENU_MENU_334: "直播专区", ENU_MENU_334: "直播专区",
ENU_MENU_335: "乐学易考", ENU_MENU_335: "乐学甄选",
ENU_MENU_336: "三方供应", ENU_MENU_336: "三方供应",
ENU_MENU_340: "福利专区", ENU_MENU_340: "福利专区",
ENU_MENU_350: "积分专区", ENU_MENU_350: "积分专区",
@ -962,9 +962,9 @@ module.exports = {
ENU_TRADE_T_121: "商品专区", ENU_TRADE_T_121: "商品专区",
ENU_TRADE_T_122: "复购合作", ENU_TRADE_T_122: "复购合作",
ENU_TRADE_T_123: "二次发货", ENU_TRADE_T_123: "二次发货",
ENU_TRADE_T_124: "乐学易考注册订单", ENU_TRADE_T_124: "乐学甄选注册订单",
ENU_TRADE_T_125: "乐学易考升级订单", ENU_TRADE_T_125: "乐学甄选升级订单",
ENU_TRADE_T_126: "乐学易考复购订单", ENU_TRADE_T_126: "乐学甄选复购订单",
ENU_TRADE_T_127: "海粉升级", ENU_TRADE_T_127: "海粉升级",
ENU_TRADE_T_128: "创客订单", ENU_TRADE_T_128: "创客订单",
ENU_TRADE_T_129: "续约订单", ENU_TRADE_T_129: "续约订单",
@ -1012,9 +1012,9 @@ module.exports = {
ENU_TRADE_T_619: "商品订单撤单返钱", ENU_TRADE_T_619: "商品订单撤单返钱",
ENU_TRADE_T_620: "合作订单撤单返钱", ENU_TRADE_T_620: "合作订单撤单返钱",
ENU_TRADE_T_621: "二次发货撤单返钱", ENU_TRADE_T_621: "二次发货撤单返钱",
ENU_TRADE_T_622: "乐学易考注册订单撤单返钱", ENU_TRADE_T_622: "乐学甄选注册订单撤单返钱",
ENU_TRADE_T_623: "乐学易考升级订单撤单返钱", ENU_TRADE_T_623: "乐学甄选升级订单撤单返钱",
ENU_TRADE_T_624: "乐学易考复购订单撤单返钱", ENU_TRADE_T_624: "乐学甄选复购订单撤单返钱",
ENU_TRADE_T_625: "海粉升级订单撤单返钱", ENU_TRADE_T_625: "海粉升级订单撤单返钱",
ENU_TRADE_T_628: "创客订单", ENU_TRADE_T_628: "创客订单",
ENU_TRADE_T_629: "续约订单", ENU_TRADE_T_629: "续约订单",
@ -2850,7 +2850,7 @@ module.exports = {
w_0026: "账号安全", w_0026: "账号安全",
w_0027: "地址管理", w_0027: "地址管理",
w_0028: "退出登录", w_0028: "退出登录",
w_0029: "乐学易考", w_0029: "乐学甄选",
w_0030: "安置架构", w_0030: "安置架构",
w_0031: "推荐架构", w_0031: "推荐架构",
w_0032: "简体中文", w_0032: "简体中文",

View File

@ -176,6 +176,7 @@ import * as api from "@/api/goods.js";
import * as ads from "@/api/register.js"; import * as ads from "@/api/register.js";
import specialListMixin from "@/mixins/special-list-mixin.js"; import specialListMixin from "@/mixins/special-list-mixin.js";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
console.log(specialListMixin, "....specialListMixin");
export default { export default {
name: "Tabbar", name: "Tabbar",
mixins: [specialListMixin], mixins: [specialListMixin],
@ -336,7 +337,7 @@ export default {
if (ctem.name == item.menuKey) { if (ctem.name == item.menuKey) {
ctem.isShow = true; ctem.isShow = true;
} }
if (ctem.children.length > 0) { if (ctem.children?.length > 0) {
ctem.children.forEach((stem) => { ctem.children.forEach((stem) => {
if (stem.name == item.menuKey) { if (stem.name == item.menuKey) {
stem.isShow = true; stem.isShow = true;
@ -344,7 +345,6 @@ export default {
} }
}); });
} }
console.log(ctem.value == 13);
if (ctem.value == 13) { if (ctem.value == 13) {
ctem.isShow = false; ctem.isShow = false;
} }

View File

@ -39,7 +39,7 @@
<script> <script>
import { numberToCurrencyNo, isLocal } from "@/util/numberToCurrency"; import { numberToCurrencyNo, isLocal } from "@/util/numberToCurrency";
import { specialAreaMap } from "@/util/special-area-map.js";
export default { export default {
props: { props: {
title: { title: {
@ -64,18 +64,25 @@ export default {
return isLocal(numberToCurrencyNo(price)); return isLocal(numberToCurrencyNo(price));
}, },
goToMore(specialArea) { goToMore(specialArea) {
console.log(
"🚀 ~ goToMore ~ specialArea",
specialArea,
this.specialAreaId
);
if (this.$router && this.specialAreaId) { if (this.$router && this.specialAreaId) {
const query = {
// specialArea26 id3
id:
specialArea === specialAreaMap.ezLearnRep.value
? specialAreaMap.repurchase.value
: this.specialAreaId,
};
if (
specialArea !== query.id ||
specialArea === specialAreaMap.self.value
) {
Object.assign(query, {
idTh: specialArea,
});
}
this.$router.push({ this.$router.push({
path: "/shoppingMall", path: "/shoppingMall",
query: { query,
idTh: specialArea || this.specialAreaId,
id: this.specialAreaId,
},
}); });
} else if (!this.specialAreaId) { } else if (!this.specialAreaId) {
console.error("Special area ID (code) is missing."); console.error("Special area ID (code) is missing.");

View File

@ -1,47 +1,16 @@
import { specialAreaMap } from "@/util/special-area-map.js";
console.log(specialAreaMap, "....specialAreaMap");
export default { export default {
data() { data() {
return { return {
zoneList: [ zoneList: [
specialAreaMap.regiest,
specialAreaMap.upgrade,
{ {
label: "注册专区", ...specialAreaMap.repurchase,
value: 24, children: [specialAreaMap.ezLearnRep, specialAreaMap.self],
name: "regiest",
defaultChildId: 24,
children: [],
},
{
label: "升级专区",
value: 25,
name: "upgrade",
defaultChildId: 25,
children: [],
},
{
label: "复购专区",
value: 3,
name: "repurchase",
children: [
{
label: "乐学易考",
value: 26,
name: "ezLearnRep",
},
{
label: "自营专区",
value: 3,
name: "self",
},
],
},
{
label: "重消专区",
value: 10,
children: [],
name: "rescission",
}, },
specialAreaMap.rescission,
{ {
label: "续约专区", label: "续约专区",
value: 30, value: 30,

View File

@ -0,0 +1,34 @@
export const specialAreaMap = {
// 父级id 3
ezLearnRep: {
label: "乐学甄选",
value: 26,
name: "ezLearnRep",
},
repurchase: {
label: "复购专区",
value: 3,
name: "repurchase",
},
// 父级id 3
self: {
label: "自营专区",
value: 3,
name: "self",
},
upgrade: {
label: "升级专区",
value: 25,
name: "upgrade",
},
regiest: {
label: "注册专区",
value: 24,
name: "regiest",
},
rescission: {
label: "重消专区",
value: 10,
name: "rescission",
},
};

View File

@ -289,7 +289,7 @@ import Sidebar from "@/components/Sidebar.vue";
import * as api from "@/api/goods.js"; import * as api from "@/api/goods.js";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import selSpaceGoods from "@/components/selSpaceGoods.vue"; import selSpaceGoods from "@/components/selSpaceGoods.vue";
import { specialAreaMap } from "@/util/special-area-map.js";
export default { export default {
components: { components: {
personInfo, personInfo,
@ -344,9 +344,7 @@ export default {
], ],
}, },
{ {
label: "注册专区", ...specialAreaMap.regiest,
value: 24,
name: "regiest",
children: [ children: [
{ {
label: "自营专区", label: "自营专区",
@ -356,9 +354,7 @@ export default {
], ],
}, },
{ {
label: "升级专区", ...specialAreaMap.upgrade,
value: 25,
name: "upgrade",
children: [ children: [
{ {
label: "自营专区", label: "自营专区",
@ -373,9 +369,7 @@ export default {
], ],
}, },
{ {
label: "复购专区", ...specialAreaMap.repurchase,
value: 3,
name: "repurchase",
children: [ children: [
{ {
label: "自营专区", label: "自营专区",
@ -392,11 +386,7 @@ export default {
value: 22, value: 22,
name: "cooperation", name: "cooperation",
}, },
{ specialAreaMap.ezLearnRep,
label: "乐学易考",
value: 26,
name: "ezLearnRep",
},
{ {
label: "直播专区", label: "直播专区",
value: 14, value: 14,
@ -421,12 +411,7 @@ export default {
// children: [], // children: [],
// name: 'integral', // name: 'integral',
// }, // },
{ specialAreaMap.rescission,
label: "重消专区",
value: 10,
children: [],
name: "rescission",
},
], ],
}; };
}, },

View File

@ -262,7 +262,7 @@
</div> </div>
<!-- <img class="addCarImg" :src="addCarImg3" alt=""> --> <!-- <img class="addCarImg" :src="addCarImg3" alt=""> -->
<div class="addCarImg1"> <div class="addCarImg1">
<img :src="addCarImg2" alt="" /> <i class="el-icon-shopping-cart-2"></i>
<div>加入购物车</div> <div>加入购物车</div>
</div> </div>
<div class="md"> <div class="md">
@ -364,7 +364,10 @@
" "
@click.stop="addToCar($event, item)" @click.stop="addToCar($event, item)"
> >
<img :src="addCarImg1" alt="" /> <i
class="el-icon-shopping-cart-2"
style="font-size: 16px; font-weight: 600; margin-right: 8px"
></i>
<div>加入购物车</div> <div>加入购物车</div>
</div> </div>
<div class="md"> <div class="md">
@ -674,7 +677,7 @@ export default {
if (ctem.name == item.menuKey) { if (ctem.name == item.menuKey) {
ctem.isShow = true; ctem.isShow = true;
} }
if (ctem.children.length > 0) { if (ctem.children?.length > 0) {
ctem.children.forEach((stem) => { ctem.children.forEach((stem) => {
if (stem.name == item.menuKey) { if (stem.name == item.menuKey) {
stem.isShow = true; stem.isShow = true;
@ -1331,6 +1334,7 @@ export default {
color: var(--primary-color); color: var(--primary-color);
font-weight: 500; font-weight: 500;
padding: 3px 0; padding: 3px 0;
transition: all 0.3s ease-in-out;
img { img {
width: 25px; width: 25px;
@ -1342,6 +1346,12 @@ export default {
border-radius: 5px; border-radius: 5px;
} }
.addCarImg:hover {
transform: scale(1.05);
background-color: var(--primary-color);
color: #fff;
}
.addCarImg1 { .addCarImg1 {
display: flex; display: flex;
justify-content: center; justify-content: center;