636 lines
28 KiB
JavaScript
636 lines
28 KiB
JavaScript
import { defineComponent, ref, computed, unref, resolveDirective, mergeProps, withCtx, createTextVNode, toDisplayString, createVNode, withDirectives, reactive, watch, nextTick, useSSRContext } from 'vue';
|
|
import { ssrRenderComponent, ssrRenderAttrs, ssrRenderClass, ssrInterpolate, ssrGetDirectiveProps, ssrRenderList } from 'vue/server-renderer';
|
|
import { u as useRouter$1, a as useConfigStore, b as useUserStore, C as getSupabaseStorageUrl, ac as __nuxt_component_4, ad as __nuxt_component_1$1, f as loading, ae as useProduct, G as Badge, F as Form, j as __nuxt_component_1$3, P as myAxios, Q as supabaseService, d as api$1 } from './server.mjs';
|
|
import { B as BasicIconOld } from './BasicIconOld-93vAWohq.mjs';
|
|
import { u as usePrice } from './usePrice-B-5-jXKQ.mjs';
|
|
import { e as empty_user } from './empty_user-BaUNCdgf.mjs';
|
|
import { B as BasicButton } from './BasicButton-B9iMRxfW.mjs';
|
|
import { p as previewImg } from './logo_preview-CJTcB_Eg.mjs';
|
|
import { t as toJalali } from './useDateTime-D8RCoGwW.mjs';
|
|
import { B as BasicSheet } from './index-CM92jef_.mjs';
|
|
import { _ as _sfc_main$5 } from './close-1waVvhB6.mjs';
|
|
import { B as BasicInput } from './BasicInput-DvVrG0oq.mjs';
|
|
import { _ as _export_sfc } from './_plugin-vue_export-helper-1tPrXgE0.mjs';
|
|
import '../_/nitro.mjs';
|
|
import 'node:http';
|
|
import 'node:https';
|
|
import 'node:events';
|
|
import 'node:buffer';
|
|
import 'node:fs';
|
|
import 'node:url';
|
|
import 'consola';
|
|
import 'ipx';
|
|
import 'node:path';
|
|
import 'node:crypto';
|
|
import 'pinia';
|
|
import '@supabase/supabase-js';
|
|
import '@babel/runtime/helpers/esm/extends';
|
|
import '@babel/runtime/helpers/esm/objectSpread2';
|
|
import '@ant-design/colors';
|
|
import '@ctrl/tinycolor';
|
|
import 'stylis';
|
|
import 'vue-types';
|
|
import 'lodash-es';
|
|
import 'axios';
|
|
import '@ant-design/icons-vue';
|
|
import 'resize-observer-polyfill';
|
|
import 'dom-align';
|
|
import 'lodash-es/uniq.js';
|
|
import 'lodash-es/pick.js';
|
|
import 'lodash-es/isPlainObject.js';
|
|
import 'lodash-es/debounce.js';
|
|
import 'lodash-es/cloneDeep.js';
|
|
import 'async-validator';
|
|
import 'lodash-es/find.js';
|
|
import 'lodash-es/isEqual.js';
|
|
import 'compute-scroll-into-view';
|
|
import 'lodash-es/intersection.js';
|
|
import 'lodash-es/omit.js';
|
|
import 'lodash-es/isNumber.js';
|
|
import 'throttle-debounce';
|
|
import 'lodash-es/fromPairs.js';
|
|
import 'lodash-es/partition.js';
|
|
import '../routes/renderer.mjs';
|
|
import 'vue-bundle-renderer/runtime';
|
|
import 'unhead/server';
|
|
import 'devalue';
|
|
import 'unhead/utils';
|
|
import 'moment';
|
|
import 'moment-timezone';
|
|
import 'moment-jalaali';
|
|
import 'date-fns';
|
|
import 'date-fns/locale';
|
|
import '@vueuse/gesture';
|
|
import '@headlessui/vue';
|
|
import 'framesync';
|
|
import 'popmotion';
|
|
import 'style-value-types';
|
|
import './close_light-DbrEdRZI.mjs';
|
|
|
|
const getOneOrder = async (id) => {
|
|
return await myAxios.get(`/order/${id}`);
|
|
};
|
|
const updateStatus = async (id, obj) => supabaseService.fetch("orders_status", "update", {
|
|
data: obj,
|
|
field: "id",
|
|
value: id
|
|
});
|
|
const createStatus = async (obj) => {
|
|
return await myAxios.post(`/order/change-status/${obj.order_id}`, { title: obj.title });
|
|
};
|
|
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
__name: "OrderProductCard",
|
|
__ssrInlineRender: true,
|
|
props: {
|
|
item: {},
|
|
isLast: { type: Boolean }
|
|
},
|
|
setup(__props) {
|
|
const props = __props;
|
|
const config = useConfigStore();
|
|
const {
|
|
originalImage,
|
|
qty,
|
|
price,
|
|
title,
|
|
hasDiscount,
|
|
originalPrice
|
|
} = useProduct(props.item.product, props.item.variant);
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
const _component_a_badge = Badge;
|
|
const _component_a_divider = __nuxt_component_4;
|
|
const _directive_lazy = resolveDirective("lazy");
|
|
let _temp0;
|
|
_push(`<div${ssrRenderAttrs(_attrs)}><div class="flex">`);
|
|
_push(ssrRenderComponent(_component_a_badge, {
|
|
count: _ctx.item.qty
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`<div class="h-6rem w-6rem"${_scopeId}><img${ssrRenderAttrs(_temp0 = mergeProps({
|
|
alt: "instagram",
|
|
class: "bg-zinc-1 w-6rem aspect-square rounded-2xl object-contain ms-2"
|
|
}, ssrGetDirectiveProps(_ctx, _directive_lazy, { src: unref(originalImage), loading: unref(previewImg), error: unref(previewImg) })))}${_scopeId}>${"textContent" in _temp0 ? ssrInterpolate(_temp0.textContent) : _temp0.innerHTML ?? ""}</div>`);
|
|
} else {
|
|
return [
|
|
createVNode("div", { class: "h-6rem w-6rem" }, [
|
|
withDirectives(createVNode("img", {
|
|
alt: "instagram",
|
|
class: "bg-zinc-1 w-6rem aspect-square rounded-2xl object-contain ms-2"
|
|
}, null, 512), [
|
|
[_directive_lazy, { src: unref(originalImage), loading: unref(previewImg), error: unref(previewImg) }]
|
|
])
|
|
])
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
_push(`<div class="w-full"><div class="flex items-center justify-between w-full"><div class="ps-4 pt-2 w-full"><div class="font-bold truncate text-sm">${ssrInterpolate(unref(title))}</div><div class="flex"><!--[-->`);
|
|
ssrRenderList(_ctx.item?.variant?.attribute_values, (val, index) => {
|
|
_push(`<div class="flex items-baseline ms1"><div>${ssrInterpolate(val.value)}</div>`);
|
|
if (_ctx.item?.variant?.attribute_values.length - 1 !== index) {
|
|
_push(`<div>,</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div>`);
|
|
});
|
|
_push(`<!--]--></div><div class="flex w-full justify-between"><div class="flex gap-1 items-baseline text-xs mt2"><div class="font-bold">${ssrInterpolate(_ctx.item.qty)}</div><div class="text-xs">${ssrInterpolate(unref(config).useString("item2"))}</div></div><div class="flex flex-col font-bold me-3">`);
|
|
if (unref(hasDiscount)) {
|
|
_push(`<span class="font-medium text-gray-400 text-xs line-through">${ssrInterpolate(unref(usePrice)(unref(originalPrice), true, ""))}</span>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`<span class="text-sm">${ssrInterpolate(unref(usePrice)(unref(price), true, ""))}</span><span class="text-xs text-end">${ssrInterpolate(unref(config).priceUnit)}</span></div></div></div></div><div class="px-3">`);
|
|
_push(ssrRenderComponent(_component_a_divider, { class: "my-2" }, null, _parent));
|
|
_push(`</div><div class="ps-4 flex items-baseline"><div class="font-bold">${ssrInterpolate(unref(usePrice)(_ctx.item.qty * unref(price), true, ""))}</div><div class="text-sm text-end font-bold ms-1">${ssrInterpolate(unref(config).priceUnit)}</div>`);
|
|
if (unref(hasDiscount)) {
|
|
_push(`<div class="font-medium text-gray-400 text-xs line-through ms-5">${ssrInterpolate(unref(usePrice)(_ctx.item.qty * unref(originalPrice)))}</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div></div></div>`);
|
|
if (!_ctx.isLast) {
|
|
_push(`<div class="py-4 mx-3"><div class="h-2px bg-gray-3"></div></div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div>`);
|
|
};
|
|
}
|
|
});
|
|
const _sfc_setup$4 = _sfc_main$4.setup;
|
|
_sfc_main$4.setup = (props, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/Cards/OrderProductCard.vue");
|
|
return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
|
|
};
|
|
const ProductCard = Object.assign(_sfc_main$4, { __name: "CardsOrderProductCard" });
|
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
__name: "StatusAddEdit",
|
|
__ssrInlineRender: true,
|
|
props: {
|
|
open: { type: Boolean, default: false },
|
|
isEdit: { type: Boolean, default: false },
|
|
data: {},
|
|
orderId: {}
|
|
},
|
|
emits: ["update:open", "update:isEdit", "success"],
|
|
setup(__props, { emit: __emit }) {
|
|
const formFields = reactive({});
|
|
const formRef = ref();
|
|
const config = useConfigStore();
|
|
const sheetRef = ref(null);
|
|
const props = __props;
|
|
const emits = __emit;
|
|
const addForm = () => {
|
|
Object.assign(formFields, {
|
|
title: ""
|
|
});
|
|
};
|
|
const editForm = () => {
|
|
console.log(props.data);
|
|
Object.assign(formFields, props.data);
|
|
};
|
|
const handleSubmit = async () => {
|
|
formRef.value.validateFields().then(async () => {
|
|
try {
|
|
loading.value = true;
|
|
formFields.order_id = props.orderId;
|
|
if (props.isEdit && props.data) {
|
|
const data = props.data;
|
|
await updateStatus(data.id, formFields);
|
|
emits("update:isEdit", false);
|
|
api$1.success(config.useString("editedSuccessfully"));
|
|
} else {
|
|
await createStatus(formFields);
|
|
api$1.success(config.useString("addedSuccessfully"));
|
|
}
|
|
emits("update:visible", false);
|
|
emits("success");
|
|
await closeSheet();
|
|
} catch (e) {
|
|
loading.value = false;
|
|
console.log("error", e);
|
|
}
|
|
});
|
|
};
|
|
watch(props, (value) => {
|
|
if (value.open) {
|
|
openSheet();
|
|
} else {
|
|
closeSheet();
|
|
}
|
|
if (props.isEdit) {
|
|
editForm();
|
|
} else {
|
|
addForm();
|
|
}
|
|
});
|
|
async function openSheet() {
|
|
await nextTick();
|
|
await sheetRef.value?.setOpen();
|
|
}
|
|
async function closeSheet() {
|
|
await nextTick();
|
|
await sheetRef.value?.setClose();
|
|
emits("update:open", false);
|
|
}
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
const _component_a_form = Form;
|
|
const _component_a_form_item = __nuxt_component_1$3;
|
|
_push(ssrRenderComponent(BasicSheet, mergeProps({
|
|
title: "",
|
|
ref_key: "sheetRef",
|
|
ref: sheetRef,
|
|
headerCls: "",
|
|
closeOnClickOutside: "",
|
|
onOnClickOutside: ($event) => emits("update:open", false),
|
|
onOnClose: ($event) => emits("update:open", false)
|
|
}, _attrs), {
|
|
header: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`<div flex justify-center items-center flex-col p-2 data-v-29f95169${_scopeId}><div bg-gray-500 h-2px w-2.5rem data-v-29f95169${_scopeId}></div><div class="flex justify-center" data-v-29f95169${_scopeId}><div mt-3 font-semibold data-v-29f95169${_scopeId}>${ssrInterpolate(_ctx.isEdit ? unref(config).useString("editStatus") : unref(config).useString("addStatus"))}</div><div class="absolute end-0" data-v-29f95169${_scopeId}>`);
|
|
_push2(ssrRenderComponent(_sfc_main$5, {
|
|
class: "w-1rem mt-2 me-5",
|
|
onClick: closeSheet
|
|
}, null, _parent2, _scopeId));
|
|
_push2(`</div></div></div>`);
|
|
} else {
|
|
return [
|
|
createVNode("div", {
|
|
flex: "",
|
|
"justify-center": "",
|
|
"items-center": "",
|
|
"flex-col": "",
|
|
"p-2": ""
|
|
}, [
|
|
createVNode("div", {
|
|
"bg-gray-500": "",
|
|
"h-2px": "",
|
|
"w-2.5rem": ""
|
|
}),
|
|
createVNode("div", { class: "flex justify-center" }, [
|
|
createVNode("div", {
|
|
"mt-3": "",
|
|
"font-semibold": ""
|
|
}, toDisplayString(_ctx.isEdit ? unref(config).useString("editStatus") : unref(config).useString("addStatus")), 1),
|
|
createVNode("div", { class: "absolute end-0" }, [
|
|
createVNode(_sfc_main$5, {
|
|
class: "w-1rem mt-2 me-5",
|
|
onClick: closeSheet
|
|
})
|
|
])
|
|
])
|
|
])
|
|
];
|
|
}
|
|
}),
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`<div class="max-h-85vh overflow-y-auto px-2 mt3 pb-10" data-v-29f95169${_scopeId}>`);
|
|
_push2(ssrRenderComponent(_component_a_form, {
|
|
model: formFields,
|
|
ref_key: "formRef",
|
|
ref: formRef
|
|
}, {
|
|
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
if (_push3) {
|
|
_push3(ssrRenderComponent(_component_a_form_item, {
|
|
label: unref(config).useString("title"),
|
|
name: "title"
|
|
}, {
|
|
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
|
|
if (_push4) {
|
|
_push4(ssrRenderComponent(BasicInput, {
|
|
value: formFields.title,
|
|
"onUpdate:value": ($event) => formFields.title = $event,
|
|
"place-holder": unref(config).useString("title")
|
|
}, null, _parent4, _scopeId3));
|
|
} else {
|
|
return [
|
|
createVNode(BasicInput, {
|
|
value: formFields.title,
|
|
"onUpdate:value": ($event) => formFields.title = $event,
|
|
"place-holder": unref(config).useString("title")
|
|
}, null, 8, ["value", "onUpdate:value", "place-holder"])
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent3, _scopeId2));
|
|
} else {
|
|
return [
|
|
createVNode(_component_a_form_item, {
|
|
label: unref(config).useString("title"),
|
|
name: "title"
|
|
}, {
|
|
default: withCtx(() => [
|
|
createVNode(BasicInput, {
|
|
value: formFields.title,
|
|
"onUpdate:value": ($event) => formFields.title = $event,
|
|
"place-holder": unref(config).useString("title")
|
|
}, null, 8, ["value", "onUpdate:value", "place-holder"])
|
|
]),
|
|
_: 1
|
|
}, 8, ["label"])
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent2, _scopeId));
|
|
_push2(ssrRenderComponent(BasicButton, {
|
|
type: "primary",
|
|
block: "",
|
|
onClick: handleSubmit
|
|
}, {
|
|
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
if (_push3) {
|
|
_push3(`${ssrInterpolate(unref(config).useString("submit"))}`);
|
|
} else {
|
|
return [
|
|
createTextVNode(toDisplayString(unref(config).useString("submit")), 1)
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent2, _scopeId));
|
|
_push2(`</div>`);
|
|
} else {
|
|
return [
|
|
createVNode("div", { class: "max-h-85vh overflow-y-auto px-2 mt3 pb-10" }, [
|
|
createVNode(_component_a_form, {
|
|
model: formFields,
|
|
ref_key: "formRef",
|
|
ref: formRef
|
|
}, {
|
|
default: withCtx(() => [
|
|
createVNode(_component_a_form_item, {
|
|
label: unref(config).useString("title"),
|
|
name: "title"
|
|
}, {
|
|
default: withCtx(() => [
|
|
createVNode(BasicInput, {
|
|
value: formFields.title,
|
|
"onUpdate:value": ($event) => formFields.title = $event,
|
|
"place-holder": unref(config).useString("title")
|
|
}, null, 8, ["value", "onUpdate:value", "place-holder"])
|
|
]),
|
|
_: 1
|
|
}, 8, ["label"])
|
|
]),
|
|
_: 1
|
|
}, 8, ["model"]),
|
|
createVNode(BasicButton, {
|
|
type: "primary",
|
|
block: "",
|
|
onClick: handleSubmit
|
|
}, {
|
|
default: withCtx(() => [
|
|
createTextVNode(toDisplayString(unref(config).useString("submit")), 1)
|
|
]),
|
|
_: 1
|
|
})
|
|
])
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
};
|
|
}
|
|
});
|
|
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("components/StatusAddEdit.vue");
|
|
return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
|
|
};
|
|
const StatusAddEdit = /* @__PURE__ */ Object.assign(_export_sfc(_sfc_main$3, [["__scopeId", "data-v-29f95169"]]), { __name: "StatusAddEdit" });
|
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
__name: "OrderDetail",
|
|
__ssrInlineRender: true,
|
|
setup(__props) {
|
|
const router = useRouter$1();
|
|
const order = ref(null);
|
|
const showMore = ref(false);
|
|
const visible = ref(false);
|
|
const isEdit = ref(false);
|
|
const userStore = useUserStore();
|
|
const data = ref({});
|
|
const orderStatus = ref([]);
|
|
const id = computed(() => {
|
|
return parseInt(router.currentRoute.value.params.id);
|
|
});
|
|
const config = useConfigStore();
|
|
const address = computed(() => {
|
|
if (order.value) {
|
|
const convert = order.value?.address?.payload;
|
|
return `${convert?.province ?? ""}-${convert?.city ?? ""}-${convert?.address ?? ""}`;
|
|
} else {
|
|
return "";
|
|
}
|
|
});
|
|
const getOrder = async () => {
|
|
try {
|
|
loading.value = true;
|
|
order.value = await getOneOrder(id.value);
|
|
orderStatus.value = order.value?.orders_status?.map((x) => {
|
|
return {
|
|
title: x.title,
|
|
description: toJalali(x.created_at ?? "_")
|
|
};
|
|
});
|
|
} catch (e) {
|
|
console.log(e);
|
|
} finally {
|
|
loading.value = false;
|
|
}
|
|
};
|
|
computed(() => {
|
|
return usePrice(order.value?.total_price + (order.value?.profit ?? 0), true, "");
|
|
});
|
|
computed(() => {
|
|
return usePrice(order.value?.profit ?? 0, true, "");
|
|
});
|
|
computed(() => {
|
|
return usePrice(order.value?.total_price, true, "");
|
|
});
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
const _component_a_divider = __nuxt_component_4;
|
|
const _component_a_steps = __nuxt_component_1$1;
|
|
const _directive_lazy = resolveDirective("lazy");
|
|
let _temp0, _temp1;
|
|
_push(`<div${ssrRenderAttrs(mergeProps({ class: "pb-10vh" }, _attrs))}><div class="mx-3"><div class="flex items-center mb-5 mt-2 gap-3"><img${ssrRenderAttrs(_temp0 = mergeProps({
|
|
alt: "instagram",
|
|
class: "w-3rem aspect-square rounded-full"
|
|
}, ssrGetDirectiveProps(_ctx, _directive_lazy, { src: unref(getSupabaseStorageUrl)(order.value?.store?.avatar ?? ""), loading: unref(empty_user), error: unref(empty_user) })))}>${"textContent" in _temp0 ? ssrInterpolate(_temp0.textContent) : _temp0.innerHTML ?? ""}<div class="h-full"><div class="font-bold">${ssrInterpolate(order.value?.store?.name ?? "")}</div><div class="text-sm text-gray-4">${ssrInterpolate(unref(config).useString("seller"))}</div></div></div></div><div class="mx-3 mt-10"><div class="flex items-center mb-5 mt-2 gap-3"><img${ssrRenderAttrs(_temp1 = mergeProps({
|
|
alt: "instagram",
|
|
class: "w-3rem aspect-square rounded-full"
|
|
}, ssrGetDirectiveProps(_ctx, _directive_lazy, { src: unref(getSupabaseStorageUrl)(order.value?.user?.avatar ?? ""), loading: unref(empty_user), error: unref(empty_user) })))}>${"textContent" in _temp1 ? ssrInterpolate(_temp1.textContent) : _temp1.innerHTML ?? ""}<div class="h-full"><div class="font-bold">${ssrInterpolate(order.value?.user?.name ?? "")}</div><div class="text-sm text-gray-4">${ssrInterpolate(order.value?.user?.phone)}</div><div class="text-sm text-gray-4">${ssrInterpolate(unref(config).useString("customer"))}</div></div></div></div>`);
|
|
_push(ssrRenderComponent(_component_a_divider, null, null, _parent));
|
|
_push(`<div class="mx-3"><div class="font-semibold text-xl mb-5">${ssrInterpolate(unref(config).useString("orderSummery"))}</div>`);
|
|
if (!showMore.value) {
|
|
_push(`<div><!--[-->`);
|
|
ssrRenderList(order.value?.order_items?.slice(0, 3), (item, index) => {
|
|
_push(ssrRenderComponent(ProductCard, {
|
|
key: item.product.id,
|
|
item,
|
|
isLast: (order.value?.order_items?.length ?? 0) < 3 ? (order.value?.order_items?.length ?? 0) - 1 === index : index === 2
|
|
}, null, _parent));
|
|
});
|
|
_push(`<!--]--></div>`);
|
|
} else {
|
|
_push(`<div><!--[-->`);
|
|
ssrRenderList(order.value?.order_items, (item, index) => {
|
|
_push(ssrRenderComponent(ProductCard, {
|
|
key: item.product.id,
|
|
item,
|
|
isLast: (order.value?.order_items?.length ?? 0) - 1 === index
|
|
}, null, _parent));
|
|
});
|
|
_push(`<!--]--></div>`);
|
|
}
|
|
if ((order.value?.order_items?.length ?? 0) > 3) {
|
|
_push(`<div class="w-full mt-5 text-end">`);
|
|
if (showMore.value) {
|
|
_push(ssrRenderComponent(BasicButton, {
|
|
onClick: ($event) => showMore.value = !showMore.value,
|
|
size: "small"
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`${ssrInterpolate(unref(config).useString("less"))}`);
|
|
} else {
|
|
return [
|
|
createTextVNode(toDisplayString(unref(config).useString("less")), 1)
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
} else {
|
|
_push(ssrRenderComponent(BasicButton, {
|
|
onClick: ($event) => showMore.value = !showMore.value,
|
|
size: "small"
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(`${ssrInterpolate(unref(config).useString("more"))}`);
|
|
} else {
|
|
return [
|
|
createTextVNode(toDisplayString(unref(config).useString("more")), 1)
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
}
|
|
_push(`</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div>`);
|
|
_push(ssrRenderComponent(_component_a_divider, null, null, _parent));
|
|
_push(`<div class="mx-3"><div class="font-semibold text-xl mb-5">${ssrInterpolate(unref(config).useString("paymentDetail"))}</div><div><div class="flex justify-between items-baseline"><div class="text-sm">${ssrInterpolate(unref(config).useString("totalPrice"))}:</div><div class="flex gap-1 items-baseline"><div class="font-bold">${ssrInterpolate(unref(usePrice)(order.value?.total_price ?? 0, true, ""))}</div><div class="text-xs">${ssrInterpolate(unref(config).priceUnit)}</div></div></div><div class="flex justify-between items-baseline mt-2"><div class="text-sm">${ssrInterpolate(unref(config).useString("totalItems"))}:</div><div class="flex gap-1 items-baseline"><div class="font-bold">${ssrInterpolate(order.value?.total_qty ?? 0)}</div><div class="text-xs">${ssrInterpolate(unref(config).useString("countProducts"))}</div></div></div>`);
|
|
if (order.value?.sum_gold !== 0) {
|
|
_push(`<div class="flex justify-between items-baseline mt-2"><div class="text-sm">${ssrInterpolate(unref(config).useString("totalGoldWeight"))}:</div><div class="flex gap-1 items-baseline"><div class="font-bold">${ssrInterpolate(order.value?.sum_gold)}</div><div class="text-xs">${ssrInterpolate(unref(config).useString("gram"))}</div></div></div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
if (order.value?.sum_silver !== 0) {
|
|
_push(`<div class="flex justify-between items-baseline mt-2"><div class="text-sm">${ssrInterpolate(unref(config).useString("totalSilverWeight"))}:</div><div class="flex gap-1 items-baseline"><div class="font-bold">${ssrInterpolate(order.value?.sum_silver)}</div><div class="text-xs">${ssrInterpolate(unref(config).useString("gram"))}</div></div></div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`<div class="flex justify-between items-baseline mt-2"><div class="text-sm">${ssrInterpolate(unref(config).useString("profit"))}:</div><div class="flex gap-1 items-baseline"><div class="font-bold">${ssrInterpolate(unref(usePrice)(order.value?.total_discounts ?? 0, true, ""))}</div><div class="text-xs">${ssrInterpolate(unref(config).priceUnit)}</div></div></div></div><div class="flex flex-col items-center mt-5"><div>${ssrInterpolate(unref(config).useString("amountPaid"))}</div><div class="flex gap-1 items-baseline mt-2"><span class="font-bold text-xl">${ssrInterpolate(unref(usePrice)(order.value?.discount_total_price ?? 0, true, ""))}</span><span>${ssrInterpolate(unref(config).priceUnit)}</span></div></div></div>`);
|
|
_push(ssrRenderComponent(_component_a_divider, null, null, _parent));
|
|
_push(`<div class="mx-3"><div class="font-semibold text-xl mb-5">${ssrInterpolate(unref(config).useString("address"))}</div><div class="text-xs">${ssrInterpolate(address.value)}</div></div>`);
|
|
_push(ssrRenderComponent(_component_a_divider, null, null, _parent));
|
|
_push(`<div class="mx-3"><div class="font-semibold text-xl mb-5">${ssrInterpolate(unref(config).useString("status"))}</div>`);
|
|
_push(ssrRenderComponent(_component_a_steps, {
|
|
direction: "vertical",
|
|
size: "small",
|
|
current: orderStatus.value.length - 1,
|
|
items: orderStatus.value
|
|
}, null, _parent));
|
|
if (unref(config).isSeller && order.value?.store_id === unref(userStore).user?.id) {
|
|
_push(`<div class="flex items-center"><div class="rounded-full p-1 bg-primary">`);
|
|
_push(ssrRenderComponent(BasicIconOld, {
|
|
icon: "vuesax-linear:add",
|
|
"color-white": "",
|
|
size: "17"
|
|
}, null, _parent));
|
|
_push(`</div><div class="text-xs ms-4">${ssrInterpolate(unref(config).useString("addStatus"))}</div></div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div>`);
|
|
_push(ssrRenderComponent(StatusAddEdit, {
|
|
open: visible.value,
|
|
"onUpdate:open": ($event) => visible.value = $event,
|
|
"is-edit": isEdit.value,
|
|
"onUpdate:isEdit": ($event) => isEdit.value = $event,
|
|
data: data.value,
|
|
onSuccess: getOrder,
|
|
"order-id": id.value
|
|
}, null, _parent));
|
|
_push(`</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/OrderDetail.vue");
|
|
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
|
|
};
|
|
const OrderDetail = Object.assign(_sfc_main$2, { __name: "OrderDetail" });
|
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
__name: "index",
|
|
__ssrInlineRender: true,
|
|
setup(__props) {
|
|
const router = useRouter$1();
|
|
ref(null);
|
|
computed(() => {
|
|
return parseInt(router.currentRoute.value.params.id);
|
|
});
|
|
const config = useConfigStore();
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
_push(`<div${ssrRenderAttrs(_attrs)}><div class="${ssrRenderClass([!unref(config).isNightStore ? "bg-header-color" : "bg-header-color-dark ", "sticky z-10 top-0 w-inherit right-0 left-0"])}"><div class="flex justify-between w-full p-4"><div class="flex items-center gap-4">`);
|
|
_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-xl">${ssrInterpolate(unref(config).useString("orderDetail"))}</div></div></div></div>`);
|
|
_push(ssrRenderComponent(OrderDetail, null, null, _parent));
|
|
_push(`</div>`);
|
|
};
|
|
}
|
|
});
|
|
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("views/base/pages/user/order/index.vue");
|
|
return _sfc_setup$1 ? _sfc_setup$1(props, 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 = (props, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/user/order/[id].vue");
|
|
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
};
|
|
|
|
export { _sfc_main as default };
|
|
//# sourceMappingURL=_id_-CjGI2ICL.mjs.map
|