修复部分bug
This commit is contained in:
parent
ddda63c1b0
commit
e3a950481c
@ -56,3 +56,14 @@ export const AddFavoriteApi = () => {
|
||||
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://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://test.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.42:50001/lymarket` // 杰
|
||||
|
||||
// CDN
|
||||
|
@ -42,7 +42,7 @@ const PictureItem:FC<ImageParam> = memo(({onChange, defaultList, onlyRead = fals
|
||||
//预览图片
|
||||
const showImage = () => {
|
||||
let list = imageList.map(item => {
|
||||
return formatImgUrl(item)
|
||||
return formatImgUrl(item, '!w800')
|
||||
})
|
||||
Taro.previewImage({
|
||||
current: list[0], // 当前显示
|
||||
|
@ -17,7 +17,7 @@ import useUserInfo from '@/use/useUserInfo';
|
||||
import LabAndImg from '@/components/LabAndImg';
|
||||
import { alert } from '@/common/common';
|
||||
import AddCollection from '@/components/addCollection';
|
||||
import { AddFavoriteApi } from '@/api/favorite';
|
||||
import { AddFavoriteApi, DelFavoriteProductApi } from '@/api/favorite';
|
||||
import { GetShoppingCartApi } from '@/api/shopCart';
|
||||
|
||||
type item = {title:string, img:string, url:string, id:number}
|
||||
@ -137,11 +137,19 @@ export default (props:Params) => {
|
||||
const [collectStatus, setCollectStatus] = useState(false)
|
||||
const [collectionShow, setCollectionShow] = useState(false)
|
||||
const {fetchData: addFavoritefetchData} = AddFavoriteApi()
|
||||
const openCollection = () => {
|
||||
if(productInfo.is_favorite) {
|
||||
delFavoriteProduct()
|
||||
} else {
|
||||
setCollectionShow(true)
|
||||
}
|
||||
}
|
||||
const onAdd = useCallback(async (val) => {
|
||||
let res = await addFavoritefetchData({favorite_id: val.id, product_id: Number(params.id)})
|
||||
if(res.success) {
|
||||
alert.success('添加成功')
|
||||
setCollectStatus(true)
|
||||
getProductDetail()
|
||||
} else {
|
||||
alert.none(res.msg)
|
||||
}
|
||||
@ -151,6 +159,16 @@ export default (props:Params) => {
|
||||
const closeCollection = useCallback(() => {
|
||||
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)
|
||||
@ -181,7 +199,7 @@ export default (props:Params) => {
|
||||
<View className={styles.text}>分享</View>
|
||||
<Button open-type="share" className={styles.shareBtn}></Button>
|
||||
</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={styles.text}>收藏</View>
|
||||
</View>
|
||||
|
@ -58,7 +58,8 @@ import styles from './index.module.scss'
|
||||
let res = await getOrderFetchData({id: orderId.current})
|
||||
setOrderDetail(res.data)
|
||||
setOrderRemark(res.data.remark)
|
||||
if(firstOpen.current) {
|
||||
//预付款自动打开支付
|
||||
if(firstOpen.current && SaleorderstatusWaitingPrePayment.value == res.data.status) {
|
||||
firstOpen.current = false
|
||||
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 classnames from "classnames";
|
||||
import {memo, useMemo} from "react";
|
||||
import styles from './index.module.scss'
|
||||
|
||||
type Param = {
|
||||
return_address?:string,
|
||||
return_phone?: string,
|
||||
onLogistics?: (val: 1|2) => void, //1 上传物流 2 查看物流
|
||||
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 {
|
||||
ReturnStageApplying,
|
||||
ReturnStageWaitCheck,
|
||||
@ -22,15 +27,30 @@ export default memo(({return_address = '', return_phone = '', onLogistics, stage
|
||||
ReturnStageRejected
|
||||
} = AFTER_ORDER_STATUS
|
||||
|
||||
const {
|
||||
ReturnApplyOrderTypeAdvanceReceiptRefund, // 预收退款
|
||||
ReturnApplyOrderTypeReturnForRefund, // 退货退款
|
||||
ReturnApplyOrderTypeSalesRefund, // 销售退款
|
||||
} = REFUND_STATUS_ORDER
|
||||
|
||||
//是否显示地址
|
||||
const showAddress = useMemo(() => {
|
||||
return stage != ReturnStageApplying.value
|
||||
}, [stage])
|
||||
let after_list = [
|
||||
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(() => {
|
||||
return stage == ReturnStageWaitCheck.value
|
||||
}, [stage])
|
||||
return orderInfo?.stage == ReturnStageWaitCheck.value
|
||||
}, [orderInfo])
|
||||
|
||||
|
||||
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={styles.order_address_text_con}>
|
||||
<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 className={styles.order_address_text_name}>
|
||||
<Text>管理员</Text>
|
||||
<Text>{return_phone}</Text>
|
||||
<Text>{orderInfo?.return_user_phone}</Text>
|
||||
{upLogistics&&<View className={styles.updateBtn} onClick={() => onLogistics?.(1)}>
|
||||
上传物流
|
||||
</View>
|
||||
|
@ -137,11 +137,10 @@ import styles from './index.module.scss'
|
||||
//显示记录
|
||||
const [applyRecord, setApplyRecord] = useState(false)
|
||||
|
||||
|
||||
return (
|
||||
<View className={styles.order_main}>
|
||||
<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}/>
|
||||
<OrderDes orderInfo={orderDetail}/>
|
||||
<AfterOrderBtns orderInfo={orderInfo} onClick={orderStateClick}/>
|
||||
|
@ -23,19 +23,30 @@
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.order_con {
|
||||
padding-left: 15px;
|
||||
width: 100%;
|
||||
.name {
|
||||
color: #000;
|
||||
font-weight: 700;
|
||||
font-size: $font_size;
|
||||
}
|
||||
.order_num {
|
||||
flex: 1;
|
||||
font-size: $font_size_medium;
|
||||
color: $color_font_one;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
.order_num_con{
|
||||
flex:1;
|
||||
}
|
||||
.miconfont {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.tag{
|
||||
font-size: $font_size_min;
|
||||
padding: 5px 15px;
|
||||
|
@ -73,14 +73,24 @@ export default memo(({value, onClickBtn}: Param) => {
|
||||
<View className={styles.header} onClick={() => goLink('/pages/salesAfter/index', {id: value?.id})}>
|
||||
<View className={styles.user}>
|
||||
<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 className={styles.order_num}>
|
||||
{/* <View className={styles.order_num}>
|
||||
<Text>售后单号:{value?.return_order_no}</Text>
|
||||
<Text className={classnames(styles.miconfont, 'iconfont, icon-a-moreback')}></Text>
|
||||
</View>
|
||||
<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 className={styles.product_con} onClick={() => goLink('/pages/salesAfter/index', {id: value?.id})}>
|
||||
<View className={styles.product_title}>
|
||||
<View className={styles.product_tag}>{value?.sale_mode_name}</View>
|
||||
|
Loading…
x
Reference in New Issue
Block a user