From dc30fc43c47820aabfffe82f24f07c36366a49b2 Mon Sep 17 00:00:00 2001 From: li tong bao <2903733959@qq.com> Date: Wed, 8 Jun 2022 19:11:28 +0800 Subject: [PATCH 1/5] =?UTF-8?q?--=E6=88=91=E7=9A=84=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AddressList/index.scss | 12 ++- src/components/AddressList/index.tsx | 57 ++++++------ src/pages/addressAdd/index.scss | 4 +- src/pages/addressAdd/index.tsx | 5 +- src/pages/creditLine/index.tsx | 2 +- src/pages/user/index.module.scss | 119 +++++++++++++++++++++++++- src/pages/user/index.tsx | 41 ++++++++- 7 files changed, 204 insertions(+), 36 deletions(-) diff --git a/src/components/AddressList/index.scss b/src/components/AddressList/index.scss index 5f8cd5b..88fbb0a 100644 --- a/src/components/AddressList/index.scss +++ b/src/components/AddressList/index.scss @@ -6,6 +6,9 @@ height: 100%; box-sizing: border-box; } + scroll-view>view{ + display: flex;flex-direction: column; + } .address-list{ width: 704px; @@ -25,7 +28,7 @@ .address-list:first-child{ margin-top: 0; } - .address-list:last-child{ + .address-list-last{ margin-bottom: 300px; } .address-user{ @@ -62,6 +65,13 @@ font-size: 24px; font-weight: 400; color: #3c3c3c; + display: flex; + width: 100%; + } + .address-list-info view{ + width: 50%; + text-overflow: ellipsis; + overflow: hidden;white-space: nowrap; } .address-list-bottom{ display: flex;justify-content: space-between; diff --git a/src/components/AddressList/index.tsx b/src/components/AddressList/index.tsx index e412e63..c3db685 100644 --- a/src/components/AddressList/index.tsx +++ b/src/components/AddressList/index.tsx @@ -81,37 +81,40 @@ const AddressList = memo((props:Params)=>{ return ( - { - state?.data?.list?.length>0? - state?.data?.list?.map((item,index)=>{ - // data.length>0? - // data.map((item,index)=>{ - return( - handleDelete(item)} onClick={()=>handleSelect(item,index)} className={`address-list ${focusId==item.id&&'address-active'}`}> - - {item.name} - { - item.is_default?默认: - {item.phone} - } - - - - {/* **省**市**区**街道****仓库 */} - {item.province_name+item.city_name+item.district_name} {item.address_detail} + + { + state?.data?.list?.length>0? + state?.data?.list?.map((item,index)=>{ + // data.length>0? + // data.map((item,index)=>{ + return( + handleDelete(item)} onClick={()=>handleSelect(item,index)} className={`address-list ${index+1==state?.data?.list?.length&&'address-list-last'} ${focusId==item.id&&'address-active'}`}> + + {item.name} { - item.is_default&&{item.phone.replace(item.phone.substring(3,7), "****")} + item.is_default?默认: + {item.phone.replace(item.phone.substring(4,7), "****")} } - - - + + + {item.province_name+item.city_name+item.district_name} + {/* {item.address_detail} */} + + { + item.is_default&&{item.phone.replace(item.phone.substring(4,7), "****")} + } + + + + + - - ); - }): - 暂未添加地址 - } + ); + }): + 暂未添加地址 + } + {addButtonEnabled&&添加收货地址} diff --git a/src/pages/addressAdd/index.scss b/src/pages/addressAdd/index.scss index b229c8b..8443556 100644 --- a/src/pages/addressAdd/index.scss +++ b/src/pages/addressAdd/index.scss @@ -40,6 +40,8 @@ font-weight: 400; color: #ffffff; display: flex;align-items: center;justify-content: center; - margin: 620px auto 0; + // margin: 620px auto 0; + position: fixed;left: 50%;bottom: 50px; + transform: translateX(-50%); } } \ No newline at end of file diff --git a/src/pages/addressAdd/index.tsx b/src/pages/addressAdd/index.tsx index 0399a4d..fbc2b16 100644 --- a/src/pages/addressAdd/index.tsx +++ b/src/pages/addressAdd/index.tsx @@ -54,7 +54,10 @@ export default ()=>{ }) const rules = { name: [{ - message: "请输入收货人姓名" + message: "请输入正确收货人姓名", + validator: (value:any, rule:any)=>{ // 自定义验证,返回true表示匹配到了(错误) + return value.length>5; + } }], phone: [{ message: "请输入正确的电话号码", regex: /^1[3|5|6|9|2|8|7]\d{9}$/ diff --git a/src/pages/creditLine/index.tsx b/src/pages/creditLine/index.tsx index e28f80b..505dcdc 100644 --- a/src/pages/creditLine/index.tsx +++ b/src/pages/creditLine/index.tsx @@ -41,7 +41,7 @@ export default ()=>{ const credit_quota_used_line = convertPrice(formatPriceDiv(result.data.credit_quota_used_line)); const credit_quota_line = convertPrice(formatPriceDiv(result.data.credit_quota_line)); const credit_quota_available_line = convertPrice(formatPriceDiv(result.data.credit_quota_available_line)); - const progress = (credit_quota_available_line[0] / credit_quota_line[0] * 100).toFixed(0); + const progress = ((credit_quota_available_line[0]??0) / (credit_quota_line[0]??0) * 100).toFixed(0); switch(Number(result.data.quota_status)){ case 0://暂未开通 diff --git a/src/pages/user/index.module.scss b/src/pages/user/index.module.scss index 693421b..5de5efa 100644 --- a/src/pages/user/index.module.scss +++ b/src/pages/user/index.module.scss @@ -7,7 +7,7 @@ height: 560px; position: relative; .card-main{ - margin-top: 33%; + margin-top: 10px; } } .header-card{ @@ -137,9 +137,6 @@ position: absolute;top: -10px;right: 0; } - .assets{ - - } .assets-title{ font-size: 28px; font-weight: 700; @@ -195,4 +192,118 @@ .card-main-list-content-item-right text{ font-size: 30px; } + + .auth{ + margin-top: 115px; + } + .auth-top{ + display: flex;align-items: center;justify-content: space-between; + } + .auth-status{ + padding: 0 10px; + height: 30px; + background: #dddddd; + border-radius: 10px 4px 0px 0px; + display: flex;align-items: center;justify-content: center; + font-size: 18px; + font-weight: 400; + color: #707070; + } + .auth-tips{ + font-size: 18px; + font-weight: 400; + color: #007aff; + } + .auth-tips text{ + font-size: 17px; + } + .auth-company{ + height: 70px; + width: 100%; + background: #f6f6f6; + border: 2px solid #f0f0f0; + border-radius: 0px 10px 10px 10px; + font-size: 26px; + font-weight: 700; + color: #707070; + display: flex;align-items: center;justify-content: center; + } + + .modal{ + background: rgba(0,0,0,0.6); + position: fixed;inset: 0; + display: flex;justify-content: center;align-items: center; + } + .modal-content{ + width: 598px; + background: #ffffff; + border-radius: 10px; + animation: enlargeK 0.2s linear; + overflow: hidden; + } + @keyframes enlargeK { + 0%{ + transform: scale(0); + } + 100%{ + transform: scale(1); + } + } + .modal-title{ + font-size: 32px; + font-weight: 700; + text-align: center; + color: #000000; + margin-bottom: 58px; + padding-top: 48px; + } + .modal-letter{ + font-size: 26px; + font-weight: 400; + color: #707070; + padding: 0 30px; + line-height: 50px; + } + .modal-letter-text{ + text-indent: 60px; + } + .modal-letter-beginn{ + font-size: 28px; + font-weight: 400; + color: #000000; + margin-bottom: 25px; + } + .modal-letter-end{ + font-size: 26px; + font-weight: 400; + text-align: right; + margin-top: 61px; + } + .modal-button{ + display: flex; + border-top: 1px solid #DDDDDD; + margin-top: 45px; + } + .modal-button button, .modal-button view{ + display: flex;align-items: center;justify-content: center; + width: 50%; + height: 90px; + background-color: white; + } + .modal-button button{ + font-size: 26px; + font-weight: 400; + color: #707070; + border-radius: 0; + border-right: 1px solid #DDDDDD; + } + .modal-button button::after{ + border: 0; + border-radius: 0; + } + .modal-button view{ + font-size: 26px; + font-weight: 400; + color: #007aff; + } } \ No newline at end of file diff --git a/src/pages/user/index.tsx b/src/pages/user/index.tsx index 0be67c8..de7f33f 100644 --- a/src/pages/user/index.tsx +++ b/src/pages/user/index.tsx @@ -1,4 +1,4 @@ -import { View, Image, Text, Navigator } from "@tarojs/components" +import { View, Image, Text, Navigator, Button } from "@tarojs/components" import { memo, useEffect, useState } from "react" import styles from './index.module.scss' import classnames from "classnames"; @@ -12,6 +12,33 @@ export default () => {
+ + + ) +} +const Modal = ()=>{ + const handleContent = ()=>{ + console.log(111); + + } + const handleouter = ()=>{ + console.log(222); + + } + return( + + e.stopPropagation()}> + 首次登录提醒 + + To: 万丰园纺织科技 + 尊敬的老朋友,欢迎你使用小程序商城;由于您是我们长期合作的伙伴,你的组织已自动为你生成,关联后可查看历史订单哟。 + 信息错误请联系客服 + + + + 我知道 + + ) } @@ -68,6 +95,18 @@ const Header = memo(() => { + + + + 1 + 认证不通过 + + 重新认证 + + + 佛山市带生纺织品有限公司 + + 订单 From 090f7e7dfb03aaead121d49b89319eb618d8a136 Mon Sep 17 00:00:00 2001 From: li tong bao <2903733959@qq.com> Date: Wed, 8 Jun 2022 19:23:36 +0800 Subject: [PATCH 2/5] =?UTF-8?q?--=E5=9C=B0=E5=9D=80=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=86=92=E6=B3=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AddressList/index.scss | 5 ++--- src/components/AddressList/index.tsx | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/AddressList/index.scss b/src/components/AddressList/index.scss index 88fbb0a..e7c7124 100644 --- a/src/components/AddressList/index.scss +++ b/src/components/AddressList/index.scss @@ -6,10 +6,9 @@ height: 100%; box-sizing: border-box; } - scroll-view>view{ - display: flex;flex-direction: column; + .address-scroll-view-content{ + padding-bottom: 300px; } - .address-list{ width: 704px; height: 156px; diff --git a/src/components/AddressList/index.tsx b/src/components/AddressList/index.tsx index c3db685..b2066a0 100644 --- a/src/components/AddressList/index.tsx +++ b/src/components/AddressList/index.tsx @@ -81,14 +81,14 @@ const AddressList = memo((props:Params)=>{ return ( - + { state?.data?.list?.length>0? state?.data?.list?.map((item,index)=>{ // data.length>0? // data.map((item,index)=>{ return( - handleDelete(item)} onClick={()=>handleSelect(item,index)} className={`address-list ${index+1==state?.data?.list?.length&&'address-list-last'} ${focusId==item.id&&'address-active'}`}> + handleDelete(item)} onClick={()=>handleSelect(item,index)} className={`address-list ${focusId==item.id&&'address-active'}`}> {item.name} { @@ -105,7 +105,7 @@ const AddressList = memo((props:Params)=>{ item.is_default&&{item.phone.replace(item.phone.substring(4,7), "****")} } - + e.stopPropagation()} url={`/pages/addressAdd/index?type=edit&id=${item.id}`} hoverClass="none" className="address-edit"> From 996777341c0c6b76345174ffe02495c19d14e86f Mon Sep 17 00:00:00 2001 From: li tong bao <2903733959@qq.com> Date: Wed, 8 Jun 2022 19:28:10 +0800 Subject: [PATCH 3/5] =?UTF-8?q?--=E4=BF=AE=E6=94=B9=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AddressList/index.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/AddressList/index.scss b/src/components/AddressList/index.scss index e7c7124..71c2eba 100644 --- a/src/components/AddressList/index.scss +++ b/src/components/AddressList/index.scss @@ -68,7 +68,7 @@ width: 100%; } .address-list-info view{ - width: 50%; + max-width: 60%; text-overflow: ellipsis; overflow: hidden;white-space: nowrap; } From de38a42b2e0f6cee752af9de237cb5b3c2d0e040 Mon Sep 17 00:00:00 2001 From: li tong bao <2903733959@qq.com> Date: Wed, 8 Jun 2022 19:47:41 +0800 Subject: [PATCH 4/5] =?UTF-8?q?--=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=8C=89=E9=92=AE=E6=94=BE=E5=A4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AddressList/index.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/AddressList/index.scss b/src/components/AddressList/index.scss index 71c2eba..3495b3a 100644 --- a/src/components/AddressList/index.scss +++ b/src/components/AddressList/index.scss @@ -56,6 +56,9 @@ color: #ababab; margin-left: 30px; } + .address-edit{ + padding: 10px; + } .address-edit .icon-bianji{ font-size: 40px; } From eceb170ecefc68009283b4c71eb9b05a8fe66df3 Mon Sep 17 00:00:00 2001 From: li tong bao <2903733959@qq.com> Date: Thu, 9 Jun 2022 19:31:40 +0800 Subject: [PATCH 5/5] =?UTF-8?q?--=E6=88=91=E7=9A=84=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project.config.json | 2 +- src/app.config.ts | 6 + src/components/AddressList/index.scss | 3 +- src/components/FromList/index.scss | 5 + src/components/FromList/index.tsx | 14 +- .../FromListCertification/index.scss | 95 ++++++++++++ .../FromListCertification/index.tsx | 60 ++++++++ src/components/Message/index.scss | 16 +++ src/components/Message/index.tsx | 19 +++ src/pages/certification/index.config.ts | 4 + src/pages/certification/index.scss | 104 ++++++++++++++ src/pages/certification/index.tsx | 135 ++++++++++++++++++ src/pages/creditLine/index.tsx | 4 +- src/pages/user/index.module.scss | 42 +++--- src/pages/user/index.tsx | 84 ++++++----- src/pages/userEdit/index.scss | 15 +- src/pages/userEdit/index.tsx | 17 ++- 17 files changed, 556 insertions(+), 69 deletions(-) create mode 100644 src/components/FromListCertification/index.scss create mode 100644 src/components/FromListCertification/index.tsx create mode 100644 src/components/Message/index.scss create mode 100644 src/components/Message/index.tsx create mode 100644 src/pages/certification/index.config.ts create mode 100644 src/pages/certification/index.scss create mode 100644 src/pages/certification/index.tsx diff --git a/project.config.json b/project.config.json index d98974e..9f2fb2a 100644 --- a/project.config.json +++ b/project.config.json @@ -2,7 +2,7 @@ "miniprogramRoot": "./dist", "projectname": "EShop", "description": "电子商城", - "appid": "touristappid", + "appid": "wx68d92d7cbf0b6963", "setting": { "urlCheck": true, "es6": false, diff --git a/src/app.config.ts b/src/app.config.ts index 61bd39e..21286b2 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -158,6 +158,12 @@ export default { pages: [ "index", ] + }, + { + root: "pages/certification", + pages: [ + "index", + ] } ] } diff --git a/src/components/AddressList/index.scss b/src/components/AddressList/index.scss index 3495b3a..8c6198c 100644 --- a/src/components/AddressList/index.scss +++ b/src/components/AddressList/index.scss @@ -19,6 +19,7 @@ box-sizing: border-box; margin: 18px auto 0; border: 1px solid #ffffff; + border: 1px solid rgba(0,0,0,0.16); } .address-active{ border: 1px solid #68b4ff; @@ -88,7 +89,7 @@ font-weight: 400; color: #ffffff; display: flex;align-items: center;justify-content: center; - position: absolute;bottom: 8%;left: 50%; + position: absolute;bottom: 4%;left: 50%; transform: translateX(-50%); } .address-no-data{ diff --git a/src/components/FromList/index.scss b/src/components/FromList/index.scss index e820f47..969922e 100644 --- a/src/components/FromList/index.scss +++ b/src/components/FromList/index.scss @@ -9,6 +9,11 @@ color: #000000; margin-top: 20px; } + .form-list-label-required::before{ + content: "*"; + color: #FF0000; + font-size: 28px; + } .form-list-right{ width: 506px; font-size: 26px; diff --git a/src/components/FromList/index.tsx b/src/components/FromList/index.tsx index 8df1c6c..0af11d4 100644 --- a/src/components/FromList/index.tsx +++ b/src/components/FromList/index.tsx @@ -10,20 +10,24 @@ interface ListParams{ placeholder?:string, // 提示文本 children?: any, // 插槽 type?: string // 类型:1.input,2.textarea,3.select - value?: any + value?: any, + style?: object, //整行样式 + labelStyle?: object, // label样式 + contentStyle?: object, + required?: boolean } // 表单列表 const FromList = memo((props:ListParams)=>{ - const {type="input",value=""} = props; + const {type="input",value="",style={},labelStyle={},contentStyle={},required=false} = props; return ( - - {props.label} + + {props.label} { props.children?? - + { type=="input"? diff --git a/src/components/FromListCertification/index.scss b/src/components/FromListCertification/index.scss new file mode 100644 index 0000000..fc0ed5a --- /dev/null +++ b/src/components/FromListCertification/index.scss @@ -0,0 +1,95 @@ +.From-list-certification{ + display: flex; + justify-content: space-between; + margin: 0 30px; + border-bottom: 1px solid #F0F0F0; + padding: 15px 0; + + .From-list-certification-label{ + font-size: 28px; + font-weight: 400; + color: #000000; + margin-top: 20px; + width: 150px; + border-right: 1px solid #F0F0F0; + } + .From-list-certification-label-required::before{ + content: "*"; + color: #FF0000; + font-size: 28px; + } + .From-list-certification-right{ + width: 506px; + font-size: 26px; + font-weight: 400; + } + .From-list-certification-right-meet{ + width: 506px; + min-height: 45px; + border-radius: 20px; + box-sizing: border-box; + padding: 10px 20px; + display: flex;justify-content: space-between; + align-items: center; + } + .From-list-certification-input{ + width: 100%; + display: flex;align-items: center; + } + .From-list-certification-input view{ + height: 100%; + padding: 0 10px; + box-sizing: border-box; + } + .From-list-certification-input text{ + width: 30px; + min-width: 30px; + height: 30px; + background: rgba(0,0,0,0.3); + border-radius: 50%; + font-size: 18px; + display: flex;align-items: center; + justify-content: center; + flex: 1; + color: white; + } + .From-list-certification-right input,.From-list-certification-right textarea{ + // flex: 0 0 auto; + min-height: 100%; + width: 100%; + color: #000000; + } + .From-list-certification-right textarea{ + height: 186px; + border-radius: 10px; + padding: 10px 0; + } + .From-list-certification-right .phcolor{ + color: #ababab; + } + .From-list-certification-right-placeholder{ + color: #ababab; + } + .From-list-certification-right-enter .icon-a-moreback{ + font-size: 28px; + } + .add-address-default{ + display: flex;align-items: center;justify-content: space-between; + margin: 70px 30px 0; + font-size: 26px; + font-weight: 700; + color: #000000; + } + + .add-address-save{ + width: 668px; + height: 82px; + background: #007aff; + border-radius: 40px; + font-size: 32px; + font-weight: 400; + color: #ffffff; + display: flex;align-items: center;justify-content: center; + margin: 620px auto 0; + } +} \ No newline at end of file diff --git a/src/components/FromListCertification/index.tsx b/src/components/FromListCertification/index.tsx new file mode 100644 index 0000000..3017860 --- /dev/null +++ b/src/components/FromListCertification/index.tsx @@ -0,0 +1,60 @@ + +import { Input, Text, Textarea, View } from "@tarojs/components" +import { memo } from "react" +import "./index.scss" + +interface ListParams{ + label: string, //左边label + onInput?: (ev:Object)=>void, // 输入框输入 + onClick?:()=>any, //点击列表 + placeholder?:string, // 提示文本 + children?: any, // 插槽 + type?: string // 类型:1.input,2.textarea,3.select + value?: any, + style?: object, //整行样式 + labelStyle?: object, // label样式 + contentStyle?: object, + required?: boolean +} + +// 表单列表 +const FromList = memo((props:ListParams)=>{ + const {type="input",value="",style={},labelStyle={},contentStyle={},required=false} = props; + + return ( + + {props.label} + + { + props.children?? + + { + type=="input"? + + + {value&& + props.onInput&&props.onInput({detail: {value: ""}})} className="iconfont icon-qingkong"/> + } + : + type=="textarea"?