feat: 能力插件元数据与运行时消费闭环
This commit is contained in:
1 parent
076c6124c8
commit
bb0709b8cc
26 files changed
+2188
-267
No files matched your search
@@ -11,6 +11,7 @@ import {
|
||||
text,
|
||||
rows,
|
||||
} from "../../../apps/taro/src/runtime/content";
|
||||
import { inquiryPluginState, pluginStateText } from "../../../apps/taro/src/runtime/plugins";
|
||||
import "./style.css";
|
||||
function Home({ workspace }: { workspace: RuntimeWorkspace }) {
|
||||
const b = workspace.brand;
|
||||
@@ -277,7 +278,16 @@ function List({ workspace }: { workspace: RuntimeWorkspace }) {
|
||||
</View>
|
||||
))}
|
||||
<Text className="subtitle">{p.closingText}</Text>
|
||||
{p.closingAction && <Button onClick={() => navigate("inquiry")}>{p.closingAction}</Button>}
|
||||
{p.closingAction &&
|
||||
(inquiryPluginState(workspace).enabled ? (
|
||||
<Button onClick={() => navigate("inquiry")}>
|
||||
{pluginStateText(workspace, "inquiry", "entryLabel") || p.closingAction}
|
||||
</Button>
|
||||
) : (
|
||||
<Text>
|
||||
{inquiryPluginState(workspace).disabledHint || `${p.closingAction}暂不可用`}
|
||||
</Text>
|
||||
))}
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
@@ -366,9 +376,13 @@ function Detail({ workspace, id }: { workspace: RuntimeWorkspace; id?: string })
|
||||
</View>
|
||||
</View>
|
||||
<View className="bar" data-editor-target="linjing-editorial.detail.action">
|
||||
<Button onClick={() => navigate("inquiry", { offeringId: item.id })}>
|
||||
{p.inquiryAction}
|
||||
</Button>
|
||||
{inquiryPluginState(workspace).enabled ? (
|
||||
<Button onClick={() => navigate("inquiry", { offeringId: item.id })}>
|
||||
{pluginStateText(workspace, "inquiry", "entryLabel") || p.inquiryAction || "咨询"}
|
||||
</Button>
|
||||
) : (
|
||||
<Text>{inquiryPluginState(workspace).disabledHint || "咨询暂不可用"}</Text>
|
||||
)}
|
||||
<Text>{p.inquiryHint}</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
Reference in new issue
Block a user