Merge branch 'dev' of ssh://git.online.zzfzyc.com:10022/mp/EShop into dev

This commit is contained in:
2022-05-12 11:37:04 +08:00
24 changed files with 439 additions and 3876 deletions
+1 -1
View File
@@ -18,7 +18,7 @@
margin: 18px auto 0;
border: 1px solid #ffffff;
}
.address-list:hover{
.address-active{
border: 1px solid #68b4ff;
box-shadow: 0px 0px 10px 0px rgba(0,122,255,0.27);
}
+30 -14
View File
@@ -1,7 +1,8 @@
import { Button, Navigator, ScrollView, Text, View } from "@tarojs/components"
import { memo, useState } from "react"
import { memo, useEffect, useState } from "react"
import "./index.scss"
import {addressListApi} from "@/api/addressManager"
interface Params{
refresherEnabled?: boolean,//是否开启刷新
@@ -11,13 +12,21 @@ interface Params{
// 地址列表
const AddressList = memo((props:Params)=>{
const {fetchData, state} = addressListApi()
// 获取数据
const getData = ()=>{
fetchData();
}
useEffect(()=>{
getData();
},[])
// 处理刷新
const [refreshState, setRefreshState] = useState(false);
const handleRefresh = ()=>{
const handleRefresh = async ()=>{
setRefreshState(true);
setTimeout(()=>{
setRefreshState(false);
},500)
await fetchData();
setRefreshState(false);
}
const data = Array.from({length:15});
@@ -25,21 +34,28 @@ const AddressList = memo((props:Params)=>{
<View className="address-scroll-view">
<ScrollView scrollY refresherEnabled={props.refresherEnabled} enhanced refresherTriggered={refreshState} onRefresherRefresh={handleRefresh}>
{
data.length>0?
data.map((item,index)=>{
state?.data?.list?.length>0?
state?.data?.list?.map((item,index)=>{
// data.length>0?
// data.map((item,index)=>{
return(
<View onClick={()=>props.onSelect&&props.onSelect(item,index)} className="address-list">
<View onClick={()=>props.onSelect&&props.onSelect(item,index)} className={`address-list ${item.is_default&&'address-active'}`}>
<View className="address-user">
XL纺织
<Text className="address-list-default">默认</Text>
{/* <Text className="address-list-phone">1656488999</Text> */}
{item.name}
{
item.is_default?<Text className="address-list-default">默认</Text>:
<Text className="address-list-phone">{item.phone}</Text>
}
</View>
<View className="address-list-bottom">
<View className="address-list-info">
**省**市**区**街道****仓库
<Text className="address-list-phone">181****9790</Text>
{/* **省**市**区**街道****仓库 */}
{item.province_name+item.city_name+item.district_name} {item.address_detail}
{
item.is_default&&<Text className="address-list-phone">{item.phone}</Text>
}
</View>
<Navigator url="/pages/addressAdd/index?type=edit" hoverClass="none" className="address-edit">
<Navigator url={`/pages/addressAdd/index?type=edit&id=${item.id}`} hoverClass="none" className="address-edit">
<Text className="iconfont icon-bianji"></Text>
</Navigator>
</View>
+6
View File
@@ -28,6 +28,11 @@
width: 100%;
display: flex;align-items: center;
}
.form-list-input view{
height: 100%;
padding: 0 10px;
box-sizing: border-box;
}
.form-list-input text{
width: 30px;
min-width: 30px;
@@ -38,6 +43,7 @@
display: flex;align-items: center;
justify-content: center;
flex: 1;
color: white;
}
.form-list-right input,.form-list-right textarea{
// flex: 0 0 auto;
+8 -2
View File
@@ -5,7 +5,7 @@ import "./index.scss"
interface ListParams{
label: string, //左边label
onInput?: ()=>any, // 输入框输入
onInput?: (ev:Object)=>void, // 输入框输入
onClick?:()=>any, //点击列表
placeholder?:string, // 提示文本
children?: any, // 插槽
@@ -28,7 +28,9 @@ const FromList = memo((props:ListParams)=>{
type=="input"?
<View className="form-list-input">
<Input value={value} placeholder-class="phcolor" onInput={props?.onInput} placeholder={props.placeholder} />
{value&&<Text className="iconfont icon-qingkong"/>}
{value&&
<View><Text onClick={()=>props.onInput&&props.onInput({detail: {value: ""}})} className="iconfont icon-qingkong"/></View>
}
</View>:
type=="textarea"?<Textarea value={value} placeholder-class="phcolor" onInput={props?.onInput} placeholder={props.placeholder} />:
<>
@@ -47,4 +49,8 @@ const FromList = memo((props:ListParams)=>{
</View>
)
})
const A = ()=>{
}
export default FromList;