Merge branch 'dev' of ssh://git.online.zzfzyc.com:10022/mp/EShop into 样式对比
This commit is contained in:
commit
d734720dd1
@ -21,7 +21,7 @@ export const GetSaleOrderListApi = () => {
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消退货
|
||||
* 取消退货/退款
|
||||
*/
|
||||
export const ReturnApplyOrderCancelApi = () => {
|
||||
return useRequest({
|
||||
|
@ -139,10 +139,11 @@ export const toDecimal2 = (x) => {
|
||||
/**
|
||||
* 格式化图片路径
|
||||
* @param {*} url
|
||||
* @status true|false
|
||||
* @returns
|
||||
*/
|
||||
export const formatImgUrl = (url, suffix="!w200") => {
|
||||
return url?IMG_CND_Prefix + url + suffix:IMG_CND_Prefix +'/mall/no_img.png'
|
||||
export const formatImgUrl = (url, status = false ,suffix="!w200") => {
|
||||
return url? (status?IMG_CND_Prefix:'') +url + suffix:IMG_CND_Prefix +'/mall/no_img.png'
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -12,8 +12,9 @@ type Param = {
|
||||
orderInfo: {
|
||||
stage: number, //售后状态
|
||||
orderId: number, //订单id
|
||||
sale_mode: number //订单类型
|
||||
type: number //1退货,2退款
|
||||
sale_mode: number, //订单类型
|
||||
type: number, //1退货,2退款
|
||||
return_apply_order_id: number //售后申请单
|
||||
},
|
||||
onClick?: (val: number) => void, //点击后触发的事件,返回订单状态
|
||||
onBtnNull?: () => void //所有按钮都为空
|
||||
@ -110,22 +111,22 @@ export default memo(({orderInfo, onClick, onBtnNull}:Param) => {
|
||||
//点击按钮操作
|
||||
const submitBtns = (val, index) => {
|
||||
if (val == 1) {
|
||||
cancelOrder()
|
||||
cancelOrder({title:'要取消退货吗?'})
|
||||
} else if (val == 6) {
|
||||
receiveOrder()
|
||||
cancelOrder({title:'要取消退款吗?'})
|
||||
} else {
|
||||
onClick?.(val)
|
||||
}
|
||||
}
|
||||
|
||||
//取消退货
|
||||
//取消退货/退款
|
||||
const {fetchData: returnApplyOrderCancelFetchData} = ReturnApplyOrderCancelApi()
|
||||
const cancelOrder = () => {
|
||||
const cancelOrder = ({title = ''}) => {
|
||||
Taro.showModal({
|
||||
title: '要取消退货吗?',
|
||||
title,
|
||||
success: async function (res) {
|
||||
if (res.confirm) {
|
||||
let res = await returnApplyOrderCancelFetchData({id: orderInfo?.orderId})
|
||||
let res = await returnApplyOrderCancelFetchData({id: orderInfo?.return_apply_order_id})
|
||||
if(res.success) {
|
||||
alert.success('取消成功')
|
||||
onClick?.(1)
|
||||
@ -139,28 +140,6 @@ export default memo(({orderInfo, onClick, onBtnNull}:Param) => {
|
||||
})
|
||||
}
|
||||
|
||||
//确认订单
|
||||
const {fetchData: receiveOrderFetchData} = ReceiveOrderApi()
|
||||
const receiveOrder = async () => {
|
||||
console.log('123456')
|
||||
Taro.showModal({
|
||||
title: '确定收货?',
|
||||
success: async function (res) {
|
||||
if (res.confirm) {
|
||||
let res = await receiveOrderFetchData({sale_order_id: orderInfo?.orderId})
|
||||
if(res.success){
|
||||
onClick?.(6)
|
||||
alert.success('收货成功')
|
||||
} else {
|
||||
alert.error('收货失败')
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//显示更多按钮
|
||||
const [showMore, setShowMore] = useState(false)
|
||||
const styleTop = useMemo(() => {
|
||||
|
@ -23,7 +23,7 @@ export default ({list = []}: params) => {
|
||||
return (
|
||||
<View className={styles.swiper}>
|
||||
<Swiper className={styles.swiper_item} circular={true} onAnimationFinish={(e) => swiperChange(e)}>
|
||||
{list.map((item) => {
|
||||
{list?.map((item) => {
|
||||
return <SwiperItem key={item.id}>
|
||||
<View className={styles.image_item} >
|
||||
<Image mode="aspectFill" src={formatImgUrl(item)}></Image>
|
||||
|
@ -0,0 +1,48 @@
|
||||
|
||||
.advance_main{
|
||||
width:100%;
|
||||
height: 238px;
|
||||
background-color: #007AFF;
|
||||
border-radius: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 24px;
|
||||
color: #dddddd;
|
||||
position: relative;
|
||||
.time_con{
|
||||
padding-left: 30px;
|
||||
.times{
|
||||
margin-bottom: 25px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.text{
|
||||
margin-right: 15px;
|
||||
}
|
||||
.num{
|
||||
width: 46px;
|
||||
height: 50px;
|
||||
background: #0063ce;
|
||||
border-radius: 10px;
|
||||
line-height: 50px;
|
||||
text-align: center;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
}
|
||||
.separate{
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.cardIcon{
|
||||
width: 238px;
|
||||
height: 178px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
.image{
|
||||
width:100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
25
src/pages/order/components/advanceOrderState/index.tsx
Normal file
25
src/pages/order/components/advanceOrderState/index.tsx
Normal file
@ -0,0 +1,25 @@
|
||||
import { formatImgUrl } from "@/common/fotmat";
|
||||
import { Image, Text, View } from "@tarojs/components";
|
||||
import { memo } from "react";
|
||||
import styles from './index.module.scss'
|
||||
|
||||
export default memo(() => {
|
||||
return (
|
||||
<View className={styles.advance_main}>
|
||||
<View className={styles.time_con}>
|
||||
<View className={styles.times}>
|
||||
<Text className={styles.text}>剩</Text>
|
||||
<Text className={styles.num}>23</Text>
|
||||
<Text className={styles.separate}>:</Text>
|
||||
<Text className={styles.num}>58</Text>
|
||||
<Text className={styles.separate}>:</Text>
|
||||
<Text className={styles.num}>55</Text>
|
||||
</View>
|
||||
<Text>支付关闭,订单自动取消</Text>
|
||||
</View>
|
||||
<View className={styles.cardIcon}>
|
||||
<Image className={styles.image} src={formatImgUrl("/mall/my_cart.png", true)}/>
|
||||
</View>
|
||||
</View>
|
||||
)
|
||||
})
|
@ -17,6 +17,7 @@ import Taro, { useDidShow, usePullDownRefresh, useRouter } from "@tarojs/taro";
|
||||
import classnames from "classnames";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import AddressInfoDetail from "./components/addressInfoDetail";
|
||||
import AdvanceOrderState from "./components/advanceOrderState";
|
||||
import ApplyRefund from "./components/applyRefund";
|
||||
import KindList from "./components/kindList";
|
||||
import OrderState from "./components/orderState";
|
||||
@ -250,6 +251,7 @@ import styles from './index.module.scss'
|
||||
return (
|
||||
<View className={styles.order_main}>
|
||||
<OrderState orderInfo={orderDetail} onRefresh={refresh}/>
|
||||
{/* <AdvanceOrderState orderInfo={orderDetail} onRefresh={refresh}/> */}
|
||||
<View>
|
||||
<AddressInfoDetail orderInfo={defaultAddress} onLogistics={getLogistics} onSelect={getAddress} onChangeShipmentMode={getShipmentMode} ref={addressRef} />
|
||||
</View>
|
||||
|
@ -92,6 +92,7 @@ import styles from './index.module.scss'
|
||||
settle_mode: orderDetail?.settle_mode,
|
||||
type: orderDetail?.type, //退货or退款
|
||||
sale_mode: orderDetail?.sale_model, //订单类型
|
||||
return_apply_order_id: orderDetail?.return_apply_order_id
|
||||
}
|
||||
}, [orderDetail])
|
||||
|
||||
|
@ -99,7 +99,7 @@ const Header = memo((props: any) => {
|
||||
console.log(props, 'propsprops')
|
||||
let menu = [{ text: "待配布", icon: "icon-daipeibu", url: "/pages/orderList/index" }, { text: "待付款", icon: "icon-daifukuan", url: "/pages/orderList/index" },
|
||||
{ text: "待发货", icon: "icon-daifahuo", url: "/pages/orderList/index" }, { text: "已发货", icon: "icon-yifahuo", url: "/pages/orderList/index" },
|
||||
{ text: "退款/售后", icon: "icon-a-tuikuanshouhou", url: "/pages/orderList/index" }];
|
||||
{ text: "退款/售后", icon: "icon-a-tuikuanshouhou", url: "/pages/salesAfterList/index" }];
|
||||
const { getPhoneNumber } = useLogin();
|
||||
const mGetPhoneNumber = (ev) => {
|
||||
if (ev.detail?.code) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user