chore: 清理项目中自动生成的vue.js及sourcemap文件
本次提交删除了所有由IDE自动生成的*.vue.js编译临时文件和对应的.map源映射文件,这些文件属于本地开发产生的中间产物,不应该被提交到版本仓库中。
This commit is contained in:
parent
260d51c9eb
commit
de67c1d494
|
|
@ -25,6 +25,8 @@ coverage
|
|||
*.sw?
|
||||
|
||||
*.tsbuildinfo
|
||||
*.vue.js
|
||||
*.vue.js.map
|
||||
|
||||
.eslintcache
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
const __VLS_ctx = {};
|
||||
let __VLS_components;
|
||||
let __VLS_intrinsics;
|
||||
let __VLS_directives;
|
||||
let __VLS_0;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.routerView | typeof __VLS_components.RouterView | typeof __VLS_components['router-view']} */
|
||||
routerView;
|
||||
// @ts-ignore
|
||||
const __VLS_1 = __VLS_asFunctionalComponent1(__VLS_0, new __VLS_0({}));
|
||||
const __VLS_2 = __VLS_1({}, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
||||
var __VLS_5;
|
||||
var __VLS_3;
|
||||
const __VLS_export = (await import('vue')).defineComponent({});
|
||||
export default {};
|
||||
//# sourceMappingURL=App.vue.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"App.vue.js","sourceRoot":"","sources":["App.vue"],"names":[],"mappings":"AAiBA,MAAM,SAAS,GAAG,EAA2C,CAAC;AAG9D,IAAI,gBAAiE,CAAC;AACtE,IAAI,gBAAkE,CAAC;AAEvE,IAAI,gBAAyE,CAAC;AAC9E,IAAI,OAA2J,CAAC;AAChK,6IAA6I;AAC7I,UAAU,CAAC;AACX,aAAa;AACb,MAAM,OAAO,GAAG,4BAA4B,CAAC,OAAO,EAAE,IAAI,OAAO,CAAC,EACjE,CAAC,CAAC,CAAC;AACJ,MAAM,OAAO,GAAG,OAAO,CAAC,EACvB,EAAE,GAAG,iCAAiC,CAAC,OAAO,CAAC,CAAC,CAAC;AAClD,IAAI,OAA8D,CAAC;AACnE,IAAI,OAAuE,CAAC;AAG5E,MAAM,YAAY,GAAG,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,EAC1D,CAAC,CAAC;AACH,eAAe,EAAyB,CAAC"}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
const __VLS_props = defineProps();
|
||||
const __VLS_ctx = {
|
||||
...{},
|
||||
...{},
|
||||
...{},
|
||||
};
|
||||
let __VLS_components;
|
||||
let __VLS_intrinsics;
|
||||
let __VLS_directives;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "empty-state" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['empty-state']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "empty-icon" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['empty-icon']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({
|
||||
...{ class: "empty-text" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['empty-text']} */ ;
|
||||
(__VLS_ctx.description || '暂无数据');
|
||||
// @ts-ignore
|
||||
[description,];
|
||||
const __VLS_export = (await import('vue')).defineComponent({
|
||||
__typeProps: {},
|
||||
});
|
||||
export default {};
|
||||
//# sourceMappingURL=EmptyState.vue.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"EmptyState.vue.js","sourceRoot":"","sources":["EmptyState.vue"],"names":[],"mappings":"AAgDA,MAAM,WAAW,GAAG,WAAW,EAAe,CAAA;AAI9C,MAAM,SAAS,GAAG;IAClB,GAAG,EAA2C;IAC9C,GAAG,EAAoC;IACvC,GAAG,EAAwB;CAC1B,CAAC;AAGF,IAAI,gBAAiE,CAAC;AACtE,IAAI,gBAAkE,CAAC;AAEvE,IAAI,gBAAyE,CAAC;AAK9E,0BAA0B,CAAC,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACvE,GAAG,EAAE,KAAK,EAAE,aAAa,EAAE;CAC1B,CAAC,CAAC;AACH,sDAAsD,CAAA,CAAC;AACvD,0BAA0B,CAAC,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACvE,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE;CACzB,CAAC,CAAC;AACH,qDAAqD,CAAA,CAAC;AACtD,0BAA0B,CAAC,gBAAgB,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IACnE,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE;CACzB,CAAC,CAAC;AACH,qDAAqD,CAAA,CAAC;AACtD,CAAE,SAAS,CAAC,WAAW,IAAI,MAAM,CAAE,CAAC;AAGpC,aAAa;AACb,CAAC,WAAW,EAAE,CAAC;AACf,MAAM,YAAY,GAAG,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC;IAC3D,WAAW,EAAE,EAAuB;CACnC,CAAC,CAAC;AACH,eAAe,EAAyB,CAAC"}
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
import { useRouter } from 'vue-router';
|
||||
const router = useRouter();
|
||||
const year = new Date().getFullYear();
|
||||
const __VLS_ctx = {
|
||||
...{},
|
||||
...{},
|
||||
};
|
||||
let __VLS_components;
|
||||
let __VLS_intrinsics;
|
||||
let __VLS_directives;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.footer, __VLS_intrinsics.footer)({
|
||||
...{ class: "app-footer" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['app-footer']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "footer-inner" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['footer-inner']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "footer-brand" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['footer-brand']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "brand-icon" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['brand-icon']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "brand-name" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['brand-name']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "footer-links" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['footer-links']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ onClick: (...[$event]) => {
|
||||
return (__VLS_ctx.router.push('/notice'));
|
||||
// @ts-ignore
|
||||
[router,];
|
||||
} },
|
||||
...{ class: "footer-link" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['footer-link']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ onClick: (...[$event]) => {
|
||||
return (__VLS_ctx.router.push('/chat'));
|
||||
// @ts-ignore
|
||||
[router,];
|
||||
} },
|
||||
...{ class: "footer-link" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['footer-link']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ onClick: (...[$event]) => {
|
||||
return (__VLS_ctx.router.push('/user'));
|
||||
// @ts-ignore
|
||||
[router,];
|
||||
} },
|
||||
...{ class: "footer-link" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['footer-link']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({
|
||||
...{ class: "footer-copy" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['footer-copy']} */ ;
|
||||
(__VLS_ctx.year);
|
||||
// @ts-ignore
|
||||
[year,];
|
||||
const __VLS_export = (await import('vue')).defineComponent({});
|
||||
export default {};
|
||||
//# sourceMappingURL=AppFooter.vue.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"AppFooter.vue.js","sourceRoot":"","sources":["AppFooter.vue"],"names":[],"mappings":"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"}
|
||||
|
|
@ -1,306 +0,0 @@
|
|||
import { ref, onMounted, watch } from 'vue';
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
import { Search, ShoppingCart, User as UserIcon } from '@element-plus/icons-vue';
|
||||
import { useUserStore } from '@/stores/modules/user';
|
||||
import { getCategoryTreeApi } from '@/api/category';
|
||||
import { getCartCountApi } from '@/api/cart';
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const userStore = useUserStore();
|
||||
const searchKeyword = ref('');
|
||||
const categories = ref([]);
|
||||
const cartCount = ref(0);
|
||||
onMounted(async () => {
|
||||
try {
|
||||
categories.value = await getCategoryTreeApi();
|
||||
}
|
||||
catch {
|
||||
/* 分类加载失败不阻塞页面 */
|
||||
}
|
||||
fetchCartCount();
|
||||
});
|
||||
// 路由切换时刷新购物车数量
|
||||
watch(() => route.path, () => {
|
||||
fetchCartCount();
|
||||
});
|
||||
async function fetchCartCount() {
|
||||
if (userStore.isLoggedIn) {
|
||||
try {
|
||||
cartCount.value = await getCartCountApi();
|
||||
}
|
||||
catch {
|
||||
cartCount.value = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
cartCount.value = 0;
|
||||
}
|
||||
}
|
||||
function handleSearch() {
|
||||
const keyword = searchKeyword.value.trim();
|
||||
if (keyword) {
|
||||
router.push({ path: '/search', query: { q: keyword } });
|
||||
}
|
||||
}
|
||||
function goToCart() {
|
||||
router.push('/cart');
|
||||
}
|
||||
function goToUser() {
|
||||
if (userStore.isLoggedIn) {
|
||||
router.push('/user');
|
||||
}
|
||||
else {
|
||||
router.push('/login');
|
||||
}
|
||||
}
|
||||
const __VLS_ctx = {
|
||||
...{},
|
||||
...{},
|
||||
};
|
||||
let __VLS_components;
|
||||
let __VLS_intrinsics;
|
||||
let __VLS_directives;
|
||||
/** @type {__VLS_StyleScopedClasses['header-nav']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['search-box']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['search-box']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.header, __VLS_intrinsics.header)({
|
||||
...{ class: "app-header" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['app-header']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "header-inner" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['header-inner']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ onClick: (...[$event]) => {
|
||||
return (__VLS_ctx.router.push('/'));
|
||||
// @ts-ignore
|
||||
[router,];
|
||||
} },
|
||||
...{ class: "header-brand" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['header-brand']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "brand-icon" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['brand-icon']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "brand-name" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['brand-name']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.nav, __VLS_intrinsics.nav)({
|
||||
...{ class: "header-nav" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['header-nav']} */ ;
|
||||
let __VLS_0;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.routerLink | typeof __VLS_components.RouterLink | typeof __VLS_components['router-link'] | typeof __VLS_components.routerLink | typeof __VLS_components.RouterLink | typeof __VLS_components['router-link']} */
|
||||
routerLink;
|
||||
// @ts-ignore
|
||||
const __VLS_1 = __VLS_asFunctionalComponent1(__VLS_0, new __VLS_0({
|
||||
to: "/",
|
||||
...{ class: "nav-item" },
|
||||
activeClass: "active",
|
||||
exact: true,
|
||||
}));
|
||||
const __VLS_2 = __VLS_1({
|
||||
to: "/",
|
||||
...{ class: "nav-item" },
|
||||
activeClass: "active",
|
||||
exact: true,
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
||||
/** @type {__VLS_StyleScopedClasses['nav-item']} */ ;
|
||||
const { default: __VLS_5 } = __VLS_3.slots;
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_3;
|
||||
for (const [cat] of __VLS_vFor((__VLS_ctx.categories))) {
|
||||
let __VLS_6;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.routerLink | typeof __VLS_components.RouterLink | typeof __VLS_components['router-link'] | typeof __VLS_components.routerLink | typeof __VLS_components.RouterLink | typeof __VLS_components['router-link']} */
|
||||
routerLink;
|
||||
// @ts-ignore
|
||||
const __VLS_7 = __VLS_asFunctionalComponent1(__VLS_6, new __VLS_6({
|
||||
key: (cat.id),
|
||||
to: (`/category/${cat.id}`),
|
||||
...{ class: "nav-item" },
|
||||
}));
|
||||
const __VLS_8 = __VLS_7({
|
||||
key: (cat.id),
|
||||
to: (`/category/${cat.id}`),
|
||||
...{ class: "nav-item" },
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_7));
|
||||
/** @type {__VLS_StyleScopedClasses['nav-item']} */ ;
|
||||
const { default: __VLS_11 } = __VLS_9.slots;
|
||||
(cat.name);
|
||||
// @ts-ignore
|
||||
[categories,];
|
||||
var __VLS_9;
|
||||
// @ts-ignore
|
||||
[];
|
||||
}
|
||||
let __VLS_12;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.routerLink | typeof __VLS_components.RouterLink | typeof __VLS_components['router-link'] | typeof __VLS_components.routerLink | typeof __VLS_components.RouterLink | typeof __VLS_components['router-link']} */
|
||||
routerLink;
|
||||
// @ts-ignore
|
||||
const __VLS_13 = __VLS_asFunctionalComponent1(__VLS_12, new __VLS_12({
|
||||
to: "/seckill",
|
||||
...{ class: "nav-item nav-hot" },
|
||||
}));
|
||||
const __VLS_14 = __VLS_13({
|
||||
to: "/seckill",
|
||||
...{ class: "nav-item nav-hot" },
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_13));
|
||||
/** @type {__VLS_StyleScopedClasses['nav-item']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['nav-hot']} */ ;
|
||||
const { default: __VLS_17 } = __VLS_15.slots;
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_15;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "header-actions" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['header-actions']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "search-box" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['search-box']} */ ;
|
||||
let __VLS_18;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elInput | typeof __VLS_components.ElInput | typeof __VLS_components['el-input']} */
|
||||
elInput;
|
||||
// @ts-ignore
|
||||
const __VLS_19 = __VLS_asFunctionalComponent1(__VLS_18, new __VLS_18({
|
||||
...{ 'onKeyup': {} },
|
||||
modelValue: (__VLS_ctx.searchKeyword),
|
||||
placeholder: "搜索零食...",
|
||||
prefixIcon: (__VLS_ctx.Search),
|
||||
size: "default",
|
||||
...{ class: "search-input" },
|
||||
}));
|
||||
const __VLS_20 = __VLS_19({
|
||||
...{ 'onKeyup': {} },
|
||||
modelValue: (__VLS_ctx.searchKeyword),
|
||||
placeholder: "搜索零食...",
|
||||
prefixIcon: (__VLS_ctx.Search),
|
||||
size: "default",
|
||||
...{ class: "search-input" },
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_19));
|
||||
let __VLS_23;
|
||||
const __VLS_24 = {
|
||||
/** @type {typeof __VLS_23.keyup} */
|
||||
onKeyup: (__VLS_ctx.handleSearch),
|
||||
};
|
||||
/** @type {__VLS_StyleScopedClasses['search-input']} */ ;
|
||||
var __VLS_21;
|
||||
var __VLS_22;
|
||||
let __VLS_25;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elBadge | typeof __VLS_components.ElBadge | typeof __VLS_components['el-badge'] | typeof __VLS_components.elBadge | typeof __VLS_components.ElBadge | typeof __VLS_components['el-badge']} */
|
||||
elBadge;
|
||||
// @ts-ignore
|
||||
const __VLS_26 = __VLS_asFunctionalComponent1(__VLS_25, new __VLS_25({
|
||||
value: (__VLS_ctx.cartCount),
|
||||
max: (99),
|
||||
showZero: (false),
|
||||
...{ class: "action-badge" },
|
||||
}));
|
||||
const __VLS_27 = __VLS_26({
|
||||
value: (__VLS_ctx.cartCount),
|
||||
max: (99),
|
||||
showZero: (false),
|
||||
...{ class: "action-badge" },
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_26));
|
||||
/** @type {__VLS_StyleScopedClasses['action-badge']} */ ;
|
||||
const { default: __VLS_30 } = __VLS_28.slots;
|
||||
let __VLS_31;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button']} */
|
||||
elButton;
|
||||
// @ts-ignore
|
||||
const __VLS_32 = __VLS_asFunctionalComponent1(__VLS_31, new __VLS_31({
|
||||
...{ 'onClick': {} },
|
||||
icon: (__VLS_ctx.ShoppingCart),
|
||||
circle: true,
|
||||
...{ class: "action-btn" },
|
||||
}));
|
||||
const __VLS_33 = __VLS_32({
|
||||
...{ 'onClick': {} },
|
||||
icon: (__VLS_ctx.ShoppingCart),
|
||||
circle: true,
|
||||
...{ class: "action-btn" },
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_32));
|
||||
let __VLS_36;
|
||||
const __VLS_37 = {
|
||||
/** @type {typeof __VLS_36.click} */
|
||||
onClick: (__VLS_ctx.goToCart),
|
||||
};
|
||||
/** @type {__VLS_StyleScopedClasses['action-btn']} */ ;
|
||||
var __VLS_34;
|
||||
var __VLS_35;
|
||||
// @ts-ignore
|
||||
[searchKeyword, Search, handleSearch, cartCount, ShoppingCart, goToCart,];
|
||||
var __VLS_28;
|
||||
if (__VLS_ctx.userStore.isLoggedIn) {
|
||||
let __VLS_38;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button']} */
|
||||
elButton;
|
||||
// @ts-ignore
|
||||
const __VLS_39 = __VLS_asFunctionalComponent1(__VLS_38, new __VLS_38({
|
||||
...{ 'onClick': {} },
|
||||
icon: (__VLS_ctx.UserIcon),
|
||||
circle: true,
|
||||
...{ class: "action-btn" },
|
||||
}));
|
||||
const __VLS_40 = __VLS_39({
|
||||
...{ 'onClick': {} },
|
||||
icon: (__VLS_ctx.UserIcon),
|
||||
circle: true,
|
||||
...{ class: "action-btn" },
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_39));
|
||||
let __VLS_43;
|
||||
const __VLS_44 = {
|
||||
/** @type {typeof __VLS_43.click} */
|
||||
onClick: (__VLS_ctx.goToUser),
|
||||
};
|
||||
/** @type {__VLS_StyleScopedClasses['action-btn']} */ ;
|
||||
var __VLS_41;
|
||||
var __VLS_42;
|
||||
}
|
||||
else {
|
||||
let __VLS_45;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button'] | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button']} */
|
||||
elButton;
|
||||
// @ts-ignore
|
||||
const __VLS_46 = __VLS_asFunctionalComponent1(__VLS_45, new __VLS_45({
|
||||
...{ 'onClick': {} },
|
||||
type: "primary",
|
||||
round: true,
|
||||
size: "small",
|
||||
...{ class: "login-btn" },
|
||||
}));
|
||||
const __VLS_47 = __VLS_46({
|
||||
...{ 'onClick': {} },
|
||||
type: "primary",
|
||||
round: true,
|
||||
size: "small",
|
||||
...{ class: "login-btn" },
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_46));
|
||||
let __VLS_50;
|
||||
const __VLS_51 = {
|
||||
/** @type {typeof __VLS_50.click} */
|
||||
onClick: (...[$event]) => {
|
||||
if (!!(__VLS_ctx.userStore.isLoggedIn))
|
||||
throw 0;
|
||||
return (__VLS_ctx.router.push('/login'));
|
||||
// @ts-ignore
|
||||
[router, userStore, UserIcon, goToUser,];
|
||||
},
|
||||
};
|
||||
/** @type {__VLS_StyleScopedClasses['login-btn']} */ ;
|
||||
const { default: __VLS_52 } = __VLS_48.slots;
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_48;
|
||||
var __VLS_49;
|
||||
}
|
||||
// @ts-ignore
|
||||
[];
|
||||
const __VLS_export = (await import('vue')).defineComponent({});
|
||||
export default {};
|
||||
//# sourceMappingURL=AppHeader.vue.js.map
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,124 +0,0 @@
|
|||
import { computed } from 'vue';
|
||||
const props = defineProps();
|
||||
const emit = defineEmits();
|
||||
const priceLabel = computed(() => {
|
||||
const min = Number(props.product.minPrice);
|
||||
const max = Number(props.product.maxPrice);
|
||||
if (max <= 0 || min === max)
|
||||
return `¥${min.toFixed(2)}`;
|
||||
return `¥${min.toFixed(2)} - ¥${max.toFixed(2)}`;
|
||||
});
|
||||
const imageUrl = computed(() => {
|
||||
const img = props.product.mainImage;
|
||||
if (!img)
|
||||
return '';
|
||||
if (img.startsWith('http'))
|
||||
return img;
|
||||
return img;
|
||||
});
|
||||
const __VLS_ctx = {
|
||||
...{},
|
||||
...{},
|
||||
...{},
|
||||
...{},
|
||||
...{},
|
||||
};
|
||||
let __VLS_components;
|
||||
let __VLS_intrinsics;
|
||||
let __VLS_directives;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ onClick: (...[$event]) => {
|
||||
return (__VLS_ctx.$router.push(`/product/${__VLS_ctx.product.id}`));
|
||||
// @ts-ignore
|
||||
[$router, product,];
|
||||
} },
|
||||
...{ class: "product-card" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['product-card']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "card-image" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['card-image']} */ ;
|
||||
let __VLS_0;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elImage | typeof __VLS_components.ElImage | typeof __VLS_components['el-image'] | typeof __VLS_components.elImage | typeof __VLS_components.ElImage | typeof __VLS_components['el-image']} */
|
||||
elImage;
|
||||
// @ts-ignore
|
||||
const __VLS_1 = __VLS_asFunctionalComponent1(__VLS_0, new __VLS_0({
|
||||
src: (__VLS_ctx.imageUrl),
|
||||
fit: "cover",
|
||||
...{ class: "product-img" },
|
||||
lazy: true,
|
||||
}));
|
||||
const __VLS_2 = __VLS_1({
|
||||
src: (__VLS_ctx.imageUrl),
|
||||
fit: "cover",
|
||||
...{ class: "product-img" },
|
||||
lazy: true,
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
||||
/** @type {__VLS_StyleScopedClasses['product-img']} */ ;
|
||||
const { default: __VLS_5 } = __VLS_3.slots;
|
||||
{
|
||||
const { error: __VLS_6 } = __VLS_3.slots;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "image-placeholder" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['image-placeholder']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({});
|
||||
// @ts-ignore
|
||||
[imageUrl,];
|
||||
}
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_3;
|
||||
if (__VLS_ctx.product.isHot === 1) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "tag tag-hot" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['tag']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['tag-hot']} */ ;
|
||||
}
|
||||
if (__VLS_ctx.product.isNew === 1) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "tag tag-new" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['tag']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['tag-new']} */ ;
|
||||
}
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "card-body" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['card-body']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.h3, __VLS_intrinsics.h3)({
|
||||
...{ class: "product-name" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['product-name']} */ ;
|
||||
(__VLS_ctx.product.name);
|
||||
if (__VLS_ctx.product.brand) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({
|
||||
...{ class: "product-brand" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['product-brand']} */ ;
|
||||
(__VLS_ctx.product.brand);
|
||||
}
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "card-footer" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['card-footer']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "product-price" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['product-price']} */ ;
|
||||
(__VLS_ctx.priceLabel);
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "product-sales" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['product-sales']} */ ;
|
||||
(__VLS_ctx.product.sales);
|
||||
// @ts-ignore
|
||||
[product, product, product, product, product, product, priceLabel,];
|
||||
const __VLS_export = (await import('vue')).defineComponent({
|
||||
__typeEmits: {},
|
||||
__typeProps: {},
|
||||
});
|
||||
export default {};
|
||||
//# sourceMappingURL=ProductCard.vue.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"ProductCard.vue.js","sourceRoot":"","sources":["ProductCard.vue"],"names":[],"mappings":"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"}
|
||||
|
|
@ -1,285 +0,0 @@
|
|||
import { reactive, ref } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { User, Lock } from '@element-plus/icons-vue';
|
||||
import { useUserStore } from '@/stores/modules/user';
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const userStore = useUserStore();
|
||||
const formRef = ref();
|
||||
const loading = ref(false);
|
||||
const form = reactive({
|
||||
username: '',
|
||||
password: ''
|
||||
});
|
||||
const rules = {
|
||||
username: [
|
||||
{ required: true, message: '请输入用户名', trigger: 'blur' },
|
||||
{ min: 3, max: 50, message: '用户名长度 3-50', trigger: 'blur' }
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: '请输入密码', trigger: 'blur' },
|
||||
{ min: 6, max: 50, message: '密码长度 6-50', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
async function handleLogin() {
|
||||
if (!formRef.value)
|
||||
return;
|
||||
await formRef.value.validate(async (valid) => {
|
||||
if (!valid)
|
||||
return;
|
||||
loading.value = true;
|
||||
try {
|
||||
await userStore.login({
|
||||
username: form.username,
|
||||
password: form.password
|
||||
});
|
||||
ElMessage.success('登录成功');
|
||||
const redirect = route.query.redirect || '/';
|
||||
await router.push(redirect);
|
||||
}
|
||||
catch {
|
||||
/* 拦截器已提示错误 */
|
||||
}
|
||||
finally {
|
||||
loading.value = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
const __VLS_ctx = {
|
||||
...{},
|
||||
...{},
|
||||
};
|
||||
let __VLS_components;
|
||||
let __VLS_intrinsics;
|
||||
let __VLS_directives;
|
||||
/** @type {__VLS_StyleScopedClasses['login-card']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['login-left']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['login-right']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "login-page" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['login-page']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "login-bg" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['login-bg']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div)({
|
||||
...{ class: "blob blob-1" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['blob']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['blob-1']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div)({
|
||||
...{ class: "blob blob-2" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['blob']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['blob-2']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div)({
|
||||
...{ class: "blob blob-3" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['blob']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['blob-3']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "login-card" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['login-card']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "login-left" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['login-left']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "brand" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['brand']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "brand-icon" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['brand-icon']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "brand-text" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['brand-text']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.h1, __VLS_intrinsics.h1)({});
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({});
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "welcome" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['welcome']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.h2, __VLS_intrinsics.h2)({});
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({});
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.ul, __VLS_intrinsics.ul)({
|
||||
...{ class: "features" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['features']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.li, __VLS_intrinsics.li)({});
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "feature-icon" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['feature-icon']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.li, __VLS_intrinsics.li)({});
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "feature-icon" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['feature-icon']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.li, __VLS_intrinsics.li)({});
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "feature-icon" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['feature-icon']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "login-right" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['login-right']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.h2, __VLS_intrinsics.h2)({
|
||||
...{ class: "form-title" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['form-title']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({
|
||||
...{ class: "form-subtitle" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['form-subtitle']} */ ;
|
||||
let __VLS_0;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elForm | typeof __VLS_components.ElForm | typeof __VLS_components['el-form'] | typeof __VLS_components.elForm | typeof __VLS_components.ElForm | typeof __VLS_components['el-form']} */
|
||||
elForm;
|
||||
// @ts-ignore
|
||||
const __VLS_1 = __VLS_asFunctionalComponent1(__VLS_0, new __VLS_0({
|
||||
...{ 'onKeyup': {} },
|
||||
ref: "formRef",
|
||||
model: (__VLS_ctx.form),
|
||||
rules: (__VLS_ctx.rules),
|
||||
size: "large",
|
||||
...{ class: "login-form" },
|
||||
}));
|
||||
const __VLS_2 = __VLS_1({
|
||||
...{ 'onKeyup': {} },
|
||||
ref: "formRef",
|
||||
model: (__VLS_ctx.form),
|
||||
rules: (__VLS_ctx.rules),
|
||||
size: "large",
|
||||
...{ class: "login-form" },
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
||||
let __VLS_5;
|
||||
const __VLS_6 = {
|
||||
/** @type {typeof __VLS_5.keyup} */
|
||||
onKeyup: (__VLS_ctx.handleLogin),
|
||||
};
|
||||
var __VLS_7;
|
||||
/** @type {__VLS_StyleScopedClasses['login-form']} */ ;
|
||||
const { default: __VLS_9 } = __VLS_3.slots;
|
||||
let __VLS_10;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elFormItem | typeof __VLS_components.ElFormItem | typeof __VLS_components['el-form-item'] | typeof __VLS_components.elFormItem | typeof __VLS_components.ElFormItem | typeof __VLS_components['el-form-item']} */
|
||||
elFormItem;
|
||||
// @ts-ignore
|
||||
const __VLS_11 = __VLS_asFunctionalComponent1(__VLS_10, new __VLS_10({
|
||||
prop: "username",
|
||||
}));
|
||||
const __VLS_12 = __VLS_11({
|
||||
prop: "username",
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_11));
|
||||
const { default: __VLS_15 } = __VLS_13.slots;
|
||||
let __VLS_16;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elInput | typeof __VLS_components.ElInput | typeof __VLS_components['el-input']} */
|
||||
elInput;
|
||||
// @ts-ignore
|
||||
const __VLS_17 = __VLS_asFunctionalComponent1(__VLS_16, new __VLS_16({
|
||||
modelValue: (__VLS_ctx.form.username),
|
||||
placeholder: "请输入用户名",
|
||||
prefixIcon: (__VLS_ctx.User),
|
||||
clearable: true,
|
||||
}));
|
||||
const __VLS_18 = __VLS_17({
|
||||
modelValue: (__VLS_ctx.form.username),
|
||||
placeholder: "请输入用户名",
|
||||
prefixIcon: (__VLS_ctx.User),
|
||||
clearable: true,
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_17));
|
||||
// @ts-ignore
|
||||
[form, form, rules, handleLogin, User,];
|
||||
var __VLS_13;
|
||||
let __VLS_21;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elFormItem | typeof __VLS_components.ElFormItem | typeof __VLS_components['el-form-item'] | typeof __VLS_components.elFormItem | typeof __VLS_components.ElFormItem | typeof __VLS_components['el-form-item']} */
|
||||
elFormItem;
|
||||
// @ts-ignore
|
||||
const __VLS_22 = __VLS_asFunctionalComponent1(__VLS_21, new __VLS_21({
|
||||
prop: "password",
|
||||
}));
|
||||
const __VLS_23 = __VLS_22({
|
||||
prop: "password",
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_22));
|
||||
const { default: __VLS_26 } = __VLS_24.slots;
|
||||
let __VLS_27;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elInput | typeof __VLS_components.ElInput | typeof __VLS_components['el-input']} */
|
||||
elInput;
|
||||
// @ts-ignore
|
||||
const __VLS_28 = __VLS_asFunctionalComponent1(__VLS_27, new __VLS_27({
|
||||
modelValue: (__VLS_ctx.form.password),
|
||||
type: "password",
|
||||
placeholder: "请输入密码",
|
||||
prefixIcon: (__VLS_ctx.Lock),
|
||||
showPassword: true,
|
||||
clearable: true,
|
||||
}));
|
||||
const __VLS_29 = __VLS_28({
|
||||
modelValue: (__VLS_ctx.form.password),
|
||||
type: "password",
|
||||
placeholder: "请输入密码",
|
||||
prefixIcon: (__VLS_ctx.Lock),
|
||||
showPassword: true,
|
||||
clearable: true,
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_28));
|
||||
// @ts-ignore
|
||||
[form, Lock,];
|
||||
var __VLS_24;
|
||||
let __VLS_32;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elFormItem | typeof __VLS_components.ElFormItem | typeof __VLS_components['el-form-item'] | typeof __VLS_components.elFormItem | typeof __VLS_components.ElFormItem | typeof __VLS_components['el-form-item']} */
|
||||
elFormItem;
|
||||
// @ts-ignore
|
||||
const __VLS_33 = __VLS_asFunctionalComponent1(__VLS_32, new __VLS_32({}));
|
||||
const __VLS_34 = __VLS_33({}, ...__VLS_functionalComponentArgsRest(__VLS_33));
|
||||
const { default: __VLS_37 } = __VLS_35.slots;
|
||||
let __VLS_38;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button'] | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button']} */
|
||||
elButton;
|
||||
// @ts-ignore
|
||||
const __VLS_39 = __VLS_asFunctionalComponent1(__VLS_38, new __VLS_38({
|
||||
...{ 'onClick': {} },
|
||||
type: "primary",
|
||||
loading: (__VLS_ctx.loading),
|
||||
...{ class: "submit-btn" },
|
||||
}));
|
||||
const __VLS_40 = __VLS_39({
|
||||
...{ 'onClick': {} },
|
||||
type: "primary",
|
||||
loading: (__VLS_ctx.loading),
|
||||
...{ class: "submit-btn" },
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_39));
|
||||
let __VLS_43;
|
||||
const __VLS_44 = {
|
||||
/** @type {typeof __VLS_43.click} */
|
||||
onClick: (__VLS_ctx.handleLogin),
|
||||
};
|
||||
/** @type {__VLS_StyleScopedClasses['submit-btn']} */ ;
|
||||
const { default: __VLS_45 } = __VLS_41.slots;
|
||||
// @ts-ignore
|
||||
[handleLogin, loading,];
|
||||
var __VLS_41;
|
||||
var __VLS_42;
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_35;
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_3;
|
||||
var __VLS_4;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "tips" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['tips']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({});
|
||||
// @ts-ignore
|
||||
var __VLS_8 = __VLS_7;
|
||||
// @ts-ignore
|
||||
[];
|
||||
const __VLS_export = (await import('vue')).defineComponent({});
|
||||
export default {};
|
||||
//# sourceMappingURL=login.vue.js.map
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,660 +0,0 @@
|
|||
import { ref, computed, onMounted } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ArrowRight, Delete, Minus, Plus, ShoppingCart } from '@element-plus/icons-vue';
|
||||
import AppHeader from '@/components/layout/AppHeader.vue';
|
||||
import AppFooter from '@/components/layout/AppFooter.vue';
|
||||
import EmptyState from '@/components/common/EmptyState.vue';
|
||||
import { getCartApi, updateCartQuantityApi, updateCartSelectedApi, updateAllCartSelectedApi, deleteCartItemApi, batchDeleteCartApi, clearCartApi } from '@/api/cart';
|
||||
const router = useRouter();
|
||||
const items = ref([]);
|
||||
const loading = ref(true);
|
||||
const updatingSkuId = ref(null);
|
||||
const allSelected = computed(() => {
|
||||
return items.value.length > 0 && items.value.every(item => item.selected === 1);
|
||||
});
|
||||
const someSelected = computed(() => {
|
||||
return items.value.some(item => item.selected === 1) && !allSelected.value;
|
||||
});
|
||||
const selectedItems = computed(() => items.value.filter(item => item.selected === 1));
|
||||
const selectedCount = computed(() => {
|
||||
return selectedItems.value.reduce((sum, item) => sum + item.quantity, 0);
|
||||
});
|
||||
const selectedAmount = computed(() => {
|
||||
return selectedItems.value.reduce((sum, item) => sum + Number(item.subtotal || 0), 0);
|
||||
});
|
||||
const totalCount = computed(() => {
|
||||
return items.value.reduce((sum, item) => sum + item.quantity, 0);
|
||||
});
|
||||
const canCheckout = computed(() => {
|
||||
return (selectedItems.value.length > 0 &&
|
||||
selectedItems.value.every(item => item.productStatus === 1));
|
||||
});
|
||||
async function loadCart() {
|
||||
loading.value = true;
|
||||
try {
|
||||
const data = await getCartApi();
|
||||
items.value = data?.items || [];
|
||||
}
|
||||
catch {
|
||||
items.value = [];
|
||||
}
|
||||
finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
function formatPrice(value) {
|
||||
return Number(value || 0).toFixed(2);
|
||||
}
|
||||
async function toggleAll(checked) {
|
||||
const selected = checked === true || checked === 1 ? 1 : 0;
|
||||
items.value = items.value.map(item => {
|
||||
if (item.productStatus !== 1)
|
||||
return item;
|
||||
return { ...item, selected };
|
||||
});
|
||||
try {
|
||||
await updateAllCartSelectedApi(selected);
|
||||
}
|
||||
catch {
|
||||
loadCart();
|
||||
}
|
||||
}
|
||||
async function toggleItem(item, checked) {
|
||||
if (item.productStatus !== 1)
|
||||
return;
|
||||
const selected = checked === true || checked === 1 ? 1 : 0;
|
||||
const index = items.value.findIndex(row => row.skuId === item.skuId);
|
||||
if (index !== -1) {
|
||||
items.value[index] = { ...items.value[index], selected };
|
||||
}
|
||||
try {
|
||||
await updateCartSelectedApi(item.skuId, selected);
|
||||
}
|
||||
catch {
|
||||
loadCart();
|
||||
}
|
||||
}
|
||||
async function changeQuantity(item, delta) {
|
||||
if (item.productStatus !== 1 || updatingSkuId.value === item.skuId)
|
||||
return;
|
||||
const next = item.quantity + delta;
|
||||
if (next < 1)
|
||||
return;
|
||||
const max = Math.min(item.stock || 99, 99);
|
||||
if (next > max) {
|
||||
ElMessage.warning(next > 99 ? '单件商品最多购买 99 件' : '库存不足');
|
||||
return;
|
||||
}
|
||||
updatingSkuId.value = item.skuId;
|
||||
try {
|
||||
await updateCartQuantityApi({ skuId: item.skuId, quantity: next });
|
||||
item.quantity = next;
|
||||
item.subtotal = Number((Number(item.price) * next).toFixed(2));
|
||||
}
|
||||
catch {
|
||||
/* 拦截器已提示 */
|
||||
}
|
||||
finally {
|
||||
updatingSkuId.value = null;
|
||||
}
|
||||
}
|
||||
async function deleteItem(item) {
|
||||
try {
|
||||
await ElMessageBox.confirm(`确定删除「${item.productName}」吗?`, '删除商品', {
|
||||
confirmButtonText: '删除',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
catch {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await deleteCartItemApi(item.skuId);
|
||||
ElMessage.success('已删除');
|
||||
await loadCart();
|
||||
}
|
||||
catch {
|
||||
/* 拦截器已提示 */
|
||||
}
|
||||
}
|
||||
async function removeSelected() {
|
||||
if (!selectedItems.value.length) {
|
||||
ElMessage.warning('请先勾选要删除的商品');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await ElMessageBox.confirm(`确定删除选中的 ${selectedItems.value.length} 件商品吗?`, '批量删除', {
|
||||
confirmButtonText: '删除',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
catch {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await batchDeleteCartApi(selectedItems.value.map(item => item.skuId));
|
||||
ElMessage.success('已删除选中商品');
|
||||
await loadCart();
|
||||
}
|
||||
catch {
|
||||
/* 拦截器已提示 */
|
||||
}
|
||||
}
|
||||
async function clearCart() {
|
||||
if (!items.value.length)
|
||||
return;
|
||||
try {
|
||||
await ElMessageBox.confirm('确定清空购物车吗?', '清空购物车', {
|
||||
confirmButtonText: '清空',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
catch {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await clearCartApi();
|
||||
ElMessage.success('购物车已清空');
|
||||
await loadCart();
|
||||
}
|
||||
catch {
|
||||
/* 拦截器已提示 */
|
||||
}
|
||||
}
|
||||
function goCheckout() {
|
||||
if (!selectedItems.value.length) {
|
||||
ElMessage.warning('请先选择商品');
|
||||
return;
|
||||
}
|
||||
if (selectedItems.value.some(item => item.productStatus !== 1)) {
|
||||
ElMessage.warning('已下架商品不能结算,请先取消选择');
|
||||
return;
|
||||
}
|
||||
router.push('/checkout');
|
||||
}
|
||||
onMounted(loadCart);
|
||||
const __VLS_ctx = {
|
||||
...{},
|
||||
...{},
|
||||
};
|
||||
let __VLS_components;
|
||||
let __VLS_intrinsics;
|
||||
let __VLS_directives;
|
||||
/** @type {__VLS_StyleScopedClasses['off-tag']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['stock-tag']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['disabled']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['disabled']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['container']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['page-title']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['cart-toolbar']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['cart-item']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['item-image']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['item-info']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['item-name']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['item-bottom']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['item-price']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['cart-footer-bar']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['summary-label']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['footer-actions']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "cart-page" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['cart-page']} */ ;
|
||||
const __VLS_0 = AppHeader;
|
||||
// @ts-ignore
|
||||
const __VLS_1 = __VLS_asFunctionalComponent1(__VLS_0, new __VLS_0({}));
|
||||
const __VLS_2 = __VLS_1({}, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.main, __VLS_intrinsics.main)({
|
||||
...{ class: "cart-main" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['cart-main']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "container" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['container']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "page-head" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['page-head']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.h1, __VLS_intrinsics.h1)({
|
||||
...{ class: "page-title" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['page-title']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "title-badge" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['title-badge']} */ ;
|
||||
let __VLS_5;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon'] | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon']} */
|
||||
elIcon;
|
||||
// @ts-ignore
|
||||
const __VLS_6 = __VLS_asFunctionalComponent1(__VLS_5, new __VLS_5({
|
||||
size: (18),
|
||||
}));
|
||||
const __VLS_7 = __VLS_6({
|
||||
size: (18),
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_6));
|
||||
const { default: __VLS_10 } = __VLS_8.slots;
|
||||
let __VLS_11;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.ShoppingCart} */
|
||||
ShoppingCart;
|
||||
// @ts-ignore
|
||||
const __VLS_12 = __VLS_asFunctionalComponent1(__VLS_11, new __VLS_11({}));
|
||||
const __VLS_13 = __VLS_12({}, ...__VLS_functionalComponentArgsRest(__VLS_12));
|
||||
var __VLS_8;
|
||||
if (__VLS_ctx.items.length) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "count-badge" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['count-badge']} */ ;
|
||||
(__VLS_ctx.totalCount);
|
||||
}
|
||||
if (__VLS_ctx.loading) {
|
||||
let __VLS_16;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elSkeleton | typeof __VLS_components.ElSkeleton | typeof __VLS_components['el-skeleton']} */
|
||||
elSkeleton;
|
||||
// @ts-ignore
|
||||
const __VLS_17 = __VLS_asFunctionalComponent1(__VLS_16, new __VLS_16({
|
||||
rows: (5),
|
||||
animated: true,
|
||||
...{ class: "cart-skeleton" },
|
||||
}));
|
||||
const __VLS_18 = __VLS_17({
|
||||
rows: (5),
|
||||
animated: true,
|
||||
...{ class: "cart-skeleton" },
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_17));
|
||||
/** @type {__VLS_StyleScopedClasses['cart-skeleton']} */ ;
|
||||
}
|
||||
else if (__VLS_ctx.items.length === 0) {
|
||||
const __VLS_21 = EmptyState;
|
||||
// @ts-ignore
|
||||
const __VLS_22 = __VLS_asFunctionalComponent1(__VLS_21, new __VLS_21({
|
||||
description: "购物车还是空的,去挑点喜欢的零食吧",
|
||||
}));
|
||||
const __VLS_23 = __VLS_22({
|
||||
description: "购物车还是空的,去挑点喜欢的零食吧",
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_22));
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "empty-actions" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['empty-actions']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.button, __VLS_intrinsics.button)({
|
||||
...{ onClick: (...[$event]) => {
|
||||
if (!!(__VLS_ctx.loading))
|
||||
throw 0;
|
||||
if (!(__VLS_ctx.items.length === 0))
|
||||
throw 0;
|
||||
return (__VLS_ctx.router.push('/products'));
|
||||
// @ts-ignore
|
||||
[items, items, totalCount, loading, router,];
|
||||
} },
|
||||
type: "button",
|
||||
...{ class: "go-shopping-btn" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['go-shopping-btn']} */ ;
|
||||
}
|
||||
else {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "cart-toolbar" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['cart-toolbar']} */ ;
|
||||
let __VLS_26;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elCheckbox | typeof __VLS_components.ElCheckbox | typeof __VLS_components['el-checkbox'] | typeof __VLS_components.elCheckbox | typeof __VLS_components.ElCheckbox | typeof __VLS_components['el-checkbox']} */
|
||||
elCheckbox;
|
||||
// @ts-ignore
|
||||
const __VLS_27 = __VLS_asFunctionalComponent1(__VLS_26, new __VLS_26({
|
||||
...{ 'onChange': {} },
|
||||
modelValue: (__VLS_ctx.allSelected),
|
||||
indeterminate: (__VLS_ctx.someSelected),
|
||||
}));
|
||||
const __VLS_28 = __VLS_27({
|
||||
...{ 'onChange': {} },
|
||||
modelValue: (__VLS_ctx.allSelected),
|
||||
indeterminate: (__VLS_ctx.someSelected),
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_27));
|
||||
let __VLS_31;
|
||||
const __VLS_32 = {
|
||||
/** @type {typeof __VLS_31.change} */
|
||||
onChange: (__VLS_ctx.toggleAll),
|
||||
};
|
||||
const { default: __VLS_33 } = __VLS_29.slots;
|
||||
// @ts-ignore
|
||||
[allSelected, someSelected, toggleAll,];
|
||||
var __VLS_29;
|
||||
var __VLS_30;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "toolbar-actions" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['toolbar-actions']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.button, __VLS_intrinsics.button)({
|
||||
...{ onClick: (__VLS_ctx.removeSelected) },
|
||||
type: "button",
|
||||
...{ class: "text-btn danger" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['text-btn']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['danger']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span)({
|
||||
...{ class: "toolbar-divider" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['toolbar-divider']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.button, __VLS_intrinsics.button)({
|
||||
...{ onClick: (__VLS_ctx.clearCart) },
|
||||
type: "button",
|
||||
...{ class: "text-btn" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['text-btn']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "cart-list" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['cart-list']} */ ;
|
||||
for (const [item] of __VLS_vFor((__VLS_ctx.items))) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
key: (item.skuId),
|
||||
...{ class: "cart-item" },
|
||||
...{ class: ({ 'is-off': item.productStatus !== 1 }) },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['cart-item']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['is-off']} */ ;
|
||||
let __VLS_34;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elCheckbox | typeof __VLS_components.ElCheckbox | typeof __VLS_components['el-checkbox']} */
|
||||
elCheckbox;
|
||||
// @ts-ignore
|
||||
const __VLS_35 = __VLS_asFunctionalComponent1(__VLS_34, new __VLS_34({
|
||||
...{ 'onChange': {} },
|
||||
modelValue: (item.selected === 1),
|
||||
disabled: (item.productStatus !== 1),
|
||||
}));
|
||||
const __VLS_36 = __VLS_35({
|
||||
...{ 'onChange': {} },
|
||||
modelValue: (item.selected === 1),
|
||||
disabled: (item.productStatus !== 1),
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_35));
|
||||
let __VLS_39;
|
||||
const __VLS_40 = {
|
||||
/** @type {typeof __VLS_39.change} */
|
||||
onChange: ((v) => __VLS_ctx.toggleItem(item, v)),
|
||||
};
|
||||
var __VLS_37;
|
||||
var __VLS_38;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ onClick: (...[$event]) => {
|
||||
if (!!(__VLS_ctx.loading))
|
||||
throw 0;
|
||||
if (!!(__VLS_ctx.items.length === 0))
|
||||
throw 0;
|
||||
return (__VLS_ctx.router.push(`/product/${item.productId}`));
|
||||
// @ts-ignore
|
||||
[items, router, removeSelected, clearCart, toggleItem,];
|
||||
} },
|
||||
...{ class: "item-image" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['item-image']} */ ;
|
||||
let __VLS_41;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elImage | typeof __VLS_components.ElImage | typeof __VLS_components['el-image'] | typeof __VLS_components.elImage | typeof __VLS_components.ElImage | typeof __VLS_components['el-image']} */
|
||||
elImage;
|
||||
// @ts-ignore
|
||||
const __VLS_42 = __VLS_asFunctionalComponent1(__VLS_41, new __VLS_41({
|
||||
src: (item.productImage || item.skuImage),
|
||||
fit: "cover",
|
||||
...{ class: "item-img" },
|
||||
lazy: true,
|
||||
}));
|
||||
const __VLS_43 = __VLS_42({
|
||||
src: (item.productImage || item.skuImage),
|
||||
fit: "cover",
|
||||
...{ class: "item-img" },
|
||||
lazy: true,
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_42));
|
||||
/** @type {__VLS_StyleScopedClasses['item-img']} */ ;
|
||||
const { default: __VLS_46 } = __VLS_44.slots;
|
||||
{
|
||||
const { error: __VLS_47 } = __VLS_44.slots;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "image-placeholder" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['image-placeholder']} */ ;
|
||||
// @ts-ignore
|
||||
[];
|
||||
}
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_44;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "item-info" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['item-info']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({
|
||||
...{ onClick: (...[$event]) => {
|
||||
if (!!(__VLS_ctx.loading))
|
||||
throw 0;
|
||||
if (!!(__VLS_ctx.items.length === 0))
|
||||
throw 0;
|
||||
return (__VLS_ctx.router.push(`/product/${item.productId}`));
|
||||
// @ts-ignore
|
||||
[router,];
|
||||
} },
|
||||
...{ class: "item-name" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['item-name']} */ ;
|
||||
(item.productName);
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({
|
||||
...{ class: "item-sku" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['item-sku']} */ ;
|
||||
(item.skuName);
|
||||
if (item.productStatus !== 1) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "off-tag" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['off-tag']} */ ;
|
||||
}
|
||||
else if (item.stock <= 10) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "stock-tag" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['stock-tag']} */ ;
|
||||
(item.stock);
|
||||
}
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.button, __VLS_intrinsics.button)({
|
||||
...{ onClick: (...[$event]) => {
|
||||
if (!!(__VLS_ctx.loading))
|
||||
throw 0;
|
||||
if (!!(__VLS_ctx.items.length === 0))
|
||||
throw 0;
|
||||
return (__VLS_ctx.deleteItem(item));
|
||||
// @ts-ignore
|
||||
[deleteItem,];
|
||||
} },
|
||||
type: "button",
|
||||
...{ class: "item-delete" },
|
||||
'aria-label': "删除商品",
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['item-delete']} */ ;
|
||||
let __VLS_48;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon'] | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon']} */
|
||||
elIcon;
|
||||
// @ts-ignore
|
||||
const __VLS_49 = __VLS_asFunctionalComponent1(__VLS_48, new __VLS_48({
|
||||
size: (18),
|
||||
}));
|
||||
const __VLS_50 = __VLS_49({
|
||||
size: (18),
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_49));
|
||||
const { default: __VLS_53 } = __VLS_51.slots;
|
||||
let __VLS_54;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.Delete} */
|
||||
Delete;
|
||||
// @ts-ignore
|
||||
const __VLS_55 = __VLS_asFunctionalComponent1(__VLS_54, new __VLS_54({}));
|
||||
const __VLS_56 = __VLS_55({}, ...__VLS_functionalComponentArgsRest(__VLS_55));
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_51;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "item-bottom" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['item-bottom']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "item-price" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['item-price']} */ ;
|
||||
(__VLS_ctx.formatPrice(item.price));
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "item-qty" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['item-qty']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.button, __VLS_intrinsics.button)({
|
||||
...{ onClick: (...[$event]) => {
|
||||
if (!!(__VLS_ctx.loading))
|
||||
throw 0;
|
||||
if (!!(__VLS_ctx.items.length === 0))
|
||||
throw 0;
|
||||
return (__VLS_ctx.changeQuantity(item, -1));
|
||||
// @ts-ignore
|
||||
[formatPrice, changeQuantity,];
|
||||
} },
|
||||
type: "button",
|
||||
...{ class: "qty-btn" },
|
||||
disabled: (item.productStatus !== 1 || __VLS_ctx.updatingSkuId === item.skuId || item.quantity <= 1),
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['qty-btn']} */ ;
|
||||
let __VLS_59;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon'] | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon']} */
|
||||
elIcon;
|
||||
// @ts-ignore
|
||||
const __VLS_60 = __VLS_asFunctionalComponent1(__VLS_59, new __VLS_59({
|
||||
size: (14),
|
||||
}));
|
||||
const __VLS_61 = __VLS_60({
|
||||
size: (14),
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_60));
|
||||
const { default: __VLS_64 } = __VLS_62.slots;
|
||||
let __VLS_65;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.Minus} */
|
||||
Minus;
|
||||
// @ts-ignore
|
||||
const __VLS_66 = __VLS_asFunctionalComponent1(__VLS_65, new __VLS_65({}));
|
||||
const __VLS_67 = __VLS_66({}, ...__VLS_functionalComponentArgsRest(__VLS_66));
|
||||
// @ts-ignore
|
||||
[updatingSkuId,];
|
||||
var __VLS_62;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "qty-num" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['qty-num']} */ ;
|
||||
(item.quantity);
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.button, __VLS_intrinsics.button)({
|
||||
...{ onClick: (...[$event]) => {
|
||||
if (!!(__VLS_ctx.loading))
|
||||
throw 0;
|
||||
if (!!(__VLS_ctx.items.length === 0))
|
||||
throw 0;
|
||||
return (__VLS_ctx.changeQuantity(item, 1));
|
||||
// @ts-ignore
|
||||
[changeQuantity,];
|
||||
} },
|
||||
type: "button",
|
||||
...{ class: "qty-btn" },
|
||||
disabled: (item.productStatus !== 1 || __VLS_ctx.updatingSkuId === item.skuId),
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['qty-btn']} */ ;
|
||||
let __VLS_70;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon'] | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon']} */
|
||||
elIcon;
|
||||
// @ts-ignore
|
||||
const __VLS_71 = __VLS_asFunctionalComponent1(__VLS_70, new __VLS_70({
|
||||
size: (14),
|
||||
}));
|
||||
const __VLS_72 = __VLS_71({
|
||||
size: (14),
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_71));
|
||||
const { default: __VLS_75 } = __VLS_73.slots;
|
||||
let __VLS_76;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.Plus} */
|
||||
Plus;
|
||||
// @ts-ignore
|
||||
const __VLS_77 = __VLS_asFunctionalComponent1(__VLS_76, new __VLS_76({}));
|
||||
const __VLS_78 = __VLS_77({}, ...__VLS_functionalComponentArgsRest(__VLS_77));
|
||||
// @ts-ignore
|
||||
[updatingSkuId,];
|
||||
var __VLS_73;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "item-subtotal" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['item-subtotal']} */ ;
|
||||
(__VLS_ctx.formatPrice(item.subtotal));
|
||||
// @ts-ignore
|
||||
[formatPrice,];
|
||||
}
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "cart-footer-bar" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['cart-footer-bar']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "footer-left" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['footer-left']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "summary-label" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['summary-label']} */ ;
|
||||
(__VLS_ctx.selectedCount);
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "summary-amount" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['summary-amount']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.b, __VLS_intrinsics.b)({});
|
||||
(__VLS_ctx.formatPrice(__VLS_ctx.selectedAmount));
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "footer-actions" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['footer-actions']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.button, __VLS_intrinsics.button)({
|
||||
...{ onClick: (__VLS_ctx.removeSelected) },
|
||||
type: "button",
|
||||
...{ class: "remove-selected-btn" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['remove-selected-btn']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.button, __VLS_intrinsics.button)({
|
||||
...{ onClick: (__VLS_ctx.goCheckout) },
|
||||
type: "button",
|
||||
...{ class: "checkout-btn" },
|
||||
...{ class: ({ disabled: !__VLS_ctx.canCheckout }) },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['checkout-btn']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['disabled']} */ ;
|
||||
let __VLS_81;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon'] | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon']} */
|
||||
elIcon;
|
||||
// @ts-ignore
|
||||
const __VLS_82 = __VLS_asFunctionalComponent1(__VLS_81, new __VLS_81({
|
||||
size: (16),
|
||||
}));
|
||||
const __VLS_83 = __VLS_82({
|
||||
size: (16),
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_82));
|
||||
const { default: __VLS_86 } = __VLS_84.slots;
|
||||
let __VLS_87;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.ArrowRight} */
|
||||
ArrowRight;
|
||||
// @ts-ignore
|
||||
const __VLS_88 = __VLS_asFunctionalComponent1(__VLS_87, new __VLS_87({}));
|
||||
const __VLS_89 = __VLS_88({}, ...__VLS_functionalComponentArgsRest(__VLS_88));
|
||||
// @ts-ignore
|
||||
[removeSelected, formatPrice, selectedCount, selectedAmount, goCheckout, canCheckout,];
|
||||
var __VLS_84;
|
||||
}
|
||||
const __VLS_92 = AppFooter;
|
||||
// @ts-ignore
|
||||
const __VLS_93 = __VLS_asFunctionalComponent1(__VLS_92, new __VLS_92({}));
|
||||
const __VLS_94 = __VLS_93({}, ...__VLS_functionalComponentArgsRest(__VLS_93));
|
||||
// @ts-ignore
|
||||
[];
|
||||
const __VLS_export = (await import('vue')).defineComponent({});
|
||||
export default {};
|
||||
//# sourceMappingURL=index.vue.js.map
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,342 +0,0 @@
|
|||
import { ref, computed, watch, onMounted } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { ArrowLeft, Goods } from '@element-plus/icons-vue';
|
||||
import AppHeader from '@/components/layout/AppHeader.vue';
|
||||
import AppFooter from '@/components/layout/AppFooter.vue';
|
||||
import ProductCard from '@/components/product/ProductCard.vue';
|
||||
import EmptyState from '@/components/common/EmptyState.vue';
|
||||
import { getCategoryTreeApi } from '@/api/category';
|
||||
import { getProductsByCategoryApi } from '@/api/product';
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const categories = ref([]);
|
||||
const products = ref([]);
|
||||
const loading = ref(true);
|
||||
const activeCategoryId = ref(null);
|
||||
const activeSort = ref('default');
|
||||
const sortOptions = [
|
||||
{ key: 'default', label: '综合' },
|
||||
{ key: 'sales', label: '销量' },
|
||||
{ key: 'price_asc', label: '价格 ↑' },
|
||||
{ key: 'price_desc', label: '价格 ↓' },
|
||||
{ key: 'newest', label: '最新' }
|
||||
];
|
||||
const activeRoot = computed(() => {
|
||||
if (activeCategoryId.value == null)
|
||||
return null;
|
||||
return findCategoryRoot(activeCategoryId.value);
|
||||
});
|
||||
const pageTitle = computed(() => activeRoot.value?.name || '全部商品');
|
||||
const sortedProducts = computed(() => {
|
||||
const list = [...products.value];
|
||||
switch (activeSort.value) {
|
||||
case 'sales':
|
||||
return list.sort((a, b) => b.sales - a.sales);
|
||||
case 'price_asc':
|
||||
return list.sort((a, b) => Number(a.minPrice || 0) - Number(b.minPrice || 0));
|
||||
case 'price_desc':
|
||||
return list.sort((a, b) => Number(b.minPrice || 0) - Number(a.minPrice || 0));
|
||||
case 'newest':
|
||||
return list.sort((a, b) => String(b.createTime).localeCompare(String(a.createTime)));
|
||||
default:
|
||||
return list.sort((a, b) => (b.isHot - a.isHot) || (b.sales - a.sales));
|
||||
}
|
||||
});
|
||||
function findCategoryRoot(targetId, nodes = categories.value) {
|
||||
for (const node of nodes) {
|
||||
if (node.id === targetId)
|
||||
return node;
|
||||
if (node.children?.length) {
|
||||
const found = findCategoryRoot(targetId, node.children);
|
||||
if (found)
|
||||
return node;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function collectCategoryIds(cat) {
|
||||
const ids = [cat.id];
|
||||
if (cat.children?.length) {
|
||||
cat.children.forEach(child => ids.push(...collectCategoryIds(child)));
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
function syncFromRoute() {
|
||||
const rawId = Array.isArray(route.params.id) ? route.params.id[0] : route.params.id;
|
||||
const parsedId = Number(rawId);
|
||||
if (rawId && Number.isFinite(parsedId) && parsedId > 0) {
|
||||
activeCategoryId.value = findCategoryRoot(parsedId)?.id ?? parsedId;
|
||||
}
|
||||
else {
|
||||
activeCategoryId.value = null;
|
||||
}
|
||||
}
|
||||
async function fetchProducts() {
|
||||
loading.value = true;
|
||||
try {
|
||||
const categoryIds = activeRoot.value
|
||||
? collectCategoryIds(activeRoot.value).join(',')
|
||||
: '';
|
||||
const data = await getProductsByCategoryApi(categoryIds, 'create_desc', 100);
|
||||
products.value = data || [];
|
||||
}
|
||||
catch {
|
||||
products.value = [];
|
||||
}
|
||||
finally {
|
||||
loading.value = false;
|
||||
document.title = pageTitle.value === '全部商品'
|
||||
? '全部商品 - 零食商城'
|
||||
: `${pageTitle.value} - 零食商城`;
|
||||
}
|
||||
}
|
||||
function selectCategory(id) {
|
||||
if (id == null) {
|
||||
router.push('/products');
|
||||
}
|
||||
else {
|
||||
router.push(`/category/${id}`);
|
||||
}
|
||||
}
|
||||
function selectSort(key) {
|
||||
activeSort.value = key;
|
||||
}
|
||||
watch(() => route.params.id, () => {
|
||||
syncFromRoute();
|
||||
fetchProducts();
|
||||
});
|
||||
onMounted(async () => {
|
||||
try {
|
||||
categories.value = await getCategoryTreeApi();
|
||||
}
|
||||
catch {
|
||||
categories.value = [];
|
||||
}
|
||||
syncFromRoute();
|
||||
await fetchProducts();
|
||||
});
|
||||
const __VLS_ctx = {
|
||||
...{},
|
||||
...{},
|
||||
};
|
||||
let __VLS_components;
|
||||
let __VLS_intrinsics;
|
||||
let __VLS_directives;
|
||||
/** @type {__VLS_StyleScopedClasses['active']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['product-grid']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['filter-bar']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['product-grid']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['container']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['page-title']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['product-grid']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['category-tabs']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "product-list-page" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['product-list-page']} */ ;
|
||||
const __VLS_0 = AppHeader;
|
||||
// @ts-ignore
|
||||
const __VLS_1 = __VLS_asFunctionalComponent1(__VLS_0, new __VLS_0({}));
|
||||
const __VLS_2 = __VLS_1({}, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.main, __VLS_intrinsics.main)({
|
||||
...{ class: "list-main" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['list-main']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "container" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['container']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "page-head" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['page-head']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "title-row" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['title-row']} */ ;
|
||||
if (__VLS_ctx.activeCategoryId != null) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.button, __VLS_intrinsics.button)({
|
||||
...{ onClick: (...[$event]) => {
|
||||
if (!(__VLS_ctx.activeCategoryId != null))
|
||||
throw 0;
|
||||
return (__VLS_ctx.selectCategory(null));
|
||||
// @ts-ignore
|
||||
[activeCategoryId, selectCategory,];
|
||||
} },
|
||||
type: "button",
|
||||
...{ class: "back-btn" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['back-btn']} */ ;
|
||||
let __VLS_5;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon'] | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon']} */
|
||||
elIcon;
|
||||
// @ts-ignore
|
||||
const __VLS_6 = __VLS_asFunctionalComponent1(__VLS_5, new __VLS_5({
|
||||
size: (15),
|
||||
}));
|
||||
const __VLS_7 = __VLS_6({
|
||||
size: (15),
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_6));
|
||||
const { default: __VLS_10 } = __VLS_8.slots;
|
||||
let __VLS_11;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.ArrowLeft} */
|
||||
ArrowLeft;
|
||||
// @ts-ignore
|
||||
const __VLS_12 = __VLS_asFunctionalComponent1(__VLS_11, new __VLS_11({}));
|
||||
const __VLS_13 = __VLS_12({}, ...__VLS_functionalComponentArgsRest(__VLS_12));
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_8;
|
||||
}
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.h1, __VLS_intrinsics.h1)({
|
||||
...{ class: "page-title" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['page-title']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "title-badge" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['title-badge']} */ ;
|
||||
let __VLS_16;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon'] | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon']} */
|
||||
elIcon;
|
||||
// @ts-ignore
|
||||
const __VLS_17 = __VLS_asFunctionalComponent1(__VLS_16, new __VLS_16({
|
||||
size: (18),
|
||||
}));
|
||||
const __VLS_18 = __VLS_17({
|
||||
size: (18),
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_17));
|
||||
const { default: __VLS_21 } = __VLS_19.slots;
|
||||
let __VLS_22;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.Goods} */
|
||||
Goods;
|
||||
// @ts-ignore
|
||||
const __VLS_23 = __VLS_asFunctionalComponent1(__VLS_22, new __VLS_22({}));
|
||||
const __VLS_24 = __VLS_23({}, ...__VLS_functionalComponentArgsRest(__VLS_23));
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_19;
|
||||
(__VLS_ctx.pageTitle);
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "count-badge" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['count-badge']} */ ;
|
||||
(__VLS_ctx.products.length);
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "filter-bar" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['filter-bar']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "category-tabs" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['category-tabs']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.button, __VLS_intrinsics.button)({
|
||||
...{ onClick: (...[$event]) => {
|
||||
return (__VLS_ctx.selectCategory(null));
|
||||
// @ts-ignore
|
||||
[selectCategory, pageTitle, products,];
|
||||
} },
|
||||
type: "button",
|
||||
...{ class: "category-tab" },
|
||||
...{ class: ({ active: __VLS_ctx.activeCategoryId == null }) },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['category-tab']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['active']} */ ;
|
||||
for (const [cat] of __VLS_vFor((__VLS_ctx.categories))) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.button, __VLS_intrinsics.button)({
|
||||
...{ onClick: (...[$event]) => {
|
||||
return (__VLS_ctx.selectCategory(cat.id));
|
||||
// @ts-ignore
|
||||
[activeCategoryId, selectCategory, categories,];
|
||||
} },
|
||||
key: (cat.id),
|
||||
type: "button",
|
||||
...{ class: "category-tab" },
|
||||
...{ class: ({ active: __VLS_ctx.activeCategoryId === cat.id }) },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['category-tab']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['active']} */ ;
|
||||
(cat.name);
|
||||
// @ts-ignore
|
||||
[activeCategoryId,];
|
||||
}
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "sort-bar" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['sort-bar']} */ ;
|
||||
for (const [option] of __VLS_vFor((__VLS_ctx.sortOptions))) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.button, __VLS_intrinsics.button)({
|
||||
...{ onClick: (...[$event]) => {
|
||||
return (__VLS_ctx.selectSort(option.key));
|
||||
// @ts-ignore
|
||||
[sortOptions, selectSort,];
|
||||
} },
|
||||
key: (option.key),
|
||||
type: "button",
|
||||
...{ class: "sort-option" },
|
||||
...{ class: ({ active: __VLS_ctx.activeSort === option.key }) },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['sort-option']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['active']} */ ;
|
||||
(option.label);
|
||||
// @ts-ignore
|
||||
[activeSort,];
|
||||
}
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.section, __VLS_intrinsics.section)({
|
||||
...{ class: "product-section" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['product-section']} */ ;
|
||||
if (__VLS_ctx.loading) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "product-grid" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['product-grid']} */ ;
|
||||
for (const [i] of __VLS_vFor((10))) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div)({
|
||||
key: (i),
|
||||
...{ class: "product-skeleton-card" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['product-skeleton-card']} */ ;
|
||||
// @ts-ignore
|
||||
[loading,];
|
||||
}
|
||||
}
|
||||
else if (__VLS_ctx.sortedProducts.length === 0) {
|
||||
const __VLS_27 = EmptyState;
|
||||
// @ts-ignore
|
||||
const __VLS_28 = __VLS_asFunctionalComponent1(__VLS_27, new __VLS_27({
|
||||
description: "该分类下还没有商品,看看其他分类吧",
|
||||
}));
|
||||
const __VLS_29 = __VLS_28({
|
||||
description: "该分类下还没有商品,看看其他分类吧",
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_28));
|
||||
}
|
||||
else {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "product-grid" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['product-grid']} */ ;
|
||||
for (const [product] of __VLS_vFor((__VLS_ctx.sortedProducts))) {
|
||||
const __VLS_32 = ProductCard;
|
||||
// @ts-ignore
|
||||
const __VLS_33 = __VLS_asFunctionalComponent1(__VLS_32, new __VLS_32({
|
||||
key: (product.id),
|
||||
product: (product),
|
||||
}));
|
||||
const __VLS_34 = __VLS_33({
|
||||
key: (product.id),
|
||||
product: (product),
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_33));
|
||||
// @ts-ignore
|
||||
[sortedProducts, sortedProducts,];
|
||||
}
|
||||
}
|
||||
const __VLS_37 = AppFooter;
|
||||
// @ts-ignore
|
||||
const __VLS_38 = __VLS_asFunctionalComponent1(__VLS_37, new __VLS_37({}));
|
||||
const __VLS_39 = __VLS_38({}, ...__VLS_functionalComponentArgsRest(__VLS_38));
|
||||
// @ts-ignore
|
||||
[];
|
||||
const __VLS_export = (await import('vue')).defineComponent({});
|
||||
export default {};
|
||||
//# sourceMappingURL=index.vue.js.map
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,13 +0,0 @@
|
|||
const __VLS_ctx = {};
|
||||
let __VLS_components;
|
||||
let __VLS_intrinsics;
|
||||
let __VLS_directives;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "placeholder-page" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['placeholder-page']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.h2, __VLS_intrinsics.h2)({});
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({});
|
||||
const __VLS_export = (await import('vue')).defineComponent({});
|
||||
export default {};
|
||||
//# sourceMappingURL=index.vue.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.vue.js","sourceRoot":"","sources":["index.vue"],"names":[],"mappings":"AAiCA,MAAM,SAAS,GAAG,EAA2C,CAAC;AAG9D,IAAI,gBAAiE,CAAC;AACtE,IAAI,gBAAkE,CAAC;AAEvE,IAAI,gBAAyE,CAAC;AAG9E,0BAA0B,CAAC,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACvE,GAAG,EAAE,KAAK,EAAE,kBAAkB,EAAE;CAC/B,CAAC,CAAC;AACH,2DAA2D,CAAA,CAAC;AAC5D,0BAA0B,CAAC,gBAAgB,CAAC,EAAE,EAAE,gBAAgB,CAAC,EAAE,CAAC,CAAC,EACpE,CAAC,CAAC;AACH,0BAA0B,CAAC,gBAAgB,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAClE,CAAC,CAAC;AAGH,MAAM,YAAY,GAAG,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,EAC1D,CAAC,CAAC;AACH,eAAe,EAAyB,CAAC"}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
const __VLS_ctx = {};
|
||||
let __VLS_components;
|
||||
let __VLS_intrinsics;
|
||||
let __VLS_directives;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "placeholder-page" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['placeholder-page']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.h2, __VLS_intrinsics.h2)({});
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({});
|
||||
const __VLS_export = (await import('vue')).defineComponent({});
|
||||
export default {};
|
||||
//# sourceMappingURL=index.vue.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.vue.js","sourceRoot":"","sources":["index.vue"],"names":[],"mappings":"AAiCA,MAAM,SAAS,GAAG,EAA2C,CAAC;AAG9D,IAAI,gBAAiE,CAAC;AACtE,IAAI,gBAAkE,CAAC;AAEvE,IAAI,gBAAyE,CAAC;AAG9E,0BAA0B,CAAC,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACvE,GAAG,EAAE,KAAK,EAAE,kBAAkB,EAAE;CAC/B,CAAC,CAAC;AACH,2DAA2D,CAAA,CAAC;AAC5D,0BAA0B,CAAC,gBAAgB,CAAC,EAAE,EAAE,gBAAgB,CAAC,EAAE,CAAC,CAAC,EACpE,CAAC,CAAC;AACH,0BAA0B,CAAC,gBAAgB,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAClE,CAAC,CAAC;AAGH,MAAM,YAAY,GAAG,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,EAC1D,CAAC,CAAC;AACH,eAAe,EAAyB,CAAC"}
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
import { useRouter } from 'vue-router';
|
||||
const router = useRouter();
|
||||
const __VLS_ctx = {
|
||||
...{},
|
||||
...{},
|
||||
};
|
||||
let __VLS_components;
|
||||
let __VLS_intrinsics;
|
||||
let __VLS_directives;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "not-found-page" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['not-found-page']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "not-found-card" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['not-found-card']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.h1, __VLS_intrinsics.h1)({});
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({});
|
||||
let __VLS_0;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button'] | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button']} */
|
||||
elButton;
|
||||
// @ts-ignore
|
||||
const __VLS_1 = __VLS_asFunctionalComponent1(__VLS_0, new __VLS_0({
|
||||
...{ 'onClick': {} },
|
||||
type: "primary",
|
||||
size: "large",
|
||||
round: true,
|
||||
}));
|
||||
const __VLS_2 = __VLS_1({
|
||||
...{ 'onClick': {} },
|
||||
type: "primary",
|
||||
size: "large",
|
||||
round: true,
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
||||
let __VLS_5;
|
||||
const __VLS_6 = {
|
||||
/** @type {typeof __VLS_5.click} */
|
||||
onClick: (...[$event]) => {
|
||||
return (__VLS_ctx.router.push('/'));
|
||||
// @ts-ignore
|
||||
[router,];
|
||||
},
|
||||
};
|
||||
const { default: __VLS_7 } = __VLS_3.slots;
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_3;
|
||||
var __VLS_4;
|
||||
// @ts-ignore
|
||||
[];
|
||||
const __VLS_export = (await import('vue')).defineComponent({});
|
||||
export default {};
|
||||
//# sourceMappingURL=404.vue.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"404.vue.js","sourceRoot":"","sources":["404.vue"],"names":[],"mappings":"AAAA,OA0DO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEtC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;AAM1B,MAAM,SAAS,GAAG;IAClB,GAAG,EAA2C;IAC9C,GAAG,EAAwB;CAC1B,CAAC;AAGF,IAAI,gBAAiE,CAAC;AACtE,IAAI,gBAAkE,CAAC;AAEvE,IAAI,gBAAyE,CAAC;AAI9E,0BAA0B,CAAC,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACvE,GAAG,EAAE,KAAK,EAAE,gBAAgB,EAAE;CAC7B,CAAC,CAAC;AACH,yDAAyD,CAAA,CAAC;AAC1D,0BAA0B,CAAC,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACvE,GAAG,EAAE,KAAK,EAAE,gBAAgB,EAAE;CAC7B,CAAC,CAAC;AACH,yDAAyD,CAAA,CAAC;AAC1D,0BAA0B,CAAC,gBAAgB,CAAC,EAAE,EAAE,gBAAgB,CAAC,EAAE,CAAC,CAAC,EACpE,CAAC,CAAC;AACH,0BAA0B,CAAC,gBAAgB,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAClE,CAAC,CAAC;AACH,IAAI,OAAiJ,CAAC;AACtJ,oPAAoP;AACpP,QAAQ,CAAC;AACT,aAAa;AACb,MAAM,OAAO,GAAG,4BAA4B,CAAC,OAAO,EAAE,IAAI,OAAO,CAAC;IAClE,GAAG,EAAE,SAAS,EAAE,EAAS,EAAE;IAC3B,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,IAAI;CACV,CAAC,CAAC,CAAC;AACJ,MAAM,OAAO,GAAG,OAAO,CAAC;IACxB,GAAG,EAAE,SAAS,EAAE,EAAS,EAAE;IAC3B,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,IAAI;CACV,EAAE,GAAG,iCAAiC,CAAC,OAAO,CAAC,CAAC,CAAC;AAClD,IAAI,OAAiE,CAAC;AACtE,MAAM,OAAO,GAAoF;IACjG,mCAAmC;IACnC,OAAO,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE;QACzB,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACpC,aAAa;QACb,CAAC,MAAM,EAAE,CAAC;IACV,CAAC;CACA,CAAC;AACF,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,KAAM,CAAC;AAC5C,aAAa;AACb,EAAE,CAAC;AACH,IAAI,OAAuE,CAAC;AAC5E,IAAI,OAAqE,CAAC;AAG1E,aAAa;AACb,EAAE,CAAC;AACH,MAAM,YAAY,GAAG,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,EAC1D,CAAC,CAAC;AACH,eAAe,EAAyB,CAAC"}
|
||||
|
|
@ -1,609 +0,0 @@
|
|||
import { ref, onMounted } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { ArrowRight, Bell } from '@element-plus/icons-vue';
|
||||
import AppHeader from '@/components/layout/AppHeader.vue';
|
||||
import AppFooter from '@/components/layout/AppFooter.vue';
|
||||
import ProductCard from '@/components/product/ProductCard.vue';
|
||||
import EmptyState from '@/components/common/EmptyState.vue';
|
||||
import { getBannersApi } from '@/api/banner';
|
||||
import { getNoticesApi } from '@/api/notice';
|
||||
import { getHotProductsApi, getNewProductsApi } from '@/api/product';
|
||||
const router = useRouter();
|
||||
// ==================== 数据 ====================
|
||||
const banners = ref([]);
|
||||
const notices = ref([]);
|
||||
const hotProducts = ref([]);
|
||||
const newProducts = ref([]);
|
||||
const loading = ref({
|
||||
banners: true,
|
||||
notices: true,
|
||||
hot: true,
|
||||
new: true
|
||||
});
|
||||
// ==================== 加载 ====================
|
||||
onMounted(async () => {
|
||||
// 并行加载所有数据
|
||||
await Promise.allSettled([
|
||||
getBannersApi().then(data => {
|
||||
banners.value = data || [];
|
||||
loading.value.banners = false;
|
||||
}).catch(() => { loading.value.banners = false; }),
|
||||
getNoticesApi().then(data => {
|
||||
notices.value = data || [];
|
||||
loading.value.notices = false;
|
||||
}).catch(() => { loading.value.notices = false; }),
|
||||
getHotProductsApi(10).then(data => {
|
||||
hotProducts.value = data || [];
|
||||
loading.value.hot = false;
|
||||
}).catch(() => { loading.value.hot = false; }),
|
||||
getNewProductsApi(10).then(data => {
|
||||
newProducts.value = data || [];
|
||||
loading.value.new = false;
|
||||
}).catch(() => { loading.value.new = false; })
|
||||
]);
|
||||
});
|
||||
// ==================== 轮播图 ====================
|
||||
function handleBannerClick(banner) {
|
||||
if (banner.linkType === 1) {
|
||||
// 跳转商品详情
|
||||
router.push(`/product/${banner.linkValue}`);
|
||||
}
|
||||
else if (banner.linkType === 2) {
|
||||
// 跳转分类
|
||||
router.push(`/category/${banner.linkValue}`);
|
||||
}
|
||||
else if (banner.linkType === 3) {
|
||||
// 外链
|
||||
window.open(banner.linkValue, '_blank');
|
||||
}
|
||||
}
|
||||
// ==================== 公告 ====================
|
||||
function handleNoticeClick(notice) {
|
||||
router.push(`/notice/${notice.id}`);
|
||||
}
|
||||
function goToNotices() {
|
||||
router.push('/notice');
|
||||
}
|
||||
const __VLS_ctx = {
|
||||
...{},
|
||||
...{},
|
||||
};
|
||||
let __VLS_components;
|
||||
let __VLS_intrinsics;
|
||||
let __VLS_directives;
|
||||
/** @type {__VLS_StyleScopedClasses['product-grid']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['product-grid']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['carousel-content']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['product-grid']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['home-carousel']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "home-page" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['home-page']} */ ;
|
||||
const __VLS_0 = AppHeader;
|
||||
// @ts-ignore
|
||||
const __VLS_1 = __VLS_asFunctionalComponent1(__VLS_0, new __VLS_0({}));
|
||||
const __VLS_2 = __VLS_1({}, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.main, __VLS_intrinsics.main)({
|
||||
...{ class: "home-main" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['home-main']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.section, __VLS_intrinsics.section)({
|
||||
...{ class: "banner-section" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['banner-section']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "container" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['container']} */ ;
|
||||
let __VLS_5;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elSkeleton | typeof __VLS_components.ElSkeleton | typeof __VLS_components['el-skeleton'] | typeof __VLS_components.elSkeleton | typeof __VLS_components.ElSkeleton | typeof __VLS_components['el-skeleton']} */
|
||||
elSkeleton;
|
||||
// @ts-ignore
|
||||
const __VLS_6 = __VLS_asFunctionalComponent1(__VLS_5, new __VLS_5({
|
||||
loading: (__VLS_ctx.loading.banners),
|
||||
animated: true,
|
||||
count: (1),
|
||||
}));
|
||||
const __VLS_7 = __VLS_6({
|
||||
loading: (__VLS_ctx.loading.banners),
|
||||
animated: true,
|
||||
count: (1),
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_6));
|
||||
const { default: __VLS_10 } = __VLS_8.slots;
|
||||
{
|
||||
const { template: __VLS_11 } = __VLS_8.slots;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div)({
|
||||
...{ class: "banner-skeleton" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['banner-skeleton']} */ ;
|
||||
// @ts-ignore
|
||||
[loading,];
|
||||
}
|
||||
{
|
||||
const { default: __VLS_12 } = __VLS_8.slots;
|
||||
if (__VLS_ctx.banners.length > 0) {
|
||||
let __VLS_13;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elCarousel | typeof __VLS_components.ElCarousel | typeof __VLS_components['el-carousel'] | typeof __VLS_components.elCarousel | typeof __VLS_components.ElCarousel | typeof __VLS_components['el-carousel']} */
|
||||
elCarousel;
|
||||
// @ts-ignore
|
||||
const __VLS_14 = __VLS_asFunctionalComponent1(__VLS_13, new __VLS_13({
|
||||
interval: (4000),
|
||||
arrow: "hover",
|
||||
indicatorPosition: "outside",
|
||||
height: "360px",
|
||||
...{ class: "home-carousel" },
|
||||
}));
|
||||
const __VLS_15 = __VLS_14({
|
||||
interval: (4000),
|
||||
arrow: "hover",
|
||||
indicatorPosition: "outside",
|
||||
height: "360px",
|
||||
...{ class: "home-carousel" },
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_14));
|
||||
/** @type {__VLS_StyleScopedClasses['home-carousel']} */ ;
|
||||
const { default: __VLS_18 } = __VLS_16.slots;
|
||||
for (const [banner] of __VLS_vFor((__VLS_ctx.banners))) {
|
||||
let __VLS_19;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elCarouselItem | typeof __VLS_components.ElCarouselItem | typeof __VLS_components['el-carousel-item'] | typeof __VLS_components.elCarouselItem | typeof __VLS_components.ElCarouselItem | typeof __VLS_components['el-carousel-item']} */
|
||||
elCarouselItem;
|
||||
// @ts-ignore
|
||||
const __VLS_20 = __VLS_asFunctionalComponent1(__VLS_19, new __VLS_19({
|
||||
key: (banner.id),
|
||||
}));
|
||||
const __VLS_21 = __VLS_20({
|
||||
key: (banner.id),
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_20));
|
||||
const { default: __VLS_24 } = __VLS_22.slots;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ onClick: (...[$event]) => {
|
||||
if (!(__VLS_ctx.banners.length > 0))
|
||||
throw 0;
|
||||
return (__VLS_ctx.handleBannerClick(banner));
|
||||
// @ts-ignore
|
||||
[banners, banners, handleBannerClick,];
|
||||
} },
|
||||
...{ class: "carousel-item" },
|
||||
...{ style: ({ backgroundImage: `url(${banner.image})` }) },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['carousel-item']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div)({
|
||||
...{ class: "carousel-overlay" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['carousel-overlay']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "carousel-content" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['carousel-content']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.h2, __VLS_intrinsics.h2)({});
|
||||
(banner.title);
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_22;
|
||||
// @ts-ignore
|
||||
[];
|
||||
}
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_16;
|
||||
}
|
||||
else {
|
||||
const __VLS_25 = EmptyState;
|
||||
// @ts-ignore
|
||||
const __VLS_26 = __VLS_asFunctionalComponent1(__VLS_25, new __VLS_25({
|
||||
description: "暂无轮播图",
|
||||
}));
|
||||
const __VLS_27 = __VLS_26({
|
||||
description: "暂无轮播图",
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_26));
|
||||
}
|
||||
// @ts-ignore
|
||||
[];
|
||||
}
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_8;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.section, __VLS_intrinsics.section)({
|
||||
...{ class: "notice-section" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['notice-section']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "container" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['container']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "notice-bar" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['notice-bar']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ onClick: (__VLS_ctx.goToNotices) },
|
||||
...{ class: "notice-header" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['notice-header']} */ ;
|
||||
let __VLS_30;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon'] | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon']} */
|
||||
elIcon;
|
||||
// @ts-ignore
|
||||
const __VLS_31 = __VLS_asFunctionalComponent1(__VLS_30, new __VLS_30({
|
||||
size: (18),
|
||||
}));
|
||||
const __VLS_32 = __VLS_31({
|
||||
size: (18),
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_31));
|
||||
const { default: __VLS_35 } = __VLS_33.slots;
|
||||
let __VLS_36;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.Bell} */
|
||||
Bell;
|
||||
// @ts-ignore
|
||||
const __VLS_37 = __VLS_asFunctionalComponent1(__VLS_36, new __VLS_36({}));
|
||||
const __VLS_38 = __VLS_37({}, ...__VLS_functionalComponentArgsRest(__VLS_37));
|
||||
// @ts-ignore
|
||||
[goToNotices,];
|
||||
var __VLS_33;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "notice-label" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['notice-label']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "notice-scroll" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['notice-scroll']} */ ;
|
||||
let __VLS_41;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elSkeleton | typeof __VLS_components.ElSkeleton | typeof __VLS_components['el-skeleton'] | typeof __VLS_components.elSkeleton | typeof __VLS_components.ElSkeleton | typeof __VLS_components['el-skeleton']} */
|
||||
elSkeleton;
|
||||
// @ts-ignore
|
||||
const __VLS_42 = __VLS_asFunctionalComponent1(__VLS_41, new __VLS_41({
|
||||
loading: (__VLS_ctx.loading.notices),
|
||||
animated: true,
|
||||
count: (1),
|
||||
}));
|
||||
const __VLS_43 = __VLS_42({
|
||||
loading: (__VLS_ctx.loading.notices),
|
||||
animated: true,
|
||||
count: (1),
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_42));
|
||||
const { default: __VLS_46 } = __VLS_44.slots;
|
||||
{
|
||||
const { template: __VLS_47 } = __VLS_44.slots;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div)({
|
||||
...{ style: {} },
|
||||
});
|
||||
// @ts-ignore
|
||||
[loading,];
|
||||
}
|
||||
{
|
||||
const { default: __VLS_48 } = __VLS_44.slots;
|
||||
if (__VLS_ctx.notices.length > 0) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "notice-scroll-inner" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['notice-scroll-inner']} */ ;
|
||||
for (const [notice] of __VLS_vFor((__VLS_ctx.notices))) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ onClick: (...[$event]) => {
|
||||
if (!(__VLS_ctx.notices.length > 0))
|
||||
throw 0;
|
||||
return (__VLS_ctx.handleNoticeClick(notice));
|
||||
// @ts-ignore
|
||||
[notices, notices, handleNoticeClick,];
|
||||
} },
|
||||
key: (notice.id),
|
||||
...{ class: "notice-item" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['notice-item']} */ ;
|
||||
if (notice.type === 2) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "notice-badge notice-badge-event" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['notice-badge']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['notice-badge-event']} */ ;
|
||||
}
|
||||
else if (notice.type === 1) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "notice-badge notice-badge-important" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['notice-badge']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['notice-badge-important']} */ ;
|
||||
}
|
||||
else {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "notice-badge notice-badge-normal" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['notice-badge']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['notice-badge-normal']} */ ;
|
||||
}
|
||||
(notice.title);
|
||||
// @ts-ignore
|
||||
[];
|
||||
}
|
||||
}
|
||||
else {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "notice-empty" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['notice-empty']} */ ;
|
||||
}
|
||||
// @ts-ignore
|
||||
[];
|
||||
}
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_44;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ onClick: (__VLS_ctx.goToNotices) },
|
||||
...{ class: "notice-more" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['notice-more']} */ ;
|
||||
let __VLS_49;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon'] | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon']} */
|
||||
elIcon;
|
||||
// @ts-ignore
|
||||
const __VLS_50 = __VLS_asFunctionalComponent1(__VLS_49, new __VLS_49({}));
|
||||
const __VLS_51 = __VLS_50({}, ...__VLS_functionalComponentArgsRest(__VLS_50));
|
||||
const { default: __VLS_54 } = __VLS_52.slots;
|
||||
let __VLS_55;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.ArrowRight} */
|
||||
ArrowRight;
|
||||
// @ts-ignore
|
||||
const __VLS_56 = __VLS_asFunctionalComponent1(__VLS_55, new __VLS_55({}));
|
||||
const __VLS_57 = __VLS_56({}, ...__VLS_functionalComponentArgsRest(__VLS_56));
|
||||
// @ts-ignore
|
||||
[goToNotices,];
|
||||
var __VLS_52;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.section, __VLS_intrinsics.section)({
|
||||
...{ class: "product-section" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['product-section']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "container" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['container']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "section-header" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['section-header']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.h2, __VLS_intrinsics.h2)({
|
||||
...{ class: "section-title" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['section-title']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "section-icon" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['section-icon']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "section-subtitle" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['section-subtitle']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ onClick: (...[$event]) => {
|
||||
return (__VLS_ctx.router.push('/products'));
|
||||
// @ts-ignore
|
||||
[router,];
|
||||
} },
|
||||
...{ class: "section-more" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['section-more']} */ ;
|
||||
let __VLS_60;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon'] | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon']} */
|
||||
elIcon;
|
||||
// @ts-ignore
|
||||
const __VLS_61 = __VLS_asFunctionalComponent1(__VLS_60, new __VLS_60({
|
||||
size: (14),
|
||||
}));
|
||||
const __VLS_62 = __VLS_61({
|
||||
size: (14),
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_61));
|
||||
const { default: __VLS_65 } = __VLS_63.slots;
|
||||
let __VLS_66;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.ArrowRight} */
|
||||
ArrowRight;
|
||||
// @ts-ignore
|
||||
const __VLS_67 = __VLS_asFunctionalComponent1(__VLS_66, new __VLS_66({}));
|
||||
const __VLS_68 = __VLS_67({}, ...__VLS_functionalComponentArgsRest(__VLS_67));
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_63;
|
||||
let __VLS_71;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elSkeleton | typeof __VLS_components.ElSkeleton | typeof __VLS_components['el-skeleton'] | typeof __VLS_components.elSkeleton | typeof __VLS_components.ElSkeleton | typeof __VLS_components['el-skeleton']} */
|
||||
elSkeleton;
|
||||
// @ts-ignore
|
||||
const __VLS_72 = __VLS_asFunctionalComponent1(__VLS_71, new __VLS_71({
|
||||
loading: (__VLS_ctx.loading.hot),
|
||||
animated: true,
|
||||
count: (4),
|
||||
}));
|
||||
const __VLS_73 = __VLS_72({
|
||||
loading: (__VLS_ctx.loading.hot),
|
||||
animated: true,
|
||||
count: (4),
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_72));
|
||||
const { default: __VLS_76 } = __VLS_74.slots;
|
||||
{
|
||||
const { template: __VLS_77 } = __VLS_74.slots;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "product-grid" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['product-grid']} */ ;
|
||||
for (const [i] of __VLS_vFor((8))) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div)({
|
||||
key: (i),
|
||||
...{ class: "product-skeleton-card" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['product-skeleton-card']} */ ;
|
||||
// @ts-ignore
|
||||
[loading,];
|
||||
}
|
||||
// @ts-ignore
|
||||
[];
|
||||
}
|
||||
{
|
||||
const { default: __VLS_78 } = __VLS_74.slots;
|
||||
if (__VLS_ctx.hotProducts.length > 0) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "product-grid" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['product-grid']} */ ;
|
||||
for (const [product] of __VLS_vFor((__VLS_ctx.hotProducts))) {
|
||||
const __VLS_79 = ProductCard;
|
||||
// @ts-ignore
|
||||
const __VLS_80 = __VLS_asFunctionalComponent1(__VLS_79, new __VLS_79({
|
||||
key: (product.id),
|
||||
product: (product),
|
||||
}));
|
||||
const __VLS_81 = __VLS_80({
|
||||
key: (product.id),
|
||||
product: (product),
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_80));
|
||||
// @ts-ignore
|
||||
[hotProducts, hotProducts,];
|
||||
}
|
||||
}
|
||||
else {
|
||||
const __VLS_84 = EmptyState;
|
||||
// @ts-ignore
|
||||
const __VLS_85 = __VLS_asFunctionalComponent1(__VLS_84, new __VLS_84({
|
||||
description: "暂无热门商品",
|
||||
}));
|
||||
const __VLS_86 = __VLS_85({
|
||||
description: "暂无热门商品",
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_85));
|
||||
}
|
||||
// @ts-ignore
|
||||
[];
|
||||
}
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_74;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.section, __VLS_intrinsics.section)({
|
||||
...{ class: "product-section" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['product-section']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "container" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['container']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "section-header" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['section-header']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.h2, __VLS_intrinsics.h2)({
|
||||
...{ class: "section-title" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['section-title']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "section-icon" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['section-icon']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "section-subtitle" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['section-subtitle']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ onClick: (...[$event]) => {
|
||||
return (__VLS_ctx.router.push('/products'));
|
||||
// @ts-ignore
|
||||
[router,];
|
||||
} },
|
||||
...{ class: "section-more" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['section-more']} */ ;
|
||||
let __VLS_89;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon'] | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon']} */
|
||||
elIcon;
|
||||
// @ts-ignore
|
||||
const __VLS_90 = __VLS_asFunctionalComponent1(__VLS_89, new __VLS_89({
|
||||
size: (14),
|
||||
}));
|
||||
const __VLS_91 = __VLS_90({
|
||||
size: (14),
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_90));
|
||||
const { default: __VLS_94 } = __VLS_92.slots;
|
||||
let __VLS_95;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.ArrowRight} */
|
||||
ArrowRight;
|
||||
// @ts-ignore
|
||||
const __VLS_96 = __VLS_asFunctionalComponent1(__VLS_95, new __VLS_95({}));
|
||||
const __VLS_97 = __VLS_96({}, ...__VLS_functionalComponentArgsRest(__VLS_96));
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_92;
|
||||
let __VLS_100;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elSkeleton | typeof __VLS_components.ElSkeleton | typeof __VLS_components['el-skeleton'] | typeof __VLS_components.elSkeleton | typeof __VLS_components.ElSkeleton | typeof __VLS_components['el-skeleton']} */
|
||||
elSkeleton;
|
||||
// @ts-ignore
|
||||
const __VLS_101 = __VLS_asFunctionalComponent1(__VLS_100, new __VLS_100({
|
||||
loading: (__VLS_ctx.loading.new),
|
||||
animated: true,
|
||||
count: (4),
|
||||
}));
|
||||
const __VLS_102 = __VLS_101({
|
||||
loading: (__VLS_ctx.loading.new),
|
||||
animated: true,
|
||||
count: (4),
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_101));
|
||||
const { default: __VLS_105 } = __VLS_103.slots;
|
||||
{
|
||||
const { template: __VLS_106 } = __VLS_103.slots;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "product-grid" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['product-grid']} */ ;
|
||||
for (const [i] of __VLS_vFor((8))) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div)({
|
||||
key: (i),
|
||||
...{ class: "product-skeleton-card" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['product-skeleton-card']} */ ;
|
||||
// @ts-ignore
|
||||
[loading,];
|
||||
}
|
||||
// @ts-ignore
|
||||
[];
|
||||
}
|
||||
{
|
||||
const { default: __VLS_107 } = __VLS_103.slots;
|
||||
if (__VLS_ctx.newProducts.length > 0) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "product-grid" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['product-grid']} */ ;
|
||||
for (const [product] of __VLS_vFor((__VLS_ctx.newProducts))) {
|
||||
const __VLS_108 = ProductCard;
|
||||
// @ts-ignore
|
||||
const __VLS_109 = __VLS_asFunctionalComponent1(__VLS_108, new __VLS_108({
|
||||
key: (product.id),
|
||||
product: (product),
|
||||
}));
|
||||
const __VLS_110 = __VLS_109({
|
||||
key: (product.id),
|
||||
product: (product),
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_109));
|
||||
// @ts-ignore
|
||||
[newProducts, newProducts,];
|
||||
}
|
||||
}
|
||||
else {
|
||||
const __VLS_113 = EmptyState;
|
||||
// @ts-ignore
|
||||
const __VLS_114 = __VLS_asFunctionalComponent1(__VLS_113, new __VLS_113({
|
||||
description: "暂无新品",
|
||||
}));
|
||||
const __VLS_115 = __VLS_114({
|
||||
description: "暂无新品",
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_114));
|
||||
}
|
||||
// @ts-ignore
|
||||
[];
|
||||
}
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_103;
|
||||
const __VLS_118 = AppFooter;
|
||||
// @ts-ignore
|
||||
const __VLS_119 = __VLS_asFunctionalComponent1(__VLS_118, new __VLS_118({}));
|
||||
const __VLS_120 = __VLS_119({}, ...__VLS_functionalComponentArgsRest(__VLS_119));
|
||||
// @ts-ignore
|
||||
[];
|
||||
const __VLS_export = (await import('vue')).defineComponent({});
|
||||
export default {};
|
||||
//# sourceMappingURL=index.vue.js.map
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,13 +0,0 @@
|
|||
const __VLS_ctx = {};
|
||||
let __VLS_components;
|
||||
let __VLS_intrinsics;
|
||||
let __VLS_directives;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "placeholder-page" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['placeholder-page']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.h2, __VLS_intrinsics.h2)({});
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({});
|
||||
const __VLS_export = (await import('vue')).defineComponent({});
|
||||
export default {};
|
||||
//# sourceMappingURL=detail.vue.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"detail.vue.js","sourceRoot":"","sources":["detail.vue"],"names":[],"mappings":"AAiCA,MAAM,SAAS,GAAG,EAA2C,CAAC;AAG9D,IAAI,gBAAiE,CAAC;AACtE,IAAI,gBAAkE,CAAC;AAEvE,IAAI,gBAAyE,CAAC;AAG9E,0BAA0B,CAAC,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACvE,GAAG,EAAE,KAAK,EAAE,kBAAkB,EAAE;CAC/B,CAAC,CAAC;AACH,2DAA2D,CAAA,CAAC;AAC5D,0BAA0B,CAAC,gBAAgB,CAAC,EAAE,EAAE,gBAAgB,CAAC,EAAE,CAAC,CAAC,EACpE,CAAC,CAAC;AACH,0BAA0B,CAAC,gBAAgB,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAClE,CAAC,CAAC;AAGH,MAAM,YAAY,GAAG,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,EAC1D,CAAC,CAAC;AACH,eAAe,EAAyB,CAAC"}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
const __VLS_ctx = {};
|
||||
let __VLS_components;
|
||||
let __VLS_intrinsics;
|
||||
let __VLS_directives;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "placeholder-page" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['placeholder-page']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.h2, __VLS_intrinsics.h2)({});
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({});
|
||||
const __VLS_export = (await import('vue')).defineComponent({});
|
||||
export default {};
|
||||
//# sourceMappingURL=index.vue.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.vue.js","sourceRoot":"","sources":["index.vue"],"names":[],"mappings":"AAiCA,MAAM,SAAS,GAAG,EAA2C,CAAC;AAG9D,IAAI,gBAAiE,CAAC;AACtE,IAAI,gBAAkE,CAAC;AAEvE,IAAI,gBAAyE,CAAC;AAG9E,0BAA0B,CAAC,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACvE,GAAG,EAAE,KAAK,EAAE,kBAAkB,EAAE;CAC/B,CAAC,CAAC;AACH,2DAA2D,CAAA,CAAC;AAC5D,0BAA0B,CAAC,gBAAgB,CAAC,EAAE,EAAE,gBAAgB,CAAC,EAAE,CAAC,CAAC,EACpE,CAAC,CAAC;AACH,0BAA0B,CAAC,gBAAgB,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAClE,CAAC,CAAC;AAGH,MAAM,YAAY,GAAG,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,EAC1D,CAAC,CAAC;AACH,eAAe,EAAyB,CAAC"}
|
||||
|
|
@ -1,625 +0,0 @@
|
|||
import { ref, computed, onMounted } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { ShoppingCart, Plus, Minus } from '@element-plus/icons-vue';
|
||||
import { useUserStore } from '@/stores/modules/user';
|
||||
import { getProductDetailApi } from '@/api/product';
|
||||
import { addToCartApi } from '@/api/cart';
|
||||
import AppHeader from '@/components/layout/AppHeader.vue';
|
||||
import AppFooter from '@/components/layout/AppFooter.vue';
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const userStore = useUserStore();
|
||||
// ==================== 数据 ====================
|
||||
const product = ref(null);
|
||||
const loading = ref(true);
|
||||
const activeImageIndex = ref(0);
|
||||
const selectedSku = ref(null);
|
||||
const quantity = ref(1);
|
||||
const addingToCart = ref(false);
|
||||
// ==================== 计算 ====================
|
||||
const allImages = computed(() => {
|
||||
if (!product.value)
|
||||
return [];
|
||||
const imgs = [];
|
||||
if (product.value.mainImage)
|
||||
imgs.push(product.value.mainImage);
|
||||
if (product.value.subImages?.length)
|
||||
imgs.push(...product.value.subImages);
|
||||
return imgs;
|
||||
});
|
||||
const currentImage = computed(() => {
|
||||
return allImages.value[activeImageIndex.value] || '';
|
||||
});
|
||||
const priceLabel = computed(() => {
|
||||
if (selectedSku.value) {
|
||||
return `¥${Number(selectedSku.value.price).toFixed(2)}`;
|
||||
}
|
||||
if (!product.value)
|
||||
return '';
|
||||
const min = Number(product.value.minPrice);
|
||||
if (min > 0)
|
||||
return `¥${min.toFixed(2)} 起`;
|
||||
return '';
|
||||
});
|
||||
const originPriceLabel = computed(() => {
|
||||
if (selectedSku.value && product.value?.originPrice) {
|
||||
const op = Number(product.value.originPrice);
|
||||
const sp = Number(selectedSku.value.price);
|
||||
if (op > sp)
|
||||
return `¥${op.toFixed(2)}`;
|
||||
}
|
||||
return '';
|
||||
});
|
||||
const canAddToCart = computed(() => {
|
||||
return selectedSku.value !== null && quantity.value > 0;
|
||||
});
|
||||
// ==================== 方法 ====================
|
||||
function selectSku(sku) {
|
||||
selectedSku.value = sku;
|
||||
// 如果 SKU 有独立图片,切换主图
|
||||
if (sku.image && allImages.value.includes(sku.image)) {
|
||||
activeImageIndex.value = allImages.value.indexOf(sku.image);
|
||||
}
|
||||
}
|
||||
function increaseQty() {
|
||||
const max = selectedSku.value?.stock ?? 1;
|
||||
if (quantity.value < max) {
|
||||
quantity.value++;
|
||||
}
|
||||
}
|
||||
function decreaseQty() {
|
||||
if (quantity.value > 1) {
|
||||
quantity.value--;
|
||||
}
|
||||
}
|
||||
async function handleAddToCart() {
|
||||
if (!canAddToCart.value || !product.value || !selectedSku.value)
|
||||
return;
|
||||
// 需要登录
|
||||
if (!userStore.isLoggedIn) {
|
||||
router.push(`/login?redirect=${encodeURIComponent(route.fullPath)}`);
|
||||
return;
|
||||
}
|
||||
addingToCart.value = true;
|
||||
try {
|
||||
await addToCartApi({
|
||||
productId: product.value.id,
|
||||
skuId: selectedSku.value.id,
|
||||
quantity: quantity.value
|
||||
});
|
||||
ElMessage.success('已添加到购物车');
|
||||
}
|
||||
catch {
|
||||
/* 拦截器已提示 */
|
||||
}
|
||||
finally {
|
||||
addingToCart.value = false;
|
||||
}
|
||||
}
|
||||
// ==================== 加载 ====================
|
||||
onMounted(async () => {
|
||||
const id = Number(route.params.id);
|
||||
if (!id || Number.isNaN(id)) {
|
||||
router.replace('/404');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
product.value = await getProductDetailApi(id);
|
||||
document.title = product.value?.name ? `${product.value.name} - 零食商城` : '商品详情';
|
||||
// 默认选中第一个 SKU
|
||||
if (product.value?.skuList?.length) {
|
||||
selectedSku.value = product.value.skuList[0];
|
||||
}
|
||||
}
|
||||
catch {
|
||||
ElMessage.error('商品不存在或已下架');
|
||||
}
|
||||
finally {
|
||||
loading.value = false;
|
||||
}
|
||||
});
|
||||
const __VLS_ctx = {
|
||||
...{},
|
||||
...{},
|
||||
};
|
||||
let __VLS_components;
|
||||
let __VLS_intrinsics;
|
||||
let __VLS_directives;
|
||||
/** @type {__VLS_StyleScopedClasses['active']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['disabled']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['detail-layout']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['detail-skeleton']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['product-name']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['current-price']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "detail-page" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['detail-page']} */ ;
|
||||
const __VLS_0 = AppHeader;
|
||||
// @ts-ignore
|
||||
const __VLS_1 = __VLS_asFunctionalComponent1(__VLS_0, new __VLS_0({}));
|
||||
const __VLS_2 = __VLS_1({}, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.main, __VLS_intrinsics.main)({
|
||||
...{ class: "detail-main" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['detail-main']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "container" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['container']} */ ;
|
||||
let __VLS_5;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elSkeleton | typeof __VLS_components.ElSkeleton | typeof __VLS_components['el-skeleton'] | typeof __VLS_components.elSkeleton | typeof __VLS_components.ElSkeleton | typeof __VLS_components['el-skeleton']} */
|
||||
elSkeleton;
|
||||
// @ts-ignore
|
||||
const __VLS_6 = __VLS_asFunctionalComponent1(__VLS_5, new __VLS_5({
|
||||
loading: (__VLS_ctx.loading),
|
||||
animated: true,
|
||||
count: (1),
|
||||
}));
|
||||
const __VLS_7 = __VLS_6({
|
||||
loading: (__VLS_ctx.loading),
|
||||
animated: true,
|
||||
count: (1),
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_6));
|
||||
const { default: __VLS_10 } = __VLS_8.slots;
|
||||
{
|
||||
const { template: __VLS_11 } = __VLS_8.slots;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "detail-skeleton" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['detail-skeleton']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "skeleton-gallery" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['skeleton-gallery']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div)({
|
||||
...{ class: "skeleton-main" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['skeleton-main']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "skeleton-thumbs" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['skeleton-thumbs']} */ ;
|
||||
for (const [i] of __VLS_vFor((4))) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div)({
|
||||
key: (i),
|
||||
...{ class: "skeleton-thumb" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['skeleton-thumb']} */ ;
|
||||
// @ts-ignore
|
||||
[loading,];
|
||||
}
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "skeleton-info" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['skeleton-info']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div)({
|
||||
...{ class: "skeleton-line skeleton-title" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['skeleton-line']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['skeleton-title']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div)({
|
||||
...{ class: "skeleton-line skeleton-brand" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['skeleton-line']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['skeleton-brand']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div)({
|
||||
...{ class: "skeleton-line skeleton-price" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['skeleton-line']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['skeleton-price']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div)({
|
||||
...{ class: "skeleton-line" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['skeleton-line']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div)({
|
||||
...{ class: "skeleton-line skeleton-btn" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['skeleton-line']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['skeleton-btn']} */ ;
|
||||
// @ts-ignore
|
||||
[];
|
||||
}
|
||||
if (__VLS_ctx.product) {
|
||||
{
|
||||
const { default: __VLS_12 } = __VLS_8.slots;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "detail-layout" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['detail-layout']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "detail-gallery" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['detail-gallery']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "gallery-main" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['gallery-main']} */ ;
|
||||
let __VLS_13;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elImage | typeof __VLS_components.ElImage | typeof __VLS_components['el-image'] | typeof __VLS_components.elImage | typeof __VLS_components.ElImage | typeof __VLS_components['el-image']} */
|
||||
elImage;
|
||||
// @ts-ignore
|
||||
const __VLS_14 = __VLS_asFunctionalComponent1(__VLS_13, new __VLS_13({
|
||||
src: (__VLS_ctx.currentImage),
|
||||
fit: "cover",
|
||||
...{ class: "main-image" },
|
||||
}));
|
||||
const __VLS_15 = __VLS_14({
|
||||
src: (__VLS_ctx.currentImage),
|
||||
fit: "cover",
|
||||
...{ class: "main-image" },
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_14));
|
||||
/** @type {__VLS_StyleScopedClasses['main-image']} */ ;
|
||||
const { default: __VLS_18 } = __VLS_16.slots;
|
||||
{
|
||||
const { error: __VLS_19 } = __VLS_16.slots;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "image-placeholder" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['image-placeholder']} */ ;
|
||||
// @ts-ignore
|
||||
[product, currentImage,];
|
||||
}
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_16;
|
||||
if (__VLS_ctx.allImages.length > 1) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "gallery-thumbs" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['gallery-thumbs']} */ ;
|
||||
for (const [img, idx] of __VLS_vFor((__VLS_ctx.allImages))) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ onClick: (...[$event]) => {
|
||||
if (!(__VLS_ctx.product))
|
||||
throw 0;
|
||||
if (!(__VLS_ctx.allImages.length > 1))
|
||||
throw 0;
|
||||
return (__VLS_ctx.activeImageIndex = idx);
|
||||
// @ts-ignore
|
||||
[allImages, allImages, activeImageIndex,];
|
||||
} },
|
||||
key: (idx),
|
||||
...{ class: "thumb-item" },
|
||||
...{ class: ({ active: idx === __VLS_ctx.activeImageIndex }) },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['thumb-item']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['active']} */ ;
|
||||
let __VLS_20;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elImage | typeof __VLS_components.ElImage | typeof __VLS_components['el-image'] | typeof __VLS_components.elImage | typeof __VLS_components.ElImage | typeof __VLS_components['el-image']} */
|
||||
elImage;
|
||||
// @ts-ignore
|
||||
const __VLS_21 = __VLS_asFunctionalComponent1(__VLS_20, new __VLS_20({
|
||||
src: (img),
|
||||
fit: "cover",
|
||||
...{ class: "thumb-image" },
|
||||
}));
|
||||
const __VLS_22 = __VLS_21({
|
||||
src: (img),
|
||||
fit: "cover",
|
||||
...{ class: "thumb-image" },
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_21));
|
||||
/** @type {__VLS_StyleScopedClasses['thumb-image']} */ ;
|
||||
const { default: __VLS_25 } = __VLS_23.slots;
|
||||
{
|
||||
const { error: __VLS_26 } = __VLS_23.slots;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "thumb-placeholder" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['thumb-placeholder']} */ ;
|
||||
// @ts-ignore
|
||||
[activeImageIndex,];
|
||||
}
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_23;
|
||||
// @ts-ignore
|
||||
[];
|
||||
}
|
||||
}
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "detail-info" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['detail-info']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.h1, __VLS_intrinsics.h1)({
|
||||
...{ class: "product-name" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['product-name']} */ ;
|
||||
(__VLS_ctx.product.name);
|
||||
if (__VLS_ctx.product.brand) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({
|
||||
...{ class: "product-brand" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['product-brand']} */ ;
|
||||
(__VLS_ctx.product.brand);
|
||||
}
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "product-meta" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['product-meta']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({});
|
||||
(__VLS_ctx.product.sales);
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "meta-divider" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['meta-divider']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({});
|
||||
(__VLS_ctx.product.viewCount);
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "meta-divider" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['meta-divider']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({});
|
||||
(__VLS_ctx.product.categoryName);
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "price-box" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['price-box']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "current-price" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['current-price']} */ ;
|
||||
(__VLS_ctx.priceLabel);
|
||||
if (__VLS_ctx.originPriceLabel) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "origin-price" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['origin-price']} */ ;
|
||||
(__VLS_ctx.originPriceLabel);
|
||||
}
|
||||
if (__VLS_ctx.selectedSku) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "price-tip" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['price-tip']} */ ;
|
||||
if (__VLS_ctx.selectedSku.stock <= 10 && __VLS_ctx.selectedSku.stock > 0) {
|
||||
(__VLS_ctx.selectedSku.stock);
|
||||
}
|
||||
else if (__VLS_ctx.selectedSku.stock === 0) {
|
||||
}
|
||||
}
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "sku-section" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['sku-section']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "sku-label" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['sku-label']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "sku-list" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['sku-list']} */ ;
|
||||
for (const [sku] of __VLS_vFor((__VLS_ctx.product.skuList))) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ onClick: (...[$event]) => {
|
||||
if (!(__VLS_ctx.product))
|
||||
throw 0;
|
||||
return (sku.stock > 0 && __VLS_ctx.selectSku(sku));
|
||||
// @ts-ignore
|
||||
[product, product, product, product, product, product, product, priceLabel, originPriceLabel, originPriceLabel, selectedSku, selectedSku, selectedSku, selectedSku, selectedSku, selectSku,];
|
||||
} },
|
||||
key: (sku.id),
|
||||
...{ class: "sku-item" },
|
||||
...{ class: ({
|
||||
active: __VLS_ctx.selectedSku?.id === sku.id,
|
||||
disabled: sku.stock <= 0
|
||||
}) },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['sku-item']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['active']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['disabled']} */ ;
|
||||
(sku.skuName);
|
||||
// @ts-ignore
|
||||
[selectedSku,];
|
||||
}
|
||||
if (__VLS_ctx.selectedSku) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "sku-detail" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['sku-detail']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "sku-detail-item" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['sku-detail-item']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.strong, __VLS_intrinsics.strong)({});
|
||||
(Number(__VLS_ctx.selectedSku.price).toFixed(2));
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "sku-detail-item" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['sku-detail-item']} */ ;
|
||||
(__VLS_ctx.selectedSku.stock);
|
||||
if (__VLS_ctx.selectedSku.weight) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "sku-detail-item" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['sku-detail-item']} */ ;
|
||||
(__VLS_ctx.selectedSku.weight);
|
||||
}
|
||||
}
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "qty-section" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['qty-section']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
|
||||
...{ class: "qty-label" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['qty-label']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "qty-control" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['qty-control']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.button, __VLS_intrinsics.button)({
|
||||
...{ onClick: (__VLS_ctx.decreaseQty) },
|
||||
...{ class: "qty-btn" },
|
||||
disabled: (__VLS_ctx.quantity <= 1),
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['qty-btn']} */ ;
|
||||
let __VLS_27;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon'] | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon']} */
|
||||
elIcon;
|
||||
// @ts-ignore
|
||||
const __VLS_28 = __VLS_asFunctionalComponent1(__VLS_27, new __VLS_27({}));
|
||||
const __VLS_29 = __VLS_28({}, ...__VLS_functionalComponentArgsRest(__VLS_28));
|
||||
const { default: __VLS_32 } = __VLS_30.slots;
|
||||
let __VLS_33;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.Minus} */
|
||||
Minus;
|
||||
// @ts-ignore
|
||||
const __VLS_34 = __VLS_asFunctionalComponent1(__VLS_33, new __VLS_33({}));
|
||||
const __VLS_35 = __VLS_34({}, ...__VLS_functionalComponentArgsRest(__VLS_34));
|
||||
// @ts-ignore
|
||||
[selectedSku, selectedSku, selectedSku, selectedSku, selectedSku, decreaseQty, quantity,];
|
||||
var __VLS_30;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.input)({
|
||||
type: "number",
|
||||
...{ class: "qty-input" },
|
||||
min: (1),
|
||||
max: (__VLS_ctx.selectedSku?.stock ?? 1),
|
||||
});
|
||||
(__VLS_ctx.quantity);
|
||||
/** @type {__VLS_StyleScopedClasses['qty-input']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.button, __VLS_intrinsics.button)({
|
||||
...{ onClick: (__VLS_ctx.increaseQty) },
|
||||
...{ class: "qty-btn" },
|
||||
disabled: (__VLS_ctx.quantity >= (__VLS_ctx.selectedSku?.stock ?? 1)),
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['qty-btn']} */ ;
|
||||
let __VLS_38;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon'] | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon']} */
|
||||
elIcon;
|
||||
// @ts-ignore
|
||||
const __VLS_39 = __VLS_asFunctionalComponent1(__VLS_38, new __VLS_38({}));
|
||||
const __VLS_40 = __VLS_39({}, ...__VLS_functionalComponentArgsRest(__VLS_39));
|
||||
const { default: __VLS_43 } = __VLS_41.slots;
|
||||
let __VLS_44;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.Plus} */
|
||||
Plus;
|
||||
// @ts-ignore
|
||||
const __VLS_45 = __VLS_asFunctionalComponent1(__VLS_44, new __VLS_44({}));
|
||||
const __VLS_46 = __VLS_45({}, ...__VLS_functionalComponentArgsRest(__VLS_45));
|
||||
// @ts-ignore
|
||||
[selectedSku, selectedSku, quantity, quantity, increaseQty,];
|
||||
var __VLS_41;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "action-section" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['action-section']} */ ;
|
||||
let __VLS_49;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button'] | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button']} */
|
||||
elButton;
|
||||
// @ts-ignore
|
||||
const __VLS_50 = __VLS_asFunctionalComponent1(__VLS_49, new __VLS_49({
|
||||
...{ 'onClick': {} },
|
||||
type: "primary",
|
||||
size: "large",
|
||||
icon: (__VLS_ctx.ShoppingCart),
|
||||
loading: (__VLS_ctx.addingToCart),
|
||||
disabled: (!__VLS_ctx.canAddToCart),
|
||||
...{ class: "add-cart-btn" },
|
||||
}));
|
||||
const __VLS_51 = __VLS_50({
|
||||
...{ 'onClick': {} },
|
||||
type: "primary",
|
||||
size: "large",
|
||||
icon: (__VLS_ctx.ShoppingCart),
|
||||
loading: (__VLS_ctx.addingToCart),
|
||||
disabled: (!__VLS_ctx.canAddToCart),
|
||||
...{ class: "add-cart-btn" },
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_50));
|
||||
let __VLS_54;
|
||||
const __VLS_55 = {
|
||||
/** @type {typeof __VLS_54.click} */
|
||||
onClick: (__VLS_ctx.handleAddToCart),
|
||||
};
|
||||
/** @type {__VLS_StyleScopedClasses['add-cart-btn']} */ ;
|
||||
const { default: __VLS_56 } = __VLS_52.slots;
|
||||
// @ts-ignore
|
||||
[ShoppingCart, addingToCart, canAddToCart, handleAddToCart,];
|
||||
var __VLS_52;
|
||||
var __VLS_53;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "detail-bottom" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['detail-bottom']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "detail-tabs" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['detail-tabs']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.h2, __VLS_intrinsics.h2)({
|
||||
...{ class: "tab-title active" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['tab-title']} */ ;
|
||||
/** @type {__VLS_StyleScopedClasses['active']} */ ;
|
||||
if (__VLS_ctx.product.detail) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div)({
|
||||
...{ class: "detail-content" },
|
||||
});
|
||||
__VLS_asFunctionalDirective(__VLS_directives.vHtml, {})(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.product.detail), }, null, null);
|
||||
/** @type {__VLS_StyleScopedClasses['detail-content']} */ ;
|
||||
}
|
||||
else {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "detail-empty" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['detail-empty']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({});
|
||||
}
|
||||
// @ts-ignore
|
||||
[product, product,];
|
||||
}
|
||||
}
|
||||
if (!__VLS_ctx.loading && !__VLS_ctx.product) {
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "detail-error" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['detail-error']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "error-icon" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['error-icon']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.h2, __VLS_intrinsics.h2)({});
|
||||
let __VLS_57;
|
||||
/** @ts-ignore @type { | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button'] | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button']} */
|
||||
elButton;
|
||||
// @ts-ignore
|
||||
const __VLS_58 = __VLS_asFunctionalComponent1(__VLS_57, new __VLS_57({
|
||||
...{ 'onClick': {} },
|
||||
type: "primary",
|
||||
round: true,
|
||||
}));
|
||||
const __VLS_59 = __VLS_58({
|
||||
...{ 'onClick': {} },
|
||||
type: "primary",
|
||||
round: true,
|
||||
}, ...__VLS_functionalComponentArgsRest(__VLS_58));
|
||||
let __VLS_62;
|
||||
const __VLS_63 = {
|
||||
/** @type {typeof __VLS_62.click} */
|
||||
onClick: (...[$event]) => {
|
||||
if (!(!__VLS_ctx.loading && !__VLS_ctx.product))
|
||||
throw 0;
|
||||
return (__VLS_ctx.router.push('/'));
|
||||
// @ts-ignore
|
||||
[loading, product, router,];
|
||||
},
|
||||
};
|
||||
const { default: __VLS_64 } = __VLS_60.slots;
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_60;
|
||||
var __VLS_61;
|
||||
}
|
||||
// @ts-ignore
|
||||
[];
|
||||
var __VLS_8;
|
||||
const __VLS_65 = AppFooter;
|
||||
// @ts-ignore
|
||||
const __VLS_66 = __VLS_asFunctionalComponent1(__VLS_65, new __VLS_65({}));
|
||||
const __VLS_67 = __VLS_66({}, ...__VLS_functionalComponentArgsRest(__VLS_66));
|
||||
// @ts-ignore
|
||||
[];
|
||||
const __VLS_export = (await import('vue')).defineComponent({});
|
||||
export default {};
|
||||
//# sourceMappingURL=detail.vue.js.map
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,13 +0,0 @@
|
|||
const __VLS_ctx = {};
|
||||
let __VLS_components;
|
||||
let __VLS_intrinsics;
|
||||
let __VLS_directives;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "placeholder-page" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['placeholder-page']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.h2, __VLS_intrinsics.h2)({});
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({});
|
||||
const __VLS_export = (await import('vue')).defineComponent({});
|
||||
export default {};
|
||||
//# sourceMappingURL=search.vue.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"search.vue.js","sourceRoot":"","sources":["search.vue"],"names":[],"mappings":"AAiCA,MAAM,SAAS,GAAG,EAA2C,CAAC;AAG9D,IAAI,gBAAiE,CAAC;AACtE,IAAI,gBAAkE,CAAC;AAEvE,IAAI,gBAAyE,CAAC;AAG9E,0BAA0B,CAAC,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACvE,GAAG,EAAE,KAAK,EAAE,kBAAkB,EAAE;CAC/B,CAAC,CAAC;AACH,2DAA2D,CAAA,CAAC;AAC5D,0BAA0B,CAAC,gBAAgB,CAAC,EAAE,EAAE,gBAAgB,CAAC,EAAE,CAAC,CAAC,EACpE,CAAC,CAAC;AACH,0BAA0B,CAAC,gBAAgB,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAClE,CAAC,CAAC;AAGH,MAAM,YAAY,GAAG,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,EAC1D,CAAC,CAAC;AACH,eAAe,EAAyB,CAAC"}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
const __VLS_ctx = {};
|
||||
let __VLS_components;
|
||||
let __VLS_intrinsics;
|
||||
let __VLS_directives;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "placeholder-page" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['placeholder-page']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.h2, __VLS_intrinsics.h2)({});
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({});
|
||||
const __VLS_export = (await import('vue')).defineComponent({});
|
||||
export default {};
|
||||
//# sourceMappingURL=index.vue.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.vue.js","sourceRoot":"","sources":["index.vue"],"names":[],"mappings":"AAiCA,MAAM,SAAS,GAAG,EAA2C,CAAC;AAG9D,IAAI,gBAAiE,CAAC;AACtE,IAAI,gBAAkE,CAAC;AAEvE,IAAI,gBAAyE,CAAC;AAG9E,0BAA0B,CAAC,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACvE,GAAG,EAAE,KAAK,EAAE,kBAAkB,EAAE;CAC/B,CAAC,CAAC;AACH,2DAA2D,CAAA,CAAC;AAC5D,0BAA0B,CAAC,gBAAgB,CAAC,EAAE,EAAE,gBAAgB,CAAC,EAAE,CAAC,CAAC,EACpE,CAAC,CAAC;AACH,0BAA0B,CAAC,gBAAgB,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAClE,CAAC,CAAC;AAGH,MAAM,YAAY,GAAG,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,EAC1D,CAAC,CAAC;AACH,eAAe,EAAyB,CAAC"}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
const __VLS_ctx = {};
|
||||
let __VLS_components;
|
||||
let __VLS_intrinsics;
|
||||
let __VLS_directives;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
|
||||
...{ class: "placeholder-page" },
|
||||
});
|
||||
/** @type {__VLS_StyleScopedClasses['placeholder-page']} */ ;
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.h2, __VLS_intrinsics.h2)({});
|
||||
__VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({});
|
||||
const __VLS_export = (await import('vue')).defineComponent({});
|
||||
export default {};
|
||||
//# sourceMappingURL=index.vue.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.vue.js","sourceRoot":"","sources":["index.vue"],"names":[],"mappings":"AAiCA,MAAM,SAAS,GAAG,EAA2C,CAAC;AAG9D,IAAI,gBAAiE,CAAC;AACtE,IAAI,gBAAkE,CAAC;AAEvE,IAAI,gBAAyE,CAAC;AAG9E,0BAA0B,CAAC,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACvE,GAAG,EAAE,KAAK,EAAE,kBAAkB,EAAE;CAC/B,CAAC,CAAC;AACH,2DAA2D,CAAA,CAAC;AAC5D,0BAA0B,CAAC,gBAAgB,CAAC,EAAE,EAAE,gBAAgB,CAAC,EAAE,CAAC,CAAC,EACpE,CAAC,CAAC;AACH,0BAA0B,CAAC,gBAAgB,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAClE,CAAC,CAAC;AAGH,MAAM,YAAY,GAAG,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,EAC1D,CAAC,CAAC;AACH,eAAe,EAAyB,CAAC"}
|
||||
Loading…
Reference in New Issue