Merge branch 'dev' of ssh://git.online.zzfzyc.com:10022/mp/EShop into dev
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
navigationBarTitleText: ''
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
.add-address{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.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: #68b4ff;
|
||||
border-radius: 40px;
|
||||
font-size: 32px;
|
||||
font-weight: 400;
|
||||
color: #ffffff;
|
||||
display: flex;align-items: center;justify-content: center;
|
||||
margin: 620px auto 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
|
||||
import { retrieval } from "@/common/common"
|
||||
import Address from "@/components/address"
|
||||
import FromList from "@/components/FromList"
|
||||
import { Button, Input, Text, Textarea, View } from "@tarojs/components"
|
||||
import Taro, { setNavigationBarTitle, useRouter } from "@tarojs/taro"
|
||||
import { useEffect, useState } from "react"
|
||||
import "./index.scss"
|
||||
|
||||
export default ()=>{
|
||||
const [showSiteModal, setShowSiteModal] = useState(false);
|
||||
const {type} = useRouter().params;
|
||||
useEffect(()=>{
|
||||
if(type=="add"){
|
||||
setNavigationBarTitle({title:"新增收货地址"})
|
||||
}else{
|
||||
setNavigationBarTitle({title:"编辑收货地址"})
|
||||
}
|
||||
},[])
|
||||
|
||||
const handleSelectSite = ()=>{
|
||||
setShowSiteModal(true);
|
||||
}
|
||||
|
||||
// 保存
|
||||
const [formData, setFormData] = useState({
|
||||
aa: "1",
|
||||
bb:"2",
|
||||
cc:"aa",
|
||||
dd:"d"
|
||||
})
|
||||
const handleSave = ()=>{
|
||||
Taro.navigateBack();
|
||||
}
|
||||
const [hozon, setHozon] = useState(false);
|
||||
useEffect(()=>{
|
||||
if(retrieval){
|
||||
retrieval(formData).then(()=>setHozon(true)).catch(()=>setHozon(false))
|
||||
}
|
||||
},[formData])
|
||||
|
||||
return (
|
||||
<View className="add-address">
|
||||
<FromList value={formData["aa"]} label="联系人" placeholder="请输入收货人姓名"/>
|
||||
<FromList value={formData["bb"]} label="联系方式" placeholder="请输入收货人姓名"/>
|
||||
<FromList value={formData["cc"]} onClick={handleSelectSite} label="收货地址" type="select" placeholder="请选择/省/市/区"/>
|
||||
<FromList value={formData["dd"]} label="详细地址" type="textarea" placeholder="请输入详细地址(街道、门牌号等)"/>
|
||||
<View className="add-address-default">
|
||||
<Text>设为默认地址</Text>
|
||||
<View>1</View>
|
||||
</View>
|
||||
|
||||
<Button style={{"background": hozon?'#007aff':''}} hoverClass="none" className={`add-address-save`} onClick={handleSave}>
|
||||
保存
|
||||
</Button>
|
||||
<Address addressOnClose={()=>setShowSiteModal(false)} show={showSiteModal}/>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
navigationBarTitleText: '地址管理'
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
.address-manager{
|
||||
height: 100vh;
|
||||
}
|
||||
@@ -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 (
|
||||
<View className="address-manager">
|
||||
<AddressList refresherEnabled={true}/>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
navigationBarTitleText: '公司资料'
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
.company{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.save-button{
|
||||
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: 320px auto 0;
|
||||
}
|
||||
|
||||
.form-radio{
|
||||
display: flex;
|
||||
flex-wrap: wrap;align-items: center;
|
||||
}
|
||||
.form-radio view{
|
||||
height: 54px;
|
||||
background: #f0f0f0;
|
||||
border-radius: 28px;
|
||||
font-size: 24px;
|
||||
font-weight: 400;
|
||||
color: #707070;
|
||||
padding: 10px 28px;
|
||||
box-sizing: border-box;
|
||||
display: flex;align-items: center;justify-content: center;
|
||||
margin: 10px;
|
||||
border: 2px solid #f0f0f0;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
.form-radio .form-radio-active{
|
||||
background: #ecf5ff;
|
||||
border: 2px solid #cde5ff;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
|
||||
import Address from "@/components/address"
|
||||
import FromList from "@/components/FromList"
|
||||
import { Button, Input, Text, Textarea, View } from "@tarojs/components"
|
||||
import Taro, { getCurrentPages, useRouter } from "@tarojs/taro"
|
||||
import { useEffect, 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 = ()=>{
|
||||
const pages = getCurrentPages();
|
||||
const prevPage = pages[pages.length-2];
|
||||
Taro.eventCenter.trigger('message:detail', { text: 'test' })
|
||||
|
||||
Taro.navigateBack();
|
||||
}
|
||||
// 单选
|
||||
const radioData = ['布行','二批','制衣厂'];
|
||||
const [radioActive, setRadioActive] = useState(0);
|
||||
const handleActiveRadio = (index:number)=>{
|
||||
setRadioActive(index);
|
||||
}
|
||||
|
||||
return (
|
||||
<View className="company">
|
||||
<FromList value={formData["aa"]} label="公司名称" placeholder="请输入收货人姓名"/>
|
||||
<FromList value={formData["bb"]} label="公司全称" placeholder="请输入收货人姓名"/>
|
||||
<FromList value={formData["bb"]} label="公司类型" placeholder="请输入收货人姓名">
|
||||
<View className="form-radio">
|
||||
{
|
||||
radioData.map((item,index)=>{
|
||||
return <View onClick={()=>handleActiveRadio(index)} className={radioActive==index?'form-radio-active':''} key={index}>{item}</View>
|
||||
})
|
||||
}
|
||||
</View>
|
||||
</FromList>
|
||||
<FromList value={formData["bb"]} label="联系人" placeholder="请输入收货人姓名"/>
|
||||
<FromList value={formData["bb"]} label="联系方式" placeholder="请输入收货人姓名"/>
|
||||
<FromList value={formData["cc"]} onClick={handleSelectSite} label="收货地址" type="select" placeholder="请选择/省/市/区"/>
|
||||
<FromList value={formData["dd"]} label="详细地址" type="textarea" placeholder="请输入详细地址(街道、门牌号等)"/>
|
||||
|
||||
|
||||
<Button hoverClass="none" className="save-button" onClick={handleSave}>保存</Button>
|
||||
<Address addressOnClose={()=>setShowSiteModal(false)} show={showSiteModal}/>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
@@ -60,6 +60,22 @@
|
||||
}
|
||||
.card-info-right{
|
||||
font-size: 26px;
|
||||
display: flex;align-items: flex-end;
|
||||
}
|
||||
.setup-icon{
|
||||
position: relative;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.icon-wrapper{
|
||||
font-size: 60px;
|
||||
}
|
||||
.icon-point{
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: #ff0000;
|
||||
position: absolute;
|
||||
right: 0;top: 0;
|
||||
}
|
||||
|
||||
.card-main-title{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { View,Image,Text } from "@tarojs/components"
|
||||
import { View,Image,Text, Navigator } from "@tarojs/components"
|
||||
import { memo } from "react"
|
||||
import styles from './index.module.scss'
|
||||
import classnames from "classnames";
|
||||
|
||||
export default () => {
|
||||
|
||||
@@ -29,7 +30,14 @@ const Header = memo(()=>{
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles['card-info-right']}>
|
||||
1
|
||||
<Navigator hoverClass="none" url="/pages/userEdit/index" className={styles['setup-icon']}>
|
||||
<View className={classnames(
|
||||
styles['icon-wrapper'],
|
||||
'iconfont',
|
||||
'icon-shezhi',
|
||||
)}></View>
|
||||
<View className={styles['icon-point']}></View>
|
||||
</Navigator>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles['card-main']}>
|
||||
@@ -43,7 +51,7 @@ const Header = memo(()=>{
|
||||
return (
|
||||
<View className={styles['card-main-title-content-item']}>
|
||||
<Image src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2F1113%2F052420110515%2F200524110515-2-1200.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1652840455&t=6d2fd53931578ef6e213a929a77d059c"/>
|
||||
<View>待配布</View>
|
||||
<View>{item.text}</View>
|
||||
</View>
|
||||
)
|
||||
})
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
navigationBarTitleText: '编辑个人资料'
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
.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-list-right .icon-a-moreback{
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
.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;
|
||||
padding-bottom: 50px;
|
||||
}
|
||||
.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; }
|
||||
}
|
||||
@@ -1,6 +1,107 @@
|
||||
|
||||
import { goLink } from "@/common/common";
|
||||
import Popup from "@/components/popup";
|
||||
import { Button, Image, Text, Textarea, View } from "@tarojs/components"
|
||||
import Taro, { chooseMedia } from "@tarojs/taro";
|
||||
import { memo, useCallback, useState } from "react"
|
||||
import "./index.scss"
|
||||
|
||||
export default ()=>{
|
||||
return "1"
|
||||
}
|
||||
// 表单数据
|
||||
const [formData, setFormData] = useState({
|
||||
nickname: "麦兜"
|
||||
});
|
||||
|
||||
// 显示popup
|
||||
const [popupShow,setPopupShow] = useState(false);
|
||||
const triggerList = useCallback((key:string)=>{
|
||||
setPopupShow(true);
|
||||
},[])
|
||||
|
||||
// popup保存
|
||||
const handleTextareaSave = ()=>{
|
||||
|
||||
}
|
||||
Taro.eventCenter.on('message:detail', (message) => console.log(message))
|
||||
// 面面跳转
|
||||
const onNavigate = (url:string)=>{
|
||||
goLink(url);
|
||||
}
|
||||
// 肖像编辑
|
||||
const handleSelectRortrait = ()=>{
|
||||
chooseMedia({
|
||||
count: 1,
|
||||
mediaType: ["image"],
|
||||
success(ev){
|
||||
console.log(ev);
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return (
|
||||
<View className="user-edit">
|
||||
<View onClick={handleSelectRortrait} className="user-edit-portrait">
|
||||
<Image src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2F1113%2F052420110515%2F200524110515-2-1200.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1652840455&t=6d2fd53931578ef6e213a929a77d059c"/>
|
||||
<View>点击编辑头像</View>
|
||||
</View>
|
||||
<View className="user-edit-content">
|
||||
<UserEditList onClick={()=>triggerList('nickname')} data={formData} label="昵称" placeholder="请输入" icon=""/>
|
||||
<UserEditList onClick={()=>onNavigate("/pages/company/index")} label="公司/组织" placeholder="请输入" icon=""/>
|
||||
<UserEditList onClick={()=>onNavigate("/pages/addressManager/index")} label="地址管理" placeholder="添加 / 修改收货地址" icon=""/>
|
||||
<UserEditList onClick={()=>onNavigate("/pages/weightList/index")} label="码单管理" placeholder="修改码单抬头 / 客户 / 电话等显示信息" icon=""/>
|
||||
<UserEditList label="完善资料" placeholder="完善资料加入会员,申请更多优惠" icon=""/>
|
||||
<UserEditList label="账号解绑" placeholder="解除账号与所属公司/组织的绑定关系" icon=""/>
|
||||
</View>
|
||||
<Button hoverClass="none" className="user-edit-logout">退出当前账号</Button>
|
||||
|
||||
<PopupContent value="123" show={popupShow} setPopupShow={setPopupShow} save={handleTextareaSave}/>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
// 列表
|
||||
const UserEditList = memo((props:any)=>{
|
||||
return (
|
||||
<View onClick={props.onClick} className="user-edit-list">
|
||||
<View className="user-edit-list-left">
|
||||
{props.label}
|
||||
</View>
|
||||
<View className="user-edit-list-right">
|
||||
<View>
|
||||
<View className="user-edit-list-right-placeholder">{props.placeholder}</View>
|
||||
{/* 请输入 */}
|
||||
</View>
|
||||
<Text className="iconfont icon-a-moreback"></Text>
|
||||
</View>
|
||||
</View>
|
||||
)
|
||||
})
|
||||
|
||||
// popup内容
|
||||
const PopupContent = memo((props:any)=>{
|
||||
const [value, setValue] = useState("");
|
||||
// popup输入长度
|
||||
const handleTextareaInput = (ev:any)=>{
|
||||
setValue(ev.detail.value.slice(0,20));
|
||||
}
|
||||
// 重置
|
||||
const handleTextareaReset = ()=>{
|
||||
|
||||
}
|
||||
return (
|
||||
<Popup onClose={()=>props.setPopupShow(false)} title="修改昵称" show={props.show}>
|
||||
<View className="user-edit-popup-content">
|
||||
<View className="user-edit-popup-input">
|
||||
<Textarea value={value} onInput={handleTextareaInput} maxlength={20}/>
|
||||
<Text>{value.length}/20</Text>
|
||||
</View>
|
||||
<Text className="user-edit-popup-tips">请设置2-20个字符,由中文、英文、数字、-和_组成</Text>
|
||||
<View className="user-edit-popup-operation">
|
||||
<Button onClick={handleTextareaReset} hoverClass="none" className="user-edit-popup-operation-reset">重置</Button>
|
||||
<Button onClick={props.save} hoverClass="none" className="user-edit-popup-operation-save">保存</Button>
|
||||
</View>
|
||||
</View>
|
||||
</Popup>
|
||||
)
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
navigationBarTitleText: '码单管理'
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
.weight-list-manager{
|
||||
height: 100vh;
|
||||
|
||||
.weight-list-scroll-view{
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
scroll-view{
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.weight-list-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;
|
||||
border: 1px solid #ffffff;
|
||||
}
|
||||
.weight-list-list:hover{
|
||||
border: 1px solid #68b4ff;
|
||||
box-shadow: 0px 0px 10px 0px rgba(0,122,255,0.27);
|
||||
}
|
||||
.weight-list-list:last-child{
|
||||
margin-bottom: 300px;
|
||||
}
|
||||
.weight-list-user{
|
||||
font-size: 28px;
|
||||
font-family: Microsoft YaHei, Microsoft YaHei-Bold;
|
||||
font-weight: 700;
|
||||
text-align: left;
|
||||
color: #000000;
|
||||
display: flex;align-items: center;
|
||||
}
|
||||
.weight-list-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;
|
||||
|
||||
}
|
||||
.weight-list-list-phone{
|
||||
font-size: 24px;
|
||||
font-weight: 400;
|
||||
color: #ababab;
|
||||
margin-left: 30px;
|
||||
}
|
||||
.weight-list-edit .icon-bianji{
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
.weight-list-list-info{
|
||||
font-size: 24px;
|
||||
font-weight: 400;
|
||||
color: #3c3c3c;
|
||||
}
|
||||
.weight-list-list-bottom{
|
||||
display: flex;justify-content: space-between;
|
||||
margin-top: 18px;
|
||||
}
|
||||
.add-weight-list{
|
||||
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%);
|
||||
}
|
||||
.weight-list-no-data{
|
||||
font-size: 24px;
|
||||
font-weight: 400;
|
||||
text-align: center;
|
||||
color: #707070;
|
||||
height: 100%;
|
||||
padding-top: 40%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
|
||||
import { Button, Navigator, ScrollView, Text, View } from "@tarojs/components"
|
||||
import { memo, useState } from "react"
|
||||
import "./index.scss"
|
||||
|
||||
const weightListManager = ()=>{
|
||||
|
||||
return(
|
||||
<View className="weight-list-manager">
|
||||
<WeightList />
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
interface Params{
|
||||
refresherEnabled?: boolean,//是否开启刷新
|
||||
onSelect?: (item:any,index:number)=>void,//列表选择
|
||||
|
||||
}
|
||||
// 码单列表
|
||||
const WeightList = memo((props:Params)=>{
|
||||
// 处理刷新
|
||||
const [refreshState, setRefreshState] = useState(false);
|
||||
const handleRefresh = ()=>{
|
||||
setRefreshState(true);
|
||||
setTimeout(()=>{
|
||||
setRefreshState(false);
|
||||
},500)
|
||||
}
|
||||
const data = Array.from({length:0});
|
||||
|
||||
return (
|
||||
<View className="weight-list-scroll-view">
|
||||
<ScrollView scrollY refresherEnabled={props.refresherEnabled} enhanced refresherTriggered={refreshState} onRefresherRefresh={handleRefresh}>
|
||||
{
|
||||
data.length>0?
|
||||
data.map((item,index)=>{
|
||||
return(
|
||||
<View onClick={()=>props.onSelect&&props.onSelect(item,index)} className="weight-list-list">
|
||||
<View className="weight-list-user">
|
||||
XL纺织
|
||||
<Text className="weight-list-list-default">默认</Text>
|
||||
{/* <Text className="weight-list-list-phone">1656488999</Text> */}
|
||||
</View>
|
||||
<View className="weight-list-list-bottom">
|
||||
<View className="weight-list-list-info">
|
||||
**省**市**区**街道****仓库
|
||||
<Text className="weight-list-list-phone">181****9790</Text>
|
||||
</View>
|
||||
<Navigator url="/pages/weightListAdd/index?type=edit" hoverClass="none" className="weight-list-edit">
|
||||
<Text className="iconfont icon-bianji"></Text>
|
||||
</Navigator>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}):
|
||||
<View className="weight-list-no-data">
|
||||
<View>您末添加任何码单信息</View>
|
||||
正在使用平台默认码单信息
|
||||
</View>
|
||||
}
|
||||
</ScrollView>
|
||||
<Navigator url="/pages/weightListAdd/index?type=add" hoverClass="none" className="add-weight-list">添加新码单信息</Navigator>
|
||||
</View>
|
||||
)
|
||||
})
|
||||
|
||||
export default weightListManager;
|
||||
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
navigationBarTitleText: ''
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
.add-address{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.add-address-default{
|
||||
display: flex;align-items: center;justify-content: space-between;
|
||||
margin: 70px 30px 0;
|
||||
font-size: 26px;
|
||||
font-weight: 700;
|
||||
color: #000000;
|
||||
padding-right: 20px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.add-address-default-active{
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
background: #007aff;
|
||||
border-radius: 50%;
|
||||
display: flex;align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 45px;
|
||||
color: white;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.add-address-default-noactive{
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border: 2px solid #707070;
|
||||
border-radius: 50%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.add-address-save{
|
||||
width: 668px;
|
||||
height: 82px;
|
||||
background: #68b4ff;
|
||||
border-radius: 40px;
|
||||
font-size: 32px;
|
||||
font-weight: 400;
|
||||
color: #ffffff;
|
||||
display: flex;align-items: center;justify-content: center;
|
||||
margin: 620px auto 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
|
||||
import FromList from "@/components/FromList"
|
||||
import { Button, Input, Text, Textarea, View } from "@tarojs/components"
|
||||
import Taro, { setNavigationBarTitle, useRouter } from "@tarojs/taro"
|
||||
import { useEffect, useState } from "react"
|
||||
import "./index.scss"
|
||||
|
||||
export default ()=>{
|
||||
const {type} = useRouter().params;
|
||||
useEffect(()=>{
|
||||
if(type=="add"){
|
||||
setNavigationBarTitle({title:"添加码单信息"})
|
||||
}else{
|
||||
setNavigationBarTitle({title:"修改码单信息"})
|
||||
}
|
||||
},[])
|
||||
|
||||
// 保存
|
||||
const [formData, setFormData] = useState({
|
||||
aa: "",
|
||||
bb:"",
|
||||
cc:"",
|
||||
dd:"",
|
||||
ee: 0
|
||||
})
|
||||
const handleSave = ()=>{
|
||||
Taro.navigateBack();
|
||||
}
|
||||
const handleSelectDefault = ()=>setFormData({...formData ,ee: formData.ee?0:1});
|
||||
|
||||
return (
|
||||
<View className="add-address">
|
||||
<FromList value={formData["aa"]} label="抬头" placeholder="请输入码单显示抬头信息"/>
|
||||
<FromList value={formData["bb"]} label="客户" placeholder="请输入码单显示客户名称"/>
|
||||
<FromList value={formData["bb"]} label="联系方式" placeholder="请输入码单显示联系号码"/>
|
||||
<View className="add-address-default">
|
||||
<Text>设为默认地址</Text>
|
||||
<View onClick={handleSelectDefault}>
|
||||
{
|
||||
formData.ee?<View className="add-address-default-active">✓</View>
|
||||
:<View className="add-address-default-noactive"></View>
|
||||
}
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<Button hoverClass="none" className="add-address-save" onClick={handleSave}>保存</Button>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user