Skip to content

Commit

Permalink
Merge branch 'main' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
YongZL committed Sep 28, 2023
2 parents 15a8aa7 + df51830 commit 01a81d8
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 56 deletions.
10 changes: 2 additions & 8 deletions components/common/DivText.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import classNames from "classnames";
import { FC } from "react";
import { handleContentRender } from "utils";

interface TextType {
textArray: { text: string; value: string | number; link?: string }[];
Expand All @@ -12,7 +11,7 @@ const DivText: FC<TextType> = ({ textArray = [] }) => {
{textArray.length &&
textArray.map((item, key) => {
return (
<div key={`text_${key}`} className="lg:mb-[4px] mo:mb-1 md:mb-4 sm:truncate sm:max-w-[25rem]">
<div key={`text_${key}`} className="lg:mb-[4px] mo:mb-1 md:mb-2 ]">
<span className=" font-bold leading-7 text-[#000000] text-[16px] ">{item.text}</span>
{item.link ? (
<a
Expand All @@ -26,12 +25,7 @@ const DivText: FC<TextType> = ({ textArray = [] }) => {
{item.value}
</a>
) : (
<span
data-tooltip-id="tooltip"
data-tooltip-content={handleContentRender(item.value, 14)}
className=" font-normal text-[#666666] text-[16px] ">
{item.value}
</span>
<span className=" font-normal text-[#666666] text-[16px] ">{item.value}</span>
)}
</div>
);
Expand Down
8 changes: 3 additions & 5 deletions components/common/productQrcode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import QRCode from "qrcode.react";

export function ProductQrcode(p: any) {
const { qrText, className, qrcodeDisable, data, orgName, name = "Certified" } = p;
console.log("data", data);

return (
<div className={classNames("", className)}>
<div className="p-1 border-[4px] border-green-2 rounded-[2.25rem]">
Expand All @@ -19,11 +21,7 @@ export function ProductQrcode(p: any) {
<p className="text-[0.6875rem] text-center mb-2 leading-[0.945rem] font-semibold mo:leading-[0.865rem]">
{qrText ? qrText : `Product Carbon Footprint ${name} `}
</p>
{qrcodeDisable ? (
<img className="w-[5.75rem]" src={"/disable_qrcode.svg"} alt="" />
) : (
<QRCode className="w-[5.75rem]" size={92} value={data} />
)}
<QRCode className="w-[5.75rem]" size={92} value={data} />
</div>
</div>
</div>
Expand Down
4 changes: 1 addition & 3 deletions components/routes/blockchain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,7 @@ export function Blockchain() {
<ProductQrcode
className=""
name={name}
data={`${
current || "https://aicp.gtech-cn.co"
}/car?vin=${"b5387977-9615-4528-aa14-7fbcd7b51ba5-1695716134"}`}
data={`${current || "https://aicp.gtech.world"}/car?vin=${sbtTagList?.uuid}`}
/>
</div>
<div className="flex flex-col flex-1 ml-5 mo:ml-0 mo:mt-5">
Expand Down
14 changes: 8 additions & 6 deletions components/routes/car.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -413,22 +413,24 @@ export function Car() {
return (
<Fragment>
<div className="flex w-full gap-5 mo:flex-none mo:flex-col ">
<div className="w-[420px] max-h-[380px] mo:h-[110px] bg-[#FFFFFF] flex justify-center mo:justify-start mo:flex-row mo:w-full flex-col items-center rounded-lg ">
<SVGCarbon3 className="text-[5.375rem] w-[5.375rem] mt-[.625rem] mb-5 mo:mb-2 mo:ml-[15px]" />
<div className="mo:ml-[2.5rem]">
<div className="text-[#29953A] text-[1.75rem] leading-8 font-semibold">{dealResult(pcfResult)}</div>
<div className="w-[420px] max-h-[450px] p-5 mo:h-auto bg-[#FFFFFF] text-center flex justify-center mo:justify-start mo:flex-row mo:w-full flex-col items-center rounded-lg ">
<SVGCarbon3 className="text-[5.375rem] w-[5.375rem] mt-[.625rem] mb-5 mo:mb-2 shrink-0" />
<div className="mo:ml-[2.5rem] mo:flex-1 ">
<div className="text-[#29953A] text-[1.75rem] leading-8 font-semibold max-w-full break-all">
{pcfResult}
</div>
<div className="font-[1.75rem] leading-8 ">二氧化碳等效排放</div>
</div>
</div>
<div className="w-[420px] mo:w-full max-h-[380px] bg-[#FFFFFF] mo:max-h-[350px] rounded-lg">
<div className="w-[420px] mo:w-full max-h-[450px] bg-[#FFFFFF] mo:max-h-[350px] rounded-lg">
<div className="mx-5 mt-5 mb-5 mmd:mt-10">
<div className="mb-5 mo:mb-[15px] md:text-[18px] font-bold mo:text-[18px] text-[20px] leading-7">
产品信息
</div>
<DivText textArray={productInfo} />
</div>
</div>
<div className="w-[420px] mo:w-full max-h-[380px] bg-[#FFFFFF] mo:max-h-[350px] rounded-lg">
<div className="w-[420px] mo:w-full max-h-[450px] bg-[#FFFFFF] mo:max-h-[350px] rounded-lg">
<div className="mx-5 mt-5 mb-5 mmd:mt-10">
<div className="mb-5 mo:mb-[15px] md:text-[18px] font-bold mo:text-[18px] text-[20px] leading-7">
产品碳足迹评价信息
Expand Down
34 changes: 2 additions & 32 deletions components/routes/carbon/tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,35 +53,6 @@ function Card(p: {
);
}

const tagData = [
{
title: "完成[AT01]系列培训-双碳基础 认证",
icon: <SvgTeacher className="w-[2.75rem]" />,
by: "2023年4月30日签发 by AIAG",
id: "144095402",
qrcodeDisable: true,
link: [
{ text: "标签信息", href: "" },
{ text: "在区块链浏览器查看", target: "", href: "" },
],
},
{
title: "完成[AI09]产品碳足迹测算",
icon: <SvgTeacher className="w-[2.75rem]" />,
by: "2023年4月30日签发 by AIAG",
id: "144049913",
qrcodeDisable: false,
link: [
{ text: "标签信息", href: "/car?vin=1500101202311001" },
{
text: "在区块链浏览器查看",
target: "_blank",
href: "/blockchain?tokenId=1000000",
},
],
},
];

export function Tag() {
const [tagList, setTagList] = useState<SbtTokenController.Records>();
const [current, setCurrent] = useState("");
Expand All @@ -108,7 +79,7 @@ export function Tag() {
],
tokenId,
orgName,
qrCode: `${current || "https://aicp.gtech-cn.co"}/car?vin=${uuid}`,
qrCode: `${current || "https://aicp.gtech.world"}/car?vin=${uuid}`,
};
},
) as any;
Expand All @@ -120,15 +91,14 @@ export function Tag() {
setCurrent(window?.location?.origin);
}, []);

console.log("current", current);
console.log("current", tagList);

return (
<CarbonLayout className="h-full bg-gray-16">
<div className="flex flex-wrap">
{(tagList?.records || []).map((v: any, i) => {
return <Card key={`tagData${i}`} data={v} />;
})}
{`${current || "https://aicp.gtech-cn.co"}/car?vin=`}
</div>
</CarbonLayout>
);
Expand Down
4 changes: 2 additions & 2 deletions components/routes/tools/inventoryResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ export function InventoryResult() {
<Loading />
</div>
) : (
<div className="pt-8 mo:break-all w-full max-w-[1000px] mx-auto" id="inventory-result-content">
<div className="grid grid-cols-2 gap-5 mo:grid-cols-1">
<div className="pt-8 mo:break-all w-full max-w-[1000px] mx-auto">
<div className="grid grid-cols-2 gap-5 mo:grid-cols-1" id="inventory-result-content">
<MCard tit="产品碳足迹">
<div className="flex items-center flex-1 px-9 mb-9">
<CarbonFooter />
Expand Down

0 comments on commit 01a81d8

Please sign in to comment.