From f4facb8b6fc76b70c3dcd13934c2aa88c0153e5b Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Fri, 15 Mar 2024 11:26:42 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E8=B0=83=E6=95=B4=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/test.js | 12 +++--- src/pages/plan/message/index.jsx | 66 +++++++++++++++++++------------ src/pages/plan/message/index.less | 9 +++++ 3 files changed, 56 insertions(+), 31 deletions(-) diff --git a/scripts/test.js b/scripts/test.js index e6ae8cfc..195cf2dc 100644 --- a/scripts/test.js +++ b/scripts/test.js @@ -3,14 +3,14 @@ process.env.BABEL_ENV = "test" process.env.NODE_ENV = "test" // 测试 -// process.env.BASE_URL = "http://test.marketapi.1688sup.com" -// process.env.UNIFIED_API = "http://api.test.user.1688sup.com/v1" -// process.env.UNIFIED_URL = "http://test.user.1688sup.com/#/login" +process.env.BASE_URL = "http://test.marketapi.1688sup.com" +process.env.UNIFIED_API = "http://api.test.user.1688sup.com/v1" +process.env.UNIFIED_URL = "http://test.user.1688sup.com/#/login" // 镜像 -process.env.BASE_URL = "http://pre.marketapi.1688sup.com" -process.env.UNIFIED_API = "http://api.gray.user.1688sup.com/v1" -process.env.UNIFIED_URL = "http://gray.user.1688sup.com/#/login" +// process.env.BASE_URL = "http://pre.marketapi.1688sup.com" +// process.env.UNIFIED_API = "http://api.gray.user.1688sup.com/v1" +// process.env.UNIFIED_URL = "http://gray.user.1688sup.com/#/login" // Makes the script crash on unhandled rejections instead of silently // ignoring them. In the future, promise rejections that are not handled will diff --git a/src/pages/plan/message/index.jsx b/src/pages/plan/message/index.jsx index 7359bc1c..43ba0122 100644 --- a/src/pages/plan/message/index.jsx +++ b/src/pages/plan/message/index.jsx @@ -2,7 +2,8 @@ import Grid from "@/components/gird/main.js" import Ipt from "@/components/input/main" import TabPage from "@/components/tabPage/main.js" import { cloneDeep } from "lodash-es" -import { useEffect, useState } from "react" +import { useEffect } from "react" +import { useSetState } from "ahooks" import { Button } from "zent" import "./index.less" import { getClientPrompt } from "@/assets/api.js" @@ -13,7 +14,7 @@ const data = [ defaultPrompt: "还没开始哟,兑换时间为${开始时间}至${结束时间}", customizePrompt: "", typeText: "通用", - variables: "开始时间,结束时间", + variables: "开始时间:${start_time},结束时间:${end_time}", readOnly: true }, { @@ -101,7 +102,7 @@ export default function Message() { title: "可用变量", name: "variables", prop: "variables", - type: "normal", + type: "slot", width: "200px" }, { @@ -114,12 +115,13 @@ export default function Message() { { title: "定制提示", prop: "customizePrompt", + name: "customizePrompt", type: "slot", width: "520px" } ] - const [state, setState] = useState({ + const [state, setState] = useSetState({ tableData: [], backupTableData: [], tabs: [{ title: "提示列表" }], @@ -128,7 +130,6 @@ export default function Message() { useEffect(() => { setState({ - ...state, tableData: cloneDeep(data), backupTableData: cloneDeep(data) }) @@ -162,26 +163,41 @@ export default function Message() { Column={Column} maxheight={670} ComponentHandler={(com, rowData) => { - return ( - { - rowData.customizePrompt = e - setState({ ...state }) - }} - onClearItem={() => { - rowData.customizePrompt = "" - setState({ ...state }) - }} - value={rowData.customizePrompt} - placeholder="请输入(请勿输入过长文案,以防C端弹窗展示异常,变量使用${xxxx}格式。)" - labelWidth={"0px"} - countShow={false} - disabled={rowData.readOnly} - height={"36px"} - width={"400px"} - alignment={"left"} - /> - ) + if (com === "customizePrompt") { + return ( + { + rowData.customizePrompt = e + setState({ ...state }) + }} + onClearItem={() => { + rowData.customizePrompt = "" + setState({ ...state }) + }} + value={rowData.customizePrompt} + placeholder="请输入(请勿输入过长文案,以防C端弹窗展示异常,变量使用 ${xx} 格式。)" + labelWidth={"0px"} + countShow={false} + disabled={rowData.readOnly} + height={"36px"} + width={"400px"} + alignment={"left"} + /> + ) + } + + if (com === "variables") { + return ( +
+

+ 开始时间: {"${start_time}"} +

+

+ 结束时间: {"${end_time}"} +

+
+ ) + } }} /> diff --git a/src/pages/plan/message/index.less b/src/pages/plan/message/index.less index 7342103c..d294f0d0 100644 --- a/src/pages/plan/message/index.less +++ b/src/pages/plan/message/index.less @@ -10,4 +10,13 @@ margin-top: 10px; margin-bottom: 20px; } + + .variable { + color: #b5b5b5; + margin-bottom: 5px; + + span { + color: red + } + } } \ No newline at end of file