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

View File

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

View File

@ -39,7 +39,7 @@
<script>
import { numberToCurrencyNo, isLocal } from "@/util/numberToCurrency";
import { specialAreaMap } from "@/util/special-area-map.js";
export default {
props: {
title: {
@ -64,18 +64,25 @@ export default {
return isLocal(numberToCurrencyNo(price));
},
goToMore(specialArea) {
console.log(
"🚀 ~ goToMore ~ specialArea",
specialArea,
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({
path: "/shoppingMall",
query: {
idTh: specialArea || this.specialAreaId,
id: this.specialAreaId,
},
query,
});
} else if (!this.specialAreaId) {
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 {
data() {
return {
zoneList: [
specialAreaMap.regiest,
specialAreaMap.upgrade,
{
label: "注册专区",
value: 24,
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.repurchase,
children: [specialAreaMap.ezLearnRep, specialAreaMap.self],
},
specialAreaMap.rescission,
{
label: "续约专区",
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 { mapGetters } from "vuex";
import selSpaceGoods from "@/components/selSpaceGoods.vue";
import { specialAreaMap } from "@/util/special-area-map.js";
export default {
components: {
personInfo,
@ -344,9 +344,7 @@ export default {
],
},
{
label: "注册专区",
value: 24,
name: "regiest",
...specialAreaMap.regiest,
children: [
{
label: "自营专区",
@ -356,9 +354,7 @@ export default {
],
},
{
label: "升级专区",
value: 25,
name: "upgrade",
...specialAreaMap.upgrade,
children: [
{
label: "自营专区",
@ -373,9 +369,7 @@ export default {
],
},
{
label: "复购专区",
value: 3,
name: "repurchase",
...specialAreaMap.repurchase,
children: [
{
label: "自营专区",
@ -392,11 +386,7 @@ export default {
value: 22,
name: "cooperation",
},
{
label: "乐学易考",
value: 26,
name: "ezLearnRep",
},
specialAreaMap.ezLearnRep,
{
label: "直播专区",
value: 14,
@ -421,12 +411,7 @@ export default {
// children: [],
// name: 'integral',
// },
{
label: "重消专区",
value: 10,
children: [],
name: "rescission",
},
specialAreaMap.rescission,
],
};
},

View File

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