master
mahdi 2 years ago
parent 6a98f0a86f
commit 7aaf28e0ab
  1. 15
      src/components/Design2D/index.js
  2. 7
      src/components/Product/index.js
  3. 10
      src/views/Contact/index.js
  4. 7
      src/views/Dashboard/layouts/Main/MyBooks/index.js
  5. 2
      src/views/Dashboard/layouts/Main/UserItems/ProductSuggestion/index.js
  6. 10
      src/views/Dashboard/layouts/Mobile/ProfileAddress/index.js
  7. 4
      src/views/DeliveryForm/TransportDate/index.js
  8. 11
      src/views/DeliveryForm/TransportMethod/index.js
  9. 27
      src/views/DeliveryForm/index.js
  10. 19
      src/views/Faq/index.js
  11. 14
      src/views/Favorites/index.js
  12. 6
      src/views/Home/Portrait/Private/MyBooks/index.js
  13. 4
      src/views/Order/components/Book.js
  14. 13
      src/views/Order/index.js
  15. 8
      src/views/Orders/components/Order.js
  16. 2
      src/views/Orders/index.js
  17. 2
      src/views/Product/Desktop/ProductOverAll/index.js
  18. 8
      src/views/Product/index.js

@ -3,7 +3,7 @@ import React from "react";
const Design2D = ({ array }) => {
return (
<section
className="flex items-center justify-around p-2 bg-red-400"
className="flex items-center justify-around"
style={{ height: "420px" }}
>
{array.map((item, index) => (
@ -11,10 +11,6 @@ const Design2D = ({ array }) => {
className={`flex flex-col justify-center h-full`}
style={{
flex: item.flex,
// display:'-webkit-box',
// display:'flex',
// maxHeight: '400px',
// minHeight: '400px'
}}
key={index}
>
@ -32,14 +28,7 @@ const Design2D = ({ array }) => {
backgroundRepeat: "no-repeat",
backgroundPosition: "center",
}}
>
{/* <p>inside div</p> */}
{/* <img src={item1.image} className=' rounded-xl' style={{
objectFit: 'cover',
display: 'block',
minWidth: '100%'
}}/> */}
</div>
></div>
</div>
))}
</div>

@ -122,12 +122,13 @@ const ProductDesign = ({
{/* price with line on it */}
{discountPrice && (
<p className="line-through text-xs text-borderColor mr-2">
145<span>{window.t("تومان")}</span>
{separate(product.product?.masterPrice)}
<span>{window.t("تومان")}</span>
</p>
)}
</div>
<p className="text-lg text-productPrice font-semibold inline text-green4F">
{separate(product.product[type]?.price)}{" "}
{separate(product.product[type]?.price)}
<span>{window.t("تومان")}</span>
</p>
</div>
@ -191,7 +192,7 @@ ProductDesign.defaultProps = {
discount: false,
discountPricePercent: false,
// product price
discountPrice: false,
discountPrice: true,
priceHolder: true,
productContent: false,

@ -96,11 +96,6 @@ Contact.defaultProps = {
tel: null,
color: "#766600",
},
// link: {
// title: window.t("ارتباط با بخش پشتیبانی"),
// link: "/support",
// color: "#766600",
// },
bg: "#D3B70222",
borderColor: "#D3B70255",
},
@ -128,11 +123,6 @@ Contact.defaultProps = {
tel: null,
color: "#066A5C",
},
// link: {
// title: window.t("لیست نمایندگیهای فروش"),
// link: "/sell",
// color: "#0A7769",
// },
bg: "#0A776922",
borderColor: "#0A776955",
},

@ -55,11 +55,6 @@ export const MyBooks = ({ books, grades, isMobile, userProducts }) => {
) : null}
</div>
</div>
{/* <ProductSuggestion
products={books?.slice(0, 3)}
grades={grades}
isMobile={isMobile}
/> */}
</div>
);
};
@ -67,7 +62,7 @@ export const MyBooks = ({ books, grades, isMobile, userProducts }) => {
const mapStateToProps = (state) => ({
userProducts: state.userProduct.list,
grades: state.publicApi.grades,
isMobile: state.config.device === 'mobile',
isMobile: state.config.device === "mobile",
books: state.book.list,
});

@ -8,7 +8,7 @@ function Suggestion({ products, grades, isMobile }) {
return (
<div className="flex flex-col pl-7 pr-8 pt-4 border border-solid border-gray-200 bg-blueC0 bg-opacity-5 shadow-all rounded-md w-full">
<strong className="text-green7B dark:text-white font-bold text-2xl lg:text-base my-4">
پیشنهادات ما به شما
{window.t("پیشنهادات ما به شما")}
</strong>
{products?.length ? (
<div className="relative w-full ltr">

@ -144,7 +144,7 @@ const Location = ({
className="py-3 pr-2 pl-10 border-none m-0 text-sm text-red19 font-bold"
onClick={() => delAddress(address.id)}
>
حذف
{window.t("حذف")}
</button>
</div>
<div className={"flex flex-col flex-1 mr-2"}>
@ -177,20 +177,20 @@ const Location = ({
<div className={`flex w-full ${active ? "" : "flex-row"}`}>
<div className={"flex flex-col flex-1 mb-4"}>
<span className={"text-sm leading-6"}>
{`{window.t("آدرس:")}` + " " + address.address}
{`${window.t("آدرس:")}` + " " + address.address}
</span>
<span className={"text-sm leading-6 mt-1.5"}>
{`{window.t("نام:")}` +
{`${window.t("نام:")}` +
" " +
address.firstName +
" " +
address.lastName}
</span>
<span className={"text-sm leading-6 mt-1.5"}>
{`{window.t("کد پستی:")}` + " " + address.postalCode}
{`${window.t("کد پستی:")}` + " " + address.postalCode}
</span>
<span className={"text-sm leading-6 mt-1.5"}>
{`{window.t("شماره تماس:")}` + " " + address.cellphone}
{`${window.t("شماره تماس:")}` + " " + address.cellphone}
</span>
</div>
{!active && (

@ -11,7 +11,7 @@ function TransportDate({ transportDate, isMobile }) {
return isMobile ? (
<ButtonBetween
item={time.time}
status={"تکمیل ظرفیت"}
status={window.t("تکمیل ظرفیت")}
width="100%"
onClick={() => setActiveDate(time)}
active={activeDate === time}
@ -35,7 +35,7 @@ function TransportDate({ transportDate, isMobile }) {
onClick={() => setActiveDate(time)}
active={activeDate === time}
toggle={true}
status={"تکمیل ظرفیت"}
status={window.t("تکمیل ظرفیت")}
>
<strong
className={`text-tiny transition-all duration-500 dark:text-white ${

@ -35,8 +35,8 @@ function TransportMethod({
)
: {}
}
item={"ارسال با" + " " + method.name}
status={separate(method.price) + " " + "تومان"}
item={window.t("ارسال با") + " " + method.name}
status={separate(method.price) + " " + window.t("تومان")}
active={active}
toggle={true}
/>
@ -77,7 +77,8 @@ function TransportMethod({
: "text-blue52 dark:text-white"
}`}
>
هزینه ارسال &nbsp; {separate(method.price)}
{window.t("هزینه ارسال")}
&nbsp; {separate(method.price)}
</span>
</button>
);
@ -85,7 +86,7 @@ function TransportMethod({
return isMobile ? (
<section className="mt-0 w-full">
<strong className="text-green7B font-bold dark:text-white text-base">
لطفا یک روش ارسال انتخاب کنید
{window.t("یک روش ارسال انتخاب کنید")}
</strong>
<ul className="list-none p-0 m-0 flex flex-col gap-4 w-full mt-5">
{list.map((method, index) => (
@ -100,7 +101,7 @@ function TransportMethod({
) : (
<section className="mt-1 w-full">
<strong className="font-medium dark:text-white">
لطفا یک روش ارسال انتخاب کنید
{window.t("لطفا یک روش ارسال انتخاب کنید")}
</strong>
<ul className="list-none p-0 m-0 flex gap-5 flex-wrap">
{list.map((method, index) => (

@ -40,7 +40,7 @@ export const DeliveryForm = ({
color: !isDark ? (type === "error" ? "#F1420D" : "#246E8A") : "",
}}
>
{value + " " + "تومان"}
{value + " " + window.t("تومان")}
</span>
</div>
);
@ -65,7 +65,7 @@ export const DeliveryForm = ({
}}
>
<strong className="text-green4F text-lg font-semibold dark:text-white">
تکمیل اطلاعات
{window.t("تکمیل اطلاعات")}
</strong>
<img
src={
@ -73,7 +73,7 @@ export const DeliveryForm = ({
? "/assets/icons/arrow-white.svg"
: "/assets/icons/arrow-primary.svg"
}
alt="بازگشت"
alt={window.t("بازگشت")}
className="w-6"
onClick={() => setPhase("products")}
/>
@ -124,21 +124,22 @@ DeliveryForm.defaultProps = {
form: {
addresses: [
{
address:
" تهران میدان احمد آباد خیابان شریعتی بعد از میدان فجر بن بست شکوفه پلاک 4 زنگ 12",
receiver: "احمد نام آور",
address: window.t(
"تهران میدان احمد آباد خیابان شریعتی بعد از میدان فجر بن بست شکوفه پلاک 4 زنگ 12"
),
receiver: window.t("احمد نام آور"),
postalCode: "54352432",
cellphone: "09123456789",
},
],
transportMethods: [
{
name: "ارسال اکسپرس مخصوص شهر تهران",
name: window.t("ارسال اکسپرس مخصوص شهر تهران"),
cost: "25.000",
icon: ExpressIcon,
},
{
name: "ارسال با پست پیشتاز",
name: window.t("ارسال با پست پیشتاز"),
cost: "25.000",
icon: PishtazIcon,
},
@ -147,25 +148,25 @@ DeliveryForm.defaultProps = {
day: new Date(),
times: [
{
time: "ساعت 9 تا 12",
time: window.t("ساعت 9 تا 12"),
status: "completed",
},
{
time: "ساعت 12 تا 15",
time: window.t("ساعت 12 تا 15"),
status: "free",
},
{
time: "ساعت 15 تا 18",
time: window.t("ساعت 15 تا 18"),
status: "free",
},
],
},
paymentMethods: [
{
name: "پرداخت آنلاین با کلیه کارتهای عضو شبکه شتاب",
name: window.t("پرداخت آنلاین با کلیه کارتهای عضو شبکه شتاب"),
},
{
name: "پرداخت در محل",
name: window.t("پرداخت در محل"),
},
],
},

@ -12,7 +12,14 @@ import faqBgImage from "./faq-bg.svg";
import desktopFaqBgImage from "./desktop-faq-bg.svg";
import searchLight from "../../assets/icons/search-light.svg";
function Faq({ headerOptions, setHeaderOptions, isMobile, list, getList, selectFaq }) {
function Faq({
headerOptions,
setHeaderOptions,
isMobile,
list,
getList,
selectFaq,
}) {
useEffect(() => {
setHeaderOptions(headerOptions);
getList();
@ -24,7 +31,7 @@ function Faq({ headerOptions, setHeaderOptions, isMobile, list, getList, selectF
>
<Header
bg={isMobile ? faqBgImage : desktopFaqBgImage}
title="پرسشهای متداول"
title={window.t("پرسش های متداول")}
/>
<div className="w-full flex flex-col px-4 transform -translate-y-12 items-center">
@ -43,8 +50,8 @@ function Faq({ headerOptions, setHeaderOptions, isMobile, list, getList, selectF
</div>
<div className="w-full flex lg:w-4/5 justify-end">
<NotFound
title={"پرسش خود را در لیست بالا پیدا نکردید؟"}
subTitle={"برای ما پیام ارسال کنید"}
title={window.t("پرسش خود را در لیست بالا پیدا نکردید؟")}
subTitle={window.t("برای ما پیام ارسال کنید")}
link="/contact-us"
/>
</div>
@ -56,12 +63,12 @@ function Faq({ headerOptions, setHeaderOptions, isMobile, list, getList, selectF
const mapStateToProps = (state) => ({
isMobile: state.publicApi.isMobile,
list: state.faq.list,
active : state.faq.active
active: state.faq.active,
});
const mapDispatchToProps = {
setHeaderOptions: publicApi.setHeaderOptions,
getList: faq.list,
selectFaq: faq.selectFaq
selectFaq: faq.selectFaq,
};
export default connect(mapStateToProps, mapDispatchToProps)(Faq);

@ -35,7 +35,7 @@ const Favorites = ({
<Bookmark key={index} bookmark={bookmark} />
))
) : (
<Empty text="هیج موردی در علاقهمندیهای شما وجود ندارد." />
<Empty text={window.t("هیج موردی در علاقهمندیهای شما وجود ندارد.")} />
)}
</div>
);
@ -78,18 +78,18 @@ export default connect(mapStateToProps, mapDispatchToProps)(Favorites);
Favorites.defaultProps = {
bookmarkList: [
{
name: "کتاب آموزشی علوم تجربی",
grade: "پایه ششم ابتدایی",
name: window.t("کتاب آموزشی علوم تجربی"),
grade: window.t("پایه ششم ابتدایی"),
image: bookImage,
},
{
name: "کتاب آموزشی علوم تجربی",
grade: "پایه ششم ابتدایی",
name: window.t("کتاب آموزشی علوم تجربی"),
grade: window.t("پایه ششم ابتدایی"),
image: bookImage,
},
{
name: "کتاب آموزشی علوم تجربی",
grade: "پایه ششم ابتدایی",
name: window.t("کتاب آموزشی علوم تجربی"),
grade: window.t("پایه ششم ابتدایی"),
image: bookImage,
},
],

@ -63,13 +63,13 @@ function MyBooks({ books, grades, isMobile }) {
to={"/scan"}
className="w-full text-center py-3 bg-blueC0 text-white font-medium rounded-sm text-tiny"
>
اسکن کد QR
{window.t(" اسکن کد QR")}
</Link>
<a
href={`https://ar.dnvn.ir/lunch?id=${book.id}`}
className="w-full text-center py-3 bg-gray-400 text-white font-medium rounded-sm text-tiny"
>
واقعیت افزوده
{window.t("واقعیت افزوده")}
</a>
</div>
</Modal>
@ -83,7 +83,7 @@ function MyBooks({ books, grades, isMobile }) {
<div className="px-4 mb-5 lg:mb-0" style={{ maxWidth: "100%" }}>
<div className=" w-full flex flex-col rounded-md pt-4 lg:py-5 px-2 lg:px-4 bg-opacity-5 border border-green-200 border-solid dark:bg-gray2077 dark:border-opacity-40 overflow-hidden">
<strong className="text-green7B dark:text-white font-bold text-base lg:text-base mb-2">
کتابهای من
{window.t("کتابهای من")}
</strong>
<ul className=" list-none w-full overflow-x-scroll pt-2 flex lg:hidden lg:pt-5 lg:flex-wrap lg:overflow-y-scroll gap-3 lg:gap-10 no-scrollbar">
{books?.slice(0, 5)?.map((book, index) => (

@ -14,7 +14,7 @@ function Book({ book, grades }) {
{book?.product?.book?.name || " "}
</strong>
<span className="mt-4 text-xs lg:text-sm text-gray70 dark:text-greenBA">
{"پایه" + " " + grades[book?.product?.book?.gradeId]}
{window.t("پایه") + " " + grades[book?.product?.book?.gradeId]}
</span>
</div>
</div>
@ -23,7 +23,7 @@ function Book({ book, grades }) {
{book?.product?.count}
</span>
<div className="mr-3 text-blueC0 text-xs lg:text-base dark:text-white">
{book?.product?.price + " " + "تومان"}
{book?.product?.price + " " + window.t("تومان")}
</div>
</div>
</div>

@ -33,7 +33,7 @@ function OrderDetails({ order, setHeaderOptions, headerOptions, isMobile }) {
<div className="flex w-full justify-between items-center p-3 bg-blueC0 bg-opacity-10 rounded-t-md dark:bg-blueC0 dark:bg-opacity-10">
{order?.transactionId ? (
<strong className="font-medium text-sm lg:text-tiny text-blue52 dark:text-white">
{"شماره سفارش:" + " " + order?.transactionId}
{window.t("شماره سفارش:") + " " + order?.transactionId}
</strong>
) : null}
{order?.condition ? (
@ -83,7 +83,7 @@ function OrderDetails({ order, setHeaderOptions, headerOptions, isMobile }) {
<div className="w-full rounded-md flex flex-col p-4 mt-2 bg-blueC0 bg-opacity-10 dark:bg-blueC0 dark:bg-opacity-20 dark:border-blueC0 dark:border dark:border-solid">
{order?.recieverPostalCode ? (
<strong className="text-xs lg:text-tiny text-green4F dark:text-white">
{"کد تحویل" + " " + order?.recieverPostalCode}
{window.t("کد تحویل") + " " + order?.recieverPostalCode}
</strong>
) : null}
<p className="font-light text-right mt-3 text-xs lg:text-sm text-green4F dark:text-white">
@ -104,7 +104,7 @@ function OrderDetails({ order, setHeaderOptions, headerOptions, isMobile }) {
{window.t("مبلغ سبد خرید:")}
</strong>
<span className="flex-1 font-light text-right mr-2 text-xs lg:text-tiny text-green4F dark:text-white">
{order?.sumPrice + " " + "تومان"}
{order?.sumPrice + " " + window.t("تومان")}
</span>
</div>
) : null}
@ -116,7 +116,7 @@ function OrderDetails({ order, setHeaderOptions, headerOptions, isMobile }) {
{window.t("هزینه ارسال کالا:")}
</strong>
<span className="flex-1 font-light text-right mr-2 text-xs lg:text-tiny text-green4F dark:text-white">
{order?.transportPrice + " " + "تومان"}
{order?.transportPrice + " " + window.t("تومان")}
</span>
</div>
) : null}
@ -126,7 +126,7 @@ function OrderDetails({ order, setHeaderOptions, headerOptions, isMobile }) {
{window.t("جمع هزینه پرداختی:")}
</strong>
<span className="flex-1 font-light text-right mr-2 text-xs lg:text-tiny text-green4F dark:text-white">
{order?.payPrice + " " + "تومان"}
{order?.payPrice + " " + window.t("تومان")}
</span>
</div>
) : null}
@ -134,7 +134,6 @@ function OrderDetails({ order, setHeaderOptions, headerOptions, isMobile }) {
<div className="w-full flex flex-row justify-between py-2 border-b border-solid border-blueFF1 dark:border-gray45">
<div className="flex flex-row py-4">
<strong className="text-xs lg:text-tiny text-green4F dark:text-white">
{" "}
{window.t("شماره تراکنش:")}
</strong>
<span className="flex-1 font-light text-right mr-2 text-xs lg:text-tiny text-green4F dark:text-white">
@ -158,7 +157,7 @@ function OrderDetails({ order, setHeaderOptions, headerOptions, isMobile }) {
const mapStateToProps = (state) => ({
isMobile: state.config.device === "mobile",
order: state.userFactor.selectedOrder
order: state.userFactor.selectedOrder,
});
const mapDispatchToProps = {

@ -27,7 +27,7 @@ function Order({ order, setDashboardPage, isDashboard, selectOrder }) {
<div className="flex w-full justify-between items-center p-3 bg-blueC0 bg-opacity-10 dark:bg-blueC0 dark:bg-opacity-10">
{order?.transactionId ? (
<strong className="font-medium text-sm lg:text-sm text-green4F dark:text-white">
{"شماره سفارش:" + " " + order?.transactionId}
{window.t("شماره سفارش:") + " " + order?.transactionId}
</strong>
) : null}
{order?.condition ? (
@ -68,7 +68,7 @@ function Order({ order, setDashboardPage, isDashboard, selectOrder }) {
<div>
{order?.followCode ? (
<div className="p-2 rounded-md text-center text-xs bg-grayEE dark:bg-gray-400 dark:text-white text-blue5F lg:hidden">
{"کد تحویل:" + " " + order?.followCode}
{window.t("کد تحویل:") + " " + order?.followCode}
</div>
) : null}
</div>
@ -81,7 +81,7 @@ function Order({ order, setDashboardPage, isDashboard, selectOrder }) {
fontFamily: "bold",
}}
>
{"جمع فاکتور:" + " " + order?.payPrice}
{window.t("جمع فاکتور:") + " " + order?.payPrice}
</strong>
) : null}
<Link
@ -106,7 +106,7 @@ function Order({ order, setDashboardPage, isDashboard, selectOrder }) {
</Link>
{order?.payedAt ? (
<span className="my-5 text-xs text-blue52 font-light dark:text-white lg:hidden">
{"تاریخ سفارش:" +
{window.t("تاریخ سفارش:") +
" " +
moment(order?.payedAt)?.format("jYYYY/jMM/jDD")}{" "}
</span>

@ -40,7 +40,7 @@ function Orders({
</div>
) : (
<Empty
text="هیچ محصولی برای شما به ثبت نرسیده است."
text={window.t("هیچ محصولی برای شما به ثبت نرسیده است.")}
buttonText="ثبت اولین سفارش"
buttonAction={() => navigation("/products")}
/>

@ -60,7 +60,7 @@ export const ProductOverAll = ({
</h1>
{book?.gradeId ? (
<div className="text-blueC0 text-tiny dark:text-greenBA">
{"پایه" + " " + grades[book?.gradeId]}
{window.t("پایه") + " " + grades[book?.gradeId]}
</div>
) : null}

@ -86,7 +86,6 @@ export const Product = ({
useEffect(() => {
if (!isMobile) {
setHeaderOptions(headerOptions);
}
getInfo({ id: location.getId(), vod: true });
if (!isMobile) {
@ -157,7 +156,7 @@ export const Product = ({
</li>
{book?.rate ? (
<li className="border-solid border-blueFE flex-1 flex-shrink-0 text-center text-tiny leading-5 font-medium text-green7B dark:text-white">
{book?.rate} <br /> امتیاز
{book?.rate} <br /> {window.t("امتیاز")}
</li>
) : null}
</ul>
@ -258,7 +257,10 @@ export const Product = ({
</div>
) : (
<div className="flex flex-col items-center justify-center lg:py-24">
<DesktopProductLayout physicalProduct={physicalProduct} rate={book?.rate || 0} />
<DesktopProductLayout
physicalProduct={physicalProduct}
rate={book?.rate || 0}
/>
</div>
)}
</>

Loading…
Cancel
Save