修复部分bug
This commit is contained in:
parent
ddda63c1b0
commit
e3a950481c
@ -56,3 +56,14 @@ export const AddFavoriteApi = () => {
|
|||||||
method: "post",
|
method: "post",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除收藏夹商品
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const DelFavoriteProductApi = () => {
|
||||||
|
return useRequest({
|
||||||
|
url: `/v1/mall/favorite/product`,
|
||||||
|
method: "delete",
|
||||||
|
})
|
||||||
|
}
|
@ -4,14 +4,14 @@
|
|||||||
// export const BASE_URL = `http://10.0.0.5:50001/lymarket`
|
// export const BASE_URL = `http://10.0.0.5:50001/lymarket`
|
||||||
// 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 = `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.42:50001/lymarket` // 杰
|
// export const BASE_URL = `http://192.168.1.42:50001/lymarket` // 杰
|
||||||
|
|
||||||
// CDN
|
// CDN
|
||||||
|
@ -42,7 +42,7 @@ const PictureItem:FC<ImageParam> = memo(({onChange, defaultList, onlyRead = fals
|
|||||||
//预览图片
|
//预览图片
|
||||||
const showImage = () => {
|
const showImage = () => {
|
||||||
let list = imageList.map(item => {
|
let list = imageList.map(item => {
|
||||||
return formatImgUrl(item)
|
return formatImgUrl(item, '!w800')
|
||||||
})
|
})
|
||||||
Taro.previewImage({
|
Taro.previewImage({
|
||||||
current: list[0], // 当前显示
|
current: list[0], // 当前显示
|
||||||
|
@ -17,7 +17,7 @@ import useUserInfo from '@/use/useUserInfo';
|
|||||||
import LabAndImg from '@/components/LabAndImg';
|
import LabAndImg from '@/components/LabAndImg';
|
||||||
import { alert } from '@/common/common';
|
import { alert } from '@/common/common';
|
||||||
import AddCollection from '@/components/addCollection';
|
import AddCollection from '@/components/addCollection';
|
||||||
import { AddFavoriteApi } from '@/api/favorite';
|
import { AddFavoriteApi, DelFavoriteProductApi } from '@/api/favorite';
|
||||||
import { GetShoppingCartApi } from '@/api/shopCart';
|
import { GetShoppingCartApi } from '@/api/shopCart';
|
||||||
|
|
||||||
type item = {title:string, img:string, url:string, id:number}
|
type item = {title:string, img:string, url:string, id:number}
|
||||||
@ -137,11 +137,19 @@ export default (props:Params) => {
|
|||||||
const [collectStatus, setCollectStatus] = useState(false)
|
const [collectStatus, setCollectStatus] = useState(false)
|
||||||
const [collectionShow, setCollectionShow] = useState(false)
|
const [collectionShow, setCollectionShow] = useState(false)
|
||||||
const {fetchData: addFavoritefetchData} = AddFavoriteApi()
|
const {fetchData: addFavoritefetchData} = AddFavoriteApi()
|
||||||
|
const openCollection = () => {
|
||||||
|
if(productInfo.is_favorite) {
|
||||||
|
delFavoriteProduct()
|
||||||
|
} else {
|
||||||
|
setCollectionShow(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
const onAdd = useCallback(async (val) => {
|
const onAdd = useCallback(async (val) => {
|
||||||
let res = await addFavoritefetchData({favorite_id: val.id, product_id: Number(params.id)})
|
let res = await addFavoritefetchData({favorite_id: val.id, product_id: Number(params.id)})
|
||||||
if(res.success) {
|
if(res.success) {
|
||||||
alert.success('添加成功')
|
alert.success('添加成功')
|
||||||
setCollectStatus(true)
|
setCollectStatus(true)
|
||||||
|
getProductDetail()
|
||||||
} else {
|
} else {
|
||||||
alert.none(res.msg)
|
alert.none(res.msg)
|
||||||
}
|
}
|
||||||
@ -151,6 +159,16 @@ export default (props:Params) => {
|
|||||||
const closeCollection = useCallback(() => {
|
const closeCollection = useCallback(() => {
|
||||||
setCollectionShow(false)
|
setCollectionShow(false)
|
||||||
}, [])
|
}, [])
|
||||||
|
//取消收藏
|
||||||
|
const {fetchData: delFavoriteProductFetchData} = DelFavoriteProductApi()
|
||||||
|
const delFavoriteProduct = async () => {
|
||||||
|
let res = await delFavoriteProductFetchData({favorite_id: productInfo.favorite_id, product_id:[productInfo.id]})
|
||||||
|
if(res.success) {
|
||||||
|
setCollectStatus(false)
|
||||||
|
getProductDetail()
|
||||||
|
alert.none('已取消收藏')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//获取购物车数据数量
|
//获取购物车数据数量
|
||||||
const [shopCount, setShopCount] = useState<number>(0)
|
const [shopCount, setShopCount] = useState<number>(0)
|
||||||
@ -181,7 +199,7 @@ export default (props:Params) => {
|
|||||||
<View className={styles.text}>分享</View>
|
<View className={styles.text}>分享</View>
|
||||||
<Button open-type="share" className={styles.shareBtn}></Button>
|
<Button open-type="share" className={styles.shareBtn}></Button>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.collect} onClick={() => setCollectionShow(true)}>
|
<View className={styles.collect} onClick={openCollection}>
|
||||||
<View className={classnames(`iconfont ${collectStatus?'icon-shoucang-pressed':'icon-shoucang'}`, styles.miconfont, collectStatus&&styles.collected)} ></View>
|
<View className={classnames(`iconfont ${collectStatus?'icon-shoucang-pressed':'icon-shoucang'}`, styles.miconfont, collectStatus&&styles.collected)} ></View>
|
||||||
<View className={styles.text}>收藏</View>
|
<View className={styles.text}>收藏</View>
|
||||||
</View>
|
</View>
|
||||||
|
@ -58,7 +58,8 @@ import styles from './index.module.scss'
|
|||||||
let res = await getOrderFetchData({id: orderId.current})
|
let res = await getOrderFetchData({id: orderId.current})
|
||||||
setOrderDetail(res.data)
|
setOrderDetail(res.data)
|
||||||
setOrderRemark(res.data.remark)
|
setOrderRemark(res.data.remark)
|
||||||
if(firstOpen.current) {
|
//预付款自动打开支付
|
||||||
|
if(firstOpen.current && SaleorderstatusWaitingPrePayment.value == res.data.status) {
|
||||||
firstOpen.current = false
|
firstOpen.current = false
|
||||||
toPay()
|
toPay()
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,21 @@
|
|||||||
import { AFTER_ORDER_STATUS } from "@/common/enum";
|
import { AFTER_ORDER_STATUS, REFUND_STATUS_ORDER } from "@/common/enum";
|
||||||
import { Text, View } from "@tarojs/components"
|
import { Text, View } from "@tarojs/components"
|
||||||
import classnames from "classnames";
|
import classnames from "classnames";
|
||||||
import {memo, useMemo} from "react";
|
import {memo, useMemo} from "react";
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
|
|
||||||
type Param = {
|
type Param = {
|
||||||
return_address?:string,
|
|
||||||
return_phone?: string,
|
|
||||||
onLogistics?: (val: 1|2) => void, //1 上传物流 2 查看物流
|
onLogistics?: (val: 1|2) => void, //1 上传物流 2 查看物流
|
||||||
stage?: number,
|
orderInfo: {
|
||||||
|
return_user_name?:string,
|
||||||
|
return_user_phone?: string,
|
||||||
|
stage?: number,
|
||||||
|
sale_mode?: 0|1|2, //0 大货 1剪板 2散剪
|
||||||
|
type?: number, //申请单退款状态
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
export default memo(({return_address = '', return_phone = '', onLogistics, stage}:Param) => {
|
export default memo(({orderInfo, onLogistics}:Param) => {
|
||||||
const {
|
const {
|
||||||
ReturnStageApplying,
|
ReturnStageApplying,
|
||||||
ReturnStageWaitCheck,
|
ReturnStageWaitCheck,
|
||||||
@ -22,15 +27,30 @@ export default memo(({return_address = '', return_phone = '', onLogistics, stage
|
|||||||
ReturnStageRejected
|
ReturnStageRejected
|
||||||
} = AFTER_ORDER_STATUS
|
} = AFTER_ORDER_STATUS
|
||||||
|
|
||||||
|
const {
|
||||||
|
ReturnApplyOrderTypeAdvanceReceiptRefund, // 预收退款
|
||||||
|
ReturnApplyOrderTypeReturnForRefund, // 退货退款
|
||||||
|
ReturnApplyOrderTypeSalesRefund, // 销售退款
|
||||||
|
} = REFUND_STATUS_ORDER
|
||||||
|
|
||||||
//是否显示地址
|
//是否显示地址
|
||||||
const showAddress = useMemo(() => {
|
const showAddress = useMemo(() => {
|
||||||
return stage != ReturnStageApplying.value
|
let after_list = [
|
||||||
}, [stage])
|
ReturnStageApplying.value,
|
||||||
|
ReturnStageCancel.value,
|
||||||
|
ReturnStageRejected.value
|
||||||
|
]
|
||||||
|
let refurn_list = [
|
||||||
|
ReturnApplyOrderTypeSalesRefund.value,
|
||||||
|
ReturnApplyOrderTypeAdvanceReceiptRefund.value
|
||||||
|
]
|
||||||
|
return (!after_list.includes(orderInfo?.stage!)) && (orderInfo?.sale_mode != 1) && (!refurn_list.includes(orderInfo?.type!))
|
||||||
|
}, [orderInfo])
|
||||||
|
|
||||||
//上传物流
|
//上传物流
|
||||||
const upLogistics = useMemo(() => {
|
const upLogistics = useMemo(() => {
|
||||||
return stage == ReturnStageWaitCheck.value
|
return orderInfo?.stage == ReturnStageWaitCheck.value
|
||||||
}, [stage])
|
}, [orderInfo])
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -44,11 +64,11 @@ export default memo(({return_address = '', return_phone = '', onLogistics, stage
|
|||||||
<View className={classnames(styles.order_address_icon, 'iconfont','icon-fahuo')}></View>
|
<View className={classnames(styles.order_address_icon, 'iconfont','icon-fahuo')}></View>
|
||||||
<View className={styles.order_address_text_con}>
|
<View className={styles.order_address_text_con}>
|
||||||
<View className={styles.order_address_text_title}>
|
<View className={styles.order_address_text_title}>
|
||||||
<Text className={classnames(styles.address_text, styles.address_text_no)}>{return_address}</Text>
|
<Text className={classnames(styles.address_text, styles.address_text_no)}>{orderInfo?.return_user_name}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.order_address_text_name}>
|
<View className={styles.order_address_text_name}>
|
||||||
<Text>管理员</Text>
|
<Text>管理员</Text>
|
||||||
<Text>{return_phone}</Text>
|
<Text>{orderInfo?.return_user_phone}</Text>
|
||||||
{upLogistics&&<View className={styles.updateBtn} onClick={() => onLogistics?.(1)}>
|
{upLogistics&&<View className={styles.updateBtn} onClick={() => onLogistics?.(1)}>
|
||||||
上传物流
|
上传物流
|
||||||
</View>
|
</View>
|
||||||
|
@ -137,11 +137,10 @@ import styles from './index.module.scss'
|
|||||||
//显示记录
|
//显示记录
|
||||||
const [applyRecord, setApplyRecord] = useState(false)
|
const [applyRecord, setApplyRecord] = useState(false)
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={styles.order_main}>
|
<View className={styles.order_main}>
|
||||||
<OrderState orderInfo={orderDetail}/>
|
<OrderState orderInfo={orderDetail}/>
|
||||||
<AddressInfoDetail return_address={orderDetail?.return_user_name} return_phone={orderDetail?.return_user_phone} stage={orderDetail?.stage} onLogistics={onShowLogistics}/>
|
<AddressInfoDetail orderInfo={orderDetail} onLogistics={onShowLogistics}/>
|
||||||
<KindList order={formatPreViewOrderMemo}/>
|
<KindList order={formatPreViewOrderMemo}/>
|
||||||
<OrderDes orderInfo={orderDetail}/>
|
<OrderDes orderInfo={orderDetail}/>
|
||||||
<AfterOrderBtns orderInfo={orderInfo} onClick={orderStateClick}/>
|
<AfterOrderBtns orderInfo={orderInfo} onClick={orderStateClick}/>
|
||||||
|
@ -23,17 +23,28 @@
|
|||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.order_num {
|
.order_con {
|
||||||
flex: 1;
|
padding-left: 15px;
|
||||||
font-size: $font_size_medium;
|
width: 100%;
|
||||||
color: $color_font_one;
|
.name {
|
||||||
text-align: right;
|
color: #000;
|
||||||
padding-right: 10px;
|
font-weight: 700;
|
||||||
display: flex;
|
font-size: $font_size;
|
||||||
justify-content: flex-end;
|
}
|
||||||
align-items: center;
|
.order_num {
|
||||||
.miconfont {
|
flex: 1;
|
||||||
font-size: 20px;
|
font-size: $font_size_medium;
|
||||||
|
color: $color_font_one;
|
||||||
|
padding-right: 10px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
.order_num_con{
|
||||||
|
flex:1;
|
||||||
|
}
|
||||||
|
.miconfont {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.tag{
|
.tag{
|
||||||
|
@ -72,14 +72,24 @@ export default memo(({value, onClickBtn}: Param) => {
|
|||||||
<View className={styles.order_item}>
|
<View className={styles.order_item}>
|
||||||
<View className={styles.header} onClick={() => goLink('/pages/salesAfter/index', {id: value?.id})}>
|
<View className={styles.header} onClick={() => goLink('/pages/salesAfter/index', {id: value?.id})}>
|
||||||
<View className={styles.user}>
|
<View className={styles.user}>
|
||||||
<Image src={`${userInfo?.adminUserInfo?.avatar_url}`}/>
|
<Image src={`${userInfo?.adminUserInfo?.avatar_url}`}/>
|
||||||
<Text className={styles.name}>{userInfo?.adminUserInfo?.user_name}</Text>
|
{/* <Text className={styles.name}>{userInfo?.adminUserInfo?.user_name}</Text> */}
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.order_num}>
|
{/* <View className={styles.order_num}>
|
||||||
<Text>售后单号:{value?.return_order_no}</Text>
|
<Text>售后单号:{value?.return_order_no}</Text>
|
||||||
<Text className={classnames(styles.miconfont, 'iconfont, icon-a-moreback')}></Text>
|
<Text className={classnames(styles.miconfont, 'iconfont, icon-a-moreback')}></Text>
|
||||||
</View>
|
</View>
|
||||||
<OrderStatusTag status={value?.type}/>
|
<OrderStatusTag status={value?.type}/> */}
|
||||||
|
<View className={styles.order_con}>
|
||||||
|
<Text className={styles.name}>{userInfo?.adminUserInfo?.user_name}</Text>
|
||||||
|
<View className={styles.order_num}>
|
||||||
|
<View className={styles.order_num_con}>
|
||||||
|
<Text className={styles.order_no}>售后单号:{value?.return_order_no}</Text>
|
||||||
|
<Text className={classnames(styles.miconfont, 'iconfont, icon-a-moreback')}></Text>
|
||||||
|
</View>
|
||||||
|
<OrderStatusTag status={value?.type}/>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.product_con} onClick={() => goLink('/pages/salesAfter/index', {id: value?.id})}>
|
<View className={styles.product_con} onClick={() => goLink('/pages/salesAfter/index', {id: value?.id})}>
|
||||||
<View className={styles.product_title}>
|
<View className={styles.product_title}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user