🐳 chore(eslint): 修正所有文件的eslint 错误❌
This commit is contained in:
@@ -10,7 +10,7 @@ interface propsObj {
|
||||
obj: any
|
||||
handUp?: (any) => void
|
||||
}
|
||||
export default memo((props: propsObj) => {
|
||||
const AddressDetailBox = (props: propsObj) => {
|
||||
const {
|
||||
obj = {},
|
||||
handUp,
|
||||
@@ -46,4 +46,5 @@ export default memo((props: propsObj) => {
|
||||
</View>
|
||||
</View >
|
||||
)
|
||||
})
|
||||
}
|
||||
export default memo(AddressDetailBox)
|
||||
|
||||
@@ -24,8 +24,7 @@ interface Param {
|
||||
account_period_time?: string // 还款日期
|
||||
}
|
||||
}
|
||||
|
||||
export default memo(({ orderInfo = { logistics_details: [], payment_method: 0, status: 0 }, onRefresh }: Param) => {
|
||||
const OrderState = ({ orderInfo = { logistics_details: [], payment_method: 0, status: 0 }, onRefresh }: Param) => {
|
||||
useEffect(() => {
|
||||
console.log('orderInfo33::', orderInfo)
|
||||
}, [orderInfo])
|
||||
@@ -48,7 +47,7 @@ export default memo(({ orderInfo = { logistics_details: [], payment_method: 0, s
|
||||
<>
|
||||
{(dataList?.length > 0) && <View className={styles.order_flow_state}>
|
||||
<View className={classnames(styles.order_status_list, showMore && styles.order_status_list_show)}>
|
||||
{dataList.map((item, index) => <View className={styles.order_status_item}>
|
||||
{dataList.map((item, index) => <View className={styles.order_status_item} key={index}>
|
||||
{(dataList.length > 1) && <View className={classnames(styles.order_status_tail, (index == 0) && styles.order_status_tail_end)}></View>}
|
||||
{(dataList.length != (index + 1)) && <View className={styles.order_status_line}></View>}
|
||||
<View className={styles.order_status_content}>
|
||||
@@ -59,10 +58,11 @@ export default memo(({ orderInfo = { logistics_details: [], payment_method: 0, s
|
||||
</View>)}
|
||||
</View>
|
||||
{(dataList.length > 2) && <View className={styles.more} onClick={() => changeMore()}>
|
||||
<Text>{showMore && '收起详情' || '点击查看详情'}</Text>
|
||||
<Text>{showMore ? '收起详情' : '点击查看详情'}</Text>
|
||||
<Text className={classnames('iconfont icon-a-moreback', styles.miconfonts, showMore && styles.open_miconfonts)}></Text>
|
||||
</View>}
|
||||
</View>}
|
||||
</>
|
||||
)
|
||||
})
|
||||
}
|
||||
export default memo(OrderState)
|
||||
|
||||
+164
-162
@@ -9,9 +9,9 @@ import OrderState from './components/orderState'
|
||||
import AddressDetailBox from './components/addressDetailBox'
|
||||
import { formatDateTime, formatHashTag, formatImgUrl, formatPriceDiv, formatWeightDiv } from '@/common/format'
|
||||
import {
|
||||
mpreturnApplyOrder,
|
||||
returnApplyOrdercancel,
|
||||
returnApplyOrderuploadAccessory,
|
||||
MpReturnApplyOrder,
|
||||
ReturnApplyOrderCancel,
|
||||
ReturnApplyOrderUploadAccessory,
|
||||
} from '@/api/refound'
|
||||
import { IMG_CND_Prefix } from '@/common/constant'
|
||||
import Popup from '@/components/popup'
|
||||
@@ -20,17 +20,150 @@ import { alert } from '@/common/common'
|
||||
import RefundCodelist from '@/components/RefundCodelist'
|
||||
import LabAndImg from '@/components/LabAndImg'
|
||||
|
||||
export default () => {
|
||||
// 页面下拉刷新
|
||||
usePullDownRefresh(() => {
|
||||
getDetail()
|
||||
})
|
||||
const router = useRouter()
|
||||
useEffect(() => {
|
||||
getDetail()
|
||||
interface Obs {
|
||||
title?: string
|
||||
modeName?: string
|
||||
showMode?: boolean
|
||||
children?: ReactNode
|
||||
clickNode?: () => void
|
||||
}
|
||||
|
||||
const DefaultBox = (props: Obs) => {
|
||||
const {
|
||||
title = '标题',
|
||||
modeName = '大货',
|
||||
showMode = false,
|
||||
children,
|
||||
clickNode,
|
||||
} = props
|
||||
|
||||
return (
|
||||
<View className={styles.defaltBox}>
|
||||
<View className={styles.titleBox}>
|
||||
<View className={styles.title}>{title}</View>
|
||||
{
|
||||
showMode && <View className={styles.modeName} onClick={() => clickNode?.()}>{modeName}</View>
|
||||
}
|
||||
</View>
|
||||
<View className={styles.modeLine}></View>
|
||||
{children}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
const DefaultBoxWithMemo = memo(DefaultBox)
|
||||
|
||||
interface PropGoods {
|
||||
// item?: {
|
||||
// code?: string | number
|
||||
// }
|
||||
list: any[]
|
||||
obj: any
|
||||
}
|
||||
|
||||
const GoodsItem = (porps: PropGoods) => {
|
||||
const { list = [], obj = {} } = porps
|
||||
|
||||
const labAndImgObj = useCallback((item) => {
|
||||
return { lab: item.lab, rgb: item.rgb, texture_url: item.texture_url }
|
||||
}, [])
|
||||
return (
|
||||
<>
|
||||
{
|
||||
list.map((item, index) => {
|
||||
return (
|
||||
<View className={styles.goodsBox} key={index}>
|
||||
<View className={styles.goodsProduct}>{item.code}# {item.name}</View>
|
||||
{
|
||||
item.product_colors.map((it, inx) => {
|
||||
return (
|
||||
<View className={styles.itemGoods} key={inx}>
|
||||
{
|
||||
it.texture_url === ''
|
||||
&& <Image className={styles.itemPic} mode="aspectFill" src="https://test.cdn.zzfzyc.com/mall/no_img.png"></Image>
|
||||
}
|
||||
{
|
||||
it.texture_url !== ''
|
||||
&& <View className={styles.itemPic}>
|
||||
<LabAndImg value={labAndImgObj(it)} />
|
||||
</View>
|
||||
}
|
||||
<View className={styles.clear}> </View>
|
||||
<View className={styles.itemRight}>
|
||||
<View className={styles.item_right_top}>
|
||||
<View className={styles.itemName}>{it.code}# {it.name}</View>
|
||||
{/* <View className={styles.itemNums}>x{obj?.sale_mode === 0 ? it.roll : it.length / 100}{obj?.sale_mode === 0 ? '条' : 'm'}</View> */}
|
||||
{
|
||||
obj.sale_mode == 0 && <View className={styles.itemNums}>x{obj.stage == 0 || obj.stage == 1 || obj.stage == 2
|
||||
? it.roll
|
||||
: obj.stage == 5 || obj.stage == 6 || obj.stage == 3
|
||||
? it.return_roll
|
||||
: it.roll}{obj?.sale_mode == 0 ? '条' : 'm'}</View>
|
||||
}
|
||||
{
|
||||
obj.sale_mode != 0 && <View className={styles.itemNums}>x{it.length / 100}m</View>
|
||||
}
|
||||
</View>
|
||||
<View className={styles.item_right_Bottom}>
|
||||
<View className={styles.itemMoney}>¥{it.sale_price / 100}/{obj?.sale_mode == 0 ? 'kg' : 'm'}</View>
|
||||
{/* <View className={styles.itemMoneyOne}>¥{formatPriceDiv(it.total_sale_price)}</View> */}
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
)
|
||||
})
|
||||
}
|
||||
</View>
|
||||
)
|
||||
})
|
||||
}
|
||||
</>
|
||||
|
||||
)
|
||||
}
|
||||
const GoodsItemWithMemo = memo(GoodsItem)
|
||||
|
||||
const RefundDetail = () => {
|
||||
// 页面下拉刷新
|
||||
const router = useRouter()
|
||||
// 查看图片
|
||||
const [ShowPic, setShowPic] = useState(false)
|
||||
|
||||
const [PicList, setPicList] = useState<any[]>([])
|
||||
// 订单信息文字数组
|
||||
const [orderMsg, setOrderMsg] = useState<any[]>([
|
||||
{
|
||||
leftTitle: '售后编号:',
|
||||
rightTitle: '------',
|
||||
showBtn: true,
|
||||
},
|
||||
{
|
||||
leftTitle: '订单号:',
|
||||
rightTitle: '------',
|
||||
showBtn: true,
|
||||
},
|
||||
{
|
||||
leftTitle: '退货原因:',
|
||||
rightTitle: '------',
|
||||
},
|
||||
{
|
||||
leftTitle: '退货说明:',
|
||||
rightTitle: '------',
|
||||
},
|
||||
{
|
||||
leftTitle: '其他说明:',
|
||||
rightTitle: '------',
|
||||
},
|
||||
{
|
||||
leftTitle: '货物状况:',
|
||||
rightTitle: '------',
|
||||
},
|
||||
{
|
||||
leftTitle: '申请时间:',
|
||||
rightTitle: '------',
|
||||
},
|
||||
])
|
||||
// 获取详情
|
||||
const { fetchData: detailFetch } = mpreturnApplyOrder()
|
||||
const { fetchData: detailFetch } = MpReturnApplyOrder()
|
||||
const [DeatailObj, setDeatailObj] = useState<any>({})
|
||||
const getDetail = async() => {
|
||||
Taro.showLoading({
|
||||
@@ -40,7 +173,7 @@ export default () => {
|
||||
const res = await detailFetch({ id: Number(router.params.id) })
|
||||
if (res.data) {
|
||||
setDeatailObj(res.data)
|
||||
orderMsg.map((it) => {
|
||||
orderMsg.forEach((it) => {
|
||||
if (it.leftTitle === '售后编号:') {
|
||||
it.rightTitle = res.data.return_order_no
|
||||
}
|
||||
@@ -82,40 +215,6 @@ export default () => {
|
||||
}
|
||||
}, [DeatailObj])
|
||||
|
||||
// 订单信息文字数组
|
||||
const [orderMsg, setOrderMsg] = useState<any[]>([
|
||||
{
|
||||
leftTitle: '售后编号:',
|
||||
rightTitle: '------',
|
||||
showBtn: true,
|
||||
},
|
||||
{
|
||||
leftTitle: '订单号:',
|
||||
rightTitle: '------',
|
||||
showBtn: true,
|
||||
},
|
||||
{
|
||||
leftTitle: '退货原因:',
|
||||
rightTitle: '------',
|
||||
},
|
||||
{
|
||||
leftTitle: '退货说明:',
|
||||
rightTitle: '------',
|
||||
},
|
||||
{
|
||||
leftTitle: '其他说明:',
|
||||
rightTitle: '------',
|
||||
},
|
||||
{
|
||||
leftTitle: '货物状况:',
|
||||
rightTitle: '------',
|
||||
},
|
||||
{
|
||||
leftTitle: '申请时间:',
|
||||
rightTitle: '------',
|
||||
},
|
||||
])
|
||||
|
||||
// 复制功能
|
||||
const clipboardData = (val) => {
|
||||
Taro.setClipboardData({
|
||||
@@ -130,7 +229,7 @@ export default () => {
|
||||
}
|
||||
|
||||
// 取消退货
|
||||
const { fetchData: cancelFetch } = returnApplyOrdercancel()
|
||||
const { fetchData: cancelFetch } = ReturnApplyOrderCancel()
|
||||
const handCancle = async() => {
|
||||
Taro.showModal({
|
||||
content: '确定要取消吗?',
|
||||
@@ -160,10 +259,6 @@ export default () => {
|
||||
},
|
||||
})
|
||||
}
|
||||
// 查看图片
|
||||
const [ShowPic, setShowPic] = useState(false)
|
||||
|
||||
const [PicList, setPicList] = useState<any[]>([])
|
||||
|
||||
const handUp = (value) => {
|
||||
setShowPic(true)
|
||||
@@ -185,7 +280,7 @@ export default () => {
|
||||
}, [])
|
||||
|
||||
// 提交附件
|
||||
const { fetchData: sureFetch } = returnApplyOrderuploadAccessory()
|
||||
const { fetchData: sureFetch } = ReturnApplyOrderUploadAccessory()
|
||||
const handSure = () => {
|
||||
let arr: any = []
|
||||
arr = [...picUrl.current]
|
||||
@@ -234,7 +329,12 @@ export default () => {
|
||||
const handSee = () => {
|
||||
setShowCode(true)
|
||||
}
|
||||
|
||||
usePullDownRefresh(() => {
|
||||
getDetail()
|
||||
})
|
||||
useEffect(() => {
|
||||
getDetail()
|
||||
}, [])
|
||||
return (
|
||||
<View className={styles.main}>
|
||||
<OrderState orderInfo={DeatailObj} />
|
||||
@@ -242,7 +342,7 @@ export default () => {
|
||||
obj={DeatailObj}
|
||||
handUp={() => handUp(DeatailObj)}
|
||||
></AddressDetailBox>
|
||||
<DefaultBox
|
||||
<DefaultBoxWithMemo
|
||||
showMode
|
||||
title="客户信息"
|
||||
modeName={DeatailObj.sale_mode_name}
|
||||
@@ -251,9 +351,9 @@ export default () => {
|
||||
<View className={styles.pussName}>{DeatailObj.purchaser_name}</View>
|
||||
<View className={styles.pussPhone}>{DeatailObj.purchaser_phone}</View>
|
||||
</View>
|
||||
</DefaultBox>
|
||||
<DefaultBox title="退款信息">
|
||||
<GoodsItem list={productList} obj={DeatailObj}></GoodsItem>
|
||||
</DefaultBoxWithMemo>
|
||||
<DefaultBoxWithMemo title="退款信息">
|
||||
<GoodsItemWithMemo list={productList} obj={DeatailObj}></GoodsItemWithMemo>
|
||||
<View className={styles.totalBox}>
|
||||
<View className={styles.totalLeft}>总计</View>
|
||||
<View className={styles.totalRight}>{DeatailObj.total_fabrics} 种面料,{DeatailObj?.total_colors} 种颜色,共 {
|
||||
@@ -270,8 +370,8 @@ export default () => {
|
||||
</View>
|
||||
|
||||
}
|
||||
</DefaultBox>
|
||||
<DefaultBox title="订单信息">
|
||||
</DefaultBoxWithMemo>
|
||||
<DefaultBoxWithMemo title="订单信息">
|
||||
{
|
||||
orderMsg.map((item, index) => {
|
||||
return (
|
||||
@@ -289,8 +389,8 @@ export default () => {
|
||||
})
|
||||
}
|
||||
|
||||
</DefaultBox>
|
||||
<DefaultBox title="售后图片">
|
||||
</DefaultBoxWithMemo>
|
||||
<DefaultBoxWithMemo title="售后图片">
|
||||
<View className={styles.picBox}>
|
||||
{
|
||||
DeatailObj?.fabric_piece_accessory_url?.length > 0 && DeatailObj?.fabric_piece_accessory_url.map((item, index) => {
|
||||
@@ -305,7 +405,7 @@ export default () => {
|
||||
DeatailObj?.fabric_piece_accessory_url?.length === 0 && <View className={styles.noPic}>暂无图片</View>
|
||||
}
|
||||
</View>
|
||||
</DefaultBox>
|
||||
</DefaultBoxWithMemo>
|
||||
<View className={styles.safeBox}></View>
|
||||
|
||||
<View className={styles.bottomMuck}>
|
||||
@@ -336,102 +436,4 @@ export default () => {
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
interface Obs {
|
||||
title?: string
|
||||
modeName?: string
|
||||
showMode?: boolean
|
||||
children?: ReactNode
|
||||
clickNode?: () => void
|
||||
}
|
||||
|
||||
const DefaultBox = memo((props: Obs) => {
|
||||
const {
|
||||
title = '标题',
|
||||
modeName = '大货',
|
||||
showMode = false,
|
||||
children,
|
||||
clickNode,
|
||||
} = props
|
||||
|
||||
return (
|
||||
<View className={styles.defaltBox}>
|
||||
<View className={styles.titleBox}>
|
||||
<View className={styles.title}>{title}</View>
|
||||
{
|
||||
showMode && <View className={styles.modeName} onClick={() => clickNode?.()}>{modeName}</View>
|
||||
}
|
||||
</View>
|
||||
<View className={styles.modeLine}></View>
|
||||
{children}
|
||||
</View>
|
||||
)
|
||||
})
|
||||
|
||||
interface PropGoods {
|
||||
// item?: {
|
||||
// code?: string | number
|
||||
// }
|
||||
list: any[]
|
||||
obj: any
|
||||
}
|
||||
const GoodsItem = memo((porps: PropGoods) => {
|
||||
const { list = [], obj = {} } = porps
|
||||
|
||||
const labAndImgObj = useCallback((item) => {
|
||||
return { lab: item.lab, rgb: item.rgb, texture_url: item.texture_url }
|
||||
}, [])
|
||||
return (
|
||||
<>
|
||||
{
|
||||
list.map((item, index) => {
|
||||
return (
|
||||
<View className={styles.goodsBox} key={index}>
|
||||
<View className={styles.goodsProduct}>{item.code}# {item.name}</View>
|
||||
{
|
||||
item.product_colors.map((it, inx) => {
|
||||
return (
|
||||
<View className={styles.itemGoods}>
|
||||
{
|
||||
it.texture_url === ''
|
||||
&& <Image className={styles.itemPic} mode="aspectFill" src="https://test.cdn.zzfzyc.com/mall/no_img.png"></Image>
|
||||
}
|
||||
{
|
||||
it.texture_url !== ''
|
||||
&& <View className={styles.itemPic}>
|
||||
<LabAndImg value={labAndImgObj(it)} />
|
||||
</View>
|
||||
}
|
||||
<View className={styles.clear}> </View>
|
||||
<View className={styles.itemRight}>
|
||||
<View className={styles.item_right_top}>
|
||||
<View className={styles.itemName}>{it.code}# {it.name}</View>
|
||||
{/* <View className={styles.itemNums}>x{obj?.sale_mode === 0 ? it.roll : it.length / 100}{obj?.sale_mode === 0 ? '条' : 'm'}</View> */}
|
||||
{
|
||||
obj.sale_mode == 0 && <View className={styles.itemNums}>x{obj.stage == 0 || obj.stage == 1 || obj.stage == 2
|
||||
? it.roll
|
||||
: obj.stage == 5 || obj.stage == 6 || obj.stage == 3
|
||||
? it.return_roll
|
||||
: it.roll}{obj?.sale_mode == 0 ? '条' : 'm'}</View>
|
||||
}
|
||||
{
|
||||
obj.sale_mode != 0 && <View className={styles.itemNums}>x{it.length / 100}m</View>
|
||||
}
|
||||
</View>
|
||||
<View className={styles.item_right_Bottom}>
|
||||
<View className={styles.itemMoney}>¥{it.sale_price / 100}/{obj?.sale_mode == 0 ? 'kg' : 'm'}</View>
|
||||
{/* <View className={styles.itemMoneyOne}>¥{formatPriceDiv(it.total_sale_price)}</View> */}
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
)
|
||||
})
|
||||
}
|
||||
</View>
|
||||
)
|
||||
})
|
||||
}
|
||||
</>
|
||||
|
||||
)
|
||||
})
|
||||
export default RefundDetail
|
||||
|
||||
Reference in New Issue
Block a user