🌈 style(eslint): 解决eslint的错误❌

This commit is contained in:
xuan
2022-12-01 18:10:18 +08:00
parent bd06efef61
commit 9e7b4d7d56
22 changed files with 222 additions and 223 deletions
@@ -7,7 +7,7 @@ import LinkBlueTooth from '../components/bluetooth/LinkBlueTooth'
import styles from './index.module.scss'
import { useBluetooth } from '@/use/contextBlueTooth'
import { toRgb } from '@/common/bluetooth/color/colorSpace'
import { productabsorbcontrast } from '@/api/index'
import { ProductAbsorbContrast } from '@/api/index'
import { alert } from '@/common/common'
const SampleComparison = () => {
@@ -82,7 +82,7 @@ const SampleComparison = () => {
const [data, setData] = useState('')
const [result, setResult] = useState('')
const { fetchData } = productabsorbcontrast()
const { fetchData } = ProductAbsorbContrast()
const handTake = async() => {
if (searchField.l1 === '') {
Taro.showToast({
+2 -2
View File
@@ -88,9 +88,9 @@ const CustomerDetails = () => {
<View className={styles.item_tagItem}>{infoObj?.purchaser_type_name || '暂无'}</View>
<View className={styles.item_tagItem}>{infoObj?.sale_user_name || '暂无'}</View>
{
infoObj?.label_list?.map((item) => {
infoObj?.label_list?.map((item, key) => {
return (
<View className={styles.item_tagItem}>{item.label_name}</View>
<View key={key} className={styles.item_tagItem}>{item.label_name}</View>
)
})
}
@@ -24,7 +24,7 @@ interface Props {
showBorder?: boolean
handNav?: () => void
}
export default memo((props: Props) => {
const Form = (props: Props) => {
const {
title = '标题',
isQuire = true,
@@ -70,4 +70,5 @@ export default memo((props: Props) => {
{children}
</View>
)
})
}
export default memo(Form)
+1 -2
View File
@@ -9,9 +9,8 @@ import ShopCart from '@/components/shoppingCart'
import { goLink } from '@/common/common'
import { KindListApi, ProductListApi } from '@/api/index'
// import useLogin from '@/use/useLogin'
import { MpProductColorList, MpShoppingCartProductColorList } from '@/api/order'
import { ClientListApi, MpProductColorList, MpShoppingCartProductColorList } from '@/api/order'
import { dataLoadingStatus, getFilterData } from '@/common/util'
import { ClientListApi } from '@/api/order'
const Index = () => {
// 获取客户
+128 -130
View File
@@ -34,8 +34,7 @@ interface filterObj {
sale_mode?: Number | undefined
shipment_mode?: Number | undefined
}
export default () => {
const Order = () => {
// 页码和页数
const [searchField, setSearchField] = useState<{ status: number | unknown; page: number; size: number; order_no: string }>({
status: -1,
@@ -47,6 +46,21 @@ export default () => {
// 获取订单列表
const { fetchData: listFetchData, state: orderState } = OrderListApi()
const [orderData, setOrderData] = useState<{ list: any[]; total: number }>({ list: [], total: 0 })
// 筛选参数
const [searchObj, setsearchObj] = useState<filterObj>({
purchaser_id: '',
clientName: '',
sale_user_id: '',
saleuserName: '',
sale_mode: undefined,
shipment_mode: undefined,
})
// 筛选内容展示
const [showPopup, setshowPopup] = useState(false)
// 上拉加载数据
const pageNum = useRef({ size: searchField.size, page: searchField.page })
// 列表下拉刷新
const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false)
const getOrderList = async() => {
const res = await listFetchData({
...getFilterData(searchField),
@@ -57,8 +71,6 @@ export default () => {
setRefresherTriggeredStatus(() => false)
}
// 列表下拉刷新
const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false)
const getRefresherRefresh = async() => {
pageNum.current.size = 1
setRefresherTriggeredStatus(true)
@@ -67,11 +79,9 @@ export default () => {
// 数据加载状态
const statusMore = useMemo(() => {
console.log({ list: orderData.list, total: orderData.total, status: orderState.loading }, '{ list: orderData.list, total: orderData.total, status: orderState.loading }')
return dataLoadingStatus({ list: orderData.list, total: orderData.total, status: orderState.loading })
return dataLoadingStatus({ list: orderData.list, total: orderData.total, status: orderState.loading! })
}, [orderData, orderState])
// 上拉加载数据
const pageNum = useRef({ size: searchField.size, page: searchField.page })
const getScrolltolower = useCallback(() => {
if (orderData.list.length < orderData.total) {
pageNum.current.page++
@@ -106,8 +116,6 @@ export default () => {
setOrderData(() => ({ list: [], total: 0 }))
setSearchField(val => ({ ...val, order_no: e, size: 10 }))
}, [])
// 筛选内容展示
const [showPopup, setshowPopup] = useState(false)
const showSelctPopup = () => {
setshowPopup(true)
}
@@ -131,15 +139,6 @@ export default () => {
}))
})
// 筛选参数
const [searchObj, setsearchObj] = useState<filterObj>({
purchaser_id: '',
clientName: '',
sale_user_id: '',
saleuserName: '',
sale_mode: undefined,
shipment_mode: undefined,
})
// 跳转选择客户
const navTo = (index) => {
if (index === 1) {
@@ -201,6 +200,18 @@ export default () => {
}
}, [searchObj])
// 数组重置
const resetArr = (arr) => {
arr.map((it) => {
it.checked = false
return it
})
return arr
}
// 确认筛选
const handSure = async() => {
getOrderList()
}
// 重置
const handReset = () => {
pageNum.current.page = 1
@@ -218,19 +229,6 @@ export default () => {
const arrTwo = resetArr(deliveryList)
setdeliveryList([...arrTwo])
}
// 数组重置
const resetArr = (arr) => {
arr.map((it) => {
it.checked = false
return it
})
return arr
}
// 确认筛选
const handSure = async() => {
getOrderList()
}
// 扫描
const handScan = () => {
Taro.scanCode({
@@ -358,6 +356,103 @@ export default () => {
color: '#ffffff',
},
])
// 显示支付
const [showPay, setShowPay] = useState(false)
// 显示线下汇款
const [showOffline, setShowOffine] = useState(false)
// 扫码支付
const [showSide, setShowSide] = useState(true)
const [title, setTitle] = useState('')
const [picUrl, setPicUrl] = useState('')
const { fetchData: payFetch } = GetPayCode()
const handScanpay = async() => {
const list: any = []
itemObj.product_list.forEach((item) => {
item.product_colors.forEach((it) => {
list.push({
product_code: item.code,
product_name: item.name,
product_color_code: it.product_color_code,
product_color_name: it.product_color_name,
num: it.roll.toString(),
weight: formatWeightDiv(it.actual_weight).toString(),
sale_price: (it.sale_price / 100).toString(),
total_price:
it.total_sale_price !== 0
? (it.total_sale_price / 100).toString()
: (it.estimate_amount / 100).toString(),
length: (it.length / 100).toString(),
weight_error: formatWeightDiv(it.weight_error).toString(),
})
})
})
const query = {
list,
title: '面料销售电子确认单',
show_qrcode: true,
show_barcode: true,
show_wait_pay_amount: true,
order_type: itemObj.sale_mode_name,
shipment_mode: itemObj.shipment_mode_name,
company: itemObj.title_purchaser_name,
sale_user: itemObj.sale_user_name,
order_created_time: formatDateTime(itemObj.create_time),
order_no: itemObj.order_no,
target_user_name: itemObj.target_user_name,
target_address: itemObj.address_detail,
target_description: itemObj.remark,
pay_account: itemObj.transfer_remittance_account,
bank_account_name: itemObj.account_name,
bank_name: itemObj.bank_of_deposit,
pay_type: itemObj.settle_mode_name,
client: itemObj.purchaser_name,
phone: itemObj.target_user_phone,
order_total_length: (itemObj.total_number / 100).toString(),
order_total_price: (
itemObj.bill_total_sale_price / 100
).toString(),
total_weight_error_discount: (
itemObj.total_weight_error_discount / 100
).toString(),
order_total_num: itemObj.total_number.toString(),
qrcode: `${PAY_H5_CODE_URL}?sale_order_no=${itemObj.order_no}`,
order_total_weight: (itemObj.total_weight / 1000).toString(),
estimate_amount: (itemObj.estimate_amount / 100).toString(),
total_sale_price: (itemObj.total_sale_price / 100).toString(),
show_total_sale_price: true,
show_total_weight_error_discount: true,
actual_amount: (itemObj.actual_amount / 100).toString(),
wait_pay_amount: (itemObj.wait_pay_amount / 100).toString(),
order_total_weight_error: (
itemObj.total_weight_error / 1000
).toString(),
}
const res = await payFetch(query)
if (res.data) {
console.log(res.data.base64)
setShowSide(false)
setTitle('查看销售码单')
setPicUrl(res.data.base64)
}
}
// 选择支付方式
const clickItem = (item) => {
if (item.name === '扫码支付') { handScanpay() }
if (item.name === '线下汇款') { setShowOffine(true) }
payList.map((it) => {
if (item.id === it.id) {
it.checked = true
}
else {
it.checked = false
}
return it
})
setPayList([...payList])
}
const toPay = async(e, item) => {
e.stopPropagation()
@@ -445,99 +540,6 @@ export default () => {
setTitle('待支付款项')
setShowPay(true)
}
// 选择支付方式
const clickItem = (item) => {
if (item.name === '扫码支付') { handScanpay() }
if (item.name === '线下汇款') { setShowOffine(true) }
payList.map((it) => {
if (item.id === it.id) {
it.checked = true
}
else {
it.checked = false
}
return it
})
setPayList([...payList])
}
// 扫码支付
const [showSide, setShowSide] = useState(true)
const [title, setTitle] = useState('')
const [picUrl, setPicUrl] = useState('')
const { fetchData: payFetch } = GetPayCode()
const handScanpay = async() => {
const list: any = []
itemObj.product_list.forEach((item) => {
item.product_colors.forEach((it) => {
list.push({
product_code: item.code,
product_name: item.name,
product_color_code: it.product_color_code,
product_color_name: it.product_color_name,
num: it.roll.toString(),
weight: formatWeightDiv(it.actual_weight).toString(),
sale_price: (it.sale_price / 100).toString(),
total_price:
it.total_sale_price !== 0
? (it.total_sale_price / 100).toString()
: (it.estimate_amount / 100).toString(),
length: (it.length / 100).toString(),
weight_error: formatWeightDiv(it.weight_error).toString(),
})
})
})
const query = {
list,
title: '面料销售电子确认单',
show_qrcode: true,
show_barcode: true,
show_wait_pay_amount: true,
order_type: itemObj.sale_mode_name,
shipment_mode: itemObj.shipment_mode_name,
company: itemObj.title_purchaser_name,
sale_user: itemObj.sale_user_name,
order_created_time: formatDateTime(itemObj.create_time),
order_no: itemObj.order_no,
target_user_name: itemObj.target_user_name,
target_address: itemObj.address_detail,
target_description: itemObj.remark,
pay_account: itemObj.transfer_remittance_account,
bank_account_name: itemObj.account_name,
bank_name: itemObj.bank_of_deposit,
pay_type: itemObj.settle_mode_name,
client: itemObj.purchaser_name,
phone: itemObj.target_user_phone,
order_total_length: (itemObj.total_number / 100).toString(),
order_total_price: (
itemObj.bill_total_sale_price / 100
).toString(),
total_weight_error_discount: (
itemObj.total_weight_error_discount / 100
).toString(),
order_total_num: itemObj.total_number.toString(),
qrcode: `${PAY_H5_CODE_URL}?sale_order_no=${itemObj.order_no}`,
order_total_weight: (itemObj.total_weight / 1000).toString(),
estimate_amount: (itemObj.estimate_amount / 100).toString(),
total_sale_price: (itemObj.total_sale_price / 100).toString(),
show_total_sale_price: true,
show_total_weight_error_discount: true,
actual_amount: (itemObj.actual_amount / 100).toString(),
wait_pay_amount: (itemObj.wait_pay_amount / 100).toString(),
order_total_weight_error: (
itemObj.total_weight_error / 1000
).toString(),
}
const res = await payFetch(query)
if (res.data) {
console.log(res.data.base64)
setShowSide(false)
setTitle('查看销售码单')
setPicUrl(res.data.base64)
}
}
// 确认交易
const { fetchData: payOneFetch } = OrderPaymentOrderPaymentSubmission()
const { fetchData: payTwoFetch } = OrderPaymentPreCollectOrderOrderPaymentSubmission()
@@ -587,15 +589,10 @@ export default () => {
// }
}
// 显示支付
const [showPay, setShowPay] = useState(false)
// 显示线下汇款
const [showOffline, setShowOffine] = useState(false)
return (
<View>
<View style={{ background: '#FFFFFF', paddingLeft: '20rpx', paddingBottom: '20rpx', position: 'sticky', top: '0', zIndex: '99' }}>
<Search handScan={() => handScan()} defaultValue={searchField.order_no} showScan placeholder="搜索商品/名称/颜色/订单号" showBtn={false} changeOnSearch={getSearchData} debounceTime={300}>
<Search handScan={() => handScan()} defaultValue={searchField.order_no} showScan placeholder="搜索商品/名称/颜色/订单号" showBtn={false} changeOnSearch={getSearchData}>
<View className={styles.flexBox} onClick={() => showSelctPopup()}>
<IconFont name="icon-shaixuan" size={35} color={!isDisabled ? '#0D7CFF' : ''} customClassName={styles.activeshaixuan} />
{/* <View className={classnames('iconfont', 'icon-shaixuan', !isDisabled ? styles.icon_shaixuan : styles.activeshaixuan)}></View> */}
@@ -726,3 +723,4 @@ export default () => {
</View>
)
}
export default Order
-1
View File
@@ -61,7 +61,6 @@ const Delivery: FC = () => {
pageNum.current.page++
const size = pageNum.current.size * pageNum.current.page
setSearch(e => ({ ...e, size }))
console.log(search, 11111)
}
}, [takeDeliveryOrderList])