✨ feat:状态按钮重新对接完成进度20%
This commit is contained in:
parent
7362e5bca6
commit
c3053f232a
@ -155,6 +155,13 @@
|
||||
"query": "purchaser_id=642&sale_mode=1&shopping_cart_product_color_list%5B2%5D=58994&shopping_cart_product_color_list%5B3%5D=58995",
|
||||
"launchMode": "default",
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"pathName": "pages/applyGoods/index",
|
||||
"query": "orderId=28503",
|
||||
"launchMode": "default",
|
||||
"scene": null
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -6,7 +6,8 @@ interface prosObj {
|
||||
sale_mode?: Number,
|
||||
collect_status?: Number | string,
|
||||
status?: Number,
|
||||
payment_method?: Number
|
||||
payment_method?: Number,
|
||||
settle_mode?: Number | string,
|
||||
}
|
||||
cancle?: (any) => void,
|
||||
nextBuy?: (any) => void,
|
||||
@ -20,22 +21,27 @@ export default memo((props: prosObj) => {
|
||||
collect_status: '',
|
||||
status: '',
|
||||
payment_method: 0,
|
||||
settle_mode: ''
|
||||
},
|
||||
cancle,
|
||||
nextBuy,
|
||||
toPay
|
||||
} = props
|
||||
//判断显示取消订单
|
||||
|
||||
const showCancel = useMemo(() => {
|
||||
if (
|
||||
(obj.sale_mode === 0 && obj.status === 0) ||
|
||||
(obj.sale_mode === 0 && obj.status === 1) ||
|
||||
(obj.sale_mode === 0 && obj.status === 2) ||
|
||||
(obj.sale_mode === 0 && obj.status === 11 && obj.collect_status == 0) ||
|
||||
(obj.sale_mode === 0 && obj.status === 2 && obj.collect_status == 0) ||
|
||||
(obj.sale_mode === 0 && obj.status === 7 && obj.collect_status == 0) ||
|
||||
(obj.sale_mode === 0 && obj.status === 3 && (obj.payment_method == 3 || obj.payment_method == 5)) ||
|
||||
(obj.sale_mode === 0 && obj.status === 11 && obj.collect_status == 0) ||
|
||||
(obj.sale_mode === 0 && obj.status === 11 && obj.settle_mode == 3) ||
|
||||
(obj.sale_mode === 0 && obj.status === 3 && obj.settle_mode == 3) ||
|
||||
(obj.sale_mode === 1 && obj.status === 10) ||
|
||||
(obj.sale_mode === 2 && obj.status === 10)
|
||||
(obj.sale_mode === 2 && obj.status === 10) ||
|
||||
(obj.sale_mode === 2 && obj.status === 0 && (obj.collect_status == 1 || obj.collect_status == 2)) ||
|
||||
(obj.sale_mode === 2 && obj.status === 0 && obj.collect_status == 0)
|
||||
) {
|
||||
return true
|
||||
} else return false
|
||||
@ -58,6 +64,7 @@ export default memo((props: prosObj) => {
|
||||
(obj.sale_mode === 0 && obj.status === 3 && (obj.payment_method == 3 || obj.payment_method == 5)) ||
|
||||
(obj.sale_mode === 0 && obj.status === 8 && (obj.payment_method == 3 || obj.payment_method == 5 || obj.collect_status == 1)) ||
|
||||
(obj.sale_mode === 0 && obj.status === 9 && (obj.payment_method == 3 || obj.payment_method == 5 || obj.collect_status == 1)) ||
|
||||
(obj.sale_mode === 0 && obj.status === 7 && obj.collect_status == 0) ||
|
||||
(obj.sale_mode === 2 && obj.status === 7)
|
||||
) {
|
||||
return true
|
||||
|
@ -32,11 +32,17 @@ export default memo((props: props) => {
|
||||
|
||||
const onInputEven = (e) => {
|
||||
let res = e.detail.value
|
||||
if (props.modeFont !== 2) {
|
||||
if (Number(res) == 0 || Number(res) < 1) {
|
||||
if (props.modeFont == 0) {
|
||||
if (Number(res) < 0) {
|
||||
setValue({ count: 1 })
|
||||
}
|
||||
} else {
|
||||
}
|
||||
if (props.modeFont == 1) {
|
||||
if (Number(res) < 0) {
|
||||
setValue({ count: 0.5 })
|
||||
}
|
||||
}
|
||||
if (props.modeFont == 2) {
|
||||
if (Number(res) == 0 || Number(res) < 3) {
|
||||
setValue({ count: 3 })
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { View } from '@tarojs/components'
|
||||
import style from './index.module.scss'
|
||||
import classnames from 'classnames'
|
||||
import { memo, ReactNode, useEffect, useMemo, useRef } from 'react'
|
||||
import { memo, ReactNode, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import CloseBtnIcon from '@/components/closeBtn'
|
||||
|
||||
export interface Params {
|
||||
@ -13,10 +13,11 @@ export interface Params {
|
||||
// IconButton?: ReactNode, //
|
||||
showIconButton?: false | true //是否显示关闭按钮
|
||||
position?: 'bottom' | 'top' | 'right' //弹出位置
|
||||
animationEnd?: () => void //弹出动画结束
|
||||
animationEnd?: () => void, //弹出动画结束
|
||||
isFixed?: boolean //二次弹窗触发
|
||||
}
|
||||
export default memo(
|
||||
({ title = '标题', show = false, showTitle = true, onClose, showIconButton = false, children, position = 'bottom', animationEnd }: Params) => {
|
||||
({ title = '标题', show = false, showTitle = true, isFixed = false, onClose, showIconButton = false, children, position = 'bottom', animationEnd }: Params) => {
|
||||
const animationTime = useRef<any>(null)
|
||||
useEffect(() => {
|
||||
if (show) {
|
||||
@ -30,16 +31,19 @@ export default memo(
|
||||
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
|
||||
clearTimeout(animationTime.current)
|
||||
}
|
||||
}, [])
|
||||
|
||||
const [ShowContext, setShowContext] = useState(false)
|
||||
return (
|
||||
<>
|
||||
<View className={style.drawer_main}>
|
||||
<View catchMove={true} className={`${style.drawer} ${show ? style.drawer_active : ''}`}>
|
||||
<View className={classnames(style.drawer_mask, { [style.drawer_mask_active]: show })} onClick={() => onClose?.()}>
|
||||
<View
|
||||
style={{ position: `${isFixed == true ? 'fixed' : 'absolute'}`, }}
|
||||
className={classnames(style.drawer_container, style['drawer_container_' + position], { [style.drawer_container_active]: show })}
|
||||
onClick={(e) => e.stopPropagation()}>
|
||||
{showTitle && <View className={style.drawer_container_title}>{title}</View>}
|
||||
@ -48,7 +52,6 @@ export default memo(
|
||||
<CloseBtnIcon onClose={() => onClose?.()} />
|
||||
</View>
|
||||
)}
|
||||
|
||||
<View className={style.drawer_container_context}>{children}</View>
|
||||
<View className='common_safe_area_y'></View>
|
||||
</View>
|
||||
|
@ -141,7 +141,7 @@ export default memo(forwardRef((props: prosObj, ref) => {
|
||||
<View className={styles.danwei}>{modeFont == 0 ? '大货' : modeFont == 1 ? '剪版' : '散剪'}单位:{showModefont}</View>
|
||||
</View>
|
||||
<View className={styles.searchBox}>
|
||||
<Search placeholder='请输入搜索布料' showBtn={false} changeOnSearch={getSearchData} debounceTime={300} />
|
||||
<Search placeholder='请输入搜索布料' showBtn={false} changeOnSearch={getSearchData} debounceTime={300} adjustPosition={true} />
|
||||
</View>
|
||||
{
|
||||
goodList.length > 0 && <>
|
||||
|
@ -65,6 +65,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
.bigBoxThree {
|
||||
width: 100%;
|
||||
// position: fixed;
|
||||
// bottom: 0px;
|
||||
// z-index: 999;
|
||||
height: 150px;
|
||||
|
||||
.itemBox {
|
||||
width: 100%;
|
||||
height: 88px;
|
||||
|
@ -84,30 +84,35 @@ const PictureItem = memo<ImageParam>(({ onChange, defaultList, onlyRead = false
|
||||
}
|
||||
|
||||
return (
|
||||
<View className={styles.image_main}>
|
||||
{imageList?.map((item, index) => (
|
||||
<View className={styles.ImgItem}>
|
||||
<Image mode='aspectFill' src={formatImgUrl(item)} onClick={showImage}></Image>
|
||||
{!onlyRead && <View onClick={() => delImage(index)} className={classnames(styles.miconfont_close, 'iconfont icon-guanbi')}></View>}
|
||||
<>
|
||||
<View className={styles.image_main}>
|
||||
{imageList?.map((item, index) => (
|
||||
<View className={styles.ImgItem}>
|
||||
<Image mode='aspectFill' src={formatImgUrl(item)} onClick={showImage}></Image>
|
||||
{!onlyRead && <View onClick={() => delImage(index)} className={classnames(styles.miconfont_close, 'iconfont icon-guanbi')}></View>}
|
||||
</View>
|
||||
))}
|
||||
{!onlyRead && (
|
||||
<View className={styles.uploadImg} onClick={uploadImage}>
|
||||
<Text className={classnames(styles.miconfont, 'iconfont icon-xinzeng')}></Text>
|
||||
{/* <Text className={styles.uploadText}>上传照片</Text> */}
|
||||
</View>
|
||||
)}
|
||||
|
||||
</View>
|
||||
<Popup title={'选择方式'} show={showPopup} onClose={() => setshowPopup(false)} isFixed={true}>
|
||||
<View className={styles.bigBoxThree}>
|
||||
{
|
||||
List.map((item, index) => {
|
||||
return (
|
||||
<View className={styles.itemBox} key={index} onClick={() => handItem(item)}>{item.name}</View>
|
||||
)
|
||||
})
|
||||
}
|
||||
</View>
|
||||
))}
|
||||
{!onlyRead && (
|
||||
<View className={styles.uploadImg} onClick={uploadImage}>
|
||||
<Text className={classnames(styles.miconfont, 'iconfont icon-xinzeng')}></Text>
|
||||
{/* <Text className={styles.uploadText}>上传照片</Text> */}
|
||||
</View>
|
||||
)}
|
||||
<Popup title={'选择方式'} show={showPopup} onClose={() => setshowPopup(false)}>
|
||||
{
|
||||
List.map((item, index) => {
|
||||
return (
|
||||
<View className={styles.itemBox} key={index} onClick={() => handItem(item)}>{item.name}</View>
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
</Popup>
|
||||
</View>
|
||||
</>
|
||||
)
|
||||
})
|
||||
|
||||
|
@ -25,16 +25,23 @@ export default () => {
|
||||
const [ListArr, setListArr] = useState<any[]>([])
|
||||
//获取订单详情
|
||||
const getDetail = async () => {
|
||||
const res = await infoFetch({ id: router.params.orderId })
|
||||
res.data.av_return_product.forEach(item => {
|
||||
item.av_product_color.map(it => {
|
||||
it.isTui = false
|
||||
it.nums = 1
|
||||
})
|
||||
return item
|
||||
Taro.showLoading({
|
||||
title: '请稍等...',
|
||||
mask: true
|
||||
})
|
||||
setListArr(res.data.av_return_product)
|
||||
setInfoObj(res.data)
|
||||
const res = await infoFetch({ id: router.params.orderId })
|
||||
if (res.data) {
|
||||
res.data.av_return_product.forEach(item => {
|
||||
item.av_product_color.map(it => {
|
||||
it.isTui = false
|
||||
it.nums = 1
|
||||
})
|
||||
return item
|
||||
})
|
||||
setListArr(res.data.av_return_product)
|
||||
setInfoObj(res.data)
|
||||
Taro.hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
//点击退货
|
||||
@ -176,9 +183,10 @@ export default () => {
|
||||
|
||||
//判断是否允许提交
|
||||
const isDisabled = useMemo(() => {
|
||||
console.log(Query, 8888)
|
||||
if (Query.GoodStatus !== '' &&
|
||||
Query.return_explain !== '' &&
|
||||
totalNums !== 0 &&
|
||||
totalNums > 0 &&
|
||||
Query.GoodStatus !== ''
|
||||
) {
|
||||
return false
|
||||
@ -236,7 +244,8 @@ export default () => {
|
||||
})
|
||||
setReasonListTwo([...ReasonListTwo])
|
||||
// queryRef.current.reasonNameTwo = item.name
|
||||
setQuery({ return_explain: item.id })
|
||||
setQuery((val) => ({ ...val, return_explain: item.id }))
|
||||
|
||||
// queryRef.current.return_explain = item.id
|
||||
}
|
||||
|
||||
@ -265,10 +274,10 @@ export default () => {
|
||||
|
||||
//判断选择原因
|
||||
const selectIsDisabled = useMemo(() => {
|
||||
if (Query.return_explain == '') {
|
||||
return true
|
||||
} else {
|
||||
if (Query.return_explain !== '') {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}, [Query])
|
||||
|
||||
@ -362,12 +371,15 @@ export default () => {
|
||||
const arr: any = [];
|
||||
ListArr.forEach((item) => {
|
||||
item.av_product_color.forEach((it) => {
|
||||
arr.push({
|
||||
product_color_id: it.sale_mode == 0 ? it.product_color_id : '',
|
||||
product_id: it.sale_mode == 0 ? it.product_id : '',
|
||||
product_roll: it.sale_mode == 0 ? it.nums : 0,
|
||||
sale_order_detail_id: it.sale_order_detail_id,
|
||||
});
|
||||
if (it.isTui) {
|
||||
arr.push({
|
||||
product_color_id: it.sale_mode == 0 ? it.product_color_id : '',
|
||||
product_id: it.sale_mode == 0 ? it.product_id : '',
|
||||
product_roll: it.sale_mode == 0 ? it.nums : 0,
|
||||
sale_order_detail_id: it.sale_order_detail_id,
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
const query = {
|
||||
@ -380,6 +392,7 @@ export default () => {
|
||||
roll_list: arr,
|
||||
sale_order_id: Number(infoObj.id),
|
||||
}
|
||||
|
||||
Taro.showModal({
|
||||
content: "确认退货吗?",
|
||||
confirmText: "确认",
|
||||
@ -409,7 +422,9 @@ export default () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
setQuery(Query)
|
||||
}, [Query])
|
||||
|
||||
//备注信息
|
||||
const [TextareaValue, setTextareaValue] = useState('')
|
||||
@ -471,7 +486,6 @@ export default () => {
|
||||
value={TextareaValue}
|
||||
// style='background:#f6f6f6;height:210px;padding:15rpx 24rpx 24rpx 24rpx;border-radius: 8rpx;'
|
||||
placeholderStyle='font-size: 28rpx;font-weight: 400;'
|
||||
autoFocus
|
||||
placeholder={'选填/退货说明中选择时(其他问题)必填'}
|
||||
></Textarea>
|
||||
</View>
|
||||
|
@ -75,7 +75,7 @@ export default () => {
|
||||
setHasMore(true)
|
||||
setRefresherTriggeredStatus(true)
|
||||
}
|
||||
|
||||
|
||||
const onj = JSON.parse(Taro.getStorageSync('userInfo') || '{}')
|
||||
const [search, setSearchObj] = useState({
|
||||
modeId: 0,
|
||||
@ -117,10 +117,15 @@ export default () => {
|
||||
const res = await colorlistFetch({ product_id: search.goodsId, sale_mode: search.modeId, code_or_name: search.code_or_name, physical_warehouse: 1 })
|
||||
res.data.list.map((item) => {
|
||||
item.showInput = false
|
||||
if (search.modeId !== 2) {
|
||||
if (search.modeId == 0) {
|
||||
item.nums = 1
|
||||
item.buyNums = 1
|
||||
} else {
|
||||
}
|
||||
if (search.modeId == 1) {
|
||||
item.nums = 0.5
|
||||
item.buyNums = 0.5
|
||||
}
|
||||
if (search.modeId == 2) {
|
||||
item.nums = 3
|
||||
item.buyNums = 3
|
||||
}
|
||||
@ -158,9 +163,13 @@ export default () => {
|
||||
goodList.map((it) => {
|
||||
if (item.id === it.id) {
|
||||
item.nums--
|
||||
if (search.modeId !== 2) {
|
||||
if (search.modeId == 0) {
|
||||
if (item.nums < 1) it.showInput = false, it.nums = 1
|
||||
} else {
|
||||
}
|
||||
if (search.modeId == 1) {
|
||||
if (item.nums < 0.5) it.showInput = false, it.nums = 0.5
|
||||
}
|
||||
if (search.modeId == 2) {
|
||||
if (item.nums < 3) it.showInput = false, it.nums = 3
|
||||
}
|
||||
|
||||
@ -174,9 +183,7 @@ export default () => {
|
||||
const handPlus = useCallback((item) => {
|
||||
goodList.map((it) => {
|
||||
if (item.id === it.id) {
|
||||
// if (it.nums > item.buyNums) {
|
||||
it.nums++
|
||||
// }
|
||||
}
|
||||
return item
|
||||
})
|
||||
@ -213,8 +220,8 @@ export default () => {
|
||||
const list: any[] = []
|
||||
arr.forEach(it => {
|
||||
list.push({
|
||||
roll: search.modeId === 0 ? it.nums : 0,
|
||||
length: search.modeId !== 0 ? it.nums * 100 : 0,
|
||||
roll: search.modeId === 0 ? Number(it.nums) : 0,
|
||||
length: search.modeId !== 0 ? Number(it.nums) * 100 : 0,
|
||||
product_color_id: Number(it.id)
|
||||
})
|
||||
})
|
||||
@ -240,7 +247,6 @@ export default () => {
|
||||
return item
|
||||
})
|
||||
setGoodlist([...goodList])
|
||||
console.log(search, '000000.0.0.')
|
||||
Taro.hideLoading()
|
||||
} else {
|
||||
Taro.hideLoading()
|
||||
@ -254,13 +260,32 @@ export default () => {
|
||||
const onBlur = (e, id) => {
|
||||
goodList.map((item) => {
|
||||
if (item.id == id) {
|
||||
item.nums = e.detail.value
|
||||
if (search.modeId == 0 && (e.detail.value == '' || Number(e.detail.value) == 0)) {
|
||||
item.nums = 1
|
||||
item.showInput = false
|
||||
} else {
|
||||
item.nums = e.detail.value
|
||||
}
|
||||
if (search.modeId == 1 && Number(e.detail.value) < 0.5) {
|
||||
item.nums = 0.5
|
||||
item.showInput = false
|
||||
} else {
|
||||
item.nums = e.detail.value
|
||||
}
|
||||
if (search.modeId == 2) {
|
||||
item.nums = e.detail.value
|
||||
}
|
||||
|
||||
}
|
||||
return item
|
||||
})
|
||||
setGoodlist([...goodList])
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
setGoodlist(goodList)
|
||||
}, [goodList])
|
||||
|
||||
return (
|
||||
// <MoveBtn onClick={() => setShowShopCart(showShopCart)}>
|
||||
<View className={styles.main}>
|
||||
|
@ -117,7 +117,7 @@ export default memo((props: Props) => {
|
||||
订单金额
|
||||
</View>
|
||||
<View className={styles.rightFont}>
|
||||
¥{formatPriceDiv(obj.total_sale_price)}
|
||||
¥{formatPriceDiv(obj.wait_pay_amount)}
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.itemMoney}>
|
||||
|
@ -143,7 +143,6 @@ export default () => {
|
||||
clientName: '',
|
||||
sale_user_id: '',
|
||||
saleuserName: '',
|
||||
// order_no: '',
|
||||
sale_mode: undefined,
|
||||
shipment_mode: undefined
|
||||
})
|
||||
@ -159,10 +158,7 @@ export default () => {
|
||||
})
|
||||
}
|
||||
}
|
||||
// //订单号输入框
|
||||
// const handInput = (eq) => {
|
||||
// setsearchObj((e) => ({ ...e, order_no: eq.detail.value }))
|
||||
// }
|
||||
|
||||
|
||||
//订单类型
|
||||
const [modeList, setModeList] = useState<any[]>([{ id: -1, name: '不限' }, { id: 0, name: '大货' }, { id: 1, name: '剪版' }, { id: 2, name: '散剪' }])
|
||||
@ -243,8 +239,7 @@ export default () => {
|
||||
const handScan = () => {
|
||||
Taro.scanCode({
|
||||
success(res) {
|
||||
// setsearchObj((e) => ({ ...e, order_no: res.result }))
|
||||
setSearchField({ ...searchField, order_no: res.result })
|
||||
setSearchField((val) => ({ ...val, order_no: res.result }))
|
||||
},
|
||||
fail(res) {
|
||||
console.log(res);
|
||||
@ -596,7 +591,7 @@ export default () => {
|
||||
return (
|
||||
<View>
|
||||
<View style={{ background: '#FFFFFF', paddingLeft: '20rpx', paddingBottom: '20rpx', position: 'sticky', top: '0', zIndex: '99' }}>
|
||||
<Search handScan={() => handScan()} showScan placeholder='搜索商品/名称/颜色/订单号' showBtn={false} changeOnSearch={getSearchData} debounceTime={300}>
|
||||
<Search handScan={() => handScan()} defaultValue={searchField.order_no} showScan placeholder='搜索商品/名称/颜色/订单号' showBtn={false} changeOnSearch={getSearchData} debounceTime={300}>
|
||||
<View className={styles.flexBox} onClick={() => showSelctPopup()}>
|
||||
<IconFont name='icon-shaixuan' size={35} color={!isDisabled ? '#0D7CFF' : ''} customClassName={styles['activeshaixuan']} />
|
||||
{/* <View className={classnames('iconfont', 'icon-shaixuan', !isDisabled ? styles.icon_shaixuan : styles.activeshaixuan)}></View> */}
|
||||
|
@ -35,14 +35,14 @@
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #000000;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
/*这里设置几行*/
|
||||
overflow: hidden;
|
||||
margin-right: 41px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2; /*这里设置几行*/
|
||||
overflow: hidden;
|
||||
|
||||
}
|
||||
|
||||
.icon_more {
|
||||
|
@ -21,7 +21,7 @@ export default memo((props: propsObj) => {
|
||||
if (receivingStatus == 1) {
|
||||
return obj.take_goods_address
|
||||
} else {
|
||||
return obj.province_name + obj.city_name + obj.district_name
|
||||
return obj.province_name + obj.city_name + obj.district_name + obj.address_detail
|
||||
}
|
||||
}, [obj, receivingStatus])
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
import Popup from "@/components/popup"
|
||||
import { Textarea, View } from "@tarojs/components"
|
||||
import { useCallback, useEffect, useState } from "react"
|
||||
import styles from './index.module.scss'
|
||||
import styles from './index.module.scss'
|
||||
|
||||
type Param = {
|
||||
onBlur?: (val:any) => void
|
||||
onBlur?: (val: any) => void
|
||||
onSave?: (val: string) => void
|
||||
defaultValue?: string
|
||||
}
|
||||
export default ({onBlur, onSave, defaultValue = ''}:Param) => {
|
||||
export default ({ onBlur, onSave, defaultValue = '' }: Param) => {
|
||||
const [descData, setDescData] = useState({
|
||||
number: 0,
|
||||
value: '',
|
||||
@ -21,10 +21,10 @@ export default ({onBlur, onSave, defaultValue = ''}:Param) => {
|
||||
|
||||
const getDesc = (value) => {
|
||||
let res = value
|
||||
if(value.length > descData.count) {
|
||||
if (value.length > descData.count) {
|
||||
res = value.slice(0, descData.count)
|
||||
}
|
||||
setDescData({...descData, number:res.length, value: res})
|
||||
setDescData({ ...descData, number: res.length, value: res })
|
||||
}
|
||||
|
||||
const setSave = () => {
|
||||
|
@ -199,6 +199,7 @@ page {
|
||||
|
||||
|
||||
}
|
||||
|
||||
.itemGoods:last-child {
|
||||
margin-top: 24px;
|
||||
display: flex;
|
||||
@ -367,4 +368,18 @@ page {
|
||||
transform: rotate(135deg);
|
||||
box-shadow: 2px -2px 2px #ccc;
|
||||
}
|
||||
}
|
||||
|
||||
.order_save_address {
|
||||
height: 82px;
|
||||
background: #007aff;
|
||||
border-radius: 40px;
|
||||
width: 668px;
|
||||
text-align: center;
|
||||
line-height: 82px;
|
||||
color: #fff;
|
||||
margin-top: 20px;
|
||||
margin-left: 24px;
|
||||
margin-right: 24px;
|
||||
margin-bottom: 20px;
|
||||
}
|
@ -5,7 +5,7 @@ import classnames from "classnames";
|
||||
import Taro, { usePullDownRefresh, useRouter, useDidShow } from '@tarojs/taro';
|
||||
import AdvanceOrderState from './components/advanceOrderState'
|
||||
import AddressDetailBox from './components/addressDetailBox'
|
||||
import Remark from './components/remark'
|
||||
import Remark from '@/components/textareaEnhance'
|
||||
import Popup from '@/components/popup'
|
||||
import BottomBtns from '@/components/BottomBtns';
|
||||
import BottomApply from './components/BottomApply';
|
||||
@ -72,11 +72,19 @@ export default () => {
|
||||
setReceivingStatus(value)
|
||||
getDetail()
|
||||
} else {
|
||||
Taro.hideLoading()
|
||||
Taro.showToast({
|
||||
title: '请先去新增地址',
|
||||
icon: 'error'
|
||||
})
|
||||
if (res.data.code == 70029) {
|
||||
Taro.hideLoading()
|
||||
Taro.showToast({
|
||||
title: res.msg,
|
||||
icon: 'error'
|
||||
})
|
||||
} else {
|
||||
Taro.hideLoading()
|
||||
Taro.showToast({
|
||||
title: '请先去新增地址',
|
||||
icon: 'error'
|
||||
})
|
||||
}
|
||||
}
|
||||
}, 300)
|
||||
|
||||
@ -106,6 +114,8 @@ export default () => {
|
||||
})
|
||||
setOrderMsg([...orderMsg])
|
||||
setReceivingStatus(res.data.shipment_mode)
|
||||
// 小程序提供的api,通知页面停止下拉刷新效果
|
||||
Taro.stopPullDownRefresh();
|
||||
Taro.hideLoading()
|
||||
}
|
||||
//复制功能
|
||||
@ -148,8 +158,8 @@ export default () => {
|
||||
//备注操作
|
||||
const [showDesc, setShowDesc] = useState(false)
|
||||
const { fetchData: remarkFetch } = mpsaleOrderput()
|
||||
const getRemark = useCallback(async (e) => {
|
||||
const res = await remarkFetch({ remark: e, id: Number(router.params.id) })
|
||||
const getRemark = async () => {
|
||||
const res = await remarkFetch({ remark: infoObj.remark, id: Number(router.params.id) })
|
||||
if (res.msg === 'success') {
|
||||
Taro.showToast({
|
||||
title: '成功',
|
||||
@ -158,7 +168,7 @@ export default () => {
|
||||
setShowDesc(false)
|
||||
getDetail()
|
||||
}
|
||||
}, [])
|
||||
}
|
||||
|
||||
//更多按钮查看操作
|
||||
const [showMore, setShowMore] = useState(false)
|
||||
@ -476,7 +486,7 @@ export default () => {
|
||||
title: '请稍等...',
|
||||
mask: true
|
||||
})
|
||||
const restult = await obj.status !== 10 ? payOneFetch({ id: Number(obj.should_collect_order_id), payment_method: Number(arr[0]?.id) }) : payTwoFetch({ id: Number(obj.pre_collect_order_id), payment_method: Number(arr[0]?.id) })
|
||||
let restult = await obj.status !== 10 ? payOneFetch({ id: Number(obj.should_collect_order_id), payment_method: Number(arr[0]?.id) }) : payTwoFetch({ id: Number(obj.pre_collect_order_id), payment_method: Number(arr[0]?.id) })
|
||||
if (restult?.msg === 'success') {
|
||||
Taro.showToast({
|
||||
title: '交易成功'
|
||||
@ -548,7 +558,7 @@ export default () => {
|
||||
title: '请稍等...',
|
||||
mask: true
|
||||
})
|
||||
const res = await receveFetch({ id: Number(infoObj.id) })
|
||||
const res = await receveFetch({ sale_order_id: Number(infoObj.id) })
|
||||
if (res?.msg === 'success') {
|
||||
Taro.showToast({
|
||||
title: '成功'
|
||||
@ -569,6 +579,13 @@ export default () => {
|
||||
})
|
||||
}
|
||||
|
||||
const onChange = (e) => {
|
||||
setInfoObj((val) => ({ ...val, remark: e }))
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
setInfoObj(infoObj)
|
||||
}, [infoObj])
|
||||
return (
|
||||
<View className={styles.mainBox}>
|
||||
{(infoObj?.status != 10 && <OrderState orderInfo={infoObj} />)}
|
||||
@ -636,11 +653,22 @@ export default () => {
|
||||
}
|
||||
|
||||
</DefaultBox>
|
||||
<DefaultBox title={'备注信息'} showMode={true} modeName={`${'填写/修改备注'} >`} clickNode={() => setShowDesc(true)}>
|
||||
<View className={styles.remarkFont}>{infoObj.remark === '' ? '暂无' : infoObj.remark}</View>
|
||||
</DefaultBox>
|
||||
<Popup show={showDesc} showTitle={false} onClose={() => setShowDesc(false)}>
|
||||
<Remark onSave={(e) => getRemark(e)} defaultValue={infoObj.remark} />
|
||||
{
|
||||
(infoObj.status != 11 && infoObj.status != 3 && infoObj.status != 8 && infoObj.status != 9 && infoObj.status != 4
|
||||
) && <DefaultBox title={'备注信息'} showMode={true} modeName={`${'填写/修改备注'} >`} clickNode={() => setShowDesc(true)}>
|
||||
<View className={styles.remarkFont}>{infoObj.remark === '' ? '暂无' : infoObj.remark}</View>
|
||||
</DefaultBox>
|
||||
}
|
||||
|
||||
<Popup show={showDesc} title={'填写/编辑备注'} showTitle={true} onClose={() => setShowDesc(false)}>
|
||||
<View style={{ margin: '24rpx' }}>
|
||||
<Remark
|
||||
// onSave={(e) => getRemark(e)}
|
||||
onChange={(e) => onChange(e)}
|
||||
defaultValue={infoObj.remark} />
|
||||
<View className={styles.order_save_address} onClick={() => getRemark()}>保存</View>
|
||||
</View>
|
||||
|
||||
</Popup>
|
||||
<View className={styles.safeBottom}></View>
|
||||
<View className={styles.bottomBox}>
|
||||
|
@ -2,7 +2,7 @@ import { View, Input, Button, Image } from '@tarojs/components'
|
||||
import { useCallback, useEffect, useMemo, useRef, useState, ReactNode, memo } from 'react'
|
||||
import styles from "./index.module.scss"
|
||||
import classnames from "classnames";
|
||||
import Taro, { faceVerifyForPay, useDidShow, useRouter } from '@tarojs/taro'
|
||||
import Taro, { faceVerifyForPay, useDidShow, useRouter, usePullDownRefresh } from '@tarojs/taro'
|
||||
import ItemList from './components/itemList'
|
||||
import { formatDateTime, formatHashTag, formatImgUrl, formatPriceDiv, formatWeightDiv } from '@/common/format'
|
||||
import {
|
||||
@ -15,8 +15,12 @@ import AddressDetailBox from './components/addressDetailBox'
|
||||
import { IMG_CND_Prefix } from "@/common/constant";
|
||||
import Popup from '@/components/popup';
|
||||
import UploadImage from '@/components/uploadImage'
|
||||
|
||||
import { alert } from '@/common/common';
|
||||
export default () => {
|
||||
//页面下拉刷新
|
||||
usePullDownRefresh(() => {
|
||||
getDetail()
|
||||
})
|
||||
const router = useRouter()
|
||||
useEffect(() => {
|
||||
getDetail()
|
||||
@ -58,6 +62,8 @@ export default () => {
|
||||
setOrderMsg([...orderMsg])
|
||||
setPicList([...res.data?.accessory_url !== null ? res.data?.accessory_url : []])
|
||||
Taro.hideLoading()
|
||||
// 小程序提供的api,通知页面停止下拉刷新效果
|
||||
Taro.stopPullDownRefresh();
|
||||
}
|
||||
}
|
||||
|
||||
@ -179,7 +185,10 @@ export default () => {
|
||||
const { fetchData: sureFetch } = returnApplyOrderuploadAccessory()
|
||||
const handSure = () => {
|
||||
let arr: any = []
|
||||
arr = [...picUrl.current, ...PicList]
|
||||
arr = [...picUrl.current]
|
||||
if (arr == 0) {
|
||||
return alert.error('请先添加附件')
|
||||
}
|
||||
Taro.showModal({
|
||||
content: "确定要提交吗?",
|
||||
confirmText: "确认",
|
||||
@ -193,8 +202,9 @@ export default () => {
|
||||
})
|
||||
if (res.msg === 'success') {
|
||||
Taro.showToast({
|
||||
title: '取消成功'
|
||||
title: '成功'
|
||||
})
|
||||
setShowPic(false)
|
||||
Taro.hideLoading()
|
||||
getDetail()
|
||||
} else {
|
||||
@ -285,11 +295,13 @@ export default () => {
|
||||
</View>
|
||||
}
|
||||
<Popup title={'查看/修改物流回单'} show={ShowPic} onClose={() => setShowPic(false)}>
|
||||
<UploadImage onChange={getImageList} defaultList={PicList} onlyRead={onlyRead} />
|
||||
{
|
||||
<>
|
||||
<UploadImage onChange={getImageList} defaultList={PicList} onlyRead={onlyRead} />
|
||||
{
|
||||
|
||||
!onlyRead && <View className={styles.picBtn} onClick={() => handSure()}>确认修改</View>
|
||||
}
|
||||
!onlyRead && <View className={styles.picBtn} onClick={() => handSure()}>确认修改</View>
|
||||
}
|
||||
</>
|
||||
</Popup>
|
||||
</View>
|
||||
)
|
||||
|
@ -48,7 +48,7 @@ export default () => {
|
||||
//监听筛选条件变化
|
||||
useEffect(() => {
|
||||
getOrderList()
|
||||
}, [searchField.size, searchField.name])
|
||||
}, [searchField.size, searchField.name, searchField.status])
|
||||
|
||||
//获取订单列表
|
||||
const { fetchData: listFetchData, state: orderState } = mpreturnApplyOrderlist()
|
||||
@ -61,7 +61,7 @@ export default () => {
|
||||
})
|
||||
setOrderData((e) => ({ ...e, list: res.data?.list, total: res.data?.total }))
|
||||
// setshowPopup(false)
|
||||
setRefresherTriggeredStatus(() => false)
|
||||
setRefresherTriggeredStatus(false)
|
||||
}
|
||||
|
||||
|
||||
@ -81,6 +81,7 @@ export default () => {
|
||||
pageNum.current.size = 1
|
||||
setRefresherTriggeredStatus(true)
|
||||
setSearchField((val) => ({ ...val, size: 10 }))
|
||||
getOrderList()
|
||||
}
|
||||
//数据加载状态
|
||||
const statusMore = useMemo(() => {
|
||||
@ -111,6 +112,7 @@ export default () => {
|
||||
pageNum.current.page = 1
|
||||
setOrderData(() => ({ list: [], total: 0 }))
|
||||
setSearchField((val) => ({ ...val, size: 10, status: item.id }))
|
||||
// getOrderList()
|
||||
})
|
||||
}
|
||||
|
||||
@ -126,7 +128,7 @@ export default () => {
|
||||
}
|
||||
|
||||
//订单类型
|
||||
const [modeList, setModeList] = useState<any[]>([{ id: -1, name: '不限' }, { id: 0, name: '大货' }, { id: 1, name: '剪版' }, { id: 2, name: '散剪' }])
|
||||
const [modeList, setModeList] = useState<any[]>([{ id: '', name: '不限' }, { id: 0, name: '大货' }, { id: 1, name: '剪版' }, { id: 2, name: '散剪' }])
|
||||
//选择订单类型
|
||||
const handCheckMode = (item) => {
|
||||
modeList.map(it => {
|
||||
|
@ -64,10 +64,15 @@ export default memo(() => {
|
||||
const res = await colorlistFetch({ product_id: search.goodsId, sale_mode: search.modeId, code_or_name: search.code_or_name, physical_warehouse: 1 })
|
||||
res.data.list.map((item) => {
|
||||
item.showInput = false
|
||||
if (search.modeId !== 2) {
|
||||
if (search.modeId == 0) {
|
||||
item.nums = 1
|
||||
item.buyNums = 1
|
||||
} else {
|
||||
}
|
||||
if (search.modeId == 1) {
|
||||
item.nums = 0.5
|
||||
item.buyNums = 0.5
|
||||
}
|
||||
if (search.modeId == 2) {
|
||||
item.nums = 3
|
||||
item.buyNums = 3
|
||||
}
|
||||
@ -167,9 +172,13 @@ export default memo(() => {
|
||||
goodList.map((it) => {
|
||||
if (item.id === it.id) {
|
||||
item.nums--
|
||||
if (search.modeId !== 2) {
|
||||
if (search.modeId == 0) {
|
||||
if (item.nums < 1) it.showInput = false, it.nums = 1
|
||||
} else {
|
||||
}
|
||||
if (search.modeId == 1) {
|
||||
if (item.nums < 0.5) it.showInput = false, it.nums = 0.5
|
||||
}
|
||||
if (search.modeId == 2) {
|
||||
if (item.nums < 3) it.showInput = false, it.nums = 3
|
||||
}
|
||||
|
||||
@ -262,7 +271,22 @@ export default memo(() => {
|
||||
const onBlur = (e, id) => {
|
||||
goodList.map((item) => {
|
||||
if (item.id == id) {
|
||||
item.nums = e.detail.value
|
||||
if (search.modeId == 0 && (e.detail.value == '' || Number(e.detail.value) == 0)) {
|
||||
item.nums = 1
|
||||
item.showInput = false
|
||||
} else {
|
||||
item.nums = e.detail.value
|
||||
}
|
||||
if (search.modeId == 1 && Number(e.detail.value) < 0.5) {
|
||||
item.nums = 0.5
|
||||
item.showInput = false
|
||||
} else {
|
||||
item.nums = e.detail.value
|
||||
}
|
||||
if (search.modeId == 2) {
|
||||
item.nums = e.detail.value
|
||||
}
|
||||
|
||||
}
|
||||
return item
|
||||
})
|
||||
|
@ -22,16 +22,16 @@ export default () => {
|
||||
//获取选择的客户
|
||||
let pages = Taro.getCurrentPages();
|
||||
let currPage = pages[pages.length - 1]; // 获取当前页面
|
||||
|
||||
setInfoObj({
|
||||
...infoObj,
|
||||
province_name: currPage.data.addressObj.province_name,
|
||||
address_id: currPage.data.addressObj.id,
|
||||
city_name: currPage.data.addressObj.city_name,
|
||||
district_name: currPage.data.addressObj.district_name,
|
||||
target_user_name: currPage.data.addressObj.name,
|
||||
purchaser_phone: currPage.data.addressObj.phone,
|
||||
})
|
||||
setInfoObj((val) => ({
|
||||
...val,
|
||||
province_name: currPage.data?.addressObj?.province_name,
|
||||
address_id: currPage.data?.addressObj?.id,
|
||||
city_name: currPage.data?.addressObj?.city_name,
|
||||
address_detail: currPage.data?.addressObj?.address_detail,
|
||||
district_name: currPage.data?.addressObj?.district_name,
|
||||
target_user_name: currPage.data?.addressObj?.name,
|
||||
purchaser_phone: currPage.data?.addressObj?.phone,
|
||||
}))
|
||||
})
|
||||
useEffect(() => {
|
||||
getDetail()
|
||||
@ -152,6 +152,10 @@ export default () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
setInfoObj(infoObj)
|
||||
}, [infoObj])
|
||||
return (
|
||||
<View className={styles.mainBox}>
|
||||
<AddressDetailBox
|
||||
|
Loading…
x
Reference in New Issue
Block a user