✨ feat(ID1000873领取剪样和ID1000868领取色卡):
This commit is contained in:
parent
2d2518f4ab
commit
f375079d30
@ -29,7 +29,7 @@ export const GetCutSampleOrderStatusApi = () => {
|
|||||||
export const CutSampleOrderCancelApi = () => {
|
export const CutSampleOrderCancelApi = () => {
|
||||||
return request({
|
return request({
|
||||||
url: '/v1/mall/cutSampleOrder/cancel',
|
url: '/v1/mall/cutSampleOrder/cancel',
|
||||||
method: 'post',
|
method: 'put',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,3 +43,25 @@ export const GetSampleOrderProductApi = () => {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取剪样订单详情
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const GetCutSampleOrderDetailApi = () => {
|
||||||
|
return request({
|
||||||
|
url: '/v1/mall/cutSampleOrder/detail',
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交订单
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const submitCutSampleOrderApi = () => {
|
||||||
|
return request({
|
||||||
|
url: '/v1/mall/cutSampleOrder/submit',
|
||||||
|
method: 'post',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
// 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 = `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:40001/lymarket` // 发
|
||||||
// export const BASE_URL = `http://192.168.1.9:50005/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 = `http://192.168.1.30:50001/lymarket` // 发
|
||||||
@ -13,7 +13,7 @@
|
|||||||
// 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.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.28:50001/lymarket' // 婷
|
// export const BASE_URL = 'http://192.168.1.28:50001/lymarket' // 婷
|
||||||
// export const BASE_URL = 'http://192.168.1.42:50002/lymarket' // 杰
|
// export const BASE_URL = 'http://192.168.1.42:50002/lymarket' // 杰
|
||||||
|
|
||||||
// CDN
|
// CDN
|
||||||
|
|||||||
@ -70,6 +70,7 @@ const CounterDisplayName = (props: params) => {
|
|||||||
if (!isInteger(num_res)) {
|
if (!isInteger(num_res)) {
|
||||||
num_res = Math.trunc(num_res)
|
num_res = Math.trunc(num_res)
|
||||||
}
|
}
|
||||||
|
if (num_res > maxNum) { onMax?.() }
|
||||||
num_res = num_res >= maxNum ? maxNum : num_res
|
num_res = num_res >= maxNum ? maxNum : num_res
|
||||||
setValue({ ...value, count: num_res })
|
setValue({ ...value, count: num_res })
|
||||||
onChange?.(parseFloat(num_res))
|
onChange?.(parseFloat(num_res))
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import LoadingCard from '../loadingCard'
|
|||||||
import style from './index.module.scss'
|
import style from './index.module.scss'
|
||||||
import DotLoading from '@/components/dotLoading'
|
import DotLoading from '@/components/dotLoading'
|
||||||
import Empty from '@/components/empty'
|
import Empty from '@/components/empty'
|
||||||
import { SEARCH_EMPTY_IMAGE } from '@/common/constant'
|
import { IMG_CND_Prefix, SEARCH_EMPTY_IMAGE } from '@/common/constant'
|
||||||
|
|
||||||
export type StatusParam = 0 | 1 | 2 | 3
|
export type StatusParam = 0 | 1 | 2 | 3
|
||||||
|
|
||||||
@ -32,6 +32,8 @@ interface Params {
|
|||||||
moreText?: string
|
moreText?: string
|
||||||
loadingText?: string
|
loadingText?: string
|
||||||
noMoreText?: string
|
noMoreText?: string
|
||||||
|
defaultUrl?: string
|
||||||
|
defaultText?: string
|
||||||
}
|
}
|
||||||
const InfiniteScroll = ({
|
const InfiniteScroll = ({
|
||||||
styleObj,
|
styleObj,
|
||||||
@ -53,6 +55,8 @@ const InfiniteScroll = ({
|
|||||||
statusMore = 0,
|
statusMore = 0,
|
||||||
enableBackToTop = true,
|
enableBackToTop = true,
|
||||||
emptySlot,
|
emptySlot,
|
||||||
|
defaultUrl = '',
|
||||||
|
defaultText = '',
|
||||||
}: Params) => {
|
}: Params) => {
|
||||||
const scrollToLower = () => {
|
const scrollToLower = () => {
|
||||||
selfonScrollToLower?.()
|
selfonScrollToLower?.()
|
||||||
@ -113,7 +117,7 @@ const InfiniteScroll = ({
|
|||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
{statusMore == 0 && <LoadingCard />}
|
{statusMore == 0 && <LoadingCard />}
|
||||||
{statusMore == 1 && (emptySlot || <Empty picUrl={SEARCH_EMPTY_IMAGE} text="暂无数据" />)}
|
{statusMore == 1 && (emptySlot || <Empty picUrl={defaultUrl ? `${IMG_CND_Prefix}${defaultUrl}` : SEARCH_EMPTY_IMAGE} text={defaultText || '暂无数据'} />)}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -126,7 +126,7 @@ const MoveBtn = ({ orderObj = {}, children = null, onShopClick, showList = [], m
|
|||||||
x="630rpx"
|
x="630rpx"
|
||||||
y={`${screenHeight.customer}rpx`}
|
y={`${screenHeight.customer}rpx`}
|
||||||
>
|
>
|
||||||
<Image mode="aspectFit" src={formatImgUrl('/mall/float_button_customer_service.png')} />
|
<Image mode="aspectFit" src={formatImgUrl('/color_card/businessManager.png')} />
|
||||||
</MovableView>}
|
</MovableView>}
|
||||||
{showCode && <CodeSelect orderObj={orderObj} y={screenHeight.code as number} />}
|
{showCode && <CodeSelect orderObj={orderObj} y={screenHeight.code as number} />}
|
||||||
<Customer messageTitle={messageTitle} messagePath={messageTitle} show={customer_service_show} showCard={showCart} onClose={customerClose} />
|
<Customer messageTitle={messageTitle} messagePath={messageTitle} show={customer_service_show} showCard={showCart} onClose={customerClose} />
|
||||||
|
|||||||
@ -93,8 +93,6 @@ export default memo((props: Param) => {
|
|||||||
if (item.status) { data.push({ ...item, count: 1 }) }
|
if (item.status) { data.push({ ...item, count: 1 }) }
|
||||||
})
|
})
|
||||||
onSelected?.(data)
|
onSelected?.(data)
|
||||||
// Taro.setStorageSync('cutSample', JSON.stringify(data))
|
|
||||||
// goLink('/pages/cutSampleListOrder/index')
|
|
||||||
}
|
}
|
||||||
return <View className={styles.main}>
|
return <View className={styles.main}>
|
||||||
<Popup show={show} showTitle={false} onClose={onClose}>
|
<Popup show={show} showTitle={false} onClose={onClose}>
|
||||||
@ -125,7 +123,6 @@ interface ColorItemCom {
|
|||||||
}
|
}
|
||||||
const ColorSelectItem = memo((props: ColorItemCom) => {
|
const ColorSelectItem = memo((props: ColorItemCom) => {
|
||||||
const { item, onSelect } = props
|
const { item, onSelect } = props
|
||||||
console.log('abcedef', item)
|
|
||||||
return <View key={item.id} className={styles.item} onClick={() => onSelect?.(item)}>
|
return <View key={item.id} className={styles.item} onClick={() => onSelect?.(item)}>
|
||||||
<View className={classNames(styles.item_color, item.status && styles.select_color)}>
|
<View className={classNames(styles.item_color, item.status && styles.select_color)}>
|
||||||
<LabAndImg
|
<LabAndImg
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import InfiniteScroll from '@/components/infiniteScroll'
|
|||||||
import { alert, goLink } from '@/common/common'
|
import { alert, goLink } from '@/common/common'
|
||||||
import { ColorCardOrderCancelApi, GetColorCardOrderApi, GetColorCardOrderStatusApi } from '@/api/colorCard'
|
import { ColorCardOrderCancelApi, GetColorCardOrderApi, GetColorCardOrderStatusApi } from '@/api/colorCard'
|
||||||
import { dataLoadingStatus, getFilterData } from '@/common/util'
|
import { dataLoadingStatus, getFilterData } from '@/common/util'
|
||||||
import kong from '@/styles/image/kong.png'
|
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const [searchData, setSearchData] = useState<{ status?: number; page: number; size: number }>({
|
const [searchData, setSearchData] = useState<{ status?: number; page: number; size: number }>({
|
||||||
@ -99,10 +98,6 @@ export default () => {
|
|||||||
{statusList.map(item => <View key={item.id} onClick={() => changeStatus(item.id)} className={classNames(styles.btn_item, searchData.status === item.id && styles.select_ed)}>{item.name}</View>)}
|
{statusList.map(item => <View key={item.id} onClick={() => changeStatus(item.id)} className={classNames(styles.btn_item, searchData.status === item.id && styles.select_ed)}>{item.name}</View>)}
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.con}>
|
<View className={styles.con}>
|
||||||
{false && <View className={styles.kong_image}>
|
|
||||||
<Image src={kong}></Image>
|
|
||||||
<Text>还没有领取过色卡</Text>
|
|
||||||
</View>}
|
|
||||||
<View className={styles.con_list}>
|
<View className={styles.con_list}>
|
||||||
<InfiniteScroll
|
<InfiniteScroll
|
||||||
statusMore={statusMore}
|
statusMore={statusMore}
|
||||||
@ -110,6 +105,8 @@ export default () => {
|
|||||||
selfonScrollToLower={getScrolltolower}
|
selfonScrollToLower={getScrolltolower}
|
||||||
refresherTriggered={refresherTriggeredStatus}
|
refresherTriggered={refresherTriggeredStatus}
|
||||||
selfOnRefresherRefresh={getRefresherRefresh}
|
selfOnRefresherRefresh={getRefresherRefresh}
|
||||||
|
defaultUrl="/color_card/colorCardList_empty.png"
|
||||||
|
defaultText="还没领取过色卡"
|
||||||
>
|
>
|
||||||
{orderData.list?.map((item) => {
|
{orderData.list?.map((item) => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
height: 134px;
|
height: 134px;
|
||||||
}
|
}
|
||||||
.item_con_desc {
|
.item_con_desc {
|
||||||
width: 100%;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|||||||
@ -51,14 +51,22 @@ export default (props: Param) => {
|
|||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
onCancel?.(id)
|
onCancel?.(id)
|
||||||
}
|
}
|
||||||
return <View className={styles.list_item} onClick={() => goLink('/pages/colorCardOrderDetail/index', { id: value.order_id })} >
|
|
||||||
|
const labAndImgObj = useMemo(
|
||||||
|
() => {
|
||||||
|
const res = value.cut_sample_order_product_list[0]
|
||||||
|
return { lab: res.lab, rgb: res.rgb, texture_url: res.texture_url }
|
||||||
|
},
|
||||||
|
[value],
|
||||||
|
)
|
||||||
|
return <View className={styles.list_item} onClick={() => goLink('/pages/cutSampleListOrderDetail/index', { id: value.order_id })} >
|
||||||
<View className={styles.item_header}>
|
<View className={styles.item_header}>
|
||||||
<Text>单号:{value.order_no}</Text>
|
<Text>单号:{value.order_no}</Text>
|
||||||
<Text>{value.mp_cut_sample_audit_status_name}</Text>
|
<Text>{value.mp_cut_sample_audit_status_name}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.item_con}>
|
<View className={styles.item_con}>
|
||||||
<View className={styles.image}>
|
<View className={styles.image}>
|
||||||
<LabAndImg value={{}} showStatus={false} />
|
<LabAndImg value={labAndImgObj} showStatus={false} />
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.item_con_desc}>
|
<View className={styles.item_con_desc}>
|
||||||
<View className={styles.item_con_name}>
|
<View className={styles.item_con_name}>
|
||||||
|
|||||||
@ -8,7 +8,6 @@ import styles from './index.module.scss'
|
|||||||
import InfiniteScroll from '@/components/infiniteScroll'
|
import InfiniteScroll from '@/components/infiniteScroll'
|
||||||
import { alert, goLink } from '@/common/common'
|
import { alert, goLink } from '@/common/common'
|
||||||
import { dataLoadingStatus, getFilterData } from '@/common/util'
|
import { dataLoadingStatus, getFilterData } from '@/common/util'
|
||||||
import kong from '@/styles/image/kong.png'
|
|
||||||
import { CutSampleOrderCancelApi, GetCutSampleOrderListApi, GetCutSampleOrderStatusApi } from '@/api/cutSample'
|
import { CutSampleOrderCancelApi, GetCutSampleOrderListApi, GetCutSampleOrderStatusApi } from '@/api/cutSample'
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
@ -99,10 +98,6 @@ export default () => {
|
|||||||
{statusList.map(item => <View key={item.id} onClick={() => changeStatus(item.id)} className={classNames(styles.btn_item, searchData.mp_cut_sample_audit_status === item.id && styles.select_ed)}>{item.name}</View>)}
|
{statusList.map(item => <View key={item.id} onClick={() => changeStatus(item.id)} className={classNames(styles.btn_item, searchData.mp_cut_sample_audit_status === item.id && styles.select_ed)}>{item.name}</View>)}
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.con}>
|
<View className={styles.con}>
|
||||||
{false && <View className={styles.kong_image}>
|
|
||||||
<Image src={kong}></Image>
|
|
||||||
<Text>还没有领取过色卡</Text>
|
|
||||||
</View>}
|
|
||||||
<View className={styles.con_list}>
|
<View className={styles.con_list}>
|
||||||
<InfiniteScroll
|
<InfiniteScroll
|
||||||
statusMore={statusMore}
|
statusMore={statusMore}
|
||||||
@ -110,6 +105,9 @@ export default () => {
|
|||||||
selfonScrollToLower={getScrolltolower}
|
selfonScrollToLower={getScrolltolower}
|
||||||
refresherTriggered={refresherTriggeredStatus}
|
refresherTriggered={refresherTriggeredStatus}
|
||||||
selfOnRefresherRefresh={getRefresherRefresh}
|
selfOnRefresherRefresh={getRefresherRefresh}
|
||||||
|
defaultUrl="/color_card/colorCardList_empty.png"
|
||||||
|
defaultText="还没领取过剪样"
|
||||||
|
|
||||||
>
|
>
|
||||||
{orderData.list?.map((item) => {
|
{orderData.list?.map((item) => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
height: 134px;
|
height: 134px;
|
||||||
}
|
}
|
||||||
.item_con_desc {
|
.item_con_desc {
|
||||||
width: 100%;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|||||||
@ -39,6 +39,14 @@ export default (props: Param) => {
|
|||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
onCancel?.(id)
|
onCancel?.(id)
|
||||||
}
|
}
|
||||||
|
const labAndImgObj = useMemo(
|
||||||
|
() => {
|
||||||
|
const res = value.color_card_info[0]
|
||||||
|
return { lab: res.lab, rgb: res.rgb, texture_url: res.texture_url }
|
||||||
|
},
|
||||||
|
[value],
|
||||||
|
)
|
||||||
|
|
||||||
return <View className={styles.list_item} onClick={() => goLink('/pages/colorCardOrderDetail/index', { id: value.order_id })} >
|
return <View className={styles.list_item} onClick={() => goLink('/pages/colorCardOrderDetail/index', { id: value.order_id })} >
|
||||||
<View className={styles.item_header}>
|
<View className={styles.item_header}>
|
||||||
<Text>单号:{value.order_no}</Text>
|
<Text>单号:{value.order_no}</Text>
|
||||||
@ -46,7 +54,7 @@ export default (props: Param) => {
|
|||||||
</View>
|
</View>
|
||||||
<View className={styles.item_con}>
|
<View className={styles.item_con}>
|
||||||
<View className={styles.image}>
|
<View className={styles.image}>
|
||||||
<LabAndImg value={{}} showStatus={false} />
|
<LabAndImg value={labAndImgObj} showStatus={false} />
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View className={styles.item_con_desc}>
|
<View className={styles.item_con_desc}>
|
||||||
|
|||||||
@ -6,7 +6,6 @@ import styles from './index.module.scss'
|
|||||||
import type { ParamItem } from './components/productItem'
|
import type { ParamItem } from './components/productItem'
|
||||||
import ProductItem from './components/productItem'
|
import ProductItem from './components/productItem'
|
||||||
import SelectList from '@/components/selectList'
|
import SelectList from '@/components/selectList'
|
||||||
import kong from '@/styles/image/kong.png'
|
|
||||||
import InfiniteScroll from '@/components/infiniteScroll'
|
import InfiniteScroll from '@/components/infiniteScroll'
|
||||||
import { alert, goLink } from '@/common/common'
|
import { alert, goLink } from '@/common/common'
|
||||||
import { ColorCardOrderCancelApi, GetColorCardOrderApi, GetColorCardOrderStatusApi } from '@/api/colorCard'
|
import { ColorCardOrderCancelApi, GetColorCardOrderApi, GetColorCardOrderStatusApi } from '@/api/colorCard'
|
||||||
@ -107,10 +106,6 @@ export default () => {
|
|||||||
{statusList.map(item => <View key={item.id} onClick={() => changeStatus(item.id)} className={classNames(styles.btn_item, searchData.status === item.id && styles.select_ed)}>{item.name}</View>)}
|
{statusList.map(item => <View key={item.id} onClick={() => changeStatus(item.id)} className={classNames(styles.btn_item, searchData.status === item.id && styles.select_ed)}>{item.name}</View>)}
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.con}>
|
<View className={styles.con}>
|
||||||
{false && <View className={styles.kong_image}>
|
|
||||||
<Image src={kong}></Image>
|
|
||||||
<Text>还没有领取过色卡</Text>
|
|
||||||
</View>}
|
|
||||||
<View className={styles.con_list}>
|
<View className={styles.con_list}>
|
||||||
<InfiniteScroll
|
<InfiniteScroll
|
||||||
statusMore={statusMore}
|
statusMore={statusMore}
|
||||||
|
|||||||
@ -1,18 +1,9 @@
|
|||||||
import { Image, Text, View } from '@tarojs/components'
|
import { Image, Text, View } from '@tarojs/components'
|
||||||
import Taro, { useDidShow } from '@tarojs/taro'
|
import { useState } from 'react'
|
||||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
|
||||||
import classNames from 'classnames'
|
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import type { ParamItem } from './components/productItem'
|
|
||||||
import ProductItem from './components/productItem'
|
|
||||||
import ColorCardList from './components/colorCardList'
|
import ColorCardList from './components/colorCardList'
|
||||||
import CutSampleList from './components/cutSampleList'
|
import CutSampleList from './components/cutSampleList'
|
||||||
import SelectList from '@/components/selectList'
|
import SelectList from '@/components/selectList'
|
||||||
import kong from '@/styles/image/kong.png'
|
|
||||||
import InfiniteScroll from '@/components/infiniteScroll'
|
|
||||||
import { alert, goLink } from '@/common/common'
|
|
||||||
import { ColorCardOrderCancelApi, GetColorCardOrderApi, GetColorCardOrderStatusApi } from '@/api/colorCard'
|
|
||||||
import { dataLoadingStatus, getFilterData } from '@/common/util'
|
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const [selectIndex, setSelectIndex] = useState(1)
|
const [selectIndex, setSelectIndex] = useState(1)
|
||||||
|
|||||||
@ -5,6 +5,21 @@
|
|||||||
.image {
|
.image {
|
||||||
width: 144px;
|
width: 144px;
|
||||||
height: 144px;
|
height: 144px;
|
||||||
|
position: relative;
|
||||||
|
text {
|
||||||
|
height: 38px;
|
||||||
|
background: rgba(0, 0, 0, 0.55);
|
||||||
|
border-radius: 0px 0px 10px 10px;
|
||||||
|
font-size: 24px;
|
||||||
|
display: inline-block;
|
||||||
|
position: absolute;
|
||||||
|
color: #fff;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
text-align: center;
|
||||||
|
width: 100%;
|
||||||
|
line-height: 38px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.card_info {
|
.card_info {
|
||||||
margin-left: 24px;
|
margin-left: 24px;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { Text, View } from '@tarojs/components'
|
import { Text, View } from '@tarojs/components'
|
||||||
import { memo, useState } from 'react'
|
import { memo, useCallback, useMemo, useState } from 'react'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import LabAndImg from '@/components/LabAndImg'
|
import LabAndImg from '@/components/LabAndImg'
|
||||||
import Checkbox from '@/components/checkbox'
|
import Checkbox from '@/components/checkbox'
|
||||||
@ -36,9 +36,16 @@ export default memo((props: ParamType) => {
|
|||||||
props.onSelect?.(props, false)
|
props.onSelect?.(props, false)
|
||||||
setCheckStatus(false)
|
setCheckStatus(false)
|
||||||
}
|
}
|
||||||
|
const labAndImgObj = useMemo(
|
||||||
|
() => {
|
||||||
|
return { lab: props.lab, rgb: props.rgb, texture_url: props.texture_url }
|
||||||
|
},
|
||||||
|
[props],
|
||||||
|
)
|
||||||
return <View className={styles.get_card_item} onClick={changeSelect}>
|
return <View className={styles.get_card_item} onClick={changeSelect}>
|
||||||
<View className={styles.image}>
|
<View className={styles.image}>
|
||||||
<LabAndImg value={{}} />
|
<LabAndImg value={labAndImgObj} />
|
||||||
|
{affiliation_product.length > 1 && <Text>多面料共用</Text>}
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.card_info}>
|
<View className={styles.card_info}>
|
||||||
<View className={styles.card_info_name}>{color_card_name}</View>
|
<View className={styles.card_info_name}>{color_card_name}</View>
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import InfiniteScroll from '@/components/infiniteScroll'
|
|||||||
import Search from '@/components/search'
|
import Search from '@/components/search'
|
||||||
import { GetColorCardApi } from '@/api/colorCard'
|
import { GetColorCardApi } from '@/api/colorCard'
|
||||||
import { dataLoadingStatus, getFilterData } from '@/common/util'
|
import { dataLoadingStatus, getFilterData } from '@/common/util'
|
||||||
|
import { alert } from '@/common/common'
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const { fetchData, state: cardState } = GetColorCardApi()
|
const { fetchData, state: cardState } = GetColorCardApi()
|
||||||
@ -81,6 +82,7 @@ export default () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
|
if (selectList.length <= 0) { return alert.none('请选择色卡') }
|
||||||
selectList?.map((item) => {
|
selectList?.map((item) => {
|
||||||
item.count = 1
|
item.count = 1
|
||||||
})
|
})
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
flex: 1;
|
||||||
margin-left: 24px;
|
margin-left: 24px;
|
||||||
.info_address {
|
.info_address {
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
|
|||||||
@ -52,7 +52,7 @@ export default (props: Param) => {
|
|||||||
}
|
}
|
||||||
return <>
|
return <>
|
||||||
<View className={styles.address_con} onClick={() => setShowList(true)}>
|
<View className={styles.address_con} onClick={() => setShowList(true)}>
|
||||||
<IconFont name="icon-dizhiguanli" size={50} />
|
<IconFont name="icon-dingwei" size={50} />
|
||||||
<View className={styles.message}>
|
<View className={styles.message}>
|
||||||
<View className={styles.info_address}>
|
<View className={styles.info_address}>
|
||||||
<View className={styles.address_name}>{data.address_title || '请选择收货地址'}</View>
|
<View className={styles.address_name}>{data.address_title || '请选择收货地址'}</View>
|
||||||
|
|||||||
@ -14,14 +14,32 @@
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
|
display: flex;
|
||||||
|
.card_info_label {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, 100px);
|
||||||
|
grid-gap: 10px 10px;
|
||||||
|
margin-top: 10px;
|
||||||
|
text {
|
||||||
|
font-size: 24px;
|
||||||
|
color: #4581ff;
|
||||||
|
height: 34px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 34px;
|
||||||
|
background-color: rgba(69, 129, 255, 0.15);
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
.btns {
|
.btns {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
.count_btn {
|
.count_btn {
|
||||||
margin-top: 27px;
|
padding-bottom: 10px;
|
||||||
width: 170px;
|
width: 170px;
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import { memo, useCallback, useEffect, useState } from 'react'
|
|||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import Counter from '@/components/counter'
|
import Counter from '@/components/counter'
|
||||||
import LabAndImg from '@/components/LabAndImg'
|
import LabAndImg from '@/components/LabAndImg'
|
||||||
|
import { alert } from '@/common/common'
|
||||||
|
|
||||||
interface ProductItemParamType {
|
interface ProductItemParamType {
|
||||||
code: string
|
code: string
|
||||||
@ -35,7 +36,9 @@ export default memo((props: Param) => {
|
|||||||
const ProductItem = memo((props: Param) => {
|
const ProductItem = memo((props: Param) => {
|
||||||
const { value } = props
|
const { value } = props
|
||||||
const labAndImgObj = useCallback(
|
const labAndImgObj = useCallback(
|
||||||
|
|
||||||
(item) => {
|
(item) => {
|
||||||
|
console.log('item:::', 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 }
|
||||||
},
|
},
|
||||||
[value],
|
[value],
|
||||||
@ -43,7 +46,6 @@ const ProductItem = memo((props: Param) => {
|
|||||||
const onChangeNum = (num) => {
|
const onChangeNum = (num) => {
|
||||||
props.onChangeNum?.({ id: value.id, count: num })
|
props.onChangeNum?.({ id: value.id, count: num })
|
||||||
}
|
}
|
||||||
console.log('测试:::', value)
|
|
||||||
const onMin = () => {
|
const onMin = () => {
|
||||||
Taro.showModal({
|
Taro.showModal({
|
||||||
title: '确认删除所选色卡?',
|
title: '确认删除所选色卡?',
|
||||||
@ -57,11 +59,22 @@ const ProductItem = memo((props: Param) => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const onMax = () => {
|
||||||
|
alert.none('最多领取2份')
|
||||||
|
}
|
||||||
return <>
|
return <>
|
||||||
<View key={value.id} className={styles.card_item}>
|
<View key={value.id} className={styles.card_item}>
|
||||||
<View className={styles.img}><LabAndImg value={labAndImgObj(props)} /></View>
|
<View className={styles.img}>
|
||||||
|
<LabAndImg value={labAndImgObj(props.value)} />
|
||||||
|
</View>
|
||||||
<View className={styles.name_count}>
|
<View className={styles.name_count}>
|
||||||
<Text>{value.color_card_name}</Text>
|
<View className={styles.name_con}>
|
||||||
|
<Text>{value.color_card_name}</Text>
|
||||||
|
<View className={styles.card_info_label}>
|
||||||
|
{value.affiliation_product?.map(item => <Text key={item.id}>{item.code}</Text>)}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
<View className={styles.btns}>
|
<View className={styles.btns}>
|
||||||
<View className={styles.count_btn}>
|
<View className={styles.count_btn}>
|
||||||
<Counter
|
<Counter
|
||||||
@ -72,6 +85,7 @@ const ProductItem = memo((props: Param) => {
|
|||||||
onBlue={onChangeNum}
|
onBlue={onChangeNum}
|
||||||
unit="件"
|
unit="件"
|
||||||
onMin={onMin}
|
onMin={onMin}
|
||||||
|
onMax={onMax}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import { SubmitColorCardApi } from '@/api/colorCard'
|
|||||||
import { getFilterData } from '@/common/util'
|
import { getFilterData } from '@/common/util'
|
||||||
import { UseSubscriptionMessage } from '@/use/useCommon'
|
import { UseSubscriptionMessage } from '@/use/useCommon'
|
||||||
import { SUBSCRIPTION_MESSAGE_SCENE } from '@/common/enum'
|
import { SUBSCRIPTION_MESSAGE_SCENE } from '@/common/enum'
|
||||||
|
import { addressListApi } from '@/api/addressManager'
|
||||||
|
|
||||||
export interface submitData {
|
export interface submitData {
|
||||||
address_id: number
|
address_id: number
|
||||||
@ -36,9 +37,15 @@ export default () => {
|
|||||||
const info = Taro.getStorageSync('colorCardOther') ? JSON.parse(Taro.getStorageSync('colorCardOther')) : {}
|
const info = Taro.getStorageSync('colorCardOther') ? JSON.parse(Taro.getStorageSync('colorCardOther')) : {}
|
||||||
setList(() => list)
|
setList(() => list)
|
||||||
computeCount(list)
|
computeCount(list)
|
||||||
setAddressInfo(info.address)
|
if (info.address) {
|
||||||
|
setAddressInfo(info.address)
|
||||||
|
submitData.current.address_id = info?.address?.id || 0
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
getAddressDefault()
|
||||||
|
}
|
||||||
setRemarkData(info.remark)
|
setRemarkData(info.remark)
|
||||||
submitData.current.address_id = info?.address?.id || 0
|
|
||||||
Taro.removeStorageSync('colorCard')
|
Taro.removeStorageSync('colorCard')
|
||||||
Taro.removeStorageSync('colorCardOther')
|
Taro.removeStorageSync('colorCardOther')
|
||||||
})
|
})
|
||||||
@ -106,6 +113,23 @@ export default () => {
|
|||||||
setRemarkData(e)
|
setRemarkData(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取默认地址
|
||||||
|
const { fetchData: addressListFetchData, state } = addressListApi()
|
||||||
|
const getAddressDefault = async() => {
|
||||||
|
const res = await addressListFetchData()
|
||||||
|
let defaultInfo: AddressItem|null = null
|
||||||
|
res?.data.list?.map((item) => {
|
||||||
|
defaultInfo = {
|
||||||
|
id: item.id,
|
||||||
|
address_title: item.province_name + item.city_name + item.district_name + item.address_detail,
|
||||||
|
address_name: item.name,
|
||||||
|
address_phone: item.phone,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
submitData.current.address_id = defaultInfo!.id
|
||||||
|
setAddressInfo(defaultInfo!)
|
||||||
|
}
|
||||||
|
|
||||||
return <View className={styles.main}>
|
return <View className={styles.main}>
|
||||||
<Address onSelect={getAddress} defaultValue={addressInfo} />
|
<Address onSelect={getAddress} defaultValue={addressInfo} />
|
||||||
<View className={styles.add_card_btn} onClick={onAddCard}>添加色卡</View>
|
<View className={styles.add_card_btn} onClick={onAddCard}>添加色卡</View>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { Text, View } from '@tarojs/components'
|
import { Text, View } from '@tarojs/components'
|
||||||
import { memo, useState } from 'react'
|
import { memo, useMemo, useState } from 'react'
|
||||||
import PopupSelectColor from '../popupSelectColor'
|
import PopupSelectColor from '../popupSelectColor'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import LabAndImg from '@/components/LabAndImg'
|
import LabAndImg from '@/components/LabAndImg'
|
||||||
@ -53,10 +53,15 @@ export default memo((props: ParamType) => {
|
|||||||
props.onSelect?.(productItem)
|
props.onSelect?.(productItem)
|
||||||
setCheckStatus(true)
|
setCheckStatus(true)
|
||||||
}
|
}
|
||||||
|
const labAndImgObj = useMemo(
|
||||||
|
() => {
|
||||||
|
return { lab: productItem?.lab, rgb: productItem?.rgb, texture_url: productItem?.texture_url }
|
||||||
|
},
|
||||||
|
[productItem],
|
||||||
|
)
|
||||||
return <View className={styles.get_card_item} onClick={changeSelect}>
|
return <View className={styles.get_card_item} onClick={changeSelect}>
|
||||||
<View className={styles.image}>
|
<View className={styles.image}>
|
||||||
<LabAndImg value={{}} />
|
<LabAndImg value={labAndImgObj} />
|
||||||
<Text>{productItem?.product_color_count}色</Text>
|
<Text>{productItem?.product_color_count}色</Text>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.card_info}>
|
<View className={styles.card_info}>
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import InfiniteScroll from '@/components/infiniteScroll'
|
|||||||
import Search from '@/components/search'
|
import Search from '@/components/search'
|
||||||
import { dataLoadingStatus, getFilterData } from '@/common/util'
|
import { dataLoadingStatus, getFilterData } from '@/common/util'
|
||||||
import { GetSampleOrderProductApi } from '@/api/cutSample'
|
import { GetSampleOrderProductApi } from '@/api/cutSample'
|
||||||
import { goLink } from '@/common/common'
|
import { alert, goLink } from '@/common/common'
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const { fetchData, state: cardState } = GetSampleOrderProductApi()
|
const { fetchData, state: cardState } = GetSampleOrderProductApi()
|
||||||
@ -19,36 +19,39 @@ export default () => {
|
|||||||
list: [],
|
list: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
})
|
})
|
||||||
const [searchData, setSearchData] = useState<{ color_card_ids?: number[]; product_code_and_name?: string; page: number; size: number }>({
|
const [searchData, setSearchData] = useState<{ product_ids?: string; product_code_and_name?: string; page: number; size: number }>({
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 10,
|
size: 10,
|
||||||
})
|
})
|
||||||
|
|
||||||
const shopColorCardData = useRef<ParamItem[]>([])
|
const shopColorCardData = useRef<ParamItem[]>([])
|
||||||
|
|
||||||
// 获取已加入购物车的数据id
|
|
||||||
const getShopId = () => {
|
|
||||||
if (shopColorCardData.current.length <= 0) { return null }
|
|
||||||
return shopColorCardData.current?.map((item) => {
|
|
||||||
return item.id
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取数据
|
// 获取数据
|
||||||
const getGetColorCard = async() => {
|
const getGetColorCard = async() => {
|
||||||
const { data } = await fetchData(getFilterData({ ...searchData, color_card_ids: getShopId() }))
|
const { data } = await fetchData(getFilterData({ ...searchData }))
|
||||||
setOrderData(() => ({ list: data.list, total: data.total }))
|
setOrderData(() => ({ list: data.list, total: data.total }))
|
||||||
setRefresherTriggeredStatus(() => false)
|
setRefresherTriggeredStatus(() => false)
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (Taro.getStorageSync('cutSample') && shopColorCardData.current.length <= 0) {
|
|
||||||
shopColorCardData.current = Taro.getStorageSync('cutSample') ? JSON.parse(Taro.getStorageSync('cutSample')) : []
|
|
||||||
// Taro.removeStorageSync('cutSample')
|
|
||||||
}
|
|
||||||
getGetColorCard()
|
getGetColorCard()
|
||||||
}, [searchData])
|
}, [searchData])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (Taro.getStorageSync('cutSample')) {
|
||||||
|
const res = Taro.getStorageSync('cutSample') ? JSON.parse(Taro.getStorageSync('cutSample')) : []
|
||||||
|
const selectProsuctIds: number[] = []
|
||||||
|
res.map((item) => {
|
||||||
|
selectProsuctIds.push(item.id)
|
||||||
|
})
|
||||||
|
setSelectProsuctIds(selectProsuctIds)
|
||||||
|
setSelectProcutColors(res)
|
||||||
|
if (selectProsuctIds.length > 0) {
|
||||||
|
setSearchData(e => ({ ...e, product_ids: selectProsuctIds.join(',') }))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [])
|
||||||
|
|
||||||
const getSearch = (con) => {
|
const getSearch = (con) => {
|
||||||
setSearchData(e => ({ ...e, product_code_and_name: con }))
|
setSearchData(e => ({ ...e, product_code_and_name: con }))
|
||||||
}
|
}
|
||||||
@ -56,9 +59,6 @@ export default () => {
|
|||||||
setSearchData(e => ({ ...e, product_code_and_name: '' }))
|
setSearchData(e => ({ ...e, product_code_and_name: '' }))
|
||||||
}
|
}
|
||||||
|
|
||||||
// 选择的数据
|
|
||||||
const [selectList, setSelectList] = useState<ParamItem[]>([])
|
|
||||||
|
|
||||||
// 数据加载状态
|
// 数据加载状态
|
||||||
const statusMore = useMemo(() => {
|
const statusMore = useMemo(() => {
|
||||||
return dataLoadingStatus({ list: orderData.list, total: cardState.total, status: cardState.loading })
|
return dataLoadingStatus({ list: orderData.list, total: cardState.total, status: cardState.loading })
|
||||||
@ -83,7 +83,8 @@ export default () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
Taro.setStorageSync('cutSample', JSON.stringify([...selectProcutColors, ...shopColorCardData.current]))
|
if (selectProcutColors.length <= 0) { return alert.none('请选择剪样') }
|
||||||
|
Taro.setStorageSync('cutSample', JSON.stringify([...selectProcutColors]))
|
||||||
Taro.redirectTo({
|
Taro.redirectTo({
|
||||||
url: '/pages/cutSampleListOrder/index',
|
url: '/pages/cutSampleListOrder/index',
|
||||||
})
|
})
|
||||||
@ -114,11 +115,11 @@ export default () => {
|
|||||||
const [selectColorIds, setSelectColorIds] = useState<number[]>([])
|
const [selectColorIds, setSelectColorIds] = useState<number[]>([])
|
||||||
const onSelected = (val: ColorItem[]) => {
|
const onSelected = (val: ColorItem[]) => {
|
||||||
val.map((item) => {
|
val.map((item) => {
|
||||||
item.count = 1
|
if (!item.count) { item.count = 1 }
|
||||||
})
|
})
|
||||||
const pIndex = selectProcutColors?.findIndex(item => item.id === selectItem?.id)
|
const pIndex = selectProcutColors?.findIndex(item => item.id === selectItem?.id)
|
||||||
if (pIndex === -1) {
|
if (pIndex === -1) {
|
||||||
const data: ParamItem&{ colors: ColorItem[] } = { ...selectItem }
|
const data: any = { ...selectItem }
|
||||||
data.colors = val
|
data.colors = val
|
||||||
selectProcutColors.push(data)
|
selectProcutColors.push(data)
|
||||||
}
|
}
|
||||||
@ -135,7 +136,7 @@ export default () => {
|
|||||||
|
|
||||||
return <View className={styles.main}>
|
return <View className={styles.main}>
|
||||||
<View className={styles.search}>
|
<View className={styles.search}>
|
||||||
<Search defaultValue={searchData?.product_code_and_name} placeholder="请输入搜索面料" changeOnSearch={getSearch} debounceTime={300} />
|
<Search defaultValue={searchData?.product_code_and_name} placeholder="请输入搜索面料" changeOnSearch={getSearch} debounceTime={500} />
|
||||||
<View className={styles.btn_reset} onClick={onReset}>取消</View>
|
<View className={styles.btn_reset} onClick={onReset}>取消</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.get_card_con}>
|
<View className={styles.get_card_con}>
|
||||||
@ -145,6 +146,7 @@ export default () => {
|
|||||||
statusMore={statusMore}
|
statusMore={statusMore}
|
||||||
refresherEnabled
|
refresherEnabled
|
||||||
selfOnRefresherRefresh={getRefresherRefresh}
|
selfOnRefresherRefresh={getRefresherRefresh}
|
||||||
|
|
||||||
>
|
>
|
||||||
{orderData.list?.map((item) => {
|
{orderData.list?.map((item) => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
.message {
|
.message {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 100%;
|
flex: 1;
|
||||||
margin-left: 24px;
|
margin-left: 24px;
|
||||||
.info_address {
|
.info_address {
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
|
|||||||
@ -52,7 +52,7 @@ export default (props: Param) => {
|
|||||||
}
|
}
|
||||||
return <>
|
return <>
|
||||||
<View className={styles.address_con} onClick={() => setShowList(true)}>
|
<View className={styles.address_con} onClick={() => setShowList(true)}>
|
||||||
<IconFont name="icon-dizhiguanli" size={50} />
|
<IconFont name="icon-dingwei" size={50} />
|
||||||
<View className={styles.message}>
|
<View className={styles.message}>
|
||||||
<View className={styles.info_address}>
|
<View className={styles.info_address}>
|
||||||
<View className={styles.address_name}>{data.address_title || '请选择收货地址'}</View>
|
<View className={styles.address_name}>{data.address_title || '请选择收货地址'}</View>
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import styles from './index.module.scss'
|
|||||||
import Counter from '@/components/counter'
|
import Counter from '@/components/counter'
|
||||||
import LabAndImg from '@/components/LabAndImg'
|
import LabAndImg from '@/components/LabAndImg'
|
||||||
import { formatHashTag } from '@/common/fotmat'
|
import { formatHashTag } from '@/common/fotmat'
|
||||||
|
import { alert } from '@/common/common'
|
||||||
|
|
||||||
interface ProductItemParamType {
|
interface ProductItemParamType {
|
||||||
code: string
|
code: string
|
||||||
@ -65,9 +66,12 @@ const ProductItem = memo((props: Param) => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const onMax = () => {
|
||||||
|
alert.none('最多领取2份')
|
||||||
|
}
|
||||||
return <>
|
return <>
|
||||||
<View key={value.id} className={styles.card_item}>
|
<View key={value.id} className={styles.card_item}>
|
||||||
<View className={styles.img}><LabAndImg value={labAndImgObj(props)} /></View>
|
<View className={styles.img}><LabAndImg value={labAndImgObj(props.value)} /></View>
|
||||||
<View className={styles.name_count}>
|
<View className={styles.name_count}>
|
||||||
<Text>{formatHashTag(value.code, value.name)}</Text>
|
<Text>{formatHashTag(value.code, value.name)}</Text>
|
||||||
<View className={styles.btns}>
|
<View className={styles.btns}>
|
||||||
@ -80,6 +84,7 @@ const ProductItem = memo((props: Param) => {
|
|||||||
onBlue={onChangeNum}
|
onBlue={onChangeNum}
|
||||||
unit="件"
|
unit="件"
|
||||||
onMin={onMin}
|
onMin={onMin}
|
||||||
|
onMax={onMax}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@ -22,4 +22,7 @@
|
|||||||
line-height: 82px;
|
line-height: 82px;
|
||||||
color: rgba(0, 0, 0, 0.4);
|
color: rgba(0, 0, 0, 0.4);
|
||||||
}
|
}
|
||||||
|
.valuable {
|
||||||
|
color: rgba(0, 0, 0, 0.8);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { Text, View } from '@tarojs/components'
|
import { Text, View } from '@tarojs/components'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
|
import classNames from 'classnames'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import Remark from '@/components/remark'
|
import Remark from '@/components/remark'
|
||||||
|
|
||||||
@ -25,7 +26,7 @@ export default (props: Param) => {
|
|||||||
<Text>填写/修改备注</Text>
|
<Text>填写/修改备注</Text>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.remarks_message}>
|
<View className={styles.remarks_message}>
|
||||||
<Text>{data || '尚未备注信息'}</Text>
|
<Text className={classNames(data ? styles.valuable : '')}>{data || '尚未备注信息'}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<Remark show={showRemark} onSave={getOnSave} onClose={() => setShowRemark(false)} />
|
<Remark show={showRemark} onSave={getOnSave} onClose={() => setShowRemark(false)} />
|
||||||
|
|||||||
@ -56,6 +56,9 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
|
.numText {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
text {
|
text {
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
|
|||||||
@ -13,11 +13,14 @@ import { getFilterData } from '@/common/util'
|
|||||||
import { UseSubscriptionMessage } from '@/use/useCommon'
|
import { UseSubscriptionMessage } from '@/use/useCommon'
|
||||||
import { SUBSCRIPTION_MESSAGE_SCENE } from '@/common/enum'
|
import { SUBSCRIPTION_MESSAGE_SCENE } from '@/common/enum'
|
||||||
import { formatHashTag } from '@/common/fotmat'
|
import { formatHashTag } from '@/common/fotmat'
|
||||||
|
import { submitCutSampleOrderApi } from '@/api/cutSample'
|
||||||
|
import { addressListApi } from '@/api/addressManager'
|
||||||
|
|
||||||
export interface submitData {
|
export interface submitData {
|
||||||
address_id: number
|
address_id: number
|
||||||
color_card_infos: { count: number; id: number }[]
|
cut_sample_order_product_color_list: { color_num: number; product_color_id: number }[]
|
||||||
remark: string
|
remark: string
|
||||||
|
shipment_mode: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ParamItem {
|
export interface ParamItem {
|
||||||
@ -47,8 +50,9 @@ export interface ParamItem {
|
|||||||
export default () => {
|
export default () => {
|
||||||
const submitData = useRef<submitData>({
|
const submitData = useRef<submitData>({
|
||||||
address_id: 0,
|
address_id: 0,
|
||||||
color_card_infos: [],
|
cut_sample_order_product_color_list: [],
|
||||||
remark: '',
|
remark: '',
|
||||||
|
shipment_mode: 2,
|
||||||
})
|
})
|
||||||
|
|
||||||
const [addressInfo, setAddressInfo] = useState<AddressItem>()
|
const [addressInfo, setAddressInfo] = useState<AddressItem>()
|
||||||
@ -59,39 +63,54 @@ export default () => {
|
|||||||
const [list, setList] = useState<ParamItem[]>([])
|
const [list, setList] = useState<ParamItem[]>([])
|
||||||
useDidShow(() => {
|
useDidShow(() => {
|
||||||
const list = Taro.getStorageSync('cutSample') ? JSON.parse(Taro.getStorageSync('cutSample')) : []
|
const list = Taro.getStorageSync('cutSample') ? JSON.parse(Taro.getStorageSync('cutSample')) : []
|
||||||
const info = Taro.getStorageSync('colorCardOther') ? JSON.parse(Taro.getStorageSync('colorCardOther')) : {}
|
const info = Taro.getStorageSync('cutSampleOther') ? JSON.parse(Taro.getStorageSync('cutSampleOther')) : {}
|
||||||
setList(() => list)
|
setList(() => list)
|
||||||
computeCount(list)
|
computeCount(list)
|
||||||
setAddressInfo(info.address)
|
if (info.address) {
|
||||||
|
setAddressInfo(info.address)
|
||||||
|
submitData.current.address_id = info?.address?.id || 0
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
getAddressDefault()
|
||||||
|
}
|
||||||
setRemarkData(info.remark)
|
setRemarkData(info.remark)
|
||||||
submitData.current.address_id = info?.address?.id || 0
|
|
||||||
// Taro.removeStorageSync('colorCard')
|
Taro.removeStorageSync('cutSample')
|
||||||
// Taro.removeStorageSync('colorCardOther')
|
Taro.removeStorageSync('cutSampleOther')
|
||||||
})
|
})
|
||||||
|
|
||||||
const onAddCard = () => {
|
const onAddCard = () => {
|
||||||
Taro.setStorageSync('cutSample', JSON.stringify(list))
|
Taro.setStorageSync('cutSample', JSON.stringify(list))
|
||||||
Taro.setStorageSync('colorCardOther', JSON.stringify({ address: addressInfo || {}, remark: submitData.current.remark }))
|
Taro.setStorageSync('cutSampleOther', JSON.stringify({ address: addressInfo || {}, remark: submitData.current.remark }))
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: '/pages/colorCardList/index',
|
url: '/pages/cutSampleList/index',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const onDelData = useCallback((val: ParamItem) => {
|
const onDelData = useCallback((val: ParamItem) => {
|
||||||
return (id: number) => {
|
return (id: number) => {
|
||||||
console.log('lista:', list)
|
|
||||||
const res = val.colors?.filter((citem) => {
|
const res = val.colors?.filter((citem) => {
|
||||||
return citem.id != id
|
return citem.id != id
|
||||||
})
|
})
|
||||||
list?.map((item, index) => {
|
if (res.length <= 0 && list.length === 1) {
|
||||||
if (item.id === val.id) {
|
return alert.none('不能删除最后一个剪样')
|
||||||
list[index] = { ...item, colors: [...res] }
|
}
|
||||||
|
else {
|
||||||
|
if (res.length > 0) {
|
||||||
|
list?.map((item, index) => {
|
||||||
|
if (item.id === val.id) {
|
||||||
|
list[index] = { ...item, colors: [...res] }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
computeCount(list)
|
||||||
|
setList(() => [...list])
|
||||||
}
|
}
|
||||||
})
|
else {
|
||||||
// // // if (list.length === 1) { return alert.none('不能删除最后一个色卡') }
|
const data = list?.filter(item => item.id != val.id)
|
||||||
// console.log('listb:', list)
|
computeCount(data)
|
||||||
computeCount(list)
|
setList(() => [...data])
|
||||||
setList(() => [...list])
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, [list])
|
}, [list])
|
||||||
|
|
||||||
@ -128,13 +147,15 @@ export default () => {
|
|||||||
const { ColorCard } = SUBSCRIPTION_MESSAGE_SCENE
|
const { ColorCard } = SUBSCRIPTION_MESSAGE_SCENE
|
||||||
const { openSubscriptionMessage } = UseSubscriptionMessage()
|
const { openSubscriptionMessage } = UseSubscriptionMessage()
|
||||||
|
|
||||||
const { fetchData: submitFetchData } = SubmitColorCardApi()
|
const { fetchData: submitFetchData } = submitCutSampleOrderApi()
|
||||||
const onSubmitData = async() => {
|
const onSubmitData = async() => {
|
||||||
submitData.current.color_card_infos = []
|
submitData.current.cut_sample_order_product_color_list = []
|
||||||
list?.map((item) => {
|
list?.map((item) => {
|
||||||
submitData.current.color_card_infos.push({
|
item.colors?.map((citem) => {
|
||||||
count: item.count || 0,
|
submitData.current.cut_sample_order_product_color_list.push({
|
||||||
id: item.id,
|
color_num: citem.count || 0,
|
||||||
|
product_color_id: citem.id,
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
if (!submitData.current.address_id) { return alert.none('请选择收货地址') }
|
if (!submitData.current.address_id) { return alert.none('请选择收货地址') }
|
||||||
@ -142,7 +163,7 @@ export default () => {
|
|||||||
const res = await submitFetchData(getFilterData(submitData.current))
|
const res = await submitFetchData(getFilterData(submitData.current))
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
alert.success('提交成功')
|
alert.success('提交成功')
|
||||||
goLink('/pages/colorCardOrderDetail/index', { id: res.data.id })
|
goLink('/pages/cutSampleListOrderDetail/index', { id: res.data.id }, 'redirectTo')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,6 +173,23 @@ export default () => {
|
|||||||
setRemarkData(e)
|
setRemarkData(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取默认地址
|
||||||
|
const { fetchData: addressListFetchData, state } = addressListApi()
|
||||||
|
const getAddressDefault = async() => {
|
||||||
|
const res = await addressListFetchData()
|
||||||
|
let defaultInfo: AddressItem|null = null
|
||||||
|
res?.data.list?.map((item) => {
|
||||||
|
defaultInfo = {
|
||||||
|
id: item.id,
|
||||||
|
address_title: item.province_name + item.city_name + item.district_name + item.address_detail,
|
||||||
|
address_name: item.name,
|
||||||
|
address_phone: item.phone,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
submitData.current.address_id = defaultInfo!.id || 0
|
||||||
|
setAddressInfo(defaultInfo!)
|
||||||
|
}
|
||||||
|
|
||||||
return <View className={styles.main}>
|
return <View className={styles.main}>
|
||||||
<Address onSelect={getAddress} defaultValue={addressInfo} />
|
<Address onSelect={getAddress} defaultValue={addressInfo} />
|
||||||
<View className={styles.add_card_btn} onClick={onAddCard}>添加剪样</View>
|
<View className={styles.add_card_btn} onClick={onAddCard}>添加剪样</View>
|
||||||
|
|||||||
@ -3,18 +3,30 @@ import { useCallback } from 'react'
|
|||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import Counter from '@/components/counter'
|
import Counter from '@/components/counter'
|
||||||
import LabAndImg from '@/components/LabAndImg'
|
import LabAndImg from '@/components/LabAndImg'
|
||||||
|
import { formatHashTag } from '@/common/fotmat'
|
||||||
|
|
||||||
export interface orderParam {
|
export interface ProductParam {
|
||||||
affiliation_product: any
|
code: string
|
||||||
count: number
|
|
||||||
lab: { l: number; a: number; b: number }
|
lab: { l: number; a: number; b: number }
|
||||||
name: string
|
name: string
|
||||||
|
product_colors: ColorParam[]
|
||||||
|
product_id: number
|
||||||
|
rgb: { r: number; g: number; b: number }
|
||||||
|
texture_url: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ColorParam {
|
||||||
|
code: string
|
||||||
|
color_num: number
|
||||||
|
lab: { l: number; a: number; b: number }
|
||||||
|
name: string
|
||||||
|
product_color_id: number
|
||||||
rgb: { r: number; g: number; b: number }
|
rgb: { r: number; g: number; b: number }
|
||||||
texture_url: string
|
texture_url: string
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Param {
|
interface Param {
|
||||||
value: orderParam[]
|
value: ProductParam[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export default (props: Param) => {
|
export default (props: Param) => {
|
||||||
@ -25,21 +37,25 @@ export default (props: Param) => {
|
|||||||
},
|
},
|
||||||
[value],
|
[value],
|
||||||
)
|
)
|
||||||
return <View className={styles.card_con}>
|
return <>
|
||||||
<View className={styles.card_header}>色卡信息</View>
|
{value?.map((pitem) => {
|
||||||
<View className={styles.card_list}>
|
return <View key={pitem.product_id} className={styles.card_con}>
|
||||||
<>
|
<View className={styles.card_header}>{formatHashTag(pitem.code, pitem.name)}</View>
|
||||||
{value?.map((item, index) => {
|
<View className={styles.card_list}>
|
||||||
return <View key={index} className={styles.card_item}>
|
<>
|
||||||
<View className={styles.img}><LabAndImg value={labAndImgObj(item)} /></View>
|
{pitem.product_colors?.map((citem, index) => {
|
||||||
<View className={styles.name_count}>
|
return <View key={index} className={styles.card_item}>
|
||||||
<Text>{item.name}</Text>
|
<View className={styles.img}><LabAndImg value={labAndImgObj(citem)} /></View>
|
||||||
<Text>x{item.count}本</Text>
|
<View className={styles.name_count}>
|
||||||
</View>
|
<Text>{formatHashTag(citem.code, citem.name)}</Text>
|
||||||
</View>
|
<Text>x{citem.color_num}份</Text>
|
||||||
})}
|
</View>
|
||||||
<View className={styles.express_btn}>快递到付</View>
|
</View>
|
||||||
</>
|
})}
|
||||||
</View>
|
<View className={styles.express_btn}>快递到付</View>
|
||||||
</View>
|
</>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
})}
|
||||||
|
</>
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
export default {
|
export default {
|
||||||
navigationBarTitleText: '色卡订单详情',
|
navigationBarTitleText: '剪样订单详情',
|
||||||
enableShareAppMessage: true,
|
enableShareAppMessage: true,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,49 +1,48 @@
|
|||||||
import { Text, View } from '@tarojs/components'
|
import { View } from '@tarojs/components'
|
||||||
import Taro, { useDidShow, useRouter } from '@tarojs/taro'
|
import Taro, { useDidShow, useRouter } from '@tarojs/taro'
|
||||||
import { useMemo, useState } from 'react'
|
import { useMemo, useState } from 'react'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import Address from './components/address'
|
import Address from './components/address'
|
||||||
import type { orderParam } from './components/productCard'
|
import type { ProductParam } from './components/productCard'
|
||||||
import ProductCard from './components/productCard'
|
import ProductCard from './components/productCard'
|
||||||
import Remark from './components/remark'
|
import Remark from './components/remark'
|
||||||
import OrderInfo from './components/orderInfo'
|
import OrderInfo from './components/orderInfo'
|
||||||
import type { orderStateItem } from './components/orderState'
|
import type { orderStateItem } from './components/orderState'
|
||||||
import OrderState from './components/orderState'
|
import OrderState from './components/orderState'
|
||||||
import { alert, goLink } from '@/common/common'
|
import { alert } from '@/common/common'
|
||||||
import SearchInput from '@/components/searchInput'
|
|
||||||
import { ColorCardOrderCancelApi, GetColorCardOrderDetailApi } from '@/api/colorCard'
|
import { ColorCardOrderCancelApi, GetColorCardOrderDetailApi } from '@/api/colorCard'
|
||||||
|
import { CutSampleOrderCancelApi, GetCutSampleOrderDetailApi } from '@/api/cutSample'
|
||||||
|
|
||||||
interface Param {
|
interface Param {
|
||||||
address: string
|
address_detail: string
|
||||||
color_card_info: orderParam[]
|
city_id: number
|
||||||
|
city_name: string
|
||||||
create_time: string
|
create_time: string
|
||||||
create_user_name: string
|
cut_sample_order_product_list: ProductParam[]
|
||||||
creator_id: number
|
district_id: number
|
||||||
id: number
|
district_name: string
|
||||||
|
order_form: orderStateItem[]
|
||||||
|
order_id: number
|
||||||
order_no: string
|
order_no: string
|
||||||
order_progress: orderStateItem[]
|
order_remark: string
|
||||||
order_status: number
|
phone: string
|
||||||
order_status_name: string
|
province_id: number
|
||||||
|
province_name: string
|
||||||
purchaser_id: number
|
purchaser_id: number
|
||||||
purchaser_name: string
|
purchaser_name: string
|
||||||
purchaser_phone: string
|
|
||||||
remark: string
|
|
||||||
sale_user_id: number
|
sale_user_id: number
|
||||||
sale_user_name: string
|
sale_user_name: string
|
||||||
shipment_mode: number
|
shipment_mode: number
|
||||||
shipment_mode_name: string
|
shipment_mode_name: string
|
||||||
target_user_name: string
|
target_user_name: string
|
||||||
target_user_phone: string
|
target_user_phone: string
|
||||||
update_time: string
|
|
||||||
update_user_name: string
|
|
||||||
updater_id: number
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
const [orderData, setOrderData] = useState<Param>()
|
const [orderData, setOrderData] = useState<Param>()
|
||||||
const { fetchData: fetchDataDtail } = GetColorCardOrderDetailApi()
|
const { fetchData: fetchDataDtail } = GetCutSampleOrderDetailApi()
|
||||||
const getColorCardOrderDetail = async() => {
|
const getColorCardOrderDetail = async() => {
|
||||||
const res = await fetchDataDtail({ id: router.params.id })
|
const res = await fetchDataDtail({ id: router.params.id })
|
||||||
setOrderData(() => res.data)
|
setOrderData(() => res.data)
|
||||||
@ -55,21 +54,21 @@ export default () => {
|
|||||||
|
|
||||||
const addressData = useMemo(() => {
|
const addressData = useMemo(() => {
|
||||||
return {
|
return {
|
||||||
address_title: orderData?.address || '',
|
address_title: `${orderData?.province_name}${orderData?.city_name}${orderData?.district_name}`,
|
||||||
address_name: orderData?.purchaser_name || '',
|
address_name: orderData?.purchaser_name || '',
|
||||||
address_phone: orderData?.purchaser_phone || '',
|
address_phone: orderData?.target_user_phone || '',
|
||||||
address_mode: orderData?.shipment_mode_name || '',
|
address_mode: orderData?.shipment_mode_name || '',
|
||||||
}
|
}
|
||||||
}, [orderData])
|
}, [orderData])
|
||||||
|
|
||||||
// 取消订单
|
// 取消订单
|
||||||
const { fetchData: fetchDataCancel } = ColorCardOrderCancelApi()
|
const { fetchData: fetchDataCancel } = CutSampleOrderCancelApi()
|
||||||
const onCancel = async() => {
|
const onCancel = async() => {
|
||||||
Taro.showModal({
|
Taro.showModal({
|
||||||
title: '确定取消订单?',
|
title: '确定取消订单?',
|
||||||
async success(res) {
|
async success(res) {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
const res = await fetchDataCancel({ id: orderData?.id })
|
const res = await fetchDataCancel({ id: orderData?.order_id })
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
alert.success('取消成功')
|
alert.success('取消成功')
|
||||||
getColorCardOrderDetail()
|
getColorCardOrderDetail()
|
||||||
@ -82,12 +81,12 @@ export default () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
return <View className={styles.main}>
|
return <View className={styles.main}>
|
||||||
<OrderState list={orderData?.order_progress} />
|
<OrderState list={orderData?.order_form} />
|
||||||
<Address defaultValue={addressData} />
|
<Address defaultValue={addressData} />
|
||||||
<ProductCard value={orderData?.color_card_info || []} />
|
<ProductCard value={orderData?.cut_sample_order_product_list || []} />
|
||||||
<OrderInfo {...orderData} />
|
<OrderInfo {...orderData} />
|
||||||
<Remark value={orderData?.remark || ''} placeholder="尚未备注信息" />
|
<Remark value={orderData?.order_remark || ''} placeholder="尚未备注信息" />
|
||||||
{orderData?.order_status === 1 && <View className={styles.order_btn}>
|
{orderData?.order_form?.length === 1 && <View className={styles.order_btn}>
|
||||||
<View className={styles.btn_con}>
|
<View className={styles.btn_con}>
|
||||||
<View className={styles.btn} onClick={onCancel}>取消订单</View>
|
<View className={styles.btn} onClick={onCancel}>取消订单</View>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@ -252,6 +252,18 @@ const Details = (props: Params) => {
|
|||||||
setShowColorSelect(true)
|
setShowColorSelect(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onCutSampleList = (val) => {
|
||||||
|
const data = { ...productInfo }
|
||||||
|
val.map((item) => {
|
||||||
|
item.count = 1
|
||||||
|
})
|
||||||
|
data.colors = val
|
||||||
|
Taro.setStorageSync('cutSample', JSON.stringify([data]))
|
||||||
|
Taro.redirectTo({
|
||||||
|
url: '/pages/cutSampleListOrder/index',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MoveBtn showList={['customer']}>
|
<MoveBtn showList={['customer']}>
|
||||||
<View className={styles.main}>
|
<View className={styles.main}>
|
||||||
@ -423,7 +435,7 @@ const Details = (props: Params) => {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
<PopupSelectColor show={showColorSelect} product_id={productInfo.id} onClose={() => setShowColorSelect(false)} />
|
<PopupSelectColor onSelected={onCutSampleList} show={showColorSelect} product_id={productInfo.id} onClose={() => setShowColorSelect(false)} />
|
||||||
<View className="common_safe_area_y"></View>
|
<View className="common_safe_area_y"></View>
|
||||||
</View>
|
</View>
|
||||||
</MoveBtn>
|
</MoveBtn>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 43 KiB |
Loading…
x
Reference in New Issue
Block a user