商城测试版v8
This commit is contained in:
parent
341c5c2eed
commit
3009b65e00
@ -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
|
||||
|
@ -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{
|
||||
|
@ -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)
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -43,6 +43,7 @@
|
||||
.title{
|
||||
font-size: $font_size;
|
||||
color: #707070;
|
||||
@include common_ellipsis(2);
|
||||
text{
|
||||
color: $color_font_one;
|
||||
font-weight: bold;
|
||||
|
@ -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<any>(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 (
|
||||
<View className={styles.main}>
|
||||
@ -106,9 +118,9 @@ export default () => {
|
||||
</View>
|
||||
<View className={styles.filter}>
|
||||
<View className={styles.filter_all}>
|
||||
<View className={styles.text_one}>
|
||||
<View className={styles.text_one} onClick={() => changeSort()}>
|
||||
<Text>综合</Text>
|
||||
<SortBtn status="top"/>
|
||||
<SortBtn status={sortStatus.comprehensive} ref={sortComprehensiveRef} sortValue={{desc: '1', asc: '-1'}}/>
|
||||
</View>
|
||||
<View className={styles.text_two} onClick={() => setShowPopup(true)}>
|
||||
<Text>筛选</Text>
|
||||
|
@ -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) => {
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
import { View } from "@tarojs/components"
|
||||
import styles from './index.module.scss'
|
||||
|
||||
export default ({
|
||||
state = '',
|
||||
desc = ''
|
||||
}) => {
|
||||
return (
|
||||
<View className={styles.order_flow_state}>
|
||||
<View className={styles.order_flow_state_text}>{state}</View>
|
||||
<View className={styles.order_flow_state_desc}>{desc}</View>
|
||||
</View>
|
||||
)
|
||||
}
|
21
src/pages/order/components/orderStatusTag/index.module.scss
Normal file
21
src/pages/order/components/orderStatusTag/index.module.scss
Normal file
@ -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;
|
||||
}
|
25
src/pages/order/components/orderStatusTag/index.tsx
Normal file
25
src/pages/order/components/orderStatusTag/index.tsx
Normal file
@ -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)&&<View className={classnames(styles.tag, status != ReturnApplyOrderTypeReturnForRefund.value?styles.refund_tag :styles.saleReturn_tag)}>
|
||||
<View className={classnames(styles.miconfont, 'iconfont icon-yucunkuan')}></View>
|
||||
<Text>{ status == ReturnApplyOrderTypeReturnForRefund.value?'退货':'退款'}</Text>
|
||||
</View>}
|
||||
</>
|
||||
)
|
||||
})
|
@ -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,
|
||||
|
@ -23,7 +23,6 @@ export default memo(() => {
|
||||
} else {
|
||||
setLinkStatus(2)
|
||||
}
|
||||
console.log('aaa:::', state.connected)
|
||||
}, [state.available, state.connected])
|
||||
|
||||
const linkName = useMemo(() => {
|
||||
|
@ -22,7 +22,10 @@ export default () => {
|
||||
one?: any,
|
||||
two?: any
|
||||
}
|
||||
const [colorList, setColorList] = useState<ColorList>()
|
||||
const [colorList, setColorList] = useState<ColorList>({
|
||||
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] })
|
||||
|
@ -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;
|
||||
|
@ -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 () => {
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.list}>
|
||||
<View className={classnames(styles.list_num, scrollStatus&&styles.list_num_shadow)}>搜索结果 ({materialList.total}条记录)</View>
|
||||
<View className={classnames(styles.list_num, styles.list_num_shadow)}>搜索结果 ({materialList.total}条记录)</View>
|
||||
<View className={styles.scroll}>
|
||||
<InfiniteScroll
|
||||
selfonScrollToLower={getScrolltolower}
|
||||
selfOnScroll={(e) => onscroll(e)}
|
||||
statusMore={statusMore}
|
||||
>
|
||||
<View className={styles.product_list}>
|
||||
|
@ -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;
|
||||
|
@ -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) => {
|
||||
@ -79,16 +80,6 @@ export default () => {
|
||||
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 () => {
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.list}>
|
||||
<View className={classnames(styles.list_num, scrollStatus&&styles.list_num_shadow)}>搜索结果 ({materialList.total}条记录)</View>
|
||||
<View className={classnames(styles.list_num, styles.list_num_shadow)}>搜索结果 ({materialList.total}条记录)</View>
|
||||
<View className={styles.scroll}>
|
||||
<InfiniteScroll
|
||||
selfonScrollToLower={getScrolltolower}
|
||||
selfOnScroll={onscroll}
|
||||
statusMore={statusMore}
|
||||
>
|
||||
<View className={styles.product_list}>
|
||||
|
Loading…
x
Reference in New Issue
Block a user