From 5c7db1551fe4dd3fd4592f015670395851eac3c9 Mon Sep 17 00:00:00 2001 From: Mylio Date: Thu, 17 Feb 2022 15:13:16 +0800 Subject: [PATCH] fix: custom order owner field display --- .../AdminResource/AdminOrderDetailForm.js | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/Generators/AdminResource/AdminOrderDetailForm.js b/src/Generators/AdminResource/AdminOrderDetailForm.js index b659a2ef..6cef6efe 100644 --- a/src/Generators/AdminResource/AdminOrderDetailForm.js +++ b/src/Generators/AdminResource/AdminOrderDetailForm.js @@ -15,6 +15,7 @@ import CartList from 'rev.sdk.js/Components/CartList'; import * as JStorage from 'rev.sdk.js/Actions/JStorage'; import * as Cart from 'rev.sdk.js/Actions/Cart'; import {useOutlet} from 'reconnect.js'; +import {Open} from '@styled-icons/ionicons-outline/Open'; const {Panel} = Collapse; function Filed(props) { @@ -142,6 +143,22 @@ function CustomAdminOrderDetailForm(props) { } }, [actions, values.id]); + const openCustomOrderOwnerInfo = async (ownerId) => { + try { + actions.setLoading(true); + console.log('ownerId >', ownerId); + let user = await JStorage.fetchOneDocument('user_profile', { + owner: ownerId, + }); + window.open(`/admin/users/?action=detail&id=${user.id}`); + } catch (err) { + console.log(err); + message.warn('無法取得此客戶資訊'); + } finally { + actions.setLoading(false); + } + }; + return (
{values.payment_subtype === Cart.PAYMENT_SUBTYPE.offline && ( @@ -187,7 +204,20 @@ function CustomAdminOrderDetailForm(props) { {instance.is_custom ? (
- +
+
+ {' '} + +
+ +
) : (