✨ feat(码单抬头列表开发完成):
This commit is contained in:
parent
a53c9dda64
commit
43b5bb7ee0
@ -185,11 +185,17 @@ export default {
|
||||
],
|
||||
},
|
||||
{
|
||||
root: 'pages/codeList',
|
||||
root: 'pages/codeSetting',
|
||||
pages: [
|
||||
'index',
|
||||
'codeColorList/index',
|
||||
],
|
||||
},
|
||||
{
|
||||
root: 'pages/codeList',
|
||||
pages: [
|
||||
'index',
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
@ -5,12 +5,12 @@
|
||||
// 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 = '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:50002/lymarket' // 婷
|
||||
|
||||
@ -94,7 +94,7 @@ const Search = (
|
||||
></Input>
|
||||
{!!inputCon && (
|
||||
<View className={styles.search_closeBtn}>
|
||||
<CloseBtn onClose={() => clearInput()} styleObj={{ width: '20rpx', height: '20rpx', backgroundColor: '#fff', border: '0' }} />
|
||||
<CloseBtn onClose={() => clearInput()} styleObj={{ width: '20rpx', height: '20rpx', border: '0' }} />
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
|
||||
30
src/components/selectList/index.tsx
Normal file
30
src/components/selectList/index.tsx
Normal file
@ -0,0 +1,30 @@
|
||||
import { Text, View } from '@tarojs/components'
|
||||
import classNames from 'classnames'
|
||||
import { memo, useCallback, useEffect, useState } from 'react'
|
||||
import styles from './index.module.scss'
|
||||
|
||||
interface ItemIndex {
|
||||
value: number
|
||||
label: string
|
||||
}
|
||||
interface Param {
|
||||
defaultIndex?: number
|
||||
onSelect?: (val: number) => void
|
||||
list: ItemIndex[]
|
||||
}
|
||||
export default memo((props: Param) => {
|
||||
const { defaultIndex = 1, onSelect, list = [] } = props
|
||||
const [selectIndex, setSelectIndex] = useState(0)
|
||||
useEffect(() => {
|
||||
if (defaultIndex != selectIndex) { setSelectIndex(() => defaultIndex) }
|
||||
}, [defaultIndex])
|
||||
const getSelect = useCallback((index) => {
|
||||
setSelectIndex(() => index)
|
||||
onSelect?.(index)
|
||||
}, [])
|
||||
return <View className={styles.select_list} >
|
||||
{list?.map((item) => {
|
||||
return <View key={item.value} onClick={() => getSelect(item.value)} className={classNames(styles.select_list_item, selectIndex === item.value && styles.select_list_ed)}><Text>{item.label}</Text></View>
|
||||
})}
|
||||
</View>
|
||||
})
|
||||
30
src/pages/codeList/components/codeModel/index.module.scss
Normal file
30
src/pages/codeList/components/codeModel/index.module.scss
Normal file
@ -0,0 +1,30 @@
|
||||
.code_list_search {
|
||||
width: 750px;
|
||||
height: 104px;
|
||||
background: #ffffff;
|
||||
display: flex;
|
||||
padding: 0 24px;
|
||||
box-sizing: border-box;
|
||||
align-items: center;
|
||||
margin-top: 1px;
|
||||
.code_list_search--code {
|
||||
width: 558px;
|
||||
height: 72px;
|
||||
background: #f7f7f7;
|
||||
border-radius: 36px;
|
||||
margin-right: 32px;
|
||||
}
|
||||
.code_list_search--data {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text {
|
||||
font-size: 28px;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.code_list_con {
|
||||
padding: 24px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
22
src/pages/codeList/components/codeModel/index.tsx
Normal file
22
src/pages/codeList/components/codeModel/index.tsx
Normal file
@ -0,0 +1,22 @@
|
||||
import { Text, View } from '@tarojs/components'
|
||||
import { useState } from 'react'
|
||||
import ColorItem from '../colorItem'
|
||||
import styles from './index.module.scss'
|
||||
import IconFont from '@/components/iconfont/iconfont'
|
||||
import SelectList from '@/components/selectList'
|
||||
import Search from '@/components/search'
|
||||
|
||||
export default () => {
|
||||
return <View>
|
||||
<View className={styles.code_list_search}>
|
||||
<View className={styles['code_list_search--code']}><Search placeholder="请输入单据抬头/客户/单号" /></View>
|
||||
<View className={styles['code_list_search--data']}>
|
||||
<IconFont name="icon-riqi" size={43} />
|
||||
<Text>日期</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.code_list_con}>
|
||||
<ColorItem />
|
||||
</View>
|
||||
</View>
|
||||
}
|
||||
84
src/pages/codeList/components/colorItem/index.module.scss
Normal file
84
src/pages/codeList/components/colorItem/index.module.scss
Normal file
@ -0,0 +1,84 @@
|
||||
.code_list_item {
|
||||
background-color: #fff;
|
||||
border-radius: 16px;
|
||||
padding: 0 32px;
|
||||
.code_list_con__title {
|
||||
display: flex;
|
||||
font-size: 28px;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
align-items: center;
|
||||
height: 74px;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
||||
.code_list_con__title_mode {
|
||||
width: 60px;
|
||||
height: 28px;
|
||||
background: #337fff;
|
||||
border-radius: 8px;
|
||||
font-size: 20px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 28px;
|
||||
margin-left: 26px;
|
||||
}
|
||||
}
|
||||
.code_list_desc {
|
||||
margin-top: 24px;
|
||||
display: flex;
|
||||
.image {
|
||||
width: 134px;
|
||||
height: 134px;
|
||||
}
|
||||
.company {
|
||||
margin-left: 24px;
|
||||
font-size: 28px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
flex: 1;
|
||||
.company_item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
text {
|
||||
&:nth-child(1) {
|
||||
font-size: 28px;
|
||||
color: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.code_list_number {
|
||||
width: 638px;
|
||||
height: 54px;
|
||||
background: #fef9f4;
|
||||
border-radius: 8px;
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
color: #f79b31;
|
||||
text-align: center;
|
||||
line-height: 54px;
|
||||
margin-top: 24px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
}
|
||||
.code_list_bottom {
|
||||
display: flex;
|
||||
padding: 24px 0;
|
||||
justify-content: flex-end;
|
||||
.code_list_bottom_item {
|
||||
width: 160px;
|
||||
height: 72px;
|
||||
border-radius: 40px;
|
||||
border: 1px solid #000000;
|
||||
font-size: 28px;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
text-align: center;
|
||||
line-height: 72px;
|
||||
&:nth-child(2) {
|
||||
border: 1px solid #337fff;
|
||||
color: #337fff;
|
||||
margin-left: 32px;
|
||||
}
|
||||
}
|
||||
}
|
||||
36
src/pages/codeList/components/colorItem/index.tsx
Normal file
36
src/pages/codeList/components/colorItem/index.tsx
Normal file
@ -0,0 +1,36 @@
|
||||
import { Text, View } from '@tarojs/components'
|
||||
import styles from './index.module.scss'
|
||||
import LabAndImg from '@/components/LabAndImg'
|
||||
|
||||
export default () => {
|
||||
return <View className={styles.code_list_item}>
|
||||
<View className={styles.code_list_con__title}>
|
||||
<Text>订单号:XS-LY-2208220092</Text>
|
||||
<View className={styles.code_list_con__title_mode}>大货</View>
|
||||
</View>
|
||||
<View className={styles.code_list_desc}>
|
||||
<View className={styles.image}>
|
||||
<LabAndImg value={{}} />
|
||||
</View>
|
||||
<View className={styles.company}>
|
||||
<View className={styles.company_item}>
|
||||
<Text>公司抬头:</Text>
|
||||
<Text>XL纺织公司</Text>
|
||||
</View>
|
||||
<View className={styles.company_item}>
|
||||
<Text>客户名称:</Text>
|
||||
<Text>上生企业制衣厂</Text>
|
||||
</View>
|
||||
<View className={styles.company_item}>
|
||||
<Text>商品信息:</Text>
|
||||
<Text>106.60kg|¥1,332.00</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.code_list_number}> 共 2 种面料,3 种颜色,共 4 条</View>
|
||||
<View className={styles.code_list_bottom}>
|
||||
<View className={styles.code_list_bottom_item}>码单浏览</View>
|
||||
<View className={styles.code_list_bottom_item}>码单编辑</View>
|
||||
</View>
|
||||
</View>
|
||||
}
|
||||
38
src/pages/codeList/components/companyItem/index.module.scss
Normal file
38
src/pages/codeList/components/companyItem/index.module.scss
Normal file
@ -0,0 +1,38 @@
|
||||
.company_item {
|
||||
width: 702px;
|
||||
height: 148px;
|
||||
background: #ffffff;
|
||||
border-radius: 16px;
|
||||
margin-top: 24px;
|
||||
display: flex;
|
||||
padding: 0 24px;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
.name {
|
||||
width: 78px;
|
||||
height: 78px;
|
||||
background: linear-gradient(337deg, #7bb7ff 0%, #4581ff 100%);
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 78px;
|
||||
}
|
||||
.desc {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
margin-left: 30px;
|
||||
font-size: 28px;
|
||||
text {
|
||||
&:nth-child(1) {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
&:nth-child(2) {
|
||||
color: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
}
|
||||
}
|
||||
.company_icon {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
}
|
||||
14
src/pages/codeList/components/companyItem/index.tsx
Normal file
14
src/pages/codeList/components/companyItem/index.tsx
Normal file
@ -0,0 +1,14 @@
|
||||
import { Text, View } from '@tarojs/components'
|
||||
import styles from './index.module.scss'
|
||||
import IconFont from '@/components/iconfont/iconfont'
|
||||
|
||||
export default () => {
|
||||
return <View className={styles.company_item}>
|
||||
<View className={styles.name}>欧</View>
|
||||
<View className={styles.desc}>
|
||||
<Text>布郡纺织有限公司</Text>
|
||||
<Text>杨翰俊 131****4873</Text>
|
||||
</View>
|
||||
<View className={styles.company_icon}><IconFont name="icon-xiala" size={43} /></View>
|
||||
</View>
|
||||
}
|
||||
43
src/pages/codeList/components/companyModel/index.module.scss
Normal file
43
src/pages/codeList/components/companyModel/index.module.scss
Normal file
@ -0,0 +1,43 @@
|
||||
.company_main {
|
||||
padding-bottom: 200px;
|
||||
.company_search {
|
||||
width: 750px;
|
||||
height: 104px;
|
||||
background: #ffffff;
|
||||
display: flex;
|
||||
padding: 0 24px;
|
||||
box-sizing: border-box;
|
||||
align-items: center;
|
||||
margin-top: 1px;
|
||||
.code_list_search--code {
|
||||
width: 100%;
|
||||
height: 72px;
|
||||
background: #f7f7f7;
|
||||
border-radius: 36px;
|
||||
margin-right: 32px;
|
||||
}
|
||||
}
|
||||
.company_con {
|
||||
padding: 0 24px;
|
||||
}
|
||||
.company_create {
|
||||
width: 750px;
|
||||
height: 160px;
|
||||
background: #ffffff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
font-size: 28px;
|
||||
padding-top: 16px;
|
||||
color: #fff;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
.company_create_btn {
|
||||
text-align: center;
|
||||
line-height: 80px;
|
||||
width: 702px;
|
||||
height: 80px;
|
||||
background: #337fff;
|
||||
border-radius: 44px;
|
||||
}
|
||||
}
|
||||
}
|
||||
18
src/pages/codeList/components/companyModel/index.tsx
Normal file
18
src/pages/codeList/components/companyModel/index.tsx
Normal file
@ -0,0 +1,18 @@
|
||||
import { Text, View } from '@tarojs/components'
|
||||
import CompanyItem from '../companyItem'
|
||||
import styles from './index.module.scss'
|
||||
import Search from '@/components/search'
|
||||
|
||||
export default () => {
|
||||
return <View className={styles.company_main}>
|
||||
<View className={styles.company_search}>
|
||||
<View className={styles['code_list_search--code']}><Search placeholder="请输入单据抬头/客户/单号" /></View>
|
||||
</View>
|
||||
<View className={styles.company_con}>
|
||||
<CompanyItem />
|
||||
</View>
|
||||
<View className={styles.company_create}>
|
||||
<View className={styles.company_create_btn}>新建抬头</View>
|
||||
</View>
|
||||
</View>
|
||||
}
|
||||
@ -1,26 +0,0 @@
|
||||
import { Text, View } from '@tarojs/components'
|
||||
import classNames from 'classnames'
|
||||
import { memo, useCallback, useEffect, useState } from 'react'
|
||||
import styles from './index.module.scss'
|
||||
|
||||
export type SelectStatus = 1|2|3
|
||||
interface Param {
|
||||
defaultIndex?: SelectStatus
|
||||
onSelect?: (val: number) => void
|
||||
}
|
||||
export default memo((props: Param) => {
|
||||
const { defaultIndex = 1, onSelect } = props
|
||||
const [selectIndex, setSelectIndex] = useState(1)
|
||||
useEffect(() => {
|
||||
if (defaultIndex != selectIndex) { setSelectIndex(() => defaultIndex) }
|
||||
}, [defaultIndex])
|
||||
const getSelect = useCallback((index) => {
|
||||
setSelectIndex(() => index)
|
||||
onSelect?.(index)
|
||||
}, [])
|
||||
return <View className={styles.select_list} >
|
||||
<View onClick={() => getSelect(1)} className={classNames(styles.select_list_item, selectIndex == 1 && styles.select_list_ed)}><Text>按整单</Text></View>
|
||||
<View onClick={() => getSelect(2)} className={classNames(styles.select_list_item, selectIndex == 2 && styles.select_list_ed)}><Text>按面料</Text></View>
|
||||
<View onClick={() => getSelect(3)} className={classNames(styles.select_list_item, selectIndex == 3 && styles.select_list_ed)}><Text>按颜色</Text></View>
|
||||
</View>
|
||||
})
|
||||
@ -1,3 +1,3 @@
|
||||
export default {
|
||||
navigationBarTitleText: '码单详情',
|
||||
navigationBarTitleText: '码单管理',
|
||||
}
|
||||
|
||||
@ -1,41 +1,34 @@
|
||||
.code_list__main {
|
||||
background-color: #f7f7f7;
|
||||
min-height: 100vh;
|
||||
padding-bottom: 150px;
|
||||
.code_list__head {
|
||||
background-color: #fff;
|
||||
padding: 24px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.code_list_con {
|
||||
background-color: #f7f7f7ff;
|
||||
.code_list_search {
|
||||
width: 750px;
|
||||
height: 104px;
|
||||
background: #ffffff;
|
||||
display: flex;
|
||||
padding: 0 24px;
|
||||
margin-top: 24px;
|
||||
.code_des {
|
||||
padding: 0 32px 32px 32px;
|
||||
background-color: #fff;
|
||||
border-radius: 16px;
|
||||
margin-top: 24px;
|
||||
.code_des_title {
|
||||
height: 82px;
|
||||
line-height: 82px;
|
||||
font-size: 28px;
|
||||
color: #000000;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.code_des_item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
align-items: center;
|
||||
margin-top: 1px;
|
||||
.code_list_search--code {
|
||||
width: 558px;
|
||||
height: 72px;
|
||||
background: #f7f7f7;
|
||||
border-radius: 36px;
|
||||
margin-right: 32px;
|
||||
}
|
||||
.code_list_search--data {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text {
|
||||
font-size: 28px;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
margin-top: 24px;
|
||||
.code_des_weight {
|
||||
font-weight: 500;
|
||||
}
|
||||
.code_des_price {
|
||||
color: #f64861;
|
||||
font-weight: 500;
|
||||
}
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.code_list_con {
|
||||
padding: 24px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,67 +1,19 @@
|
||||
import { Text, View } from '@tarojs/components'
|
||||
import classnames from 'classnames'
|
||||
import { useCallback, useState } from 'react'
|
||||
import { View } from '@tarojs/components'
|
||||
import { useState } from 'react'
|
||||
import styles from './index.module.scss'
|
||||
import PayeeHead from './components/payeeHead'
|
||||
import type { SelectStatus } from './components/payeeHead/selectList'
|
||||
import SelectList from './components/payeeHead/selectList'
|
||||
import Counter from './components/counter'
|
||||
import SettingNumber from './components/settingNumber'
|
||||
import WholeOrderSetting from './components/wholeOrderSetting'
|
||||
import BottomBtn from './components/bottomBtn'
|
||||
import ProductSetting from './components/productSetting'
|
||||
import ColorSetting from './components/colorSetting'
|
||||
import useLogin from '@/use/useLogin'
|
||||
import IconFont from '@/components/iconfont/iconfont'
|
||||
import LabAndImg from '@/components/LabAndImg'
|
||||
import CodeModel from './components/codeModel'
|
||||
import CompanyModel from './components/companyModel'
|
||||
import SelectList from '@/components/selectList'
|
||||
|
||||
export default () => {
|
||||
const [modeIndex, setModeIndex] = useState<SelectStatus>(1)
|
||||
const getTypeSelect = useCallback((index) => {
|
||||
console.log('index::', index)
|
||||
setModeIndex(index)
|
||||
}, [])
|
||||
const selectList = [
|
||||
{ value: 1, label: '码单列表' },
|
||||
{ value: 2, label: '抬头列表' },
|
||||
]
|
||||
const [selectIndex, setSelectIndex] = useState(1)
|
||||
return <View className={styles.code_list__main}>
|
||||
<View className={styles.code_list__head}>
|
||||
<PayeeHead />
|
||||
</View>
|
||||
<SelectList onSelect={getTypeSelect} />
|
||||
<View className={styles.code_list_con}>
|
||||
{modeIndex == 1 && <WholeOrderSetting />}
|
||||
{modeIndex == 2 && <ProductSetting />}
|
||||
{modeIndex == 3 && <ColorSetting />}
|
||||
<View className={styles.code_des}>
|
||||
<View className={styles.code_des_title}>自定义单据信息</View>
|
||||
<View className={styles.code_des_item}>
|
||||
<Text>合计空差</Text>
|
||||
<Text>60kg</Text>
|
||||
</View>
|
||||
<View className={styles.code_des_item}>
|
||||
<Text>合计重量</Text>
|
||||
<Text className={styles.code_des_weight}>230.2kg</Text>
|
||||
</View>
|
||||
<View className={styles.code_des_item}>
|
||||
<Text>合计金额</Text>
|
||||
<Text className={styles.code_des_price}>¥22,332.00</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.code_des}>
|
||||
<View className={styles.code_des_title}>原始单据信息</View>
|
||||
<View className={styles.code_des_item}>
|
||||
<Text>合计空差</Text>
|
||||
<Text>60kg</Text>
|
||||
</View>
|
||||
<View className={styles.code_des_item}>
|
||||
<Text>合计重量</Text>
|
||||
<Text className={styles.code_des_weight}>230.2kg</Text>
|
||||
</View>
|
||||
<View className={styles.code_des_item}>
|
||||
<Text>合计金额</Text>
|
||||
<Text className={styles.code_des_price}>¥22,332.00</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
<BottomBtn />
|
||||
<View className="common_safe_area_y"></View>
|
||||
<SelectList list={selectList} defaultIndex={selectIndex} onSelect={index => setSelectIndex(index)} />
|
||||
{selectIndex == 1 && <CodeModel />}
|
||||
{selectIndex == 2 && <CompanyModel />}
|
||||
</View>
|
||||
}
|
||||
|
||||
3
src/pages/codeSetting/index.config.ts
Normal file
3
src/pages/codeSetting/index.config.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export default {
|
||||
navigationBarTitleText: '码单详情',
|
||||
}
|
||||
41
src/pages/codeSetting/index.module.scss
Normal file
41
src/pages/codeSetting/index.module.scss
Normal file
@ -0,0 +1,41 @@
|
||||
.code_list__main {
|
||||
background-color: #f7f7f7;
|
||||
min-height: 100vh;
|
||||
padding-bottom: 150px;
|
||||
.code_list__head {
|
||||
background-color: #fff;
|
||||
padding: 24px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.code_list_con {
|
||||
padding: 0 24px;
|
||||
margin-top: 24px;
|
||||
.code_des {
|
||||
padding: 0 32px 32px 32px;
|
||||
background-color: #fff;
|
||||
border-radius: 16px;
|
||||
margin-top: 24px;
|
||||
.code_des_title {
|
||||
height: 82px;
|
||||
line-height: 82px;
|
||||
font-size: 28px;
|
||||
color: #000000;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.code_des_item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 28px;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
margin-top: 24px;
|
||||
.code_des_weight {
|
||||
font-weight: 500;
|
||||
}
|
||||
.code_des_price {
|
||||
color: #f64861;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
70
src/pages/codeSetting/index.tsx
Normal file
70
src/pages/codeSetting/index.tsx
Normal file
@ -0,0 +1,70 @@
|
||||
import { Text, View } from '@tarojs/components'
|
||||
import classnames from 'classnames'
|
||||
import { useCallback, useState } from 'react'
|
||||
import styles from './index.module.scss'
|
||||
import PayeeHead from './components/payeeHead'
|
||||
import Counter from './components/counter'
|
||||
import SettingNumber from './components/settingNumber'
|
||||
import WholeOrderSetting from './components/wholeOrderSetting'
|
||||
import BottomBtn from './components/bottomBtn'
|
||||
import ProductSetting from './components/productSetting'
|
||||
import ColorSetting from './components/colorSetting'
|
||||
import SelectList from '@/components/selectList'
|
||||
import useLogin from '@/use/useLogin'
|
||||
import IconFont from '@/components/iconfont/iconfont'
|
||||
import LabAndImg from '@/components/LabAndImg'
|
||||
|
||||
export default () => {
|
||||
const selectList = [
|
||||
{ value: 1, label: '按整单' },
|
||||
{ value: 2, label: '按面料' },
|
||||
{ value: 3, label: '按颜色' },
|
||||
]
|
||||
const [modeIndex, setModeIndex] = useState(1)
|
||||
const getTypeSelect = useCallback((index) => {
|
||||
setModeIndex(index)
|
||||
}, [])
|
||||
return <View className={styles.code_list__main}>
|
||||
<View className={styles.code_list__head}>
|
||||
<PayeeHead />
|
||||
</View>
|
||||
<SelectList onSelect={getTypeSelect} list={selectList} defaultIndex={1} />
|
||||
<View className={styles.code_list_con}>
|
||||
{modeIndex == 1 && <WholeOrderSetting />}
|
||||
{modeIndex == 2 && <ProductSetting />}
|
||||
{modeIndex == 3 && <ColorSetting />}
|
||||
<View className={styles.code_des}>
|
||||
<View className={styles.code_des_title}>自定义单据信息</View>
|
||||
<View className={styles.code_des_item}>
|
||||
<Text>合计空差</Text>
|
||||
<Text>60kg</Text>
|
||||
</View>
|
||||
<View className={styles.code_des_item}>
|
||||
<Text>合计重量</Text>
|
||||
<Text className={styles.code_des_weight}>230.2kg</Text>
|
||||
</View>
|
||||
<View className={styles.code_des_item}>
|
||||
<Text>合计金额</Text>
|
||||
<Text className={styles.code_des_price}>¥22,332.00</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.code_des}>
|
||||
<View className={styles.code_des_title}>原始单据信息</View>
|
||||
<View className={styles.code_des_item}>
|
||||
<Text>合计空差</Text>
|
||||
<Text>60kg</Text>
|
||||
</View>
|
||||
<View className={styles.code_des_item}>
|
||||
<Text>合计重量</Text>
|
||||
<Text className={styles.code_des_weight}>230.2kg</Text>
|
||||
</View>
|
||||
<View className={styles.code_des_item}>
|
||||
<Text>合计金额</Text>
|
||||
<Text className={styles.code_des_price}>¥22,332.00</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
<BottomBtn />
|
||||
<View className="common_safe_area_y"></View>
|
||||
</View>
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
.company_item {
|
||||
width: 702px;
|
||||
height: 148px;
|
||||
background: #ffffff;
|
||||
border-radius: 16px;
|
||||
margin-top: 24px;
|
||||
display: flex;
|
||||
padding: 0 24px;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
.name {
|
||||
width: 78px;
|
||||
height: 78px;
|
||||
background: linear-gradient(337deg, #7bb7ff 0%, #4581ff 100%);
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 78px;
|
||||
}
|
||||
.desc {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
margin-left: 30px;
|
||||
font-size: 28px;
|
||||
text {
|
||||
&:nth-child(1) {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
&:nth-child(2) {
|
||||
color: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
}
|
||||
}
|
||||
.company_icon {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
}
|
||||
19
src/pages/weightList/components/companyItem/index.tsx
Normal file
19
src/pages/weightList/components/companyItem/index.tsx
Normal file
@ -0,0 +1,19 @@
|
||||
import { Text, View } from '@tarojs/components'
|
||||
import styles from './index.module.scss'
|
||||
import IconFont from '@/components/iconfont/iconfont'
|
||||
import { goLink } from '@/common/common'
|
||||
|
||||
interface Param {
|
||||
value: { title: string; purchaser_name: string; id: number; phone: string }
|
||||
}
|
||||
export default (props: Param) => {
|
||||
const { value } = props
|
||||
return <View className={styles.company_item} onClick={() => goLink(`/pages/weightListAdd/index?type=edit&id=${value.id}`)}>
|
||||
<View className={styles.name}>{value?.title || ''}</View>
|
||||
<View className={styles.desc}>
|
||||
<Text>{value?.title }</Text>
|
||||
<Text>{`${value?.purchaser_name} ${value?.phone}`}</Text>
|
||||
</View>
|
||||
<View className={styles.company_icon}><IconFont name="icon-xiala" size={43} /></View>
|
||||
</View>
|
||||
}
|
||||
101
src/pages/weightList/index copy.tsx
Normal file
101
src/pages/weightList/index copy.tsx
Normal file
@ -0,0 +1,101 @@
|
||||
|
||||
import { Button, Navigator, ScrollView, Text, View } from '@tarojs/components'
|
||||
import { memo, useEffect, useState } from 'react'
|
||||
import { weightDeleteApi, weightListApi } from '@/api/weightList'
|
||||
import './index.scss'
|
||||
import Taro, { showModal } from '@tarojs/taro'
|
||||
import { alert } from '@/common/common'
|
||||
|
||||
const weightListManager = () => {
|
||||
return (
|
||||
<View className="weight-list-manager">
|
||||
<WeightList />
|
||||
</View>
|
||||
)
|
||||
}
|
||||
interface Params{
|
||||
refresherEnabled?: boolean// 是否开启刷新
|
||||
onSelect?: (item: any, index: number) => void// 列表选择
|
||||
|
||||
}
|
||||
// 码单列表
|
||||
const WeightList = (props: Params) => {
|
||||
const { fetchData, state } = weightListApi()
|
||||
const getData = () => {
|
||||
fetchData()
|
||||
}
|
||||
useEffect(() => {
|
||||
Taro.eventCenter.on('weightList:refresh', getData)
|
||||
getData()
|
||||
return () => {
|
||||
Taro.eventCenter.off('weightList:refresh', getData)
|
||||
}
|
||||
}, [])
|
||||
// 处理刷新
|
||||
const [refreshState, setRefreshState] = useState(false)
|
||||
const handleRefresh = async() => {
|
||||
setRefreshState(true)
|
||||
await fetchData()
|
||||
setRefreshState(false)
|
||||
}
|
||||
const data = Array.from({ length: 0 })
|
||||
// 删除码单
|
||||
const { fetchData: deleteFetch } = weightDeleteApi()
|
||||
const handleDelete = (item: any) => {
|
||||
showModal(({
|
||||
title: '提示',
|
||||
content: '是否删除码单?',
|
||||
async success(ev) {
|
||||
if (ev.confirm) {
|
||||
const result = await deleteFetch({ id: item.id })
|
||||
if (result.success) {
|
||||
alert.success('删除成功')
|
||||
getData()
|
||||
}
|
||||
else {
|
||||
alert.success(result.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
}))
|
||||
}
|
||||
|
||||
return (
|
||||
<View className="weight-list-scroll-view">
|
||||
<ScrollView scrollY refresherEnabled enhanced refresherTriggered={refreshState} onRefresherRefresh={handleRefresh}>
|
||||
{
|
||||
// data.length>0?
|
||||
state?.data?.list?.length > 0
|
||||
? state?.data?.list?.map((item, index) => {
|
||||
return (
|
||||
<View key={item.id} onClick={() => props.onSelect && props.onSelect(item, index)} onLongPress={() => handleDelete(item)} className={`weight-list-list ${item.is_default && 'address-active'}`}>
|
||||
<View className="weight-list-user">
|
||||
{item.title}
|
||||
{
|
||||
item.is_default && <Text className="weight-list-list-default">默认</Text>
|
||||
}
|
||||
</View>
|
||||
<View className="weight-list-list-bottom">
|
||||
<View className="weight-list-list-info">
|
||||
{item.purchaser_name}
|
||||
<Text className="weight-list-list-phone">{item.phone.replace(item.phone.substring(3, 7), '****')}</Text>
|
||||
</View>
|
||||
<Navigator url={`/pages/weightListAdd/index?type=edit&id=${item.id}`} hoverClass="none" className="weight-list-edit">
|
||||
<Text className="iconfont icon-bianji"></Text>
|
||||
</Navigator>
|
||||
</View>
|
||||
</View>
|
||||
)
|
||||
})
|
||||
: <View className="weight-list-no-data">
|
||||
<View>您末添加任何码单信息</View>
|
||||
正在使用平台默认码单信息
|
||||
</View>
|
||||
}
|
||||
</ScrollView>
|
||||
<Navigator url="/pages/weightListAdd/index?type=add" hoverClass="none" className="add-weight-list">添加新码单信息</Navigator>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
export default weightListManager
|
||||
@ -1,4 +1,5 @@
|
||||
export default {
|
||||
navigationBarTitleText: '码单管理',
|
||||
enableShareAppMessage: true,
|
||||
backgroundColor: '#F7F7F7FF',
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
.weight-list-manager {
|
||||
height: 100vh;
|
||||
|
||||
background-color: #f7f7f7ff;
|
||||
.weight-list-scroll-view {
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
@ -10,6 +11,10 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.weight-list-con {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.weight-list-list {
|
||||
width: 704px;
|
||||
height: 156px;
|
||||
|
||||
@ -1,14 +1,13 @@
|
||||
|
||||
import { Button, Navigator, ScrollView, Text, View } from '@tarojs/components'
|
||||
import { memo, useEffect, useState } from 'react'
|
||||
import CompanyItem from './components/companyItem'
|
||||
import { weightDeleteApi, weightListApi } from '@/api/weightList'
|
||||
import './index.scss'
|
||||
import Taro, { showModal } from '@tarojs/taro'
|
||||
import { alert } from '@/common/common'
|
||||
import useLogin from '@/use/useLogin'
|
||||
|
||||
const weightListManager = () => {
|
||||
useLogin()
|
||||
return (
|
||||
<View className="weight-list-manager">
|
||||
<WeightList />
|
||||
@ -70,22 +69,8 @@ const WeightList = (props: Params) => {
|
||||
state?.data?.list?.length > 0
|
||||
? state?.data?.list?.map((item, index) => {
|
||||
return (
|
||||
<View onClick={() => props.onSelect && props.onSelect(item, index)} onLongPress={() => handleDelete(item)} className={`weight-list-list ${item.is_default && 'address-active'}`}>
|
||||
<View className="weight-list-user">
|
||||
{item.title}
|
||||
{
|
||||
item.is_default && <Text className="weight-list-list-default">默认</Text>
|
||||
}
|
||||
</View>
|
||||
<View className="weight-list-list-bottom">
|
||||
<View className="weight-list-list-info">
|
||||
{item.purchaser_name}
|
||||
<Text className="weight-list-list-phone">{item.phone.replace(item.phone.substring(3, 7), '****')}</Text>
|
||||
</View>
|
||||
<Navigator url={`/pages/weightListAdd/index?type=edit&id=${item.id}`} hoverClass="none" className="weight-list-edit">
|
||||
<Text className="iconfont icon-bianji"></Text>
|
||||
</Navigator>
|
||||
</View>
|
||||
<View key={item.id} className="weight-list-con">
|
||||
<CompanyItem value={item} />
|
||||
</View>
|
||||
)
|
||||
})
|
||||
@ -95,7 +80,7 @@ const WeightList = (props: Params) => {
|
||||
</View>
|
||||
}
|
||||
</ScrollView>
|
||||
<Navigator url="/pages/weightListAdd/index?type=add" hoverClass="none" className="add-weight-list">添加新码单信息</Navigator>
|
||||
<Navigator url="/pages/weightListAdd/index?type=add" hoverClass="none" className="add-weight-list">新建抬头</Navigator>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
@ -16,13 +16,12 @@ export default (props: Param) => {
|
||||
console.log('openstatus::', openStatus)
|
||||
useEffect(() => {
|
||||
Taro.onAppShow((res) => {
|
||||
if (res?.referrerInfo?.appId == BANk_WX_APPID && props.custMerchId) {
|
||||
console.log('onAppShow::', res)
|
||||
if (res?.referrerInfo?.appId == BANk_WX_APPID && !openStatus.current && props.custMerchId) {
|
||||
callBack?.(res)
|
||||
const tf = res?.referrerInfo?.extraData?.payStatus == 'success'
|
||||
setPayStatus(() => tf)
|
||||
openStatus.current = true
|
||||
}
|
||||
openStatus.current = true
|
||||
})
|
||||
}, [props])
|
||||
|
||||
@ -39,6 +38,7 @@ export default (props: Param) => {
|
||||
},
|
||||
success(res) { // 打开成功的回调函数
|
||||
console.log('打开成功::', res)
|
||||
openStatus.current = false
|
||||
},
|
||||
fail(res) {
|
||||
console.log('打开失败::', res)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user