1934 lines
77 KiB
JavaScript
1934 lines
77 KiB
JavaScript
import { defineComponent, computed, withAsyncContext, unref, mergeProps, ref, reactive, withCtx, createVNode, watch, resolveDirective, openBlock, createBlock, toDisplayString, createTextVNode, shallowRef, inject, provide, nextTick, Transition, withDirectives, vShow, useSSRContext } from 'vue';
|
|
import { ssrRenderComponent, ssrRenderAttrs, ssrRenderAttr, ssrInterpolate, ssrRenderList, ssrGetDirectiveProps, ssrRenderStyle, ssrRenderSlot } from 'vue/server-renderer';
|
|
import { u as useRouter$1, a as useConfigStore, b as useUserStore, e as loading, aQ as getOneUser, q as useElementSize, o as useCartStore, m as useIntersectionObserver, n as getToken, V as withInstall, z as useConfigInject, aC as devWarning, A as classNames, ad as getTransitionProps, Y as getTransitionName, E as omit, aR as NoCompactStyle, Q as initDefaultProps, B as genComponentStyleHook, C as merge, a4 as Portal, P as PropTypes, a9 as objectType, S as getPropsSlot, aq as KeyCode, F as functionType, I as arrayType, af as CloseOutlined } from './server.mjs';
|
|
import { _ as _imports_0$2, a as _imports_1$2 } from './cart-DMkYna66.mjs';
|
|
import { B as BasicIconOld } from './BasicIconOld-93vAWohq.mjs';
|
|
import numbro from 'numbro';
|
|
import { B as BasicButton } from './BasicButton-CNera6n7.mjs';
|
|
import { H as Highlights, T as Tabs, _ as __nuxt_component_1$2 } from './Highlights-hsf9wGS5.mjs';
|
|
import { U as UserProfilePic } from './UserProfilePic-XzJNxY0K.mjs';
|
|
import { l as loadGray, _ as __nuxt_component_0 } from './gray-Bd8mWW-o.mjs';
|
|
import { u as useMediaStore } from './media-SggCY0jL.mjs';
|
|
import { _ as _sfc_main$8 } from './FullScreenStories-DfqBumN3.mjs';
|
|
import { u as useUserPostStore } from './userPostsStore-CAxMlK-n.mjs';
|
|
import { u as useAsyncData } from './asyncData-CZ9BKXPA.mjs';
|
|
import { B as Badge, i as isNumeric } from './index-BdQA8FuS.mjs';
|
|
import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';
|
|
import _extends from '@babel/runtime/helpers/esm/extends';
|
|
import { _ as __nuxt_component_1 } from './index-Cq494RwS.mjs';
|
|
import { _ as __nuxt_component_1$1 } from './index-CHH5_wC4.mjs';
|
|
import { _ as _export_sfc } from './_plugin-vue_export-helper-1tPrXgE0.mjs';
|
|
import { _ as _sfc_main$9 } from './OrdersList-Dw8e4QsQ.mjs';
|
|
import { _ as _sfc_main$a } from './SavedList-1hoOQDD0.mjs';
|
|
import { u as usePrice } from './usePrice-_QzChhgO.mjs';
|
|
import { t as toJalali } from './useDateTime-D8RCoGwW.mjs';
|
|
import { ContentLoader } from 'vue-content-loader';
|
|
import '../nitro/nitro.mjs';
|
|
import 'node:http';
|
|
import 'node:https';
|
|
import 'node:events';
|
|
import 'node:buffer';
|
|
import 'node:fs';
|
|
import 'node:path';
|
|
import 'node:crypto';
|
|
import 'node:url';
|
|
import 'consola';
|
|
import 'fast-xml-parser';
|
|
import 'ipx';
|
|
import 'pinia';
|
|
import '@supabase/supabase-js';
|
|
import 'axios';
|
|
import 'lodash-es';
|
|
import '@ant-design/colors';
|
|
import '@ctrl/tinycolor';
|
|
import 'stylis';
|
|
import 'vue-types';
|
|
import '@ant-design/icons-vue';
|
|
import 'unhead/utils';
|
|
import './index--iRd5AYr.mjs';
|
|
import 'throttle-debounce';
|
|
import './index-Bpb_QU26.mjs';
|
|
import 'dom-align';
|
|
import './index-CGkJdmtz.mjs';
|
|
import './shallowequal-B7epstpr.mjs';
|
|
import 'lodash-es/uniq.js';
|
|
import './index-xCOPbDMH.mjs';
|
|
import './FormItemContext-p68sljID.mjs';
|
|
import './index-DgsBGZQx.mjs';
|
|
import 'lodash-es/isPlainObject.js';
|
|
import 'resize-observer-polyfill';
|
|
import './useRefs-BHKrVg4I.mjs';
|
|
import 'lodash-es/pick.js';
|
|
import './useMergedState-BZEfJ8Fl.mjs';
|
|
import './media-_NDkNIvH.mjs';
|
|
import 'swiper/vue';
|
|
import './empty_user-DSxcM_ac.mjs';
|
|
import './BasicInput-CldcPa4f.mjs';
|
|
import './like-BhIOg3YL.mjs';
|
|
import 'swiper/modules';
|
|
import 'perfect-debounce';
|
|
import './save-6qQTYFWc.mjs';
|
|
import 'moment';
|
|
import 'moment-timezone';
|
|
import 'moment-jalaali';
|
|
import 'date-fns';
|
|
import 'date-fns/locale';
|
|
|
|
const props = () => ({
|
|
prefixCls: String,
|
|
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
style: {
|
|
type: Object,
|
|
default: void 0
|
|
},
|
|
class: String,
|
|
rootClassName: String,
|
|
rootStyle: objectType(),
|
|
placement: {
|
|
type: String
|
|
},
|
|
wrapperClassName: String,
|
|
level: {
|
|
type: [String, Array]
|
|
},
|
|
levelMove: {
|
|
type: [Number, Function, Array]
|
|
},
|
|
duration: String,
|
|
ease: String,
|
|
showMask: {
|
|
type: Boolean,
|
|
default: void 0
|
|
},
|
|
maskClosable: {
|
|
type: Boolean,
|
|
default: void 0
|
|
},
|
|
maskStyle: {
|
|
type: Object,
|
|
default: void 0
|
|
},
|
|
afterVisibleChange: Function,
|
|
keyboard: {
|
|
type: Boolean,
|
|
default: void 0
|
|
},
|
|
contentWrapperStyle: arrayType(),
|
|
autofocus: {
|
|
type: Boolean,
|
|
default: void 0
|
|
},
|
|
open: {
|
|
type: Boolean,
|
|
default: void 0
|
|
},
|
|
// Motion
|
|
motion: functionType(),
|
|
maskMotion: objectType()
|
|
});
|
|
const drawerProps$1 = () => _extends(_extends({}, props()), {
|
|
forceRender: {
|
|
type: Boolean,
|
|
default: void 0
|
|
},
|
|
getContainer: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.object, PropTypes.looseBool])
|
|
});
|
|
const drawerChildProps = () => _extends(_extends({}, props()), {
|
|
getContainer: Function,
|
|
getOpenCount: Function,
|
|
scrollLocker: PropTypes.any,
|
|
inline: Boolean
|
|
});
|
|
var __rest$2 = function(s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
const DrawerChild = defineComponent({
|
|
compatConfig: {
|
|
MODE: 3
|
|
},
|
|
inheritAttrs: false,
|
|
props: drawerChildProps(),
|
|
emits: ["close", "handleClick", "change"],
|
|
setup(props2, _ref) {
|
|
let {
|
|
emit,
|
|
slots
|
|
} = _ref;
|
|
const contentWrapper = shallowRef();
|
|
const dom = shallowRef();
|
|
const maskDom = shallowRef();
|
|
const handlerDom = shallowRef();
|
|
const contentDom = shallowRef();
|
|
`drawer_id_${Number((Date.now() + Math.random()).toString().replace(".", Math.round(Math.random() * 9).toString())).toString(16)}`;
|
|
watch(() => props2.level, () => {
|
|
getLevelDom(props2);
|
|
}, {
|
|
flush: "post"
|
|
});
|
|
watch(() => props2.open, () => {
|
|
const {
|
|
open,
|
|
getContainer,
|
|
scrollLocker,
|
|
showMask,
|
|
autofocus
|
|
} = props2;
|
|
const container = getContainer === null || getContainer === void 0 ? void 0 : getContainer();
|
|
if (container && container.parentNode === (void 0).body) ;
|
|
if (open) {
|
|
if (autofocus) {
|
|
domFocus();
|
|
}
|
|
if (showMask) {
|
|
scrollLocker === null || scrollLocker === void 0 ? void 0 : scrollLocker.lock();
|
|
}
|
|
} else {
|
|
scrollLocker === null || scrollLocker === void 0 ? void 0 : scrollLocker.unLock();
|
|
}
|
|
}, {
|
|
flush: "post"
|
|
});
|
|
watch(() => props2.placement, (val) => {
|
|
if (val) {
|
|
contentDom.value = null;
|
|
}
|
|
});
|
|
const domFocus = () => {
|
|
var _a, _b;
|
|
(_b = (_a = dom.value) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
};
|
|
const onClose = (e) => {
|
|
emit("close", e);
|
|
};
|
|
const onKeyDown = (e) => {
|
|
if (e.keyCode === KeyCode.ESC) {
|
|
e.stopPropagation();
|
|
onClose(e);
|
|
}
|
|
};
|
|
const onAfterVisibleChange = () => {
|
|
const {
|
|
open,
|
|
afterVisibleChange
|
|
} = props2;
|
|
if (afterVisibleChange) {
|
|
afterVisibleChange(!!open);
|
|
}
|
|
};
|
|
const getLevelDom = (_ref2) => {
|
|
let {
|
|
level,
|
|
getContainer
|
|
} = _ref2;
|
|
{
|
|
return;
|
|
}
|
|
};
|
|
const onHandleClick = (e) => {
|
|
emit("handleClick", e);
|
|
};
|
|
const canOpen = shallowRef(false);
|
|
watch(dom, () => {
|
|
nextTick(() => {
|
|
canOpen.value = true;
|
|
});
|
|
});
|
|
return () => {
|
|
var _a, _b;
|
|
const {
|
|
width,
|
|
height,
|
|
open: $open,
|
|
prefixCls,
|
|
placement,
|
|
level,
|
|
levelMove,
|
|
ease,
|
|
duration,
|
|
getContainer,
|
|
onChange,
|
|
afterVisibleChange,
|
|
showMask,
|
|
maskClosable,
|
|
maskStyle,
|
|
keyboard,
|
|
getOpenCount,
|
|
scrollLocker,
|
|
contentWrapperStyle,
|
|
style,
|
|
class: className,
|
|
rootClassName,
|
|
rootStyle,
|
|
maskMotion,
|
|
motion,
|
|
inline
|
|
} = props2, otherProps = __rest$2(props2, ["width", "height", "open", "prefixCls", "placement", "level", "levelMove", "ease", "duration", "getContainer", "onChange", "afterVisibleChange", "showMask", "maskClosable", "maskStyle", "keyboard", "getOpenCount", "scrollLocker", "contentWrapperStyle", "style", "class", "rootClassName", "rootStyle", "maskMotion", "motion", "inline"]);
|
|
const open = $open && canOpen.value;
|
|
const wrapperClassName = classNames(prefixCls, {
|
|
[`${prefixCls}-${placement}`]: true,
|
|
[`${prefixCls}-open`]: open,
|
|
[`${prefixCls}-inline`]: inline,
|
|
"no-mask": !showMask,
|
|
[rootClassName]: true
|
|
});
|
|
const motionProps = typeof motion === "function" ? motion(placement) : motion;
|
|
return createVNode("div", _objectSpread(_objectSpread({}, omit(otherProps, ["autofocus"])), {}, {
|
|
"tabindex": -1,
|
|
"class": wrapperClassName,
|
|
"style": rootStyle,
|
|
"ref": dom,
|
|
"onKeydown": open && keyboard ? onKeyDown : void 0
|
|
}), [createVNode(Transition, maskMotion, {
|
|
default: () => [showMask && withDirectives(createVNode("div", {
|
|
"class": `${prefixCls}-mask`,
|
|
"onClick": maskClosable ? onClose : void 0,
|
|
"style": maskStyle,
|
|
"ref": maskDom
|
|
}, null), [[vShow, open]])]
|
|
}), createVNode(Transition, _objectSpread(_objectSpread({}, motionProps), {}, {
|
|
"onAfterEnter": onAfterVisibleChange,
|
|
"onAfterLeave": onAfterVisibleChange
|
|
}), {
|
|
default: () => [withDirectives(createVNode("div", {
|
|
"class": `${prefixCls}-content-wrapper`,
|
|
"style": [contentWrapperStyle],
|
|
"ref": contentWrapper
|
|
}, [createVNode("div", {
|
|
"class": [`${prefixCls}-content`, className],
|
|
"style": style,
|
|
"ref": contentDom
|
|
}, [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)]), slots.handler ? createVNode("div", {
|
|
"onClick": onHandleClick,
|
|
"ref": handlerDom
|
|
}, [(_b = slots.handler) === null || _b === void 0 ? void 0 : _b.call(slots)]) : null]), [[vShow, open]])]
|
|
})]);
|
|
};
|
|
}
|
|
});
|
|
var __rest$1 = function(s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
const DrawerWrapper = defineComponent({
|
|
compatConfig: {
|
|
MODE: 3
|
|
},
|
|
inheritAttrs: false,
|
|
props: initDefaultProps(drawerProps$1(), {
|
|
prefixCls: "drawer",
|
|
placement: "left",
|
|
getContainer: "body",
|
|
level: "all",
|
|
duration: ".3s",
|
|
ease: "cubic-bezier(0.78, 0.14, 0.15, 0.86)",
|
|
afterVisibleChange: () => {
|
|
},
|
|
showMask: true,
|
|
maskClosable: true,
|
|
maskStyle: {},
|
|
wrapperClassName: "",
|
|
keyboard: true,
|
|
forceRender: false,
|
|
autofocus: true
|
|
}),
|
|
emits: ["handleClick", "close"],
|
|
setup(props2, _ref) {
|
|
let {
|
|
emit,
|
|
slots
|
|
} = _ref;
|
|
const dom = ref(null);
|
|
const onHandleClick = (e) => {
|
|
emit("handleClick", e);
|
|
};
|
|
const onClose = (e) => {
|
|
emit("close", e);
|
|
};
|
|
return () => {
|
|
const {
|
|
getContainer,
|
|
wrapperClassName,
|
|
rootClassName,
|
|
rootStyle,
|
|
forceRender
|
|
} = props2, otherProps = __rest$1(props2, ["getContainer", "wrapperClassName", "rootClassName", "rootStyle", "forceRender"]);
|
|
let portal = null;
|
|
if (!getContainer) {
|
|
return createVNode(DrawerChild, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
"rootClassName": rootClassName,
|
|
"rootStyle": rootStyle,
|
|
"open": props2.open,
|
|
"onClose": onClose,
|
|
"onHandleClick": onHandleClick,
|
|
"inline": true
|
|
}), slots);
|
|
}
|
|
const $forceRender = !!slots.handler || forceRender;
|
|
if ($forceRender || props2.open || dom.value) {
|
|
portal = createVNode(Portal, {
|
|
"autoLock": true,
|
|
"visible": props2.open,
|
|
"forceRender": $forceRender,
|
|
"getContainer": getContainer,
|
|
"wrapperClassName": wrapperClassName
|
|
}, {
|
|
default: (_a) => {
|
|
var {
|
|
visible,
|
|
afterClose
|
|
} = _a, rest = __rest$1(_a, ["visible", "afterClose"]);
|
|
return createVNode(DrawerChild, _objectSpread(_objectSpread(_objectSpread({
|
|
"ref": dom
|
|
}, otherProps), rest), {}, {
|
|
"rootClassName": rootClassName,
|
|
"rootStyle": rootStyle,
|
|
"open": visible !== void 0 ? visible : props2.open,
|
|
"afterVisibleChange": afterClose !== void 0 ? afterClose : props2.afterVisibleChange,
|
|
"onClose": onClose,
|
|
"onHandleClick": onHandleClick
|
|
}), slots);
|
|
}
|
|
});
|
|
}
|
|
return portal;
|
|
};
|
|
}
|
|
});
|
|
const genMotionStyle = (token) => {
|
|
const {
|
|
componentCls,
|
|
motionDurationSlow
|
|
} = token;
|
|
const sharedPanelMotion = {
|
|
"&-enter, &-appear, &-leave": {
|
|
"&-start": {
|
|
transition: "none"
|
|
},
|
|
"&-active": {
|
|
transition: `all ${motionDurationSlow}`
|
|
}
|
|
}
|
|
};
|
|
return {
|
|
[componentCls]: {
|
|
// ======================== Mask ========================
|
|
[`${componentCls}-mask-motion`]: {
|
|
"&-enter, &-appear, &-leave": {
|
|
"&-active": {
|
|
transition: `all ${motionDurationSlow}`
|
|
}
|
|
},
|
|
"&-enter, &-appear": {
|
|
opacity: 0,
|
|
"&-active": {
|
|
opacity: 1
|
|
}
|
|
},
|
|
"&-leave": {
|
|
opacity: 1,
|
|
"&-active": {
|
|
opacity: 0
|
|
}
|
|
}
|
|
},
|
|
// ======================= Panel ========================
|
|
[`${componentCls}-panel-motion`]: {
|
|
// Left
|
|
"&-left": [sharedPanelMotion, {
|
|
"&-enter, &-appear": {
|
|
"&-start": {
|
|
transform: "translateX(-100%) !important"
|
|
},
|
|
"&-active": {
|
|
transform: "translateX(0)"
|
|
}
|
|
},
|
|
"&-leave": {
|
|
transform: "translateX(0)",
|
|
"&-active": {
|
|
transform: "translateX(-100%)"
|
|
}
|
|
}
|
|
}],
|
|
// Right
|
|
"&-right": [sharedPanelMotion, {
|
|
"&-enter, &-appear": {
|
|
"&-start": {
|
|
transform: "translateX(100%) !important"
|
|
},
|
|
"&-active": {
|
|
transform: "translateX(0)"
|
|
}
|
|
},
|
|
"&-leave": {
|
|
transform: "translateX(0)",
|
|
"&-active": {
|
|
transform: "translateX(100%)"
|
|
}
|
|
}
|
|
}],
|
|
// Top
|
|
"&-top": [sharedPanelMotion, {
|
|
"&-enter, &-appear": {
|
|
"&-start": {
|
|
transform: "translateY(-100%) !important"
|
|
},
|
|
"&-active": {
|
|
transform: "translateY(0)"
|
|
}
|
|
},
|
|
"&-leave": {
|
|
transform: "translateY(0)",
|
|
"&-active": {
|
|
transform: "translateY(-100%)"
|
|
}
|
|
}
|
|
}],
|
|
// Bottom
|
|
"&-bottom": [sharedPanelMotion, {
|
|
"&-enter, &-appear": {
|
|
"&-start": {
|
|
transform: "translateY(100%) !important"
|
|
},
|
|
"&-active": {
|
|
transform: "translateY(0)"
|
|
}
|
|
},
|
|
"&-leave": {
|
|
transform: "translateY(0)",
|
|
"&-active": {
|
|
transform: "translateY(100%)"
|
|
}
|
|
}
|
|
}]
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const genDrawerStyle = (token) => {
|
|
const {
|
|
componentCls,
|
|
zIndexPopup,
|
|
colorBgMask,
|
|
colorBgElevated,
|
|
motionDurationSlow,
|
|
motionDurationMid,
|
|
padding,
|
|
paddingLG,
|
|
fontSizeLG,
|
|
lineHeightLG,
|
|
lineWidth,
|
|
lineType,
|
|
colorSplit,
|
|
marginSM,
|
|
colorIcon,
|
|
colorIconHover,
|
|
colorText,
|
|
fontWeightStrong,
|
|
drawerFooterPaddingVertical,
|
|
drawerFooterPaddingHorizontal
|
|
} = token;
|
|
const wrapperCls = `${componentCls}-content-wrapper`;
|
|
return {
|
|
[componentCls]: {
|
|
position: "fixed",
|
|
inset: 0,
|
|
zIndex: zIndexPopup,
|
|
pointerEvents: "none",
|
|
"&-pure": {
|
|
position: "relative",
|
|
background: colorBgElevated,
|
|
[`&${componentCls}-left`]: {
|
|
boxShadow: token.boxShadowDrawerLeft
|
|
},
|
|
[`&${componentCls}-right`]: {
|
|
boxShadow: token.boxShadowDrawerRight
|
|
},
|
|
[`&${componentCls}-top`]: {
|
|
boxShadow: token.boxShadowDrawerUp
|
|
},
|
|
[`&${componentCls}-bottom`]: {
|
|
boxShadow: token.boxShadowDrawerDown
|
|
}
|
|
},
|
|
"&-inline": {
|
|
position: "absolute"
|
|
},
|
|
// ====================== Mask ======================
|
|
[`${componentCls}-mask`]: {
|
|
position: "absolute",
|
|
inset: 0,
|
|
zIndex: zIndexPopup,
|
|
background: colorBgMask,
|
|
pointerEvents: "auto"
|
|
},
|
|
// ==================== Content =====================
|
|
[wrapperCls]: {
|
|
position: "absolute",
|
|
zIndex: zIndexPopup,
|
|
transition: `all ${motionDurationSlow}`,
|
|
"&-hidden": {
|
|
display: "none"
|
|
}
|
|
},
|
|
// Placement
|
|
[`&-left > ${wrapperCls}`]: {
|
|
top: 0,
|
|
bottom: 0,
|
|
left: {
|
|
_skip_check_: true,
|
|
value: 0
|
|
},
|
|
boxShadow: token.boxShadowDrawerLeft
|
|
},
|
|
[`&-right > ${wrapperCls}`]: {
|
|
top: 0,
|
|
right: {
|
|
_skip_check_: true,
|
|
value: 0
|
|
},
|
|
bottom: 0,
|
|
boxShadow: token.boxShadowDrawerRight
|
|
},
|
|
[`&-top > ${wrapperCls}`]: {
|
|
top: 0,
|
|
insetInline: 0,
|
|
boxShadow: token.boxShadowDrawerUp
|
|
},
|
|
[`&-bottom > ${wrapperCls}`]: {
|
|
bottom: 0,
|
|
insetInline: 0,
|
|
boxShadow: token.boxShadowDrawerDown
|
|
},
|
|
[`${componentCls}-content`]: {
|
|
width: "100%",
|
|
height: "100%",
|
|
overflow: "auto",
|
|
background: colorBgElevated,
|
|
pointerEvents: "auto"
|
|
},
|
|
// ===================== Panel ======================
|
|
[`${componentCls}-wrapper-body`]: {
|
|
display: "flex",
|
|
flexDirection: "column",
|
|
width: "100%",
|
|
height: "100%"
|
|
},
|
|
// Header
|
|
[`${componentCls}-header`]: {
|
|
display: "flex",
|
|
flex: 0,
|
|
alignItems: "center",
|
|
padding: `${padding}px ${paddingLG}px`,
|
|
fontSize: fontSizeLG,
|
|
lineHeight: lineHeightLG,
|
|
borderBottom: `${lineWidth}px ${lineType} ${colorSplit}`,
|
|
"&-title": {
|
|
display: "flex",
|
|
flex: 1,
|
|
alignItems: "center",
|
|
minWidth: 0,
|
|
minHeight: 0
|
|
}
|
|
},
|
|
[`${componentCls}-extra`]: {
|
|
flex: "none"
|
|
},
|
|
[`${componentCls}-close`]: {
|
|
display: "inline-block",
|
|
marginInlineEnd: marginSM,
|
|
color: colorIcon,
|
|
fontWeight: fontWeightStrong,
|
|
fontSize: fontSizeLG,
|
|
fontStyle: "normal",
|
|
lineHeight: 1,
|
|
textAlign: "center",
|
|
textTransform: "none",
|
|
textDecoration: "none",
|
|
background: "transparent",
|
|
border: 0,
|
|
outline: 0,
|
|
cursor: "pointer",
|
|
transition: `color ${motionDurationMid}`,
|
|
textRendering: "auto",
|
|
"&:focus, &:hover": {
|
|
color: colorIconHover,
|
|
textDecoration: "none"
|
|
}
|
|
},
|
|
[`${componentCls}-title`]: {
|
|
flex: 1,
|
|
margin: 0,
|
|
color: colorText,
|
|
fontWeight: token.fontWeightStrong,
|
|
fontSize: fontSizeLG,
|
|
lineHeight: lineHeightLG
|
|
},
|
|
// Body
|
|
[`${componentCls}-body`]: {
|
|
flex: 1,
|
|
minWidth: 0,
|
|
minHeight: 0,
|
|
padding: paddingLG,
|
|
overflow: "auto"
|
|
},
|
|
// Footer
|
|
[`${componentCls}-footer`]: {
|
|
flexShrink: 0,
|
|
padding: `${drawerFooterPaddingVertical}px ${drawerFooterPaddingHorizontal}px`,
|
|
borderTop: `${lineWidth}px ${lineType} ${colorSplit}`
|
|
},
|
|
// ====================== RTL =======================
|
|
"&-rtl": {
|
|
direction: "rtl"
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const useStyle = genComponentStyleHook("Drawer", (token) => {
|
|
const drawerToken = merge(token, {
|
|
drawerFooterPaddingVertical: token.paddingXS,
|
|
drawerFooterPaddingHorizontal: token.padding
|
|
});
|
|
return [genDrawerStyle(drawerToken), genMotionStyle(drawerToken)];
|
|
}, (token) => ({
|
|
zIndexPopup: token.zIndexPopupBase
|
|
}));
|
|
var __rest = function(s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
const PlacementTypes = ["top", "right", "bottom", "left"];
|
|
const defaultPushState = {
|
|
distance: 180
|
|
};
|
|
const drawerProps = () => ({
|
|
autofocus: {
|
|
type: Boolean,
|
|
default: void 0
|
|
},
|
|
closable: {
|
|
type: Boolean,
|
|
default: void 0
|
|
},
|
|
closeIcon: PropTypes.any,
|
|
destroyOnClose: {
|
|
type: Boolean,
|
|
default: void 0
|
|
},
|
|
forceRender: {
|
|
type: Boolean,
|
|
default: void 0
|
|
},
|
|
getContainer: {
|
|
type: [String, Function, Boolean, Object],
|
|
default: void 0
|
|
},
|
|
maskClosable: {
|
|
type: Boolean,
|
|
default: void 0
|
|
},
|
|
mask: {
|
|
type: Boolean,
|
|
default: void 0
|
|
},
|
|
maskStyle: objectType(),
|
|
rootClassName: String,
|
|
rootStyle: objectType(),
|
|
size: {
|
|
type: String
|
|
},
|
|
drawerStyle: objectType(),
|
|
headerStyle: objectType(),
|
|
bodyStyle: objectType(),
|
|
contentWrapperStyle: {
|
|
type: Object,
|
|
default: void 0
|
|
},
|
|
title: PropTypes.any,
|
|
/** @deprecated Please use `open` instead */
|
|
visible: {
|
|
type: Boolean,
|
|
default: void 0
|
|
},
|
|
open: {
|
|
type: Boolean,
|
|
default: void 0
|
|
},
|
|
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
zIndex: Number,
|
|
prefixCls: String,
|
|
push: PropTypes.oneOfType([PropTypes.looseBool, {
|
|
type: Object
|
|
}]),
|
|
placement: PropTypes.oneOf(PlacementTypes),
|
|
keyboard: {
|
|
type: Boolean,
|
|
default: void 0
|
|
},
|
|
extra: PropTypes.any,
|
|
footer: PropTypes.any,
|
|
footerStyle: objectType(),
|
|
level: PropTypes.any,
|
|
levelMove: {
|
|
type: [Number, Array, Function]
|
|
},
|
|
handle: PropTypes.any,
|
|
/** @deprecated Use `@afterVisibleChange` instead */
|
|
afterVisibleChange: Function,
|
|
/** @deprecated Please use `@afterOpenChange` instead */
|
|
onAfterVisibleChange: Function,
|
|
onAfterOpenChange: Function,
|
|
/** @deprecated Please use `onUpdate:open` instead */
|
|
"onUpdate:visible": Function,
|
|
"onUpdate:open": Function,
|
|
onClose: Function
|
|
});
|
|
const Drawer = defineComponent({
|
|
compatConfig: {
|
|
MODE: 3
|
|
},
|
|
name: "ADrawer",
|
|
inheritAttrs: false,
|
|
props: initDefaultProps(drawerProps(), {
|
|
closable: true,
|
|
placement: "right",
|
|
maskClosable: true,
|
|
mask: true,
|
|
level: null,
|
|
keyboard: true,
|
|
push: defaultPushState
|
|
}),
|
|
slots: Object,
|
|
// emits: ['update:visible', 'close', 'afterVisibleChange'],
|
|
setup(props2, _ref) {
|
|
let {
|
|
emit,
|
|
slots,
|
|
attrs
|
|
} = _ref;
|
|
const sPush = shallowRef(false);
|
|
const destroyClose = shallowRef(false);
|
|
const vcDrawer = shallowRef(null);
|
|
const load = shallowRef(false);
|
|
const visible = shallowRef(false);
|
|
const mergedOpen = computed(() => {
|
|
var _a;
|
|
return (_a = props2.open) !== null && _a !== void 0 ? _a : props2.visible;
|
|
});
|
|
watch(mergedOpen, () => {
|
|
if (mergedOpen.value) {
|
|
load.value = true;
|
|
} else {
|
|
visible.value = false;
|
|
}
|
|
}, {
|
|
immediate: true
|
|
});
|
|
watch([mergedOpen, load], () => {
|
|
if (mergedOpen.value && load.value) {
|
|
visible.value = true;
|
|
}
|
|
}, {
|
|
immediate: true
|
|
});
|
|
const parentDrawerOpts = inject("parentDrawerOpts", null);
|
|
const {
|
|
prefixCls,
|
|
getPopupContainer,
|
|
direction
|
|
} = useConfigInject("drawer", props2);
|
|
const [wrapSSR, hashId] = useStyle(prefixCls);
|
|
const getContainer = computed(() => (
|
|
// 有可能为 false,所以不能直接判断
|
|
props2.getContainer === void 0 && (getPopupContainer === null || getPopupContainer === void 0 ? void 0 : getPopupContainer.value) ? () => getPopupContainer.value((void 0).body) : props2.getContainer
|
|
));
|
|
devWarning(!props2.afterVisibleChange, "Drawer", "`afterVisibleChange` prop is deprecated, please use `@afterVisibleChange` event instead");
|
|
const setPush = () => {
|
|
sPush.value = true;
|
|
};
|
|
const setPull = () => {
|
|
sPush.value = false;
|
|
nextTick(() => {
|
|
domFocus();
|
|
});
|
|
};
|
|
provide("parentDrawerOpts", {
|
|
setPush,
|
|
setPull
|
|
});
|
|
watch(visible, () => {
|
|
if (parentDrawerOpts) {
|
|
if (visible.value) {
|
|
parentDrawerOpts.setPush();
|
|
} else {
|
|
parentDrawerOpts.setPull();
|
|
}
|
|
}
|
|
}, {
|
|
flush: "post"
|
|
});
|
|
const domFocus = () => {
|
|
var _a, _b;
|
|
(_b = (_a = vcDrawer.value) === null || _a === void 0 ? void 0 : _a.domFocus) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
};
|
|
const close = (e) => {
|
|
emit("update:visible", false);
|
|
emit("update:open", false);
|
|
emit("close", e);
|
|
};
|
|
const afterVisibleChange = (open) => {
|
|
var _a;
|
|
if (!open) {
|
|
if (destroyClose.value === false) {
|
|
destroyClose.value = true;
|
|
}
|
|
if (props2.destroyOnClose) {
|
|
load.value = false;
|
|
}
|
|
}
|
|
(_a = props2.afterVisibleChange) === null || _a === void 0 ? void 0 : _a.call(props2, open);
|
|
emit("afterVisibleChange", open);
|
|
emit("afterOpenChange", open);
|
|
};
|
|
const pushTransform = computed(() => {
|
|
const {
|
|
push,
|
|
placement
|
|
} = props2;
|
|
let distance;
|
|
if (typeof push === "boolean") {
|
|
distance = push ? defaultPushState.distance : 0;
|
|
} else {
|
|
distance = push.distance;
|
|
}
|
|
distance = parseFloat(String(distance || 0));
|
|
if (placement === "left" || placement === "right") {
|
|
return `translateX(${placement === "left" ? distance : -distance}px)`;
|
|
}
|
|
if (placement === "top" || placement === "bottom") {
|
|
return `translateY(${placement === "top" ? distance : -distance}px)`;
|
|
}
|
|
return null;
|
|
});
|
|
const mergedWidth = computed(() => {
|
|
var _a;
|
|
return (_a = props2.width) !== null && _a !== void 0 ? _a : props2.size === "large" ? 736 : 378;
|
|
});
|
|
const mergedHeight = computed(() => {
|
|
var _a;
|
|
return (_a = props2.height) !== null && _a !== void 0 ? _a : props2.size === "large" ? 736 : 378;
|
|
});
|
|
const offsetStyle = computed(() => {
|
|
const {
|
|
mask,
|
|
placement
|
|
} = props2;
|
|
if (!visible.value && !mask) {
|
|
return {};
|
|
}
|
|
const val = {};
|
|
if (placement === "left" || placement === "right") {
|
|
val.width = isNumeric(mergedWidth.value) ? `${mergedWidth.value}px` : mergedWidth.value;
|
|
} else {
|
|
val.height = isNumeric(mergedHeight.value) ? `${mergedHeight.value}px` : mergedHeight.value;
|
|
}
|
|
return val;
|
|
});
|
|
const wrapperStyle = computed(() => {
|
|
const {
|
|
zIndex,
|
|
contentWrapperStyle
|
|
} = props2;
|
|
const val = offsetStyle.value;
|
|
return [{
|
|
zIndex,
|
|
transform: sPush.value ? pushTransform.value : void 0
|
|
}, _extends({}, contentWrapperStyle), val];
|
|
});
|
|
const renderHeader = (prefixCls2) => {
|
|
const {
|
|
closable,
|
|
headerStyle
|
|
} = props2;
|
|
const extra = getPropsSlot(slots, props2, "extra");
|
|
const title = getPropsSlot(slots, props2, "title");
|
|
if (!title && !closable) {
|
|
return null;
|
|
}
|
|
return createVNode("div", {
|
|
"class": classNames(`${prefixCls2}-header`, {
|
|
[`${prefixCls2}-header-close-only`]: closable && !title && !extra
|
|
}),
|
|
"style": headerStyle
|
|
}, [createVNode("div", {
|
|
"class": `${prefixCls2}-header-title`
|
|
}, [renderCloseIcon(prefixCls2), title && createVNode("div", {
|
|
"class": `${prefixCls2}-title`
|
|
}, [title])]), extra && createVNode("div", {
|
|
"class": `${prefixCls2}-extra`
|
|
}, [extra])]);
|
|
};
|
|
const renderCloseIcon = (prefixCls2) => {
|
|
var _a;
|
|
const {
|
|
closable
|
|
} = props2;
|
|
const $closeIcon = slots.closeIcon ? (_a = slots.closeIcon) === null || _a === void 0 ? void 0 : _a.call(slots) : props2.closeIcon;
|
|
return closable && createVNode("button", {
|
|
"key": "closer",
|
|
"onClick": close,
|
|
"aria-label": "Close",
|
|
"class": `${prefixCls2}-close`
|
|
}, [$closeIcon === void 0 ? createVNode(CloseOutlined, null, null) : $closeIcon]);
|
|
};
|
|
const renderBody = (prefixCls2) => {
|
|
var _a;
|
|
if (destroyClose.value && !props2.forceRender && !load.value) {
|
|
return null;
|
|
}
|
|
const {
|
|
bodyStyle,
|
|
drawerStyle
|
|
} = props2;
|
|
return createVNode("div", {
|
|
"class": `${prefixCls2}-wrapper-body`,
|
|
"style": drawerStyle
|
|
}, [renderHeader(prefixCls2), createVNode("div", {
|
|
"key": "body",
|
|
"class": `${prefixCls2}-body`,
|
|
"style": bodyStyle
|
|
}, [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)]), renderFooter(prefixCls2)]);
|
|
};
|
|
const renderFooter = (prefixCls2) => {
|
|
const footer = getPropsSlot(slots, props2, "footer");
|
|
if (!footer) {
|
|
return null;
|
|
}
|
|
const footerClassName = `${prefixCls2}-footer`;
|
|
return createVNode("div", {
|
|
"class": footerClassName,
|
|
"style": props2.footerStyle
|
|
}, [footer]);
|
|
};
|
|
const drawerClassName = computed(() => classNames({
|
|
"no-mask": !props2.mask,
|
|
[`${prefixCls.value}-rtl`]: direction.value === "rtl"
|
|
}, props2.rootClassName, hashId.value));
|
|
const maskMotion = computed(() => {
|
|
return getTransitionProps(getTransitionName(prefixCls.value, "mask-motion"));
|
|
});
|
|
const panelMotion = (motionPlacement) => {
|
|
return getTransitionProps(getTransitionName(prefixCls.value, `panel-motion-${motionPlacement}`));
|
|
};
|
|
return () => {
|
|
const {
|
|
width,
|
|
height,
|
|
placement,
|
|
mask,
|
|
forceRender
|
|
} = props2, rest = __rest(props2, ["width", "height", "placement", "mask", "forceRender"]);
|
|
const vcDrawerProps = _extends(_extends(_extends({}, attrs), omit(rest, ["size", "closeIcon", "closable", "destroyOnClose", "drawerStyle", "headerStyle", "bodyStyle", "title", "push", "onAfterVisibleChange", "onClose", "onUpdate:visible", "onUpdate:open", "visible"])), {
|
|
forceRender,
|
|
onClose: close,
|
|
afterVisibleChange,
|
|
handler: false,
|
|
prefixCls: prefixCls.value,
|
|
open: visible.value,
|
|
showMask: mask,
|
|
placement,
|
|
ref: vcDrawer
|
|
});
|
|
return wrapSSR(createVNode(NoCompactStyle, null, {
|
|
default: () => [createVNode(DrawerWrapper, _objectSpread(_objectSpread({}, vcDrawerProps), {}, {
|
|
"maskMotion": maskMotion.value,
|
|
"motion": panelMotion,
|
|
"width": mergedWidth.value,
|
|
"height": mergedHeight.value,
|
|
"getContainer": getContainer.value,
|
|
"rootClassName": drawerClassName.value,
|
|
"rootStyle": props2.rootStyle,
|
|
"contentWrapperStyle": wrapperStyle.value
|
|
}), {
|
|
handler: props2.handle ? () => props2.handle : slots.handle,
|
|
default: () => renderBody(prefixCls.value)
|
|
})]
|
|
}));
|
|
};
|
|
}
|
|
});
|
|
const __nuxt_component_2 = withInstall(Drawer);
|
|
const _imports_2 = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20viewBox='0%200%2050%2050'%20id='grid'%3e%3cpath%20d='M48%202H2v46h46V2zm-2%2011h-9V4h9v9zm-20%200V4h9v9h-9zm9%202v9h-9v-9h9zm-11-2h-9V4h9v9zm0%202v9h-9v-9h9zm-11%209H4v-9h9v9zm0%202v9H4v-9h9zm2%200h9v9h-9v-9zm9%2011v9h-9v-9h9zm2%200h9v9h-9v-9zm0-2v-9h9v9h-9zm11-9h9v9h-9v-9zm0-2v-9h9v9h-9zM13%204v9H4V4h9zM4%2037h9v9H4v-9zm33%209v-9h9v9h-9z'/%3e%3c/svg%3e";
|
|
const _imports_3 = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20id='Layer_1'%20data-name='Layer%201'%20viewBox='0%200%20122.64%20122.88'%3e%3ctitle%3estories%3c/title%3e%3cpath%20d='M104,31.15c2.31,5.65,5.11,11.94,6.52,17.55a51.83,51.83,0,0,1,1.54,15.24,50.9,50.9,0,0,1-3,15,49.87,49.87,0,0,1-7.24,13.23A49.12,49.12,0,0,1,91,102.49h0a54.85,54.85,0,0,1-4.74,3q-2.44,1.38-5,2.49a52,52,0,0,1-11.38,3.56,49.5,49.5,0,0,1-11.67.82L57,112.28l-2.76,10.28,1.89.15A60.44,60.44,0,0,0,71.05,122a63,63,0,0,0,14.51-4.42q2.94-1.3,5.83-2.93c1.87-1.06,3.75-2.25,5.62-3.55A59.59,59.59,0,0,0,119,82.48,61.68,61.68,0,0,0,120.7,46.1c-2-5.77-4.18-13.39-8.31-19.22-2.73-3.86-10.73-1.57-8.35,4.27ZM56,44.74a5.34,5.34,0,1,1,10.67,0V56.1H78a5.34,5.34,0,0,1,0,10.68H66.66V78.14a5.34,5.34,0,1,1-10.67,0V66.78H44.62a5.34,5.34,0,1,1,0-10.68H56V44.74ZM24.25,110.36a59.9,59.9,0,0,0,11.46,7l1.69.79,2.75-10.25L39,107.35a49.27,49.27,0,0,1-8.38-5.28,50.34,50.34,0,0,1-7.25-6.93l-.85-1-9.17,5.29,1.18,1.43a61.27,61.27,0,0,0,9.72,9.48ZM.57,69.53A59.49,59.49,0,0,0,4,82.67l.65,1.72,9.17-5.29-.44-1.24a49.32,49.32,0,0,1-2.4-9.72,48.75,48.75,0,0,1-.37-10l.07-1.29L.41,54.15.24,56A58.82,58.82,0,0,0,.57,69.53ZM8.38,31c-.92,1.55-1.75,3.11-2.51,4.7l-.81,1.7,10.25,2.75L15.89,39c.58-1.13,1.19-2.23,1.83-3.29s1.35-2.13,2.1-3.17a61.6,61.6,0,0,1,3.9-4.93A53.89,53.89,0,0,1,28,23.22l.93-.85-5.31-9.21-1.44,1.25a66.4,66.4,0,0,0-5.74,5.65,72.56,72.56,0,0,0-5.15,6.41c-1.05,1.48-2,3-2.92,4.5ZM50.44.78A54.27,54.27,0,0,0,40.27,3.52l-1.74.65,5.3,9.18,1.22-.43a44.39,44.39,0,0,1,15.71-2.43c1.21,0,2.48.11,3.79.26s2.51.33,3.74.58,2.55.56,3.8.93,2.5.8,3.79,1.3h0a5.24,5.24,0,1,0,3.79-9.77C78.15,3.2,76.59,2.67,75,2.2s-3.12-.84-4.65-1.15S67.28.5,65.76.33,62.63.05,61,0A55.87,55.87,0,0,0,50.44.78Z'/%3e%3c/svg%3e";
|
|
const _imports_0$1 = "data:image/svg+xml,%3csvg%20width='23'%20height='23'%20viewBox='0%200%2023%2023'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='1.04163'%20y='1.52081'%20width='20'%20height='20'%20rx='5'%20stroke='white'%20stroke-width='2'/%3e%3cpath%20d='M11.0416%206.02081L11.0416%2017.0208'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'/%3e%3cpath%20d='M16.5416%2011.5208L5.54163%2011.5208'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'/%3e%3c/svg%3e";
|
|
const _imports_1$1 = "data:image/svg+xml,%3csvg%20width='23'%20height='23'%20viewBox='0%200%2023%2023'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='1.04163'%20y='1.52081'%20width='20'%20height='20'%20rx='5'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M11.0416%206.02081L11.0416%2017.0208'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'/%3e%3cpath%20d='M16.5416%2011.5208L5.54163%2011.5208'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'/%3e%3c/svg%3e";
|
|
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
__name: "add",
|
|
__ssrInlineRender: true,
|
|
setup(__props) {
|
|
const config = useConfigStore();
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
if (unref(config).isNightStore) {
|
|
_push(`<img${ssrRenderAttrs(mergeProps({
|
|
src: _imports_0$1,
|
|
alt: "comment",
|
|
"cursor-pointer": ""
|
|
}, _attrs))}>`);
|
|
} else {
|
|
_push(`<img${ssrRenderAttrs(mergeProps({
|
|
src: _imports_1$1,
|
|
alt: "comment",
|
|
"cursor-pointer": ""
|
|
}, _attrs))}>`);
|
|
}
|
|
};
|
|
}
|
|
});
|
|
const _sfc_setup$7 = _sfc_main$7.setup;
|
|
_sfc_main$7.setup = (props2, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("assets/img/icons/add.vue");
|
|
return _sfc_setup$7 ? _sfc_setup$7(props2, ctx) : void 0;
|
|
};
|
|
const _imports_0 = "data:image/svg+xml,%3csvg%20width='21'%20height='18'%20viewBox='0%200%2021%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M20.25%200H1.25L1.14823%200.00684662C0.782154%200.056509%200.5%200.370304%200.5%200.75C0.5%201.16421%200.835786%201.5%201.25%201.5H20.25L20.3518%201.49315C20.7178%201.44349%2021%201.1297%2021%200.75C21%200.335786%2020.6642%200%2020.25%200ZM1.25%208H20.25C20.6642%208%2021%208.33579%2021%208.75C21%209.1297%2020.7178%209.44349%2020.3518%209.49315L20.25%209.5H1.25C0.835786%209.5%200.5%209.16421%200.5%208.75C0.5%208.3703%200.782154%208.05651%201.14823%208.00685L1.25%208ZM1.25%2016H20.25C20.6642%2016%2021%2016.3358%2021%2016.75C21%2017.1297%2020.7178%2017.4435%2020.3518%2017.4932L20.25%2017.5H1.25C0.835786%2017.5%200.5%2017.1642%200.5%2016.75C0.5%2016.3703%200.782154%2016.0565%201.14823%2016.0068L1.25%2016Z'%20fill='white'/%3e%3c/svg%3e";
|
|
const _imports_1 = "data:image/svg+xml,%3csvg%20width='21'%20height='18'%20viewBox='0%200%2021%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M20.25%200H1.25L1.14823%200.00684662C0.782154%200.056509%200.5%200.370304%200.5%200.75C0.5%201.16421%200.835786%201.5%201.25%201.5H20.25L20.3518%201.49315C20.7178%201.44349%2021%201.1297%2021%200.75C21%200.335786%2020.6642%200%2020.25%200ZM1.25%208H20.25C20.6642%208%2021%208.33579%2021%208.75C21%209.1297%2020.7178%209.44349%2020.3518%209.49315L20.25%209.5H1.25C0.835786%209.5%200.5%209.16421%200.5%208.75C0.5%208.3703%200.782154%208.05651%201.14823%208.00685L1.25%208ZM1.25%2016H20.25C20.6642%2016%2021%2016.3358%2021%2016.75C21%2017.1297%2020.7178%2017.4435%2020.3518%2017.4932L20.25%2017.5H1.25C0.835786%2017.5%200.5%2017.1642%200.5%2016.75C0.5%2016.3703%200.782154%2016.0565%201.14823%2016.0068L1.25%2016Z'%20fill='%23262626'/%3e%3c/svg%3e";
|
|
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
__name: "menu",
|
|
__ssrInlineRender: true,
|
|
setup(__props) {
|
|
const config = useConfigStore();
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
if (unref(config).isNightStore) {
|
|
_push(`<img${ssrRenderAttrs(mergeProps({
|
|
src: _imports_0,
|
|
alt: "comment",
|
|
"cursor-pointer": ""
|
|
}, _attrs))}>`);
|
|
} else {
|
|
_push(`<img${ssrRenderAttrs(mergeProps({
|
|
src: _imports_1,
|
|
alt: "comment",
|
|
"cursor-pointer": ""
|
|
}, _attrs))}>`);
|
|
}
|
|
};
|
|
}
|
|
});
|
|
const _sfc_setup$6 = _sfc_main$6.setup;
|
|
_sfc_main$6.setup = (props2, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("assets/img/icons/menu.vue");
|
|
return _sfc_setup$6 ? _sfc_setup$6(props2, ctx) : void 0;
|
|
};
|
|
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
__name: "MenuItem",
|
|
__ssrInlineRender: true,
|
|
props: {
|
|
title: {},
|
|
icon: {},
|
|
hasRightArrow: { type: Boolean }
|
|
},
|
|
setup(__props) {
|
|
const config = useConfigStore();
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
_push(`<div${ssrRenderAttrs(mergeProps({ class: "flex items-center justify-between" }, _attrs))}><div class="flex gap-2 items-center">`);
|
|
if (_ctx.icon) {
|
|
_push(ssrRenderComponent(BasicIconOld, { icon: _ctx.icon }, null, _parent));
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`<div class="text-sm">${ssrInterpolate(_ctx.title)}</div></div><div class="flex items-center">`);
|
|
ssrRenderSlot(_ctx.$slots, "extra", {}, null, _push, _parent);
|
|
if (_ctx.hasRightArrow) {
|
|
_push(ssrRenderComponent(BasicIconOld, {
|
|
key: unref(config).isRTL,
|
|
icon: unref(config).isRTL ? "vuesax-linear:arrow-left-1" : "vuesax-linear:arrow-right-1",
|
|
size: "20"
|
|
}, null, _parent));
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div></div>`);
|
|
};
|
|
}
|
|
});
|
|
const _sfc_setup$5 = _sfc_main$5.setup;
|
|
_sfc_main$5.setup = (props2, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/MenuItem.vue");
|
|
return _sfc_setup$5 ? _sfc_setup$5(props2, ctx) : void 0;
|
|
};
|
|
const MenuItem = Object.assign(_sfc_main$5, { __name: "MenuItem" });
|
|
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
__name: "Seller",
|
|
__ssrInlineRender: true,
|
|
props: {
|
|
user: {},
|
|
userId: {}
|
|
},
|
|
async setup(__props) {
|
|
let __temp, __restore;
|
|
const router = useRouter$1();
|
|
const props2 = __props;
|
|
const settingMenu = ref(false);
|
|
ref(false);
|
|
ref(false);
|
|
const visibleAdd = ref(false);
|
|
const config = useConfigStore();
|
|
const userPost = useUserPostStore();
|
|
const cartStore = useCartStore();
|
|
ref([]);
|
|
const formatNumber = (num) => {
|
|
if (num < 9999) return num;
|
|
return numbro(num).format({
|
|
average: true,
|
|
// Converts 11230 -> 11.2K, 1000000 -> 1M
|
|
mantissa: 1
|
|
// Number of decimal places
|
|
});
|
|
};
|
|
const videoThumbnails = ref({});
|
|
const isMain = computed(() => router.currentRoute.value.query.isMain);
|
|
const mediaStore = useMediaStore();
|
|
computed(() => config.sellerConfig?.store);
|
|
const userStore = useUserStore();
|
|
const userStory = computed(() => {
|
|
return mediaStore.users.find((x) => x.id === props2.user?.id);
|
|
});
|
|
const selectedStoryId = ref(null);
|
|
const observer = ref();
|
|
useIntersectionObserver(observer, async ([{ isIntersecting }]) => {
|
|
if (isIntersecting && !userPost.loading && !userPost.endPage) {
|
|
setTimeout(async () => {
|
|
const nextPage = userPost.currentPage + 1;
|
|
const data2 = await userPost.loadPosts(props2.userId, nextPage);
|
|
userPost.loadStateNextPage(data2);
|
|
}, 100);
|
|
}
|
|
});
|
|
const { data } = ([__temp, __restore] = withAsyncContext(async () => useAsyncData("productProfSeller", async () => {
|
|
userPost.reset();
|
|
return await userPost.loadPosts(props2.userId, 1);
|
|
})), __temp = await __temp, __restore(), __temp);
|
|
watch(data, () => {
|
|
if (data) {
|
|
userPost.loadStateNextPage(data.value);
|
|
}
|
|
});
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
const _component_a_badge = Badge;
|
|
const _component_a_popover = __nuxt_component_1;
|
|
const _component_a_drawer = __nuxt_component_2;
|
|
const _component_a_divider = __nuxt_component_1$1;
|
|
const _directive_lazy = resolveDirective("lazy");
|
|
let _temp0;
|
|
_push(`<!--[--><div data-v-1d8a8afd><div class="absolute top-0 w-inherit right-0 left-0" data-v-1d8a8afd><div class="flex justify-between w-full p-4" data-v-1d8a8afd><div class="flex items-center gap-4" data-v-1d8a8afd>`);
|
|
if (!isMain.value) {
|
|
_push(ssrRenderComponent(BasicIconOld, {
|
|
icon: !unref(config).isRTL ? "vuesax-linear:arrow-left" : "vuesax-linear:arrow-right",
|
|
onClick: ($event) => unref(router).back()
|
|
}, null, _parent));
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`<div class="font-semibold text-xl" data-v-1d8a8afd>${ssrInterpolate(_ctx.user?.username)}</div></div><div class="flex items-center gap5" data-v-1d8a8afd>`);
|
|
if ((!unref(config).isSeller && unref(config).APP_TYPE === "single" || unref(config).APP_TYPE === "multi") && isMain.value) {
|
|
_push(ssrRenderComponent(_component_a_badge, {
|
|
count: unref(cartStore).count,
|
|
dir: "ltr",
|
|
class: "mt1"
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`<div data-v-1d8a8afd${_scopeId}>`);
|
|
if (unref(config).isNightStore) {
|
|
_push2(`<img${ssrRenderAttr("src", _imports_0$2)} class="w-1.8rem -mt1" alt="" data-v-1d8a8afd${_scopeId}>`);
|
|
} else {
|
|
_push2(`<img${ssrRenderAttr("src", _imports_1$2)}${ssrRenderAttr("alt", unref(config).appName.en)} class="w-1.8rem -mt1" data-v-1d8a8afd${_scopeId}>`);
|
|
}
|
|
_push2(`</div>`);
|
|
} else {
|
|
return [
|
|
createVNode("div", {
|
|
onClick: ($event) => unref(router).push({ name: "cart" })
|
|
}, [
|
|
unref(config).isNightStore ? (openBlock(), createBlock("img", {
|
|
key: 0,
|
|
src: _imports_0$2,
|
|
class: "w-1.8rem -mt1",
|
|
alt: ""
|
|
})) : (openBlock(), createBlock("img", {
|
|
key: 1,
|
|
src: _imports_1$2,
|
|
alt: unref(config).appName.en,
|
|
class: "w-1.8rem -mt1"
|
|
}, null, 8, ["alt"]))
|
|
], 8, ["onClick"])
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
if (unref(getToken)() && unref(config).isSeller) {
|
|
_push(ssrRenderComponent(_component_a_popover, {
|
|
open: visibleAdd.value,
|
|
"onUpdate:open": ($event) => visibleAdd.value = $event,
|
|
trigger: "click"
|
|
}, {
|
|
content: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`<div data-v-1d8a8afd${_scopeId}><div class="flex items-center gap-2" data-v-1d8a8afd${_scopeId}><img${ssrRenderAttr("src", _imports_2)} class="w-1rem" alt="" data-v-1d8a8afd${_scopeId}><div data-v-1d8a8afd${_scopeId}>${ssrInterpolate(unref(config).useString("product"))}</div></div><div class="flex items-center gap-2 mt-2" data-v-1d8a8afd${_scopeId}><img${ssrRenderAttr("src", _imports_3)} class="w-1rem" alt="" data-v-1d8a8afd${_scopeId}><div data-v-1d8a8afd${_scopeId}>${ssrInterpolate(unref(config).useString("story"))}</div></div></div>`);
|
|
} else {
|
|
return [
|
|
createVNode("div", null, [
|
|
createVNode("div", {
|
|
class: "flex items-center gap-2",
|
|
onClick: ($event) => unref(router).push({ name: "add-product" })
|
|
}, [
|
|
createVNode("img", {
|
|
src: _imports_2,
|
|
class: "w-1rem",
|
|
alt: ""
|
|
}),
|
|
createVNode("div", null, toDisplayString(unref(config).useString("product")), 1)
|
|
], 8, ["onClick"]),
|
|
createVNode("div", {
|
|
class: "flex items-center gap-2 mt-2",
|
|
onClick: ($event) => unref(router).push({ name: "add-story" })
|
|
}, [
|
|
createVNode("img", {
|
|
src: _imports_3,
|
|
class: "w-1rem",
|
|
alt: ""
|
|
}),
|
|
createVNode("div", null, toDisplayString(unref(config).useString("story")), 1)
|
|
], 8, ["onClick"])
|
|
])
|
|
];
|
|
}
|
|
}),
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(ssrRenderComponent(_sfc_main$7, { class: "w-1.4rem" }, null, _parent2, _scopeId));
|
|
} else {
|
|
return [
|
|
createVNode(_sfc_main$7, { class: "w-1.4rem" })
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
if (_ctx.user?.id === unref(userStore).user?.id) {
|
|
_push(ssrRenderComponent(_sfc_main$6, {
|
|
class: "w-1.3rem",
|
|
onClick: ($event) => unref(router).push({ name: "user-setting" })
|
|
}, null, _parent));
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div></div><div class="h-90vh overflow-y-auto pb-5vh" data-v-1d8a8afd><div class="px4" data-v-1d8a8afd><div class="flex" data-v-1d8a8afd>`);
|
|
_push(ssrRenderComponent(UserProfilePic, {
|
|
src: _ctx.user?.avatar,
|
|
onClick: ($event) => userStory.value?.stories?.length !== 0 ? selectedStoryId.value = _ctx.user?.id : "",
|
|
"just-show-profile": userStory.value?.stories?.length === 0 || !userStory.value?.stories,
|
|
seenStory: !userStory.value?.stories?.length || userStory.value?.stories?.every((item) => item.storyviews.find((_item) => _item.user_id === unref(userStore).user?.id || _item.user_id === "me")),
|
|
showAdd: unref(config).isSeller
|
|
}, null, _parent));
|
|
_push(`<div class="p3 text-sm" data-v-1d8a8afd><div class="flex mt2 gap-2" data-v-1d8a8afd><div class="" data-v-1d8a8afd><div class="font-semibold" data-v-1d8a8afd>${ssrInterpolate(formatNumber(_ctx.user?.stats?.buy_total_order_count ?? 0))}</div><div data-v-1d8a8afd>${ssrInterpolate(unref(config).useString("products"))}</div></div>`);
|
|
if (_ctx.user?.id === unref(userStore).user?.id) {
|
|
_push(`<div class="" data-v-1d8a8afd><div class="font-semibold" data-v-1d8a8afd>${ssrInterpolate(formatNumber(_ctx.user?.stats?.total_customer ?? 0))}</div><div data-v-1d8a8afd>${ssrInterpolate(unref(config).useString("customers"))}</div></div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`<div class="" data-v-1d8a8afd><div class="font-semibold" data-v-1d8a8afd>${ssrInterpolate(formatNumber(_ctx.user?.id === unref(userStore).user?.id ? _ctx.user?.stats?.sell_total_order_count ?? 0 : _ctx.user?.stats?.buy_total_order_count ?? 0))}</div><div data-v-1d8a8afd>${ssrInterpolate(unref(config).isSeller ? unref(config).useString("orders") : unref(config).useString("yourOrders"))}</div></div></div></div></div><div class="text-xs mt-5 whitespace-pre-line" data-v-1d8a8afd>${ssrInterpolate(_ctx.user?.bio)}</div>`);
|
|
if (_ctx.user?.website) {
|
|
_push(`<a${ssrRenderAttr("href", "https://" + _ctx.user?.website)} target="_blank" data-v-1d8a8afd><div class="flex items-center text-xs gap-1 text-primary" data-v-1d8a8afd>`);
|
|
_push(ssrRenderComponent(BasicIconOld, {
|
|
icon: "vuesax-linear:link-1",
|
|
class: "text-primary",
|
|
size: "20"
|
|
}, null, _parent));
|
|
_push(` ${ssrInterpolate(_ctx.user?.website)}</div></a>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
if (unref(getToken)() && unref(userStore).user?.id === unref(router).currentRoute.value.params.id) {
|
|
_push(`<div class="flex items-center gap-2 mt-2" data-v-1d8a8afd>`);
|
|
_push(ssrRenderComponent(BasicButton, {
|
|
size: "small",
|
|
block: "",
|
|
class: ["!h-unset bg-gray-200 border-0 !py-1 !rounded-lg", unref(config).isNightStore ? "border-white text-white bg-black" : "border-black text-black"],
|
|
onClick: ($event) => unref(router).push({ name: "user-edit" })
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`${ssrInterpolate(unref(config).useString("editProfile"))}`);
|
|
} else {
|
|
return [
|
|
createTextVNode(toDisplayString(unref(config).useString("editProfile")), 1)
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
_push(ssrRenderComponent(BasicButton, {
|
|
size: "small",
|
|
block: "",
|
|
class: ["!h-unset bg-gray-200 border-0 !py-1 !rounded-lg", unref(config).isNightStore ? "border-white text-white bg-black" : "border-black text-black"]
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`${ssrInterpolate(unref(config).useString("shareStore"))}`);
|
|
} else {
|
|
return [
|
|
createTextVNode(toDisplayString(unref(config).useString("shareStore")), 1)
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
_push(`</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`<div class="mt-4 flex" data-v-1d8a8afd>`);
|
|
_push(ssrRenderComponent(Highlights, { "current-user": _ctx.user }, null, _parent));
|
|
_push(`</div></div><div class="w-full grid grid-cols-3 mt-2 gap-2px" data-v-1d8a8afd><!--[-->`);
|
|
ssrRenderList(unref(userPost).posts, (post, i) => {
|
|
_push(`<div class="w-full aspect-square relative" data-v-1d8a8afd>`);
|
|
if (post.files?.length) {
|
|
_push(`<!--[-->`);
|
|
if (post.files[0]?.type === "image") {
|
|
_push(`<img${ssrRenderAttrs(_temp0 = mergeProps({
|
|
class: "w-full h-full object-cover",
|
|
alt: "Post Image"
|
|
}, ssrGetDirectiveProps(_ctx, _directive_lazy, { src: unref(config).useDataStorage(post.files[0]?.url), loading: unref(loadGray), error: unref(loadGray) })))} data-v-1d8a8afd>${"textContent" in _temp0 ? ssrInterpolate(_temp0.textContent) : _temp0.innerHTML ?? ""}`);
|
|
} else if (post.files[0]?.type === "video") {
|
|
_push(`<div class="relative w-full h-full" data-v-1d8a8afd><video${ssrRenderAttr("src", post.files[0]?.url)} class="hidden" data-v-1d8a8afd></video><img${ssrRenderAttr("src", videoThumbnails.value[post.files[0]?.url])} class="w-full h-full object-cover" alt="Video Thumbnail" data-v-1d8a8afd><div class="absolute inset-0 flex items-center justify-center bg-black bg-opacity-30" data-v-1d8a8afd><svg class="w-12 h-12 text-white" fill="currentColor" viewBox="0 0 24 24" data-v-1d8a8afd><path d="M8 5v14l11-7z" data-v-1d8a8afd></path></svg></div></div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`<!--]-->`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div>`);
|
|
});
|
|
_push(`<!--]--></div><div style="${ssrRenderStyle(!unref(userPost).loading ? null : { display: "none" })}" class="w-full opacity-0 relative" data-v-1d8a8afd> load </div>`);
|
|
if (unref(userPost).loading) {
|
|
_push(ssrRenderComponent(__nuxt_component_0, null, null, _parent));
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div></div>`);
|
|
_push(ssrRenderComponent(_component_a_drawer, {
|
|
width: 300,
|
|
title: unref(config).useString("setting"),
|
|
placement: "right",
|
|
open: settingMenu.value,
|
|
onClose: ($event) => settingMenu.value = false
|
|
}, {
|
|
extra: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(ssrRenderComponent(BasicIconOld, {
|
|
icon: "vuesax-linear:setting",
|
|
onClick: ($event) => unref(router).push({ name: "setting" })
|
|
}, null, _parent2, _scopeId));
|
|
} else {
|
|
return [
|
|
createVNode(BasicIconOld, {
|
|
icon: "vuesax-linear:setting",
|
|
onClick: ($event) => unref(router).push({ name: "setting" })
|
|
}, null, 8, ["onClick"])
|
|
];
|
|
}
|
|
}),
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`<div data-v-1d8a8afd${_scopeId}>`);
|
|
_push2(ssrRenderComponent(MenuItem, {
|
|
title: unref(config).useString("brands"),
|
|
onClick: ($event) => unref(router).push({ name: "user-brands" }),
|
|
icon: "vuesax-linear:medal"
|
|
}, null, _parent2, _scopeId));
|
|
_push2(ssrRenderComponent(_component_a_divider, { class: "my-2" }, null, _parent2, _scopeId));
|
|
_push2(ssrRenderComponent(MenuItem, {
|
|
title: unref(config).useString("categories"),
|
|
onClick: ($event) => unref(router).push({ name: "user-categories" }),
|
|
icon: "vuesax-linear:category-2"
|
|
}, null, _parent2, _scopeId));
|
|
_push2(ssrRenderComponent(_component_a_divider, { class: "my-2" }, null, _parent2, _scopeId));
|
|
_push2(ssrRenderComponent(MenuItem, {
|
|
title: unref(config).useString("attributes"),
|
|
onClick: ($event) => unref(router).push({ name: "user-attributes" }),
|
|
icon: "vuesax-linear:data-2"
|
|
}, null, _parent2, _scopeId));
|
|
_push2(ssrRenderComponent(_component_a_divider, { class: "my-2" }, null, _parent2, _scopeId));
|
|
_push2(ssrRenderComponent(MenuItem, {
|
|
class: "text-red-6",
|
|
title: unref(config).useString("logout"),
|
|
icon: "vuesax-linear:logout",
|
|
onClick: unref(userStore).confirmLogout
|
|
}, null, _parent2, _scopeId));
|
|
_push2(`</div>`);
|
|
} else {
|
|
return [
|
|
createVNode("div", null, [
|
|
createVNode(MenuItem, {
|
|
title: unref(config).useString("brands"),
|
|
onClick: ($event) => unref(router).push({ name: "user-brands" }),
|
|
icon: "vuesax-linear:medal"
|
|
}, null, 8, ["title", "onClick"]),
|
|
createVNode(_component_a_divider, { class: "my-2" }),
|
|
createVNode(MenuItem, {
|
|
title: unref(config).useString("categories"),
|
|
onClick: ($event) => unref(router).push({ name: "user-categories" }),
|
|
icon: "vuesax-linear:category-2"
|
|
}, null, 8, ["title", "onClick"]),
|
|
createVNode(_component_a_divider, { class: "my-2" }),
|
|
createVNode(MenuItem, {
|
|
title: unref(config).useString("attributes"),
|
|
onClick: ($event) => unref(router).push({ name: "user-attributes" }),
|
|
icon: "vuesax-linear:data-2"
|
|
}, null, 8, ["title", "onClick"]),
|
|
createVNode(_component_a_divider, { class: "my-2" }),
|
|
createVNode(MenuItem, {
|
|
class: "text-red-6",
|
|
title: unref(config).useString("logout"),
|
|
icon: "vuesax-linear:logout",
|
|
onClick: unref(userStore).confirmLogout
|
|
}, null, 8, ["title", "onClick"])
|
|
])
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
_push(`</div>`);
|
|
if (selectedStoryId.value) {
|
|
_push(ssrRenderComponent(_sfc_main$8, {
|
|
id: selectedStoryId.value,
|
|
"onUpdate:id": ($event) => selectedStoryId.value = $event,
|
|
specifyId: ""
|
|
}, null, _parent));
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`<!--]-->`);
|
|
};
|
|
}
|
|
});
|
|
const _sfc_setup$4 = _sfc_main$4.setup;
|
|
_sfc_main$4.setup = (props2, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("views/base/pages/userProf/components/Seller.vue");
|
|
return _sfc_setup$4 ? _sfc_setup$4(props2, ctx) : void 0;
|
|
};
|
|
const Seller = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-1d8a8afd"]]);
|
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
__name: "Customer",
|
|
__ssrInlineRender: true,
|
|
props: {
|
|
user: {}
|
|
},
|
|
setup(__props) {
|
|
const router = useRouter$1();
|
|
const activeKey = ref("orders");
|
|
const config = useConfigStore();
|
|
const formatNumber = (num) => {
|
|
if (num < 9999) return num;
|
|
return numbro(num).format({
|
|
average: true,
|
|
// Converts 11230 -> 11.2K, 1000000 -> 1M
|
|
mantissa: 1
|
|
// Number of decimal places
|
|
});
|
|
};
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
const _component_ATabs = Tabs;
|
|
const _component_ATabPane = __nuxt_component_1$2;
|
|
_push(`<div${ssrRenderAttrs(_attrs)} data-v-097c9901><div class="absolute top-0 w-inherit right-0 left-0" data-v-097c9901><div class="flex justify-between w-full p-4" data-v-097c9901><div class="flex items-center gap-4" data-v-097c9901>`);
|
|
_push(ssrRenderComponent(BasicIconOld, {
|
|
icon: !unref(config).isRTL ? "vuesax-linear:arrow-left" : "vuesax-linear:arrow-right",
|
|
onClick: ($event) => unref(router).back()
|
|
}, null, _parent));
|
|
_push(`<div class="font-semibold text-lg" data-v-097c9901>${ssrInterpolate(_ctx.user?.name)}</div></div><div class="flex gap-24px items-center" data-v-097c9901></div></div><div class="h-90vh overflow-y-auto" data-v-097c9901><div class="px4" data-v-097c9901><div class="flex" data-v-097c9901>`);
|
|
_push(ssrRenderComponent(UserProfilePic, {
|
|
src: _ctx.user?.avatar,
|
|
"just-show-profile": ""
|
|
}, null, _parent));
|
|
_push(`<div class="p3 text-sm" data-v-097c9901><div class="flex mt2 gap-4" data-v-097c9901><div class="w-4rem" data-v-097c9901><div class="font-semibold" data-v-097c9901>${ssrInterpolate(formatNumber(_ctx.user?.stats?.buy_total_order_count ?? 0))}</div><div data-v-097c9901>${ssrInterpolate(unref(config).useString("orders"))}</div></div><div class="w-10rem" data-v-097c9901><div class="font-semibold flex" data-v-097c9901>${ssrInterpolate(unref(usePrice)(_ctx.user?.stats?.buy_total_order_sum ?? 0))}</div><div data-v-097c9901>${ssrInterpolate(unref(config).useString("totalAmountPurchased"))}</div></div></div></div></div><div class="grid grid-cols-3 mt-3" data-v-097c9901><div class="" data-v-097c9901><div class="text-sm" data-v-097c9901>${ssrInterpolate(unref(config).useString("phone"))}:</div><div class="text-xs font-semibold" data-v-097c9901>${ssrInterpolate(_ctx.user?.phone ?? "_")}</div></div><div class="" data-v-097c9901><div class="text-sm" data-v-097c9901>${ssrInterpolate(unref(config).useString("birthdate"))}:</div><div class="text-xs font-semibold" data-v-097c9901>${ssrInterpolate(unref(toJalali)(_ctx.user?.birthday ?? "_"))}</div></div><div class="" data-v-097c9901><div class="text-sm" data-v-097c9901>${ssrInterpolate(unref(config).useString("email"))}:</div><div class="text-xs font-semibold" data-v-097c9901>${ssrInterpolate(_ctx.user?.email ?? "_")}</div></div></div><div class="mt-4 flex" data-v-097c9901></div></div>`);
|
|
if (unref(config).isSeller) {
|
|
_push(`<div data-v-097c9901>`);
|
|
_push(ssrRenderComponent(_component_ATabs, {
|
|
activeKey: activeKey.value,
|
|
"onUpdate:activeKey": ($event) => activeKey.value = $event,
|
|
centered: "",
|
|
class: "instaTab"
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(ssrRenderComponent(_component_ATabPane, {
|
|
class: "!w-full",
|
|
key: "orders",
|
|
tab: unref(config).useString("orders")
|
|
}, {
|
|
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
if (_push3) {
|
|
_push3(`<div class="h-63vh pb-10vh overflow-y-auto px-3" data-v-097c9901${_scopeId2}>`);
|
|
_push3(ssrRenderComponent(_sfc_main$9, null, null, _parent3, _scopeId2));
|
|
_push3(`</div>`);
|
|
} else {
|
|
return [
|
|
createVNode("div", { class: "h-63vh pb-10vh overflow-y-auto px-3" }, [
|
|
createVNode(_sfc_main$9)
|
|
])
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent2, _scopeId));
|
|
_push2(ssrRenderComponent(_component_ATabPane, {
|
|
class: "!w-full",
|
|
key: "saved",
|
|
tab: unref(config).useString("saved")
|
|
}, {
|
|
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
if (_push3) {
|
|
_push3(`<div class="h-63vh pb-10vh overflow-y-auto px-3" data-v-097c9901${_scopeId2}>`);
|
|
_push3(ssrRenderComponent(_sfc_main$a, null, null, _parent3, _scopeId2));
|
|
_push3(`</div>`);
|
|
} else {
|
|
return [
|
|
createVNode("div", { class: "h-63vh pb-10vh overflow-y-auto px-3" }, [
|
|
createVNode(_sfc_main$a)
|
|
])
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent2, _scopeId));
|
|
} else {
|
|
return [
|
|
createVNode(_component_ATabPane, {
|
|
class: "!w-full",
|
|
key: "orders",
|
|
tab: unref(config).useString("orders")
|
|
}, {
|
|
default: withCtx(() => [
|
|
createVNode("div", { class: "h-63vh pb-10vh overflow-y-auto px-3" }, [
|
|
createVNode(_sfc_main$9)
|
|
])
|
|
]),
|
|
_: 1
|
|
}, 8, ["tab"]),
|
|
createVNode(_component_ATabPane, {
|
|
class: "!w-full",
|
|
key: "saved",
|
|
tab: unref(config).useString("saved")
|
|
}, {
|
|
default: withCtx(() => [
|
|
createVNode("div", { class: "h-63vh pb-10vh overflow-y-auto px-3" }, [
|
|
createVNode(_sfc_main$a)
|
|
])
|
|
]),
|
|
_: 1
|
|
}, 8, ["tab"])
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
_push(`</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div></div></div>`);
|
|
};
|
|
}
|
|
});
|
|
const _sfc_setup$3 = _sfc_main$3.setup;
|
|
_sfc_main$3.setup = (props2, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("views/base/pages/userProf/components/Customer.vue");
|
|
return _sfc_setup$3 ? _sfc_setup$3(props2, ctx) : void 0;
|
|
};
|
|
const Customer = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-097c9901"]]);
|
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
__name: "ProfileSkeleton",
|
|
__ssrInlineRender: true,
|
|
setup(__props) {
|
|
const isLoaded = ref(false);
|
|
const skeletonRatio = ref(null);
|
|
const skeletonSize = reactive(
|
|
useElementSize(skeletonRatio, { width: 0, height: 0 }, { box: "border-box" })
|
|
);
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
if (isLoaded.value) {
|
|
_push(`<div${ssrRenderAttrs(mergeProps({
|
|
ref_key: "skeletonRatio",
|
|
ref: skeletonRatio,
|
|
class: "h-fit"
|
|
}, _attrs))}>`);
|
|
_push(ssrRenderComponent(unref(ContentLoader), {
|
|
width: skeletonSize.width,
|
|
height: "760"
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`<rect x="0" y="0" rx="0" ry="0"${ssrRenderAttr("width", skeletonSize.width)} height="40"${_scopeId}></rect><circle cx="60" cy="90" r="40"${_scopeId}></circle><rect x="120" y="90" rx="3" ry="3" width="70" height="30"${_scopeId}></rect><rect x="220" y="90" rx="3" ry="3" width="70" height="30"${_scopeId}></rect><rect x="320" y="90" rx="3" ry="3" width="70" height="30"${_scopeId}></rect><rect x="10" y="160" rx="3" ry="3" width="70" height="10"${_scopeId}></rect><rect x="10" y="180" rx="3" ry="3" width="200" height="10"${_scopeId}></rect><rect x="10" y="200" rx="3" ry="3" width="400" height="10"${_scopeId}></rect><rect x="10" y="220" rx="3" ry="3" width="400" height="10"${_scopeId}></rect><rect x="10" y="250" rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 2 - 15)} height="30"${_scopeId}></rect><rect${ssrRenderAttr("x", skeletonSize.width / 2 + 5)} y="250" rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 2 - 15)} height="30"${_scopeId}></rect><rect x="0" y="310" rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 3 - 2)}${ssrRenderAttr("height", skeletonSize.width / 3 - 2)}${_scopeId}></rect><rect${ssrRenderAttr("x", skeletonSize.width / 3)} y="310" rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 3 - 2)}${ssrRenderAttr("height", skeletonSize.width / 3 - 2)}${_scopeId}></rect><rect${ssrRenderAttr("x", 2 * skeletonSize.width / 3)} y="310" rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 3 - 2)}${ssrRenderAttr("height", skeletonSize.width / 3 - 2)}${_scopeId}></rect><rect x="0"${ssrRenderAttr("y", 311 + skeletonSize.width / 3)} rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 3 - 2)}${ssrRenderAttr("height", skeletonSize.width / 3 - 2)}${_scopeId}></rect><rect${ssrRenderAttr("x", skeletonSize.width / 3)}${ssrRenderAttr("y", 311 + skeletonSize.width / 3)} rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 3 - 2)}${ssrRenderAttr("height", skeletonSize.width / 3 - 2)}${_scopeId}></rect><rect${ssrRenderAttr("x", 2 * skeletonSize.width / 3)}${ssrRenderAttr("y", 311 + skeletonSize.width / 3)} rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 3 - 2)}${ssrRenderAttr("height", skeletonSize.width / 3 - 2)}${_scopeId}></rect><rect x="0"${ssrRenderAttr("y", 312 + 2 * skeletonSize.width / 3)} rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 3 - 2)}${ssrRenderAttr("height", skeletonSize.width / 3 - 2)}${_scopeId}></rect><rect${ssrRenderAttr("x", skeletonSize.width / 3)}${ssrRenderAttr("y", 312 + 2 * skeletonSize.width / 3)} rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 3 - 2)}${ssrRenderAttr("height", skeletonSize.width / 3 - 2)}${_scopeId}></rect><rect${ssrRenderAttr("x", 2 * skeletonSize.width / 3)}${ssrRenderAttr("y", 312 + 2 * skeletonSize.width / 3)} rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 3 - 2)}${ssrRenderAttr("height", skeletonSize.width / 3 - 2)}${_scopeId}></rect>`);
|
|
} else {
|
|
return [
|
|
createVNode("rect", {
|
|
x: "0",
|
|
y: "0",
|
|
rx: "0",
|
|
ry: "0",
|
|
width: skeletonSize.width,
|
|
height: "40"
|
|
}, null, 8, ["width"]),
|
|
createVNode("circle", {
|
|
cx: "60",
|
|
cy: "90",
|
|
r: "40"
|
|
}),
|
|
createVNode("rect", {
|
|
x: "120",
|
|
y: "90",
|
|
rx: "3",
|
|
ry: "3",
|
|
width: "70",
|
|
height: "30"
|
|
}),
|
|
createVNode("rect", {
|
|
x: "220",
|
|
y: "90",
|
|
rx: "3",
|
|
ry: "3",
|
|
width: "70",
|
|
height: "30"
|
|
}),
|
|
createVNode("rect", {
|
|
x: "320",
|
|
y: "90",
|
|
rx: "3",
|
|
ry: "3",
|
|
width: "70",
|
|
height: "30"
|
|
}),
|
|
createVNode("rect", {
|
|
x: "10",
|
|
y: "160",
|
|
rx: "3",
|
|
ry: "3",
|
|
width: "70",
|
|
height: "10"
|
|
}),
|
|
createVNode("rect", {
|
|
x: "10",
|
|
y: "180",
|
|
rx: "3",
|
|
ry: "3",
|
|
width: "200",
|
|
height: "10"
|
|
}),
|
|
createVNode("rect", {
|
|
x: "10",
|
|
y: "200",
|
|
rx: "3",
|
|
ry: "3",
|
|
width: "400",
|
|
height: "10"
|
|
}),
|
|
createVNode("rect", {
|
|
x: "10",
|
|
y: "220",
|
|
rx: "3",
|
|
ry: "3",
|
|
width: "400",
|
|
height: "10"
|
|
}),
|
|
createVNode("rect", {
|
|
x: "10",
|
|
y: "250",
|
|
rx: "3",
|
|
ry: "3",
|
|
width: skeletonSize.width / 2 - 15,
|
|
height: "30"
|
|
}, null, 8, ["width"]),
|
|
createVNode("rect", {
|
|
x: skeletonSize.width / 2 + 5,
|
|
y: "250",
|
|
rx: "3",
|
|
ry: "3",
|
|
width: skeletonSize.width / 2 - 15,
|
|
height: "30"
|
|
}, null, 8, ["x", "width"]),
|
|
createVNode("rect", {
|
|
x: "0",
|
|
y: "310",
|
|
rx: "3",
|
|
ry: "3",
|
|
width: skeletonSize.width / 3 - 2,
|
|
height: skeletonSize.width / 3 - 2
|
|
}, null, 8, ["width", "height"]),
|
|
createVNode("rect", {
|
|
x: skeletonSize.width / 3,
|
|
y: "310",
|
|
rx: "3",
|
|
ry: "3",
|
|
width: skeletonSize.width / 3 - 2,
|
|
height: skeletonSize.width / 3 - 2
|
|
}, null, 8, ["x", "width", "height"]),
|
|
createVNode("rect", {
|
|
x: 2 * skeletonSize.width / 3,
|
|
y: "310",
|
|
rx: "3",
|
|
ry: "3",
|
|
width: skeletonSize.width / 3 - 2,
|
|
height: skeletonSize.width / 3 - 2
|
|
}, null, 8, ["x", "width", "height"]),
|
|
createVNode("rect", {
|
|
x: "0",
|
|
y: 311 + skeletonSize.width / 3,
|
|
rx: "3",
|
|
ry: "3",
|
|
width: skeletonSize.width / 3 - 2,
|
|
height: skeletonSize.width / 3 - 2
|
|
}, null, 8, ["y", "width", "height"]),
|
|
createVNode("rect", {
|
|
x: skeletonSize.width / 3,
|
|
y: 311 + skeletonSize.width / 3,
|
|
rx: "3",
|
|
ry: "3",
|
|
width: skeletonSize.width / 3 - 2,
|
|
height: skeletonSize.width / 3 - 2
|
|
}, null, 8, ["x", "y", "width", "height"]),
|
|
createVNode("rect", {
|
|
x: 2 * skeletonSize.width / 3,
|
|
y: 311 + skeletonSize.width / 3,
|
|
rx: "3",
|
|
ry: "3",
|
|
width: skeletonSize.width / 3 - 2,
|
|
height: skeletonSize.width / 3 - 2
|
|
}, null, 8, ["x", "y", "width", "height"]),
|
|
createVNode("rect", {
|
|
x: "0",
|
|
y: 312 + 2 * skeletonSize.width / 3,
|
|
rx: "3",
|
|
ry: "3",
|
|
width: skeletonSize.width / 3 - 2,
|
|
height: skeletonSize.width / 3 - 2
|
|
}, null, 8, ["y", "width", "height"]),
|
|
createVNode("rect", {
|
|
x: skeletonSize.width / 3,
|
|
y: 312 + 2 * skeletonSize.width / 3,
|
|
rx: "3",
|
|
ry: "3",
|
|
width: skeletonSize.width / 3 - 2,
|
|
height: skeletonSize.width / 3 - 2
|
|
}, null, 8, ["x", "y", "width", "height"]),
|
|
createVNode("rect", {
|
|
x: 2 * skeletonSize.width / 3,
|
|
y: 312 + 2 * skeletonSize.width / 3,
|
|
rx: "3",
|
|
ry: "3",
|
|
width: skeletonSize.width / 3 - 2,
|
|
height: skeletonSize.width / 3 - 2
|
|
}, null, 8, ["x", "y", "width", "height"])
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
_push(`</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
};
|
|
}
|
|
});
|
|
const _sfc_setup$2 = _sfc_main$2.setup;
|
|
_sfc_main$2.setup = (props2, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("views/base/pages/userProf/components/ProfileSkeleton.vue");
|
|
return _sfc_setup$2 ? _sfc_setup$2(props2, ctx) : void 0;
|
|
};
|
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
__name: "index",
|
|
__ssrInlineRender: true,
|
|
async setup(__props) {
|
|
let __temp, __restore;
|
|
const router = useRouter$1();
|
|
useConfigStore();
|
|
const profileId = computed(() => router.currentRoute.value.params.id);
|
|
const userStore = useUserStore();
|
|
computed(() => router.currentRoute.value.query.isMain);
|
|
const { data: user, error } = ([__temp, __restore] = withAsyncContext(() => useAsyncData(
|
|
"user-profile",
|
|
() => getOneUser(profileId.value ?? 0)
|
|
)), __temp = await __temp, __restore(), __temp);
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
if (unref(user) && !unref(loading)) {
|
|
_push(`<!--[-->`);
|
|
if (unref(user)?.type === "store" && !unref(userStore)?.user?.main || unref(router).currentRoute.value.query.isMain) {
|
|
_push(ssrRenderComponent(Seller, {
|
|
user: unref(user),
|
|
userId: profileId.value
|
|
}, null, _parent));
|
|
} else {
|
|
_push(ssrRenderComponent(Customer, { user: unref(user) }, null, _parent));
|
|
}
|
|
_push(`<!--]-->`);
|
|
} else {
|
|
_push(ssrRenderComponent(_sfc_main$2, mergeProps({ class: "w-full h-90vh" }, _attrs), null, _parent));
|
|
}
|
|
};
|
|
}
|
|
});
|
|
const _sfc_setup$1 = _sfc_main$1.setup;
|
|
_sfc_main$1.setup = (props2, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("views/base/pages/userProf/index.vue");
|
|
return _sfc_setup$1 ? _sfc_setup$1(props2, ctx) : void 0;
|
|
};
|
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
__name: "[id]",
|
|
__ssrInlineRender: true,
|
|
setup(__props) {
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
_push(ssrRenderComponent(_sfc_main$1, _attrs, null, _parent));
|
|
};
|
|
}
|
|
});
|
|
const _sfc_setup = _sfc_main.setup;
|
|
_sfc_main.setup = (props2, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/user_detail/[id].vue");
|
|
return _sfc_setup ? _sfc_setup(props2, ctx) : void 0;
|
|
};
|
|
|
|
export { _sfc_main as default };
|