✨ feat(ID1000873领取剪样和ID1000868领取色卡):
This commit is contained in:
parent
2d2518f4ab
commit
f375079d30
@ -29,7 +29,7 @@ export const GetCutSampleOrderStatusApi = () => {
|
||||
export const CutSampleOrderCancelApi = () => {
|
||||
return request({
|
||||
url: '/v1/mall/cutSampleOrder/cancel',
|
||||
method: 'post',
|
||||
method: 'put',
|
||||
})
|
||||
}
|
||||
|
||||
@ -43,3 +43,25 @@ export const GetSampleOrderProductApi = () => {
|
||||
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.1.165:40001/lymarket` // 王霞
|
||||
// export const BASE_URL = 'https://test.zzfzyc.com/lymarket' // 测试环境
|
||||
// export const BASE_URL = 'https://pre.zzfzyc.com/lymarket' // 预发布
|
||||
export const BASE_URL = 'https://pre.zzfzyc.com/lymarket' // 预发布
|
||||
// export const BASE_URL = `http://192.168.1.9:40001/lymarket` // 发
|
||||
// export const BASE_URL = `http://192.168.1.9:50005/lymarket` // 发
|
||||
// export const BASE_URL = `http://192.168.1.30:50001/lymarket` // 发
|
||||
@ -13,7 +13,7 @@
|
||||
// export const BASE_URL = 'https://www.zzfzyc.com/lymarket' // 正式环境
|
||||
// export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞
|
||||
// export const BASE_URL = 'http://192.168.1.7:50002/lymarket' // 添
|
||||
export const BASE_URL = 'http://192.168.1.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' // 杰
|
||||
|
||||
// CDN
|
||||
|
||||
@ -70,6 +70,7 @@ const CounterDisplayName = (props: params) => {
|
||||
if (!isInteger(num_res)) {
|
||||
num_res = Math.trunc(num_res)
|
||||
}
|
||||
if (num_res > maxNum) { onMax?.() }
|
||||
num_res = num_res >= maxNum ? maxNum : num_res
|
||||
setValue({ ...value, count: num_res })
|
||||
onChange?.(parseFloat(num_res))
|
||||
|
||||
@ -5,7 +5,7 @@ import LoadingCard from '../loadingCard'
|
||||
import style from './index.module.scss'
|
||||
import DotLoading from '@/components/dotLoading'
|
||||
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
|
||||
|
||||
@ -32,6 +32,8 @@ interface Params {
|
||||
moreText?: string
|
||||
loadingText?: string
|
||||
noMoreText?: string
|
||||
defaultUrl?: string
|
||||
defaultText?: string
|
||||
}
|
||||
const InfiniteScroll = ({
|
||||
styleObj,
|
||||
@ -53,6 +55,8 @@ const InfiniteScroll = ({
|
||||
statusMore = 0,
|
||||
enableBackToTop = true,
|
||||
emptySlot,
|
||||
defaultUrl = '',
|
||||
defaultText = '',
|
||||
}: Params) => {
|
||||
const scrollToLower = () => {
|
||||
selfonScrollToLower?.()
|
||||
@ -113,7 +117,7 @@ const InfiniteScroll = ({
|
||||
</View>
|
||||
)}
|
||||
{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"
|
||||
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>}
|
||||
{showCode && <CodeSelect orderObj={orderObj} y={screenHeight.code as number} />}
|
||||
<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 }) }
|
||||
})
|
||||
onSelected?.(data)
|
||||
// Taro.setStorageSync('cutSample', JSON.stringify(data))
|
||||
// goLink('/pages/cutSampleListOrder/index')
|
||||
}
|
||||
return <View className={styles.main}>
|
||||
<Popup show={show} showTitle={false} onClose={onClose}>
|
||||
@ -125,7 +123,6 @@ interface ColorItemCom {
|
||||
}
|
||||
const ColorSelectItem = memo((props: ColorItemCom) => {
|
||||
const { item, onSelect } = props
|
||||
console.log('abcedef', item)
|
||||
return <View key={item.id} className={styles.item} onClick={() => onSelect?.(item)}>
|
||||
<View className={classNames(styles.item_color, item.status && styles.select_color)}>
|
||||
<LabAndImg
|
||||
|
||||
@ -9,7 +9,6 @@ import InfiniteScroll from '@/components/infiniteScroll'
|
||||
import { alert, goLink } from '@/common/common'
|
||||
import { ColorCardOrderCancelApi, GetColorCardOrderApi, GetColorCardOrderStatusApi } from '@/api/colorCard'
|
||||
import { dataLoadingStatus, getFilterData } from '@/common/util'
|
||||
import kong from '@/styles/image/kong.png'
|
||||
|
||||
export default () => {
|
||||
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>)}
|
||||
</View>
|
||||
<View className={styles.con}>
|
||||
{false && <View className={styles.kong_image}>
|
||||
<Image src={kong}></Image>
|
||||
<Text>还没有领取过色卡</Text>
|
||||
</View>}
|
||||
<View className={styles.con_list}>
|
||||
<InfiniteScroll
|
||||
statusMore={statusMore}
|
||||
@ -110,6 +105,8 @@ export default () => {
|
||||
selfonScrollToLower={getScrolltolower}
|
||||
refresherTriggered={refresherTriggeredStatus}
|
||||
selfOnRefresherRefresh={getRefresherRefresh}
|
||||
defaultUrl="/color_card/colorCardList_empty.png"
|
||||
defaultText="还没领取过色卡"
|
||||
>
|
||||
{orderData.list?.map((item) => {
|
||||
return (
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
height: 134px;
|
||||
}
|
||||
.item_con_desc {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
@ -51,14 +51,22 @@ export default (props: Param) => {
|
||||
e.stopPropagation()
|
||||
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}>
|
||||
<Text>单号:{value.order_no}</Text>
|
||||
<Text>{value.mp_cut_sample_audit_status_name}</Text>
|
||||
</View>
|
||||
<View className={styles.item_con}>
|
||||
<View className={styles.image}>
|
||||
<LabAndImg value={{}} showStatus={false} />
|
||||
<LabAndImg value={labAndImgObj} showStatus={false} />
|
||||
</View>
|
||||
<View className={styles.item_con_desc}>
|
||||
<View className={styles.item_con_name}>
|
||||
|
||||
@ -8,7 +8,6 @@ import styles from './index.module.scss'
|
||||
import InfiniteScroll from '@/components/infiniteScroll'
|
||||
import { alert, goLink } from '@/common/common'
|
||||
import { dataLoadingStatus, getFilterData } from '@/common/util'
|
||||
import kong from '@/styles/image/kong.png'
|
||||
import { CutSampleOrderCancelApi, GetCutSampleOrderListApi, GetCutSampleOrderStatusApi } from '@/api/cutSample'
|
||||
|
||||
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>)}
|
||||
</View>
|
||||
<View className={styles.con}>
|
||||
{false && <View className={styles.kong_image}>
|
||||
<Image src={kong}></Image>
|
||||
<Text>还没有领取过色卡</Text>
|
||||
</View>}
|
||||
<View className={styles.con_list}>
|
||||
<InfiniteScroll
|
||||
statusMore={statusMore}
|
||||
@ -110,6 +105,9 @@ export default () => {
|
||||
selfonScrollToLower={getScrolltolower}
|
||||
refresherTriggered={refresherTriggeredStatus}
|
||||
selfOnRefresherRefresh={getRefresherRefresh}
|
||||
defaultUrl="/color_card/colorCardList_empty.png"
|
||||
defaultText="还没领取过剪样"
|
||||
|
||||
>
|
||||
{orderData.list?.map((item) => {
|
||||
return (
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
height: 134px;
|
||||
}
|
||||
.item_con_desc {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
@ -39,6 +39,14 @@ export default (props: Param) => {
|
||||
e.stopPropagation()
|
||||
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 })} >
|
||||
<View className={styles.item_header}>
|
||||
<Text>单号:{value.order_no}</Text>
|
||||
@ -46,7 +54,7 @@ export default (props: Param) => {
|
||||
</View>
|
||||
<View className={styles.item_con}>
|
||||
<View className={styles.image}>
|
||||
<LabAndImg value={{}} showStatus={false} />
|
||||
<LabAndImg value={labAndImgObj} showStatus={false} />
|
||||
</View>
|
||||
|
||||
<View className={styles.item_con_desc}>
|
||||
|
||||
@ -6,7 +6,6 @@ import styles from './index.module.scss'
|
||||
import type { ParamItem } from './components/productItem'
|
||||
import ProductItem from './components/productItem'
|
||||
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'
|
||||
@ -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>)}
|
||||
</View>
|
||||
<View className={styles.con}>
|
||||
{false && <View className={styles.kong_image}>
|
||||
<Image src={kong}></Image>
|
||||
<Text>还没有领取过色卡</Text>
|
||||
</View>}
|
||||
<View className={styles.con_list}>
|
||||
<InfiniteScroll
|
||||
statusMore={statusMore}
|
||||
|
||||
@ -1,18 +1,9 @@
|
||||
import { Image, Text, View } from '@tarojs/components'
|
||||
import Taro, { useDidShow } from '@tarojs/taro'
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import classNames from 'classnames'
|
||||
import { useState } from 'react'
|
||||
import styles from './index.module.scss'
|
||||
import type { ParamItem } from './components/productItem'
|
||||
import ProductItem from './components/productItem'
|
||||
import ColorCardList from './components/colorCardList'
|
||||
import CutSampleList from './components/cutSampleList'
|
||||
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 () => {
|
||||
const [selectIndex, setSelectIndex] = useState(1)
|
||||
|
||||
@ -5,6 +5,21 @@
|
||||
.image {
|
||||
width: 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 {
|
||||
margin-left: 24px;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
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 LabAndImg from '@/components/LabAndImg'
|
||||
import Checkbox from '@/components/checkbox'
|
||||
@ -36,9 +36,16 @@ export default memo((props: ParamType) => {
|
||||
props.onSelect?.(props, 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}>
|
||||
<View className={styles.image}>
|
||||
<LabAndImg value={{}} />
|
||||
<LabAndImg value={labAndImgObj} />
|
||||
{affiliation_product.length > 1 && <Text>多面料共用</Text>}
|
||||
</View>
|
||||
<View className={styles.card_info}>
|
||||
<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 { GetColorCardApi } from '@/api/colorCard'
|
||||
import { dataLoadingStatus, getFilterData } from '@/common/util'
|
||||
import { alert } from '@/common/common'
|
||||
|
||||
export default () => {
|
||||
const { fetchData, state: cardState } = GetColorCardApi()
|
||||
@ -81,6 +82,7 @@ export default () => {
|
||||
}
|
||||
|
||||
const onSubmit = () => {
|
||||
if (selectList.length <= 0) { return alert.none('请选择色卡') }
|
||||
selectList?.map((item) => {
|
||||
item.count = 1
|
||||
})
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
margin-left: 24px;
|
||||
.info_address {
|
||||
font-size: 28px;
|
||||
|
||||
@ -52,7 +52,7 @@ export default (props: Param) => {
|
||||
}
|
||||
return <>
|
||||
<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.info_address}>
|
||||
<View className={styles.address_name}>{data.address_title || '请选择收货地址'}</View>
|
||||
|
||||
@ -14,14 +14,32 @@
|
||||
flex: 1;
|
||||
font-size: 28px;
|
||||
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 {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.count_btn {
|
||||
margin-top: 27px;
|
||||
padding-bottom: 10px;
|
||||
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 Counter from '@/components/counter'
|
||||
import LabAndImg from '@/components/LabAndImg'
|
||||
import { alert } from '@/common/common'
|
||||
|
||||
interface ProductItemParamType {
|
||||
code: string
|
||||
@ -35,7 +36,9 @@ export default memo((props: Param) => {
|
||||
const ProductItem = memo((props: Param) => {
|
||||
const { value } = props
|
||||
const labAndImgObj = useCallback(
|
||||
|
||||
(item) => {
|
||||
console.log('item:::', item)
|
||||
return { lab: item.lab, rgb: item.rgb, texture_url: item.texture_url }
|
||||
},
|
||||
[value],
|
||||
@ -43,7 +46,6 @@ const ProductItem = memo((props: Param) => {
|
||||
const onChangeNum = (num) => {
|
||||
props.onChangeNum?.({ id: value.id, count: num })
|
||||
}
|
||||
console.log('测试:::', value)
|
||||
const onMin = () => {
|
||||
Taro.showModal({
|
||||
title: '确认删除所选色卡?',
|
||||
@ -57,11 +59,22 @@ const ProductItem = memo((props: Param) => {
|
||||
},
|
||||
})
|
||||
}
|
||||
const onMax = () => {
|
||||
alert.none('最多领取2份')
|
||||
}
|
||||
return <>
|
||||
<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}>
|
||||
<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.count_btn}>
|
||||
<Counter
|
||||
@ -72,6 +85,7 @@ const ProductItem = memo((props: Param) => {
|
||||
onBlue={onChangeNum}
|
||||
unit="件"
|
||||
onMin={onMin}
|
||||
onMax={onMax}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@ -12,6 +12,7 @@ import { SubmitColorCardApi } from '@/api/colorCard'
|
||||
import { getFilterData } from '@/common/util'
|
||||
import { UseSubscriptionMessage } from '@/use/useCommon'
|
||||
import { SUBSCRIPTION_MESSAGE_SCENE } from '@/common/enum'
|
||||
import { addressListApi } from '@/api/addressManager'
|
||||
|
||||
export interface submitData {
|
||||
address_id: number
|
||||
@ -36,9 +37,15 @@ export default () => {
|
||||
const info = Taro.getStorageSync('colorCardOther') ? JSON.parse(Taro.getStorageSync('colorCardOther')) : {}
|
||||
setList(() => 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)
|
||||
submitData.current.address_id = info?.address?.id || 0
|
||||
|
||||
Taro.removeStorageSync('colorCard')
|
||||
Taro.removeStorageSync('colorCardOther')
|
||||
})
|
||||
@ -106,6 +113,23 @@ export default () => {
|
||||
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}>
|
||||
<Address onSelect={getAddress} defaultValue={addressInfo} />
|
||||
<View className={styles.add_card_btn} onClick={onAddCard}>添加色卡</View>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Text, View } from '@tarojs/components'
|
||||
import { memo, useState } from 'react'
|
||||
import { memo, useMemo, useState } from 'react'
|
||||
import PopupSelectColor from '../popupSelectColor'
|
||||
import styles from './index.module.scss'
|
||||
import LabAndImg from '@/components/LabAndImg'
|
||||
@ -53,10 +53,15 @@ export default memo((props: ParamType) => {
|
||||
props.onSelect?.(productItem)
|
||||
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}>
|
||||
<View className={styles.image}>
|
||||
<LabAndImg value={{}} />
|
||||
<LabAndImg value={labAndImgObj} />
|
||||
<Text>{productItem?.product_color_count}色</Text>
|
||||
</View>
|
||||
<View className={styles.card_info}>
|
||||
|
||||
@ -11,7 +11,7 @@ import InfiniteScroll from '@/components/infiniteScroll'
|
||||
import Search from '@/components/search'
|
||||
import { dataLoadingStatus, getFilterData } from '@/common/util'
|
||||
import { GetSampleOrderProductApi } from '@/api/cutSample'
|
||||
import { goLink } from '@/common/common'
|
||||
import { alert, goLink } from '@/common/common'
|
||||
|
||||
export default () => {
|
||||
const { fetchData, state: cardState } = GetSampleOrderProductApi()
|
||||
@ -19,36 +19,39 @@ export default () => {
|
||||
list: [],
|
||||
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,
|
||||
size: 10,
|
||||
})
|
||||
|
||||
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 { data } = await fetchData(getFilterData({ ...searchData, color_card_ids: getShopId() }))
|
||||
const { data } = await fetchData(getFilterData({ ...searchData }))
|
||||
setOrderData(() => ({ list: data.list, total: data.total }))
|
||||
setRefresherTriggeredStatus(() => false)
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (Taro.getStorageSync('cutSample') && shopColorCardData.current.length <= 0) {
|
||||
shopColorCardData.current = Taro.getStorageSync('cutSample') ? JSON.parse(Taro.getStorageSync('cutSample')) : []
|
||||
// Taro.removeStorageSync('cutSample')
|
||||
}
|
||||
getGetColorCard()
|
||||
}, [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) => {
|
||||
setSearchData(e => ({ ...e, product_code_and_name: con }))
|
||||
}
|
||||
@ -56,9 +59,6 @@ export default () => {
|
||||
setSearchData(e => ({ ...e, product_code_and_name: '' }))
|
||||
}
|
||||
|
||||
// 选择的数据
|
||||
const [selectList, setSelectList] = useState<ParamItem[]>([])
|
||||
|
||||
// 数据加载状态
|
||||
const statusMore = useMemo(() => {
|
||||
return dataLoadingStatus({ list: orderData.list, total: cardState.total, status: cardState.loading })
|
||||
@ -83,7 +83,8 @@ export default () => {
|
||||
}
|
||||
|
||||
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({
|
||||
url: '/pages/cutSampleListOrder/index',
|
||||
})
|
||||
@ -114,11 +115,11 @@ export default () => {
|
||||
const [selectColorIds, setSelectColorIds] = useState<number[]>([])
|
||||
const onSelected = (val: ColorItem[]) => {
|
||||
val.map((item) => {
|
||||
item.count = 1
|
||||
if (!item.count) { item.count = 1 }
|
||||
})
|
||||
const pIndex = selectProcutColors?.findIndex(item => item.id === selectItem?.id)
|
||||
if (pIndex === -1) {
|
||||
const data: ParamItem&{ colors: ColorItem[] } = { ...selectItem }
|
||||
const data: any = { ...selectItem }
|
||||
data.colors = val
|
||||
selectProcutColors.push(data)
|
||||
}
|
||||
@ -135,7 +136,7 @@ export default () => {
|
||||
|
||||
return <View className={styles.main}>
|
||||
<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>
|
||||
<View className={styles.get_card_con}>
|
||||
@ -145,6 +146,7 @@ export default () => {
|
||||
statusMore={statusMore}
|
||||
refresherEnabled
|
||||
selfOnRefresherRefresh={getRefresherRefresh}
|
||||
|
||||
>
|
||||
{orderData.list?.map((item) => {
|
||||
return (
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
.message {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
margin-left: 24px;
|
||||
.info_address {
|
||||
font-size: 28px;
|
||||
|
||||
@ -52,7 +52,7 @@ export default (props: Param) => {
|
||||
}
|
||||
return <>
|
||||
<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.info_address}>
|
||||
<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 LabAndImg from '@/components/LabAndImg'
|
||||
import { formatHashTag } from '@/common/fotmat'
|
||||
import { alert } from '@/common/common'
|
||||
|
||||
interface ProductItemParamType {
|
||||
code: string
|
||||
@ -65,9 +66,12 @@ const ProductItem = memo((props: Param) => {
|
||||
},
|
||||
})
|
||||
}
|
||||
const onMax = () => {
|
||||
alert.none('最多领取2份')
|
||||
}
|
||||
return <>
|
||||
<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}>
|
||||
<Text>{formatHashTag(value.code, value.name)}</Text>
|
||||
<View className={styles.btns}>
|
||||
@ -80,6 +84,7 @@ const ProductItem = memo((props: Param) => {
|
||||
onBlue={onChangeNum}
|
||||
unit="件"
|
||||
onMin={onMin}
|
||||
onMax={onMax}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@ -22,4 +22,7 @@
|
||||
line-height: 82px;
|
||||
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 { useEffect, useState } from 'react'
|
||||
import classNames from 'classnames'
|
||||
import styles from './index.module.scss'
|
||||
import Remark from '@/components/remark'
|
||||
|
||||
@ -25,7 +26,7 @@ export default (props: Param) => {
|
||||
<Text>填写/修改备注</Text>
|
||||
</View>
|
||||
<View className={styles.remarks_message}>
|
||||
<Text>{data || '尚未备注信息'}</Text>
|
||||
<Text className={classNames(data ? styles.valuable : '')}>{data || '尚未备注信息'}</Text>
|
||||
</View>
|
||||
</View>
|
||||
<Remark show={showRemark} onSave={getOnSave} onClose={() => setShowRemark(false)} />
|
||||
|
||||
@ -56,6 +56,9 @@
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
.numText {
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
text {
|
||||
font-size: 24px;
|
||||
|
||||
@ -13,11 +13,14 @@ import { getFilterData } from '@/common/util'
|
||||
import { UseSubscriptionMessage } from '@/use/useCommon'
|
||||
import { SUBSCRIPTION_MESSAGE_SCENE } from '@/common/enum'
|
||||
import { formatHashTag } from '@/common/fotmat'
|
||||
import { submitCutSampleOrderApi } from '@/api/cutSample'
|
||||
import { addressListApi } from '@/api/addressManager'
|
||||
|
||||
export interface submitData {
|
||||
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
|
||||
shipment_mode: number
|
||||
}
|
||||
|
||||
export interface ParamItem {
|
||||
@ -47,8 +50,9 @@ export interface ParamItem {
|
||||
export default () => {
|
||||
const submitData = useRef<submitData>({
|
||||
address_id: 0,
|
||||
color_card_infos: [],
|
||||
cut_sample_order_product_color_list: [],
|
||||
remark: '',
|
||||
shipment_mode: 2,
|
||||
})
|
||||
|
||||
const [addressInfo, setAddressInfo] = useState<AddressItem>()
|
||||
@ -59,39 +63,54 @@ export default () => {
|
||||
const [list, setList] = useState<ParamItem[]>([])
|
||||
useDidShow(() => {
|
||||
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)
|
||||
computeCount(list)
|
||||
setAddressInfo(info.address)
|
||||
if (info.address) {
|
||||
setAddressInfo(info.address)
|
||||
submitData.current.address_id = info?.address?.id || 0
|
||||
}
|
||||
else {
|
||||
getAddressDefault()
|
||||
}
|
||||
setRemarkData(info.remark)
|
||||
submitData.current.address_id = info?.address?.id || 0
|
||||
// Taro.removeStorageSync('colorCard')
|
||||
// Taro.removeStorageSync('colorCardOther')
|
||||
|
||||
Taro.removeStorageSync('cutSample')
|
||||
Taro.removeStorageSync('cutSampleOther')
|
||||
})
|
||||
|
||||
const onAddCard = () => {
|
||||
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({
|
||||
url: '/pages/colorCardList/index',
|
||||
url: '/pages/cutSampleList/index',
|
||||
})
|
||||
}
|
||||
|
||||
const onDelData = useCallback((val: ParamItem) => {
|
||||
return (id: number) => {
|
||||
console.log('lista:', list)
|
||||
const res = val.colors?.filter((citem) => {
|
||||
return citem.id != id
|
||||
})
|
||||
list?.map((item, index) => {
|
||||
if (item.id === val.id) {
|
||||
list[index] = { ...item, colors: [...res] }
|
||||
if (res.length <= 0 && list.length === 1) {
|
||||
return alert.none('不能删除最后一个剪样')
|
||||
}
|
||||
else {
|
||||
if (res.length > 0) {
|
||||
list?.map((item, index) => {
|
||||
if (item.id === val.id) {
|
||||
list[index] = { ...item, colors: [...res] }
|
||||
}
|
||||
})
|
||||
computeCount(list)
|
||||
setList(() => [...list])
|
||||
}
|
||||
})
|
||||
// // // if (list.length === 1) { return alert.none('不能删除最后一个色卡') }
|
||||
// console.log('listb:', list)
|
||||
computeCount(list)
|
||||
setList(() => [...list])
|
||||
else {
|
||||
const data = list?.filter(item => item.id != val.id)
|
||||
computeCount(data)
|
||||
setList(() => [...data])
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [list])
|
||||
|
||||
@ -128,13 +147,15 @@ export default () => {
|
||||
const { ColorCard } = SUBSCRIPTION_MESSAGE_SCENE
|
||||
const { openSubscriptionMessage } = UseSubscriptionMessage()
|
||||
|
||||
const { fetchData: submitFetchData } = SubmitColorCardApi()
|
||||
const { fetchData: submitFetchData } = submitCutSampleOrderApi()
|
||||
const onSubmitData = async() => {
|
||||
submitData.current.color_card_infos = []
|
||||
submitData.current.cut_sample_order_product_color_list = []
|
||||
list?.map((item) => {
|
||||
submitData.current.color_card_infos.push({
|
||||
count: item.count || 0,
|
||||
id: item.id,
|
||||
item.colors?.map((citem) => {
|
||||
submitData.current.cut_sample_order_product_color_list.push({
|
||||
color_num: citem.count || 0,
|
||||
product_color_id: citem.id,
|
||||
})
|
||||
})
|
||||
})
|
||||
if (!submitData.current.address_id) { return alert.none('请选择收货地址') }
|
||||
@ -142,7 +163,7 @@ export default () => {
|
||||
const res = await submitFetchData(getFilterData(submitData.current))
|
||||
if (res.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)
|
||||
}
|
||||
|
||||
// 获取默认地址
|
||||
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}>
|
||||
<Address onSelect={getAddress} defaultValue={addressInfo} />
|
||||
<View className={styles.add_card_btn} onClick={onAddCard}>添加剪样</View>
|
||||
|
||||
@ -3,18 +3,30 @@ import { useCallback } from 'react'
|
||||
import styles from './index.module.scss'
|
||||
import Counter from '@/components/counter'
|
||||
import LabAndImg from '@/components/LabAndImg'
|
||||
import { formatHashTag } from '@/common/fotmat'
|
||||
|
||||
export interface orderParam {
|
||||
affiliation_product: any
|
||||
count: number
|
||||
export interface ProductParam {
|
||||
code: string
|
||||
lab: { l: number; a: number; b: number }
|
||||
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 }
|
||||
texture_url: string
|
||||
}
|
||||
|
||||
interface Param {
|
||||
value: orderParam[]
|
||||
value: ProductParam[]
|
||||
}
|
||||
|
||||
export default (props: Param) => {
|
||||
@ -25,21 +37,25 @@ export default (props: Param) => {
|
||||
},
|
||||
[value],
|
||||
)
|
||||
return <View className={styles.card_con}>
|
||||
<View className={styles.card_header}>色卡信息</View>
|
||||
<View className={styles.card_list}>
|
||||
<>
|
||||
{value?.map((item, index) => {
|
||||
return <View key={index} className={styles.card_item}>
|
||||
<View className={styles.img}><LabAndImg value={labAndImgObj(item)} /></View>
|
||||
<View className={styles.name_count}>
|
||||
<Text>{item.name}</Text>
|
||||
<Text>x{item.count}本</Text>
|
||||
</View>
|
||||
</View>
|
||||
})}
|
||||
<View className={styles.express_btn}>快递到付</View>
|
||||
</>
|
||||
</View>
|
||||
</View>
|
||||
return <>
|
||||
{value?.map((pitem) => {
|
||||
return <View key={pitem.product_id} className={styles.card_con}>
|
||||
<View className={styles.card_header}>{formatHashTag(pitem.code, pitem.name)}</View>
|
||||
<View className={styles.card_list}>
|
||||
<>
|
||||
{pitem.product_colors?.map((citem, index) => {
|
||||
return <View key={index} className={styles.card_item}>
|
||||
<View className={styles.img}><LabAndImg value={labAndImgObj(citem)} /></View>
|
||||
<View className={styles.name_count}>
|
||||
<Text>{formatHashTag(citem.code, citem.name)}</Text>
|
||||
<Text>x{citem.color_num}份</Text>
|
||||
</View>
|
||||
</View>
|
||||
})}
|
||||
<View className={styles.express_btn}>快递到付</View>
|
||||
</>
|
||||
</View>
|
||||
</View>
|
||||
})}
|
||||
</>
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
export default {
|
||||
navigationBarTitleText: '色卡订单详情',
|
||||
navigationBarTitleText: '剪样订单详情',
|
||||
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 { useMemo, useState } from 'react'
|
||||
import styles from './index.module.scss'
|
||||
import Address from './components/address'
|
||||
import type { orderParam } from './components/productCard'
|
||||
import type { ProductParam } from './components/productCard'
|
||||
import ProductCard from './components/productCard'
|
||||
import Remark from './components/remark'
|
||||
import OrderInfo from './components/orderInfo'
|
||||
import type { orderStateItem } from './components/orderState'
|
||||
import OrderState from './components/orderState'
|
||||
import { alert, goLink } from '@/common/common'
|
||||
import SearchInput from '@/components/searchInput'
|
||||
import { alert } from '@/common/common'
|
||||
import { ColorCardOrderCancelApi, GetColorCardOrderDetailApi } from '@/api/colorCard'
|
||||
import { CutSampleOrderCancelApi, GetCutSampleOrderDetailApi } from '@/api/cutSample'
|
||||
|
||||
interface Param {
|
||||
address: string
|
||||
color_card_info: orderParam[]
|
||||
address_detail: string
|
||||
city_id: number
|
||||
city_name: string
|
||||
create_time: string
|
||||
create_user_name: string
|
||||
creator_id: number
|
||||
id: number
|
||||
cut_sample_order_product_list: ProductParam[]
|
||||
district_id: number
|
||||
district_name: string
|
||||
order_form: orderStateItem[]
|
||||
order_id: number
|
||||
order_no: string
|
||||
order_progress: orderStateItem[]
|
||||
order_status: number
|
||||
order_status_name: string
|
||||
order_remark: string
|
||||
phone: string
|
||||
province_id: number
|
||||
province_name: string
|
||||
purchaser_id: number
|
||||
purchaser_name: string
|
||||
purchaser_phone: string
|
||||
remark: string
|
||||
sale_user_id: number
|
||||
sale_user_name: string
|
||||
shipment_mode: number
|
||||
shipment_mode_name: string
|
||||
target_user_name: string
|
||||
target_user_phone: string
|
||||
update_time: string
|
||||
update_user_name: string
|
||||
updater_id: number
|
||||
}
|
||||
|
||||
export default () => {
|
||||
const router = useRouter()
|
||||
|
||||
const [orderData, setOrderData] = useState<Param>()
|
||||
const { fetchData: fetchDataDtail } = GetColorCardOrderDetailApi()
|
||||
const { fetchData: fetchDataDtail } = GetCutSampleOrderDetailApi()
|
||||
const getColorCardOrderDetail = async() => {
|
||||
const res = await fetchDataDtail({ id: router.params.id })
|
||||
setOrderData(() => res.data)
|
||||
@ -55,21 +54,21 @@ export default () => {
|
||||
|
||||
const addressData = useMemo(() => {
|
||||
return {
|
||||
address_title: orderData?.address || '',
|
||||
address_title: `${orderData?.province_name}${orderData?.city_name}${orderData?.district_name}`,
|
||||
address_name: orderData?.purchaser_name || '',
|
||||
address_phone: orderData?.purchaser_phone || '',
|
||||
address_phone: orderData?.target_user_phone || '',
|
||||
address_mode: orderData?.shipment_mode_name || '',
|
||||
}
|
||||
}, [orderData])
|
||||
|
||||
// 取消订单
|
||||
const { fetchData: fetchDataCancel } = ColorCardOrderCancelApi()
|
||||
const { fetchData: fetchDataCancel } = CutSampleOrderCancelApi()
|
||||
const onCancel = async() => {
|
||||
Taro.showModal({
|
||||
title: '确定取消订单?',
|
||||
async success(res) {
|
||||
if (res.confirm) {
|
||||
const res = await fetchDataCancel({ id: orderData?.id })
|
||||
const res = await fetchDataCancel({ id: orderData?.order_id })
|
||||
if (res.success) {
|
||||
alert.success('取消成功')
|
||||
getColorCardOrderDetail()
|
||||
@ -82,12 +81,12 @@ export default () => {
|
||||
})
|
||||
}
|
||||
return <View className={styles.main}>
|
||||
<OrderState list={orderData?.order_progress} />
|
||||
<OrderState list={orderData?.order_form} />
|
||||
<Address defaultValue={addressData} />
|
||||
<ProductCard value={orderData?.color_card_info || []} />
|
||||
<ProductCard value={orderData?.cut_sample_order_product_list || []} />
|
||||
<OrderInfo {...orderData} />
|
||||
<Remark value={orderData?.remark || ''} placeholder="尚未备注信息" />
|
||||
{orderData?.order_status === 1 && <View className={styles.order_btn}>
|
||||
<Remark value={orderData?.order_remark || ''} placeholder="尚未备注信息" />
|
||||
{orderData?.order_form?.length === 1 && <View className={styles.order_btn}>
|
||||
<View className={styles.btn_con}>
|
||||
<View className={styles.btn} onClick={onCancel}>取消订单</View>
|
||||
</View>
|
||||
|
||||
@ -252,6 +252,18 @@ const Details = (props: Params) => {
|
||||
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 (
|
||||
<MoveBtn showList={['customer']}>
|
||||
<View className={styles.main}>
|
||||
@ -423,7 +435,7 @@ const Details = (props: Params) => {
|
||||
</View>
|
||||
</View>
|
||||
</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>
|
||||
</MoveBtn>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 43 KiB |
Loading…
x
Reference in New Issue
Block a user