diff --git a/src/common/constant.js b/src/common/constant.js index 53e9374..4512c59 100644 --- a/src/common/constant.js +++ b/src/common/constant.js @@ -11,7 +11,7 @@ export const BASE_URL = `https://test.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 = `http://192.168.1.5:40001/lymarket` // 王霞 -// export const BASE_URL = `http://192.168.1.7:50001/lymarket` // 添=[A14578YY] +// export const BASE_URL = `http://192.168.1.7:50002/lymarket` // 添 // export const BASE_URL = `http://192.168.1.42:50001/lymarket` // 杰 // CDN diff --git a/src/components/filter/index.module.scss b/src/components/filter/index.module.scss index 1ddd8b2..4add5fa 100644 --- a/src/components/filter/index.module.scss +++ b/src/components/filter/index.module.scss @@ -31,23 +31,21 @@ grid-template-columns: repeat(3, 165.75px); justify-content: space-between; .btn_item{ - // width: 165.75px; height: 69.2px; background: #f0f0f0; border-radius: 34px; - text-align: center; line-height: 69.2px; + text-align: center; font-size: $font_size_medium; color: $color_font_one; margin-bottom: 20px; + @include common_ellipsis(); } .select_btn_item{ color: $color_main; background: #ecf5ff; border: 2px solid #007aff; box-sizing: border-box; - width: 161.75px; - height: 65.2px; } } .btn_list_input{ diff --git a/src/components/orderBtns/index.tsx b/src/components/orderBtns/index.tsx index 2ab63e4..343ee90 100644 --- a/src/components/orderBtns/index.tsx +++ b/src/components/orderBtns/index.tsx @@ -85,7 +85,7 @@ export default memo(({orderInfo, showStatus = 'detail', onClick}:Param) => { SaleOrderStatusAlreadyReceipt.value, SaleOrderStatusComplete.value ] - return orderInfo.wait_pay_amount != 0 && orderStatus.includes(orderInfo.status) + return orderInfo.wait_pay_amount > 0 && orderStatus.includes(orderInfo.status) } }, { @@ -98,7 +98,7 @@ export default memo(({orderInfo, showStatus = 'detail', onClick}:Param) => { SaleOrderStatusWaitingDelivery.value, SaleOrderStatusTaking.value ] - return orderInfo.sale_mode == SaLeModeBulk.value && orderInfo.actual_amount != 0 && orderInfo.av_return_roll && orderStatus.includes(orderInfo.status) + return orderInfo.sale_mode == SaLeModeBulk.value && orderInfo.actual_amount > 0 && orderInfo.av_return_roll && orderStatus.includes(orderInfo.status) } }, { @@ -110,7 +110,7 @@ export default memo(({orderInfo, showStatus = 'detail', onClick}:Param) => { SaleOrderStatusAlreadyReceipt.value, SaleOrderStatusRefund.value ] - return orderInfo.av_return_roll&& orderStatus.includes(orderInfo.status) + return orderInfo.av_return_roll && orderStatus.includes(orderInfo.status) } }, { @@ -141,7 +141,7 @@ export default memo(({orderInfo, showStatus = 'detail', onClick}:Param) => { let orderStatus = [ SaleOrderStatusBooking.value ] - return orderInfo.sale_mode != SaLeModeBulk.value && orderInfo.actual_amount != 0 && orderStatus.includes(orderInfo.status) + return orderInfo.sale_mode != SaLeModeBulk.value && orderInfo.actual_amount > 0 && orderStatus.includes(orderInfo.status) } }, { diff --git a/src/components/product/index.module.scss b/src/components/product/index.module.scss index 342b778..91a62bd 100644 --- a/src/components/product/index.module.scss +++ b/src/components/product/index.module.scss @@ -43,6 +43,7 @@ .title{ font-size: $font_size; color: #707070; + @include common_ellipsis(2); text{ color: $color_font_one; font-weight: bold; diff --git a/src/pages/classList/index.tsx b/src/pages/classList/index.tsx index 6538ab8..594b9aa 100644 --- a/src/pages/classList/index.tsx +++ b/src/pages/classList/index.tsx @@ -49,7 +49,6 @@ export default () => { //上拉加载数据 const pageNum = useRef({size: searchField.size, page: searchField.page}) - const [hasMore, setHasMore] = useState(true) const getScrolltolower = () => { if(categoryList.list.length < categoryList.total) { pageNum.current.page++ @@ -61,11 +60,12 @@ export default () => { //数据加载状态 const statusMore = useMemo(() => { return dataLoadingStatus({list:categoryList.list, total: categoryList.total, status: state.loading}) - }, [categoryList]) + }, [categoryList, state]) //获取筛选条件 const getFiltr = (e) => { pageNum.current.page = 1 + setCategoryList(() => ({list:[], total:0})) const {data} = e setSearchField({ ...searchField, @@ -97,7 +97,19 @@ export default () => { setSearchField((val) => ({...val, code_or_name:e, size:10})) }, []) - + //排序 + type sortParam = 'none'|'top'|'bottom' + const sortComprehensiveRef = useRef(null) + const [sortStatus, setSortStatus] = useState<{comprehensive:sortParam}>({ + comprehensive: 'none' + }) + const changeSort = () => { + setCategoryList(() => ({list:[], total:0})) + const {status, value} = sortComprehensiveRef.current.changeSort() + setSortStatus((e) => ({...e, comprehensive: status, collection: 'none'})) + setSearchField((e) => ({...e, abstract_sort_key: value, size:10, page:1})) + pageNum.current = {size: 10, page: 1} + } return ( @@ -106,9 +118,9 @@ export default () => { - + changeSort()}> 综合 - + setShowPopup(true)}> 筛选 diff --git a/src/pages/collection/index.tsx b/src/pages/collection/index.tsx index 827cbd5..fc7155e 100644 --- a/src/pages/collection/index.tsx +++ b/src/pages/collection/index.tsx @@ -4,7 +4,7 @@ import { getFilterData } from "@/common/util"; import Product from "./components/product"; import Search from "@/components/search" import { Text, View } from "@tarojs/components" -import Taro from "@tarojs/taro"; +import Taro, { useDidHide, useDidShow } from "@tarojs/taro"; import classnames from "classnames"; import { useCallback, useEffect, useRef, useState } from "react"; import CreatePopup from "./components/createPopup"; @@ -17,6 +17,9 @@ export default () => { item.openStatus = !item.openStatus setList((e) => [...e]) } + useDidShow(() => { + getFavoriteList() + }) //获取搜索数据 const [searchData, setSearchData] = useState('') const onSearch = useCallback((e) => { diff --git a/src/pages/order/components/orderState copy/index.module.scss b/src/pages/order/components/orderState copy/index.module.scss deleted file mode 100644 index 78bda44..0000000 --- a/src/pages/order/components/orderState copy/index.module.scss +++ /dev/null @@ -1,18 +0,0 @@ -.order_flow_state{ - display: flex; - align-items: center; - padding: 0 30px; - height: 116px; - background-color: #fff; - border-radius: 20px; - .order_flow_state_text{ - color: $color_main; - font-size:$font_size; - font-weight: 700; - } - .order_flow_state_desc{ - color: $color_font_three; - font-size: $font_size_medium; - margin-left: 50px; - } -} \ No newline at end of file diff --git a/src/pages/order/components/orderState copy/index.tsx b/src/pages/order/components/orderState copy/index.tsx deleted file mode 100644 index 58fec4d..0000000 --- a/src/pages/order/components/orderState copy/index.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { View } from "@tarojs/components" -import styles from './index.module.scss' - -export default ({ - state = '', - desc = '' -}) => { - return ( - - {state} - {desc} - - ) -} \ No newline at end of file diff --git a/src/pages/order/components/orderStatusTag/index.module.scss b/src/pages/order/components/orderStatusTag/index.module.scss new file mode 100644 index 0000000..df84721 --- /dev/null +++ b/src/pages/order/components/orderStatusTag/index.module.scss @@ -0,0 +1,21 @@ +.tag{ + font-size: $font_size_min; + padding: 5px 15px; + background-color: $color_main; + color: #fff; + border-radius: 0px 20px 0px 20px; + display: flex; + align-items: center; + .miconfont{ + font-size: 30px; + } + +} +.saleReturn_tag{ + background-color: #E4E4FF; + color: #1818B4; +} +.refund_tag { + background-color: #FFE6CE; + color: #EE7500; +} \ No newline at end of file diff --git a/src/pages/order/components/orderStatusTag/index.tsx b/src/pages/order/components/orderStatusTag/index.tsx new file mode 100644 index 0000000..968fe99 --- /dev/null +++ b/src/pages/order/components/orderStatusTag/index.tsx @@ -0,0 +1,25 @@ +import { Text, View } from "@tarojs/components" +import { memo } from "react" +import classnames from "classnames"; +import styles from './index.module.scss' +import { REFUND_STATUS_ORDER } from "@/common/enum"; + + +type Param = { + status?: number +} +export default memo(({status = 0}:Param) => { + const { + ReturnApplyOrderTypeAdvanceReceiptRefund, // 预收退款 + ReturnApplyOrderTypeReturnForRefund, // 退货退款 + ReturnApplyOrderTypeSalesRefund // 销售退款 + } = REFUND_STATUS_ORDER + return ( + <> + {(status !== 0)&& + + { status == ReturnApplyOrderTypeReturnForRefund.value?'退货':'退款'} + } + + ) +}) \ No newline at end of file diff --git a/src/pages/order/components/returnRecord/index.tsx b/src/pages/order/components/returnRecord/index.tsx index f7eecca..30a5ac9 100644 --- a/src/pages/order/components/returnRecord/index.tsx +++ b/src/pages/order/components/returnRecord/index.tsx @@ -5,13 +5,13 @@ import { dataLoadingStatus, getFilterData } from "@/common/util"; import InfiniteScroll from "@/components/infiniteScroll"; import LabAndImg from "@/components/LabAndImg"; import Popup from "@/components/popup"; -import OrderStatusTag from "@/pages/salesAfterList/components/orderStatusTag"; import { useSelector } from "@/reducers/hooks"; import { Image, Text, View } from "@tarojs/components"; import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react"; import classnames from "classnames"; import styles from './index.module.scss' import { REFUND_STATUS_ORDER } from "@/common/enum"; +import OrderStatusTag from "../orderStatusTag"; type Param = { show?: true|false, diff --git a/src/pages/sampleComparison/compoents/bluetooth/LinkBlueTooth.tsx b/src/pages/sampleComparison/compoents/bluetooth/LinkBlueTooth.tsx index 3d36166..4be6b33 100644 --- a/src/pages/sampleComparison/compoents/bluetooth/LinkBlueTooth.tsx +++ b/src/pages/sampleComparison/compoents/bluetooth/LinkBlueTooth.tsx @@ -23,7 +23,6 @@ export default memo(() => { } else { setLinkStatus(2) } - console.log('aaa:::', state.connected) }, [state.available, state.connected]) const linkName = useMemo(() => { diff --git a/src/pages/sampleComparison/index.tsx b/src/pages/sampleComparison/index.tsx index 6dc80ff..f91c0bd 100644 --- a/src/pages/sampleComparison/index.tsx +++ b/src/pages/sampleComparison/index.tsx @@ -22,7 +22,10 @@ export default () => { one?: any, two?: any } - const [colorList, setColorList] = useState() + const [colorList, setColorList] = useState({ + one: null, + two: null + }) const { state: colorState, measureAndGetLab } = useBluetooth() const getLab = async (val) => { @@ -58,14 +61,14 @@ export default () => { if (colorState.deviceLab) { if ((colorList as any).one?.constructor === Object) { - const rgb = toRgb([(colorList as any).one.L, (colorList as any).one.a, (colorList as any).one.b]) + const rgb = toRgb([(colorList as any).one?.L, (colorList as any).one?.a, (colorList as any).one?.b]) setBlueToothColor(`rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`) setTime(getNowTime()) setSearchField({ ...searchField, l1: rgb[0], a1: rgb[1], b1: rgb[2] }) } if ((colorList as any).two?.constructor === Object) { - const rgb = toRgb([(colorList as any).two.L, (colorList as any).two.a, (colorList as any).two.b]) + const rgb = toRgb([(colorList as any).two?.L, (colorList as any).two?.a, (colorList as any).two?.b]) setBlueToothColorTwo(`rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`) setTimeTwo(getNowTime()) setSearchField({ ...searchField, l2: rgb[0], a2: rgb[1], b2: rgb[2] }) diff --git a/src/pages/searchList/hightSearchList.module.scss b/src/pages/searchList/hightSearchList.module.scss index d828503..6b2d2cc 100644 --- a/src/pages/searchList/hightSearchList.module.scss +++ b/src/pages/searchList/hightSearchList.module.scss @@ -143,7 +143,7 @@ } .list_num_shadow { - box-shadow: 0px 5px 5px #ccc; + box-shadow: 0px 3px 5px #ccc; } .scroll{ height: 100%; @@ -159,7 +159,7 @@ background-color: #fff; border-radius: 20px; margin-bottom: 20px; - box-shadow: 0px 3px 10px 0px rgba(0,0,0,0.1) ; + box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.1) ; .product_img{ width: 100%; height: 224px; diff --git a/src/pages/searchList/hightSearchList.tsx b/src/pages/searchList/hightSearchList.tsx index 0791dbb..07650f3 100644 --- a/src/pages/searchList/hightSearchList.tsx +++ b/src/pages/searchList/hightSearchList.tsx @@ -13,15 +13,15 @@ import Taro, { useDidShow, usePullDownRefresh, useReady } from "@tarojs/taro"; import {GetLabProductApi} from "@/api/material" import { dataLoadingStatus, getFilterData } from "@/common/util"; import { formatHashTag, formatImgUrl } from "@/common/fotmat"; -import LoadingCard from "@/components/loadingCard"; import useLogin from "@/use/useLogin"; import { goLink } from "@/common/common"; import SelectData, {ListProps} from "./components/selectData"; import LabAndImg from "@/components/LabAndImg"; -import useCheckAuthorize from "@/use/useCheckAuthorize"; export default () => { useLogin() + + const firstOpen = useRef(true) const [showFilter, setShowFilter] = useState(false) //搜索参数 const [searchField, setSearchField] = useState({ @@ -44,6 +44,7 @@ export default () => { let {data} = await materialFetchData(getFilterData(searchField)) setMaterialList({list:data.list, total:data.total}) Taro.stopPullDownRefresh() + firstOpen.current = false } //监听筛选条件变化 @@ -61,20 +62,10 @@ export default () => { } } - //数据加载状态 const statusMore = useMemo(() => { return dataLoadingStatus({list:materialList.list, total: materialList.total, status: materialState.loading}) - }, [materialList]) - - const [scrollStatus, setScrollStatus] = useState(false) - const onscroll = useCallback((e) => { - if(e.detail.scrollTop > 20) { - setScrollStatus(true) - } else { - setScrollStatus(false) - } - },[]) + }, [materialList, materialState]) const {state: colorState, measureAndGetLab} = useBluetooth() const getLab = () => { @@ -91,10 +82,12 @@ export default () => { //监听lab数据变化 const [blueToothColor, setBlueToothColor] = useState('') useEffect(() => { - if(colorState.deviceLab) { + if(colorState.deviceLab && !firstOpen.current) { const rgb = toRgb([colorState.deviceLab.L, colorState.deviceLab.a, colorState.deviceLab.b]) setBlueToothColor(`rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`) - setSearchField({...searchField, l:rgb[0], a:rgb[1], b:rgb[2], size:10}) + setSearchField({...searchField, l:rgb[0], a:rgb[1], b:rgb[2], size:10, page:1}) + setMaterialList(() => ({list:[], total:0})) + pageNum.current = {size: 10, page: 1} } }, [colorState.deviceLab]) @@ -104,6 +97,7 @@ export default () => { //获取筛选条件 const getFiltr = (e) => { + pageNum.current.page = 1 setMaterialList(() => ({list:[], total:0})) const {data} = e setSearchField({ @@ -143,15 +137,17 @@ export default () => { collection: 'none' }) const changeSort = (val) => { + setMaterialList(() => ({list:[], total:0})) if(val == 1) { const {status, value} = sortComprehensiveRef.current.changeSort() setSortStatus((e) => ({...e, comprehensive: status, collection: 'none'})) - setSearchField((e) => ({...e, abstract_sort_key: value})) + setSearchField((e) => ({...e, abstract_sort_key: value, size:10, page:1})) } else { const {status, value} = sortCollectionRef.current.changeSort() setSortStatus((e) => ({...e, collection: status, comprehensive: 'none'})) - setSearchField((e) => ({...e, abstract_sort_key: value})) + setSearchField((e) => ({...e, abstract_sort_key: value, size:10, page:1})) } + pageNum.current = {size: 10, page: 1} } const labAndImgObj = useCallback((item) => { @@ -195,11 +191,10 @@ export default () => { - 搜索结果 ({materialList.total}条记录) + 搜索结果 ({materialList.total}条记录) onscroll(e)} statusMore={statusMore} > diff --git a/src/pages/searchList/searchList.module.scss b/src/pages/searchList/searchList.module.scss index b590338..85e68e7 100644 --- a/src/pages/searchList/searchList.module.scss +++ b/src/pages/searchList/searchList.module.scss @@ -126,7 +126,7 @@ } .list_num_shadow { - box-shadow: 0px 5px 5px #ccc; + box-shadow: 0px 3px 5px #ccc; } .scroll{ height: 100%; @@ -142,7 +142,7 @@ background-color: #fff; border-radius: 20px; margin-bottom: 20px; - box-shadow: 0px 3px 10px 0px rgba(0,0,0,0.1) ; + box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.1) ; .product_img{ width: 100%; height: 224px; diff --git a/src/pages/searchList/searchList.tsx b/src/pages/searchList/searchList.tsx index e1e7574..15d232d 100644 --- a/src/pages/searchList/searchList.tsx +++ b/src/pages/searchList/searchList.tsx @@ -68,6 +68,7 @@ export default () => { pageNum.current.page = 1 setMaterialList(() => ({list:[], total:0})) setSearchField((val) => ({...val, code_or_name:e, size:10})) + pageNum.current = {size: 10, page: 1} }, []) const goLinkPage = (item) => { @@ -78,17 +79,7 @@ export default () => { usePullDownRefresh(() => { setSearchField({...searchField ,size : 10}) }) - - //监听滚动 - const [scrollStatus, setScrollStatus] = useState(false) - const onscroll = useCallback((e) => { - if(e.detail.scrollTop > 20) { - setScrollStatus(true) - } else { - setScrollStatus(false) - } - },[]) - + //获取筛选条件 const getFiltr = (e) => { pageNum.current.page = 1 @@ -129,12 +120,13 @@ export default () => { if(val == 1) { const {status, value} = sortComprehensiveRef.current.changeSort() setSortStatus((e) => ({...e, comprehensive: status, collection: 'none'})) - setSearchField((e) => ({...e, abstract_sort_key: value})) + setSearchField((e) => ({...e, abstract_sort_key: value, size:10, page:1})) } else { const {status, value} = sortCollectionRef.current.changeSort() setSortStatus((e) => ({...e, collection: status, comprehensive: 'none'})) - setSearchField((e) => ({...e, abstract_sort_key: value})) + setSearchField((e) => ({...e, abstract_sort_key: value, size:10, page:1})) } + pageNum.current = {size: 10, page: 1} } const labAndImgObj = useCallback((item) => { @@ -173,11 +165,10 @@ export default () => { - 搜索结果 ({materialList.total}条记录) + 搜索结果 ({materialList.total}条记录)