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