From 925f149a1ef4503f9bc8a14431653edffd86c4bc Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Mon, 15 Aug 2022 10:25:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8F=AF=E7=94=A8=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=AE=B5=E4=B8=AD=EF=BC=8C=E9=80=89=E6=8B=A9=E2=80=9C?= =?UTF-8?q?=E6=9C=89=E6=95=88=E6=9C=9F=E5=86=85=EF=BC=8C=E4=B8=8D=E8=A7=84?= =?UTF-8?q?=E5=88=99=E6=97=A5=E6=9C=9F=E5=8F=AF=E7=94=A8=E2=80=9D=E5=9C=A8?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E5=9B=BE=E4=B8=AD=E6=9C=AA=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E5=8F=AF=E7=94=A8=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/knockGold/index.less | 11 ++++ src/components/knockGold/mobileCmponent.jsx | 69 ++++++++++++++++----- 2 files changed, 63 insertions(+), 17 deletions(-) diff --git a/src/components/knockGold/index.less b/src/components/knockGold/index.less index c6baa80a..4f484d03 100644 --- a/src/components/knockGold/index.less +++ b/src/components/knockGold/index.less @@ -32,11 +32,22 @@ } .timeList { + display: grid; + grid-template-columns: repeat(3, 33.33%); + text-align: center; + li { margin: 3px 0; font-size: 12px; color: #a8a8a8; } + + } + + .flex { + display: grid; + grid-template-columns: repeat(2, 50%); + } } diff --git a/src/components/knockGold/mobileCmponent.jsx b/src/components/knockGold/mobileCmponent.jsx index 4885049b..dacd7265 100644 --- a/src/components/knockGold/mobileCmponent.jsx +++ b/src/components/knockGold/mobileCmponent.jsx @@ -2,7 +2,7 @@ * @Author: Wind * @Date: 2022-06-06 14:53:58 * @LastEditors: Wind - * @LastEditTime: 2022-08-12 17:41:52 + * @LastEditTime: 2022-08-15 10:23:22 * @Description: * @FilePath: \frontend\src\components\knockGold\mobileCmponent.jsx */ @@ -17,6 +17,56 @@ export default ({ data }) => { setNewWeek(sortWeeks(data.ruleWeek)) }, [data.ruleWeek]) + function createElement(type) { + { + /* irregularDate: [[]], //不规则日期 + irregularTime: [[]], //不规则时间 */ + } + if (data.usable_time === 'week') { + return ( +
+

可用时间

+ +
+ ) + } else if (data.usable_time === 'irregular') { + return ( +
+

可用时间

+ +
+ ) + } + } + return (
@@ -54,22 +104,7 @@ export default ({ data }) => {

- {data.batch_goods_name ? data.batch_goods_name : 'xxx'}兑换说明 -

- - {data.usable_time === 'week' ? ( -
-

可用时间

-
    - {newWeek?.map((item) => ( -
  • - {`${item}: - ${data.ruleDate.map((item1) => { - if (item1[1]) return `${item1[0]}~${item1[1]}` - })}`} -
  • - ))} -
-
- ) : null} + {createElement()} {data.instruction ? ( <>