feat: recycle system
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
:z-index="20"
|
||||
title="邀请客户"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
@left-click="goBack"
|
||||
/>
|
||||
<main class="tui-page-content scroll column list">
|
||||
<div class="pull-refresh">
|
||||
@@ -93,7 +93,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { BottomPopup } from "timi-tdesign-mobile";
|
||||
import { BottomPopup, usePane } from "timi-tdesign-mobile";
|
||||
import { Message } from "@/utils/message";
|
||||
import { useUserStore } from "timi-web-api";
|
||||
import CustomerAPI from "@/api/CustomerAPI";
|
||||
@@ -109,6 +109,8 @@ defineOptions({
|
||||
});
|
||||
|
||||
const route = useRoute();
|
||||
const props = withDefaults(defineProps<{ customerId?: string }>(), { customerId: "" });
|
||||
const pane = usePane();
|
||||
const router = useRouter();
|
||||
const settingStore = useSettingStore();
|
||||
const userStore = useUserStore();
|
||||
@@ -125,10 +127,15 @@ let latestDecodedText = "";
|
||||
|
||||
const canUpdateCustomer = computed(() => userStore.hasPermissions(permissionCodes.customer.update));
|
||||
|
||||
function goBack(): void {
|
||||
if (pane) pane.close();
|
||||
else void router.back();
|
||||
}
|
||||
|
||||
// ---------- 加载 ----------
|
||||
|
||||
async function loadCustomer(): Promise<void> {
|
||||
const customerId = String(route.params.id || "");
|
||||
const customerId = props.customerId || String(route.params.id || "");
|
||||
if (!customerId) {
|
||||
customer.value = undefined;
|
||||
invitees.value = [];
|
||||
@@ -271,7 +278,7 @@ async function toCustomerDetail(target: Customer): Promise<void> {
|
||||
}
|
||||
|
||||
onMounted(loadCustomer);
|
||||
watch(() => route.params.id, loadCustomer);
|
||||
watch(() => [props.customerId, route.params.id], loadCustomer);
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
|
||||
Reference in New Issue
Block a user