Compare commits

..

No commits in common. "2510e7ac93e3f3c6b80a79949d3cfaee39be1b9d" and "94c986a21522b0fd34d5ecc187f2fd4b77edb6b9" have entirely different histories.

32 changed files with 401 additions and 755 deletions

View File

@ -32,7 +32,6 @@
"disableUseStrict": false, "disableUseStrict": false,
"useCompilerPlugins": false, "useCompilerPlugins": false,
"minifyWXML": true, "minifyWXML": true,
"condition": false,
"ignoreUploadUnusedFiles": true "ignoreUploadUnusedFiles": true
}, },
"compileType": "miniprogram", "compileType": "miniprogram",

View File

@ -4,6 +4,7 @@ module.exports = {
env: { env: {
NODE_ENV: '"pre"', NODE_ENV: '"pre"',
}, },
outputRoot: 'dist',
defineConstants: { defineConstants: {
CURRENT_BASE_URL: '"https://pre.zzfzyc.com/lymarket"', CURRENT_BASE_URL: '"https://pre.zzfzyc.com/lymarket"',
CURRENT_CAP_HTML_TO_IMAGE_BASE_URL: '"https://pre.zzfzyc.com"', CURRENT_CAP_HTML_TO_IMAGE_BASE_URL: '"https://pre.zzfzyc.com"',

View File

@ -4,6 +4,7 @@ module.exports = {
env: { env: {
NODE_ENV: '"production"', NODE_ENV: '"production"',
}, },
outputRoot: 'build',
defineConstants: { defineConstants: {
CURRENT_BASE_URL: '"https://www.zzfzyc.com/lymarket"', CURRENT_BASE_URL: '"https://www.zzfzyc.com/lymarket"',
CURRENT_CAP_HTML_TO_IMAGE_BASE_URL: '"https://www.zzfzyc.com"', CURRENT_CAP_HTML_TO_IMAGE_BASE_URL: '"https://www.zzfzyc.com"',

View File

@ -31,8 +31,7 @@
}, },
"disableUseStrict": false, "disableUseStrict": false,
"useCompilerPlugins": false, "useCompilerPlugins": false,
"minifyWXML": true, "minifyWXML": true
"condition": false
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.24.5", "libVersion": "2.24.5",

View File

@ -128,27 +128,6 @@
"query": "id=34311", "query": "id=34311",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
},
{
"name": "",
"pathName": "pages/submitOrder/index",
"query": "purchaser_id=1873&sale_mode=0&shopping_cart_product_color_list=%5B75484%2C75485%5D&purchaser_name=%E5%AD%9C%E7%84%B6%E7%83%A4%E9%B1%BF%E9%B1%BC",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/getColorCard/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/submitOrder/index",
"query": "purchaser_id=1861&sale_mode=0&shopping_cart_product_color_list=%5B75615%5D&purchaser_name=%E5%93%88%E5%96%BD",
"launchMode": "default",
"scene": null
} }
] ]
} }

View File

@ -248,19 +248,3 @@ export const RefuseAdjustPriceAudit = () => {
method: 'put', method: 'put',
}) })
} }
// 立即下单(预览)
export const SaleOrderPreViewBuyNow = () => {
return useRequest({
url: '/v2/mp/saleOrder/preView/atOnce',
method: 'put',
})
}
// 立即下单(提交订单)
export const SaleOrderSubmitBuyNow = () => {
return useRequest({
url: '/v2/mp/saleOrder/atOnce',
method: 'post',
})
}

View File

@ -1,14 +1,21 @@
// export const BASE_URL = CURRENT_BASE_URL export const BASE_URL = CURRENT_BASE_URL
// export const BASE_URL = `http://192.168.0.75:50001/lymarket` // export const BASE_URL = `http://192.168.0.75:50001/lymarket`
// export const BASE_URL = `http://192.168.0.89:50001/lymarket` // export const BASE_URL = `http://192.168.0.89:50001/lymarket`
// export const BASE_URL = `http://10.0.0.5:50001/lymarket` // export const BASE_URL = `http://10.0.0.5:50001/lymarket`
// export const BASE_URL = `http://192.168.0.89:40001/lymarket` // export const BASE_URL = `http://192.168.0.89:40001/lymarket`
// export const BASE_URL = `http://192.168.1.165:40001/lymarket` // 王霞
// export const BASE_URL = 'https://test.zzfzyc.com/lymarket' // 测试环境 // export const BASE_URL = 'https://test.zzfzyc.com/lymarket' // 测试环境
export const BASE_URL = 'https://pre.zzfzyc.com/lymarket' // 预发布 // export const BASE_URL = 'https://pre.zzfzyc.com/lymarket' // 预发布
// export const BASE_URL = `http://192.168.1.9:40001/lymarket` // 发
// export const BASE_URL = `http://192.168.1.9:50005/lymarket` // 发
// export const BASE_URL = `http://192.168.1.30:50001/lymarket` // 发
// export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境 // export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境
// export const BASE_URL = 'https://www.zzfzyc.com/lymarket' // 正式环境 // export const BASE_URL = 'https://www.zzfzyc.com/lymarket' // 正式环境
// export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞
// export const BASE_URL = 'http://192.168.1.7:50002/lymarket' // 添 // export const BASE_URL = 'http://192.168.1.7:50002/lymarket' // 添
// export const BASE_URL = 'http://192.168.1.42:50002/lymarket' // 杰 // export const BASE_URL = 'http://192.168.1.42:50002/lymarket' // 杰
// export const BASE_URL = `http://192.168.1.95:40001/lymarket` // 华
// export const BASE_URL = 'http://192.168.1.28:50002/lymarket' // 婷
// CDN // CDN
// 生成密钥 // 生成密钥

View File

@ -0,0 +1,60 @@
.bottomBox {
width: 100%;
height: 132px;
background: #FFFFFF;
box-shadow: 0px -5px 20px -8px rgba(0, 0, 0, 0.06);
display: flex;
padding-top: 16px;
align-items: center;
justify-content: space-between;
overflow: hidden;
.leftBottom {
display: flex;
align-items: center;
margin-left: 12px;
.nowFont {
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #000000;
}
.selctFont {
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #236AFF;
margin-left: 10px;
}
}
.button {
margin-right: 50px;
width: 256px;
height: 80px;
background: #4581FF;
border-radius: 40px;
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
text-align: center;
line-height: 80px;
}
.activeButton {
margin-right: 50px;
width: 256px;
height: 80px;
background: #68b4ff;
border-radius: 40px;
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #fff;
text-align: center;
line-height: 80px;
}
}

View File

@ -0,0 +1,35 @@
import { Button, View } from '@tarojs/components'
import Taro from '@tarojs/taro'
import { memo } from 'react'
import classnames from 'classnames'
import styles from './index.module.scss'
interface prosObj {
isDisabled: boolean
handSure?: () => void
clientId?: Number
clientName?: string
}
const BottomCustomer = (props: prosObj) => {
const {
isDisabled = true,
handSure,
clientName = '',
} = props
const navTo = () => {
Taro.navigateTo({
url: `/pages/customerPage/index?clientId=${props?.clientId}`,
})
}
return (
<View className={styles.bottomBox}>
<View className={styles.leftBottom} onClick={() => { navTo() }}>
<View className={styles.nowFont}></View>
<View className={styles.selctFont}>{clientName === '' ? '请选择客户 >' : `${clientName} >`}</View>
</View>
<Button className={classnames(isDisabled ? styles.activeButton : styles.button)} disabled={isDisabled} onClick={() => { handSure?.() }}> </Button >
</View >
)
}
export default memo(BottomCustomer)

View File

@ -1,14 +1,14 @@
import type { InputProps } from '@tarojs/components'
import { CustomWrapper, Input, View } from '@tarojs/components' import { CustomWrapper, Input, View } from '@tarojs/components'
import type { FC } from 'react' import type { FC } from 'react'
import React from 'react' import React from 'react'
// 解决 input 组件输入过快会出现闪烁的问题 // 解决 input 组件输入过快会出现闪烁的问题
// https://github.com/NervJS/taro/issues/9664 // https://github.com/NervJS/taro/issues/9664
interface PropsType extends InputProps { interface PropsType {
customClassName?: string customClassName?: string
customStyle?: React.CSSProperties customStyle?: React.CSSProperties
customInputStyle?: React.CSSProperties customInputStyle?: React.CSSProperties
customInputClassName?: string customInputClassName?: string
[Property: string]: any
} }
const InputX: FC<PropsType> = (props) => { const InputX: FC<PropsType> = (props) => {
const { customClassName, customStyle, customInputStyle, customInputClassName, ...inputProps } = props const { customClassName, customStyle, customInputStyle, customInputClassName, ...inputProps } = props

View File

@ -1,10 +1,9 @@
import { Image, Input, ScrollView, Text, View } from '@tarojs/components' import { Image, Input, ScrollView, View } from '@tarojs/components'
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react' import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'
import classnames from 'classnames' import classnames from 'classnames'
import styles from './index.module.scss' import styles from './index.module.scss'
import LabAndImg from '@/components/LabAndImg' import LabAndImg from '@/components/LabAndImg'
import { formatPriceDiv, formatWeightDiv } from '@/common/format' import { formatPriceDiv, formatWeightDiv } from '@/common/format'
import { EnumSaleMode } from '@/common/Enumerate'
interface props { interface props {
clickAdd: (any) => void clickAdd: (any) => void
@ -88,19 +87,15 @@ const GoodsItem = (props: props) => {
<View className={styles.title}>{valueInfo?.code} {valueInfo?.name}</View> <View className={styles.title}>{valueInfo?.code} {valueInfo?.name}</View>
<View className={styles.productNums}>{valueInfo?.roll}</View> <View className={styles.productNums}>{valueInfo?.roll}</View>
{ {
modeFont === EnumSaleMode.Bulk && <View className={styles.productName}>{formatWeightDiv(valueInfo?.weight_error) || 0}Kg</View> modeFont === 0 && <View className={styles.productName}>{formatWeightDiv(valueInfo?.weight_error) || 0}Kg</View>
} }
</View> </View>
<View className={styles.rightFontsbox}> <View className={styles.rightFontsbox}>
<View className={styles.moneyFlex}> <View className={styles.moneyFlex}>
{ {
(modeFont === EnumSaleMode.Bulk) && (valueInfo?.last_bulk_price !== valueInfo?.bulk_price) modeFont === 0 && valueInfo?.last_bulk_price !== valueInfo?.bulk_price && <View className={styles.lastBox}>¥{modeFont === 0 ? formatPriceDiv(valueInfo?.last_bulk_price) : modeFont === 1 ? formatPriceDiv(valueInfo?.last_length_cut_price) : formatPriceDiv(valueInfo?.last_weight_cut_price)} {modeFont as any != 1 ? '/Kg' : '/m'}</View>
? <View className={styles.lastBox}>
¥{formatPriceDiv(valueInfo?.last_bulk_price)} /Kg
</View>
: null
} }
<View className={styles.money}>¥{modeFont === EnumSaleMode.Bulk ? formatPriceDiv(valueInfo?.bulk_price) : modeFont === EnumSaleMode.Plate ? formatPriceDiv(valueInfo?.length_cut_price) : formatPriceDiv(valueInfo?.weight_cut_price)}{modeFont !== EnumSaleMode.Plate ? '/Kg' : '/m'}</View> <View className={styles.money}>¥{modeFont === 0 ? formatPriceDiv(valueInfo?.bulk_price) : modeFont === 1 ? formatPriceDiv(valueInfo?.length_cut_price) : formatPriceDiv(valueInfo?.weight_cut_price)}{modeFont != 1 ? '/Kg' : '/m'}</View>
</View> </View>
{ {
valueInfo.showInput valueInfo.showInput

View File

@ -2,12 +2,7 @@ import { View } from '@tarojs/components'
import { memo, useMemo } from 'react' import { memo, useMemo } from 'react'
import style from './index.module.scss' import style from './index.module.scss'
interface LoadingProps { const Loading = ({ width = 60, color = '#6190e8' }: { width?: number; color?: string }) => {
width?: number
color?: string
}
const Loading = (props: LoadingProps) => {
const { width = 60, color = '#6190e8' } = props
const styleObj = useMemo(() => { const styleObj = useMemo(() => {
let obj = {} let obj = {}
if (width > 0) { obj = { width: `${width}rpx`, height: `${width}rpx` } } if (width > 0) { obj = { width: `${width}rpx`, height: `${width}rpx` } }

View File

@ -76,9 +76,12 @@
align-items: center; align-items: center;
color: currentColor; color: currentColor;
.loading { .loading {
display: inline-block; position: absolute;
margin-right: 20px;
pointer-events: none; pointer-events: none;
left: -40px;
top: 50%;
transform: translateY(-50%);
z-index: 1;
} }
} }
// active 伪类 // active 伪类

View File

@ -49,13 +49,6 @@ const NormalButton: FC<NormalButtonPropsType> = (props) => {
return classObject return classObject
} }
const loadingColor = type === 'primary' ? '#fff' : ''
let loadingComponent: JSX.Element | null = null
if (loading) {
loadingComponent = <View className={styles.loading}>
<Loading width={30} color={loadingColor} />
</View>
}
const handleClick = (event) => { const handleClick = (event) => {
if (disabled) { if (disabled) {
return return
@ -66,7 +59,7 @@ const NormalButton: FC<NormalButtonPropsType> = (props) => {
return ( return (
<View className={classnames(styles.button, getClassName(), customClassName)} style={customStyles} onClick={handleClick}> <View className={classnames(styles.button, getClassName(), customClassName)} style={customStyles} onClick={handleClick}>
<View className={classnames(styles['button--text'], customTextClassName)}> <View className={classnames(styles['button--text'], customTextClassName)}>
{loadingComponent} <View className={styles.loading}>{loading && <Loading width={30} />}</View>
{children}</View> {children}</View>
</View> </View>
) )

View File

@ -95,7 +95,7 @@ const Search = (
customStyle={{ width: '100%' }} customStyle={{ width: '100%' }}
/> />
<View className={styles.search_closeBtn}> <View className={styles.search_closeBtn}>
{!!inputCon && <CloseBtn onClose={clearInput} styleObj={{ width: '20rpx', height: '20rpx', backgroundColor: '#fff', border: '0' }} />} {!!inputCon && <CloseBtn onClose={() => clearInput()} styleObj={{ width: '20rpx', height: '20rpx', backgroundColor: '#fff', border: '0' }} />}
</View> </View>
{showScan && ( {showScan && (
<View <View

View File

@ -5,7 +5,7 @@
font-size: 32px; font-size: 32px;
font-weight: 500; font-weight: 500;
color: #000000; color: #000000;
padding-top: 24px; margin-top: 24px;
margin-bottom: 8px; margin-bottom: 8px;
} }
@ -97,15 +97,19 @@
margin-bottom: 32px; margin-bottom: 32px;
} }
.virtualList { .scrollviewBig {
.scrollview {
// height: 300px;
.kongBox { .kongBox {
height: 181px; height: 181px;
width: 100%; width: 100%;
} }
} }
}
.kongOne { .kongOne {
height: 80px; height: 200px;
} }
.loading_more { .loading_more {
@ -128,63 +132,12 @@
.noBottom { .noBottom {
width: 100%; width: 100%;
position: fixed;
z-index: 999;
bottom: env(safe-area-inset-bottom);
} }
} }
.popupHeight { .scrllStyle {
display: flex;
flex-flow: column nowrap;
height: 75vh; height: 75vh;
.shopcartBox {
flex: 1 1 auto;
display: flex;
flex-flow: column nowrap;
overflow: hidden;
.virtualListContainer {
flex: 1 1 auto;
overflow: auto;
}
}
}
// 底部按钮
.bottomBox {
width: 100%;
padding: 20px 20px;
background: #ffffff;
box-shadow: 0px -5px 20px -8px rgba(0, 0, 0, 0.06);
display: flex;
padding-top: 16px;
align-items: center;
justify-content: space-between;
overflow: hidden;
box-sizing: border-box;
.leftBottom {
width: 50%;
display: flex;
align-items: center;
.nowFont {
font-size: 28px;
white-space: nowrap;
font-weight: 400;
color: #000000;
}
.selctFont {
flex: 1 1 auto;
@include common_ellipsis();
font-size: 28px;
font-weight: 400;
color: #236aff;
}
}
.rightBottom {
width: 50%;
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
align-items: center;
}
} }

View File

@ -1,18 +1,16 @@
import { Button, ScrollView, View } from '@tarojs/components' import { ScrollView, View } from '@tarojs/components'
import Taro, { nextTick, useDidShow } from '@tarojs/taro' import { useDidShow } from '@tarojs/taro'
import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from 'react' import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'
import classnames from 'classnames' import classnames from 'classnames'
import VirtualList from '@tarojs/components/virtual-list' import VirtualList from '@tarojs/components/virtual-list'
import Divider from '../divider' import Divider from '../divider'
import NormalButton from '../normalButton'
import styles from './index.module.scss' import styles from './index.module.scss'
import Search from '@/components/search' import Search from '@/components/search'
import Popup from '@/components/popup' import Popup from '@/components/popup'
import Goods from '@/components/goodsItem' import Goods from '@/components/goodsItem'
import BottomCustomer from '@/components/BottomCustomer'
import DotLoading from '@/components/dotLoading' import DotLoading from '@/components/dotLoading'
import { formatDateTime, formatHashTag, formatMeterMul, formatPriceDiv, formatRemoveHashTag, formatWeightDiv } from '@/common/format' import { formatDateTime, formatHashTag, formatPriceDiv, formatRemoveHashTag, formatWeightDiv } from '@/common/format'
import { goLink } from '@/common/common'
import { EnumSaleMode } from '@/common/Enumerate'
interface prosObj { interface prosObj {
showPopup?: false | true showPopup?: false | true
@ -31,7 +29,7 @@ interface prosObj {
name?: string name?: string
} }
modeFont: EnumSaleMode modeFont: Number | string
clientName: string clientName: string
clientId: Number clientId: Number
hasBottom?: true | false // 默认不占位底部 hasBottom?: true | false // 默认不占位底部
@ -50,7 +48,7 @@ const ShoppingCart = (props: prosObj, ref) => {
getSearchData, getSearchData,
handPlus, handPlus,
obj = {}, obj = {},
modeFont = EnumSaleMode.Bulk, modeFont = 0,
clientName = '', clientName = '',
clientId = -1, clientId = -1,
handSure, handSure,
@ -127,81 +125,18 @@ const ShoppingCart = (props: prosObj, ref) => {
} }
const Rows = memo(rows) const Rows = memo(rows)
const isDisabled = useMemo(() => {
return !(selectTotal > 0 && clientName !== '')
}, [selectTotal, clientName])
const navTo = () => {
Taro.navigateTo({
url: `/pages/customerPage/index?clientId=${clientId}`,
})
}
const handBuyNow = () => {
console.log('goodList', goodList, modeFont)
const checkedGoodsKind = goodList.filter(item => item.showInput).map(item => ({
id: item.id,
length: modeFont !== EnumSaleMode.Bulk ? formatMeterMul(item?.nums) : 0,
roll: modeFont === EnumSaleMode.Bulk ? item.nums : 0,
sale_price: formatPriceDiv(item?.sale_price),
}))
goLink('/pages/submitOrder/index', {
purchaser_id: clientId,
sale_mode: modeFont,
sale_order_product_color_list: JSON.stringify(checkedGoodsKind),
purchaser_name: clientName,
isBuyNew: true,
})
}
const [virtualListHeight, setVirtualListHeight] = useState(400)
useLayoutEffect(() => {
console.log('useEffect')
if (showPopup && goodList.length !== 0) {
getVirtualListHeight()
}
}, [showPopup, goodList])
const getVirtualListHeight = () => {
nextTick(() => {
const query = Taro.createSelectorQuery()
query.select('#virtualListContainer').boundingClientRect((res) => {
console.log(res)
const virtualListHeight = res.height
console.log('setVirtualListHeight res', res)
setVirtualListHeight(virtualListHeight)
})
query.exec()
})
}
// useLayoutEffect(() => {
// console.log('useLayoutEffect')
// if (showPopup) {
// const query = Taro.createSelectorQuery()
// query.select('#shopCartBox').boundingClientRect()
// query.select('#virtualList').boundingClientRect()
// query.exec((res) => {
// console.log(res)
// const shopCartBoxHeight = res[0].height
// const virtualListTop = res[1].top
// console.log('setVirtualListHeight res', res)
// setVirtualListHeight(shopCartBoxHeight - virtualListTop)
// })
// }
// }, [showPopup])
return ( return (
<Popup showTitle={false} show={showPopup} onClose={() => closePopup?.()}> <Popup showTitle={false} show={showPopup} onClose={() => closePopup?.()}>
<View className={styles.popupHeight}> <ScrollView className={styles.scrllStyle} scrollY>
<View className={styles.shopcartBox} id="shopCartBox"> <View className={styles.shopcartBox}>
<View className={styles.topTitle}> <View className={styles.topTitle}>
{formatHashTag(obj?.code, obj?.name)} {formatHashTag(obj?.code, obj?.name)}
</View> </View>
<View className={styles.selectFont}> <View className={styles.selectFont}>
1 {selectTotal} {selectNums} {showModefont} 1 {selectTotal} {selectNums} {showModefont}
</View> </View>
<Divider direction="horizontal" customStyles={{ margin: '12px 0' }}></Divider>
<View className={styles.typeFont}></View>
<View className={styles.flexType}> <View className={styles.flexType}>
{typeList.map((item, index) => { {typeList.map((item, index) => {
return ( return (
@ -236,12 +171,12 @@ const ShoppingCart = (props: prosObj, ref) => {
/> />
</View> </View>
</View> </View>
<View id="virtualListContainer" className={styles.virtualListContainer}>
{goodList.length > 0 && ( {goodList.length > 0 && (
<> <>
<View className={styles.scrollviewBig}>
<VirtualList <VirtualList
className={styles.virtualList} className={styles.scrollview}
height={virtualListHeight} /* 列表的高度 */ height={300} /* 列表的高度 */
width="100%" /* 列表的宽度 */ width="100%" /* 列表的宽度 */
itemData={goodList} /* 渲染列表的数据 */ itemData={goodList} /* 渲染列表的数据 */
itemCount={goodList.length + 0} /* 渲染列表的长度 */ itemCount={goodList.length + 0} /* 渲染列表的长度 */
@ -250,32 +185,31 @@ const ShoppingCart = (props: prosObj, ref) => {
> >
{Rows} {Rows}
</VirtualList> </VirtualList>
</View>
{/* <View className={styles.kongOne}></View> */} <View className={styles.kongOne}></View>
</> </>
)} )}
</View>
{goodList.length === 0 && ( {goodList.length === 0 && (
<View className={styles.loading_more}> <View className={styles.loading_more}>
{/* <DotLoading /> */} {/* <DotLoading /> */}
</View> </View>
)} )}
{/* {!hasBottom && <View style={{ height: '100rpx' }}></View>} */} {!hasBottom && <View style={{ height: '100rpx' }}></View>}
</View> {/* <View className={classnames(hasBottom === true ? styles.posBox : styles.noBottom)}> */}
<View className={styles.noBottom}> <View className={styles.noBottom}>
<View className={styles.bottomBox}> <BottomCustomer
<View className={styles.leftBottom} onClick={navTo}> clientName={clientName}
<View className={styles.nowFont}></View> clientId={clientId}
<View className={styles.selctFont}>{clientName === '' ? '请选择客户 >' : `${clientName} >`}</View> isDisabled={!(selectTotal > 0 && clientName !== '')}
</View> handSure={() => {
<View className={styles.rightBottom}> handSure()
<NormalButton round type="primary" disabled={isDisabled} onClick={handBuyNow}></NormalButton> }}
<NormalButton round type="primary" disabled={isDisabled} onClick={handSure}></NormalButton> ></BottomCustomer>
</View>
</View >
</View> </View>
</View> </View>
</ScrollView>
</Popup> </Popup>
) )
} }

View File

@ -2,7 +2,6 @@ import { Button, Input, Textarea, View } from '@tarojs/components'
import Taro, { useDidShow } from '@tarojs/taro' import Taro, { useDidShow } from '@tarojs/taro'
import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import classnames from 'classnames' import classnames from 'classnames'
import Big from 'big.js'
import styles from './index.module.scss' import styles from './index.module.scss'
import Form from './components/form' import Form from './components/form'
import { import {
@ -129,7 +128,7 @@ const AddCollection = () => {
const query = { const query = {
payment_credential_url: picUrl.current, payment_credential_url: picUrl.current,
purchaser_id: Query.purchaser_id, purchaser_id: Query.purchaser_id,
receipt_amount: parseFloat(new Big(Query.money).times(100)), receipt_amount: Number(Query.money) * 100,
receiving_account_id: Query.bankId, receiving_account_id: Query.bankId,
remark: TextareaValue, remark: TextareaValue,
} }

View File

@ -8,6 +8,7 @@ import styles from './index.module.scss'
import Divider from '@/components/divider' import Divider from '@/components/divider'
import Search from '@/components/search' import Search from '@/components/search'
import Popup from '@/components/popup' import Popup from '@/components/popup'
import BottomCustomer from '@/components/BottomCustomer'
import DotLoading from '@/components/dotLoading' import DotLoading from '@/components/dotLoading'
import { formatDateTime, formatHashTag, formatPriceDiv, formatRemoveHashTag, formatWeightDiv } from '@/common/format' import { formatDateTime, formatHashTag, formatPriceDiv, formatRemoveHashTag, formatWeightDiv } from '@/common/format'

View File

@ -5,7 +5,7 @@ import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from '
import classnames from 'classnames' import classnames from 'classnames'
import Remark from '../orderDetails/components/remark' import Remark from '../orderDetails/components/remark'
import styles from './index.module.scss' import styles from './index.module.scss'
import Form from './components/Form' import Form from './components/form'
import Popup from '@/components/popup' import Popup from '@/components/popup'
import { debounce } from '@/common/util' import { debounce } from '@/common/util'
import { alert, goLink } from '@/common/common' import { alert, goLink } from '@/common/common'
@ -370,9 +370,7 @@ const CustomerEditor = () => {
<View className={classnames(remarkDesc === '' ? styles.remarkFontactive : styles.remarkFont)}>{remarkDesc === '' ? '尚未备注信息' : remarkDesc}</View> <View className={classnames(remarkDesc === '' ? styles.remarkFontactive : styles.remarkFont)}>{remarkDesc === '' ? '尚未备注信息' : remarkDesc}</View>
</DefaultBoxWithMemo> </DefaultBoxWithMemo>
<Popup show={showDesc} showTitle={false} onClose={() => setShowDesc(false)}> <Popup show={showDesc} showTitle={false} onClose={() => setShowDesc(false)}>
{ <Remark onSave={e => getRemark(e)} defaultValue={infoObj?.remark} showInput={!!showDesc} />
showDesc && <Remark onSave={e => getRemark(e)} defaultValue={infoObj?.remark} />
}
</Popup> </Popup>
<Address addressOnChange={val => handleSetSite(val)} defaultValue={addressArr} addressOnClose={() => onClose()} show={showSiteModal} /> <Address addressOnChange={val => handleSetSite(val)} defaultValue={addressArr} addressOnClose={() => onClose()} show={showSiteModal} />
<View className={styles.safeBox}></View> <View className={styles.safeBox}></View>

View File

@ -15,7 +15,6 @@ import Remark from '@/pages/orderDetails/components/remark'
import { SubmitColorCardOrder } from '@/api/colorCard' import { SubmitColorCardOrder } from '@/api/colorCard'
import NavBar from '@/pages/order/components/NavBar' import NavBar from '@/pages/order/components/NavBar'
import { MpPurchaserAddressList } from '@/api/addressList' import { MpPurchaserAddressList } from '@/api/addressList'
import { debounce } from '@/common/util'
const AddColorCard = () => { const AddColorCard = () => {
// 获取选择的客户 // 获取选择的客户
@ -93,9 +92,9 @@ const AddColorCard = () => {
// Taro.setStorageSync('colorCardCache', JSON.stringify(order)) // Taro.setStorageSync('colorCardCache', JSON.stringify(order))
} }
const { fetchData, state } = SubmitColorCardOrder() const { fetchData } = SubmitColorCardOrder()
// 提交订单 // 提交订单
const handleSubmitOrder = debounce(async() => { const handleSubmitOrder = async() => {
if (!addressInfo.address_id) { if (!addressInfo.address_id) {
return alert.none('请选择地址') return alert.none('请选择地址')
} }
@ -103,7 +102,6 @@ const AddColorCard = () => {
return alert.none('请选择客户') return alert.none('请选择客户')
} }
if (order.length === 0) { return alert.none('请选择色卡') } if (order.length === 0) { return alert.none('请选择色卡') }
// 请求数据 // 请求数据
const res = await fetchData({ const res = await fetchData({
address_id: addressInfo.address_id, address_id: addressInfo.address_id,
@ -118,9 +116,11 @@ const AddColorCard = () => {
duration: 2000, duration: 2000,
}) })
Taro.removeStorageSync('colorCardCache') Taro.removeStorageSync('colorCardCache')
setTimeout(() => {
goLink('/pages/getColorCard/colorCardDetail/index', { id: res.data.id }, 'redirectTo') goLink('/pages/getColorCard/colorCardDetail/index', { id: res.data.id }, 'redirectTo')
}, 2000)
}
} }
}, 300)
const deleteColorCard = (id) => { const deleteColorCard = (id) => {
setOrder((prev) => { setOrder((prev) => {
@ -372,9 +372,7 @@ const AddColorCard = () => {
<NormalButton <NormalButton
customClassName={styles.bottomBar__button} customClassName={styles.bottomBar__button}
type="primary" type="primary"
disabled={state.loading! || state.success!}
round round
loading={state.loading!}
onClick={handleSubmitOrder} onClick={handleSubmitOrder}
> >
@ -382,9 +380,7 @@ const AddColorCard = () => {
</View> </View>
<Popup show={showDesc} showTitle={false} onClose={() => setShowDesc(false)}> <Popup show={showDesc} showTitle={false} onClose={() => setShowDesc(false)}>
{ <Remark onSave={getRemark} defaultValue={remark} showInput={!!showDesc} />
showDesc && <Remark onSave={getRemark} defaultValue={remark} />
}
</Popup> </Popup>
</View> </View>
} }

View File

@ -63,7 +63,7 @@ const BottomApply = (props: prosObj) => {
|| (obj.sale_mode === 0 && obj.status == 7 && obj.collect_status == 2 && goodsObj?.av_return_product?.length) || (obj.sale_mode === 0 && obj.status == 7 && obj.collect_status == 2 && goodsObj?.av_return_product?.length)
|| (obj.sale_mode === 0 && obj.status == 7 && obj.collect_status == 3 && goodsObj?.av_return_product?.length) || (obj.sale_mode === 0 && obj.status == 7 && obj.collect_status == 3 && goodsObj?.av_return_product?.length)
|| (obj.sale_mode === 0 && obj.status == 11 && (obj.collect_status == 1 || obj.collect_status == 2) && goodsObj?.av_return_product?.length) || (obj.sale_mode === 0 && obj.status == 11 && (obj.collect_status == 1 || obj.collect_status == 2) && goodsObj?.av_return_product?.length)
// || (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 0 && goodsObj?.av_return_product?.length && !obj.is_shipper_picks_up) || (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 0 && goodsObj?.av_return_product?.length && !obj.is_shipper_picks_up)
|| (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 2 && goodsObj?.av_return_product?.length && !obj.is_shipper_picks_up) || (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 2 && goodsObj?.av_return_product?.length && !obj.is_shipper_picks_up)
|| (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 1 && goodsObj?.av_return_product?.length && !obj.is_shipper_picks_up) || (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 1 && goodsObj?.av_return_product?.length && !obj.is_shipper_picks_up)
|| (obj.sale_mode === 1 && obj.status == 0 && goodsObj?.av_return_product?.length) || (obj.sale_mode === 1 && obj.status == 0 && goodsObj?.av_return_product?.length)
@ -130,7 +130,6 @@ const BottomApply = (props: prosObj) => {
|| (obj.sale_mode === 1 && obj.status === 10) || (obj.sale_mode === 1 && obj.status === 10)
|| (obj.sale_mode === 2 && obj.status === 10) || (obj.sale_mode === 2 && obj.status === 10)
|| (obj.sale_mode === 0 && obj.status === 13) || (obj.sale_mode === 0 && obj.status === 13)
|| (obj.collect_status == 0)
) { ) {
return true return true
} }

View File

@ -1,21 +1,21 @@
.order_popup { .order_popup{
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
padding: 20px 0; padding: 20px 0;
.order_popup_title { .order_popup_title{
color: $font_size_big; color: $font_size_big;
font-weight: 700; font-weight: 700;
color: #000000; color: #000000;
padding-bottom: 20px; padding-bottom: 20px;
} }
.order_popup_input { .order_popup_input{
width: 100%; width: 100%;
padding: 0 25px; padding: 0 25px;
box-sizing: border-box; box-sizing: border-box;
margin-top: 43px; margin-top: 43px;
position: relative; position: relative;
.descDataNum { .descDataNum{
position: absolute; position: absolute;
right: 40px; right: 40px;
bottom: 10px; bottom: 10px;
@ -23,8 +23,7 @@
font-size: $font_size_medium; font-size: $font_size_medium;
color: $color_font_two; color: $color_font_two;
} }
textarea{
textarea {
background-color: #f3f3f3; background-color: #f3f3f3;
border-radius: 10px; border-radius: 10px;
width: 100%; width: 100%;
@ -36,20 +35,7 @@
border: 2px solid #e6e6e6; border: 2px solid #e6e6e6;
} }
} }
.recommend_remark { .order_save_address{
margin: 10px 28px;
color: #808080;
font-size: 28px;
}
.recommend_remark_content {
margin: 0 20px;
.tag {
height: 50px;
margin: 0 8px;
margin-bottom: 10px;
}
}
.order_save_address {
height: 82px; height: 82px;
background: #007aff; background: #007aff;
border-radius: 40px; border-radius: 40px;

View File

@ -2,57 +2,14 @@ import { Textarea, View } from '@tarojs/components'
import { useCallback, useEffect, useState } from 'react' import { useCallback, useEffect, useState } from 'react'
import styles from './index.module.scss' import styles from './index.module.scss'
import Popup from '@/components/popup' import Popup from '@/components/popup'
import Tag from '@/components/tag'
interface Param { interface Param {
onBlur?: (val: any) => void onBlur?: (val: any) => void
onSave?: (val: string) => void onSave?: (val: string) => void
defaultValue?: string defaultValue?: string
showInput: boolean
} }
const recommendReport = [ const Remark = ({ onBlur, onSave, defaultValue = '', showInput = false }: Param) => {
{
id: 1,
value: '拿色片',
},
{
id: 2,
value: '顺丰',
},
{
id: 3,
value: '客户自提',
},
{
id: 4,
value: '加急一下',
},
{
id: 5,
value: '物流到',
},
{
id: 6,
value: '中台秀银',
},
{
id: 7,
value: '中台晓茵',
},
{
id: 8,
value: '中台淑婷',
},
{
id: 9,
value: '中台结慧',
},
{
id: 10,
value: '辛苦了',
},
]
const Remark = ({ onBlur, onSave, defaultValue = '' }: Param) => {
const [descData, setDescData] = useState({ const [descData, setDescData] = useState({
number: 0, number: 0,
value: '', value: '',
@ -73,31 +30,16 @@ const Remark = ({ onBlur, onSave, defaultValue = '' }: Param) => {
useEffect(() => { useEffect(() => {
getDesc(defaultValue) getDesc(defaultValue)
}, [defaultValue]) }, [defaultValue])
const onClickTag = (item) => {
setDescData(prev => ({
...prev,
value: prev.value + item.value,
}))
}
return ( return (
<View className={styles.order_popup}> <View className={styles.order_popup}>
<View className={styles.order_popup_title}></View> <View className={styles.order_popup_title}></View>
<View className={styles.order_popup_input}> {
showInput && <View className={styles.order_popup_input}>
<Textarea placeholder="请添加备注" value={descData?.value} maxlength={descData.count} cursorSpacing={100} onInput={e => getDesc(e.detail.value)} onBlur={e => onBlur?.(e)}></Textarea> <Textarea placeholder="请添加备注" value={descData?.value} maxlength={descData.count} cursorSpacing={100} onInput={e => getDesc(e.detail.value)} onBlur={e => onBlur?.(e)}></Textarea>
<View className={styles.descDataNum}>{descData.number}/{descData.count}</View> <View className={styles.descDataNum}>{descData.number}/{descData.count}</View>
</View> </View>
<View>
<View className={styles.recommend_remark}></View>
<View className={styles.recommend_remark_content}>
{
recommendReport.map((item) => {
return <Tag type="info" plain onClick={() => onClickTag(item)} circle customClassName={styles.tag} key={item.id}>{item.value}</Tag>
})
} }
</View>
</View>
<View className={styles.order_save_address} onClick={() => setSave()}></View> <View className={styles.order_save_address} onClick={() => setSave()}></View>
</View> </View>
) )

View File

@ -18,7 +18,6 @@ import { formatRemoveHashTag } from '@/common/format'
import { SubmitCutSampleOrder } from '@/api/sampleCutting' import { SubmitCutSampleOrder } from '@/api/sampleCutting'
import NavBar from '@/pages/order/components/NavBar' import NavBar from '@/pages/order/components/NavBar'
import { MpPurchaserAddressList } from '@/api/addressList' import { MpPurchaserAddressList } from '@/api/addressList'
import { debounce } from '@/common/util'
const AddColorCard = () => { const AddColorCard = () => {
// 获取选择的客户 // 获取选择的客户
@ -88,9 +87,9 @@ const AddColorCard = () => {
goLink('/pages/sampleCutting/sampleCuttingList/index', { isGoBack: true, isAddSampleCutIdList: order.map(item => item.product_id) }) goLink('/pages/sampleCutting/sampleCuttingList/index', { isGoBack: true, isAddSampleCutIdList: order.map(item => item.product_id) })
} }
const { fetchData, state } = SubmitCutSampleOrder() const { fetchData } = SubmitCutSampleOrder()
// 提交订单 // 提交订单
const handleSubmitOrder = debounce(async() => { const handleSubmitOrder = async() => {
if (!addressInfo.address_id) { if (!addressInfo.address_id) {
return alert.none('请选择地址') return alert.none('请选择地址')
} }
@ -121,9 +120,11 @@ const AddColorCard = () => {
duration: 2000, duration: 2000,
}) })
Taro.removeStorageSync('sampleCuttingCache') Taro.removeStorageSync('sampleCuttingCache')
setTimeout(() => {
goLink('/pages/sampleCutting/sampleCuttingDetail/index', { id: res.data.id }, 'redirectTo') goLink('/pages/sampleCutting/sampleCuttingDetail/index', { id: res.data.id }, 'redirectTo')
}, 2000)
}
} }
}, 300)
const labAndImgObj = useCallback((item) => { const labAndImgObj = useCallback((item) => {
return { lab: item?.lab, rgb: item?.rgb, texture_url: item?.texture_url } return { lab: item?.lab, rgb: item?.rgb, texture_url: item?.texture_url }
@ -440,9 +441,7 @@ const AddColorCard = () => {
<NormalButton <NormalButton
customClassName={styles.bottomBar__button} customClassName={styles.bottomBar__button}
type="primary" type="primary"
disabled={state.loading! || state.success!}
round round
loading={state.loading!}
onClick={handleSubmitOrder} onClick={handleSubmitOrder}
> >
@ -450,9 +449,7 @@ const AddColorCard = () => {
</View> </View>
<Popup show={showDesc} showTitle={false} onClose={() => setShowDesc(false)}> <Popup show={showDesc} showTitle={false} onClose={() => setShowDesc(false)}>
{ <Remark onSave={getRemark} defaultValue={remark} showInput={!!showDesc} />
showDesc && <Remark onSave={getRemark} defaultValue={remark} />
}
</Popup> </Popup>
</View> </View>
} }

View File

@ -10,6 +10,7 @@ page {
font-size: 28px; font-size: 28px;
color: #000000; color: #000000;
margin-left: 32px; margin-left: 32px;
margin-right: 32px;
} }
.line { .line {

View File

@ -302,19 +302,21 @@ const SearchPage = () => {
// 输入了搜索关键字 // 输入了搜索关键字
const getSearchData = useCallback((e) => { const getSearchData = useCallback((e) => {
if (!e) { if (e) {
setHasFonts(true)
getProduct(e)
}
else {
setHasFonts(false) setHasFonts(false)
setSearchList([]) setSearchList([])
} }
setdefaultvalue(e)
}, []) }, [])
// 搜索 // 返回
const onSearch = () => { const back = () => {
if (defaultvalue) { Taro.navigateBack({
setHasFonts(true) delta: 1,
getProduct(defaultvalue) })
}
} }
// 判断是否整数类型 // 判断是否整数类型
function isInteger(obj) { function isInteger(obj) {
@ -417,7 +419,8 @@ const SearchPage = () => {
return ( return (
<View className={styles.main}> <View className={styles.main}>
<View className={styles.topBox}> <View className={styles.topBox}>
<Search placeholder="请输入搜索布料" defaultValue={defaultvalue} showBtn clickOnSearch={onSearch} changeOnSearch={getSearchData} > <Search placeholder="请输入搜索布料" defaultValue={defaultvalue} showBtn={false} changeOnSearch={getSearchData} >
<View className={styles.cancelFont} onClick={() => back()}></View>
</Search> </Search>
</View> </View>
<View className={styles.line}></View> <View className={styles.line}></View>

View File

@ -167,7 +167,7 @@ const ShoppingCartItem: FC<PropsType> = (props) => {
console.log('rerender component ShoppingCartItem', props, props.itemData?.purchaser_name) console.log('rerender component ShoppingCartItem', props, props.itemData?.purchaser_name)
const currentItemData = useRef<ShoppingCartData | undefined>(props.itemData) const currentItemData = useRef<ShoppingCartData | undefined>(props.itemData)
// 及时更新 useRef 的数据 不然拿到的还是旧数据 // 即使更新 useRef 的数据 不然拿到的还是旧数据
currentItemData.current = props.itemData currentItemData.current = props.itemData
const [itemData, setItemData] = usePropsValue({ const [itemData, setItemData] = usePropsValue({
@ -254,8 +254,7 @@ const ShoppingCartItem: FC<PropsType> = (props) => {
// 更新当前客户的多选项 // 更新当前客户的多选项
const updatePurchaserMultipleSelection = (purchaserId: number, payload: Goods, operationType: OperationType, goodsId: number) => { const updatePurchaserMultipleSelection = (purchaserId: number, payload: Goods, operationType: OperationType, goodsId: number) => {
if (itemData?.purchaser_id === purchaserId) { console.log('delete', colorStore, purchaserId)
console.log('updatePurchaserMultipleSelection', colorStore, purchaserId)
if (operationType === 'add') { if (operationType === 'add') {
const multipleSelection = { const multipleSelection = {
...colorStore?.[purchaserId]?.multipleSelection, ...colorStore?.[purchaserId]?.multipleSelection,
@ -269,7 +268,7 @@ const ShoppingCartItem: FC<PropsType> = (props) => {
}, },
}) })
// 全选标识 // 全选标识
if (itemData?.[BackEndSaleModeListFieldMap[selected]].length === Object.keys(multipleSelection).length) { if (currentItemData.current?.purchaser_id === purchaserId && currentItemData.current?.[BackEndSaleModeListFieldMap[selected]].length === Object.keys(multipleSelection).length) {
dispatch({ type: ShoppingDispatchType.UPDATE_MULTIPLE_SELECTION_STATUS, data: true }) dispatch({ type: ShoppingDispatchType.UPDATE_MULTIPLE_SELECTION_STATUS, data: true })
} }
} }
@ -286,15 +285,12 @@ const ShoppingCartItem: FC<PropsType> = (props) => {
dispatch({ type: ShoppingDispatchType.UPDATE_MULTIPLE_SELECTION_STATUS, data: false }) dispatch({ type: ShoppingDispatchType.UPDATE_MULTIPLE_SELECTION_STATUS, data: false })
} }
} }
}
const handleOtherHighLight = (purchaserId: number, deletedItemData: any) => { const handleOtherHighLight = (purchaserId: number) => {
if (purchaserId === itemData?.purchaser_id) { console.log('handleOtherHighLight', purchaserId, currentCheckedPurchaserId)
// 当前订单类型还有数据,跳过 if (purchaserId === currentCheckedPurchaserId) {
if (deletedItemData?.[BackEndSaleModeListFieldMap[selected]].length !== 0) { return }
// 当前订单类型没有数据,高亮其他订单类型
for (let i = 0; i < BackEndSaleModeListField.length; i++) { for (let i = 0; i < BackEndSaleModeListField.length; i++) {
if (deletedItemData?.[BackEndSaleModeListFieldMap[i]].length !== 0) { if (itemData?.[BackEndSaleModeListFieldMap[i]].length !== 0) {
// 控制高亮 // 控制高亮
onSelectOrderType(i) onSelectOrderType(i)
return return
@ -473,7 +469,17 @@ const withStateSlice = (comp, slice: (state: ShoppingStateContextValue, props: P
console.log('itemData 有变化') console.log('itemData 有变化')
needMemo = false needMemo = false
} }
if (prevProps.itemData.purchaser_name === '皮特织业') {
console.log('------withStateSlice props-------')
console.log('withStateSlice props prevProps', prevProps)
console.log('withStateSlice props prevProps comparison itemData', prevProps.itemData === nextProps.itemData)
console.log('withStateSlice props nextProps', nextProps)
console.log('withStateSlice props prevProps comparison multipleSelection', prevProps.state.multipleSelection === nextProps.state.multipleSelection)
console.log('withStateSlice props prevProps comparison currentCheckedPurchaserId', prevProps.state.currentCheckedPurchaserId === nextProps.state.currentCheckedPurchaserId)
console.log('withStateSlice props prevProps comparison Observer', prevProps.state.Observer === nextProps.state.Observer)
console.log('withStateSlice props prevProps comparison state', prevProps.state === nextProps.state)
console.log('------withStateSlice props-------')
}
if (prevProps.state.Observer !== nextProps.state.Observer) { if (prevProps.state.Observer !== nextProps.state.Observer) {
console.log('Observer 有变化') console.log('Observer 有变化')
needMemo = false needMemo = false
@ -486,18 +492,6 @@ const withStateSlice = (comp, slice: (state: ShoppingStateContextValue, props: P
console.log('currentCheckedPurchaserId 有变化') console.log('currentCheckedPurchaserId 有变化')
needMemo = false needMemo = false
} }
if (prevProps.itemData.purchaser_name === '孜然烤鱿鱼') {
console.log('更新 孜然烤鱿鱼', !needMemo)
console.log('------withStateSlice props-------')
console.log('withStateSlice props prevProps', prevProps)
console.log('withStateSlice props prevProps comparison itemData', prevProps.itemData === nextProps.itemData)
console.log('withStateSlice props nextProps', nextProps)
console.log('withStateSlice props prevProps comparison multipleSelection', prevProps.state.multipleSelection === nextProps.state.multipleSelection)
console.log('withStateSlice props prevProps comparison currentCheckedPurchaserId', prevProps.state.currentCheckedPurchaserId === nextProps.state.currentCheckedPurchaserId)
console.log('withStateSlice props prevProps comparison Observer', prevProps.state.Observer === nextProps.state.Observer)
console.log('withStateSlice props prevProps comparison state', prevProps.state === nextProps.state)
console.log('------withStateSlice props-------')
}
return needMemo return needMemo
}) })
const Wrapper = (props: PropsType, ref) => { const Wrapper = (props: PropsType, ref) => {

View File

@ -77,7 +77,7 @@ export interface ShoppingDispatchContextValue {
[ShoppingDispatchType.UPDATE_CURRENT_CHECKED_SALEMODE]: (saleMode: ShoppingStateContextValue['currentCheckedSaleMode']) => void [ShoppingDispatchType.UPDATE_CURRENT_CHECKED_SALEMODE]: (saleMode: ShoppingStateContextValue['currentCheckedSaleMode']) => void
[ShoppingDispatchType.UPDATE_COLOR_STORE]: (colorStore: React.SetStateAction<ColorStore>) => void [ShoppingDispatchType.UPDATE_COLOR_STORE]: (colorStore: React.SetStateAction<ColorStore>) => void
[ShoppingDispatchType.UPDATE_SELECTED_AMOUNT]: (amount: React.SetStateAction<ShoppingStateContextValue['selectedAmount']>) => void [ShoppingDispatchType.UPDATE_SELECTED_AMOUNT]: (amount: React.SetStateAction<ShoppingStateContextValue['selectedAmount']>) => void
[ShoppingDispatchType.UPDATE_CHANGED_CHECKBOX]: (amount: React.SetStateAction<GoodsMeta>) => void [ShoppingDispatchType.UPDATE_CHANGED_CHECKBOX]: (amount: React.SetStateAction<ShoppingStateContextValue['selectedAmount']>) => void
} }
export interface ShoppingAction { export interface ShoppingAction {

View File

@ -13,12 +13,11 @@ import { ShoppingDispatchType, useShoppingDispatch, useShoppingState } from './c
import { events } from './context/shoppingStore' import { events } from './context/shoppingStore'
import { dataLoadingStatus, debounce, getFilterData } from '@/common/util' import { dataLoadingStatus, debounce, getFilterData } from '@/common/util'
import { ShoppingCartDeleteApi, ShoppingCartListApi } from '@/api/index' import { ShoppingCartDeleteApi, ShoppingCartListApi } from '@/api/index'
import { formatMeterDiv, formatPriceDiv } from '@/common/format' import { formatPriceDiv } from '@/common/format'
import InfiniteScroll from '@/components/infiniteScroll' import InfiniteScroll from '@/components/infiniteScroll'
import IconText from '@/components/iconText' import IconText from '@/components/iconText'
import Search from '@/components/search' import Search from '@/components/search'
import { alert, goLink, isEmptyObject } from '@/common/common' import { alert, goLink, isEmptyObject } from '@/common/common'
import { EnumSaleMode } from '@/common/Enumerate'
interface SearchOptions { interface SearchOptions {
short_name_or_phone?: string short_name_or_phone?: string
@ -40,75 +39,26 @@ const ShoppingCartContainer: FC = () => {
} }
const listHeightRef = useRef('auto') const listHeightRef = useRef('auto')
// 强制刷新
const [, setForceUpdate] = useState({})
const { fetchData, state } = ShoppingCartListApi() const { fetchData, state } = ShoppingCartListApi()
const [searchOptions, setSearchOptions] = useState<SearchOptions>({}) const [searchOptions, setSearchOptions] = useState<SearchOptions>({})
const clearMultiSelection = () => {
console.log('clearMultiSelection', shoppingCartData?.list)
const target = shoppingCartData?.list?.find(item => item.purchaser_id === currentCheckedPurchaserId)
console.log('BackEndSaleModeListFieldMap', BackEndSaleModeListFieldMap[currentCheckedSaleMode], target)
const newGoodsKind = Object.fromEntries(
target?.[BackEndSaleModeListFieldMap[currentCheckedSaleMode]].map(item => [
item?.id,
{
id: item?.id,
estimate_amount: item.estimate_amount,
product_code: item.product_code,
product_color_code: item.product_color_code,
sale_mode: item.sale_mode,
count: currentCheckedSaleMode === EnumSaleMode.Bulk ? item.roll : Number(formatMeterDiv(item.length)),
},
]),
)
const prevMultipleSelection = colorStore?.[currentCheckedPurchaserId]?.multipleSelection
console.log('clearMultiSelection', prevMultipleSelection)
const nextMultipleSelection = prevMultipleSelection
? Object.fromEntries(
Object.values(prevMultipleSelection).filter(value => !Object.keys(newGoodsKind).includes(String(value.id)))
.map(value => [
value.id,
{
id: value.id,
estimate_amount: value.estimate_amount,
product_code: value.product_code,
product_color_code: value.product_color_code,
sale_mode: value.sale_mode,
count: value.count,
},
],
))
: {}
console.log('nextMultipleSelection', nextMultipleSelection)
// 清空多选
dispatch({
type: ShoppingDispatchType.UPDATE_CHANGED_CHECKBOX,
data: {
purchaserId: currentCheckedPurchaserId,
goodsKind: newGoodsKind,
multipleSelection: nextMultipleSelection,
},
})
}
const getData = async() => { useDidShow(() => {
await fetchData(getFilterData(searchOptions))
clearMultiSelection()
}
useDidShow(async() => {
// 第二次进入该页面时触发 // 第二次进入该页面时触发
if (!isFirst.current) { if (!isFirst.current) {
console.log('重新刷新')
// 重新刷新 // 重新刷新
getData() // setShoppingCartData({ list: [], total: 0 })
fetchData(getFilterData(searchOptions))
} }
}) })
useEffect(() => { useEffect(() => {
console.log('useEffect fetchData', getFilterData(searchOptions)) console.log('useEffect fetchData', getFilterData(searchOptions))
if (!isFirst.current) { if (!isFirst.current) {
getData() fetchData(getFilterData(searchOptions))
} }
}, [searchOptions]) }, [searchOptions])
@ -141,6 +91,21 @@ const ShoppingCartContainer: FC = () => {
console.log('useLayoutEffect') console.log('useLayoutEffect')
await fetchData(getFilterData(searchOptions)) await fetchData(getFilterData(searchOptions))
isFirst.current = false isFirst.current = false
// const query = Taro.createSelectorQuery()
// console.log('query', query)
// query.select('#shoppingContainer').boundingClientRect()
// query.select('#topBar').boundingClientRect()
// query.select('#bottomBar').boundingClientRect()
// query.exec((res) => {
// console.log('res==>', res)
// const containerHeight = res[0].height
// const topBarHeight = res[1].height
// const bottomBarHeight = res[2].height
// const listHeight = containerHeight - topBarHeight - bottomBarHeight
// listHeightRef.current = `${listHeight}px`
// // 强制刷新
// setForceUpdate({})
// })
})() })()
}, []) }, [])
@ -164,7 +129,6 @@ const ShoppingCartContainer: FC = () => {
sale_mode: currentCheckedSaleMode, sale_mode: currentCheckedSaleMode,
shopping_cart_product_color_list: JSON.stringify(checkedGoodsKind), shopping_cart_product_color_list: JSON.stringify(checkedGoodsKind),
purchaser_name: shoppingCartData?.list.find(item => item.purchaser_id === currentCheckedPurchaserId)?.purchaser_name, purchaser_name: shoppingCartData?.list.find(item => item.purchaser_id === currentCheckedPurchaserId)?.purchaser_name,
isBuyNew: false,
}) })
}, 400) }, 400)
@ -183,44 +147,23 @@ const ShoppingCartContainer: FC = () => {
async success(res) { async success(res) {
if (res.confirm) { if (res.confirm) {
alert.showLoading('删除中') alert.showLoading('删除中')
const checkedIds = checked.map(item => item.id)
const res = await deleteApi({ const res = await deleteApi({
ids: checkedIds.join(','), ids: checked.map(item => item.id).join(','),
}) })
if (res.success) { if (res.success) {
alert.hideLoading() alert.hideLoading()
alert.success('删除成功') alert.success('删除成功')
console.log('colorStore?.[currentCheckedPurchaserId]', colorStore?.[currentCheckedPurchaserId])
let goodsKind = colorStore?.[currentCheckedPurchaserId].goodsKind
if (goodsKind) {
goodsKind = Object.fromEntries(
Object.values(goodsKind).filter(value => !checkedIds.includes(value.id))
.map(value => [
value.id,
{
id: value.id,
estimate_amount: value.estimate_amount,
product_code: value.product_code,
product_color_code: value.product_color_code,
sale_mode: value.sale_mode,
count: value.count,
},
],
))
}
console.log('goodsKind', goodsKind)
// 清空多选 // 清空多选
dispatch({ dispatch({
type: ShoppingDispatchType.UPDATE_CHANGED_CHECKBOX, type: ShoppingDispatchType.UPDATE_CHANGED_CHECKBOX,
data: { data: {
purchaserId: currentCheckedPurchaserId, purchaserId: currentCheckedPurchaserId,
goodsKind, goodsKind: colorStore?.[currentCheckedPurchaserId].goodsKind,
multipleSelection: {}, multipleSelection: {},
}, },
}) })
const deleted = await fetchData(searchOptions) fetchData(searchOptions)
events.trigger('handleOtherHighLight', currentCheckedPurchaserId)
events.trigger('handleOtherHighLight', currentCheckedPurchaserId, deleted.data.list.find(item => item.purchaser_id === currentCheckedPurchaserId))
// Observer.notify(currentCheckedPurchaserId) // Observer.notify(currentCheckedPurchaserId)
} }
else { else {
@ -233,24 +176,10 @@ const ShoppingCartContainer: FC = () => {
} }
// 全选 // 全选
const handleSelectAllCheckbox = (isSelectAll: boolean) => { const handleSelectAllCheckbox = (isSelectAll: boolean) => {
if (!currentCheckedPurchaserId) { return alert.error('请先选择客户') } const targetGoodsKind = colorStore?.[currentCheckedPurchaserId].goodsKind
if (!targetGoodsKind) { return alert.error('请先选择客户') }
const targetGoodsKind = shoppingCartData.list.find(item => item.purchaser_id === currentCheckedPurchaserId)?.[BackEndSaleModeListFieldMap[currentCheckedSaleMode]] const tempObject = { ...targetGoodsKind }
const tempObject: Record<Goods['id'], Goods> = Object.fromEntries(
targetGoodsKind.map(item => [
item?.id,
{
id: item?.id,
estimate_amount: item.estimate_amount,
product_code: item.product_code,
product_color_code: item.product_color_code,
sale_mode: item.sale_mode,
count: currentCheckedSaleMode === EnumSaleMode.Bulk ? item.roll : Number(formatMeterDiv(item.length)),
},
]),
)
console.log('handleSelectAllCheckbox', tempObject)
dispatch({ dispatch({
type: ShoppingDispatchType.UPDATE_CHANGED_CHECKBOX, type: ShoppingDispatchType.UPDATE_CHANGED_CHECKBOX,
data: { data: {
@ -268,7 +197,6 @@ const ShoppingCartContainer: FC = () => {
setRefreshStatus(true) setRefreshStatus(true)
const res = await fetchData(getFilterData(searchOptions)) const res = await fetchData(getFilterData(searchOptions))
if (res.success) { if (res.success) {
clearMultiSelection()
setRefreshStatus(false) setRefreshStatus(false)
alert.success('刷新成功') alert.success('刷新成功')
} }

View File

@ -1,7 +1,5 @@
import type { CommonEvent } from '@tarojs/components'
import { Input, Text, View } from '@tarojs/components' import { Input, Text, View } from '@tarojs/components'
import Taro, { useDidShow, usePullDownRefresh, useRouter } from '@tarojs/taro' import Taro, { useDidShow, usePullDownRefresh, useRouter } from '@tarojs/taro'
import Big from 'big.js'
import type { ReactNode } from 'react' import type { ReactNode } from 'react'
import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react' import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'
import classnames from 'classnames' import classnames from 'classnames'
@ -14,8 +12,6 @@ import { UseSubscriptionMessage } from '@/use/useCommon'
import { import {
MpSaleOrderPost, MpSaleOrderPost,
MpSaleOrderPreview, MpSaleOrderPreview,
SaleOrderPreViewBuyNow,
SaleOrderSubmitBuyNow,
} from '@/api/order' } from '@/api/order'
import { alert } from '@/common/common' import { alert } from '@/common/common'
import { formatDateTime, formatMeterDiv, formatPriceDiv, formatPriceMul, formatRemoveHashTag, formatWeightDiv } from '@/common/format' import { formatDateTime, formatMeterDiv, formatPriceDiv, formatPriceMul, formatRemoveHashTag, formatWeightDiv } from '@/common/format'
@ -28,13 +24,6 @@ import LayoutBlock from '@/components/layoutBlock'
import IconText from '@/components/iconText' import IconText from '@/components/iconText'
import Dialog from '@/components/Dialog' import Dialog from '@/components/Dialog'
import InputX from '@/components/InputX' import InputX from '@/components/InputX'
interface ExtendEvent {
target: {
value: string | number
}
}
// 卡片盒子元素 // 卡片盒子元素
interface Obs { interface Obs {
title?: string title?: string
@ -74,10 +63,10 @@ interface PropGoods {
obj: { obj: {
sale_mode?: number | string sale_mode?: number | string
} }
updateData: (data: Record<string, any>) => void updateList: (list: any[]) => void
} }
const GoodsItem = (props: PropGoods) => { const GoodsItem = (props: PropGoods) => {
const { list = [], obj = {}, updateData } = props const { list = [], obj = {}, updateList } = props
const [goodsList, setGoodsList] = useState(list) const [goodsList, setGoodsList] = useState(list)
@ -125,19 +114,6 @@ const GoodsItem = (props: PropGoods) => {
item.product_colors = item.product_colors.map((it) => { item.product_colors = item.product_colors.map((it) => {
if (it.id === editPayload.current[0]) { if (it.id === editPayload.current[0]) {
it.sale_price = it.origin_price + formatPriceMul(value) it.sale_price = it.origin_price + formatPriceMul(value)
if (obj?.sale_mode === EnumSaleMode.Bulk) {
// 计算金额
it.estimate_amount = formatPriceMul(Number(formatPriceDiv(it.sale_price)) * formatWeightDiv(it.estimate_weight) * it.roll)
}
else if (obj?.sale_mode === EnumSaleMode.Plate) {
// 剪板
it.estimate_amount = formatPriceMul(Number(formatPriceDiv(it.sale_price)) * formatMeterDiv(it.length))
}
else {
// 散剪
it.estimate_amount = formatPriceMul(Number(formatPriceDiv(it.sale_price)) * formatMeterDiv(it.length) / formatMeterDiv(it.length_to_weight_rate)).toFixed(0)
console.log('estimate_amount', it.estimate_amount, formatPriceDiv(it.estimate_amount, 100, true))
}
} }
return it return it
}) })
@ -146,11 +122,7 @@ const GoodsItem = (props: PropGoods) => {
}) })
setGoodsList(res) setGoodsList(res)
handleCancel() handleCancel()
updateData({ updateList(res)
product_list: res,
// 计算总金额
estimate_amount: res.reduce((acc, cur) => acc + cur.product_colors.reduce((a, c) => a + c.estimate_amount, 0), 0),
})
} }
// 批量调整点击确认 // 批量调整点击确认
@ -160,18 +132,6 @@ const GoodsItem = (props: PropGoods) => {
if (item.id === editPayload.current[0]) { if (item.id === editPayload.current[0]) {
item.product_colors = item.product_colors.map((it) => { item.product_colors = item.product_colors.map((it) => {
it.sale_price = it.origin_price + formatPriceMul(value) it.sale_price = it.origin_price + formatPriceMul(value)
if (obj?.sale_mode === EnumSaleMode.Bulk) {
// 计算金额
it.estimate_amount = formatPriceMul(Number(formatPriceDiv(it.sale_price)) * formatWeightDiv(it.estimate_weight) * it.roll)
}
else if (obj?.sale_mode === EnumSaleMode.Plate) {
// 剪板
it.estimate_amount = formatPriceMul(Number(formatPriceDiv(it.sale_price)) * formatMeterDiv(it.length))
}
else {
// 散剪
it.estimate_amount = formatPriceMul(Number(formatPriceDiv(it.sale_price)) * formatMeterDiv(it.length) / formatMeterDiv(it.length_to_weight_rate))
}
return it return it
}) })
} }
@ -179,30 +139,20 @@ const GoodsItem = (props: PropGoods) => {
}) })
setGoodsList(res) setGoodsList(res)
handleCancel() handleCancel()
updateData({ updateList(res)
product_list: res,
// 计算总金额
estimate_amount: res.reduce((acc, cur) => acc + cur.product_colors.reduce((a, c) => a + c.estimate_amount, 0), 0),
})
} }
// 批量调整 // 批量调整
const defaultValue = '-1.5'
// 单价调整 // 单价调整
const [value, setValue] = useState(defaultValue) const [value, setValue] = useState('-1.5')
const handleInput = (e: CommonEvent & ExtendEvent) => { const handleInput = (e) => {
const res = e.detail.value const res = e.detail.value
setValue(res) setValue(res)
return res
} }
const errorMsg = useMemo(() => { const errorMsg = useMemo(() => {
let msg = '' let msg = ''
console.log('errorMsg', value) if (Number(value) < -3) {
if (/[a-zA-Z]/.test(value) || Number.isNaN(Number(value))) {
msg = '请填写数字'
}
else if (Number(value) < -3) {
msg = '不能小于-3' msg = '不能小于-3'
} }
else { else {
@ -235,31 +185,13 @@ const GoodsItem = (props: PropGoods) => {
<View> <View>
<View className={styles.item_right_top}> <View className={styles.item_right_top}>
<View className={styles.itemName}>{formatRemoveHashTag(it.code)}# {it.name}</View> <View className={styles.itemName}>{formatRemoveHashTag(it.code)}# {it.name}</View>
<View className={styles.itemNums}>x{obj?.sale_mode === EnumSaleMode.Bulk ? it.roll : formatMeterDiv(it.length)}{obj?.sale_mode === 0 ? '条' : ''}</View> <View className={styles.itemNums}>x{obj?.sale_mode === EnumSaleMode.Bulk ? it.roll : formatMeterDiv(it.length)}{obj?.sale_mode === 0 ? '条' : 'm'}</View>
</View> </View>
<View className={styles.item_right_Bottom}> <View className={styles.item_right_Bottom}>
<View className={styles.flexBox}> <View className={styles.flexBox}>
<View className={styles.itemMoney}>¥{formatPriceDiv(it.sale_price, 100, true)}/{obj?.sale_mode === EnumSaleMode.Plate ? 'm' : 'kg'}</View> <View className={styles.itemMoney}>¥{formatPriceDiv(it.sale_price)}/{obj?.sale_mode === EnumSaleMode.Plate ? 'm' : 'kg'}</View>
{ {
(obj?.sale_mode === EnumSaleMode.Bulk && it?.sale_price !== it?.standard_price) (obj?.sale_mode === EnumSaleMode.Bulk && it?.sale_price !== it?.standard_price) ? <View className={styles.lastBox}>¥{formatPriceDiv(it?.standard_price)}/kg</View> : null
? <View className={styles.lastBox}>
¥{formatPriceDiv(it?.standard_price, 100, true)}/kg
</View>
: null
}
{
(obj?.sale_mode === EnumSaleMode.Plate && it?.sale_price !== it?.standard_price)
? <View className={styles.lastBox}>
¥{formatPriceDiv(it?.standard_price, 100, true)}/m
</View>
: null
}
{
(obj?.sale_mode === EnumSaleMode.BulkCut && it?.sale_price !== it?.standard_price)
? <View className={styles.lastBox}>
¥{formatPriceDiv(it?.standard_price, 100, true)}/kg
</View>
: null
} }
<View onClick={() => handleEdit(it.id, item.id)}> <View onClick={() => handleEdit(it.id, item.id)}>
<IconFont name="icon-bianji1" color="#3d85ff"></IconFont> <IconFont name="icon-bianji1" color="#3d85ff"></IconFont>
@ -329,8 +261,6 @@ const SubmitOrder = () => {
const [infoObj, setInfoObj] = useState<any>({}) const [infoObj, setInfoObj] = useState<any>({})
let selectId = -1 let selectId = -1
const isBuyNew = useRef(false)
// 收货方法,1:自提2物流 // 收货方法,1:自提2物流
const [receivingStatus, setReceivingStatus] = useState<any>(null) const [receivingStatus, setReceivingStatus] = useState<any>(null)
// 切换自提或者物流 // 切换自提或者物流
@ -370,7 +300,7 @@ const SubmitOrder = () => {
// 获取订单详情 // 获取订单详情
const getDetail = async() => { const getDetail = async() => {
let arr: any[] = [] let arr: any[] = []
console.log('purchaser_name', router.params.purchaser_name) setPusername(decodeURIComponent(router.params.purchaser_name))
arr = JSON.parse(decodeURIComponent(router.params.shopping_cart_product_color_list)) arr = JSON.parse(decodeURIComponent(router.params.shopping_cart_product_color_list))
const list: any[] = [] const list: any[] = []
arr?.forEach((item) => { arr?.forEach((item) => {
@ -398,40 +328,6 @@ const SubmitOrder = () => {
}) })
} }
const { fetchData } = SaleOrderPreViewBuyNow()
// 立即购买
const getOnceDetail = async() => {
const sale_order_product_color_list = JSON.parse(router?.params?.sale_order_product_color_list as string) || []
if (sale_order_product_color_list?.length > 0) {
const arr: any[] = []
const sale_mode = Number(router?.params.sale_mode)
sale_order_product_color_list.forEach((item) => {
arr.push({
length: item?.length || 0,
roll: item.roll,
product_color_id: item.id,
sale_price: sale_mode === EnumSaleMode.Bulk ? item.bulk_price : sale_mode === EnumSaleMode.Plate ? item.length_cut_price : item.weight_cut_price,
})
})
const res = await fetchData({
sale_mode,
sale_order_product_color_list: arr,
purchaser_id: Number(router?.params.purchaser_id),
})
setInfoObj({
...res.data,
product_list: res.data.product_list?.map((item) => {
item.product_colors = item.product_colors.map((it) => {
// 用于存储原始价格,(单价/批量)调整价格
it.origin_price = it.sale_price
return it
})
return item
}),
})
}
}
// 备注操作 // 备注操作
const [showDesc, setShowDesc] = useState(false) const [showDesc, setShowDesc] = useState(false)
const getRemark = useCallback(async(e) => { const getRemark = useCallback(async(e) => {
@ -449,13 +345,11 @@ const SubmitOrder = () => {
// 提交订单 // 提交订单
const { fetchData: postFetch } = MpSaleOrderPost() const { fetchData: postFetch } = MpSaleOrderPost()
const { fetchData: postOnceFetch } = SaleOrderSubmitBuyNow()
const handSure = () => { const handSure = () => {
if (receivingStatus == 2 && !infoObj.address_id) { if (receivingStatus == 2 && !infoObj.address_id) {
return alert.error('请选择地址') return alert.error('请选择地址')
} }
const list: any[] = [] const list: any[] = []
if (!isBuyNew.current) {
infoObj.product_list.forEach((item) => { infoObj.product_list.forEach((item) => {
item.product_colors.forEach((it) => { item.product_colors.forEach((it) => {
list.push({ list.push({
@ -464,19 +358,6 @@ const SubmitOrder = () => {
}) })
}) })
}) })
}
else {
infoObj.product_list.forEach((item) => {
item.product_colors.forEach((it) => {
list.push({
length: it.length,
roll: it.roll,
sale_price: it.sale_price,
product_color_id: Number(it.id),
})
})
})
}
const query = { const query = {
address_id: Number(infoObj.address_id) ? Number(infoObj.address_id) : 0, address_id: Number(infoObj.address_id) ? Number(infoObj.address_id) : 0,
list, list,
@ -497,13 +378,7 @@ const SubmitOrder = () => {
title: '请稍等...', title: '请稍等...',
mask: true, mask: true,
}) })
let res const res = await postFetch(query)
if (isBuyNew.current) {
res = await postOnceFetch(query)
}
else {
res = await postFetch(query)
}
if (res?.msg === 'success') { if (res?.msg === 'success') {
Taro.showToast({ Taro.showToast({
title: '成功', title: '成功',
@ -573,22 +448,13 @@ const SubmitOrder = () => {
useEffect(() => { useEffect(() => {
getAddress() getAddress()
console.log('isBuyNew', router.params.isBuyNew)
setPusername(decodeURIComponent(router.params.purchaser_name))
isBuyNew.current = JSON.parse(router.params.isBuyNew)
// 判断立即购买
if (isBuyNew.current) {
getOnceDetail()
}
else {
getDetail() getDetail()
}
}, []) }, [])
const updateData = (data: Record<string, any>) => { const updateList = (list: any[]) => {
setInfoObj(val => ({ setInfoObj(val => ({
...val, ...val,
...data, product_list: list,
})) }))
} }
@ -612,7 +478,7 @@ const SubmitOrder = () => {
</View> </View>
</DefaultBoxWithMemo> </DefaultBoxWithMemo>
<View className={styles.productBox}> <View className={styles.productBox}>
<GoodsItemWithMemo list={infoObj?.product_list} obj={infoObj} updateData={updateData} ></GoodsItemWithMemo> <GoodsItemWithMemo list={infoObj?.product_list} obj={infoObj} updateList={updateList}></GoodsItemWithMemo>
<View className={styles.flexMoney}> <View className={styles.flexMoney}>
<View className={styles.flexTotalBox}> <View className={styles.flexTotalBox}>
<View className={styles.totalFont}></View> <View className={styles.totalFont}></View>
@ -633,13 +499,11 @@ const SubmitOrder = () => {
</View> </View>
<View className={styles.bottomFlex}>{infoObj.product_list?.length} {infoObj.total_colors} {infoObj.sale_mode === 0 ? infoObj.total_number : infoObj.total_number / 100} {infoObj.sale_mode === 0 ? '条' : 'm'}</View> <View className={styles.bottomFlex}>{infoObj.product_list?.length} {infoObj.total_colors} {infoObj.sale_mode === 0 ? infoObj.total_number : infoObj.total_number / 100} {infoObj.sale_mode === 0 ? '条' : 'm'}</View>
</View> </View>
<View className={styles.rightBottom} onClick={handSure}></View> <View className={styles.rightBottom} onClick={() => handSure()}></View>
</View> </View>
<Popup show={showDesc} showTitle={false} onClose={() => setShowDesc(false)}> <Popup show={showDesc} showTitle={false} onClose={() => setShowDesc(false)}>
{ <Remark onSave={e => getRemark(e)} defaultValue={infoObj.remark} showInput={!!showDesc} />
showDesc && <Remark onSave={e => getRemark(e)} defaultValue={infoObj.remark} />
}
</Popup> </Popup>
</View> </View>
) )

View File

@ -1,21 +1,21 @@
.order_popup { .order_popup{
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
padding: 20px 0; padding: 20px 0;
.order_popup_title { .order_popup_title{
color: $font_size_big; color: $font_size_big;
font-weight: 700; font-weight: 700;
color: #000000; color: #000000;
padding-bottom: 20px; padding-bottom: 20px;
} }
.order_popup_input { .order_popup_input{
width: 100%; width: 100%;
padding: 0 25px; padding: 0 25px;
box-sizing: border-box; box-sizing: border-box;
margin-top: 43px; margin-top: 43px;
position: relative; position: relative;
.descDataNum { .descDataNum{
position: absolute; position: absolute;
right: 40px; right: 40px;
bottom: 10px; bottom: 10px;
@ -23,8 +23,8 @@
font-size: $font_size_medium; font-size: $font_size_medium;
color: $color_font_two; color: $color_font_two;
} }
textarea { textarea{
background-color: white; background-color: #f3f3f3;
border-radius: 10px; border-radius: 10px;
width: 100%; width: 100%;
height: 313px; height: 313px;
@ -35,7 +35,7 @@
border: 2px solid #e6e6e6; border: 2px solid #e6e6e6;
} }
} }
.order_save_address { .order_save_address{
height: 82px; height: 82px;
background: #007aff; background: #007aff;
border-radius: 40px; border-radius: 40px;