From 0a88dcd28ace3720a9735c1956efc1a95742d45a Mon Sep 17 00:00:00 2001
From: li tong bao <2903733959@qq.com>
Date: Wed, 20 Apr 2022 11:08:45 +0800
Subject: [PATCH] =?UTF-8?q?--=E5=A2=9E=E5=8A=A0=E5=9C=B0=E5=9D=80=E7=AE=A1?=
=?UTF-8?q?=E7=90=86=E9=A1=B5=E9=9D=A2=20--=E7=BC=96=E8=BE=91=E5=9C=B0?=
=?UTF-8?q?=E5=9D=80=E9=A1=B5=E9=9D=A2=20--=E5=9C=B0=E5=9D=80=E5=88=97?=
=?UTF-8?q?=E8=A1=A8=E7=BB=84=E4=BB=B6=20--=E4=B8=AA=E4=BA=BA=E8=B5=84?=
=?UTF-8?q?=E6=96=99=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/app.config.ts | 12 +++
src/components/AddressList/index.scss | 75 +++++++++++++
src/components/AddressList/index.tsx | 53 ++++++++++
src/components/address/index.module.scss | 6 +-
src/pages/addAddress/index.config.ts | 3 +
src/pages/addAddress/index.scss | 64 ++++++++++++
src/pages/addAddress/index.tsx | 76 ++++++++++++++
src/pages/addressManager/index.config.ts | 3 +
src/pages/addressManager/index.scss | 3 +
src/pages/addressManager/index.tsx | 15 +++
src/pages/userEdit/index.scss | 127 +++++++++++++++++++++++
src/pages/userEdit/index.tsx | 82 ++++++++++++++-
12 files changed, 511 insertions(+), 8 deletions(-)
create mode 100644 src/components/AddressList/index.scss
create mode 100644 src/components/AddressList/index.tsx
create mode 100644 src/pages/addAddress/index.config.ts
create mode 100644 src/pages/addAddress/index.scss
create mode 100644 src/pages/addAddress/index.tsx
create mode 100644 src/pages/addressManager/index.config.ts
create mode 100644 src/pages/addressManager/index.scss
create mode 100644 src/pages/addressManager/index.tsx
diff --git a/src/app.config.ts b/src/app.config.ts
index d3cc194..487ef1c 100644
--- a/src/app.config.ts
+++ b/src/app.config.ts
@@ -59,6 +59,18 @@ export default {
pages: [
"index"
]
+ },
+ {
+ root: "pages/addressManager",
+ pages: [
+ "index"
+ ]
+ },
+ {
+ root: "pages/addAddress",
+ pages: [
+ "index"
+ ]
}
]
}
diff --git a/src/components/AddressList/index.scss b/src/components/AddressList/index.scss
new file mode 100644
index 0000000..bbb4a69
--- /dev/null
+++ b/src/components/AddressList/index.scss
@@ -0,0 +1,75 @@
+.address-scroll-view{
+ height: 100%;
+ box-sizing: border-box;
+ position: relative;
+ scroll-view{
+ height: 100%;
+ box-sizing: border-box;
+ }
+
+ .address-list{
+ width: 704px;
+ height: 156px;
+ background: #ffffff;
+ border-radius: 20px;
+ box-shadow: 2px 4px 12px 0px rgba(0,0,0,0.16);
+ padding: 30px;
+ box-sizing: border-box;
+ margin: 18px auto 0;
+ }
+ .address-list:hover{
+ border: 1px solid #68b4ff;
+ box-shadow: 0px 0px 10px 0px rgba(0,122,255,0.27);
+ }
+ .address-list:last-child{
+ margin-bottom: 300px;
+ }
+ .address-user{
+ font-size: 28px;
+ font-family: Microsoft YaHei, Microsoft YaHei-Bold;
+ font-weight: 700;
+ text-align: left;
+ color: #000000;
+ display: flex;align-items: center;
+ }
+ .address-list-default{
+ width: 58px;
+ height: 28px;
+ background: #cde5ff;
+ border-radius: 6px;
+ font-size: 20px;
+ font-weight: 400;
+ text-align: center;
+ color: #007aff;
+ margin-left: 30px;
+
+ }
+ .address-list-phone{
+ font-size: 24px;
+ font-weight: 400;
+ color: #ababab;
+ margin-left: 30px;
+ }
+
+ .address-list-info{
+ font-size: 24px;
+ font-weight: 400;
+ color: #3c3c3c;
+ }
+ .address-list-bottom{
+ display: flex;justify-content: space-between;
+ margin-top: 18px;
+ }
+ .add-address{
+ 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;
+ position: absolute;bottom: 8%;left: 50%;
+ transform: translateX(-50%);
+ }
+}
\ No newline at end of file
diff --git a/src/components/AddressList/index.tsx b/src/components/AddressList/index.tsx
new file mode 100644
index 0000000..c999aa8
--- /dev/null
+++ b/src/components/AddressList/index.tsx
@@ -0,0 +1,53 @@
+
+import { Button, ScrollView, Text, View } from "@tarojs/components"
+import { useState } from "react"
+import "./index.scss"
+
+interface Params{
+ refresherEnabled?: boolean,//是否开启刷新
+ onSelect?: (item:any,index:number)=>void,//列表选择
+
+}
+
+// 地址列表
+const AddressList = (props:Params)=>{
+ // 处理刷新
+ const [refreshState, setRefreshState] = useState(false);
+ const handleRefresh = ()=>{
+ setRefreshState(true);
+ setTimeout(()=>{
+ setRefreshState(false);
+ },3000)
+
+ }
+
+ return (
+
+
+ {
+ Array.from({length:15}).map((item,index)=>{
+ return(
+ props.onSelect&&props.onSelect(item,index)} className="address-list">
+
+ XL纺织
+ 默认
+ {/* 1656488999 */}
+
+
+
+ **省**市**区**街道****仓库
+ 181****9790
+
+ 1
+
+
+ );
+ })
+ }
+
+
+
+ )
+}
+
+export default AddressList;
\ No newline at end of file
diff --git a/src/components/address/index.module.scss b/src/components/address/index.module.scss
index a19253c..49b5975 100644
--- a/src/components/address/index.module.scss
+++ b/src/components/address/index.module.scss
@@ -15,7 +15,7 @@
margin-top: 10px;
font-size: $font_size_medium;
border-bottom: 1px solid $color_font_two;
- color: $common_title_font_color;
+ color: $color_font_two;
position: relative;
.address_item{
padding: 0 20px;
@@ -37,7 +37,7 @@
height: 600px;
.address_scroll_list{
padding: 0 20px;
- font-size: $common_main_font_size2;
+ font-size: $font_size;
.address_list_item{
padding: 20px 0;
display: flex;
@@ -54,6 +54,6 @@
}
.addresst_select{
- color:$color_font_two;
+ color:$color_font_one;
}
}
diff --git a/src/pages/addAddress/index.config.ts b/src/pages/addAddress/index.config.ts
new file mode 100644
index 0000000..367665a
--- /dev/null
+++ b/src/pages/addAddress/index.config.ts
@@ -0,0 +1,3 @@
+export default {
+ navigationBarTitleText: '新增收货地址'
+}
diff --git a/src/pages/addAddress/index.scss b/src/pages/addAddress/index.scss
new file mode 100644
index 0000000..b77fdba
--- /dev/null
+++ b/src/pages/addAddress/index.scss
@@ -0,0 +1,64 @@
+.add-address{
+
+ .form-list{
+ display: flex;
+ justify-content: space-between;
+ margin: 30px 30px 0;
+ }
+ .form-list-label{
+ font-size: 28px;
+ font-weight: 700;
+ color: #000000;
+ margin-top: 20px;
+ }
+ .form-list-right{
+ width: 506px;
+ min-height: 80px;
+ background: #f6f6f6;
+ border-radius: 20px;
+ padding: 10px 20px;
+ box-sizing: border-box;
+ font-size: 26px;
+ font-weight: 400;
+ display: flex;justify-content: space-between;
+ align-items: center;
+ }
+ .form-list-right input,.form-list-right textarea{
+ flex: 0 0 auto;
+ min-height: 100%;
+ width: 100%;
+ color: #000000;
+ }
+ .form-list-right textarea{
+ height: 186px;
+ border-radius: 10px;
+ }
+ .form-list-right .phcolor{
+ color: #ababab;
+ }
+ .form-list-right-placeholder{
+ color: #ababab;
+ }
+ .form-list-right-enter{
+
+ }
+ .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/pages/addAddress/index.tsx b/src/pages/addAddress/index.tsx
new file mode 100644
index 0000000..7ed107f
--- /dev/null
+++ b/src/pages/addAddress/index.tsx
@@ -0,0 +1,76 @@
+
+import Address from "@/components/address"
+import { Button, Input, Text, Textarea, View } from "@tarojs/components"
+import { useState } from "react"
+import "./index.scss"
+
+export default ()=>{
+ const [showSiteModal, setShowSiteModal] = useState(false);
+ const handleSelectSite = ()=>{
+ setShowSiteModal(true);
+ }
+
+ // 保存
+ const [formData, setFormData] = useState({
+ aa: "",
+ bb:"",
+ cc:"",
+ dd:""
+ })
+ const handleSave = ()=>{
+
+ }
+
+ return (
+
+
+
+
+
+
+ 设为默认地址
+ 1
+
+
+
+ setShowSiteModal(false)} show={showSiteModal}/>
+
+ )
+}
+
+// 表单列表
+const FromList = (props:ListParams)=>{
+ const {type="input",value=""} = props;
+
+ return (
+
+ {props.label}
+
+ {
+ props.children??(
+ type=="input"?:
+ type=="textarea"?:
+ <>
+ {
+ props.value?{value}:
+
+ {props.placeholder}
+
+ }
+ 1
+ >
+ )
+ }
+
+
+ )
+}
+interface ListParams{
+ label: string, //左边label
+ onInput?: ()=>any, // 输入框输入
+ onClick?:()=>any, //点击列表
+ placeholder?:string, // 提示文本
+ children?: any, // 插槽
+ type?: string // 类型:1.input,2.textarea,3.select
+ value?: any
+}
\ No newline at end of file
diff --git a/src/pages/addressManager/index.config.ts b/src/pages/addressManager/index.config.ts
new file mode 100644
index 0000000..6ee4e10
--- /dev/null
+++ b/src/pages/addressManager/index.config.ts
@@ -0,0 +1,3 @@
+export default {
+ navigationBarTitleText: '地址管理'
+}
diff --git a/src/pages/addressManager/index.scss b/src/pages/addressManager/index.scss
new file mode 100644
index 0000000..61d7ccd
--- /dev/null
+++ b/src/pages/addressManager/index.scss
@@ -0,0 +1,3 @@
+.address-manager{
+ height: 100vh;
+}
\ No newline at end of file
diff --git a/src/pages/addressManager/index.tsx b/src/pages/addressManager/index.tsx
new file mode 100644
index 0000000..081d0bc
--- /dev/null
+++ b/src/pages/addressManager/index.tsx
@@ -0,0 +1,15 @@
+
+import AddressList from "@/components/AddressList"
+import { Button, ScrollView, Text, View } from "@tarojs/components"
+import { stopPullDownRefresh, usePullDownRefresh } from "@tarojs/taro"
+import { useState } from "react"
+import "./index.scss"
+
+export default ()=>{
+
+ return (
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/src/pages/userEdit/index.scss b/src/pages/userEdit/index.scss
index e69de29..bed20e5 100644
--- a/src/pages/userEdit/index.scss
+++ b/src/pages/userEdit/index.scss
@@ -0,0 +1,127 @@
+.user-edit{
+ height: 100vh;
+ background: #f3f3f3;
+ .user-edit-portrait{
+ font-size: 22px;
+ font-weight: 400;
+ color: #ababab;
+ display: flex;flex-direction: column;
+ align-items: center;justify-content: center;
+ margin-bottom: 24px;
+ background-color: white;
+ height: 300px;
+ }
+ .user-edit-portrait image{
+ width: 170px;
+ height: 170px;
+ border-radius: 50%;
+ overflow: hidden;
+ object-fit: cover;
+ margin-bottom: 15px;
+ }
+
+ .user-edit-content{
+ background-color: white;
+ padding: 0 30px;
+ }
+ .user-edit-list{
+ height: 90px;
+ display: flex;align-items: center;
+ border-bottom: 2px solid #f0f0f0;
+ }
+ .user-edit-list:last-of-type{
+ border: none;
+ }
+ .user-edit-list-left{
+ width: 120px;
+ border-right: 2px solid #f3f3f3;
+ margin-right: 30px;
+ font-size: 26px;
+ font-weight: 400;
+ color: #000000;
+ }
+ .user-edit-list-right{
+ display: flex;justify-content: space-between;
+ flex: auto;
+ font-size: 26px;
+ font-weight: 400;
+ color: #000000;
+ }
+ .user-edit-list-right-placeholder{
+ color: #cccccc;
+ }
+
+ .user-edit-logout{
+ width: 668px;
+ height: 82px;
+ background: #ffffff;
+ border: 2px solid #cde5ff;
+ border-radius: 40px;
+ margin: 359px auto 0;
+ font-size: 32px;
+ font-weight: 400;
+ text-align: center;
+ color: #007aff;
+ }
+
+ .user-edit-popup-content{
+ margin: 0 auto;
+ width: 658px;
+ }
+ .user-edit-popup-input{
+ width: 658px;
+ height: 182px;
+ background: #f3f3f3;
+ border: 2px solid #e6e6e6;
+ border-radius: 10px;
+ padding: 15px;
+ box-sizing: border-box;
+ font-size: 22px;
+ font-weight: 400;
+ color: #ababab;
+ display: flex;flex-direction: column;
+ align-items: flex-end;
+ }
+ .user-edit-popup-input textarea{
+ width: 100%;
+ height: 80%;
+ font-size: 26px;
+ font-weight: 400;
+ color: #3c3c3c;
+ }
+ .user-edit-popup-tips{
+ font-size: 22px;
+ font-weight: 400;
+ color: #ababab;
+ margin-top: 30px;
+ }
+ .user-edit-popup-operation{
+ width: 658px;
+ height: 82px;
+ background: #ffffff;
+ border: 2px solid #cde5ff;
+ border-radius: 40px;
+ display: flex;
+ overflow: hidden;
+ margin-top: 105px;
+ display: flex;
+ }
+ .user-edit-popup-operation button{
+ height: 100%;
+ width: 50%;
+ font-size: 32px;
+ font-weight: 400;
+ color: #007aff;
+ background-color: white;
+ border: none;
+ outline: none;
+ border-radius: none;
+ padding: 0;
+ border-radius: 0;
+ }
+ .user-edit-popup-operation .user-edit-popup-operation-save{
+ background: #007aff;
+ color: #ffffff;
+ }
+ .user-edit-popup-operation button::after{ border-radius: 0; }
+}
\ No newline at end of file
diff --git a/src/pages/userEdit/index.tsx b/src/pages/userEdit/index.tsx
index 67f255d..92a7364 100644
--- a/src/pages/userEdit/index.tsx
+++ b/src/pages/userEdit/index.tsx
@@ -1,17 +1,89 @@
-import { Image, View } from "@tarojs/components"
+import Popup from "@/components/popup";
+import { Button, Image, Text, Textarea, View } from "@tarojs/components"
+import { memo, useCallback, useState } from "react"
import "./index.scss"
export default ()=>{
+ // 表单数据
+ const [formData, setFormData] = useState({
+ nickname: "麦兜"
+ });
+
+ // 显示popup
+ const [popupShow,setPopupShow] = useState(false);
+ const triggerList = useCallback((key:string)=>{
+ setPopupShow(true);
+ },[])
+
+ // popup保存
+ const handleTextareaSave = ()=>{
+
+ }
+
return (
-
+
点击编辑头像
-
-
+
+ triggerList('nickname')} data={formData} label="昵称" placeholder="请输入" icon=""/>
+
+
+
+
+
+
+
+
+
+
+ )
+}
+
+// 列表
+const UserEditList = memo((props:any)=>{
+ return (
+
+
+ {props.label}
+
+
+
+ {props.placeholder}
+ {/* 请输入 */}
+
+ 1
)
-}
\ No newline at end of file
+})
+
+// popup内容
+const PopupContent = memo((props:any)=>{
+ // popup输入长度
+ const [inputLength, setInputLength] = useState(0);
+ const handleTextareaInput = (ev:any)=>{
+ setInputLength(ev.detail.value.length);
+ }
+ // 重置
+ const handleTextareaReset = ()=>{
+
+ }
+ return (
+ props.setPopupShow(false)} title="修改昵称" show={props.show}>
+
+
+
+ 请设置2-20个字符,由中文、英文、数字、-和_组成
+
+
+
+
+
+
+ )
+})
\ No newline at end of file