🐞 fix(修复色卡样式问题):
This commit is contained in:
parent
b4ae27b194
commit
783bcae1c4
@ -5,14 +5,14 @@
|
|||||||
// 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` // 发
|
||||||
// export const BASE_URL = 'https://dev.zzfzyc.com/lymarket' // 开发环境
|
// export const BASE_URL = 'https://dev.zzfzyc.com/lymarket' // 开发环境
|
||||||
// export const BASE_URL = 'https://www.zzfzyc.com/lymarket' // 正式环境
|
// export const BASE_URL = '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' // 杰
|
||||||
|
|
||||||
@ -39,8 +39,9 @@ export const getCDNSource = (suffix: string) => {
|
|||||||
export const CDN_UPLOAD_IMG = `${UPLOAD_CDN_URL || ''}`
|
export const CDN_UPLOAD_IMG = `${UPLOAD_CDN_URL || ''}`
|
||||||
|
|
||||||
// appid
|
// appid
|
||||||
// export const WX_APPID = 'wx68d92d7cbf0b6963'
|
export const WX_APPID = 'wx68d92d7cbf0b6963'
|
||||||
export const WX_APPID = 'wx714eaf2dfdb9c6bb'
|
// export const WX_APPID = 'wx714eaf2dfdb9c6bb'
|
||||||
|
export const Platform = 6
|
||||||
|
|
||||||
// 招商银行小程序appid
|
// 招商银行小程序appid
|
||||||
export const BANk_WX_APPID = 'wx65934ee32a88d726'
|
export const BANk_WX_APPID = 'wx65934ee32a88d726'
|
||||||
|
|||||||
@ -42,6 +42,12 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding-left: 24px;
|
padding-left: 24px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
text {
|
||||||
|
&:nth-child(1) {
|
||||||
|
flex: 1;
|
||||||
|
@include common_ellipsis;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.item_con_color_list {
|
.item_con_color_list {
|
||||||
padding-left: 24px;
|
padding-left: 24px;
|
||||||
@ -50,6 +56,12 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
color: rgba(0, 0, 0, 0.6);
|
color: rgba(0, 0, 0, 0.6);
|
||||||
|
text {
|
||||||
|
&:nth-child(1) {
|
||||||
|
flex: 1;
|
||||||
|
@include common_ellipsis;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.item_con_count {
|
.item_con_count {
|
||||||
|
|||||||
@ -54,8 +54,8 @@ export default (props: Param) => {
|
|||||||
|
|
||||||
const labAndImgObj = useMemo(
|
const labAndImgObj = useMemo(
|
||||||
() => {
|
() => {
|
||||||
const res = value.cut_sample_order_product_list[0]
|
const res = value.cut_sample_order_product_list?.[0]
|
||||||
return { lab: res.lab, rgb: res.rgb, texture_url: res.texture_url }
|
return { lab: res?.lab, rgb: res?.rgb, texture_url: res?.texture_url }
|
||||||
},
|
},
|
||||||
[value],
|
[value],
|
||||||
)
|
)
|
||||||
|
|||||||
@ -37,11 +37,17 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
.item_con_name {
|
.item_con_name {
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding-left: 24px;
|
padding-left: 24px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
text {
|
||||||
|
&:nth-child(1) {
|
||||||
|
flex: 1;
|
||||||
|
@include common_ellipsis(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.item_con_count {
|
.item_con_count {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
|||||||
@ -27,13 +27,18 @@
|
|||||||
.card_info_name {
|
.card_info_name {
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
color: rgba(0, 0, 0, 0.8);
|
color: rgba(0, 0, 0, 0.8);
|
||||||
|
@include common_ellipsis(2);
|
||||||
}
|
}
|
||||||
.card_info_label {
|
.card_info_label {
|
||||||
display: grid;
|
display: flex;
|
||||||
grid-template-columns: repeat(3, 100px);
|
flex-wrap: wrap;
|
||||||
grid-gap: 10px 10px;
|
grid-gap: 10px 10px;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
|
||||||
|
box-sizing: border-box;
|
||||||
text {
|
text {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 2px 6px;
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
color: #4581ff;
|
color: #4581ff;
|
||||||
height: 34px;
|
height: 34px;
|
||||||
|
|||||||
@ -25,10 +25,12 @@ export default memo((props: ParamType) => {
|
|||||||
const { affiliation_product, color_card_name = '', texture_url = '', lab, rgb } = props
|
const { affiliation_product, color_card_name = '', texture_url = '', lab, rgb } = props
|
||||||
const [checkStatus, setCheckStatus] = useState(false)
|
const [checkStatus, setCheckStatus] = useState(false)
|
||||||
const changeSelect = () => {
|
const changeSelect = () => {
|
||||||
|
if (props.is_add) { return false }
|
||||||
setCheckStatus(!checkStatus)
|
setCheckStatus(!checkStatus)
|
||||||
props.onSelect?.(props, !checkStatus)
|
props.onSelect?.(props, !checkStatus)
|
||||||
}
|
}
|
||||||
const onSelect = () => {
|
const onSelect = () => {
|
||||||
|
if (props.is_add) { return false }
|
||||||
props.onSelect?.(props, true)
|
props.onSelect?.(props, true)
|
||||||
setCheckStatus(true)
|
setCheckStatus(true)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,11 +39,14 @@
|
|||||||
text {
|
text {
|
||||||
width: 702px;
|
width: 702px;
|
||||||
height: 80px;
|
height: 80px;
|
||||||
background: #4581ff;
|
background: #8aaefa;
|
||||||
border-radius: 40px;
|
border-radius: 40px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 80px;
|
line-height: 80px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
.selected {
|
||||||
|
background: #4581ff !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,7 +34,6 @@ export default () => {
|
|||||||
|
|
||||||
// 获取数据
|
// 获取数据
|
||||||
const getGetColorCard = async() => {
|
const getGetColorCard = async() => {
|
||||||
console.log('getShopId():::', getShopId())
|
|
||||||
const { data } = await fetchData(getFilterData({ ...searchData, color_card_ids: getShopId() }))
|
const { data } = await fetchData(getFilterData({ ...searchData, color_card_ids: getShopId() }))
|
||||||
setColorCardData(() => ({ list: data.list, total: data.total }))
|
setColorCardData(() => ({ list: data.list, total: data.total }))
|
||||||
setRefresherTriggeredStatus(() => false)
|
setRefresherTriggeredStatus(() => false)
|
||||||
@ -43,6 +42,7 @@ export default () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (Taro.getStorageSync('colorCard') && shopColorCardData.current.length <= 0) {
|
if (Taro.getStorageSync('colorCard') && shopColorCardData.current.length <= 0) {
|
||||||
shopColorCardData.current = Taro.getStorageSync('colorCard') ? JSON.parse(Taro.getStorageSync('colorCard')) : []
|
shopColorCardData.current = Taro.getStorageSync('colorCard') ? JSON.parse(Taro.getStorageSync('colorCard')) : []
|
||||||
|
setSelectList(e => ([...e, ...shopColorCardData.current]))
|
||||||
// Taro.removeStorageSync('colorCard')
|
// Taro.removeStorageSync('colorCard')
|
||||||
}
|
}
|
||||||
getGetColorCard()
|
getGetColorCard()
|
||||||
@ -76,7 +76,8 @@ export default () => {
|
|||||||
// 列表下拉刷新
|
// 列表下拉刷新
|
||||||
const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false)
|
const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false)
|
||||||
const getRefresherRefresh = async() => {
|
const getRefresherRefresh = async() => {
|
||||||
pageNum.current.size = 1
|
pageNum.current.page = 1
|
||||||
|
pageNum.current.size = 10
|
||||||
setRefresherTriggeredStatus(true)
|
setRefresherTriggeredStatus(true)
|
||||||
setSearchData(val => ({ ...val, size: 10 }))
|
setSearchData(val => ({ ...val, size: 10 }))
|
||||||
}
|
}
|
||||||
@ -86,10 +87,18 @@ export default () => {
|
|||||||
selectList?.map((item) => {
|
selectList?.map((item) => {
|
||||||
item.count = 1
|
item.count = 1
|
||||||
})
|
})
|
||||||
Taro.setStorageSync('colorCard', JSON.stringify([...selectList, ...shopColorCardData.current]))
|
Taro.setStorageSync('colorCard', JSON.stringify([...selectList]))
|
||||||
Taro.redirectTo({
|
const pages = getCurrentPages()
|
||||||
url: '/pages/colorCardOrder/index',
|
const current = pages[pages.length - 2]
|
||||||
})
|
console.log('current:::', current)
|
||||||
|
if (current?.route === 'pages/colorCardOrder/index') {
|
||||||
|
Taro.navigateBack()
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Taro.redirectTo({
|
||||||
|
url: '/pages/colorCardOrder/index',
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const onSelectData = (val, status) => {
|
const onSelectData = (val, status) => {
|
||||||
@ -127,7 +136,7 @@ export default () => {
|
|||||||
</InfiniteScroll>
|
</InfiniteScroll>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.get_card_btn} onClick={onSubmit}>
|
<View className={styles.get_card_btn} onClick={onSubmit}>
|
||||||
<Text>确认</Text>
|
<Text className={classNames(selectList.length > 0 ? styles.selected : '')}>确认</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
.card_item {
|
.card_item {
|
||||||
height: 140px;
|
min-height: 140px;
|
||||||
display: flex;
|
display: flex;
|
||||||
padding-top: 24px;
|
padding-top: 24px;
|
||||||
color: rgba(0, 0, 0, 0.8);
|
color: rgba(0, 0, 0, 0.8);
|
||||||
@ -15,15 +15,23 @@
|
|||||||
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;
|
display: flex;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
.name_con {
|
||||||
|
flex: 1;
|
||||||
|
text {
|
||||||
|
@include common_ellipsis;
|
||||||
|
}
|
||||||
|
}
|
||||||
.card_info_label {
|
.card_info_label {
|
||||||
display: grid;
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
grid-template-columns: repeat(3, 100px);
|
grid-template-columns: repeat(3, 100px);
|
||||||
grid-gap: 10px 10px;
|
grid-gap: 10px 10px;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
text {
|
text {
|
||||||
|
padding: 2px 6px;
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
color: #4581ff;
|
color: #4581ff;
|
||||||
height: 34px;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 34px;
|
line-height: 34px;
|
||||||
background-color: rgba(69, 129, 255, 0.15);
|
background-color: rgba(69, 129, 255, 0.15);
|
||||||
@ -31,7 +39,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.btns {
|
.btns {
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,9 +53,7 @@ export default () => {
|
|||||||
const onAddCard = () => {
|
const onAddCard = () => {
|
||||||
Taro.setStorageSync('colorCard', JSON.stringify(list))
|
Taro.setStorageSync('colorCard', JSON.stringify(list))
|
||||||
Taro.setStorageSync('colorCardOther', JSON.stringify({ address: addressInfo || {}, remark: submitData.current.remark }))
|
Taro.setStorageSync('colorCardOther', JSON.stringify({ address: addressInfo || {}, remark: submitData.current.remark }))
|
||||||
Taro.navigateTo({
|
goLink('/pages/colorCardList/index', {})
|
||||||
url: '/pages/colorCardList/index',
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onDelData = useCallback((id) => {
|
const onDelData = useCallback((id) => {
|
||||||
@ -91,20 +89,27 @@ export default () => {
|
|||||||
|
|
||||||
const { fetchData: submitFetchData } = SubmitColorCardApi()
|
const { fetchData: submitFetchData } = SubmitColorCardApi()
|
||||||
const onSubmitData = async() => {
|
const onSubmitData = async() => {
|
||||||
submitData.current.color_card_infos = []
|
Taro.showModal({
|
||||||
list?.map((item) => {
|
title: '确定提交订单?',
|
||||||
submitData.current.color_card_infos.push({
|
async success(val) {
|
||||||
count: item.count || 0,
|
if (val.confirm) {
|
||||||
id: item.id,
|
submitData.current.color_card_infos = []
|
||||||
})
|
list?.map((item) => {
|
||||||
|
submitData.current.color_card_infos.push({
|
||||||
|
count: item.count || 0,
|
||||||
|
id: item.id,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
if (!submitData.current.address_id) { return alert.none('请选择收货地址') }
|
||||||
|
await openSubscriptionMessage({ scenes: ColorCard.value })
|
||||||
|
const res = await submitFetchData(getFilterData(submitData.current))
|
||||||
|
if (res.success) {
|
||||||
|
alert.success('提交成功')
|
||||||
|
goLink('/pages/colorCardOrderDetail/index', { id: res.data.id }, 'redirectTo')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
})
|
})
|
||||||
if (!submitData.current.address_id) { return alert.none('请选择收货地址') }
|
|
||||||
await openSubscriptionMessage({ scenes: ColorCard.value })
|
|
||||||
const res = await submitFetchData(getFilterData(submitData.current))
|
|
||||||
if (res.success) {
|
|
||||||
alert.success('提交成功')
|
|
||||||
goLink('/pages/colorCardOrderDetail/index', { id: res.data.id })
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const [remarkData, setRemarkData] = useState('')
|
const [remarkData, setRemarkData] = useState('')
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
.card_list {
|
.card_list {
|
||||||
.card_item {
|
.card_item {
|
||||||
height: 140px;
|
min-height: 140px;
|
||||||
display: flex;
|
display: flex;
|
||||||
padding-top: 24px;
|
padding-top: 24px;
|
||||||
color: rgba(0, 0, 0, 0.8);
|
color: rgba(0, 0, 0, 0.8);
|
||||||
@ -29,13 +29,35 @@
|
|||||||
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;
|
|
||||||
justify-content: space-between;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
.name_con {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.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;
|
||||||
|
}
|
||||||
|
}
|
||||||
text {
|
text {
|
||||||
&:nth-child(1) {
|
&:nth-child(1) {
|
||||||
|
padding-right: 10px;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@include common_ellipsis();
|
@include common_ellipsis(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.btns {
|
.btns {
|
||||||
|
|||||||
@ -33,8 +33,14 @@ export default (props: Param) => {
|
|||||||
return <View key={index} className={styles.card_item}>
|
return <View key={index} className={styles.card_item}>
|
||||||
<View className={styles.img}><LabAndImg value={labAndImgObj(item)} /></View>
|
<View className={styles.img}><LabAndImg value={labAndImgObj(item)} /></View>
|
||||||
<View className={styles.name_count}>
|
<View className={styles.name_count}>
|
||||||
<Text>{item.name}</Text>
|
<View className={styles.name_con}>
|
||||||
<Text>x{item.count}本</Text>
|
<Text>{item.name}</Text>
|
||||||
|
<Text>x{item.count}本</Text>
|
||||||
|
</View>
|
||||||
|
<View className={styles.card_info_label}>
|
||||||
|
{item.affiliation_product?.map(item => <Text key={item.id}>{item.code}</Text>)}
|
||||||
|
</View>
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
})}
|
})}
|
||||||
|
|||||||
@ -26,6 +26,7 @@
|
|||||||
.card_info_name {
|
.card_info_name {
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
color: rgba(0, 0, 0, 0.8);
|
color: rgba(0, 0, 0, 0.8);
|
||||||
|
@include common_ellipsis(2);
|
||||||
}
|
}
|
||||||
.card_info_label {
|
.card_info_label {
|
||||||
display: grid;
|
display: grid;
|
||||||
|
|||||||
@ -67,9 +67,9 @@ export default memo((props: ParamType) => {
|
|||||||
<View className={styles.card_info}>
|
<View className={styles.card_info}>
|
||||||
<View className={styles.card_info_name}>{formatHashTag(productItem?.code, productItem?.name)}</View>
|
<View className={styles.card_info_name}>{formatHashTag(productItem?.code, productItem?.name)}</View>
|
||||||
<View className={styles.card_info_label}>
|
<View className={styles.card_info_label}>
|
||||||
{new Array(2).fill('').map(item => <Text key={item.id}>170CM</Text>)}
|
{/* {new Array(2).fill('').map(item => <Text key={item.id}></Text>)} */}
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.desc}>{productItem?.craft}</View>
|
<View className={styles.desc}>{productItem?.component}</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.checkBox} onClick={e => e.stopPropagation()}>
|
<View className={styles.checkBox} onClick={e => e.stopPropagation()}>
|
||||||
<View className={styles.add_btn} onClick={() => onSelect()}>{selected ? '继续添加' : '添加'}</View>
|
<View className={styles.add_btn} onClick={() => onSelect()}>{selected ? '继续添加' : '添加'}</View>
|
||||||
|
|||||||
@ -39,11 +39,14 @@
|
|||||||
text {
|
text {
|
||||||
width: 702px;
|
width: 702px;
|
||||||
height: 80px;
|
height: 80px;
|
||||||
background: #4581ff;
|
background: #8aaefa;
|
||||||
border-radius: 40px;
|
border-radius: 40px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 80px;
|
line-height: 80px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
.selected {
|
||||||
|
background: #4581ff !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,7 +77,8 @@ export default () => {
|
|||||||
// 列表下拉刷新
|
// 列表下拉刷新
|
||||||
const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false)
|
const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false)
|
||||||
const getRefresherRefresh = async() => {
|
const getRefresherRefresh = async() => {
|
||||||
pageNum.current.size = 1
|
pageNum.current.size = 10
|
||||||
|
pageNum.current.page = 1
|
||||||
setRefresherTriggeredStatus(true)
|
setRefresherTriggeredStatus(true)
|
||||||
setSearchData(val => ({ ...val, size: 10 }))
|
setSearchData(val => ({ ...val, size: 10 }))
|
||||||
}
|
}
|
||||||
@ -85,9 +86,16 @@ export default () => {
|
|||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
if (selectProcutColors.length <= 0) { return alert.none('请选择剪样') }
|
if (selectProcutColors.length <= 0) { return alert.none('请选择剪样') }
|
||||||
Taro.setStorageSync('cutSample', JSON.stringify([...selectProcutColors]))
|
Taro.setStorageSync('cutSample', JSON.stringify([...selectProcutColors]))
|
||||||
Taro.redirectTo({
|
const pages = getCurrentPages()
|
||||||
url: '/pages/cutSampleListOrder/index',
|
const current = pages[pages.length - 2]
|
||||||
})
|
if (current?.route === 'pages/cutSampleListOrder/index') {
|
||||||
|
Taro.navigateBack()
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Taro.redirectTo({
|
||||||
|
url: '/pages/cutSampleListOrder/index',
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const [showColorList, setShowColorList] = useState(false)
|
const [showColorList, setShowColorList] = useState(false)
|
||||||
@ -158,7 +166,7 @@ export default () => {
|
|||||||
</InfiniteScroll>
|
</InfiniteScroll>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.get_card_btn} onClick={onSubmit}>
|
<View className={styles.get_card_btn} onClick={onSubmit}>
|
||||||
<Text>确认</Text>
|
<Text className={classNames(selectProsuctIds.length > 0 ? styles.selected : '')}>确认</Text>
|
||||||
</View>
|
</View>
|
||||||
<PopupSelectColor defaultValueIds={selectColorIds} onSelected={onSelected} show={showColorList} product_id={selectItem?.id || 0} onClose={onClose} />
|
<PopupSelectColor defaultValueIds={selectColorIds} onSelected={onSelected} show={showColorList} product_id={selectItem?.id || 0} onClose={onClose} />
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@ -14,6 +14,9 @@
|
|||||||
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);
|
||||||
|
text {
|
||||||
|
@include common_ellipsis;
|
||||||
|
}
|
||||||
.btns {
|
.btns {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -149,22 +149,29 @@ export default () => {
|
|||||||
|
|
||||||
const { fetchData: submitFetchData } = submitCutSampleOrderApi()
|
const { fetchData: submitFetchData } = submitCutSampleOrderApi()
|
||||||
const onSubmitData = async() => {
|
const onSubmitData = async() => {
|
||||||
submitData.current.cut_sample_order_product_color_list = []
|
Taro.showModal({
|
||||||
list?.map((item) => {
|
title: '确定提交订单?',
|
||||||
item.colors?.map((citem) => {
|
async success(val) {
|
||||||
submitData.current.cut_sample_order_product_color_list.push({
|
if (val.confirm) {
|
||||||
color_num: citem.count || 0,
|
submitData.current.cut_sample_order_product_color_list = []
|
||||||
product_color_id: citem.id,
|
list?.map((item) => {
|
||||||
})
|
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('请选择收货地址') }
|
||||||
|
await openSubscriptionMessage({ scenes: ColorCard.value })
|
||||||
|
const res = await submitFetchData(getFilterData(submitData.current))
|
||||||
|
if (res.success) {
|
||||||
|
alert.success('提交成功')
|
||||||
|
goLink('/pages/cutSampleListOrderDetail/index', { id: res.data.id }, 'redirectTo')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
})
|
})
|
||||||
if (!submitData.current.address_id) { return alert.none('请选择收货地址') }
|
|
||||||
await openSubscriptionMessage({ scenes: ColorCard.value })
|
|
||||||
const res = await submitFetchData(getFilterData(submitData.current))
|
|
||||||
if (res.success) {
|
|
||||||
alert.success('提交成功')
|
|
||||||
goLink('/pages/cutSampleListOrderDetail/index', { id: res.data.id }, 'redirectTo')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const [remarkData, setRemarkData] = useState('')
|
const [remarkData, setRemarkData] = useState('')
|
||||||
|
|||||||
@ -29,9 +29,15 @@
|
|||||||
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;
|
|
||||||
justify-content: space-between;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
.name_con {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
text {
|
||||||
|
padding-right: 10px;
|
||||||
|
@include common_ellipsis;
|
||||||
|
}
|
||||||
|
}
|
||||||
text {
|
text {
|
||||||
&:nth-child(1) {
|
&:nth-child(1) {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|||||||
@ -47,8 +47,10 @@ export default (props: Param) => {
|
|||||||
return <View key={index} className={styles.card_item}>
|
return <View key={index} className={styles.card_item}>
|
||||||
<View className={styles.img}><LabAndImg value={labAndImgObj(citem)} /></View>
|
<View className={styles.img}><LabAndImg value={labAndImgObj(citem)} /></View>
|
||||||
<View className={styles.name_count}>
|
<View className={styles.name_count}>
|
||||||
<Text>{formatHashTag(citem.code, citem.name)}</Text>
|
<View className={styles.name_con}>
|
||||||
<Text>x{citem.color_num}份</Text>
|
<Text>{formatHashTag(citem.code, citem.name)}</Text>
|
||||||
|
<Text>x{citem.color_num}份</Text>
|
||||||
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
})}
|
})}
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import qs from 'qs'
|
|||||||
import useUserInfo from './useUserInfo'
|
import useUserInfo from './useUserInfo'
|
||||||
import useLogin from './useLogin'
|
import useLogin from './useLogin'
|
||||||
import useLoginRequest from './useLoginRequest'
|
import useLoginRequest from './useLoginRequest'
|
||||||
import { BASE_URL, WX_APPID } from '@/common/constant'
|
import { BASE_URL, Platform, WX_APPID } from '@/common/constant'
|
||||||
import { getFilterData } from '@/common/util'
|
import { getFilterData } from '@/common/util'
|
||||||
|
|
||||||
interface Params {
|
interface Params {
|
||||||
@ -148,7 +148,7 @@ export const useRequest = (
|
|||||||
...{
|
...{
|
||||||
header: {
|
header: {
|
||||||
// Platform: 6,
|
// Platform: 6,
|
||||||
Platform: 9,
|
Platform,
|
||||||
Appid: WX_APPID,
|
Appid: WX_APPID,
|
||||||
Authorization: token || stateRef.current.token,
|
Authorization: token || stateRef.current.token,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { useRef, useState } from 'react'
|
|||||||
import qs from 'qs'
|
import qs from 'qs'
|
||||||
import useUserInfo from './useUserInfo'
|
import useUserInfo from './useUserInfo'
|
||||||
import useLogin from './useLogin'
|
import useLogin from './useLogin'
|
||||||
import { BASE_URL, WX_APPID } from '@/common/constant'
|
import { BASE_URL, Platform, WX_APPID } from '@/common/constant'
|
||||||
|
|
||||||
// 开这个hook 主要是为了让useHttp 能够调用
|
// 开这个hook 主要是为了让useHttp 能够调用
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ export default () => {
|
|||||||
url: `${BASE_URL}/v1/mall/login`,
|
url: `${BASE_URL}/v1/mall/login`,
|
||||||
header: {
|
header: {
|
||||||
// Platform: 6,
|
// Platform: 6,
|
||||||
Platform: 9,
|
Platform,
|
||||||
Appid: WX_APPID,
|
Appid: WX_APPID,
|
||||||
},
|
},
|
||||||
method: 'post',
|
method: 'post',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user