对接售后列表订单状态
This commit is contained in:
@@ -12,8 +12,12 @@ type ReasonInfoParam = {
|
||||
show?: boolean, //显示
|
||||
onClose?: () => void, //关闭
|
||||
onSuccess?: () => void, //成功
|
||||
defaultValue?: {
|
||||
remark: string,
|
||||
name: string
|
||||
}, //默认数据
|
||||
}
|
||||
export default memo(({show = false, onClose, onSuccess}: ReasonInfoParam) => {
|
||||
export default memo(({show = false, onClose, onSuccess, defaultValue}: ReasonInfoParam) => {
|
||||
|
||||
const submitData = useRef({
|
||||
"name": '',
|
||||
@@ -47,13 +51,13 @@ export default memo(({show = false, onClose, onSuccess}: ReasonInfoParam) => {
|
||||
<View className={styles.title_item}>
|
||||
<View className={styles.title}>名称</View>
|
||||
<View className={styles.select}>
|
||||
<Input placeholder="请输入文件夹名称" className={styles.input} onInput={changeInput}/>
|
||||
<Input placeholder="请输入文件夹名称" className={styles.input} onInput={changeInput} value={defaultValue?.remark}/>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.desc_item}>
|
||||
<View className={styles.title}>简介</View>
|
||||
<View className={styles.desc}>
|
||||
<TextareaEnhance onChange={getOtherReason} placeholder="请输入简介"/>
|
||||
<TextareaEnhance onChange={getOtherReason} placeholder="请输入简介" />
|
||||
</View>
|
||||
</View>
|
||||
|
||||
|
||||
@@ -1,7 +1,18 @@
|
||||
|
||||
.collection_con{
|
||||
padding: 20px;
|
||||
padding: 20px ;
|
||||
.collection_item{
|
||||
|
||||
display: flex;
|
||||
font-size: 26px;
|
||||
padding: 30px 10px;
|
||||
border-bottom: 1PX solid #F3F3F3;
|
||||
align-items: center;
|
||||
.miconfont{
|
||||
font-size: 36px;
|
||||
color: #007AFF;
|
||||
}
|
||||
.text{
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,50 +11,35 @@ import { alert } from "@/common/common";
|
||||
type ReasonInfoParam = {
|
||||
show?: boolean, //显示
|
||||
onClose?: () => void, //关闭
|
||||
onSuccess?: () => void, //成功
|
||||
onUpdate?: () => void, //编辑
|
||||
onBatchManagement?: () => void, //批量管理
|
||||
onDelete?: () => void, //删除
|
||||
|
||||
}
|
||||
export default memo(({show = false, onClose, onSuccess}: ReasonInfoParam) => {
|
||||
|
||||
const submitData = useRef({
|
||||
"name": '',
|
||||
"remark": ''
|
||||
})
|
||||
|
||||
const getOtherReason = useCallback((val) => {
|
||||
submitData.current.remark = val
|
||||
}, [])
|
||||
|
||||
const changeInput = useCallback((val) => {
|
||||
submitData.current.name = val.detail.value
|
||||
}, [])
|
||||
|
||||
//创建
|
||||
const {fetchData} = CreateFavoriteApi()
|
||||
const onSubmit = async () => {
|
||||
if(!submitData.current.name) return alert.none('请输入收藏夹名称!')
|
||||
let res = await fetchData(submitData.current)
|
||||
if(res.success) {
|
||||
alert.success('创建成功')
|
||||
onSuccess?.()
|
||||
export default memo(({show = false, onClose, onUpdate, onBatchManagement, onDelete}: ReasonInfoParam) => {
|
||||
const onClickEven = (val) => {
|
||||
if (val == 1) {
|
||||
onUpdate?.()
|
||||
} else if (val == 2) {
|
||||
onBatchManagement?.()
|
||||
} else {
|
||||
alert.error('创建失败')
|
||||
onDelete?.()
|
||||
}
|
||||
onClose?.()
|
||||
}
|
||||
return (
|
||||
<Popup show={show} onClose={onClose} >
|
||||
<Popup show={show} onClose={onClose} showTitle={false} >
|
||||
<View className={styles.collection_con}>
|
||||
<View className={styles.collection_item}>
|
||||
<View className={styles.collection_item} onClick={() => onClickEven(1)}>
|
||||
<Text className={classnames(styles.miconfont, 'iconfont icon-bianji')}></Text>
|
||||
<Text>编辑收藏夹</Text>
|
||||
<Text className={styles.text}>编辑收藏夹</Text>
|
||||
</View>
|
||||
<View className={styles.collection_item}>
|
||||
<View className={styles.collection_item} onClick={() => onClickEven(2)}>
|
||||
<Text className={classnames(styles.miconfont, 'iconfont icon-fenlei')}></Text>
|
||||
<Text>批量管理</Text>
|
||||
<Text className={styles.text}>批量管理</Text>
|
||||
</View>
|
||||
<View className={styles.collection_item}>
|
||||
<View className={styles.collection_item} onClick={() => onClickEven(3)}>
|
||||
<Text className={classnames(styles.miconfont, 'iconfont icon-shanchu')}></Text>
|
||||
<Text>删除该收藏夹</Text>
|
||||
<Text className={styles.text}>删除该收藏夹</Text>
|
||||
</View>
|
||||
</View>
|
||||
</Popup>
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import { FavoriteListApi } from "@/api/favorite";
|
||||
import { DelFavoriteApi, FavoriteListApi } from "@/api/favorite";
|
||||
import { alert } from "@/common/common";
|
||||
import { getFilterData } from "@/common/util";
|
||||
import Product from "@/components/product";
|
||||
import Search from "@/components/search"
|
||||
import { Text, View } from "@tarojs/components"
|
||||
import Taro from "@tarojs/taro";
|
||||
import classnames from "classnames";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import CreatePopup from "./components/createPopup";
|
||||
import UpdatePopup from "./components/updatePopup";
|
||||
import styles from './index.module.scss'
|
||||
@@ -13,12 +16,20 @@ export default () => {
|
||||
item.openStatus = !item.openStatus
|
||||
setList((e) => [...e])
|
||||
}
|
||||
//获取搜索数据
|
||||
const [searchData, setSearchData] = useState('')
|
||||
const onSearch = useCallback((e) => {
|
||||
setSearchData(() => e)
|
||||
}, [])
|
||||
useEffect(() => {
|
||||
getFavoriteList()
|
||||
}, [searchData])
|
||||
|
||||
//获取列表
|
||||
const [list, setList] = useState([])
|
||||
const {fetchData: fetchDataList} = FavoriteListApi()
|
||||
const getFavoriteList = async () => {
|
||||
let res = await fetchDataList()
|
||||
let res = await fetchDataList(getFilterData({name: searchData}))
|
||||
setList(() => res.data.list)
|
||||
}
|
||||
useEffect(() => {
|
||||
@@ -36,11 +47,51 @@ export default () => {
|
||||
getFavoriteList()
|
||||
}, [])
|
||||
|
||||
//更多编辑
|
||||
const selectInfo = useRef<any>(null)
|
||||
const [updateShow, setUpdateShow] = useState(false)
|
||||
const closeUpdate = useCallback(() => {
|
||||
setUpdateShow(false)
|
||||
}, [])
|
||||
const moreUpdate = (item,e) => {
|
||||
e.stopPropagation()
|
||||
selectInfo.current = item
|
||||
setUpdateShow(true)
|
||||
}
|
||||
|
||||
//删除改收藏夹
|
||||
const {fetchData: delFetchData} = DelFavoriteApi()
|
||||
const onDeleteCollect = useCallback(() => {
|
||||
if(!selectInfo.current.id) return alert.error('参数不正确!')
|
||||
if(selectInfo.current.id == 1) return alert.none('删除失败,该文件夹不能删除!')
|
||||
Taro.showModal({
|
||||
content: '确认删除该文件夹?',
|
||||
success: async function (res) {
|
||||
if (res.confirm) {
|
||||
let res = await delFetchData({id: selectInfo.current.id})
|
||||
if(res.success) {
|
||||
alert.success('删除成功')
|
||||
getFavoriteList()
|
||||
} else {
|
||||
alert.error('删除失败')
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
}
|
||||
})
|
||||
closeUpdate()
|
||||
}, [])
|
||||
|
||||
//编辑
|
||||
const onUpdate = useCallback(() => {
|
||||
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<View className={styles.collection_main}>
|
||||
<View className={styles.search}>
|
||||
<Search style={{width: '100%'}} debounceTime={300} changeOnSearch={(e) => console.log(e)} placeholder="请输入面料关键词" />
|
||||
<Search style={{width: '100%'}} debounceTime={300} changeOnSearch={onSearch} placeholder="请输入面料关键词" />
|
||||
<View className={styles.miconfont_con} onClick={() => setCollectioinShow(true)}><Text className={classnames(styles.miconfont, 'iconfont icon-jia')}></Text></View>
|
||||
</View>
|
||||
<View className={styles.class_list}>
|
||||
@@ -50,7 +101,7 @@ export default () => {
|
||||
<View className={styles.title}>{item.name}
|
||||
{item.product_color_list&&<><Text className={styles.fg}>·</Text><Text className={styles.num}>{item.product_color_list.length}</Text></>}
|
||||
</View>
|
||||
<View className={styles.more} >更多</View>
|
||||
<View className={styles.more} onClick={(e) => moreUpdate(item,e)}>更多</View>
|
||||
</View>
|
||||
<View className={styles.class_con} style={item.openStatus?{maxHeight: 10*260 + 'rpx'}:{maxHeight: 0}} >
|
||||
<Product productList={new Array(10).fill('')}/>
|
||||
@@ -58,7 +109,7 @@ export default () => {
|
||||
</View>)}
|
||||
</View>
|
||||
<CreatePopup show={collectioinShow} onClose={closeCollection} onSuccess={onCreatSuccess}/>
|
||||
<UpdatePopup show={true} onClose={closeCollection} onSuccess={onCreatSuccess}/>
|
||||
<UpdatePopup show={updateShow} onClose={closeUpdate} onDelete={onDeleteCollect} onUpdate={onUpdate}/>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user