diff --git a/src/app.config.ts b/src/app.config.ts index 2c854f3..40827f1 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -124,5 +124,9 @@ export default defineAppConfig({ root: 'pages/collectionDetail', pages: ['index'], }, + { + root: 'pages/customerManagement', + pages: ['index'], + }, ], }) diff --git a/src/components/dropDown-item/index.tsx b/src/components/dropDown-item/index.tsx index ba2bc2c..0b33e96 100644 --- a/src/components/dropDown-item/index.tsx +++ b/src/components/dropDown-item/index.tsx @@ -3,7 +3,7 @@ */ import { View, Text } from '@tarojs/components' -import { useEffect, useMemo, useRef, useState } from 'react' +import { useEffect, useMemo, useRef, useState, forwardRef, useImperativeHandle } from 'react' import styles from './index.module.scss' import Iconfont from '../iconfont/iconfont' import Popup from '../popup' @@ -30,11 +30,19 @@ interface PropsType extends DropDownEvent { activeColor?: string showOverlay?: boolean customClassName?: string - customStyle?: React.CSSProperties + customStyle?: React.CSSProperties, + hasBottomBtn?: boolean //底部有按钮不允许点击蒙层关闭 } -export default (props: PropsType) => { - const { children, direction = 'down', title = '', value, options = [], change, activeColor, showOverlay = true } = props +export default forwardRef((props: PropsType, ref) => { + const { children, direction = 'down', title = '', value, options = [], change, activeColor, showOverlay = true, hasBottomBtn = false } = props + + useImperativeHandle(ref, () => ({ + //暴露出方法给有需要的用 + closePopup() { + setShowPopup(false) + } + })) const [showPopup, setShowPopup] = useState(false) @@ -65,6 +73,7 @@ export default (props: PropsType) => { } const handleClosePopup = () => { + if (hasBottomBtn) return false setShowPopup(false) } @@ -111,7 +120,7 @@ export default (props: PropsType) => { handleClosePopup()} showOverLay={showOverlay} show={showPopup} showTitle={false} @@ -123,4 +132,4 @@ export default (props: PropsType) => { ) -} +}) diff --git a/src/pages/customerManagement/components/Tag/index.module.scss b/src/pages/customerManagement/components/Tag/index.module.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/customerManagement/components/Tag/index.tsx b/src/pages/customerManagement/components/Tag/index.tsx new file mode 100644 index 0000000..4e2354a --- /dev/null +++ b/src/pages/customerManagement/components/Tag/index.tsx @@ -0,0 +1,27 @@ +import { View } from '@tarojs/components' +import React, { useCallback, memo, useEffect, useMemo, useRef, useState, ReactNode } from 'react' +import styles from "./index.module.scss" +import classnames from "classnames"; +import Taro, { usePullDownRefresh, useRouter, useDidShow } from '@tarojs/taro'; +import Popup from '@/components/popup' +import { debounce } from '@/common/util' +import { alert } from '@/common/common' +import { formatPriceDiv, formatDateTime, formatWeightDiv } from '@/common/format' +import IconFont from '@/components/iconfont/iconfont' +import DropDownItem from '@/components/dropDown-item' + + +export default memo(() => { + + const DropDownItemRef = useRef() + const close = () => { + DropDownItemRef.current.closePopup() + } + return ( + + + close()}>111 + + + ) +}) \ No newline at end of file diff --git a/src/pages/customerManagement/index.config.ts b/src/pages/customerManagement/index.config.ts new file mode 100644 index 0000000..6cfd2f0 --- /dev/null +++ b/src/pages/customerManagement/index.config.ts @@ -0,0 +1,3 @@ +export default { + navigationBarTitleText: '客户列表', +} diff --git a/src/pages/customerManagement/index.module.scss b/src/pages/customerManagement/index.module.scss new file mode 100644 index 0000000..75a1150 --- /dev/null +++ b/src/pages/customerManagement/index.module.scss @@ -0,0 +1,9 @@ +.mainBox { + overflow: hidden; + + .menuBox { + width: 100%; + display: flex; + flex: 1; + } +} \ No newline at end of file diff --git a/src/pages/customerManagement/index.tsx b/src/pages/customerManagement/index.tsx new file mode 100644 index 0000000..3c0c8a7 --- /dev/null +++ b/src/pages/customerManagement/index.tsx @@ -0,0 +1,23 @@ +import { View } from '@tarojs/components' +import React, { useCallback, memo, useEffect, useMemo, useRef, useState, ReactNode } from 'react' +import styles from "./index.module.scss" +import classnames from "classnames"; +import Taro, { usePullDownRefresh, useRouter, useDidShow } from '@tarojs/taro'; +import Popup from '@/components/popup' +import { debounce } from '@/common/util' +import { alert } from '@/common/common' +import { formatPriceDiv, formatDateTime, formatWeightDiv } from '@/common/format' +import IconFont from '@/components/iconfont/iconfont' +import Tag from './components/Tag'; + +export default () => { + return ( + + + + + + + + ) +} \ No newline at end of file diff --git a/src/pages/orderDetails/components/addressDetailBox/index.tsx b/src/pages/orderDetails/components/addressDetailBox/index.tsx index 13c50f2..8c837fa 100644 --- a/src/pages/orderDetails/components/addressDetailBox/index.tsx +++ b/src/pages/orderDetails/components/addressDetailBox/index.tsx @@ -28,7 +28,7 @@ export default memo((props: propsObj) => { { - receivingStatus == 1 && {obj.take_goods_address} + receivingStatus == 1 && {obj.take_goods_address || '中华人民共和国广东省佛山市禅城区陆盈纺织仓库'} } { (obj?.province_name != '' && receivingStatus == 2) && diff --git a/src/pages/orderDetails/components/remark/index.tsx b/src/pages/orderDetails/components/remark/index.tsx index 6549365..a28cf90 100644 --- a/src/pages/orderDetails/components/remark/index.tsx +++ b/src/pages/orderDetails/components/remark/index.tsx @@ -6,13 +6,14 @@ import styles from './index.module.scss' type Param = { onBlur?: (val: any) => void onSave?: (val: string) => void - defaultValue?: string + defaultValue?: string, + showInput: boolean } -export default ({ onBlur, onSave, defaultValue = '' }: Param) => { +export default ({ onBlur, onSave, defaultValue = '', showInput = false }: Param) => { const [descData, setDescData] = useState({ number: 0, value: '', - count: 200 + count: 200, }) useEffect(() => { @@ -33,10 +34,13 @@ export default ({ onBlur, onSave, defaultValue = '' }: Param) => { return ( 编辑备注 - - - {descData.number}/{descData.count} - + { + showInput && + + {descData.number}/{descData.count} + + } + setSave()}>保存 ) diff --git a/src/pages/submitOrder/index.tsx b/src/pages/submitOrder/index.tsx index 9cf475d..4400559 100644 --- a/src/pages/submitOrder/index.tsx +++ b/src/pages/submitOrder/index.tsx @@ -94,6 +94,7 @@ export default () => { const handSelect = (obj) => { + if (receivingStatus == 1) return false Taro.navigateTo({ url: '/pages/addressManager/index?orderId=' + '-100' + '&purchaser_id=' + router.params.purchaser_id }) @@ -192,7 +193,7 @@ export default () => { {infoObj.remark === '' ? '暂无' : infoObj.remark} setShowDesc(false)}> - getRemark(e)} defaultValue={infoObj.remark} /> + getRemark(e)} defaultValue={infoObj.remark} showInput={showDesc ? true : false} /> diff --git a/src/pages/user/index.tsx b/src/pages/user/index.tsx index a5b8458..2e7d2f4 100644 --- a/src/pages/user/index.tsx +++ b/src/pages/user/index.tsx @@ -67,7 +67,7 @@ let feature: IconCardType[] = [ { iconName: 'icon-kehuxinxi', name: '客户列表', - path: '', + path: '/pages/customerManagement/index', jurisdiction: 'customer_list_page' }, ]