Compare commits

...

7 Commits

Author SHA1 Message Date
Yang Luo
d44009f3d3 Update CartListPage.js 2026-02-13 10:15:03 +08:00
Yang Luo
b7a07c8556 Update CartListPage.js 2026-02-13 10:09:02 +08:00
copilot-swe-agent[bot]
b4ad6f1dc7 Optimize fallback timestamp creation in cart sorting
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
2026-02-13 01:43:57 +00:00
copilot-swe-agent[bot]
bc3502b315 Use moment().format() for cart item createdTime to match application format
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
2026-02-13 01:43:08 +00:00
copilot-swe-agent[bot]
eead095c2e Address code review feedback on timestamp comparison
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
2026-02-13 01:34:58 +00:00
copilot-swe-agent[bot]
cce7852694 Add CreatedTime field to cart items and implement sorting
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
2026-02-13 01:30:42 +00:00
copilot-swe-agent[bot]
76d3dd192b Initial plan 2026-02-13 01:27:37 +00:00
4 changed files with 10 additions and 0 deletions

View File

@@ -49,6 +49,7 @@ type Order struct {
type ProductInfo struct {
Owner string `json:"owner"`
Name string `json:"name"`
CreatedTime string `json:"createdTime,omitempty"`
DisplayName string `json:"displayName"`
Image string `json:"image,omitempty"`
Detail string `json:"detail,omitempty"`

View File

@@ -445,6 +445,7 @@ class CartListPage extends BaseListPage {
}
return {
...pRes.data,
createdTime: item.createdTime,
pricingName: item.pricingName,
planName: item.planName,
quantity: item.quantity,
@@ -482,6 +483,10 @@ class CartListPage extends BaseListPage {
const comparison = aValue > bValue ? 1 : -1;
return params.sortOrder === "ascend" ? comparison : -comparison;
});
} else {
sortedData.sort((a, b) => {
return b.createdTime - a.createdTime;
});
}
this.setState({

View File

@@ -14,6 +14,7 @@
import React from "react";
import {Button, Descriptions, Divider, InputNumber, Radio, Space, Spin, Typography} from "antd";
import moment from "moment";
import i18next from "i18next";
import * as ProductBackend from "./backend/ProductBackend";
import * as PlanBackend from "./backend/PlanBackend";
@@ -207,6 +208,7 @@ class ProductBuyPage extends React.Component {
} else {
const newProductInfo = {
name: product.name,
createdTime: moment().format(),
price: cartPrice,
currency: product.currency,
pricingName: pricingName,

View File

@@ -14,6 +14,7 @@
import React from "react";
import {Button, Card, Col, Row, Tag, Typography} from "antd";
import moment from "moment";
import * as Setting from "./Setting";
import * as ProductBackend from "./backend/ProductBackend";
import * as UserBackend from "./backend/UserBackend";
@@ -140,6 +141,7 @@ class ProductStorePage extends React.Component {
} else {
const newCartProductInfo = {
name: product.name,
createdTime: moment().format(),
currency: product.currency,
pricingName: "",
planName: "",