🌈 style(eslint): 解决eslint的错误❌
This commit is contained in:
parent
bd06efef61
commit
9e7b4d7d56
@ -7,6 +7,7 @@
|
||||
"eqeqeq": "off",
|
||||
"no-prototype-builtins": "off",
|
||||
"import/first": "off",
|
||||
"react/no-children-prop": "off"
|
||||
"react/no-children-prop": "off",
|
||||
"import/no-commonjs": "off"
|
||||
}
|
||||
}
|
||||
|
||||
2
global.d.ts
vendored
2
global.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
/// <reference path="node_modules/@tarojs/plugin-platform-weapp/types/shims-weapp.d.ts" />
|
||||
/// <reference types="@tarojs/taro" />
|
||||
|
||||
declare module '*.png'
|
||||
declare module '*.gif'
|
||||
|
||||
@ -4,7 +4,7 @@ import { useRequest } from '@/use/useHttp'
|
||||
export { LoginApi } from './login/index'
|
||||
|
||||
export {
|
||||
productabsorbcontrast,
|
||||
ProductAbsorbContrast,
|
||||
SelectProductListApi,
|
||||
ColorListApi,
|
||||
ColorDetailedApi,
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
export { productabsorbcontrast, SelectProductListApi } from './product'
|
||||
export { ProductAbsorbContrast, SelectProductListApi } from './product'
|
||||
export { ColorListApi, ColorDetailedApi, ColorSamplingSaveApi, TextureSaveApi } from './takeColor'
|
||||
export { FindColorListApi } from './findColor'
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { useRequest } from '@/use/useHttp'
|
||||
|
||||
// 取色对比
|
||||
export const productabsorbcontrast = () => {
|
||||
export const ProductAbsorbContrast = () => {
|
||||
return useRequest({
|
||||
url: '/v2/mp/product/color/absorb/contrast',
|
||||
method: 'get',
|
||||
|
||||
@ -18,9 +18,9 @@ const smallToBig = function(money) {
|
||||
const cnInteger = '整' // 整数金额时后面跟的字符
|
||||
const cnIntLast = '元' // 整数完以后的单位
|
||||
// 最大处理的数字
|
||||
// eslint-disable-next-line @typescript-eslint/no-loss-of-precision
|
||||
const maxNum = 999999999999999.9999
|
||||
let integerNum // 金额整数部分
|
||||
let decimalNum // 金额小数部分
|
||||
|
||||
// 输出的中文金额字符串
|
||||
let chineseStr = ''
|
||||
let parts // 分离金额后用的数组,预定义
|
||||
@ -40,15 +40,15 @@ const smallToBig = function(money) {
|
||||
|
||||
// 四舍五入保留两位小数,转换为字符串
|
||||
money = Math.round(money * 100).toString()
|
||||
integerNum = money.substr(0, money.length - 2)
|
||||
decimalNum = money.substr(money.length - 2)
|
||||
const integerNum = money.substr(0, money.length - 2) // 金额整数部分
|
||||
const decimalNum = money.substr(money.length - 2) // 金额小数部分
|
||||
|
||||
// 获取整型部分转换
|
||||
if (parseInt(integerNum, 10) > 0) {
|
||||
let zeroCount = 0
|
||||
const IntLen = integerNum.length
|
||||
for (var i = 0; i < IntLen; i++) {
|
||||
var n = integerNum.substr(i, 1)
|
||||
for (let i = 0; i < IntLen; i++) {
|
||||
const n = integerNum.substr(i, 1)
|
||||
const p = IntLen - i - 1
|
||||
const q = p / 4
|
||||
const m = p % 4
|
||||
@ -72,8 +72,8 @@ const smallToBig = function(money) {
|
||||
// 小数部分
|
||||
if (decimalNum != '') {
|
||||
const decLen = decimalNum.length
|
||||
for (var i = 0; i < decLen; i++) {
|
||||
var n = decimalNum.substr(i, 1)
|
||||
for (let i = 0; i < decLen; i++) {
|
||||
const n = decimalNum.substr(i, 1)
|
||||
if (n != '0') {
|
||||
chineseStr += cnNums[Number(n)] + cnDecUnits[i]
|
||||
}
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
|
||||
import Taro, { showModal, useDidShow, useRouter } from '@tarojs/taro'
|
||||
import { Button, Navigator, ScrollView, Text, View } from '@tarojs/components'
|
||||
import { forwardRef, memo, useEffect, useImperativeHandle, useState } from 'react'
|
||||
import './index.scss'
|
||||
import { MpPurchaserAddressList } from '@/api/addressList'
|
||||
import { alert } from '@/common/common'
|
||||
import Taro, { showModal, useDidShow, useRouter } from '@tarojs/taro'
|
||||
import IconFont from '@/components/iconfont/iconfont'
|
||||
import { MpSaleOrderAddress } from '@/api/order'
|
||||
|
||||
|
||||
@ -16,8 +16,7 @@ interface Param {
|
||||
}|null
|
||||
onClick?: (val: number) => void // 点击后触发的事件,返回订单状态
|
||||
}
|
||||
|
||||
export default memo(({ orderInfo, onClick }: Param) => {
|
||||
const AfterOrderBtns = ({ orderInfo, onClick }: Param) => {
|
||||
// 订单状态枚举
|
||||
const {
|
||||
SaleOrderStatusBooking,
|
||||
@ -93,15 +92,15 @@ export default memo(({ orderInfo, onClick }: Param) => {
|
||||
if (item.id == 1) {
|
||||
// 取消订单按钮
|
||||
return (orderInfo.actual_amount == 0 && item.value.includes(orderInfo.status)) // 在待发货之前没有付过款
|
||||
}
|
||||
}
|
||||
else if (item.id == 2) {
|
||||
// 去付款按钮
|
||||
return (orderInfo.wait_pay_amount != 0 && item.value.includes(orderInfo.status)) // 只要没有付完款就显示
|
||||
}
|
||||
}
|
||||
else if (item.id == 3) {
|
||||
// 申请退款, 只有大货才有
|
||||
return (orderInfo.sale_mode == SaLeModeBulk.value && orderInfo.actual_amount != 0 && item.value.includes(orderInfo.status)) // 大货在待发货付过款
|
||||
}
|
||||
}
|
||||
else if (item.id == 8) {
|
||||
// 退款按钮(直接退款不用申请), 只有散剪和剪板有
|
||||
return (orderInfo.sale_mode != SaLeModeBulk.value && orderInfo.actual_amount != 0 && item.value.includes(orderInfo.status)) // 散剪和剪板在待接单时付过款
|
||||
@ -120,13 +119,6 @@ export default memo(({ orderInfo, onClick }: Param) => {
|
||||
})
|
||||
}, [orderInfo])
|
||||
|
||||
// 点击按钮操作
|
||||
const submitBtns = (val, index) => {
|
||||
(val == 1) && cancelOrder(); // 取消订单按钮
|
||||
(val == 2) && onClick?.(2); // 去付款按钮
|
||||
(val == 6) && receiveOrder() // 确认收货
|
||||
}
|
||||
|
||||
// 取消订单
|
||||
const { fetchData: cancelFetchData } = CancelOrderApi()
|
||||
const cancelOrder = () => {
|
||||
@ -138,11 +130,11 @@ export default memo(({ orderInfo, onClick }: Param) => {
|
||||
if (res.success) {
|
||||
alert.success('取消成功')
|
||||
onClick?.(1)
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert.none(res.msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
@ -162,18 +154,23 @@ export default memo(({ orderInfo, onClick }: Param) => {
|
||||
if (res.success) {
|
||||
onClick?.(6)
|
||||
alert.success('收货成功')
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert.error('收货失败')
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 点击按钮操作
|
||||
const submitBtns = (val, index) => {
|
||||
(val == 1) && cancelOrder(); // 取消订单按钮
|
||||
(val == 2) && onClick?.(2); // 去付款按钮
|
||||
(val == 6) && receiveOrder() // 确认收货
|
||||
}
|
||||
// 显示更多按钮
|
||||
const [showMore, setShowMore] = useState(false)
|
||||
const styleTop = useMemo(() => {
|
||||
@ -202,4 +199,5 @@ export default memo(({ orderInfo, onClick }: Param) => {
|
||||
|
||||
</View>
|
||||
)
|
||||
})
|
||||
}
|
||||
export default memo(AfterOrderBtns)
|
||||
|
||||
@ -87,19 +87,6 @@ const AfterOrderBtns = ({ orderInfo, onClick, fixedBottom = true }: Param) => {
|
||||
})
|
||||
}, [orderInfo])
|
||||
|
||||
// 点击按钮操作
|
||||
const submitBtns = throttle((val, index) => {
|
||||
if (val == 1) {
|
||||
cancelOrder({ title: '要取消退货吗?', val })
|
||||
}
|
||||
else if (val == 6) {
|
||||
cancelOrder({ title: '要取消退款吗?', val })
|
||||
}
|
||||
else {
|
||||
onClick?.(val)
|
||||
}
|
||||
}, 600)
|
||||
|
||||
// 取消退货/退款
|
||||
const { fetchData: returnApplyOrderCancelFetchData } = ReturnApplyOrderCancelApi()
|
||||
const cancelOrder = ({ title = '', val }) => {
|
||||
@ -122,7 +109,18 @@ const AfterOrderBtns = ({ orderInfo, onClick, fixedBottom = true }: Param) => {
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 点击按钮操作
|
||||
const submitBtns = throttle((val, index) => {
|
||||
if (val == 1) {
|
||||
cancelOrder({ title: '要取消退货吗?', val })
|
||||
}
|
||||
else if (val == 6) {
|
||||
cancelOrder({ title: '要取消退款吗?', val })
|
||||
}
|
||||
else {
|
||||
onClick?.(val)
|
||||
}
|
||||
}, 600)
|
||||
// 显示更多按钮
|
||||
const [showMore, setShowMore] = useState(false)
|
||||
const styleTop = useMemo(() => {
|
||||
|
||||
@ -8,7 +8,7 @@ import SearchInput from '@/components/searchInput'
|
||||
import Popup from '@/components/bluetooth/Popup'
|
||||
import useCheckAuthorize from '@/use/useCheckAuthorize'
|
||||
|
||||
export default memo(() => {
|
||||
const LinkBlueTooth = () => {
|
||||
const { state, init, startScan, connect, disconnect } = useBluetooth()
|
||||
|
||||
const { check } = useCheckAuthorize({ scope: 'scope.bluetooth', msg: '请开启小程序蓝牙权限' })
|
||||
@ -21,10 +21,10 @@ export default memo(() => {
|
||||
useEffect(() => {
|
||||
if (!state.available) {
|
||||
setLinkStatus(1)
|
||||
}
|
||||
}
|
||||
else if (state.available && state.connected?.name) {
|
||||
setLinkStatus(3)
|
||||
}
|
||||
}
|
||||
else {
|
||||
setLinkStatus(2)
|
||||
}
|
||||
@ -40,6 +40,9 @@ export default memo(() => {
|
||||
}
|
||||
|
||||
const [popupShow, setPopupShow] = useState(false)
|
||||
const onFindEven = () => {
|
||||
if (!state.discovering && !state.connected && !state.connecting) { startScan() }
|
||||
}
|
||||
// 显示设备列表
|
||||
const onFindDevice = () => {
|
||||
check().then((res) => {
|
||||
@ -48,16 +51,13 @@ export default memo(() => {
|
||||
title: '请打开手机蓝牙',
|
||||
icon: 'none',
|
||||
})
|
||||
}
|
||||
}
|
||||
else {
|
||||
setPopupShow(true)
|
||||
onFindEven()
|
||||
}
|
||||
})
|
||||
}
|
||||
const onFindEven = () => {
|
||||
if (!state.discovering && !state.connected && !state.connecting) { startScan() }
|
||||
}
|
||||
|
||||
// 断开链接
|
||||
const onDisconnect = () => {
|
||||
@ -72,9 +72,11 @@ export default memo(() => {
|
||||
<View className={styles.bluetooth_link} onClick={onFindDevice}>
|
||||
<View className={classnames(styles.link_status, linkStatus == 3 && styles.link_statused, linkStatus == 2 && styles.link_statused_no)}></View>
|
||||
{
|
||||
linkStatus == 1 && <View className={classnames(styles.link_name, styles.link_name_no)}>请开启蓝牙</View>
|
||||
|| linkStatus == 2 && <View className={classnames(styles.link_name, styles.link_name_no_link)}>未连接设备</View>
|
||||
|| linkStatus == 3 && <View className={classnames(styles.link_name)}>{linkName}</View>
|
||||
linkStatus == 1
|
||||
? <View className={classnames(styles.link_name, styles.link_name_no)}>请开启蓝牙</View>
|
||||
: linkStatus == 2
|
||||
? <View className={classnames(styles.link_name, styles.link_name_no_link)}>未连接设备</View>
|
||||
: linkStatus == 3 ? <View className={classnames(styles.link_name)}>{linkName}</View> : null
|
||||
}
|
||||
</View>
|
||||
</SearchInput>
|
||||
@ -89,5 +91,6 @@ export default memo(() => {
|
||||
</View>
|
||||
</>
|
||||
|
||||
)
|
||||
})
|
||||
)
|
||||
}
|
||||
export default memo(LinkBlueTooth)
|
||||
|
||||
@ -7,8 +7,7 @@ interface Params {
|
||||
onClose?: () => void
|
||||
styleObj?: Object
|
||||
}
|
||||
|
||||
export default memo(({ onClose, styleObj = {} }: Params) => {
|
||||
const CloseBtn = ({ onClose, styleObj = {} }: Params) => {
|
||||
return (
|
||||
<View style={styleObj} className={style.icon_a_cuowuwrong_self} onClick={onClose}>
|
||||
<View className={style.icon_a_btn}>
|
||||
@ -16,4 +15,5 @@ export default memo(({ onClose, styleObj = {} }: Params) => {
|
||||
</View>
|
||||
</View>
|
||||
)
|
||||
})
|
||||
}
|
||||
export default memo(CloseBtn)
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { Block, View } from '@tarojs/components'
|
||||
import Taro from '@tarojs/taro'
|
||||
import type { FC } from 'react'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import './iconfont.scss'
|
||||
import Taro from '@tarojs/taro'
|
||||
import classnames from 'classnames'
|
||||
|
||||
const SystemWidth = Taro.getSystemInfoSync().windowWidth
|
||||
|
||||
@ -16,8 +16,7 @@ interface Param {
|
||||
}|null
|
||||
onClick?: (val: number) => void // 点击后触发的事件,返回订单状态
|
||||
}
|
||||
|
||||
export default memo(({ orderInfo, onClick }: Param) => {
|
||||
const OrderBtns = ({ orderInfo, onClick }: Param) => {
|
||||
// 订单状态枚举
|
||||
const {
|
||||
SaleOrderStatusBooking,
|
||||
@ -93,15 +92,15 @@ export default memo(({ orderInfo, onClick }: Param) => {
|
||||
if (item.id == 1) {
|
||||
// 取消订单按钮
|
||||
return (orderInfo.actual_amount == 0 && item.value.includes(orderInfo.status)) // 在待发货之前没有付过款
|
||||
}
|
||||
}
|
||||
else if (item.id == 2) {
|
||||
// 去付款按钮
|
||||
return (orderInfo.wait_pay_amount != 0 && item.value.includes(orderInfo.status)) // 只要没有付完款就显示
|
||||
}
|
||||
}
|
||||
else if (item.id == 3) {
|
||||
// 申请退款, 只有大货才有
|
||||
return (orderInfo.sale_mode == SaLeModeBulk.value && orderInfo.actual_amount != 0 && item.value.includes(orderInfo.status)) // 大货在待发货付过款
|
||||
}
|
||||
}
|
||||
else if (item.id == 8) {
|
||||
// 退款按钮(直接退款不用申请), 只有散剪和剪板有
|
||||
return (orderInfo.sale_mode != SaLeModeBulk.value && orderInfo.actual_amount != 0 && item.value.includes(orderInfo.status)) // 散剪和剪板在待接单时付过款
|
||||
@ -120,13 +119,6 @@ export default memo(({ orderInfo, onClick }: Param) => {
|
||||
})
|
||||
}, [orderInfo])
|
||||
|
||||
// 点击按钮操作
|
||||
const submitBtns = (val, index) => {
|
||||
(val == 1) && cancelOrder(); // 取消订单按钮
|
||||
(val == 2) && onClick?.(2); // 去付款按钮
|
||||
(val == 6) && receiveOrder() // 确认收货
|
||||
}
|
||||
|
||||
// 取消订单
|
||||
const { fetchData: cancelFetchData } = CancelOrderApi()
|
||||
const cancelOrder = () => {
|
||||
@ -138,11 +130,11 @@ export default memo(({ orderInfo, onClick }: Param) => {
|
||||
if (res.success) {
|
||||
alert.success('取消成功')
|
||||
onClick?.(1)
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert.none(res.msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
@ -162,18 +154,23 @@ export default memo(({ orderInfo, onClick }: Param) => {
|
||||
if (res.success) {
|
||||
onClick?.(6)
|
||||
alert.success('收货成功')
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert.error('收货失败')
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 点击按钮操作
|
||||
const submitBtns = (val, index) => {
|
||||
(val == 1) && cancelOrder(); // 取消订单按钮
|
||||
(val == 2) && onClick?.(2); // 去付款按钮
|
||||
(val == 6) && receiveOrder() // 确认收货
|
||||
}
|
||||
// 显示更多按钮
|
||||
const [showMore, setShowMore] = useState(false)
|
||||
const styleTop = useMemo(() => {
|
||||
@ -202,4 +199,5 @@ export default memo(({ orderInfo, onClick }: Param) => {
|
||||
|
||||
</View>
|
||||
)
|
||||
})
|
||||
}
|
||||
export default memo(OrderBtns)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import Popup from '@/components/popup'
|
||||
import { memo } from 'react'
|
||||
import './index.scss'
|
||||
import TimePicker from '../timePicker'
|
||||
import Popup from '@/components/popup'
|
||||
|
||||
type DateArg = string | number | Date
|
||||
interface Props {
|
||||
|
||||
@ -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({
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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 = () => {
|
||||
// 获取客户
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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])
|
||||
|
||||
|
||||
@ -7,13 +7,15 @@ const composeEnhancers
|
||||
&& (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
|
||||
? (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
|
||||
// Specify extension’s options like name, actionsBlacklist, actionsCreators, serialize...
|
||||
}) : compose
|
||||
})
|
||||
: compose
|
||||
|
||||
const middlewares = [
|
||||
thunkMiddleware,
|
||||
]
|
||||
|
||||
if (process.env.NODE_ENV === 'development' && process.env.TARO_ENV !== 'quickapp') {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
middlewares.push(require('redux-logger').createLogger())
|
||||
}
|
||||
|
||||
|
||||
@ -69,7 +69,10 @@ const stateObj: BluetoothStateType = {
|
||||
// 取色仪主动返回的数据
|
||||
deviceLab: null,
|
||||
}
|
||||
const ContextBlueTooth = (props) => {
|
||||
interface PropsType {
|
||||
children?: React.ReactNode
|
||||
}
|
||||
const ContextBlueTooth = (props: PropsType) => {
|
||||
const refStatus = useRef(stateObj)
|
||||
const [state, setState] = useState(refStatus.current)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user