add cancel fix bug

main
wwl 2024-03-29 20:12:32 +08:00
parent 9e1051e2f2
commit 067e9892be
5 changed files with 51 additions and 25 deletions

View File

@ -173,18 +173,18 @@ export default class TradeItem extends Component {
<View className='trade-item__ft-actions'></View> <View className='trade-item__ft-actions'></View>
<View className='trade-item__ft-bd'> <View className='trade-item__ft-bd'>
{/* <Text className='trade-item__status'>{info.status_desc}</Text> */} {/* <Text className='trade-item__status'>{info.status_desc}</Text> */}
{false && (info.order_status_des === 'PAYED' || info.order_status_des === 'NOTPAY') && {(info.order_status_des === 'PAYED' || info.order_status_des === 'NOTPAY') &&
info.can_apply_cancel != 0 && info.can_apply_cancel != 0 &&
!info.is_logistics && !info.is_logistics &&
(info.receipt_type !== 'dada' || (info.dada && info.dada.dada_status === 0)) ? ( (info.receipt_type !== 'dada' || (info.dada && info.dada.dada_status === 0)) ? (
<Button <Button
className='btn-action' className='btn-action'
style={`box-shadow: 0 0 0 1PX ${colors.data[0].primary}; color: ${colors.data[0].primary}`} style={`box-shadow: 0 0 0 1PX ${colors.data[0].primary}; color: ${colors.data[0].primary}`}
// onClick={this.handleClickBtn.bind(this, 'cancel')} onClick={this.handleClickBtn.bind(this, 'cancel')}
onClick={this.clickToEditAddress.bind(this)} // onClick={this.clickToEditAddress.bind(this)}
> >
{/* 取消订单 */} 取消订单
修改地址 {/* 修改地址 */}
</Button> </Button>
) : null} ) : null}
{info.pay_status === 'PAYED' && {info.pay_status === 'PAYED' &&

View File

@ -304,6 +304,7 @@ export default class TradeDetail extends Component {
tradeInfo, tradeInfo,
distributor: data.distributor distributor: data.distributor
}) })
console.log("🚀 ~ file: detail.js:307 ~ TradeDetail ~ info:", info)
} }
handleCopy = async () => { handleCopy = async () => {
@ -468,8 +469,12 @@ export default class TradeDetail extends Component {
// Taro.navigateTo({ // Taro.navigateTo({
// url: `/subpage/pages/trade/after-sale-detail?id=${info.tid}` // url: `/subpage/pages/trade/after-sale-detail?id=${info.tid}`
// }) // })
let url = `/subpages/trade/after-sale?id=${info.tid}`
if (info.status === "WAIT_SELLER_SEND_GOODS") {
url += '&type=ONLY_REFUND'
}
Taro.navigateTo({ Taro.navigateTo({
url: `/subpages/trade/after-sale?id=${info.tid}` url
}) })
return return
} }
@ -756,7 +761,7 @@ export default class TradeDetail extends Component {
</View> </View>
)} )}
<ScrollView scroll-y className='scroll-view' style={{ bottom: info.status === 'WAIT_BUYER_PAY' || info.can_apply_aftersales === 1 || info.status === 'WAIT_BUYER_CONFIRM_GOODS' ? '140rpx' : '40rpx' }} scrollIntoView={scrollIntoView}> <ScrollView scroll-y className='scroll-view' style={{ bottom: info.status === 'WAIT_BUYER_PAY' || info.can_apply_aftersales === 1 || info.status === 'WAIT_BUYER_CONFIRM_GOODS' || info.status === "WAIT_SELLER_SEND_GOODS" ? '150rpx' : '40rpx' }} scrollIntoView={scrollIntoView}>
{false && <View className='trade-detail-header' id='order-0'> {false && <View className='trade-detail-header' id='order-0'>
<View className='trade-detail-waitdeliver'> <View className='trade-detail-waitdeliver'>
{info.is_logistics && <View className='oneline'>线上订单</View>} {info.is_logistics && <View className='oneline'>线上订单</View>}
@ -1222,7 +1227,8 @@ export default class TradeDetail extends Component {
// !VERSION_IN_PURCHASE && // !VERSION_IN_PURCHASE &&
// !this.isPointitemGood() && ( // !this.isPointitemGood() && (
// 先禁止掉!!! // 先禁止掉!!!
info.can_apply_aftersales === 1 && ( // info.status === 'WAIT_SELLER_SEND_GOODS' || 未发货的
(info.can_apply_aftersales === 1) ? (
<View <View
className={`trade-detail__footer__btn ${info.is_logistics && className={`trade-detail__footer__btn ${info.is_logistics &&
'trade-detail__footer_active trade-detail__footer_allWidthBtn' 'trade-detail__footer_active trade-detail__footer_allWidthBtn'
@ -1231,8 +1237,21 @@ export default class TradeDetail extends Component {
> >
申请售后 申请售后
</View> </View>
) ) : <></>
} }
{!info.is_logistics &&
info.can_apply_cancel != 0 &&
(info.status === 'WAIT_BUYER_PAY' ||
(info.status === 'WAIT_SELLER_SEND_GOODS' &&
info.order_status_des !== 'PAYED_WAIT_PROCESS' &&
info.order_status_des !== 'PAYED_PARTAIL')) &&
(info.receipt_type !== 'dada' || (info.dada && info.dada.dada_status === 0)) && (
<View className={`trade-detail__footer__btn ${info.is_logistics &&
'trade-detail__footer_active trade-detail__footer_allWidthBtn'
}`} onClick={this.handleClickBtn.bind(this, 'cancel')}>
取消订单
</View>
)}
{ {
// 继续购物 先禁止掉!!! // 继续购物 先禁止掉!!!
false && (info.status === 'WAIT_SELLER_SEND_GOODS' || false && (info.status === 'WAIT_SELLER_SEND_GOODS' ||

View File

@ -26,7 +26,7 @@ $paddingBottom: 100px;
} }
.scroll-view { .scroll-view {
@include page-scroll(calc(var(--nav-height) + 16px), 140px); @include page-scroll(calc(var(--nav-height) + 16px), 190px);
} }
&.has-navbar { &.has-navbar {
@ -456,13 +456,14 @@ $paddingBottom: 100px;
position: fixed; position: fixed;
left: 0; left: 0;
width: 100%; width: 100%;
height: 100px; height: 150px;
// bottom: $edge-margin; // bottom: $edge-margin;
bottom: 0; bottom: 0;
background: #fff; background: #fff;
display: flex; display: flex;
justify-content: space-evenly; justify-content: space-evenly;
align-items: center; align-items: center;
z-index: 10;
&__btn { &__btn {
width: 338px; width: 338px;
height: 80px; height: 80px;

View File

@ -57,6 +57,12 @@ function TradeAfterSale (props) {
refundStore, contact, mobile, afterSaleDesc, offlineAftersalesIsOpen, offlineAftersales, afterSaleTotalNum, allClicked, afterSaleTotalprice, loading, isOpened, isAddrOpened, aftersales, expressList, corpIndex, logi_no } = state refundStore, contact, mobile, afterSaleDesc, offlineAftersalesIsOpen, offlineAftersales, afterSaleTotalNum, allClicked, afterSaleTotalprice, loading, isOpened, isAddrOpened, aftersales, expressList, corpIndex, logi_no } = state
useEffect(() => { useEffect(() => {
const { id, type } = $instance.router.params
if (type) {
setState(v => {
v.curTabIdx = tabList.findIndex(item => item.type == type)
})
}
fetch() fetch()
Taro.eventCenter.on('onEventPickerStore', (item) => { Taro.eventCenter.on('onEventPickerStore', (item) => {
console.log('onEventPickerStore:', item) console.log('onEventPickerStore:', item)
@ -227,7 +233,7 @@ function TradeAfterSale (props) {
} }
const onSubmit = async () => { const onSubmit = async () => {
const { id } = $instance.router.params const { id, type } = $instance.router.params
const checkedItems = info?.items.filter(item => !!item.checked) const checkedItems = info?.items.filter(item => !!item.checked)
if (checkedItems.length == 0) { if (checkedItems.length == 0) {
return showToast('请选择需要售后的商品') return showToast('请选择需要售后的商品')
@ -236,7 +242,7 @@ function TradeAfterSale (props) {
if (!reasons?.[reasonIndex]) { if (!reasons?.[reasonIndex]) {
return showToast('请选择退货原因') return showToast('请选择退货原因')
} }
const aftersales_type = tabList[curTabIdx].type let aftersales_type = tabList[curTabIdx].type
const reason = reasons?.[reasonIndex] const reason = reasons?.[reasonIndex]
let params = { let params = {
detail: checkedItems.map(({ id: _id, refundNum, num }) => { detail: checkedItems.map(({ id: _id, refundNum, num }) => {

View File

@ -51,7 +51,7 @@
} }
} }
.btn-wrap { .btn-wrap {
padding: 50px; padding: 20rpx 50px;
// margin-bottom: 100px; // margin-bottom: 100px;
.at-button__text { .at-button__text {
font-size: 36px; font-size: 36px;