239 lines
9.8 KiB
JavaScript
239 lines
9.8 KiB
JavaScript
import { b as buildAssetsURL } from '../_/nitro.mjs';
|
|
import { defineComponent, ref, computed, mergeProps, unref, withCtx, createTextVNode, toDisplayString, reactive, createVNode, useSSRContext } from 'vue';
|
|
import { ssrRenderAttrs, ssrRenderList, ssrRenderComponent, ssrRenderAttr, ssrInterpolate } from 'vue/server-renderer';
|
|
import { U as UserProfilePic } from './UserProfilePic-DXA233hi.mjs';
|
|
import { _ as _sfc_main$4 } from './BasicButton-BAlnoE_w.mjs';
|
|
import { u as useRouter$1, a as useConfigStore, aK as useRoute$1, z as useElementSize } from './server.mjs';
|
|
import { u as usePrice } from './usePrice-B-5-jXKQ.mjs';
|
|
import { t as toJalali } from './useDateTime-D8RCoGwW.mjs';
|
|
import { u as useMediaStore } from './media-kxpEX2xr.mjs';
|
|
import { _ as __nuxt_component_4 } from './index-_EOUO1YE.mjs';
|
|
import { ContentLoader } from 'vue-content-loader';
|
|
|
|
const _imports_0$1 = "" + buildAssetsURL("empty_order.g7yXtwjI.svg");
|
|
const _imports_0 = "" + buildAssetsURL("delivery-box-light.Cz31HXNr.svg");
|
|
const _imports_1 = "" + buildAssetsURL("delivery-box.DZAXZSja.svg");
|
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
__name: "box",
|
|
__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$3 = _sfc_main$3.setup;
|
|
_sfc_main$3.setup = (props, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("assets/img/icons/box.vue");
|
|
return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
|
|
};
|
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
__name: "OrderCard",
|
|
__ssrInlineRender: true,
|
|
props: {
|
|
order: {}
|
|
},
|
|
setup(__props) {
|
|
const router = useRouter$1();
|
|
const props = __props;
|
|
const config = useConfigStore();
|
|
const address = computed(() => {
|
|
var _a2, _b, _c;
|
|
var _a;
|
|
const convert = (_a = JSON.parse(props.order.address)) == null ? void 0 : _a.payload;
|
|
return `${(_a2 = convert == null ? void 0 : convert.province) != null ? _a2 : ""}-${(_b = convert == null ? void 0 : convert.city) != null ? _b : ""}-${(_c = convert == null ? void 0 : convert.address) != null ? _c : ""}`;
|
|
});
|
|
useMediaStore();
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
var _a2;
|
|
var _a, _b;
|
|
const _component_a_divider = __nuxt_component_4;
|
|
_push(`<div${ssrRenderAttrs(_attrs)}><div class="flex justify-between items-center mt-5"><div>`);
|
|
if (unref(config).isSeller) {
|
|
_push(ssrRenderComponent(UserProfilePic, {
|
|
width: "60",
|
|
src: (_a = _ctx.order.user) == null ? void 0 : _a.avatar,
|
|
"just-show-profile": ""
|
|
}, null, _parent));
|
|
} else {
|
|
_push(ssrRenderComponent(_sfc_main$3, { class: "w-2rem" }, null, _parent));
|
|
}
|
|
_push(`</div><div class="flex-1 mx-5 gap-4">`);
|
|
if (unref(config).isSeller) {
|
|
_push(`<div class="text-sm font-semibold">${ssrInterpolate((_a2 = (_b = _ctx.order.user) == null ? void 0 : _b.name) != null ? _a2 : "_")}</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`<div class="text-sm"><span class="text-gray-400 text-xs">${ssrInterpolate(unref(config).useString("orderNumber"))}:</span><span class="text-gray-700 ms-2 font-bold">${ssrInterpolate(_ctx.order.id)}</span></div><div class="flex items-center text-xs gap-2 mt-1"><span class="text-gray-400">${ssrInterpolate(unref(config).useString("totalPrice"))}:</span><span class="text-gray-700 font-bold">${ssrInterpolate(unref(usePrice)(_ctx.order.total_price, true))}</span></div><div class="flex items-baseline text-xs gap-2 mt-1"><span class="text-gray-400">${ssrInterpolate(unref(config).useString("date"))}:</span><span class="text-gray-700 font-bold">${ssrInterpolate(unref(toJalali)(_ctx.order.created_at))}</span></div></div><div class="flex flex-col items-end">`);
|
|
_push(ssrRenderComponent(_sfc_main$4, {
|
|
class: "!h-7",
|
|
onClick: ($event) => unref(router).push({ name: "user-order-id", params: { id: _ctx.order.id } })
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`${ssrInterpolate(unref(config).useString("details"))}`);
|
|
} else {
|
|
return [
|
|
createTextVNode(toDisplayString(unref(config).useString("details")), 1)
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
_push(`</div></div>`);
|
|
_push(ssrRenderComponent(_component_a_divider, { class: "my-2" }, null, _parent));
|
|
_push(`<p class="text-xs font-azar font-200">${ssrInterpolate(address.value)}</p></div>`);
|
|
};
|
|
}
|
|
});
|
|
const _sfc_setup$2 = _sfc_main$2.setup;
|
|
_sfc_main$2.setup = (props, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/Cards/OrderCard.vue");
|
|
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
|
|
};
|
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
__name: "OrderCardSkeleton",
|
|
__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: "80"
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`<circle cx="30" cy="50" r="30"${_scopeId}></circle><rect x="80" y="15" rx="3" ry="3" width="190" height="15"${_scopeId}></rect><rect x="80" y="40" rx="3" ry="3" width="190" height="15"${_scopeId}></rect><rect x="80" y="65" rx="3" ry="3" width="190" height="15"${_scopeId}></rect><rect${ssrRenderAttr("x", skeletonSize.width - 80)} y="35" rx="3" ry="3" width="80" height="30"${_scopeId}></rect>`);
|
|
} else {
|
|
return [
|
|
createVNode("circle", {
|
|
cx: "30",
|
|
cy: "50",
|
|
r: "30"
|
|
}),
|
|
createVNode("rect", {
|
|
x: "80",
|
|
y: "15",
|
|
rx: "3",
|
|
ry: "3",
|
|
width: "190",
|
|
height: "15"
|
|
}),
|
|
createVNode("rect", {
|
|
x: "80",
|
|
y: "40",
|
|
rx: "3",
|
|
ry: "3",
|
|
width: "190",
|
|
height: "15"
|
|
}),
|
|
createVNode("rect", {
|
|
x: "80",
|
|
y: "65",
|
|
rx: "3",
|
|
ry: "3",
|
|
width: "190",
|
|
height: "15"
|
|
}),
|
|
createVNode("rect", {
|
|
x: skeletonSize.width - 80,
|
|
y: "35",
|
|
rx: "3",
|
|
ry: "3",
|
|
width: "80",
|
|
height: "30"
|
|
}, null, 8, ["x"])
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
_push(`</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
};
|
|
}
|
|
});
|
|
const _sfc_setup$1 = _sfc_main$1.setup;
|
|
_sfc_main$1.setup = (props, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/Cards/OrderCardSkeleton.vue");
|
|
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
|
|
};
|
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
__name: "OrdersList",
|
|
__ssrInlineRender: true,
|
|
setup(__props) {
|
|
const router = useRouter$1();
|
|
const config = useConfigStore();
|
|
const loading = ref(false);
|
|
ref(false);
|
|
ref(0);
|
|
ref(10);
|
|
const orders = ref([]);
|
|
computed(() => router.currentRoute.value.params.id);
|
|
useRoute$1();
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
var _a;
|
|
_push(`<div${ssrRenderAttrs(mergeProps({
|
|
class: ["flex flex-col gap-2 min-h-50vh", ((_a = orders.value) == null ? void 0 : _a.length) > 0 ? "" : "justify-center"]
|
|
}, _attrs))}>`);
|
|
if (!loading.value) {
|
|
_push(`<!--[-->`);
|
|
if (orders.value.length !== 0) {
|
|
_push(`<!--[-->`);
|
|
ssrRenderList(orders.value, (order) => {
|
|
_push(ssrRenderComponent(_sfc_main$2, { order }, null, _parent));
|
|
});
|
|
_push(`<!--]-->`);
|
|
} else {
|
|
_push(`<!--[--><img${ssrRenderAttr("src", _imports_0$1)} alt="orders" class="w-20 self-center"><p class="self-center text-gray-6">${ssrInterpolate(unref(config).useString("orderListIsEmpty"))}</p><!--]-->`);
|
|
}
|
|
_push(`<!--]-->`);
|
|
} else {
|
|
_push(`<!--[-->`);
|
|
ssrRenderList(6, (i) => {
|
|
_push(ssrRenderComponent(_sfc_main$1, { key: i }, null, _parent));
|
|
});
|
|
_push(`<!--]-->`);
|
|
}
|
|
_push(`</div>`);
|
|
};
|
|
}
|
|
});
|
|
const _sfc_setup = _sfc_main.setup;
|
|
_sfc_main.setup = (props, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("views/base/pages/statisticsList/components/OrdersList.vue");
|
|
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
};
|
|
|
|
export { _sfc_main as _ };
|
|
//# sourceMappingURL=OrdersList-D8ylOI0R.mjs.map
|