import React, { Component } from 'react'
import Taro, { getCurrentInstance } from '@tarojs/taro'
import { View, Text, Button, Image, ScrollView } from '@tarojs/components'
import { connect } from 'react-redux'
import { AtCountdown, AtCurtain } from 'taro-ui'
import { Loading, SpNavBar, FloatMenuMeiQia, SpNewShopItem, SpPage, SpPrice, SpImage } from '@/components'
import {
log,
pickBy,
formatDateTime,
payPlatform,
resolveOrderStatus,
copyText,
getCurrentRoute,
isAlipay,
classNames,
isNavbar,
isWeb,
redirectUrl,
VERSION_PLATFORM,
VERSION_IN_PURCHASE,
isAPP,
isWxWeb,
isWeixin
} from '@/utils'
import { transformTextByPoint } from '@/utils/helper'
import { PAYTYPE, PAYMENT_TYPE } from '@/consts'
import { Tracker } from '@/service'
import api from '@/api'
import { TracksPayed } from '@/utils/youshu'
import S from '@/spx'
import { usePayment } from '@/hooks'
import DetailItem from './comps/detail-item'
// 图片引入
import ErrorDaDa from '../../assets/dada0.png'
import WaitStore from '../../assets/dada1.png'
import WaitDaDa from '../../assets/dada2.png'
import OnRoad from '../../assets/dada4.png'
import Cancel from '../../assets/dada5.png'
import Success from '../../assets/dada6.png'
import DadaGoStore from '../../assets/dada7.png'
import './detail.scss'
// 订单状态和图片匹配
const statusImg = {
// 等待商家接单
0: WaitStore,
// 等待骑手接单
1: WaitDaDa,
2: WaitDaDa,
// 配送中
3: OnRoad,
// 已完成
4: Success,
// 订单取消
5: Cancel,
// 投递异常
9: ErrorDaDa,
10: Success,
// 骑士到店
100: DadaGoStore
}
@connect(({ colors, sys }) => ({
colors: colors.current,
pointName: sys.pointName,
priceSetting: sys.priceSetting
}))
export default class TradeDetail extends Component {
$instance = getCurrentInstance()
constructor(props) {
super(props)
this.state = {
info: null,
timer: null,
payLoading: false,
sessionFrom: '',
interval: null,
webSocketIsOpen: false,
restartOpenWebsoect: true,
// selections:[],
scrollIntoView: 'order-0',
cancelData: {},
tradeInfo: {},
showQRcode: false,
distributor: {},
showDeliveryModal: false,
deliveryList: []
}
}
componentWillUnmount () {
clearInterval(this.state.interval)
}
componentDidShow () {
this.fetch()
}
isPointitemGood () {
const options = this.$instance.router.params
return options.type === 'pointitem'
}
calcTimer (totalSec) {
let remainingSec = totalSec
const dd = Math.floor(totalSec / 24 / 3600)
remainingSec -= dd * 3600 * 24
const hh = Math.floor(remainingSec / 3600)
remainingSec -= hh * 3600
const mm = Math.floor(remainingSec / 60)
remainingSec -= mm * 60
const ss = Math.floor(remainingSec)
return {
dd,
hh,
mm,
ss
}
}
async fetch () {
const { id } = this.$instance.router.params
const data = await api.trade.detail(id)
let sessionFrom = ''
const pickItem = {
order_id: 'order_id',
item_id: 'id',
good_id: 'item_id',
// aftersales_status: ({ aftersales_status }) => AFTER_SALE_STATUS[aftersales_status],
delivery_code: 'delivery_code',
delivery_corp: 'delivery_corp',
delivery_name: 'delivery_corp_name',
delivery_status: 'delivery_status',
delivery_type: 'delivery_type',
delivery_time: 'delivery_time',
aftersales_status: 'aftersales_status',
pic_path: 'pic',
title: ({ item_name }) => item_name,
type: 'type',
delivery_status: 'delivery_status',
origincountry_name: 'origincountry_name',
origincountry_img_url: 'origincountry_img_url',
price: ({ total_fee }) => (total_fee / 100).toFixed(2),
total_fee_new: ({ total_fee_new }) => (total_fee_new / 100).toFixed(2),
market_price: ({ market_price }) => (market_price / 100).toFixed(2),
point: 'item_point',
item_point: 'item_point',
num: 'num',
left_aftersales_num: 'left_aftersales_num',
item_spec_desc: 'item_spec_desc',
order_item_type: 'order_item_type',
show_aftersales: 'show_aftersales',
distributor_id: 'distributor_id'
}
const info = pickBy(data.orderInfo, {
tid: 'order_id',
created_time_str: ({ create_time }) => formatDateTime(create_time * 1000),
update_time_str: ({ update_time }) => formatDateTime(update_time * 1000),
auto_cancel_seconds: 'auto_cancel_seconds',
receiver_name: 'receiver_name',
receiver_mobile: 'receiver_mobile',
receiver_state: 'receiver_state',
estimate_get_points: 'estimate_get_points',
discount_fee: ({ discount_fee }) => (+discount_fee / 100).toFixed(2),
point_fee: ({ point_fee }) => (+point_fee / 100).toFixed(2),
point_use: 'point_use',
mobile: 'mobile',
dada: ({ dada }) => {
return dada
},
receiver_city: 'receiver_city',
receiver_district: 'receiver_district',
receiver_address: 'receiver_address',
status_desc: 'order_status_msg',
delivery_code: ({ order_delivery = {} }) => {
const { delivery_code, delivery_corp, delivery_corp_name, delivery_id } = order_delivery.list?.[0] || {}
return delivery_code
},
delivery_name: ({ order_delivery = {} }) => {
const { delivery_code, delivery_corp, delivery_corp_name, delivery_id } = order_delivery.list?.[0] || {}
return delivery_corp_name
},
delivery_type: 'delivery_type',
delivery_status: 'delivery_status',
pay_status: 'pay_status',
distributor_id: 'distributor_id',
receipt_type: 'receipt_type',
ziti_status: 'ziti_status',
qrcode_url: 'qrcode_url',
delivery_corp: 'delivery_corp',
order_type: 'order_type',
order_status_msg: 'order_status_msg',
order_status_des: 'order_status_des',
order_class: 'order_class',
is_all_delivery: 'is_all_delivery',
latest_aftersale_time: 'latest_aftersale_time',
remark: 'remark',
type: 'type',
is_shopscreen: 'is_shopscreen',
is_logistics: 'is_split',
total_tax: ({ total_tax }) => (+total_tax / 100).toFixed(2),
item_fee: ({ item_fee }) => (+item_fee / 100).toFixed(2),
total_fee: ({ total_fee }) => (+total_fee / 100).toFixed(2),
coupon_discount: ({ coupon_discount }) => (+coupon_discount / 100).toFixed(2),
freight_fee: ({ freight_fee }) => (+freight_fee / 100).toFixed(2),
freight_type: 'freight_type',
totalpayment: ({ total_fee }) => (+Number(total_fee) / 100).toFixed(2),
payment: ({ pay_type, total_fee }) =>
pay_type === 'point' ? Math.floor(total_fee) : (+total_fee / 100).toFixed(2), // 积分向下取整
pay_type: 'pay_type',
pay_channel: 'pay_channel',
pickupcode_status: 'pickupcode_status',
invoice_content: 'invoice.content',
delivery_status: 'delivery_status',
point: 'point',
item_point: pickItem.item_point,
can_apply_aftersales: 'can_apply_aftersales',
status: ({ order_status }) => resolveOrderStatus(order_status),
orders: ({ items = [], logistics_items = [], is_split }) =>
pickBy(is_split ? logistics_items : items, pickItem),
log_orders: ({ items = [] }) => pickBy(items, pickItem),
can_apply_cancel: 'can_apply_cancel',
market_fee: ({ market_fee }) => market_fee / 100,
item_fee_new: ({ item_fee_new }) => item_fee_new / 100,
promotion_discount: ({ promotion_discount }) => promotion_discount / 100,
ziti_info: 'ziti_info',
timer: ({ auto_cancel_seconds }) => auto_cancel_seconds > 0 ? this.calcTimer(auto_cancel_seconds) : null
})
const delivery = data.order_delivery?.list?.[0] || {}
info.delivery_corp_name = delivery.delivery_corp_name
info.delivery_corp = delivery.delivery_corp
info.delivery_code = delivery.delivery_code
const ziti = pickBy(data.distributor, {
store_name: 'store_name',
store_address: 'store_address',
store_name: 'store_name',
hour: 'hour',
phone: 'mobile'
})
const cancelData = data.cancelData
const tradeInfo = data.tradeInfo
if (info.receipt_type == 'ziti' && info.ziti_status === 'PENDING') {
const { qrcode_url, pickup_code } = await api.trade.zitiCode({ order_id: id })
this.setState(
{
qrcode: qrcode_url,
pickup_code: pickup_code
},
() => {
const interval = setInterval(async () => {
const { qrcode_url, pickup_code } = await api.trade.zitiCode({ order_id: id })
this.setState({
qrcode: qrcode_url,
pickup_code: pickup_code
})
}, 60000)
this.setState(
{
interval
},
() => {
this.zitiWebsocket()
}
)
}
)
}
let timer = null
if (info.auto_cancel_seconds) {
timer = this.calcTimer(info.auto_cancel_seconds)
this.setState({
timer
})
}
const infoStatus = (info.status || '').toLowerCase()
if (info.auto_cancel_seconds <= 0 && info.order_status_des === 'NOTPAY') {
info.status = 'TRADE_CLOSED'
info.order_status_msg = '已取消'
}
info.status_img = `ico_${infoStatus === 'trade_success' ? 'wait_rate' : infoStatus}.png`
sessionFrom += '{'
if (Taro.getStorageSync('userinfo')) {
sessionFrom += `"nickName": "${Taro.getStorageSync('userinfo').username}", `
}
sessionFrom += `"商品": "${info.orders[0].title}"`
sessionFrom += `"订单号": "${info.orders[0].order_id}"`
sessionFrom += '}'
this.setState({
info,
sessionFrom,
ziti,
cancelData,
tradeInfo,
distributor: data.distributor
})
}
handleCopy = async () => {
const { info } = this.state
const msg = `收货人:${info.receiver_name} ${info.receiver_mobile}
收货地址:${info.receiver_state}${info.receiver_city}${info.receiver_district}${info.receiver_address}
订单编号:${info.tid}
创建时间:${info.created_time_str}
`
await copyText(msg)
}
async handlePay () {
const { info } = this.state
// this.setState({
// payLoading: true
// })
// const { tid: order_id, order_type, pay_type } = info
// const paymentParams = {
// pay_type,
// order_id,
// order_type
// }
// const config = await api.cashier.getPayment(paymentParams)
// this.setState({
// payLoading: false
// })
const { tid: order_id, order_type, pay_type, pay_channel, activity_type } = info
if (isWxWeb) {
Taro.navigateTo({
url: `/pages/cart/cashier-weapp?order_id=${order_id}`
})
return
}
let payErr
try {
const params = {
activityType: activity_type,
pay_channel: pay_channel,
pay_type: pay_type
}
const orderInfo = {
order_id,
order_type: order_type,
pay_type
}
const paymentFn = usePayment()
paymentFn.cashierPayment(params, orderInfo)
} catch (e) {
console.error(e)
payErr = e
}
// try {
// if (isAPP()) {
// const AppPayType = {
// alipayapp: 'alipay',
// wxpayapp: 'wxpay'
// }
// try {
// await Taro.SAPPPay.payment({
// id: AppPayType[pay_type],
// order_params: config.config
// })
// } catch (e) {
// console.error(e)
// payErr = e
// }
// } else {
// // const resObj = await payPlatform(config)
// const { cashierPayment } = usePayment()
// cashierPayment(params, orderInfo)
// payErr = resObj.payErr
// // 支付上报
// log.debug(`[order pay]: `, resObj.payRes)
// }
// } catch (e) {
// payErr = e
// if (e.errMsg.indexOf('cancel') < 0) {
// Taro.showToast({
// title: e.err_desc || e.errMsg || '支付失败',
// icon: 'none'
// })
// } else {
// Tracker.dispatch('CANCEL_PAY', {
// ...info,
// item_fee: parseInt(info.item_fee) * 100,
// total_fee: parseInt(info.total_fee) * 100,
// ...config,
// timeStamp: config.order_info.create_time
// })
// }
// }
// if (!payErr) {
// await Taro.showToast({
// title: '支付成功',
// icon: 'success'
// })
// const { fullPath } = getCurrentRoute(this.$instance.router)
// Taro.redirectTo({
// url: fullPath
// })
// }
}
async handleClickBtn (type, e) {
e.stopPropagation()
const { info } = this.state
if (type === 'home') {
if (this.isPointitemGood()) {
Taro.redirectTo({
url: '/subpages/pointshop/list'
})
return
}
Taro.redirectTo({
url: process.env.APP_HOME_PAGE
})
return
}
if (type === 'pay') {
await this.handlePay()
return
}
if (type === 'cancel') {
Taro.navigateTo({
url: `/subpage/pages/trade/cancel?order_id=${info.tid}`
})
return
}
if (type === 'confirm') {
const { confirm } = await Taro.showModal({
title: '确认收货?',
content: ''
})
if (confirm) {
await api.trade.confirm(info.tid)
if (isWeixin || isAlipay) {
const { fullPath } = getCurrentRoute(this.$instance.router)
Taro.redirectTo({
url: fullPath
})
} else {
const { path } = this.$instance.router
Taro.redirectTo({
url: path
})
}
}
return
}
if (type === 'aftersales') {
// Taro.navigateTo({
// url: `/subpage/pages/trade/after-sale-detail?id=${info.tid}`
// })
Taro.navigateTo({
url: `/subpages/trade/after-sale?id=${info.tid}`
})
return
}
}
async handleClickRefund (type, item_id) {
const {
info: { tid: order_id }
} = this.state
if (type === 'refund') {
Taro.navigateTo({
url: `/subpage/pages/trade/refund?order_id=${order_id}&item_id=${item_id}`
})
} else if (type === 'refundDetail') {
Taro.navigateTo({
url: `/subpage/pages/trade/refund-detail?order_id=${order_id}&item_id=${item_id}`
})
}
}
handleClickDelivery = async (flag) => {
if (flag) {
Taro.showLoading({ title: '' })
let { delivery_type, delivery_id, order_type, tid: order_id } = this.state.info
console.log("🚀 ~ TradeDetail ~ delivery_type, delivery_id, order_type, tid: order_id:", delivery_type, delivery_id, order_type, order_id)
let list = []
if (delivery_type !== 'new') {
list = await api.trade.deliveryInfoNew({ delivery_id })
} else {
list = await api.trade.deliveryInfo(order_type, order_id)
}
const nList = pickBy(list, {
title: 'AcceptStation',
content: ({ AcceptTime }) => AcceptTime ? AcceptTime.substring(5, 16) : ''
})
this.setState({
deliveryList: nList
})
}
this.setState({ showDeliveryModal: flag })
Taro.hideLoading()
// Taro.navigateTo({
// url: `/subpage/pages/trade/delivery-info?order_type=${this.state.info.order_type}&order_id=${this.state.info.tid}&delivery_code=${this.state.info.delivery_code}&delivery_corp=${this.state.info.delivery_corp}&delivery_name=${this.state.info.delivery_name}`
// })
}
handleClickCopy = (val) => {
copyText(val)
Taro.showToast({
title: '复制成功',
icon: 'none'
})
}
countDownEnd = () => {
this.fetch()
}
zitiWebsocket = () => {
const { id } = this.$instance.router.params
const { webSocketIsOpen, restartOpenWebsoect } = this.state
// websocket 开始
if (!webSocketIsOpen) {
const token = S.getAuthToken()
Taro.connectSocket({
url: process.env.APP_WEBSOCKET,
header: {
'content-type': 'application/json',
'authorization': `Bearer ${token}`,
'guard': 'h5api',
'x-wxapp-sockettype': 'orderzitimsg'
},
method: 'GET'
}).then((task) => {
task.onOpen(() => {
this.setState({
webSocketIsOpen: true
})
})
task.onError(() => {
this.setState({
webSocketIsOpen: false
})
})
task.onMessage((res) => {
if (res.data === '401001') {
Taro.showToast({
title: '未登录,请登录后再试',
icon: 'none'
})
this.setState(
{
webSocketIsOpen: false
},
() => {
setTimeout(() => {
Taro.redirectTo({
url: '/subpages/member/index'
})
}, 700)
}
)
} else {
const result = JSON.parse(res.data)
if (result.status === 'success') {
Taro.showToast({
title: '核销成功',
icon: 'none'
})
setTimeout(() => {
this.fetch()
}, 700)
}
}
})
task.onClose(() => {
this.setState({
webSocketIsOpen: false
})
if (restartOpenWebsoect) {
this.restartOpenWebsocket()
}
})
})
}
}
handleLookDelivery = (value) => {
let { info } = this.state
Taro.navigateTo({
url: `/subpage/pages/trade/split-bagpack?order_type=${info.order_type}&order_id=${info.tid}`
})
}
restartOpenWebsocket = () => {
const { restartOpenWebsoect } = this.state
this.setState(
{
restartOpenWebsoect: false
},
() => {
const token = S.getAuthToken()
Taro.connectSocket({
url: process.env.APP_WEBSOCKET,
header: {
'content-type': 'application/json',
'x-wxapp-session': token,
'x-wxapp-sockettype': 'orderzitimsg'
},
method: 'GET'
}).then((task) => {
task.onOpen(() => {
this.setState({
restartOpenWebsoect: true
})
})
})
}
)
}
// 发送验证码
sendCode = async () => {
Taro.showLoading({
title: '发送中',
mask: true
})
const { info } = this.state
const res = await api.trade.sendCode(info.tid)
Taro.showToast({
title: `${res.status ? '发送成功' : '发送失败'}`,
icon: 'none'
})
}
scrollInto = (id) => {
this.setState({
scrollIntoView: id
})
}
// 拨打电话
callDada = (mobile) => {
Taro.makePhoneCall({
phoneNumber: mobile
})
}
// 复制orderid
copyOrderId = (orderid) => {
copyText(orderid)
Taro.showToast({
title: '复制成功',
icon: 'none'
})
}
handleImgClick = (val) => {
this.setState({
showQRcode: val
})
}
computedPayType = () => {
const {
info: { pay_type }
} = this.state
return PAYMENT_TYPE[pay_type]
// if (isAlipay) {
// return '支付宝'
// } else if (pay_type === PAYTYPE.ALIH5) {
// return '支付宝'
// } else {
// return '微信'
// }
}
render () {
const { colors } = this.props
const {
info,
ziti,
qrcode,
timer,
payLoading,
scrollIntoView,
cancelData,
tradeInfo,
showQRcode,
pickup_code,
distributor,
showDeliveryModal,
deliveryList
} = this.state
if (!info) {
return
}
//订单未支付
const NOT_PAY = tradeInfo && tradeInfo.tradeState === 'NOTPAY'
//const isDhPoint = info.point_fee!=0?'point':''
const isDhPoint = info.pay_type === 'point'
// 是否为余额支付
const isDeposit = info.pay_type === 'deposit'
// const isHf = info.pay_type === 'hfpay'
const meiqia = Taro.getStorageSync('meiqia')
const echat = Taro.getStorageSync('echat')
// TODO: orders 多商铺
// const tradeOrders = resolveTradeOrders(info)
const { order_page } = this.props.priceSetting
const { market_price: enMarketPrice } = order_page
return (
{/* */}
{info.is_logistics && (
线上订单
线下订单
)}
{false &&
{info.is_logistics && 线上订单}
{info.status === 'WAIT_BUYER_PAY' && (
该订单将为您保留
0}
onTimeUp={this.countDownEnd.bind(this)}
/>
分钟
)}
{info.status !== 'WAIT_BUYER_PAY' && (
{info.order_status_msg}
{info.dada && info.dada.id && statusImg[info.dada.dada_status] && (
)}
{(!info.dada || !info.dada.id) && (
{info.status === 'WAIT_SELLER_SEND_GOODS' ? '正在审核订单' : null}
{info.status === 'WAIT_BUYER_CONFIRM_GOODS' ? '正在派送中' : null}
{info.status === 'TRADE_CLOSED' ? '订单已取消' : null}
)}
)}
}
{info.dada && info.dada.id && info.dada.dada_status > 1 && info.dada.dada_status !== 5 && (
骑手:{info.dada.dm_name}
本单由达达同城为您服务
)}
{info.receipt_type === 'ziti' && !info.is_logistics && (
{info.status === 'WAIT_SELLER_SEND_GOODS' && info.ziti_status === 'PENDING' && (
{
this.handleImgClick(true)
}}
>
{info.pickupcode_status && (
{pickup_code}
{/*
发送提货码
*/}
提货时请出告知店员提货验证码
)}
)}
)}
{/*
{info.dada && info.dada.id && (
{ziti.store_name}
{ziti.store_address}
营业时间:
{ziti.hour}
门店电话:
{ziti.phone}
)}
{
info.receipt_type === 'ziti' && info.ziti_info && (
自提点:{info.ziti_info.name}
自提地址:{`${info.ziti_info.province}${info.ziti_info.city}${info.ziti_info.area}${info.ziti_info.address}`}
联系电话:{`${info.ziti_info.contract_phone}`}
提货人:{info.receiver_name}
提货时间:{`${info.ziti_info.pickup_date} ${info.ziti_info.pickup_time[0]}-${info.ziti_info.pickup_time[1]}`}
提货人手机:{info.receiver_mobile}
)
}
{((info.dada && info.dada.id) || info.receipt_type === 'logistics') && (
{info.receiver_state}
{info.receiver_city}
{info.receiver_district}
{info.receiver_address}
{info.receiver_name}
{!this.isPointitemGood() && {info.receiver_mobile}}
)}
*/}
{VERSION_PLATFORM && (
)}
订单编号
{info.tid}
复制
订单时间
{info.created_time_str}
{info.order_status_msg}
收货地址
{info.receiver_state}
{info.receiver_city}
{info.receiver_district}
{info.receiver_address}
{info.receiver_name}
{!this.isPointitemGood() && {info.receiver_mobile}}
{!!info.delivery_code && <>
物流信息
this.handleClickDelivery(true)}>查看详情
物流单号:{info.delivery_code}
物流公司:{info.delivery_corp_name}
>}
支付方式
{isDeposit ? '余额支付' : '微信支付'}
订单金额
{/* {transformTextByPoint(this.isPointitemGood(), info.item_fee_new, info.item_point)} */ console.log(transformTextByPoint(this.isPointitemGood(), info.item_fee_new, info.item_point), '-------')}
优惠金额
{/* 促销 + 优惠券 */}
{/* {`¥${parseFloat(info.promotion_discount + info.coupon_discount).toFixed(2)}`} */}
运费
{info.freight_type !== 'point'
?
: `${info.freight_fee * 100}${this.props.pointName}`}
订单总计
{info.is_logistics && (
{info.status === 'WAIT_BUYER_CONFIRM_GOODS' &&
(info.is_all_delivery ||
(!info.is_all_delivery && info.delivery_status === 'DONE')) && (
确认收货
)}
)}
{info.is_logistics && (
线下订单
销售门店:{ziti.store_name}
购买者:{info.mobile}
)}
{/* */}
{/*
总计:
{this.isPointitemGood() ? (
{info.point} {this.props.pointName}
{info.order_class === 'pointsmall' &&
info.freight_fee != 0 &&
info.freight_fee > 0 &&
info.freight_type !== 'point' && + {info.freight_fee}}
) : (
¥{info.totalpayment}
)}
*/}
{/* {!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)) && (
取消订单
)} */}
{/* */}
{/* {info.remark && (
订单备注
{info.remark}
)} */}
{false &&
下单时间
{info.created_time_str}
{tradeInfo && tradeInfo.tradeState === 'SUCCESS' && (
支付时间
{tradeInfo.payDate}
)}
{info.status === 'TRADE_CLOSED' && (
取消时间
{info.update_time_str}
)}
{info.dada && info.dada.pickup_time > 0 && (
取货时间
{formatDateTime(Number(info.dada.pickup_time))}
)}
{info.dada && info.dada.delivered_time > 0 && (
送达时间
{formatDateTime(Number(info.dada.delivered_time))}
)}
{info.dada && (info.dada.dada_status === 10 || info.dada.dada_status === 4) && (
配送时长
{info.dada.delivery_length}
)}
{info.invoice_content && (
发票信息
{info.invoice_content}
)}
{enMarketPrice && info.market_fee > 0 && (
原价
{`¥${info.market_fee}`}
)}
总价
{transformTextByPoint(this.isPointitemGood(), info.item_fee_new, info.item_point)}
运费
{info.freight_type !== 'point'
? `¥${info.freight_fee}`
: `${info.freight_fee * 100}${this.props.pointName}`}
促销
{`- ¥${info.promotion_discount}`}
优惠券
{`- ¥${info.coupon_discount}`}
{info.type == '1' && (
税费
{`¥${info.total_tax}`}
)}
{/* {!this.isPointitemGood() && (
优惠
{`- ¥${info.discount_fee}`}
)} */}
{info.point_use > 0 && (
{`${this.props.pointName}支付`}
{`${info.point_use} ${this.props.pointName},抵扣: ¥${info.point_fee}`}
)}
{isDeposit && (
支付
{`¥${info.payment} 余额支付`}
)}
{!isDhPoint && !isDeposit && !NOT_PAY && (
支付
{`¥${info.payment} ${info.order_class !== 'excard' ? this.computedPayType() : ''
}`}
)}
实付
{`${this.isPointitemGood() ? info.point + '积分' : `¥${info.totalpayment}`
}`}
{info.delivery_code && (
物流单号
{info.delivery_code}
查看物流
)}
}
{cancelData.cancel_id && (
取消理由:
{cancelData.cancel_reason}
)}
{info.status !== 'TRADE_CLOSED' && (
{
// 立即支付
info.status === 'WAIT_BUYER_PAY' && (
)
}
{
// 申请售后
// (info.status === 'WAIT_SELLER_SEND_GOODS' ||
// (info.status === 'TRADE_SUCCESS' &&
// (info.receipt_type !== 'dada' ||
// info.dada.dada_status === 4 ||
// info.dada.dada_status === 10)) ||
// (info.status === 'WAIT_BUYER_CONFIRM_GOODS' &&
// (info.is_all_delivery || info.delivery_status == 'PARTAIL') &&
// info.receipt_type !== 'dada')) &&
// info.can_apply_aftersales === 1 &&
// info.order_class !== 'excard' &&
// !VERSION_IN_PURCHASE &&
// !this.isPointitemGood() && (
// 先禁止掉!!!
info.can_apply_aftersales === 1 && (
申请售后
)
}
{
// 继续购物 先禁止掉!!!
false && (info.status === 'WAIT_SELLER_SEND_GOODS' ||
(info.status === 'WAIT_BUYER_CONFIRM_GOODS' &&
info.receipt_type === 'dada' &&
info.receipt_type !== 'dada') ||
info.dada.dada_status !== 9) && (
继续购物
)
}
{
// 确认收货
info.order_class !== 'excard' &&
info.receipt_type !== 'dada' &&
!info.is_logistics &&
info.status === 'WAIT_BUYER_CONFIRM_GOODS' &&
(info.is_all_delivery ||
(!info.is_all_delivery && info.delivery_status === 'DONE')) && (
确认收货
)
}
{/* {
// 联系客服
(info.status === 'TRADE_SUCCESS' ||
(info.receipt_type === 'dada' && info.dada.dada_status === 9)) &&
info.order_class !== 'excard' && !isWeb && (
{meiqia.is_open === 'true' || echat.is_open === 'true' ? (
联系客服
) : (
()
)}
)
} */}
)}
{showQRcode && (
{
this.handleImgClick(false)
}}
>
)}
{
this.handleClickDelivery(false)
}}
>
物流信息
{info.delivery_corp_name}:{info.delivery_code}
{deliveryList.map((item, index) =>
{item.content}
{item.title}
)}
)
}
}