Compare commits

..

No commits in common. "37a7089aa94ef79c663264e1382c01adbe683b13" and "82a04ee96fc46d229cbfb660b27509fff828dc67" have entirely different histories.

74 changed files with 1036 additions and 2842 deletions

View File

@ -58,8 +58,7 @@ export function getUserCardList (params = {}) {
}
export function homeCouponList(params = {}) {
// return req.get('/getCardList', params)
return req.get('/getRedeemDiscountCardList', params) //积分兑换优惠券列表
return req.get('/getCardList', params)
}
export function homeCouponGet(params = {}) {
@ -67,8 +66,7 @@ export function homeCouponGet (params = {}) {
}
export function getCardDetail(params = {}) {
// return req.get('/user/getCardDetail', params)
return req.post('/user/receiveCardByPoint', params) //积分换优惠券操作
return req.get('/user/getCardDetail', params)
}
export function userUsedCard(params = {}) {

View File

@ -44,9 +44,6 @@ export function imgUpload (params = {}) {
export function involiceList (params = {}) {
return req.get(`/orders/invoice`, params)
}
export function involiceResend (params = {}) {
return req.post(`/orders/invoice/resend`, params)
}
export function zitiCode (params = {}) {
return req.get(`/ziticode`, params)

View File

@ -373,7 +373,7 @@ const config = {
"getLocation",
"chooseAddress"
],
// "__usePrivacyCheck__": true
"__usePrivacyCheck__": true
}
if (process.env.TARO_ENV == 'weapp') {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -72,7 +72,7 @@ export default class AddressChoose extends Component {
{/* <View className='sp-cell__ft-icon iconfont icon-arrowRight'></View> */}
</View>
) : (
<View className='address-info__bd' onClick={this.clickTo.bind(this, 'choose')}>+请选择收货地址</View>
<View className='address-info__bd'>+请选择收货地址</View>
)}
</View>
</View>

View File

@ -116,10 +116,6 @@ export default class SearchBar extends Component {
handleBlurSearch = () => {
this.props.onBlur?.()
this.setState({
showSearchDailog: false,
isShowAction: false
})
}
render () {

View File

@ -13,7 +13,7 @@ const initialState = {
isExpanded: false
}
function SpCoupon(props) {
const { info, children, onClick = () => { }, isNew } = props
const { info, children, onClick = () => {} } = props
const [state, setState] = useImmer(initialState)
const { isExpanded } = state
if (!info) {
@ -34,39 +34,12 @@ function SpCoupon (props) {
description,
quantity,
getNum,
distributorName,
couponStatus,
id,
fixedTerm,
status,
valid,
distributorName
} = info
console.log("🚀 ~ info:", info)
const { tag, invalidBg, bg } = COUPON_TYPE[cardType]
const couponTagBg = info.tagClass === 'used' || info.tagClass === 'overdue' || !info.valid ? invalidBg : bg
return (<View className="coupons-list-item" key={`coupon-item__${id}`} style={styleNames({
background: `url(${process.env.APP_IMAGE_CDN_NEW}/member/${couponStatus ? couponStatus != 1 ? "quan-hui" : "quan-lan" : info.tagClass === 'used' ? 'quan-hui' : 'quan-lan'}.png) no-repeat`,
'background-size': '100% 100%'
})}>
<View className="coupons-list-item-left">
<View className='coupons-list-item-money'><Text className='coupons-list-item-unit'>¥</Text><Text className="coupons-list-item-num">{reduceCost || 0}</Text></View>
<View className="coupons-list-item-desc">{leastCost}可用</View>
</View>
<View className="coupons-list-item-right">
<View className="coupons-list-item-right-box">
<View className="coupons-list-item-integral">{title}</View>
{/* {item.start_time}至{item.end_time} */}
{isNew ? <View className="coupons-list-item-desc">有效日期领取{fixedTerm}天内有效</View> :
<View className="coupons-list-item-desc">有效日期{beginDate}{endDate}</View>}
</View>
{/* !valid || */}
{info.tagClass === 'used' || info.tagClass === 'overdue' ? <View className="coupons-list-item-btn">{info.tagClass === 'used' ? '使用' : '过期'}</View>
: <View className="coupons-list-item-btn" onClick={onClick}>立即{isNew ? '兑换' : '使用'}</View>}
</View>
</View>)
const getCouponValue = () => {
if (cardType === 'cash') {
return (
@ -119,7 +92,8 @@ function SpCoupon (props) {
>
{COUPON_TYPE[cardType].tag}
</View>
<View className='title'>{`${VERSION_PLATFORM && distributorName ? `${distributorName}: ${title}` : title
<View className='title'>{`${
VERSION_PLATFORM && distributorName ? `${distributorName}: ${title}` : title
}`}</View>
</View>
<View className='coupon-datetime'>{`有效期: ${beginDate} - ${endDate}`}</View>

View File

@ -181,80 +181,3 @@
}
}
}
.coupons-list {
&-item {
width: 100%;
border-radius: 10px;
overflow: hidden;
// background: #5b5b5b;
// margin-bottom: 30px;
display: flex;
color: #fff;
min-height: 175px;
align-items: center;
// padding: 50px 0;
& .active {
background: #163586;
}
&-left {
width: 174px;
height: 100%;
padding: 55px 0;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
box-sizing: border-box;
// border-right: 1px dashed #fff;
}
&-money {
display: flex;
font-weight: bold;
align-items: baseline;
line-height: 1;
margin-bottom: 6px;
}
&-unit {
font-size: 24px;
}
&-num {
font-size: 60px;
}
&-desc {
opacity: 0.6;
color: #f5f5f5;
font-size: 20px;
}
&-right {
height: 100%;
display: flex;
flex: 1;
align-items: center;
justify-content: space-between;
padding: 50px 30px 50px 40px;
box-sizing: border-box;
&-box {
color: #fff;
display: flex;
flex-direction: column;
max-width: 65%;
}
}
&-integral {
font-size: 26px;
margin-bottom: 20px;
}
&-btn {
padding: 15px 20px;
border: 1px solid #fff;
border-radius: 6px;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
font-size: 20px;
line-height: 1;
width: 124px;
}
}
}

View File

@ -31,7 +31,7 @@ export default class SpFilterBar extends Component {
curIdx: current,
sortOrder: 1,
value: '0',
sortVal: 0,
sortVal: '0',
showFilter: false
}
}
@ -88,16 +88,15 @@ export default class SpFilterBar extends Component {
{item.icon && <Text className={classNames('iconfont', isArray(item.icon) ? item.icon[sortOrder == 1 ? 0 : 1] : item.icon)}></Text>}
</View>
))} */}
{/* 2024年02月21日暂时不做了胡和客户开会沟通过了 */}
{false && <SpPicker mode="select" isTop source={list} value={value} pickerConfirm={this.handleConfirm.bind(this)} leftBtnTxt="筛选" rightBtnTxt={<AtIcon value="close" size={14} color="#000"></AtIcon>}>
<SpPicker mode="select" isTop source={list} value={value} pickerConfirm={this.handleConfirm.bind(this)} leftBtnTxt="筛选" rightBtnTxt={<AtIcon value="close" size={14} color="#000"></AtIcon>}>
<View className="item" onClick={() => false && this.setState({ showFilter: true })}>
<Text className='text'>筛选</Text>
{/* <Image className="img" src={require('@/assets/icon/filter.png')}></Image> */}
<AtIcon value='menu' size='16' color='#000'></AtIcon>
</View>
</SpPicker>}
</SpPicker>
<SpPicker mode="select" source={list} value={sortVal} pickerConfirm={this.handleConfirm.bind(this)} leftBtnTxt="排序" rightBtnTxt={<AtIcon value="close" size={14} color="#000"></AtIcon>}>
<View className="item item-right-1">
<View className="item item-right">
<Text className='text'>排序</Text>
<Image className="img" src={require('@/assets/icon/sort.png')}></Image>
</View>

View File

@ -86,7 +86,7 @@ function SpGoodsCell (props) {
)}
</View>
</View>
{false && <View className='labels-block'>
<View className='labels-block'>
{!isNaN(memberPrice) && !VERSION_IN_PURCHASE && (
<View className='goods-type'>
{vipInfo?.isVip ? vipInfo?.grade_name : userInfo?.gradeInfo?.grade_name}
@ -126,7 +126,7 @@ function SpGoodsCell (props) {
return <View className='goods-type'>{limitTxt}</View>
})}
{/* {limitTxt && <View className='goods-type'>{limitTxt}</View>} */}
</View>}
</View>
<View className='item-ft'>
{info.num && <Text className='item-num'>数量{info.num}</Text>}
@ -136,14 +136,14 @@ function SpGoodsCell (props) {
<View className='price-gp'>
{isPoint && <SpPoint value={point} />}
{!isPoint && <SpPrice value={_price} noDecimal={false} showSeparator ></SpPrice>}
{/* {info.marketPrice > 0 && (
{info.marketPrice > 0 && (
<SpPrice
className='market-price'
size={32}
lineThrough
value={info.marketPrice}
></SpPrice>
)} */}
)}
</View>
</>
)

View File

@ -47,7 +47,6 @@ function SpGoodsItem (props) {
const [current, setCurrent] = useState(0)
const [move, setMove] = useState(0)
const [selColorItem, setSelColorItem] = useState({})
const { windowWidth } = Taro.getSystemInfoSync()
const setSelColor = (index, item) => {
setCurrent(index)
@ -135,7 +134,7 @@ function SpGoodsItem (props) {
<View className={classNames('sp-goods-item')} onClick={handleClick.bind(this)}>
<View className='goods-item__hd'>
<SpImage lazyLoad src={selColorItem.item_image_url?.[0] || info.spec_images?.[0]?.item_image_url?.[0] || info.pic} height={height} width={width} mode={"scaleToFill"} />
{info.tagList?.filter((item) => item.front_show === '1').map((item, index) => <View className="new" style={{ borderColor: item.tag_color, color: item.font_color, left: index === 0 ? '20rpx' : index * 30 + 8 + 'rpx' }} key={index + item.item_id}>{item.tag_name}</View>)}
{info.tagList.map((item, index) => <View className="new" style={{ borderColor: item.tag_color, color: item.font_color, left: index === 0 ? '20rpx' : index * 30 + 8 + 'rpx' }} key={index + item.item_id}>{item.tag_name}</View>)}
{/* <View className="new" style={{ left: '120rpx' }}>NEW</View> */}
</View>
{/* {renderBrand && <View className='goods-brand-wrap'>{renderBrand}</View>} */}
@ -169,7 +168,7 @@ function SpGoodsItem (props) {
}} scrollLeft={move * 32} scrollX scrollWithAnimation className='color-box' showScrollbar={false}>
{(info.spec_images || colors).map((item, index) => (
<View className='color-item' style={{ transform: `translateX(-${move * 32}px)` }} onClick={() => setSelColor(index, item)} key={`color__${index}`}>
<View className={`color${index == current ? ' active' : ''}`} style={{ backgroundColor: item.color_value || '#000', width: windowWidth >= 420 ? '14px' : '24rpx', height: windowWidth >= 420 ? '14px' : '24rpx' }}></View>
<View className={`color${index == current ? ' active' : ''}`} style={{ backgroundColor: item.color_value || '#000' }}></View>
</View>
))}
</ScrollView>

View File

@ -43,11 +43,11 @@ function SpGoodsPrice (props) {
</View>
}
{
!isPoint && <SpPrice size={36} className='sale-price' value={price} showSeparator noDecimal={false} />
!isPoint && <SpPrice size={36} className='sale-price' value={price} />
}
{/* {marketPrice > 0 && enMarketPrice && (
{marketPrice > 0 && enMarketPrice && (
<SpPrice className='mkt-price' lineThrough value={marketPrice} />
)} */}
)}
</View>
<View>
{info.memberPrice < info.price && enMemberPrice && (

View File

@ -24,8 +24,7 @@ function SpImage (props) {
lazyLoad = false,
circle = false,
isNew = false,
isShowMenuByLongpress = true,
children
isShowMenuByLongpress = true
} = props
const [state, setState] = useImmer(initialState)
const { loadSuccess } = state
@ -84,7 +83,6 @@ function SpImage (props) {
// lazyLoad={lazyLoad}
showMenuByLongpress={isShowMenuByLongpress}
/>
{children}
</View>
)
}

View File

@ -2,7 +2,6 @@
box-sizing: border-box;
transition: all 0.2 ease-in-out;
opacity: 0;
position: relative;
&.opacity-1 {
opacity: 1;
}

View File

@ -65,7 +65,6 @@ function SpLogin (props, ref) {
}
const handleBindPhone = async (e) => {
setLoginModal(false)
const { encryptedData, iv, cloudID } = e.detail
if (encryptedData && iv) {
const code = codeRef.current
@ -235,7 +234,7 @@ function SpLogin (props, ref) {
</AtButton>}
</View>
</View> */}
{<View className="curtain_content">
<View className="curtain_content">
<View className="curtain_content_title">
<SpImage src={`member/logo-black.png`} height={32} mode='heightFix' isNew />
<View className="">隐私政策</View>
@ -259,8 +258,10 @@ function SpLogin (props, ref) {
</View>
</ScrollView>
<View className='btn-wrap'>
{isNewUser && <AtButton className='btn' type='primary' openType="getPhoneNumber" onGetPhoneNumber={handleBindPhone
}>
{isNewUser && <AtButton className='btn' type='primary' openType="getPhoneNumber" onGetPhoneNumber={(e) => {
setLoginModal(false)
handleBindPhone(e)
}}>
同意并继续
</AtButton>}
{!isNewUser && <AtButton className='btn' type='primary' onClick={handleUserLogin}>
@ -271,7 +272,7 @@ function SpLogin (props, ref) {
<View className="no-text">
*如果您不同意Birkenstock隐私政策您可继续浏览小程序但您无法使用购物结算功能
</View>
</View>}
</View>
</AtCurtain>
</View>
)

View File

@ -15,7 +15,7 @@
margin-right: 60px;
}
&__bd {
width: 42%;
width: 38%;
// margin-bottom: 40px;
padding: 20px 0;
position: relative;
@ -26,7 +26,7 @@
&__ft {
flex: 1;
text-align: right;
padding-top: 8px;
padding-top: 10px;
// font-size: $font-size-small;
}
&__title {
@ -34,7 +34,6 @@
@include multi-ellipsis(1);
margin-bottom: 26px;
color: #000;
font-size: 20px;
// margin: 0 0 15px;
&-tag {
display: inline-block;
@ -46,7 +45,6 @@
}
}
&__desc {
opacity: 0.85;
// color: $color-gray;
// font-size: $font-size-small;
// margin-bottom: 10px;
@ -69,7 +67,6 @@
&__num {
display: block;
margin-top: 26px;
opacity: 0.85;
// color: $color-gray;
}
&__pay-type {
@ -78,9 +75,8 @@
font-size: 20px;
color: #c1c1c1;
}
// .sp-price__symbol,
// .sp-price__int,
// .sp-price__decimal {
// font-weight: bold !important;
// }
.sp-price__symbol,
.sp-price__int {
font-weight: bold !important;
}
}

View File

@ -131,7 +131,7 @@ function SpPage (props, ref) {
draft.pageTitle = pageTitle
draft.isTabBarPage = isTabBarPage
draft.showLeftContainer = !['/subpages/guide/index', '/pages/index'].includes(`/${page?.route}`)
draft.showCustomNavigation = ['/pages/cart/espier-index', '/pages/index', '/subpages/member/index', '/pages/category/index', '/pages/recommend/list'].includes(`/${page?.route}`)
draft.showCustomNavigation = ['/pages/cart/espier-index', '/pages/index', '/subpages/member/index', '/pages/category/index'].includes(`/${page?.route}`)
// draft.showCustomNavigation = true
draft.showNavCartIcon = ['/subpages/marketing/coupon-center', '/subpages/marketing/coupon', '/pages/item/list'].includes(`/${page?.route}`)
})
@ -309,7 +309,7 @@ function SpPage (props, ref) {
}
}}
/>
{showNavCartIcon ? cartCount > 0 ? <AtBadge value={cartCount} maxValue={99}><SpImage src={`member/cart.png`} onClick={() => Taro.redirectTo({ url: '/pages/cart/espier-index' })} height={36} mode='heightFix' isNew /></AtBadge> : <SpImage src={`member/cart.png`} onClick={() => Taro.redirectTo({ url: '/pages/cart/espier-index' })} height={36} mode='heightFix' isNew /> : null}
{showNavCartIcon && <AtBadge value={cartCount} maxValue={99}><SpImage src={`member/cart.png`} onClick={() => Taro.redirectTo({ url: '/pages/cart/espier-index' })} height={36} mode='heightFix' isNew /></AtBadge>}
{showNavHomeIcon && <SpImage src={`cart/home.png`} onClick={() => Taro.redirectTo({ url: '/pages/index' })} height={36} mode='heightFix' isNew />}
{showNavSearchIcon && <SpImage onClick={() => Taro.navigateTo({ url: '/pages/item/list' })} src={`member/chazhao-${isBlack ? "black" : "light"}.png`} height={34} mode='heightFix' isNew />}
</View>

View File

@ -28,7 +28,7 @@
&.ipx {
padding-bottom: 20px;
.sp-page-footer {
min-height: $page-ipx-footer-height;
height: $page-ipx-footer-height;
}
.sp-float-layout-ft {
padding-bottom: 40px;
@ -63,7 +63,7 @@
bottom: 0;
left: 0;
right: 0;
// height: $toolbar-height; //+20
height: $toolbar-height; //+20
z-index: $z-index-level-3;
background: #fff;
}

View File

@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react'
import React, { useEffect } from 'react'
import { useImmer } from 'use-immer'
import { useSelector } from 'react-redux'
import { useAsyncCallback } from '@/hooks'
@ -8,7 +8,7 @@ import './picker-select.scss'
const initialState = {
source: [],
value: 0,
value: '0',
markMultiDateTime: false
}
function PickerDateTime (props) {
@ -19,18 +19,33 @@ function PickerDateTime (props) {
{ mode: 'day', unit: '日' },
]
// const [state, setState] = useAsyncCallback({ source: props.list || [], value: props.value || '' })
// const [state, setState] = useImmer({ value: [props.value || 0] })
// const { source, value } = state
const [value, setState] = useState(props.value || [0])
const [state, setState] = useImmer({ source: list, value: props.value })
const { source, value } = state
// useEffect(() => {
// // const { dateTime, start } = this.props
// // 推荐 上架时间 价格低-高 价格高一低
// setState((draft) => {
// draft.source = [
// { text: '推荐', val: '0' },
// { text: '上架时间', val: '3' },
// { text: '价格低-高', val: '1' },
// { text: '价格高-低', val: '2' },
// ]
// })
// }, [])
const onChange = (e) => {
const onChange = (e, index) => {
// const _value = [...value]
// _value[index] = e.detail.value
// console.log(value, e.detail.value)
// const { source, value } = state
// source.item[]
setState(
e.detail.value
(draft) => {
draft.value = e.detail.value
},
// ({ source, value }) => {
// const res = []
// for (let i = 0; i < source.length; i++) {
@ -54,26 +69,27 @@ function PickerDateTime (props) {
// }
)
}
const handleClick = () => {
onPickerCancel()
handleConfirm(list[value[0]], value[0])
}
console.log(value)
return (
<View className='picker-custom'>
<PickerView
indicator-style='height: 40px;'
value={value}
onChange={(e) => onChange(e)}
immediateChange
// 使用acc.concat将多维数组打平成一维数组再求数组长度
>
<PickerViewColumn>
{list.map((item, elementIndex) => (
<View key={'list' + elementIndex} >{item.text}</View>
{source.map((item, elementIndex) => (
<View key={elementIndex} >{item.text}</View>
))}
</PickerViewColumn>
</PickerView>
<View className="picker-btn" onClick={handleClick}>确定</View>
<View className="picker-btn" onClick={() => {
onPickerCancel()
setTimeout(() => {
handleConfirm(source[value[0]], value[0])
}, 100)
}}>确定</View>
</View>
)
}

View File

@ -66,10 +66,6 @@ function SpSkuSelect (props, ref) {
specItems.forEach((item) => {
const key = item.specItem.map((spec) => spec.specId).join('_')
skuDictRef.current[key] = item
if (item.store > 0) {
} else {
console.log("🚀 ~ item库存为0:", key, item.specItem.map((item) => item.specName).join('_'))
}
})
// 默认选中有库存并且前端可销售的sku
const defaultSpecItem = specItems.find((item) => item.store > 0 && ['onsale'].includes(item.approveStatus))
@ -78,28 +74,23 @@ function SpSkuSelect (props, ref) {
selection = defaultSpecItem.specItem.map((item) => item.specId)
}
calcDisabled(selection, -1)
calcDisabled(selection)
}
const calcDisabled = (selection, e = 0) => {
const { skuList, specItems } = info
const calcDisabled = (selection, i = 0) => {
const disabledSet = new Set()
const makeReg = (sel, row, val) => {
const tSel = sel.slice()
const regStr = tSel.map((s, idx) => (row === idx ? val : !s ? '(\\d+)' : s)).join('_')
return regStr
// return new RegExp(regStr)
// console.log('regStr:', regStr)
return new RegExp(regStr)
}
const isNotDisabled = (sel, row, val) => {
const reg = makeReg(sel, row, val)
return Object.keys(skuDictRef.current).some((key) => {
if (key == reg) {
return skuDictRef.current[key].store > 0 && ['onsale'].includes(skuDictRef.current[key].approveStatus)
} else {
return false
}
return key.match(reg) && skuDictRef.current[key].store > 0 && ['onsale'].includes(skuDictRef.current[key].approveStatus)
})
}
@ -121,7 +112,7 @@ function SpSkuSelect (props, ref) {
// disabledSet
// )
const curItem = skuDictRef.current[selection.join('_')] || skuDictRef.current[Object.keys(skuDictRef.current)[0]]
const curItem = skuDictRef.current[selection.join('_')]
// const skuText = curItem
// ? `已选:${curItem.specItem.map((item) => `${item.skuName}:${item.specName}`).join(',')}`
// : '请选择规格'
@ -133,10 +124,10 @@ function SpSkuSelect (props, ref) {
draft.selection = selection
draft.disabledSet = disabledSet
draft.curItem = curItem
draft.skuText = e === -1 ? '' : skuText
draft.skuText = skuText
})
onChange(skuText, curItem, e === -1 ? 0 : e)
onChange(skuText, curItem, i)
}
// calcDisabled(initSelection)
@ -144,7 +135,7 @@ function SpSkuSelect (props, ref) {
// console.log('disabledSet:', disabledSet)
const handleSelectSku = ({ specId }, idx) => {
// console.log("🚀 ~ { specId }, idx:", specId, idx)
console.log("🚀 ~ { specId }, idx:", specId, idx)
if (disabledSet.has(specId)) return
setState(
(draft) => {
@ -187,7 +178,7 @@ function SpSkuSelect (props, ref) {
return null
}
// const { skuList } = info
const { skuList } = info
const addToCart = async () => {
const { nospec } = info
@ -379,7 +370,7 @@ function SpSkuSelect (props, ref) {
</View>
</View>}
<View className='sku-list'>
{info.skuList.map((item, index) => (
{skuList.map((item, index) => (
<View className='sku-group' key={`sku-group__${index}`}>
{/* <View className='sku-name'>{item.skuName}</View> */}
<View className='sku-values'>
@ -399,8 +390,7 @@ function SpSkuSelect (props, ref) {
)}
</ScrollView>}
{index > 0 && item.skuValue.map((spec, idx) => (
<>
{!disabledSet.has(spec.specId) && <View
<View
className={classNames('sku-btn btn-noac', {
'active': spec.specId == selection[index],
'btn-primary': spec.specId == selection[index],
@ -414,14 +404,13 @@ function SpSkuSelect (props, ref) {
<SpImage src={spec.specImgs[0]} width={260} height={260} />
)} */}
<View className={classNames('spec-name', { 'pad': index === 2 })}>{spec.specName}</View>
</View>}
</>
</View>
))}
</View>
</View>
))}
{/* {!hideInputNumber && renderLimitTip()} */}
<View className="select">{skuText.split(' ').map((item, index) => <Text key={`sku-text__${index}`} style={{ marginRight: '14px' }}>{item}</Text>)}</View>
{!hideInputNumber && renderLimitTip()}
<View className="select">{skuText}</View>
</View>
{/* </SpFloatLayout> */}
</View>
@ -432,4 +421,4 @@ SpSkuSelect.options = {
addGlobalClass: true
}
export default React.memo(React.forwardRef(SpSkuSelect))
export default React.forwardRef(SpSkuSelect)

View File

@ -47,10 +47,10 @@
// margin-top: 30px;
// margin-bottom: 100px;
.select {
// position: absolute;
position: absolute;
top: 156px;
right: 50px;
font-size: 24px;
right: 100px;
font-size: 22px;
}
}
.sku-group {

View File

@ -1,4 +1,4 @@
import { formatTime, diffInDays } from '@/utils'
import { formatTime } from '@/utils'
export const COUPON_ITEM = {
title: 'title',
@ -29,26 +29,7 @@ export const COUPON_ITEM = {
} else {
return valid
}
},
couponStatus: ({ quantity, get_limit, user_get_num, get_num }) => {
if (typeof valid === 'undefined') {
return 1
} else {
return valid
}
// if (quantity - get_num <= 0) {
// return 0 // 已领完
// } else if (get_limit - user_get_num > 0) {
// return 1 // 立即领取
// } else if (get_limit - user_get_num <= 0) {
// return 2 // 已领取
// }
},
// fixedTerm: 'fixed_term',
fixedTerm: ({ begin_date, end_date }) => diffInDays(begin_date, end_date),
sourceType: 'source_type',
sourceId: 'source_id',
point: ({ point }) => +point,
}
export const COUPON = {
@ -80,10 +61,8 @@ export const COUPON = {
distributorName: ({ distributor_info }) => {
return distributor_info?.name
},
fixedTerm: 'fixed_term',
sourceType: 'source_type',
sourceId: 'source_id',
point: ({ point }) => +point,
valid: ({ valid }) => {
if(typeof valid === 'undefined') {
return true

View File

@ -122,8 +122,6 @@ export const GOODS_INFO = {
itemId: 'item_id',
itemBn: 'item_bn',
itemName: 'itemName',
itemName2: 'item_name_2',
pdp: 'pdp',
brief: 'brief',
img: 'pics[0]',
imgs: 'pics',

View File

@ -36,25 +36,7 @@ export const TRADE_ITEM = {
refundNum: 1,
itemSpecDesc: 'item_spec_desc',
point: 'point',
checked: () => false,
descInfo: ({ item_spec_desc }) => {
const desc = item_spec_desc
let desc_info = ''
if (desc) {
try {
const descArr = desc.split(',')
descArr.forEach((item, index) => {
let [_, value] = item.split(':')
if (index === 1) {
value = value.substring(0, 2)
}
desc_info += value + ' '
})
} catch (error) {
}
return desc_info
}
}
checked: () => false
})
},
point: 'point',
@ -62,7 +44,7 @@ export const TRADE_ITEM = {
totalFee: ({ total_fee }) => total_fee / 100,
marketFee: ({ market_fee }) => market_fee / 100,
itemFee: ({ item_fee_new }) => item_fee_new / 100,
freightFee: ({ freight_fee }) => freight_fee / 100,
freightFee: ({ freight_fee }) => freight_fee / 100
}
export const SHOP_INFO = {
@ -72,55 +54,18 @@ export const SHOP_INFO = {
export const TRADE_AFTER_SALES_ITEM = {
orderId: 'order_id',
progress: 'progress',
aftersalesAddress: 'aftersales_address',
progressMsg: ({ app_info }) => app_info.progress_msg,
afterSalesBn: 'aftersales_bn',
aftersalesStatus: 'aftersales_status',
afterSalesType: 'aftersales_type',
distributorRemark: 'distributor_remark',
refuseReason: 'refuse_reason',
items: ({ detail }) => {
// return pickBy(detail, {
// pic: ({ orderItem }) => orderItem.pic,
// itemName: ({ orderItem }) => orderItem.item_name,
// itemSpecDesc: ({ orderItem }) => orderItem.item_spec_desc,
// num: ({ orderItem }) => orderItem.num,
// price: ({ orderItem }) => orderItem.total_fee / 100,
// })
const _detail = detail.filter(item => item.aftersales_bn).map(item => ({
...item, ...item.orderItem
}))
return pickBy(_detail, {
id: 'id',
pic: 'pic',
itemName: 'item_name',
price: ({ total_fee }) => total_fee / 100,
num: 'num',
// 可售后商品数
leftAftersalesNum: 'left_aftersales_num',
// 默认售后商品数
refundNum: 1,
itemSpecDesc: 'item_spec_desc',
point: 'point',
checked: () => false,
descInfo: ({ item_spec_desc }) => {
const desc = item_spec_desc
let desc_info = ''
if (desc) {
try {
const descArr = desc.split(',')
descArr.forEach((item, index) => {
let [_, value] = item.split(':')
if (index === 1) {
value = value.substring(0, 2)
}
desc_info += value + ' '
})
} catch (error) {
}
return desc_info
}
}
return pickBy(detail, {
pic: ({ orderItem }) => orderItem.pic,
itemName: ({ orderItem }) => orderItem.item_name,
itemSpecDesc: ({ orderItem }) => orderItem.item_spec_desc,
num: ({ orderItem }) => orderItem.num,
price: ({ orderItem }) => orderItem.total_fee / 100,
})
},
hasAftersalesAddress: ({ aftersales_address }) => isObject(aftersales_address),
@ -128,11 +73,8 @@ export const TRADE_AFTER_SALES_ITEM = {
afterSalesMobile: ({ aftersales_address }) => aftersales_address.aftersales_mobile,
afterSalesAddress: ({ aftersales_address }) => aftersales_address.aftersales_address,
afterSalesContact: ({ aftersales_address }) => aftersales_address.aftersales_contact,
afterSalesZip: ({ aftersales_address }) => aftersales_address.post_code,
aftersalesHours: ({ aftersales_address }) => aftersales_address.aftersales_hours,
refundFee: ({ refund_fee }) => refund_fee / 100,
sendbackData: 'sendback_data',
hasSendbackData: ({ sendback_data }) => isObject(sendback_data),
refundPoint: 'refund_point',
reason: 'reason',
description: 'description',

View File

@ -37,7 +37,6 @@ export default (props = {}) => {
const login = async () => {
if (isWeixin || isAlipay) {
// await getUserInfoAuth(false)
// 隐私协议
// const checkResult = await checkPolicyChange()
// if (checkResult) {

View File

@ -19,11 +19,10 @@ export default (props = {}) => {
// const { params, orderInfo } = state
const cashierResultUrl = `/pages/cart/cashier-result`
const $instance = getCurrentInstance()
// console.log("🚀 ~ $instance.router:", $instance.router)
const currentPath = $instance.router?.path
const currentPath = $instance.router.path
const cashierPayment = (params, orderInfo) => {
// console.log(`cashierPayment:`, params, orderInfo)
console.log(`cashierPayment:`, params, orderInfo)
const { pay_type, pay_channel } = params
switch (pay_type) {
case 'wxpay':
@ -102,13 +101,13 @@ export default (props = {}) => {
// 是否开启adapay小程序插件
if (process.env.APP_ADAPAY == 'true') {
const adapayPlugin = requirePlugin("Adapay")
const adapayPlugin = requirePlugin("Adapay");
adapayPlugin.requestPay(weappOrderInfo.expend, () => {
paySuccess(params, orderInfo)
}, (e) => {
console.error('adapayPlugin:', e)
payError(orderInfo)
})
});
} else {
await Taro.requestPayment(weappOrderInfo)
paySuccess(params, orderInfo)

View File

@ -1,11 +1,10 @@
import React, { useEffect } from 'react'
import { useImmer } from 'use-immer'
import Taro, { getCurrentInstance, getCurrentPages } from '@tarojs/taro'
import { View, Text, Image } from '@tarojs/components'
import { View, Text } from '@tarojs/components'
import { AtButton, AtSwipeAction } from 'taro-ui'
import { useDispatch, useSelector } from 'react-redux'
import { SpToast, SpNavBar, SpPage, SpCheckboxNew } from '@/components'
import { classNames } from '@/utils'
import { SpToast, SpNavBar, SpPage } from '@/components'
import S from '@/spx'
import api from '@/api'
@ -16,11 +15,7 @@ const ADDRESS_ID = 'address_id'
const initialState = {
list: [],
isPicker: false,
selectedId: null,
isSelected: '',
selItem: null,
editId: null,
visible: false
selectedId: null
}
function AddressIndex (props) {
@ -39,17 +34,12 @@ function AddressIndex (props) {
}
const fetch = async (isDelete = false) => {
const { isPicker, isSelected = '', receipt_type = '', city = '' } = $instance.router.params
const { isPicker, receipt_type = '', city = '' } = $instance.router.params
if (isPicker) {
setState(draft => {
draft.isPicker = true
})
}
if (isSelected) {
setState(draft => {
draft.isSelected = isSelected
})
}
Taro.showLoading({ title: '' })
const { list } = await api.member.addressList()
Taro.hideLoading()
@ -74,14 +64,9 @@ function AddressIndex (props) {
} else {
selectedId = list.find((addr) => addr.is_def > 0) || null
}
let item = null
if (isSelected) {
item = list.find((addr) => addr[ADDRESS_ID] == isSelected)
}
setState(draft => {
draft.list = newList
draft.selectedId = selectedId
draft.selItem = item
})
}
@ -183,7 +168,7 @@ function AddressIndex (props) {
Taro.navigateBack()
}
const { selectedId, isPicker, list, isSelected, selItem, editId, visible } = state
const { selectedId, isPicker, list } = state
const options = [
{
text: '',
@ -195,30 +180,15 @@ function AddressIndex (props) {
}
}
]
const editAddr = async () => {
setState(draft => {
draft.visible = true
})
setTimeout(() => {
setState(draft => {
draft.visible = false
})
// Taro.navigateBack()
}, 700)
}
return (
<SpPage
className='page-address-index'
title={isSelected || isPicker ? '修改地址' : '收货地址管理'}
renderFooter={
<View className='btn-wrap'>
<AtButton onClick={handleClickToEdit}>
<AtButton type='primary' onClick={handleClickToEdit}>
新增地址
</AtButton>
{!!isSelected && <AtButton type='primary' disabled={!editId} onClick={editAddr} style={{ margin: '30rpx 0 100rpx 0' }}>
确认修改
</AtButton>}
</View>
}
>
@ -244,53 +214,18 @@ function AddressIndex (props) {
)} */}
<View className='member-address-list'>
{selectedId && selItem && <>
<View className="address-item">
<View className="address-item__content" style={{ display: 'flex', alignItems: 'center', padding: '16rpx 26rpx 16rpx 20rpx' }}>
<Image src='/assets/info.png' className='info-icon'></Image>
<View className="info__txt">
修改后会影响物流时效送货上门等服务只能原价修改且付款后只能修改一次
若因商品换仓已发货运费变更等原因导致修改失败请您谅解
</View>
</View>
</View>
<View className='address-item'>
<View className='address-item__content'>
<View className='address-item__title' style={{ marginBottom: "20rpx" }}>
<View className='address-item__info'>
<Text>原地址</Text>
</View>
</View>
<View className='address-item__detail_box'>
<View className='address-item__detail'>
{selItem.province}
{selItem.city}
{selItem.county}
{selItem.adrdetail}
</View>
</View>
<Text className='address-item__info_tel'>{selItem.username} {selItem.telephone}</Text>
</View>
</View>
</>}
{list?.length > 0 && list.map((item, index) => {
{list?.length && list.map((item, index) => {
return (
<View
key={item[ADDRESS_ID]}
className={`address-item ${item.disabled ? 'disabled' : ''}`}
>
<AtSwipeAction options={options} disabled={item.disabled} isOpened={item.isOpened} autoClose onClick={e => handleDelete(e, item, index)} key={item[ADDRESS_ID]}>
<View className='address-item__content' style={{ display: 'flex', alignItems: 'center' }} onClick={() => {
!!selectedId && setState(draft => {
draft.editId = item[ADDRESS_ID]
})
}}>
{!!isSelected && <SpCheckboxNew checked={editId == item[ADDRESS_ID]} onChange={e => ''} />}
<View className='' style={{ flex: 1, marginLeft: isSelected ? '50rpx' : 0 }}>
<View className='address-item__content'>
<View className='address-item__title'>
<View className='address-item__info'>
<Text>{item.username}</Text>
{!isSelected && <Text className='address-item__info_edit' onClick={e => handleClickToEdit(e, item)}>编辑</Text>}
<Text className='address-item__info_edit' onClick={e => handleClickToEdit(e, item)}>编辑</Text>
</View>
<Text className='address-item__info_tel'>{item.telephone}</Text>
</View>
@ -321,7 +256,7 @@ function AddressIndex (props) {
)}
</View>
{!isSelected && <View className='address-item__footer'>
<View className='address-item__footer'>
<View
className='address-item__footer_default'
onClick={(e) => handleChangeDefault(e, item)}
@ -360,7 +295,6 @@ function AddressIndex (props) {
<Text>编辑</Text>
</View>
</View> */}
</View>}
</View>
</View>
</AtSwipeAction>
@ -369,12 +303,6 @@ function AddressIndex (props) {
})}
</View>
<SpToast />
<View className={classNames('toast', {
'visible': visible
})}>
<View>修改成功</View>
</View>
</View>
</SpPage>
)

View File

@ -4,16 +4,11 @@
// background: #f5f5f5;
padding: 20px;
.btn-wrap {
padding: 20px 50px 0;
padding: 0 50px;
border: transparent 1px solid;
.at-button__text {
font-size: 32px;
}
.at-button {
&:not(:first-child) {
margin: 30px 0 100px;
}
}
}
.member-address-list {
// /* #ifdef h5 */
@ -68,16 +63,6 @@
// margin-left: 12px;
padding: 40px 30px;
color: #000;
.info-icon {
width: 26px;
height: 26px;
}
.info__txt {
flex: 1;
font-size: 18px;
line-height: 1.8;
margin-left: 20px;
}
}
&__title {
color: #010101;
@ -104,7 +89,7 @@
}
&__detail {
@include multi-ellipsis(2);
// margin: 0 30px 50px 0;
margin: 0 30px 50px 0;
color: #959595;
}
.at-swipe-action {
@ -122,7 +107,6 @@
.address-item__footer {
display: flex;
justify-content: space-between;
margin-top: 50px;
// color: #9d9d9d;
// padding-top: 19px;
&_default {
@ -174,30 +158,4 @@
line-height: 80px;
font-size: 26px;
}
.toast {
position: fixed;
z-index: 2;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
opacity: 0;
visibility: hidden;
transition: all 0.3s ease;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
width: 400px;
height: 120px;
background: #666;
color: #fff;
border-radius: 10px;
view {
font-size: 30px;
}
&.visible {
visibility: visible;
opacity: 1;
}
}
}

View File

@ -105,7 +105,7 @@ function CashierResult (props) {
tradeInfo?.tradeSourceType == 'normal_seckill' ||
tradeInfo?.tradeSourceType == 'normal_groups') && (
<View className='btn-wrap'>
{/* <SpButton
<SpButton
resetText='首页'
confirmText='订单详情'
onReset={() => {
@ -114,24 +114,7 @@ function CashierResult (props) {
onConfirm={() => {
Taro.redirectTo({ url: `/subpage/pages/trade/detail?id=${orderId}` })
}}
></SpButton> */}
<AtButton
type='plain'
customStyle={{ marginBottom: '20px', borderColor: '#000' }}
onClick={() => {
Taro.redirectTo({ url: '/pages/index' })
}}
>
首页
</AtButton>
<AtButton
type='primary'
onClick={() => {
Taro.redirectTo({ url: `/subpage/pages/trade/detail?id=${orderId}&type=pointitem` })
}}
>
订单详情
</AtButton>
></SpButton>
</View>
)}
@ -140,7 +123,7 @@ function CashierResult (props) {
tradeInfo?.tradeSourceType == 'normal_pointsmall_pointsmall') && (
<View className='btn-wrap'>
<SpButton
resetText='返回'
resetText='首页'
confirmText='订单详情'
onReset={() => {
Taro.redirectTo({ url: '/pages/index' })

View File

@ -8,7 +8,7 @@
flex-direction: column;
}
.icon-roundcheckfill {
font-size: 80px;
font-size: 40px;
color: var(--color-primary);
}
.trade-txt {

View File

@ -9,7 +9,6 @@
&-bd {
flex: 1;
position: relative;
height: 150px;
}
&-image {
width: 220px;

View File

@ -35,7 +35,6 @@ export const initialState = {
paramsInfo: {}, // 结算接口参数
discountInfo: [],
couponInfo: {}, // 优惠券信息
couponTotal: 0,
remark: '', // 备注
// 积分相关
isPointOpen: false,

View File

@ -105,8 +105,7 @@ function CartCheckout (props) {
buildingNumber,
houseNumber, // 房号
routerParams, // 路由参数
orderTtems,
couponTotal
orderTtems
} = state
const {
@ -124,11 +123,10 @@ function CartCheckout (props) {
scene, // 情景值
goodType = routerParams.goodType
} = $instance?.router?.params || {}
// console.log('$instance.router?.params:', $instance.router)
console.log('$instance.router?.params:', $instance.router)
useEffect(() => {
if (isLogin) {
getTradeSetting()
getCouponList()
// tode 此处应有埋点
return () => {
dispatch(changeCoupon()) // 清空优惠券信息
@ -148,7 +146,7 @@ function CartCheckout (props) {
}, [isNewUser])
useEffect(() => {
// console.log(`useEffect: payType: ${payType}, address: ${address}, zitiAddress: ${zitiAddress}, receiptType: ${receiptType}`)
console.log(`useEffect: payType: ${payType}, address: ${address}, zitiAddress: ${zitiAddress}, receiptType: ${receiptType}`)
if (receiptType && payType) {
calcOrder()
}
@ -163,20 +161,6 @@ function CartCheckout (props) {
}
}, [isPackageOpend, openCashier, isPointOpenModal])
const getCouponList = async () => {
const params = {
status: '1',
page: 1,
pageSize: 1000,
card_type: 'cash',
scope_type: 'all'
}
const { total_count } = await api.member.getUserCardList(params)
setState((draft) => {
draft.couponTotal = total_count
})
}
// 是否需要包装
const getTradeSetting = async () => {
let data = await api.trade.tradeSetting()
@ -249,7 +233,7 @@ function CartCheckout (props) {
params['building_number'] = buildingNumber
params['house_number'] = houseNumber
}
// console.log('trade params:', params)
console.log('trade params:', params)
if (params.pay_type === 'deposit') {
// 验证余额额度是否可用
if (userInfo.deposit < totalInfo.total_fee / 100) {
@ -365,24 +349,6 @@ function CartCheckout (props) {
// 开发票
const handleInvoiceClick = () => {
Taro.navigateTo({
url: `/subpage/pages/trade/invoice-info?id=${totalInfo.tid || ''}`,
events: {
// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
acceptDataFromOpenedPage: function ({ data = {} }) {
const { invoiceTitle } = data
setState((draft) => {
draft.invoiceTitle = invoiceTitle
draft.paramsInfo = { ...paramsInfo, ...(data.paramsInfo || {}) }
})
},
},
success: function (res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('acceptDataFromOpenerPage', { data: totalInfo })
}
})
return
authSetting('invoiceTitle', async () => {
const res = await Taro.chooseInvoiceTitle()
if (res.errMsg === 'chooseInvoiceTitle:ok') {
@ -437,10 +403,7 @@ function CartCheckout (props) {
price
}
})
let url = `/subpages/marketing/coupon-picker`
// let url = `/subpages/marketing/coupon`
+ `?items=${JSON.stringify(
let url = `/subpages/marketing/coupon-picker?items=${JSON.stringify(
items
)}&is_checkout=true&cart_type=${cart_type}&distributor_id=${shop_id || id}&source=${source}`
if (couponInfo?.coupon_code) {
@ -564,7 +527,7 @@ function CartCheckout (props) {
receiver_district,
item_fee_new,
market_fee,
items_promotion,
items_promotion
} = orderRes
let subdistrictRes
@ -591,8 +554,7 @@ function CartCheckout (props) {
// }
coupon_id: id,
coupon_code: coupon_code,
title: info,
...coupon_info
title: info
}
setState((draft) => {
draft.couponInfo = _info
@ -625,7 +587,7 @@ function CartCheckout (props) {
point_fee, //积分抵扣金额,
item_point,
freight_type,
promotion_discount,
promotion_discount
}
const point_info = {
@ -754,7 +716,7 @@ function CartCheckout (props) {
if (VERSION_PLATFORM) {
delete cus_parmas.isNostores
}
console.log(couponInfo, '优惠券信息')
console.log(couponInfo)
const _coupon = coupon || couponInfo
if (!isEmpty(_coupon)) {
const { coupon_id, coupon_code, title } = _coupon
@ -901,14 +863,6 @@ function CartCheckout (props) {
))}
</View>
<View className="gap"></View>
<View className='counp-line' onClick={handleCouponsClick}>
<Text className='counp-line-left'>优惠券/</Text>
<View className='counp-line-right'>
<Text>{couponInfo.rule || (!!couponTotal ? '选择优惠券' : '暂无可用优惠券/码')}</Text>
<Text className='iconfont icon-arrowRight'></Text>
</View>
</View>
<View className="gap"></View>
<View className="trade-detail-info-new">
<View className='line'>
<View className='left'>订单金额</View>
@ -922,14 +876,14 @@ function CartCheckout (props) {
<View className='line'>
<View className='left'>优惠金额</View>
{/* 促销 + 优惠券 */}
<View className='right'>{`¥ ${parseFloat(totalInfo.promotion_discount + (totalInfo.coupon_discount || 0) / 100).toFixed(2)}`}</View>
<View className='right'>{`¥${parseFloat(totalInfo.promotion_discount + totalInfo.coupon_discount).toFixed(2)}`}</View>
</View>
<View className='line'>
<View className='left'>运费</View>
<View className='right'>
{totalInfo.freight_type !== 'point'
? `¥ ${+totalInfo.freight_fee / 100}`
: `${totalInfo.freight_fee}${this.props.pointName}`}
? `¥${totalInfo.freight_fee}`
: `${totalInfo.freight_fee * 100}${this.props.pointName}`}
</View>
</View>
</View>
@ -966,7 +920,7 @@ function CartCheckout (props) {
// : ''
return (
<SpPage ref={pageRef} className='page-cart-checkout' renderFooter={renderFooter()} title="订单结算">
<SpPage ref={pageRef} className='page-cart-checkout' renderFooter={renderFooter()}>
{isObjectsValue(shoppingGuideData) && (
<View className='shopping-guide__header'>
此订单商品来自{shoppingGuideData.store_name}导购 {shoppingGuideData.name}的推荐
@ -1040,7 +994,7 @@ function CartCheckout (props) {
value={couponText || '请选择'}
/>
)} */}
{isWeixin && !bargain_id && totalInfo.invoice_status && (
{/* {isWeixin && !bargain_id && totalInfo.invoice_status && (
<SpCell
isLink
title='开发票'
@ -1058,7 +1012,7 @@ function CartCheckout (props) {
</View>
}
/>
)}
)} */}
{packInfo.is_open && (
<SpCell

View File

@ -219,21 +219,8 @@ $margin24: 10px;
background: #fff;
margin: 20px auto;
}
.counp-line {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 26px;
padding: 20px 0;
&-right {
display: flex;
align-items: center;
color: #5b5b5b;
font-size: 20px;
}
}
.trade-detail-info-new {
padding: 20px 0px;
padding: 20px 24px;
.line {
display: flex;
width: 100%;

View File

@ -431,7 +431,7 @@ function CartIndex () {
)
})}
</View>
{false && invalidCart.length > 0 && (
{invalidCart.length > 0 && (
<View className='invalid-cart-block'>
<View className='shop-cart-item'>
<View className='shop-cart-item-hd-disabeld'>已失效商品</View>
@ -457,8 +457,7 @@ function CartIndex () {
</View>
)}
{/* && invalidCart.length == 0 */}
{validCart.length == 0 && (
{validCart.length == 0 && invalidCart.length == 0 && (
<View className='empty-box'>
{/* <SpDefault type='cart' message=''>
<AtButton type='primary' circle onClick={navigateTo.bind(this, '/pages/index', true)}>

View File

@ -37,7 +37,6 @@
padding-top: 40px;
/* #endif */
margin-bottom: 36px;
padding-bottom: 100px;
&-shadow {
// box-shadow: 0px 2px 10px 0px #eae7e0;
}
@ -155,7 +154,7 @@
}
.cart-item-wrap {
padding: 60px 36px 100px;
padding: 60px 36px;
display: flex;
align-items: center;
background: #f7f7f7;

View File

@ -97,7 +97,7 @@ const CompSeries = (props) => {
const currentTopImg = info[activeIndex].img || '' //当前分类顶部图片
const currentChildren = info[activeIndex].children || [] // 子类
const currentID = info[activeIndex].id || info[activeIndex].category_id || ''
const currentID = info[activeIndex].id || ''
return (
<View className='comp-series'>
{/* left */}
@ -146,13 +146,9 @@ const CompSeries = (props) => {
)}
<View className='comp-series__content_box'>
{!showChild ? currentChildren.map((item, index) => {
return (index === 0 || currentID === '18' ? <View className='group' key={index} onClick={() => {
if (item.children?.length) {
return (<View className='group' key={index} onClick={() => {
setShowChild(true)
setSelChild(item)
} else {
handleClickItem(item)
}
}}>
<View className='group-title'>{item.name}
<Text className='iconfont icon-qianwang-01' style={{ fontSize: 'inherit', marginLeft: '4px' }}></Text>
@ -163,18 +159,6 @@ const CompSeries = (props) => {
height={350}
src={item.img}
/>
</View> : <View
className='category-content__img'
key={item.category_id}
onClick={() => handleClickItem(item)}
>
<SpImage
className={classNames(imgType ? 'cat-img' : 'cat-img-no')}
mode='aspectFill'
src={item.img}
/>
<View className='img-cat-name'>{item.name}</View>
<Text className='iconfont icon-qianwang-01' style={{ fontSize: 'inherit', marginLeft: '4px' }}></Text>
</View>)
// return item.children ? (
// // <View className='new' key={index}>

View File

@ -73,15 +73,13 @@ page {
// height: calc(100vh - #{$tabbar-height});
transition: height 0.3s ease-in-out;
animation: fadeInAnimation 0.35s ease-in;
// &.swiper-narrow {
// height: calc(100vh - 620px - #{$tabbar-height} - var(--status-bar-height));
// }
&.swiper-narrow {
height: calc(100vh - 620px - #{$tabbar-height} - var(--status-bar-height));
}
}
.swiper-narrow {
// height: calc(100vh - 620px - #{$tabbar-height} - var(--status-bar-height));
height: calc(100vh - 420px - #{$tabbar-height} - var(--status-bar-height));
height: calc(100vh - 620px - #{$tabbar-height} - var(--status-bar-height));
transition: height 0.35s linear;
margin-top: -200px;
}
.item-btns {
display: flex;
@ -141,7 +139,7 @@ page {
}
}
.icon-kf {
position: fixed;
position: absolute;
right: 20px;
top: 60%;
width: 80px;
@ -238,29 +236,6 @@ page {
}
}
}
.recommend_btn {
display: flex;
flex-direction: column;
position: absolute;
bottom: 10%;
&-title {
font-size: 40px;
color: #fff;
margin-bottom: 12px;
font-weight: bold;
}
&-btn {
width: 174px;
height: 56px;
background-color: #000;
color: #fff;
font-size: 24px;
border-radius: 6px;
display: flex;
justify-content: center;
align-items: center;
}
}
@keyframes fadeInAnimation {
from {
opacity: 0;

View File

@ -102,14 +102,12 @@ const initialState = {
pic: 'https://espier-oss-cdn.oss-cn-shanghai.aliyuncs.com/default_project/image/1/2024/01/15/46fe6ca52277038e39ee2c026a4af3c90XruENsSSAhRiz0HPI3PjR8XQNVgbxHb'
},
],
goodList: [],
recommend: []
goodList: []
}
function Home () {
const [state, setState] = useImmer(initialState)
const [startY, setStartY] = useState(0)
const [startX, setStartX] = useState(0)
const [likeList, setLikeList] = useImmer([])
const { initState, openRecommend, openLocation, openStore, appName, openScanQrcode } = useSelector(
@ -122,10 +120,8 @@ function Home () {
const showAdv = useSelector((member) => member.user.showAdv)
const { location } = useSelector((state) => state.user)
const { setNavigationBarTitle } = useNavigation()
const { windowWidth } = Taro.getSystemInfoSync()
const imgW = parseFloat(((windowWidth * 2 - 60 - 32) / 3).toFixed(4))
const { wgts, loading, searchComp, pageData, fixedTop, filterWgts, isShowHomeHeader, isUpOperation, showRecommend, shopList, swiperList, goodList, recommend } = state
const { wgts, loading, searchComp, pageData, fixedTop, filterWgts, isShowHomeHeader, isUpOperation, showRecommend, shopList, swiperList, goodList } = state
const dispatch = useDispatch()
@ -134,7 +130,6 @@ function Home () {
init()
setNavigationBarTitle(appName)
getSwiperList()
getRecommendItems()
}
}, [initState])
@ -193,50 +188,6 @@ function Home () {
}
}
const getRecommendItems = async () => {
const req = {
page: 1,
pageSize: 10,
approve_status: 'onsale',
approve_status: 'onsale,only_show',
item_type: 'normal',
is_point: false,
// goodsSort: 6,
distributor_id: 0
}
const { list: jdList } = await api.item.search({ ...req, tag_id: 1 })
const { list: newList } = await api.item.search({ ...req, tag_id: 2 })
const { list: hotList } = await api.item.search({ ...req, tag_id: 3 })
setState((draft) => {
draft.recommend = [{
type: 'new',
text: "新品推荐",
btnTxt: '查看更多',
postions: 'left',
url: '',
img: 'index/rec/new.png',
list: newList.map(item => ({ ...item, price: (item.price / 100) }))
}, {
type: 'hot',
text: "热销单品",
btnTxt: '查看更多',
postions: 'left',
url: '',
img: 'index/rec/hot.png',
list: hotList.map(item => ({ ...item, price: (item.price / 100) }))
}, {
type: 'jd',
text: "ARIZONA",
btnTxt: '经典双扣',
postions: 'right',
url: '',
img: 'index/rec/jd.png',
list: jdList.map(item => ({ ...item, price: (item.price / 100) }))
}
]
})
}
const getSwiperList = async () => {
const res = await api.shop.homeSwiperList({ page: 1, pageSize: 999 })
const list = res?.list?.map((item) => {
@ -246,11 +197,12 @@ function Home () {
goods: (item.goods_info_detail || []).map((ite) => {
return {
itemName: ite.item_name,
price: ite.price,
goods_id: ite.item_id,
itemId: ite.item_id,
pic: ite.pics?.[0],
brief: ite.brief,
price: ite.price ? ite.price / 100 : 0,
price: ite.price,
spec_images: ite.spec_images || [],
tagList: ite.tagList || []
}
@ -342,16 +294,12 @@ function Home () {
}
const handleTouchStart = (e) => {
const { clientY, clientX } = e.touches[0]
setStartY(clientY)
setStartX(clientX)
setStartY(e.touches[0].clientY)
}
const handleTouchEnd = (e) => {
const { clientX, clientY } = e.changedTouches[0]
const deltaY = clientY - startY
const deltaX = clientX - startX
if (Math.abs(deltaY) < 50) return
const endY = e.changedTouches[0].clientY
const deltaY = endY - startY
if (deltaY > 0) {
// 下滑操作
@ -467,7 +415,7 @@ function Home () {
<Image
src={item.src}
style={{ width: "100%", height: "100%", objectPosition: "center" }}
mode={isUpOperation ? 'aspectFill' : 'aspectFill'}
mode="aspectFill"
showMenuByLongpress={false}
/>
// <SpImage style={{ width: "100%", height: "100%" }} height="100%" src={item.src} isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
@ -516,7 +464,7 @@ function Home () {
<SpChat><SpImage height="62" src='index/kf.png' isShowMenuByLongpress={false} lazyLoad isNew /></SpChat>
</View>}
</View>
{isUpOperation && <ScrollView scrollX scrollWithAnimation showScrollbar={true} scrollLeft={0} className="shop-box fadeIn" >
{isUpOperation && <ScrollView scrollX scrollWithAnimation showScrollbar={false} scrollLeft={0} className="shop-box fadeIn" >
{goodList.map((item, idx) => (
<View className='goods-item-wrap fadeIn' animation={{ duration: 500, timingFunction: 'ease-in-out', delay: 0 }} key={`goods-item-l__${idx + item.goods_id}`}>
<SpGoodsItem
@ -528,52 +476,29 @@ function Home () {
</View>
))}
</ScrollView>}
{/* 推荐图片+商品 */}
{isUpOperation && <>
{recommend.length > 0 && recommend.map((_item, id) => <View key={id + '__item'}>
<SpImage width={windowWidth * 2} height={windowWidth >= 400 ? 920 : 800} mode='scaleToFill' src={_item.img} isShowMenuByLongpress={false} lazyLoad isNew >
{/* <View className="recommend_btn" style={{ [_item.postions]: '70rpx' }}>
<View className="recommend_btn-title">{_item.text}</View>
<View className="recommend_btn-btn">{_item.btnTxt}</View>
</View> */}
</SpImage>
<ScrollView scrollX scrollWithAnimation showScrollbar={true} scrollLeft={0} className="shop-box fadeIn" >
{_item.list?.map((item, idx) => (
<View className='goods-item-wrap fadeIn' animation={{ duration: 500, timingFunction: 'ease-in-out', delay: 0 }} key={`goods-item-l__${idx + item.goods_id}`}>
<SpGoodsItem
onStoreClick={handleClickStore}
info={{
...item
}}
/>
</View>
))}
</ScrollView>
</View>)}
</>}
{isUpOperation && showRecommend && <View className="brand" style={{ padding: '15px', height: '550px' }}>
{isUpOperation && showRecommend && <View className="brand">
<View className="brand-title">品牌介绍</View>
<ScrollView scrollX scrollWithAnimation showScrollbar={false} scrollLeft={0} className="brand-img" style={{ height: '220px' }}>
<View className="brand-img-left brand-img-item" style={{ marginRight: '8px' }}>
<SpImage className="brand-img-top" width={imgW} height={294} mode='aspectFill' src="index/img/1774-1902.jpg" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
<SpImage width={imgW} height={130} mode='aspectFill' src="index/img/1913.jpg" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
<ScrollView scrollX scrollWithAnimation showScrollbar={false} scrollLeft={0} className="brand-img">
<View className="brand-img-left brand-img-item">
<SpImage className="brand-img-top" width={220} height={294} mode='aspectFill' src="index/img/1774-1902.jpg" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
<SpImage width={220} height={130} mode='aspectFill' src="index/img/1913.jpg" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
</View>
<View className="brand-img-center brand-img-item" style={{ marginRight: '8px' }}>
<SpImage height={440} width={imgW} mode='aspectFill' src="index/img/1968.jpg" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
<View className="brand-img-center brand-img-item">
<SpImage height={440} width={220} mode='aspectFill' src="index/img/1968.jpg" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
</View>
<View className="brand-img-right brand-img-item" style={{ marginRight: '0px' }}>
<SpImage className="brand-img-top" width={imgW} height={324} mode='aspectFill' src="index/img/70.jpg" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
<SpImage width={imgW} height={100} mode='aspectFill' src="index/img/1980.jpg" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
<View className="brand-img-right brand-img-item">
<SpImage className="brand-img-top" width={220} height={324} mode='aspectFill' src="index/img/70.jpg" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
<SpImage width={220} height={100} mode='aspectFill' src="index/img/1980.jpg" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
</View>
</ScrollView>
<SpImage onClick={() => Taro.navigateTo({
url: '/pages/webview?url=' + encodeURIComponent('https://www.baidu.com')
})} className="brand-guanzhu" mode="widthFix" src="index/guanzhu.png" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
})} className="brand-guanzhu" width={690} mode="widthFix" src="index/guanzhu.png" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
<View className="brand-dy">
<View className="brand-dy-tit">订阅消息</View>
<SpImage width={30} mode="widthFix" src="index/xiaoxi.png" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
</View>
{/* <SpImage className="brand-logo" width={168} mode="widthFix" src="index/logo.png" isShowMenuByLongpress={false} lazyLoad isNew></SpImage> */}
<SpImage className="brand-logo" width={168} mode="widthFix" src="index/logo.png" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
</View>}
{/* </ScrollView> */}

View File

@ -42,14 +42,14 @@ function CompGoodsBuyToolbar (props) {
btns.push(BUY_TOOL_BTNS.ONLY_SHOW)
return
}
// if (info.store == 0) {
// if (info.subscribe) {
// btns.push(BUY_TOOL_BTNS.SUBSCRIBE)
// } else {
// btns.push(BUY_TOOL_BTNS.NOTICE)
// }
// return
// }
if (info.store == 0) {
if (info.subscribe) {
btns.push(BUY_TOOL_BTNS.SUBSCRIBE)
} else {
btns.push(BUY_TOOL_BTNS.NOTICE)
}
return
}
if (info.isGift) {
btns.push(BUY_TOOL_BTNS.GIFT)
@ -81,11 +81,12 @@ function CompGoodsBuyToolbar (props) {
return
}
btns.push({ ...BUY_TOOL_BTNS.ADD_CART, btnStatus: info.store == 0 ? 'disabled' : 'default' })
btns.push({ ...BUY_TOOL_BTNS.FAST_BUY, btnStatus: info.store == 0 ? 'disabled' : 'active' })
btns.push(BUY_TOOL_BTNS.ADD_CART)
btns.push(BUY_TOOL_BTNS.FAST_BUY)
}
RenderBtns()
// console.log('btns:', btns)
const onChangeLogin = async ({ key }) => {
const { dtid, card_id, user_card_id } = $instance.router.params

View File

@ -101,7 +101,7 @@
/* prettier-ignore */
border: 1PX solid #E5E5E5;
background: #e5e5e5;
color: #8d8d8d !important;
color: #8d8d8d;
}
&.sp-login {
margin-left: 0;

View File

@ -66,7 +66,7 @@ import { WgtFilm, WgtSlider, WgtWriting, WgtGoods, WgtHeading, WgtHeadline } fro
import './espier-detail.scss'
const MSpSkuSelect = SpSkuSelectNew
const MSpSkuSelect = React.memo(SpSkuSelectNew)
const initialState = {
id: null,
@ -102,8 +102,7 @@ const initialState = {
selSkuImg: '',
swiperList: [],
selColorIdx: 0,
introList: [],
scrollTop: 0
introList: []
}
function EspierDetail (props) {
@ -149,8 +148,7 @@ function EspierDetail (props) {
selSkuImg,
swiperList,
selColorIdx,
introList,
scrollTop
introList
} = state
useEffect(() => {
@ -258,15 +256,15 @@ function EspierDetail (props) {
draft.defaultMsg = '商品已下架'
})
}
// if (selColorIdx != 0) {
// const spec_values = data.itemSpecDesc?.[0]?.spec_values || []
// if (spec_values.length) {
// const item = spec_values[selColorIdx]
// setTimeout(() => {
// skuSelectRef.current?.handleSelectSku({ specId: item.spec_value_id, specValueId: item.spec_value_id }, selColorIdx)
// }, 100)
// }
// }
if (selColorIdx != 0) {
const spec_values = data.itemSpecDesc?.[0]?.spec_values || []
if (spec_values.length) {
const item = spec_values[selColorIdx]
setTimeout(() => {
skuSelectRef.current?.handleSelectSku({ specId: item.spec_value_id, specValueId: item.spec_value_id }, selColorIdx)
}, 100)
}
}
} catch (e) {
setState((draft) => {
draft.isDefault = true
@ -291,7 +289,7 @@ function EspierDetail (props) {
}
})
}
console.log("🚀 ~ data.introList:", data)
console.log("🚀 ~ data.introList:", data.introList)
setState((draft) => {
draft.info = {
...data,
@ -332,7 +330,7 @@ function EspierDetail (props) {
const res = await api.member.itemHistory()
setState((draft) => {
draft.historyList = res.list.filter((item) => item.item_id !== data.itemId && !!item.itemData?.item_id)?.map((item) => ({ ...item.itemData, pic: item.itemData.pics?.[0] || '' })) || []
draft.historyList = res.list.filter((item) => item.item_id !== data.itemId).map((item) => ({ ...item.itemData, pic: item.itemData.pics?.[0] || '' }))
draft.historyTotal = res.total_count
})
@ -457,9 +455,10 @@ function EspierDetail (props) {
{/* <Canvas id="canvas2" type="2d" onReady={onCanvasReady} /> */}
{!info && <SpLoading />}
{info && (
<ScrollView scrollY scrollWithAnimation showScrollbar={false} scrollTop={scrollTop} className='goods-contents' onScroll={(e) => {
<ScrollView scrollY scrollWithAnimation showScrollbar={false} scrollTop={0} className='goods-contents' onScroll={(e) => {
// console.log('e', e.detail)
const { scrollTop } = e.detail
if (scrollTop >= 600) {
if (scrollTop >= 640) {
setState((draft) => {
draft.isShowScroll = true
})
@ -472,7 +471,7 @@ function EspierDetail (props) {
<View className='goods-pic-container'>
<Swiper
className='goods-swiper'
current={curImgIdx}
// current={curImgIdx}
onChange={onChangeSwiper}
style={{
height: windowWidth
@ -481,7 +480,7 @@ function EspierDetail (props) {
interval={3000}
circular
>
{(swiperList || info.imgs).map((img, idx) => (
{(info.imgs || swiperList).map((img, idx) => (
<SwiperItem key={`swiperitem__${idx}`}>
<SpImage
mode='aspectFill'
@ -519,7 +518,7 @@ function EspierDetail (props) {
</Swiper>
{info.imgs.length > 1 && (
<View className='swiper-pagegation'>{`${curImgIdx + 1}/${(swiperList)?.length || 1}`}</View>
<View className='swiper-pagegation'>{`${curImgIdx + 1}/${info.imgs.length}`}</View>
)}
{info.video && play && (
@ -586,26 +585,26 @@ function EspierDetail (props) {
<View className='goods-info'>
{/* <CompVipGuide
<CompVipGuide
info={{
...info.vipgradeGuideTitle,
memberPrice: info.memberPrice
}}
/> */}
/>
{/* <CompCouponList
<CompCouponList
info={
info.couponList.list.length > 3
? info.couponList.list.slice(0, 3)
: info.couponList.list
}
onClick={handleReceiveCoupon}
/> */}
/>
<View className='goods-name-wrap'>
<View className='goods-name'>
{info.pdp && <View className='brief'>{info.pdp}</View>}
<View className='title'>{info?.itemName2 || info?.itemName}</View>
<View className='title'>{info?.itemName}</View>
{/* <View className='brief'>{info.brief}</View> */}
</View>
{/* {(isWeixin || isAPP()) && (
// {(
@ -732,18 +731,18 @@ function EspierDetail (props) {
}}
onChange={(skuText, curItem, idx) => {
console.log("🚀 ~ curItem:", curItem, idx)
curItem && setState((draft) => {
setState((draft) => {
draft.skuText = skuText
draft.curItem = curItem
// 不切换顶部轮播图
// draft.swiperList = curItem?.specItem?.[idx]?.specImgs
draft.selSkuImg = curItem.specItem?.[0]?.specImgs?.[0]
if (idx === 0) draft.swiperList = curItem?.specItem?.[idx]?.specImgs
})
}}
/>
<View className='goods-desc'>
{/* <View className='desc-hd'>
<View className='desc-hd'>
<SpImage
className='sku-image'
src={selSkuImg || info?.specItem?.[0]?.specImgs?.[0]}
@ -755,7 +754,7 @@ function EspierDetail (props) {
<Text className='desc-title-txt'>{info?.itemName}</Text>
<SpGoodsPrice info={curItem ? curItem : info} />
</View>
</View> */}
</View>
{isArray(info.intro) ? (
<View>
{info.intro.map((item, idx) => (
@ -780,17 +779,12 @@ function EspierDetail (props) {
isAnimation={false}
onClick={() => {
setState((draft) => {
// draft.introList[index].isOpen = !draft.introList[index].isOpen
draft.introList = draft.introList.map((v, i) => {
v.isOpen = false
v.isOpen = (i === index)
return v
})
draft.introList[index].isOpen = !item.isOpen
})
if (!item.isOpen) {
setState((draft) => {
draft.scrollTop = 1010 + Math.random()
})
}
}}
title={item.title}
>
@ -798,24 +792,19 @@ function EspierDetail (props) {
</AtAccordion>
<View onClick={() => {
setState((draft) => {
// draft.introList[index].isOpen = !draft.introList[index].isOpen
draft.introList = draft.introList.map((v, i) => {
v.isOpen = false
v.isOpen = (i === index)
return v
})
draft.introList[index].isOpen = !item.isOpen
})
if (!item.isOpen) {
setState((draft) => {
draft.scrollTop = 1010 + Math.random()
})
}
}}>
{item.isOpen ? <AtIcon value='subtract' size='16' color='#000' /> :
<AtIcon value='add' size='16' color='#000' />}
{item.isOpen ? <></> : <View className="line"></View>}
</View>
</View>) : <View style={{ height: `calc(100% - 380px)` }}></View>}
{isArray(historyList) ? <View className='bottom-box'>
{historyList.length && <View className='bottom-box'>
<View className="bottom-box-tit">浏览历史</View>
<ScrollView scrollX scrollWithAnimation showScrollbar={true} scrollLeft={0} className="shop-box">
{historyList.map((item, idx) => (
@ -830,7 +819,7 @@ function EspierDetail (props) {
</View>
))}
</ScrollView>
</View> : <></>}
</View>}
</View>
</ScrollView>
)}

View File

@ -255,10 +255,8 @@
// @include multi-ellipsis(2);
}
.brief {
font-size: 36px;
font-weight: bold;
margin-bottom: 10px;
// color: #666;
font-size: 28px;
color: #666;
// @include text-overflow();
}
}

View File

@ -357,7 +357,6 @@ function ItemList () {
placeholder='搜索商品'
isOpened={true}
onFocus={handleOnFocus}
onBlur={() => handleConfirm(keywords)}
onChange={handleOnChange}
onClear={handleOnClear}
onCancel={handleSearchOff}

View File

@ -299,19 +299,19 @@ export default class ItemFav extends Component {
onClick={() => this.handleClickItem(item)}
isPointitem={item.item_type === 'pointsmall'}
/> */}
<Image className="goods-list__item__img" src={item.img} onClick={() => this.handleClickItem(item)}></Image>
<Image className="goods-list__item__img" src={item.img}></Image>
<View className="goods-list__item__right">
<View className="goods-list__item__right__title" onClick={() => this.handleClickItem(item)}>{item.title}</View>
<View className="goods-list__item__right__price" onClick={() => this.handleClickItem(item)}><Text className="goods-list__item__right__price__symbol">¥</Text>{item.price}</View>
<View className="goods-list__item__right__title">{item.title}</View>
<View className="goods-list__item__right__price"><Text className="goods-list__item__right__price__symbol">¥</Text>{item.price}</View>
<View className="goods-list__item__right__footer">
<View className="goods-list__item__right__footer__fav">
<Text className="goods-list__item__right__footer__fav__num">{item.fav_num}+</Text>
<Text className="goods-list__item__right__footer__fav__text">人收藏</Text>
</View>
<View className='goods-list__item__right__footer__btns'>
{/* <View className="goods-list__item__right__footer__btn white" onClick={() => this.handleClickItem(item)}>
<View className="goods-list__item__right__footer__btn white" onClick={() => this.handleClickItem(item)}>
相似推荐
</View> */}
</View>
<View className="goods-list__item__right__footer__btn black" onClick={() => this.handleClickItem(item)}>
立即购买
</View>

View File

@ -1,6 +1,6 @@
import React, { Component } from 'react'
import Taro, { getCurrentInstance } from '@tarojs/taro'
import { View, Text, ScrollView, Picker, Video } from '@tarojs/components'
import { View, Text, ScrollView, Picker } from '@tarojs/components'
import { SpAddress } from '@/components'
import { withPager, withBackToTop } from '@/hocs'
import { connect } from 'react-redux'
@ -13,11 +13,10 @@ import {
SpNote,
FilterBar,
SpTabbar,
SpPage,
SpImage
SpPage
} from '@/components'
import api from '@/api'
import { classNames, pickBy, isWeixin } from '@/utils'
import { classNames, pickBy } from '@/utils'
import S from '@/spx'
import './list.scss'
@ -25,7 +24,7 @@ import './list.scss'
@connect(({ colors }) => ({
colors: colors.current
}))
// @withPager
@withPager
@withBackToTop
export default class RecommendList extends Component {
$instance = getCurrentInstance()
@ -46,10 +45,6 @@ export default class RecommendList extends Component {
isShowSearch: false,
shareInfo: {},
isSpAddressOpened: false,
play: false,
page: {
isLoading: true
}
}
}
@ -73,19 +68,14 @@ export default class RecommendList extends Component {
}
})
}
// Taro.showLoading({ title: '' })
// this.resetPage()
// this.setState({
// list: []
// })
setTimeout(() => {
// this.nextPage()
// Taro.hideLoading()
Taro.showLoading({ title: '' })
this.resetPage()
this.setState({
page: {
isLoading: false
}
list: []
})
setTimeout(() => {
this.nextPage()
Taro.hideLoading()
}, 200)
// this.praiseNum()
@ -539,30 +529,6 @@ export default class RecommendList extends Component {
})
}
handleVideoClick = (play) => {
let video
if (isWeixin) {
video = Taro.createVideoContext('recommend-video')
} else if (isWeb) {
video = document.getElementById('recommend-video')
}
if (!video) {
return
}
if (play) {
setTimeout(() => {
video.play()
}, 200)
} else {
isWeixin ? video.stop() : video.pause()
}
this.setState({
play
})
}
render () {
const {
list,
@ -577,16 +543,14 @@ export default class RecommendList extends Component {
areaList,
query,
isShowSearch,
isSpAddressOpened,
play
isSpAddressOpened
} = this.state
const { colors } = this.props
let address = info.province + info.city
return (
<SpPage renderFooter={<SpTabbar />} className='has-nav' title="" isBlack>
<SpPage renderFooter={<SpTabbar />} className='has-nav' title="鞋床故事">
<View className='page-recommend-list'>
{false && <>
<View className='recommend-list__toolbar'>
<View
className={`recommend-list__search ${query && query.title && isShowSearch ? 'on-search' : null
@ -718,63 +682,7 @@ export default class RecommendList extends Component {
<SpNote img='trades_empty.png'>暂无数据~</SpNote>
)}
</ScrollView>
</>}
{page.isLoading ? <Loading></Loading> :
<View className="recommend-content">
<Video
id="recommend-video"
src={`${process.env.APP_IMAGE_CDN_NEW}/recommend/162S.mp4`}
poster={`${process.env.APP_IMAGE_CDN_NEW}/recommend/poster.jpg`}
initialTime={0}
controls={play}
autoplay={false}
loop={false}
// muted={true}
showProgress={true}
showFullscreenBtn={true}
showPlayBtn={true}
showCenterPlayBtn={false}
enableProgressGesture={true}
showMuteBtn
objectFit="cover"
style={{ width: "100%", height: "400rpx", marginTop: "20rpx" }}
onPlay={() => {
}}
onEnded={() => {
}}
onClick={() => {
!play && this.handleVideoClick(true)
}}
/>
{/* <View className="top-txt">
<View className="top-txt-title">BIRKENSTOCK产品的核心和灵魂</View>
<View className="top-txt-dec">
<View className="top-txt-dec-item">标志性的鞋床是每一双BIRKENSTOCK的核心和灵魂</View>
<View className="top-txt-dec-item"> 其精美的解剖学设计是Birkenstock家族世代相传的知识结晶</View>
<View className="top-txt-dec-item">它的发明源于一个朴素但难以实现的愿望让人们能够自然地行走</View>
<View className="top-txt-dec-item">为了实现这个功能</View>
<View className="top-txt-dec-item">鞋床的轮廓被精确设计以用于从解剖学上符合支撑人类脚部的功效</View>
<View className="top-txt-dec-item">仿佛在沙滩上的脚印</View>
<View className="top-txt-dec-item">它的分层结构采用独特且天然的材料组合</View>
<View className="top-txt-dec-item">经过一系列专门的制造工艺加工确保产品拥有最大程度上的耐用性和灵活性</View>
<View className="top-txt-dec-item">这也意味着BIRKENSTOCK鞋床的功能是无可匹敌的</View>
</View>
<View className="line"></View>
</View> */}
<View className="content-item">
<SpImage height={400} width={750} mode="aspectFill" src='recommend/02.jpg' isShowMenuByLongpress={false} lazyLoad isNew />
<SpImage height={400} width={750} mode="aspectFill" src='recommend/03.jpg' isShowMenuByLongpress={false} lazyLoad isNew />
<SpImage height={400} width={750} mode="aspectFill" src='recommend/04.jpg' isShowMenuByLongpress={false} lazyLoad isNew />
<SpImage height={400} width={750} mode="aspectFill" src='recommend/05.jpg' isShowMenuByLongpress={false} lazyLoad isNew />
<SpImage height={400} width={750} mode="aspectFill" src='recommend/06.jpg' isShowMenuByLongpress={false} lazyLoad isNew />
<SpImage height={400} width={750} mode="aspectFill" src='recommend/07.jpg' isShowMenuByLongpress={false} lazyLoad isNew />
<SpImage height={400} width={750} mode="aspectFill" src='recommend/08.jpg' isShowMenuByLongpress={false} lazyLoad isNew />
<SpImage height={400} width={750} mode="aspectFill" src='recommend/09.jpg' isShowMenuByLongpress={false} lazyLoad isNew />
</View>
</View>
}
<BackToTop show={showBackToTop} onClick={this.scrollBackToTop} />
</View>

View File

@ -3,41 +3,6 @@
margin-top: 60px;
}
.page-recommend-list {
.recommend-content {
width: 100%;
.top-txt {
margin-top: 46px;
margin-bottom: 40px;
&-title {
text-align: center;
font-size: 30px;
margin-bottom: 24px;
font-weight: bold;
}
&-dec {
white-space: pre-wrap;
word-wrap: break-word;
text-align: center;
margin-bottom: 30px;
&-item {
text-align: center;
font-size: 20px;
line-height: 1.5;
margin: 0 auto;
}
}
.line {
margin: 0 auto;
width: 50px;
height: 6px;
background: #000;
border-radius: 4px;
}
}
.content-item {
margin-bottom: 50px;
}
}
/* #ifdef alipay */
.filter-bar {
position: absolute;

View File

@ -191,10 +191,8 @@
}
&--normal {
/* prettier-ignore */
// border: 1PX solid #E5E5E5;
// color: #444;
border: 1px solid #000;
color: #000;
border: 1PX solid #E5E5E5;
color: #444;
}
&--default {
border-color: var(--color-primary) !important;

View File

@ -1,4 +1,4 @@
@import '@/style/imports';
@import "@/style/imports";
.page-trade-cancel {
.sp-cell {
@ -9,28 +9,18 @@
}
&__bd {
width: 100%;
.at-tag--active {
color: #000;
border-color: #000;
background-color: #fff;
}
.at-textarea {
border-color: #00000080;
}
}
.cancel-reason {
margin: 0 6px 0 0;
}
}
.trade-cancel-footer {
width: 100%;
position: fixed;
left: 30px;
right: 30px;
bottom: 50px;
width: 690px;
left: 0;
bottom: 0;
}
.toolbar_btn {
border-radius: 10px;
width: 100%;
box-sizing: border-box;
display: inline-block;

View File

@ -4,7 +4,6 @@ import Taro from '@tarojs/taro'
import { View, Text, Button } from '@tarojs/components'
import { classNames, formatPriceToHundred } from '@/utils'
import { SpOrderItem, SpNewShopItem } from '@/components'
import { AtCountdown } from 'taro-ui'
import './new-item.scss'
@ -43,7 +42,6 @@ export default class TradeItem extends Component {
payType,
pointName
} = this.props
const [int, decimal] = String(payment || '').split('.')
if (order_class === 'pointsmall') {
if (freight_type === 'point' || (freight_type === 'cash' && freight_fee == 0)) {
@ -74,16 +72,6 @@ export default class TradeItem extends Component {
)
}
// 修改地址
clickToEditAddress () {
const { choose } = this.props.info
console.log("🚀 ~ TradeItem ~ this.props.info:", this.props.info)
return
Taro.navigateTo({
url: `/marketing/pages/member/address?isSelected=${choose}`
})
}
render () {
const {
customFooter,
@ -93,8 +81,7 @@ export default class TradeItem extends Component {
showActions,
colors,
rateStatus,
isShowDistributorInfo,
onTimeUp = () => { }
isShowDistributorInfo
} = this.props
if (!info) {
@ -110,21 +97,7 @@ export default class TradeItem extends Component {
</View>
)}
<View className='trade-item__msg'>
<View className='' style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<View className='item lineone'>订单编号{info.tid}</View>
{info.status === 'WAIT_BUYER_PAY' && <View style={{ display: 'flex', alignItems: 'center' }}>
<Text style={{ marginRight: '6rpx', color: '#163586', fontSize: '20rpx' }}>等待付款 </Text>
{info.timer && <AtCountdown
format={{ day: '天', hours: ':', minutes: ':', seconds: '' }}
day={info.timer.dd}
hours={info.timer.hh}
minutes={info.timer.mm}
seconds={info.timer.ss}
isShowDay={info.timer.dd > 0}
onTimeUp={onTimeUp}
/>}
</View>}
</View>
<View className='item linetwo'>订单时间{info.create_date}</View>
</View>
<View className='trade-item__bd' onClick={onClick}>
@ -146,7 +119,7 @@ export default class TradeItem extends Component {
<View className='trade-item__ft'>
<View className='trade-item__ft-actions'></View>
<View className='trade-item__ft-bd'>
{/* <Text className='trade-item__status'>{info.status_desc}</Text> */}
<Text className='trade-item__status'>{info.status_desc}</Text>
{(info.order_status_des === 'PAYED' || info.order_status_des === 'NOTPAY') &&
!info.is_logistics &&
info.can_apply_cancel != 0 &&
@ -161,7 +134,7 @@ export default class TradeItem extends Component {
) : null}
<Button
className='btn-action'
style={`background: ${colors.data[0].primary};width:120rpx`}
style={`background: ${colors.data[0].primary}`}
onClick={this.handleClickBtn.bind(this, 'pay')}
>
去支付
@ -173,19 +146,17 @@ export default class TradeItem extends Component {
<View className='trade-item__ft'>
<View className='trade-item__ft-actions'></View>
<View className='trade-item__ft-bd'>
{/* <Text className='trade-item__status'>{info.status_desc}</Text> */}
{false && (info.order_status_des === 'PAYED' || info.order_status_des === 'NOTPAY') &&
<Text className='trade-item__status'>{info.status_desc}</Text>
{(info.order_status_des === 'PAYED' || info.order_status_des === 'NOTPAY') &&
info.can_apply_cancel != 0 &&
!info.is_logistics &&
(info.receipt_type !== 'dada' || (info.dada && info.dada.dada_status === 0)) ? (
<Button
className='btn-action'
style={`box-shadow: 0 0 0 1PX ${colors.data[0].primary}; color: ${colors.data[0].primary}`}
// onClick={this.handleClickBtn.bind(this, 'cancel')}
onClick={this.clickToEditAddress.bind(this)}
onClick={this.handleClickBtn.bind(this, 'cancel')}
>
{/* 取消订单 */}
修改地址
取消订单
</Button>
) : null}
{info.pay_status === 'PAYED' &&
@ -213,7 +184,7 @@ export default class TradeItem extends Component {
<View className='trade-item__ft'>
<View className='trade-item__ft-actions'></View>
<View className='trade-item__ft-bd'>
{/* <Text className='trade-item__status'>{info.status_desc}</Text> */}
<Text className='trade-item__status'>{info.status_desc}</Text>
<Button
className='btn-action'
style={`background: ${colors.data[0].primary}`}
@ -249,16 +220,7 @@ export default class TradeItem extends Component {
)}
</View>
<View className='trade-item__ft-bd'>
{/* <Text className='trade-item__status'>{info.status_desc}</Text> */}
{/* {info.receipt_type !== 'dada' && (
<Button
className='btn-action'
style={`box-shadow: 0 0 0 1PX ${colors.data[0].primary}; color: ${colors.data[0].primary}`}
onClick={this.handleClickBtn.bind(this, 'delivery')}
>
查看物流
</Button>
)} */}
<Text className='trade-item__status'>{info.status_desc}</Text>
{info.receipt_type !== 'dada' && (
<Button
className='btn-action'
@ -268,21 +230,22 @@ export default class TradeItem extends Component {
查看物流
</Button>
)}
{!info.aftersales_bn ? <Button
{info.receipt_type !== 'dada' && (
<Button
className='btn-action'
style={`background: ${colors.data[0].primary}`}
// onClick={this.handleClickBtn.bind(this, 'detail')}
style={`box-shadow: 0 0 0 1PX ${colors.data[0].primary}; color: ${colors.data[0].primary}`}
onClick={this.handleClickBtn.bind(this, 'confirm')}
>
确认收货
</Button> :
</Button>
)}
<Button
className='btn-action'
style={`background: ${colors.data[0].primary}`}
onClick={this.handleClickBtn.bind(this, 'aftersales')}
onClick={this.handleClickBtn.bind(this, 'detail')}
>
售后进度
</Button>}
订单详情
</Button>
</View>
</View>
)}
@ -303,8 +266,8 @@ export default class TradeItem extends Component {
</View>
</View>
<View className='trade-item__ft-bd'>
{/* <Text className='trade-item__status'>{info.status_desc}</Text> */}
{/* {rateStatus && info.is_rate == 0 ? (
<Text className='trade-item__status'>{info.status_desc}</Text>
{rateStatus && info.is_rate == 0 ? (
<Button
className='btn-action'
style={`box-shadow: 0 0 0 1PX ${colors.data[0].primary}; color: ${colors.data[0].primary}`}
@ -312,41 +275,22 @@ export default class TradeItem extends Component {
>
评价
</Button>
) : null} */}
{
!info.aftersales_bn && (
) : null}
{info.receipt_type === 'logistics' && (
<Button
className='btn-action'
style={`box-shadow: 0 0 0 1PX ${colors.data[0].primary}; color: ${colors.data[0].primary}`}
onClick={this.handleClickBtn.bind(this, 'aftersales')}
onClick={this.handleClickBtn.bind(this, 'delivery')}
>
{/* 查看物流 */}
{info.aftersales_bn ? '售后进度' : '申请售后'}
查看物流
</Button>
)}
{false && info.is_rate == 0 && !info.aftersales_bn && <Button
className='btn-action'
style={`background: ${colors.data[0].primary};width:120rpx`}
// onClick={this.handleClickBtn.bind(this, 'detail')}
onClick={this.handleClickBtn.bind(this, 'rate')}
>
{/* 查看详情 */}
评价
</Button>}
</View>
</View>
)}
{!customFooter && !!info.aftersales_bn && info.status !== 'WAIT_BUYER_CONFIRM_GOODS' && (
<View className='trade-item__ft'>
<View className='trade-item__ft-actions'></View>
<View className='trade-item__ft-bd'>
{/* <Text className='trade-item__status'>{info.status_desc}</Text> */}
<Button
className='btn-action'
style={`background: ${colors.data[0].primary}`}
onClick={this.handleClickBtn.bind(this, 'aftersales')}
onClick={this.handleClickBtn.bind(this, 'detail')}
>
售后进度
订单详情
</Button>
</View>
</View>

View File

@ -54,20 +54,6 @@
.linetwo {
color: #999999;
}
.at-countdown {
line-height: 30px;
&__time-box {
font-size: 20px;
color: #163586;
font-family: inherit;
font-weight: normal;
}
&__separator {
padding: 0;
font-size: 22px;
color: #163586;
}
}
}
&__total {
// padding: 0 $edge-size floor($edge-size/2);

View File

@ -2,8 +2,8 @@ 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 { AtCountdown } from 'taro-ui'
import { Loading, SpNavBar, FloatMenuMeiQia, SpNewShopItem, SpPage, SpPrice } from '@/components'
import {
log,
pickBy,
@ -84,9 +84,7 @@ export default class TradeDetail extends Component {
cancelData: {},
tradeInfo: {},
showQRcode: false,
distributor: {},
showDeliveryModal: false,
deliveryList: []
distributor: {}
}
}
@ -169,20 +167,16 @@ export default class TradeDetail extends Component {
point_use: 'point_use',
mobile: 'mobile',
dada: ({ dada }) => {
console.log('dada')
console.log(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_code: 'delivery_code',
delivery_name: 'delivery_corp_name',
delivery_type: 'delivery_type',
delivery_status: 'delivery_status',
pay_status: 'pay_status',
@ -226,13 +220,8 @@ export default class TradeDetail extends Component {
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
ziti_info: 'ziti_info'
})
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',
@ -491,30 +480,10 @@ export default class TradeDetail extends Component {
}
}
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) : ''
handleClickDelivery = () => {
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}`
})
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) => {
@ -699,15 +668,15 @@ export default class TradeDetail extends Component {
tradeInfo,
showQRcode,
pickup_code,
distributor,
showDeliveryModal,
deliveryList
distributor
} = this.state
if (!info) {
return <View style={{ marginTop: '100px' }}><Loading ></Loading></View>
return <Loading></Loading>
}
console.log('==tradeInfo==>', tradeInfo)
//订单未支付
const NOT_PAY = tradeInfo && tradeInfo.tradeState === 'NOTPAY'
@ -944,14 +913,14 @@ export default class TradeDetail extends Component {
{!this.isPointitemGood() && <Text>{info.receiver_mobile}</Text>}
</View>
</View>
{!!info.delivery_code && <>
<>
<View className="address-txt info-trade">
<Text>物流信息</Text>
<Text className='right' onClick={() => this.handleClickDelivery(true)}>查看详情</Text>
<Text className='right'>查看详情</Text>
</View>
<View className='address-detail' style={{ marginTop: '4rpx' }}>物流单号{info.delivery_code}</View>
<View className='address-detail'>物流公司{info.delivery_corp_name}</View>
</>}
<View className='address-detail' style={{ marginTop: '4rpx' }}>物流单号{info.receiver_name}</View>
<View className='address-detail'>物流公司{info.receiver_name}</View>
</>
<View className="address-txt info-trade">
<Text>支付方式</Text>
</View>
@ -965,21 +934,19 @@ export default class TradeDetail extends Component {
<View className='line'>
<View className='left'>订单金额</View>
<View className='right'>
<SpPrice size={20} value={info.item_fee_new} showSeparator noDecimal={false} />
{/* {transformTextByPoint(this.isPointitemGood(), info.item_fee_new, info.item_point)} */ console.log(transformTextByPoint(this.isPointitemGood(), info.item_fee_new, info.item_point), '-------')}
{transformTextByPoint(this.isPointitemGood(), info.item_fee_new, info.item_point)}
</View>
</View>
<View className='line'>
<View className='left'>优惠金额</View>
{/* 促销 + 优惠券 */}
<SpPrice size={20} value={info.promotion_discount + info.coupon_discount} showSeparator noDecimal={false} />
{/* <View className='right'>{`¥${parseFloat(info.promotion_discount + info.coupon_discount).toFixed(2)}`}</View> */}
<View className='right'>{`¥${parseFloat(info.promotion_discount + info.coupon_discount).toFixed(2)}`}</View>
</View>
<View className='line'>
<View className='left'>运费</View>
<View className='right'>
{info.freight_type !== 'point'
? <SpPrice size={20} value={info.freight_fee} showSeparator noDecimal={false} />
? `¥${info.freight_fee}`
: `${info.freight_fee * 100}${this.props.pointName}`}
</View>
</View>
@ -1020,7 +987,7 @@ export default class TradeDetail extends Component {
</View>
)}
{/* <View className='trade-money'> */}
<View className='trade-money'>
{/* <View>
总计
{this.isPointitemGood() ? (
@ -1048,7 +1015,7 @@ export default class TradeDetail extends Component {
</View>
</View>
)} */}
{/* </View> */}
</View>
{/* {info.remark && (
<View className='trade-detail-remark'>
<View className='trade-detail-remark__header'>订单备注</View>
@ -1172,7 +1139,7 @@ export default class TradeDetail extends Component {
<View className='left'>物流单号</View>
<View className='right'>
<Text className='info-text'>{info.delivery_code}</Text>
<Text className='info-text-btn' onClick={this.handleClickDelivery.bind(this, true)}>
<Text className='info-text-btn' onClick={this.handleClickDelivery.bind(this)}>
查看物流
</Text>
<Text
@ -1199,7 +1166,7 @@ export default class TradeDetail extends Component {
<Button
className='trade-detail__footer__btn trade-detail__footer_active trade-detail__footer_allWidthBtn'
type='primary'
style={`background: ${colors.data[0].primary}; border-color: ${colors.data[0].primary}; color: #fff;`}
style={`background: ${colors.data[0].primary}; border-color: ${colors.data[0].primary}`}
loading={payLoading}
onClick={this.handleClickBtn.bind(this, 'pay')}
>
@ -1221,7 +1188,6 @@ export default class TradeDetail extends Component {
// info.order_class !== 'excard' &&
// !VERSION_IN_PURCHASE &&
// !this.isPointitemGood() && (
// 先禁止掉!!!
info.can_apply_aftersales === 1 && (
<View
className={`trade-detail__footer__btn ${info.is_logistics &&
@ -1234,8 +1200,8 @@ export default class TradeDetail extends Component {
)
}
{
// 继续购物 先禁止掉!!!
false && (info.status === 'WAIT_SELLER_SEND_GOODS' ||
// 继续购物
(info.status === 'WAIT_SELLER_SEND_GOODS' ||
(info.status === 'WAIT_BUYER_CONFIRM_GOODS' &&
info.receipt_type === 'dada' &&
info.receipt_type !== 'dada') ||
@ -1265,14 +1231,14 @@ export default class TradeDetail extends Component {
<View
className={`trade-detail__footer__btn trade-detail__footer_active ${info.can_apply_aftersales === 0 && 'trade-detail__footer_allWidthBtn'
}`}
style={`background: ${colors.data[0].primary}; border-color: ${colors.data[0].primary};color:#fff`}
style={`background: ${colors.data[0].primary}; border-color: ${colors.data[0].primary}`}
onClick={this.handleClickBtn.bind(this, 'confirm')}
>
确认收货
</View>
)
}
{/* {
{
// 联系客服
(info.status === 'TRADE_SUCCESS' ||
(info.receipt_type === 'dada' && info.dada.dada_status === 9)) &&
@ -1299,7 +1265,7 @@ export default class TradeDetail extends Component {
)}
</View>
)
} */}
}
</View>
)}
@ -1315,35 +1281,6 @@ export default class TradeDetail extends Component {
</View>
</View>
)}
<AtCurtain
className='curtain'
isOpened={showDeliveryModal}
onClose={() => {
this.handleClickDelivery(false)
}}
>
<View className="curtain_content">
<View className="curtain_content_title">
<SpImage src={`member/logo-black.png`} height={32} mode='heightFix' isNew />
<Text className="" style={{ marginLeft: '6px' }}>物流信息</Text>
</View>
<View className="receiver_name">
{info.delivery_corp_name}{info.delivery_code}
</View>
<ScrollView scrollY
scrollWithAnimation className="curtain_content_text" showScrollbar={false} enhanced>
{deliveryList.map((item, index) => <View class="receiver_item" key={`item_${index}`}>
<View className="receiver_item_left">
{item.content}
</View>
<View className="receiver_item_right">
{item.title}
</View>
</View>)}
</ScrollView>
</View>
</AtCurtain>
</SpPage>
)
}

View File

@ -26,7 +26,7 @@ $paddingBottom: 100px;
}
.scroll-view {
@include page-scroll(calc(var(--nav-height) + 16px), 140px);
@include page-scroll(var(--nav-height), 140px);
}
&.has-navbar {
@ -249,7 +249,7 @@ $paddingBottom: 100px;
}
}
.trade-detail-goods {
margin: 0px 22px;
margin: 14px 22px 0;
// padding-top: 16px;
padding: 40px 30px 40px 20px;
min-height: 100px;
@ -456,8 +456,7 @@ $paddingBottom: 100px;
left: 0;
width: 100%;
height: 100px;
// bottom: $edge-margin;
bottom: 0;
bottom: $edge-margin;
background: #fff;
display: flex;
justify-content: space-evenly;
@ -516,7 +515,6 @@ $paddingBottom: 100px;
position: initial;
transform: inherit;
margin: 0 20px;
margin-bottom: 80px;
width: calc(100% - 40px);
}
}
@ -698,73 +696,4 @@ $paddingBottom: 100px;
color: #0091ff;
font-size: 28px;
}
.curtain {
.at-curtain__container {
width: 100%;
padding: 0 30px;
}
.at-curtain__btn-close--bottom {
// display: none;
border: none;
top: 10px;
right: 10px;
left: auto;
&::after,
&::before {
background-color: #000;
}
}
&_content {
width: 100%;
background-color: #fff;
border-radius: 10px;
padding: 100px 46px;
box-sizing: border-box;
&_title {
display: flex;
justify-content: center;
align-items: center;
font-size: 36px;
line-height: 1;
margin-bottom: 80px;
color: #000;
.sp-image {
margin-right: 4px;
}
}
.receiver_name {
font-size: 26px;
color: #000;
margin: 80px 0;
}
&_text {
line-height: 1.4;
height: 650px;
color: #000;
font-size: 26px;
.receiver_item {
display: flex;
box-sizing: border-box;
font-size: 20px;
&:not(:last-child) {
margin-bottom: 30px;
}
&_left {
width: 190px;
font-size: 20px;
}
&_right {
flex: 1;
font-size: 20px;
}
}
}
}
.no-text {
color: #7e7e7e;
font-size: 20rpx;
margin-top: 28rpx;
line-height: 1.4;
}
}
}

View File

@ -5,59 +5,26 @@ import { Loading, SpPage, SpPrice, SpCheckboxNew } from '@/components'
import api from '@/api'
import { classNames, navigateTo } from '@/utils'
import { AtModal, AtIcon } from 'taro-ui'
import { log, pickBy, resolveOrderStatus, authSetting } from '@/utils'
import doc from '@/doc'
// import { log, pickBy, resolveOrderStatus, authSetting } from '@/utils'
import './invoice-info.scss'
import { useImmer } from 'use-immer'
import { useEffect } from 'react'
const initState = {
formList: [
{
name: '抬头类型',
type: 'checkbox',
key: 'title',
key: 'invoice_title',
required: true,
},
{
name: '发票抬头',
type: 'input',
key: 'content',
key: 'invoice_title',
placeholder: '请填写抬头名称(必填)',
required: true,
},
{
name: '企业税号',
type: 'input',
key: 'registration_number',
placeholder: '请填写企业税号(选填)',
required: true,
},
{
name: '注册地址',
type: 'input',
key: 'company_address',
placeholder: '(选填)',
},
{
name: '注册电话',
type: 'input',
key: 'company_phone',
placeholder: '(选填)',
},
{
name: '开户银行',
type: 'input',
key: 'bankname',
placeholder: '(选填)',
},
{
name: '银行账号',
type: 'input',
key: 'bankaccount',
placeholder: '(选填)',
},
{
name: '邮箱地址',
type: 'input',
@ -65,52 +32,42 @@ const initState = {
placeholder: '用于接收电子发票(必填)',
required: true,
},
{
name: '注册地址',
type: 'input',
key: 'addr',
placeholder: '(选填)',
},
{
name: '注册电话',
type: 'input',
key: 'tel',
placeholder: '(选填)',
},
{
name: '开户银行',
type: 'input',
key: 'yh',
placeholder: '(选填)',
},
{
name: '银行账号',
type: 'input',
key: 'zh',
placeholder: '(选填)',
},
],
form: {},
showModal: false,
visible: false,
showDetail: false,
invoiceId: '',
invoice: {},
orderInfo: {},
loading: false,
title: '',
totalFee: '',
toastShow: false,
invoiceInfo: {}
showDetail: false
}
function InvoiceInfo (props) {
const $instance = getCurrentInstance()
const [state, setState] = useImmer(initState)
const { formList, form, showModal, visible, showDetail, invoiceId, invoice, orderInfo, loading, title, totalFee, toastShow, invoiceInfo } = state
const pages = getCurrentPages()
const current = pages[pages.length - 1]
const eventChannel = current.getOpenerEventChannel()
const { formList, form, showModal, visible, showDetail } = state
useEffect(() => {
const { id } = $instance.router.params
if (id && id !== 'undefined') {
setState((draft) => {
draft.showDetail = true,
draft.invoiceId = id
})
}
// 监听acceptDataFromOpenerPage事件获取上一页面通过eventChannel传送到当前页面的数据
eventChannel?.on('acceptDataFromOpenerPage', function ({ data }) {
setState((draft) => {
draft.orderInfo = data.order || data || {}
draft.invoiceInfo = data.invoice || {}
draft.form = data.order?.invoice || {}
draft.title = data.order?.title ? data.order.title === 'unit' ? '个人' : '企业' : ''
draft.totalFee = data.order?.total_fee ?? ''
})
})
}, [])
const onChangeItemCheck = () => {
const onChangeItemCheck = (val) => {
setState((draft) => {
draft.form = { ...form, title: val }
})
}
const hadnleInput = (val, item) => {
@ -126,171 +83,41 @@ function InvoiceInfo (props) {
})
}
const handleSubmit = async () => {
const { email } = form
const emailReg = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
if (!emailReg.test(email)) {
Taro.showToast({
title: '邮箱格式不正确',
icon: 'none',
duration: 1000
})
return
}
setState((draft) => {
draft.visible = false
// draft.toastShow = true
// draft.showModal = true
})
const res = await api.trade.involiceResend({
order_id: orderInfo.order_id,
email
})
Taro.showToast({
title: '发送成功',
icon: 'success',
duration: 1500
})
setTimeout(() => {
Taro.navigateBack()
}, 2000)
}
const handSubmitInvoice = () => {
const { email, title, content } = form
if (!title) {
Taro.showToast({
title: '请选择抬头类型',
icon: 'none',
duration: 1000
})
return
}
if (!content) {
Taro.showToast({
title: '请填写抬头名称',
icon: 'none',
duration: 1000
})
return
}
const emailReg = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
if (!emailReg.test(email)) {
Taro.showToast({
title: '邮箱格式不正确',
icon: 'none',
duration: 1000
})
return
}
eventChannel?.emit('acceptDataFromOpenedPage', { data: invoice })
Taro.navigateBack()
}
const handleInvoiceClick = () => {
authSetting('invoiceTitle', async () => {
const res = await Taro.chooseInvoiceTitle()
if (res.errMsg === 'chooseInvoiceTitle:ok') {
// log.debug('[invoice] info:', res)
const {
type,
content,
company_address,
bankname,
bankaccount,
company_phone,
registration_number
} = pickBy(res, doc.checkout.INVOICE_TITLE)
let invoice_parmas = {
invoice_type: 'normal',
invoice_content: {
title: type == 0 ? 'unit' : 'individual',
content,
company_address,
registration_number,
bankname,
bankaccount,
company_phone
}
}
// console.log("🚀 ~ invoice_parmas:", invoice_parmas)
setState((draft) => {
draft.invoice = {
invoiceTitle: content,
paramsInfo: invoice_parmas
}
draft.form = invoice_parmas.invoice_content
})
}
})
}
// 预览文件
const preview = (url, fileName) => {
Taro.downloadFile({
url: url,
success: function (res) {
console.log("下载:", res)
var filePath = res.tempFilePath
Taro.openDocument({
filePath: filePath,
fileType: getFileType(url),
fileName: fileName,
success: function (res) {
console.log("打开:", res)
},
})
},
})
}
// 获取文件类型
const getFileType = (name = '') => {
if (name.lastIndexOf(".") > -1) {
return name.slice(name.lastIndexOf(".") + 1).toLowerCase()
} else {
return ""
}
}
return <SpPage className='page-invoice-info has-navbar' loading={loading} navigationBarTitleText='开票信息'>
return <SpPage className='page-invoice-info has-navbar' navigationBarTitleText='开票信息'>
<View className="info-bd">
{showDetail && <View className="info-bd-tips">{1}张发票{1}个订单</View>}
{showDetail && <View className="info-bd-tips">{0}张发票{1}个订单</View>}
<View className="info-item">
<View className="tit">发票类型</View>
<View className="content">
<Text>电子发票</Text>
{showDetail ? <View className='flex'>
<Text className='ck' onClick={() => preview(invoiceInfo.pdf_info, invoiceInfo.invoice_title + invoiceInfo.invoice_no)}>查看</Text>
<Text className='iconfont icon-qianwang-01'></Text>
{/* <AtIcon value='chevron-right' size='18' color='#000'></AtIcon> */}
</View> : <Text className='sq' onClick={handleInvoiceClick}></Text>}
<Text className='ck'>查看</Text>
<AtIcon value='chevron-right' size='18' color='#000'></AtIcon>
</View> : <Text className='sq'></Text>}
</View>
</View>
{showDetail && <View className="info-item">
<View className="tit">发票状态</View>
<View className="content">
<Text>{orderInfo.is_invoiced == 1 ? '已开票' : '已申请'}</Text>
<Text>已申请</Text>
</View>
</View>}
<View className="info-item">
<View className="tit">发票金额</View>
<View className="content">
<Text>¥{totalFee ? parseFloat(totalFee).toFixed(2) : (orderInfo.total_fee ? (orderInfo.total_fee / 100).toFixed(2) : 0)}</Text>
<Text>¥9999</Text>
</View>
</View>
{formList.map((item) => <View className="info-item">
<View className="tit">{item.name}</View>
{showDetail && item.key !== 'email' ? <View className="content">{item.key === 'title' ? title || orderInfo.invoice?.[item.key] || form[item.key] : orderInfo.invoice?.[item.key] || form[item.key] || ''}</View> : <>{item.type === 'checkbox' && <View className="content">
{showDetail ? <View className="content">{form[item.key] || '测试'}</View> : <>{item.type === 'checkbox' && <View className="content">
<View className="content-item">
<SpCheckboxNew checked={form.title === 'individual'} onChange={() => onChangeItemCheck('individual')} >
<SpCheckboxNew checked={form.gr === '1'} onChange={() => onChangeItemCheck()} >
<Text className="">个人/非企业单位</Text>
</SpCheckboxNew>
</View>
<View className="content-item">
<SpCheckboxNew checked={form.title === 'unit'} onChange={() => onChangeItemCheck('unit')} >
<SpCheckboxNew checked={form.gr === '2'} onChange={onChangeItemCheck()} >
<Text className="">企业</Text>
</SpCheckboxNew>
</View>
@ -310,20 +137,11 @@ function InvoiceInfo (props) {
</View>
</View>}
</View>
{!showDetail ? <View className={classNames("bottom")}>
<View onClick={() => {
handSubmitInvoice()
// setState((draft) => {
// draft.visible = true
// })
}} className={classNames("btn", { "btn-disabled": !form.title || !form.content || !form.email })}>提交申请</View>
</View> : orderInfo.is_invoiced == 1 && <View className={classNames("bottom")}>
<View onClick={() => {
setState((draft) => {
<View className={classNames("bottom")}>
<View onClick={() => setState((draft) => {
draft.visible = true
})
}} className={classNames("btn")}>重发发票</View>
</View>}
})} className={classNames("btn", { "btn-disabled": true })}>提交申请</View>
</View>
<View className="sp-picker">
<View
@ -350,31 +168,29 @@ function InvoiceInfo (props) {
</View>
<View className='sp-picker-bd-item'>
<View className="tit">抬头类型</View>
<View className="content">{form.title === 'unit' ? '企业' : '个人'}</View>
<View className="content">电子发票</View>
</View>
<View className='sp-picker-bd-item'>
<View className="tit">发票抬头</View>
<View className="content">{form.content}</View>
</View>
<View className='sp-picker-bd-item'>
<View className="tit">税号</View>
<View className="content">{form.registration_number}</View>
<View className="content">电子发票</View>
</View>
</>}
<View className='sp-picker-bd-item'>
<View className="tit">邮箱地址</View>
<View className="content">{form.email}</View>
<View className="content">电子发票</View>
</View>
<View onClick={handleSubmit} className={classNames("btn", { "notop": showDetail })}>提交申请</View>
<View onClick={() => setState((draft) => {
draft.visible = false
draft.showModal = true
})} className={classNames("btn", { "notop": showDetail })}>提交申请</View>
</View>
</View>
</View>
<View className={classNames('toast', {
visible: toastShow
visible: false
})}>
{/* <View></View>
<View>不可操作重开发票</View> */}
<View>提交申请成功请耐心等待</View>
<View>已超重开发票时限</View>
<View>不可操作重开发票</View>
</View>
<AtModal

View File

@ -58,10 +58,6 @@
color: #163586;
margin-right: 2px;
}
.icon-qianwang-01 {
font-size: 20px;
color: #000;
}
}
}
.ipt {
@ -70,7 +66,7 @@
font-size: 26px;
line-height: 1;
color: #000;
// padding-right: 40px;
padding-right: 40px;
box-sizing: border-box;
&-placeholder {
color: #808080;
@ -194,9 +190,6 @@
display: flex;
flex: 1;
color: #000;
.icon-qianwang-01 {
font-size: 20px;
}
}
}
.btn {

View File

@ -45,7 +45,7 @@ export default class InvoiceList extends Component {
tid: 'order_id',
status_desc: 'order_status_msg',
status: ({ order_status }) => resolveOrderStatus(order_status),
totalItems: ({ items }) => items?.reduce((acc, item) => +item.num + acc, 0),
totalItems: ({ items }) => items.reduce((acc, item) => +item.num + acc, 0),
payment: ({ total_fee }) => (total_fee / 100).toFixed(2),
pay_type: 'pay_type',
point: 'point',
@ -169,7 +169,7 @@ export default class InvoiceList extends Component {
</View>
)
})}
{!page.isLoading && list?.length > 0 && <View className="bottom">
{!page.isLoading && list?.length && <View className="bottom">
<View className="bottom-line">
<View className="left">已选{1}个订单共计
<SpPrice size={20} className='total-pirce' value={900900 / 100} showSeparator noDecimal />
@ -182,7 +182,7 @@ export default class InvoiceList extends Component {
onChange={this.onChangeItemCheck.bind(this, {})}
/>
<View className="bottom-txt">本页全选</View>
<View className="bottom-btn" onClick={() => Taro.navigateTo({ url: '/subpage/pages/trade/invoice-info' })}>下一步</View>
<View className="bottom-btn">下一步</View>
</View>
</View>}
{/*<AtButton

View File

@ -5,7 +5,7 @@ import _mapKeys from 'lodash/mapKeys'
import { Loading, SpNote, SpPage, SpPrice, SpCheckboxNew } from '@/components'
import api from '@/api'
import { withPager, withLogin } from '@/hocs'
import { log, pickBy, resolveOrderStatus, authSetting, formatDateTime } from '@/utils'
import { log, pickBy, resolveOrderStatus, authSetting } from '@/utils'
import { AtIcon } from 'taro-ui'
import './invoice-record.scss'
@ -45,32 +45,27 @@ export default class InvoiceList extends Component {
tid: 'order_id',
status_desc: 'order_status_msg',
status: ({ order_status }) => resolveOrderStatus(order_status),
totalItems: ({ items }) => items?.reduce((acc, item) => +item.num + acc, 0),
totalItems: ({ items }) => items.reduce((acc, item) => +item.num + acc, 0),
payment: ({ total_fee }) => (total_fee / 100).toFixed(2),
pay_type: 'pay_type',
point: 'point',
create_date: 'create_date',
invoice: ({ invoice }) => invoice ? JSON.parse(invoice) : {},
id: 'id',
order: ({ items }) =>
pickBy(items, {
order_id: 'order_id',
status: 'status',
order: ({ order: { orderInfo }, order }) => {
return order.orderInfo ? {
time: formatDateTime(orderInfo.create_time),
tid: orderInfo.order_id,
total_fee: orderInfo.total_fee / 100,
order_id: orderInfo.order_id,
title: orderInfo.title,
invoice: orderInfo.invoice,
is_invoiced: orderInfo.is_invoiced
} : {}
}
item_id: 'item_id',
pic_path: 'pic',
title: 'item_name',
price: ({ item_fee }) => (+item_fee / 100).toFixed(2),
point: 'item_point',
num: 'num'
})
})
log.debug('[trade list] list fetched and processed: ', nList)
this.setState({
list: [...this.state.list, ...nList]
list: [...this.state.list, ...nList, {}, {}, {}, {}, {}, {}, {}, {}]
})
return { total }
@ -135,14 +130,6 @@ export default class InvoiceList extends Component {
onChangeItemCheck = (item) => {
console.log(item, 'ckeck点击')
}
goDetail = (item) => {
Taro.navigateTo({
url: `/subpage/pages/trade/invoice-info?id=${item.id}`,
success: function (res) {
res.eventChannel?.emit('acceptDataFromOpenerPage', { data: item })
}
})
}
render () {
const { list, page } = this.state
@ -152,23 +139,18 @@ export default class InvoiceList extends Component {
<ScrollView scrollY className='trade-list__scroll' onScrollToLower={this.nextPage}>
{list.map((item, idx) => {
return (
<View className='invoice-item' onClick={() => this.goDetail(item)} key={`invoice_item_${idx}`}>
<View className="right-item">商品名称{item.order?.title}</View>
<View className='invoice-item-box'>
<View className='invoice-item' key={`invoice_item_${idx}`}>
<View className="right">
<View className="right-item">订单编号{item.order?.order_id}</View>
<View className="right-item">发票金额
<SpPrice size={26} className='total-pirce' value={item.order?.total_fee} showSeparator noDecimal={false} />
<View className="right-item">{idx + 1}发票金额
<SpPrice size={28} className='total-pirce' value={item.payment / 100} showSeparator noDecimal />
</View>
<View className="right-item">发票类型电子发票</View>
<View className="right-item">抬头类型{item.order?.invoice?.title === 'unit' ? '企业' : '个人'}</View>
<View className="right-item">申请时间{item.order?.time || ''}</View>
<View className="right-item">抬头类型{item.create_date}</View>
<View className="right-item">申请时间{item.create_date || '2023-12-18 10:10'}</View>
</View>
<View className="status">
<Text className="txt">{item.order?.is_invoiced == 1 ? '已开票' : "已申请"}</Text>
{/* <AtIcon value='chevron-right' size={20} color='#888'></AtIcon> */}
<Text className='iconfont icon-qianwang-01'></Text>
</View>
<Text className="txt">已申请</Text>
<AtIcon value='chevron-right' size='18' color='#888'></AtIcon>
</View>
</View>
)

View File

@ -4,9 +4,9 @@
.trade-list {
&__scroll {
// @include page-scroll($tabs-height + $navigate-height + 10px, 0);
@include page-scroll(var(--nav-height), 10px);
@include page-scroll(var(--nav-height), 140px);
padding-top: 20px;
padding-bottom: 50px;
padding-bottom: 210px;
}
}
.invoice-item {
@ -15,23 +15,18 @@
box-sizing: border-box;
background: #f7f7f7;
border-radius: 6px;
&-box {
display: flex;
align-items: center;
justify-content: space-between;
}
.icon-qianwang-01 {
font-size: 26px;
}
.right-item {
color: #000;
margin-bottom: 20px;
font-size: 26px;
line-height: 1;
}
.right {
display: flex;
flex-direction: column;
margin-left: 10px;
&-item {
color: #000;
margin-bottom: 20px;
line-height: 1;
}
&-item:last-child {
margin-bottom: 0;
}
@ -41,7 +36,7 @@
display: flex;
align-items: center;
.txt {
margin-right: 14px;
margin-right: 20px;
}
}
}

View File

@ -1,10 +1,10 @@
import React, { Component } from 'react'
import Taro, { getCurrentInstance } from '@tarojs/taro'
import { View, ScrollView, Text } from '@tarojs/components'
import { View, ScrollView } from '@tarojs/components'
import { connect } from 'react-redux'
import { AtTabs, AtTabsPane, AtCurtain } from 'taro-ui'
import { AtTabs, AtTabsPane } from 'taro-ui'
import _mapKeys from 'lodash/mapKeys'
import { Loading, SpNote, SpNavBar, SpPage, SpImage } from '@/components'
import { Loading, SpNote, SpNavBar, SpPage } from '@/components'
import api from '@/api'
import { withPager } from '@/hocs'
import {
@ -15,8 +15,7 @@ import {
classNames,
isNavbar,
getBrowserEnv,
VERSION_PLATFORM,
formatDateTime
VERSION_PLATFORM
} from '@/utils'
import { Tracker } from '@/service'
import TradeItem from './comps/new-item'
@ -45,11 +44,7 @@ export default class TradeList extends Component {
evaluate: 1,
list: [],
rate_status: false,
curItemActionsId: null,
showDeliveryModal: false,
deliveryList: [],
deliveryName: '',
deliveryCode: ''
curItemActionsId: null
}
}
@ -57,8 +52,7 @@ export default class TradeList extends Component {
const { status = 0, evaluate = 1 } = this.$instance.router.params
const _tabList = JSON.parse(JSON.stringify(this.state.tabList))
if (evaluate == 1) {
// _tabList.push({ title: '待评价', status: '7', is_rate: 0 })
_tabList.push({ title: '已完成', status: '7', is_rate: 0 })
_tabList.push({ title: '待评价', status: '7', is_rate: 0 })
_tabList.push({ title: '售后', status: '---', is_rate: 0 })
}
const tabIdx = _tabList.findIndex((tab) => tab.status === status)
@ -86,10 +80,7 @@ export default class TradeList extends Component {
onPullDownRefresh = () => {
Tracker.dispatch('PAGE_PULL_DOWN_REFRESH')
this.refresh()
}
refresh = () => {
Taro.showLoading({
title: '加载中',
icon: 'none'
@ -107,24 +98,6 @@ export default class TradeList extends Component {
this.hideLayer()
}
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 (params) {
const { tabList, curTabIdx } = this.state
@ -143,39 +116,18 @@ export default class TradeList extends Component {
}
)
let list = [],
total = 0,
rate_status = false
if (params.status === '---') {
params.aftersales_status = 0
const { list: _list, total_count: _total } = await api.aftersales.list(params)
list = _list
total = _total
rate_status = true
} else {
const {
list: _list,
pager: { count: _total },
rate_status: _rate_status
list,
pager: { count: total },
rate_status
} = await api.trade.list(params)
list = _list
total = _total
rate_status = _rate_status
}
let nList = pickBy(list, {
tid: 'order_id',
status_desc: 'order_status_msg',
order_status_des: 'order_status_des',
aftersales_bn: ({ aftersales_bn, aftersales }) => {
return aftersales_bn || aftersales?.aftersales_bn
},
aftersales_type: ({ aftersales }) => {
return aftersales?.aftersales_type
},
status: ({ order_status }) => resolveOrderStatus(order_status),
totalItems: ({ items }) => items?.reduce((acc, item) => +item.num + acc, 0),
// payment: ({ item_fee_new }) => (item_fee_new / 100).toFixed(2),
payment: ({ total_fee, refund_fee }) => ((+total_fee || refund_fee) / 100).toFixed(2),
totalItems: ({ items }) => items.reduce((acc, item) => +item.num + acc, 0),
payment: ({ item_fee_new }) => (item_fee_new / 100).toFixed(2),
total_fee: 'total_fee',
pay_type: 'pay_type',
point: 'point',
@ -185,9 +137,7 @@ export default class TradeList extends Component {
type: 'type',
is_rate: 'is_rate',
dada: 'dada',
create_date: ({ create_date, create_time }) => {
return create_date || formatDateTime(create_time * 1000)
},
create_date: 'create_date',
is_all_delivery: 'is_all_delivery',
is_logistics: 'is_split',
receipt_type: 'receipt_type',
@ -202,8 +152,8 @@ export default class TradeList extends Component {
orders_delivery_id: 'orders_delivery_id',
order_type: 'order_type',
can_apply_cancel: 'can_apply_cancel',
order: ({ items, detail }) =>
pickBy(items || detail, {
order: ({ items }) =>
pickBy(items, {
order_id: 'order_id',
item_id: 'item_id',
pic_path: 'pic',
@ -212,14 +162,12 @@ export default class TradeList extends Component {
origincountry_img_url: 'origincountry_img_url',
type: 'type',
item_spec_desc: 'item_spec_desc',
// price: ({ item_fee_new }) => (item_fee_new / 100).toFixed(2),
price: ({ total_fee }) => (+total_fee / 100).toFixed(2),
price: ({ item_fee_new }) => (item_fee_new / 100).toFixed(2),
item_fee: 'item_fee',
point: 'item_point',
num: 'num',
order_item_type: 'order_item_type'
}),
timer: ({ auto_cancel_time, create_time }) => auto_cancel_time > parseInt(new Date().getTime() / 1000) ? this.calcTimer(auto_cancel_time - parseInt(new Date().getTime() / 1000)) : null
})
})
log.debug('[trade list] list fetched and processed: ', nList)
@ -256,11 +204,9 @@ export default class TradeList extends Component {
}
handleClickItem = (trade) => {
const { tid, aftersales_bn } = trade
const { tid } = trade
let url = `/subpage/pages/trade/detail?id=${tid}`
if (aftersales_bn) {
url = `/subpages/trade/after-sale?aftersales_bn=${aftersales_bn}&id=${tid}`
}
if (trade.order_class === 'pointsmall') {
url += `&type=pointitem`
@ -273,7 +219,7 @@ export default class TradeList extends Component {
handleClickItemBtn = async (trade, type) => {
console.log(trade)
const { tid, aftersales_bn } = trade
const { tid } = trade
let detailUrl = `/subpage/pages/trade/detail?id=${tid}`
@ -301,11 +247,6 @@ export default class TradeList extends Component {
url: `/marketing/pages/item/rate?id=${tid}`
})
break
case 'aftersales':
Taro.navigateTo({
url: `/subpages/trade/after-sale?id=${tid}&aftersales_bn=${aftersales_bn || ''}`
})
break
case 'delivery':
{
let {
@ -318,17 +259,16 @@ export default class TradeList extends Component {
tid,
order_type
} = trade
this.handleClickDelivery(true, trade)
// if (is_all_delivery || delivery_type === 'old') {
// Taro.navigateTo({
// url: `/subpage/pages/trade/delivery-info?delivery_id=${orders_delivery_id}&delivery_code=${delivery_code}&delivery_corp=${delivery_corp}&delivery_name=${delivery_corp_name || delivery_corp
// }&delivery_type=${delivery_type}&order_type=${order_type}&order_id=${tid}`
// })
// } else {
// Taro.navigateTo({
// url: `/subpage/pages/trade/split-bagpack?order_type=${order_type}&order_id=${tid}`
// })
// }
if (is_all_delivery || delivery_type === 'old') {
Taro.navigateTo({
url: `/subpage/pages/trade/delivery-info?delivery_id=${orders_delivery_id}&delivery_code=${delivery_code}&delivery_corp=${delivery_corp}&delivery_name=${delivery_corp_name || delivery_corp
}&delivery_type=${delivery_type}&order_type=${order_type}&order_id=${tid}`
})
} else {
Taro.navigateTo({
url: `/subpage/pages/trade/split-bagpack?order_type=${order_type}&order_id=${tid}`
})
}
}
break
default:
@ -338,38 +278,13 @@ export default class TradeList extends Component {
}
}
handleClickDelivery = async (flag, trade) => {
if (flag) {
Taro.showLoading({ title: '' })
let { delivery_type, delivery_id, order_type, tid: order_id } = trade
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,
deliveryName: trade.delivery_corp_name,
deliveryCode: trade.delivery_code
})
}
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}`
// })
}
handleActionClick = (type, item) => {
console.log(type, item)
this.hideLayer()
}
handleActionBtnClick = (item) => {
console.log(item)
this.setState({
curItemActionsId: item.tid
})
@ -390,12 +305,7 @@ export default class TradeList extends Component {
list = [],
page,
rateStatus,
evaluate,
showDeliveryModal,
deliveryList,
info = {},
deliveryName,
deliveryCode
evaluate
} = this.state
return (
@ -437,7 +347,6 @@ export default class TradeList extends Component {
onClickBtn={this.handleClickItemBtn.bind(this, item)}
onActionBtnClick={this.handleActionBtnClick.bind(this, item)}
onActionClick={this.handleActionClick.bind(this, item)}
onTimeUp={this.refresh}
/>
)
})}
@ -449,34 +358,6 @@ export default class TradeList extends Component {
)}
{!!curItemActionsId && <View className='layer' onClick={this.hideLayer} />}
</ScrollView>
<AtCurtain
className='curtain'
isOpened={showDeliveryModal}
onClose={() => {
this.setState({ showDeliveryModal: false })
}}
>
<View className="curtain_content">
<View className="curtain_content_title">
<SpImage src={`member/logo-black.png`} height={32} mode='heightFix' isNew />
<Text className="" style={{ marginLeft: '6px' }}>物流信息</Text>
</View>
<View className="receiver_name">
{deliveryName}{deliveryCode}
</View>
<ScrollView scrollY
scrollWithAnimation className="curtain_content_text" showScrollbar={false} enhanced>
{deliveryList.map((item, index) => <View class="receiver_item" key={`item_${index}`}>
<View className="receiver_item_left">
{item.content}
</View>
<View className="receiver_item_right">
{item.title}
</View>
</View>)}
</ScrollView>
</View>
</AtCurtain>
</SpPage>
)
}

View File

@ -148,75 +148,6 @@
color: #000;
}
}
.curtain {
.at-curtain__container {
width: 100%;
padding: 0 30px;
}
.at-curtain__btn-close--bottom {
// display: none;
border: none;
top: 10px;
right: 10px;
left: auto;
&::after,
&::before {
background-color: #000;
}
}
&_content {
width: 100%;
background-color: #fff;
border-radius: 10px;
padding: 100px 46px;
box-sizing: border-box;
&_title {
display: flex;
justify-content: center;
align-items: center;
font-size: 36px;
line-height: 1;
margin-bottom: 80px;
color: #000;
.sp-image {
margin-right: 4px;
}
}
.receiver_name {
font-size: 26px;
color: #000;
margin: 80px 0;
}
&_text {
line-height: 1.4;
height: 650px;
color: #000;
font-size: 26px;
.receiver_item {
display: flex;
box-sizing: border-box;
font-size: 20px;
&:not(:last-child) {
margin-bottom: 30px;
}
&_left {
width: 190px;
font-size: 20px;
}
&_right {
flex: 1;
font-size: 20px;
}
}
}
}
.no-text {
color: #7e7e7e;
font-size: 20rpx;
margin-top: 28rpx;
line-height: 1.4;
}
}
}
// .trade-item__hd-cont{

View File

@ -3,7 +3,7 @@ import Taro, { getCurrentInstance } from '@tarojs/taro'
import { View, Text, Button, Image, ScrollView } from '@tarojs/components'
import { connect } from 'react-redux'
import { AtCountdown } from 'taro-ui'
import { Loading, SpToast, SpNavBar, FloatMenuMeiQia, SpImg, SpPage } from '@/components'
import { Loading, SpToast, SpNavBar, FloatMenuMeiQia, SpImg } from '@/components'
import { pickBy, formatTime, resolveOrderStatus } from '@/utils'
import api from '@/api'
@ -68,8 +68,8 @@ export default class TradeDetail extends Component {
}
return (
<SpPage className='wuliu-detail has-nav' title='订单详情'>
{/* <SpNavBar title='订单详情' leftIconType='chevron-left' fixed='true' /> */}
<View className='wuliu-detail'>
<SpNavBar title='订单详情' leftIconType='chevron-left' fixed='true' />
<View className='wuliu-detail'>
<View className='title-status'>您有{delivery_num}个包裹已发出</View>
@ -112,7 +112,7 @@ export default class TradeDetail extends Component {
{/* <DetailItem info={info} /> */}
</View>
<SpToast></SpToast>
</SpPage>
</View>
)
}
}

View File

@ -1,4 +1,4 @@
import React, { useEffect, useRef } from 'react'
import React, { useEffect } from 'react'
import { useSelector } from 'react-redux'
import { useImmer } from 'use-immer'
import Taro, { getCurrentInstance } from '@tarojs/taro'
@ -6,7 +6,7 @@ import api from '@/api'
import doc from '@/doc'
import qs from 'qs'
import { View, Text } from '@tarojs/components'
import { pickBy, showToast, isWeixin, entryLaunch, styleNames, thousandthFormat } from '@/utils'
import { pickBy, showToast, isWeixin, entryLaunch, styleNames } from '@/utils'
import { SpPage, SpScrollView, SpCoupon, SpImage } from '@/components'
import './coupon-center.scss'
@ -18,15 +18,14 @@ function CouponCenter (props) {
const $instance = getCurrentInstance()
const [state, setState] = useImmer(initialState)
const { couponList } = state
const listRef = useRef(null)
useEffect(() => { getMypoint() }, [])
const getMypoint = async () => {
const { point } = await api.pointitem.getMypoint()
// const { point } = await api.member.memberInfo()
// const { point } = await api.pointitem.getMypoint()
const { point } = await api.member.memberInfo()
setState((draft) => {
draft.point = thousandthFormat(point)
draft.point = point
})
}
@ -55,23 +54,6 @@ function CouponCenter (props) {
}
const handleClickCouponItem = async (item, index) => {
if (point <= 0 || point <= item.point) {
showToast('积分不足')
return
}
const res = await Taro.showModal({
title: '提示',
content: `确定要领取该优惠券吗?`,
showCancel: true,
cancel: '取消',
cancelText: '取消',
confirmText: '确定',
cancelColor: "#ccc",
confirmColor: "#000"
})
if (!res.confirm) {
return
}
if (item.couponStatus == 0) {
showToast('优惠券已领完')
} else if (item.couponStatus == 1) {
@ -98,12 +80,12 @@ function CouponCenter (props) {
getCoupon(item, index)
}
} else {
showToast('优惠券领取完')
showToast('优惠券领取机会已用完')
}
}
const getCoupon = async ({ cardId }, index) => {
const { status } = await api.member.getCardDetail({
const { status } = await api.member.homeCouponGet({
card_id: cardId
})
if (status) {
@ -117,7 +99,6 @@ function CouponCenter (props) {
})
}
showToast('优惠券领取成功')
getMypoint()
} else {
showToast('优惠券领取失败')
}
@ -150,28 +131,19 @@ function CouponCenter (props) {
console.log('handleRedeem:', item)
}
const getPoint = async () => {
await api.member.depositToPoint({ money: 10000 })
showToast('积分+100')
setState((draft) => {
draft.couponList = []
})
getMypoint()
listRef.current?.reset()
}
return (
<SpPage className='page-coupon-center' scrollToTopBtn>
<View className='pointshop-hd'>
<View className='point-info'>
<View className='point-total'>
{/* <SpPoint value={point} /> */}
<Text className='title' onClick={getPoint}>我的积分</Text>
<Text className='title'>我的积分</Text>
<Text className='point'>{(point || 0).toString()}</Text>
</View>
<View className="coupon" onClick={() => Taro.navigateTo({ url: '/subpages/marketing/coupon' })}>我的优惠券</View>
</View>
</View>
<SpScrollView ref={listRef} className='list-scroll' fetch={fetch} renderEmpty={<View className='empty'>
<SpScrollView className='list-scroll' fetch={fetch} renderEmpty={<View className='empty'>
<SpImage src='member/quan-empty.png' width={138} height={138} isNew />
<Text className='empty-text'>暂无优惠券</Text></View>}>
{couponList.map((item, index) => {
@ -194,22 +166,21 @@ function CouponCenter (props) {
</SpCoupon>
</View>
}
return <SpCoupon info={item} onClick={handleClickCouponItem.bind(this, item, index)} isNew />
return (<View className="coupons-list-item" key={`coupon-item__${index}`} style={styleNames({
background: `url(${process.env.APP_IMAGE_CDN_NEW}/member/${item.couponStatus != 1 ? "quan-hui" : "quan-lan"}.png) no-repeat`,
background: `url(${process.env.APP_IMAGE_CDN_NEW}/member/${item.type === "quan" ? "quan-hui" : "quan-lan"}.png) no-repeat`,
'background-size': '100% 100%'
})}>
<View className="coupons-list-item-left">
<View className='coupons-list-item-money'><Text className='coupons-list-item-unit'>¥</Text><Text className="coupons-list-item-num">{item.reduceCost || 0}</Text></View>
<View className="coupons-list-item-desc">{item.leastCost}可用</View>
<View className='coupons-list-item-money'><Text className='coupons-list-item-unit'>¥</Text><Text className="coupons-list-item-num">{item.num || 100}</Text></View>
<View className="coupons-list-item-desc">{item.desc || '满100可用'}</View>
</View>
<View className="coupons-list-item-right">
<View className="coupons-list-item-right-box">
<View className="coupons-list-item-integral">{item.title}</View>
<View className="coupons-list-item-integral">{item.integral || 500}积分兑换</View>
{/* {item.start_time}至{item.end_time} */}
<View className="coupons-list-item-desc">有效日期领取{item.fixedTerm}天内有效</View>
<View className="coupons-list-item-desc">有效日期领取7天内有效</View>
</View>
<View className="coupons-list-item-btn" onClick={handleClickCouponItem.bind(this, item, index)}>立即兑换</View>
<View className="coupons-list-item-btn" onClick={() => handleRedeem(item)}>立即兑换</View>
</View>
</View>)
})}

View File

@ -46,8 +46,7 @@
}
}
.list-scroll {
// padding: 20px;
padding: 0 50px;
padding: 20px;
.coupon-item-wrap {
&:not(:last-child) {
margin-bottom: 20px;
@ -58,8 +57,8 @@
width: 100%;
border-radius: 10px;
overflow: hidden;
// background: #5b5b5b;
// margin-bottom: 30px;
background: #5b5b5b;
margin-bottom: 30px;
display: flex;
color: #fff;
min-height: 175px;

View File

@ -97,22 +97,21 @@ function CouponPicker (props) {
<SpCheckboxNew onChange={onChangeSelectCoupon.bind(this, null)} checked={select === null}>
暂不使用优惠券
</SpCheckboxNew>
{/* <AtButton >暂不使用优惠券</AtButton> */}
</View>
}
>
<SpScrollView className='list-scroll' fetch={fetch}>
{couponListVaild.map((item, index) => (
<View className='coupon-item-wrap' key={`coupon-item__${index}`}>
<SpCoupon info={item} onClick={onChangeSelectCoupon.bind(this, item)} />
{/* <SpCheckboxNew onChange={onChangeSelectCoupon.bind(this, item)} disabled={!item.valid} checked={select == item.code}/> */}
<SpCoupon info={item} />
<SpCheckboxNew onChange={onChangeSelectCoupon.bind(this, item)} disabled={!item.valid} checked={select == item.code}/>
</View>
))}
{ couponListInVaild.length>0 ? <View className='invalid-title'>不可用优惠券</View> :''}
{couponListInVaild.map((item, index) => (
<View className='coupon-item-wrap' key={`coupon-item__${index}`}>
<SpCoupon info={item} onClick={onChangeSelectCoupon.bind(this, item)} />
{/* <SpCheckboxNew onChange={onChangeSelectCoupon.bind(this, item)} disabled={!item.valid} checked={select == item.code}/> */}
<SpCoupon info={item} />
<SpCheckboxNew onChange={onChangeSelectCoupon.bind(this, item)} disabled={!item.valid} checked={select == item.code}/>
</View>
))}
</SpScrollView>

View File

@ -120,21 +120,38 @@ function CouponIndex () {
<SpImage src='member/quan-empty.png' width={138} height={138} isNew />
<Text className='empty-text'>暂无优惠券</Text></View>}>
{couponList.map((item, index) => (
<View className='coupon-item-wrap' key={`coupon-item__${index}`}>
<SpCoupon info={item} onClick={handleClickCouponItem.bind(this, item)}>
{/* {item.cardType != 'new_gift' && <Text>使</Text>}
{item.cardType == 'new_gift' && (
<Text>
{item?.tagClass == 'notstarted'
? '未开始'
: {
'1': '去使用',
'10': '待核销'
}[item.status]}
</Text>
)} */}
</SpCoupon>
// <View className='coupon-item-wrap' key={`coupon-item__${index}`}>
// <SpCoupon info={item} onClick={handleClickCouponItem.bind(this, item)}>
// {item.cardType != 'new_gift' && <Text>去使用</Text>}
// {item.cardType == 'new_gift' && (
// <Text>
// {item?.tagClass == 'notstarted'
// ? '未开始'
// : {
// '1': '去使用',
// '10': '待核销'
// }[item.status]}
// </Text>
// )}
// </SpCoupon>
// </View>
(<View className="coupons-list-item" key={`coupon-item__${index}`} style={styleNames({
background: `url(${process.env.APP_IMAGE_CDN_NEW}/member/${item.type === "quan" ? "quan-hui" : "quan-lan"}.png) no-repeat`,
'background-size': '100% 100%'
})}>
<View className="coupons-list-item-left">
<View className='coupons-list-item-money'><Text className='coupons-list-item-unit'>¥</Text><Text className="coupons-list-item-num">{item.num || 100}</Text></View>
<View className="coupons-list-item-desc">{item.desc || '满100可用'}</View>
</View>
<View className="coupons-list-item-right">
<View className="coupons-list-item-right-box">
<View className="coupons-list-item-integral">{item.integral || 500}积分兑换</View>
{/* {item.start_time}至{item.end_time} */}
<View className="coupons-list-item-desc">有效日期领取7天内有效</View>
</View>
<View className="coupons-list-item-btn" onClick={() => handleRedeem(item)}>立即使用</View>
</View>
</View>)
))}
</SpScrollView>
</SpPage>

View File

@ -1,18 +1,18 @@
.page-marketing-coupon {
.list-scroll {
padding: 0px 50px;
// .coupon-item-wrap {
// &:not(:last-child) {
// margin-bottom: 20px;
// }
// }
padding: 20px 50px;
.coupon-item-wrap {
&:not(:last-child) {
margin-bottom: 20px;
}
}
.coupons-list {
&-item {
width: 100%;
border-radius: 10px;
overflow: hidden;
// background: #5b5b5b;
// margin-bottom: 30px;
background: #5b5b5b;
margin-bottom: 30px;
display: flex;
color: #fff;
min-height: 175px;

View File

@ -108,7 +108,7 @@ function MemberIndex (props) {
// console.log('===>getCurrentPages==>', getCurrentPages(), getCurrentInstance())
const $instance = getCurrentInstance()
const { isLogin, isNewUser, login, getUserInfoAuth } = useLogin({
autoLogin: true,
autoLogin: false,
// policyUpdateHook: (isUpdate) => {
// // isUpdate && setPolicyModal(true)
// if (isUpdate) {
@ -304,15 +304,6 @@ function MemberIndex (props) {
const resAssets = await api.member.memberAssets()
const { discount_total_count, fav_total_count, point_total_count } = resAssets
// aftersales: 0 //待处理的售后总数
// aftersales_pending: 0 //待处理的售后
// aftersales_processing: 0 //处理中售后
// normal_not_rate: 3 //待评价
// normal_notpay_notdelivery: 0 // 未付款未发货
// normal_payed_daifahuo: 4 // 待发货
// normal_payed_daishouhuo: 0 // 待收货
// normal_payed_daiziti: 0 //待自提订单
// normal_payed_notdelivery: 4 // 已付款未发货 or 已付款已发货
const {
aftersales, // 待处理售后
@ -452,7 +443,7 @@ function MemberIndex (props) {
const { memberConfig } = config
// console.log('====config===', config.menu)
console.log('====config===', config.menu)
return (
<SpPage className='pages-member-index has-navbar' renderFooter={<SpTabbar />} isTop>
@ -612,9 +603,9 @@ function MemberIndex (props) {
>
<View className='order-item-view'>
<SpImage src='member/daishouhuo.png' className='icon-style' isNew />
{state.waitRecevieNum > 0 && (
{state.waitEvaluateNum > 0 && (
<View className='order-bradge'>
<Text>{state.waitRecevieNum}</Text>
<Text>{state.waitEvaluateNum}</Text>
</View>
)}
<Text className='order-txt'>待收货</Text>
@ -626,16 +617,15 @@ function MemberIndex (props) {
>
<View className='order-item-view'>
<SpImage src='member/yiwancheng.png' className='icon-style' isNew />
{state.waitEvaluateNum > 0 && (
{state.afterSalesNum > 0 && (
<View className='order-bradge'>
<Text>{state.waitEvaluateNum}</Text>
<Text>{state.afterSalesNum}</Text>
</View>
)}
<Text className='order-txt'>已完成</Text>
</View>
</SpLogin>
{/* 先隐藏评价功能 02-24 */}
{false && <SpLogin
<SpLogin
className='order-item'
// /subpage/pages/trade/after-sale
onChange={handleClickLink.bind(this, '/subpage/pages/trade/list?status=7')}
@ -649,7 +639,7 @@ function MemberIndex (props) {
)}
<Text className='order-txt'>评价</Text>
</View>
</SpLogin>}
</SpLogin>
</View>
</CompPanel>
@ -709,13 +699,51 @@ function MemberIndex (props) {
<SpImage className="member_con_item_img" src="member/dizhi.png" height={190} mode='aspectFill' isNew />
<View className="member_con_item_txt">地址管理</View>
</View>
<View className="member_con_item" onClick={isLogin && handleClickLink.bind(this, '/subpage/pages/trade/invoice-record')}>
<View className="member_con_item" onClick={isLogin && handleClickLink.bind(this, '/subpage/pages/trade/invoice-list')}>
<SpImage className="member_con_item_img" src="member/fapiao.png" height={190} mode='aspectFill' isNew />
<View className="member_con_item_txt">发票管理</View>
</View>
</View>
</View>
</View>
{state.isOpen && <View className={`${state.isOpen ? 'show ' : 'hide '}` + 'curtain-block'} onClick={() => setState((draft) => { draft.isOpen = false })}>
<View className="curtain-block_mask">
<View className="curtain-block_content">
<View className="curtain-block_content_title">
<SpImage src={`member/logo-black.png`} height={32} mode='heightFix' isNew />
<View className="">隐私政策</View>
</View>
<ScrollView scrollY
scrollWithAnimation className="curtain-block_content_text" showScrollbar={false} enhanced>
亲爱的用户,感谢您使用Birkenstock微信小程序!为了加强对您个人信息的保护,我们根据最新法律的要求制定/更新了隐私政策,我们将基于合法以及正当必要的原则,按照本政策的规定向您提供各项服务
本政策旨在向您说明休迪贸易 (上海)有限公司及其在中国大陆境内的线上线下门店如何收集使用传输和保护您的个人信息
通过隐私政策,我们向您主要说明:
1.您在使用Birkenstock微信小程序时,可以选择浏览模式,也可以选择注册/登录成为Birkenstock微信小程序用户
2为了向你提供Birkenstock微信小程序的其本服条,我们将基于合法以及正当必要的原则,按照本政策的规定向您提供各项服务
本政策旨在向您说明休迪贸易 (上海)有限公司及其在中国大陆境内的线上线下门店如何收集使用传输和保护您的个人信息
通过隐私政策,我们向您主要说明:
1.您在使用Birkenstock微信小程序时,可以选择浏览模式,也可以选择注册/登录成为Birkenstock微信小程序用户
2为了向你提供Birkenstock微信小程序的其本服条,我们将基于合法以及正当必要的原则,按照本政策的规定向您提供各项服务
本政策旨在向您说明休迪贸易 (上海)有限公司及其在中国大陆境内的线上线下门店如何收集使用传输和保护您的个人信息
通过隐私政策,我们向您主要说明:
1.您在使用Birkenstock微信小程序时,可以选择浏览模式,也可以选择注册/登录成为Birkenstock微信小程序用户
2为了向你提供Birkenstock微信小程序的其本服条,我们将基于合法以及正当必要的原则,按照本政策的规定向您提供各项服务
本政策旨在向您说明休迪贸易 (上海)有限公司及其在中国大陆境内的线上线下门店如何收集使用传输和保护您的个人信息
通过隐私政策,我们向您主要说明:
1.您在使用Birkenstock微信小程序时,可以选择浏览模式,也可以选择注册/登录成为Birkenstock微信小程序用户
2为了向你提供Birkenstock微信小程序的其本服条,我们将基于合法以及正当必要的原则,按照本政策的规定向您提供各项服务
本政策旨在向您说明休迪贸易 (上海)有限公司及其在中国大陆境内的线上线下门店如何收集使用传输和保护您的个人信息
通过隐私政策,我们向您主要说明:
1.您在使用Birkenstock微信小程序时,可以选择浏览模式,也可以选择注册/登录成为Birkenstock微信小程序用户
2为了向你提供Birkenstock微信小程序的其本服条
</ScrollView>
<AtButton type='primary' className='btn' onClick={() => setState((draft) => { draft.isOpen = false })}>同意并继续</AtButton>
{/* <AtButton type='secondary' onClick={() => setState((draft) => { draft.isOpen = false })}>不同意</AtButton> */}
<View className="no-btn">不同意</View>
</View>
</View>
</View>}
</SpPage>
)
}

View File

@ -155,7 +155,6 @@
padding: 30px 16px 50px;
.comp-panel {
&-bd {
padding: 24px 50px;
margin-top: 20px;
}
.extra {

View File

@ -27,7 +27,6 @@ const initialState = {
listLength: 0,
nList: [],
listLength: 0,
loading: true
}
function MemberUserInfo () {
@ -45,7 +44,6 @@ function MemberUserInfo () {
areaList,
multiIndex,
nList,
loading
} = state
const { userInfo = {} } = useSelector((_state) => _state.user)
const pageRef = useRef()
@ -182,7 +180,6 @@ function MemberUserInfo () {
draft.formUserInfo = _formUserInfo
draft.areaList = [arrProvice, arrCity, arrCounty]
draft.multiIndex = _multiIndex
draft.loading = false
})
}
@ -523,7 +520,7 @@ function MemberUserInfo () {
if (isWeixin) {
return (
<Button class='avatar-wrapper' open-type='chooseAvatar' onChooseAvatar={onChooseAvatar}>
{formUserInfo.avatar ? <SpImage src={formUserInfo.avatar} width={110} height={110} circle /> : <SpImage src={'cart/logo-hui.png'} width={110} height={110} circle isNew />}
<SpImage src={'cart/logo-hui.png'} width={110} height={110} circle isNew />
</Button>
)
} else {
@ -543,7 +540,6 @@ function MemberUserInfo () {
保存
</AtButton>
}
loading={loading}
>
<View className='block-container'>
{/* <SpCell title='头像' isLink border value={renderAvatar()}></SpCell> */}

View File

@ -1,19 +1,19 @@
import React, { useEffect, useRef } from "react"
import React, { useEffect, useRef } from "react";
import { useSelector } from "react-redux"
import { useImmer } from "use-immer"
import Taro, { getCurrentInstance } from "@tarojs/taro"
import Taro, { getCurrentInstance } from "@tarojs/taro";
import api from "@/api"
import doc from "@/doc"
import { AtButton, AtInput, AtCurtain, AtCountdown } from 'taro-ui'
import { SpPage, SpTabs, SpCell, SpCheckbox, SpImage, SpInputNumber, SpFloatLayout, SpUpload, SpPrice, SpHtml, SpOrderItem } from '@/components'
import { View, Text, Picker, Input, ScrollView } from "@tarojs/components"
import { AFTER_SALE_TYPE, REFUND_FEE_TYPE, LOGISTICS_CODE } from '@/consts'
import { pickBy, showToast, classNames, VERSION_STANDARD, VERSION_PLATFORM, JumpGoodDetail, copyText } from '@/utils'
import "./after-sale.scss"
import { AtButton, AtInput, AtTextarea } from 'taro-ui'
import { SpPage, SpTabs, SpCell, SpCheckbox, SpImage, SpInputNumber, SpFloatLayout, SpUpload, SpPrice, SpHtml } from '@/components'
import { View, Text, Picker } from "@tarojs/components"
import { AFTER_SALE_TYPE, REFUND_FEE_TYPE } from '@/consts'
import { pickBy, showToast, classNames, VERSION_STANDARD, VERSION_PLATFORM } from '@/utils'
import "./after-sale.scss";
const initialState = {
info: null,
curTabIdx: 1,
curTabIdx: 0,
tabList: AFTER_SALE_TYPE,
reasonIndex: '',
reasons: [],
@ -34,27 +34,15 @@ const initialState = {
afterSaleDesc: {
intro: '',
is_open: false
},
afterSaleChecked: {},
afterSaleTotalNum: 0,
allClicked: false,
afterSaleTotalprice: 0,
loading: true,
isOpened: false,
isAddrOpened: false,
aftersales: null,
expressList: [],
corpIndex: null,
logi_no: ''
}
}
function TradeAfterSale(props) {
const $instance = getCurrentInstance()
const { aftersales_bn: afterSaleTid } = $instance.router.params
const [state, setState] = useImmer(initialState)
const pageRef = useRef()
const { info, curTabIdx, tabList, reasonIndex, reasons, refundFee, refundPoint, refundType, refundTypeList, description, pic, openRefundType, selectRefundValue,
refundStore, contact, mobile, afterSaleDesc, offlineAftersalesIsOpen, offlineAftersales, afterSaleTotalNum, allClicked, afterSaleTotalprice, loading, isOpened, isAddrOpened, aftersales, expressList, corpIndex, logi_no } = state
refundStore, contact, mobile, afterSaleDesc, offlineAftersalesIsOpen, offlineAftersales } = state
useEffect(() => {
fetch()
@ -64,15 +52,6 @@ function TradeAfterSale (props) {
draft.refundStore = item
})
})
const _expressList = Object.keys(LOGISTICS_CODE).map(key => {
return {
name: LOGISTICS_CODE[key],
code: key
}
})
setState(draft => {
draft.expressList = _expressList
})
return () => {
Taro.eventCenter.off('onEventPickerStore')
@ -91,63 +70,8 @@ function TradeAfterSale (props) {
Taro.navigateBack()
}
const onSubmitExp = async () => {
const { item_id, orderId: order_id, afterSalesBn: aftersales_bn } = aftersales
const corp_code = expressList[corpIndex]?.code
if (!corp_code) {
showToast('请填写物流公司')
return
}
if (!logi_no) {
showToast('请填写物流单号')
return
}
await api.aftersales.sendback({
item_id,
order_id,
aftersales_bn,
logi_no,
corp_code
})
showToast('操作成功')
setTimeout(() => {
// Taro.navigateBack()
fetch()
}, 300)
}
const onChangeExpress = (e) => {
const { value } = e.detail
setState(draft => {
draft.corpIndex = value
})
}
const getLogisticName = () => {
const { name } = expressList[corpIndex] || {}
return name
}
const fetch = async () => {
const { id, aftersales_bn } = $instance.router.params
if (aftersales_bn) {
const resInfo = await api.aftersales.info({
aftersales_bn,
// item_id,
// order_id
})
const _aftersales = pickBy(resInfo, doc.trade.TRADE_AFTER_SALES_ITEM)
console.log("🚀 ~ _aftersales:", _aftersales)
if (_aftersales.sendbackData) {
const { corp_code } = _aftersales.sendbackData
_aftersales.sendbackData.name = LOGISTICS_CODE[corp_code]
}
setState(draft => {
draft.aftersales = _aftersales
draft.afterSaleTotalNum = _aftersales.items.reduce((sum, { num }) => sum + num, 0)
draft.afterSaleTotalprice = _aftersales.items.reduce((sum, { price }) => sum + price, 0)
})
}
const { id } = $instance.router.params
const { orderInfo, offline_aftersales_is_open, distributor } = await api.trade.detail(id)
const reasons = await api.aftersales.reasonList()
const { intro, is_open } = await api.aftersales.remindDetail()
@ -166,29 +90,17 @@ function TradeAfterSale (props) {
draft.refundTypeList = REFUND_FEE_TYPE.filter(item => item.value != 'offline')
draft.refundType = 'logistics'
}
draft.loading = false
})
}
const onChangeItemCheck = (item, index, type) => {
// const _info = info
// _info.items[index].checked = e
const onChangeItemCheck = (item, index, e) => {
setState(draft => {
if (type === 'all') {
draft.allClicked = !allClicked
draft.info.items.map((_item) => {
_item.checked = !allClicked
})
} else {
draft.info.items[index].checked = !item.checked
}
draft.allClicked = draft.info.items.every((item) => item.checked)
draft.afterSaleTotalNum = draft.info.items.filter((_item) => _item.checked).reduce((sum, { num }) => sum + num, 0)
draft.afterSaleTotalprice = draft.info.items.filter((_item) => _item.checked).reduce((sum, { price }) => sum + price, 0)
draft.info.items[index].checked = e
})
}
const onChangeItemNum = (e, index) => {
setState(draft => {
draft.info.items[index].refundNum = e
})
@ -235,15 +147,15 @@ function TradeAfterSale (props) {
}
if (!reasons?.[reasonIndex]) {
return showToast('请选择退货原因')
return showToast('请选择售后原因')
}
const aftersales_type = tabList[curTabIdx].type
const reason = reasons?.[reasonIndex]
let params = {
detail: checkedItems.map(({ id: _id, refundNum, num }) => {
detail: checkedItems.map(({ id: _id, refundNum }) => {
return {
id: _id,
num: num || refundNum
num: refundNum
}
}),
order_id: id,
@ -281,191 +193,61 @@ function TradeAfterSale (props) {
await api.aftersales.apply(params)
showToast('提交成功')
setTimeout(() => {
// Taro.redirectTo({
// url: `/subpage/pages/trade/detail?id=${id}`
// })
// fetch()
Taro.navigateBack()
}, 500)
Taro.redirectTo({
url: `/subpage/pages/trade/detail?id=${id}`
})
}, 200)
}
const handleClickCopy = (val) => {
copyText(val)
Taro.showToast({
title: '复制成功',
icon: 'none'
})
}
return <SpPage ref={pageRef} loading={loading} className='page-trade-after-sale has-navbar' isBlack showNavSearchIcon renderFooter={
!loading && !afterSaleTid ? <View className='btn-wrap'>
<AtButton type='primary' onClick={onSubmit}>提交售后申请</AtButton>
</View> : null
return <SpPage ref={pageRef} className='page-trade-after-sale' renderFooter={
<View className='btn-wrap'>
<AtButton circle type='primary' onClick={onSubmit}>提交</AtButton>
</View>
}
>
{!afterSaleTid ? <View className="after-item">
<View className="after-item-label">请选择售后类型:</View>
<Picker
mode='selector'
range={tabList.map(item => item.title)}
onChange={(e) => {
setState(draft => {
draft.curTabIdx = +e.detail.value
})
}}
>
<View className="after-item-input">
<View className="input-txt">{tabList[curTabIdx] ? tabList[curTabIdx].title : '请选择售后类型'}</View>
<View className="iconfont icon-arrowRight" style={{ color: tabList[curTabIdx] > -1 ? '#000' : '#a5a5a5' }}></View>
</View>
</Picker>
</View> : aftersales?.progress != 12 ? <View className="after-item">
<View className="after-item-label">售后单号{afterSaleTid}</View>
<View className="after-item-label" style={{ fontSize: '30rpx', display: 'flex', alignItems: 'flex-end', justifyContent: 'space-between', opacity: '80', margin: '36rpx 0 50rpx 0', lineHeight: '0.8' }}>
<Text style={{ marginRight: '20rpx', fontWeight: 'bold' }}>{['', '售后审核通过,请您发货并填写物流单号', '等待商家确认收货', '已驳回', '已完成', '退款驳回', '退款完成', '已关闭', '商家确认收货,等待审核退款', '退款处理中'][aftersales?.progress || 0]}</Text>
<View style={{ display: 'flex', alignItems: 'flex-end', justifyContent: 'space-between' }}>
{/* <View style={{ fontSize: '20rpx', textAlign: 'end' }}><AtCountdown
format={{ day: '天', hours: '时', minutes: '分', seconds: '' }}
isShowDay
day={1}
hours={23}
minutes={59}
seconds={0}
/></View> */}
<Text onClick={() => setState(draft => { draft.isOpened = true })} style={{ fontSize: '20rpx', borderBottom: '1px solid #000', padding: '0 0 4rpx' }}>全部流程</Text>
</View>
</View>
</View> : null}
<View className="after-item" style={{ display: 'flex', alignItems: 'flex-end', justifyContent: 'space-between', marginBottom: '30rpx' }}>
<Text style={{ fontSize: '24rpx', marginTop: '-10rpx' }}>退货单号填写</Text>
{aftersales?.hasAftersalesAddress && <Text onClick={() => setState(draft => { draft.isAddrOpened = true })} style={{ fontSize: '20rpx', borderBottom: '1px solid #000', padding: '0 0 4rpx', marginTop: '-10rpx', lineHeight: 0.8 }}>查看退货地址</Text>}
</View>
<View className="after-item mt-40" style={{ marginBottom: '50rpx' }}>
{!aftersales?.hasSendbackData ? <Picker
mode='selector'
rangeKey='name'
range={expressList}
onChange={onChangeExpress}
>
<View className="after-item-input">
<View className={`input-txt`}>{`${getLogisticName() || '请选择快递公司'}`}</View>
<View className="iconfont icon-arrowRight" style={{ color: getLogisticName() ? '#000' : '#a5a5a5' }}></View>
</View>
</Picker> : <View className="after-item-input">
<View className={`input-txt color-hui`}>{`${aftersales?.sendbackData?.name || ''}`}</View>
</View>}
</View>
<View className="after-item mt-40" style={{ marginBottom: '50rpx' }}>
<View className="after-item-input">
{!aftersales?.hasSendbackData ? <Input className="desc-ipt" value={logi_no} placeholder='物流单号' onInput={(e) => {
setState(draft => {
draft.logi_no = e.detail.value
})
}}></Input>
:
<View className={`input-txt color-hui`}>{`${aftersales?.sendbackData?.logi_no || ''}`}</View>}
</View>
</View>
<View style={{ margin: '0 auto', marginBottom: '70rpx', textAlign: 'center' }}>
{/* <AtButton type='primary' onClick={onSubmitExp}>确认上传</AtButton> */}
<Text onClick={() => handleClickCopy(aftersales?.sendbackData?.logi_no || '')} style={{ fontSize: '20rpx', borderBottom: '1px solid #000', lineHeight: 0.8 }}>复制物流单号</Text>
</View>
{/* <SpTabs current={curTabIdx} tablist={tabList} onChange={(e) => {
<SpTabs current={curTabIdx} tablist={tabList} onChange={(e) => {
setState(draft => {
draft.curTabIdx = e
})
}} /> */}
{!afterSaleTid ? <>
<View className="choose-item">请选择您要退货的商品</View>
<View className="choose-all">
<SpCheckbox label='全选' checked={allClicked} onChange={onChangeItemCheck.bind(this, null, null, 'all')} />
</View>
</> : <Text className="choose-item" style={{ fontSize: '30rpx', fontWeight: 'bold' }}>退</Text>}
}} />
<View className='refund-items'>
<View className='items-container'>
{
(aftersales?.items || info?.items || []).map((item, index) => (
<View className="item-box" onClick={onChangeItemCheck.bind(this, item, index)}>
info?.items.map((item, index) => (
<View className='item-wrap' key={`item-wrap__${index}`}>
{!afterSaleTid && <View className='item-hd'>
<SpCheckbox checked={item.checked} onChange={onChangeItemCheck.bind(this, item, index)} />
</View>}
<View className='item-hd'>
<SpCheckbox disabled={!item.leftAftersalesNum} checked={item.checked} onChange={onChangeItemCheck.bind(this, item, index)} />
</View>
<View className='item-bd'>
{/* <SpOrderItem
key={`item__${index}`}
info={item}
isShowNational
isPointitemGood={false}
onClick={() => {
if (info.order_class == 'pointsmall') {
Taro.navigateTo({
url: `/subpages/pointshop/espier-detail?id=${item.good_id}`
})
} else {
JumpGoodDetail(item.good_id, item.distributor_id)
}
}}
/> */}
<SpImage src={item.pic} width={150} height={150} mode='aspectFill' radius={4} circle={4} />
<SpImage src={item.pic} width={128} height={128} radius={8} circle={8} />
<View className='goods-info'>
<View className='goods-info-hd'>
<Text className='goods-title'>{item.itemName}</Text>
</View>
<View className='goods-info-bd'>
<View>{item.itemSpecDesc && <Text className='sku-info'>{`${item.descInfo}`}</Text>}</View>
{/* <View><SpPrice size={28} value={item.price / item.num} /> x <Text className='num'>{item.num}</Text></View> */}
<View>{item.itemSpecDesc && <Text className='sku-info'>{`${item.itemSpecDesc}`}</Text>}</View>
<View><SpPrice size={28} value={item.price / item.num} /> x <Text className='num'>{item.num}</Text></View>
</View>
<View className='goods-info-ft'>
<Text>数量{item.num}</Text>
<SpPrice size={20} value={item.price / item.num} showSeparator noDecimal={false} />
{/* <SpInputNumber
<Text>退款数量</Text>
<SpInputNumber
disabled={!item.leftAftersalesNum}
value={item.refundNum}
max={item.leftAftersalesNum}
min={1}
onChange={(e) => onChangeItemNum(e, index)}
/> */}
/>
</View>
</View>
</View>
</View>
<SpPrice value={item.price} showSeparator noDecimal={false} />
</View>
))
}
</View>
</View>
<View className="after-item mt-40" style={{ marginTop: '60rpx' }}>
<View className="after-item-label color-hui">退货原因</View>
{!afterSaleTid ? <Picker
mode='selector'
range={reasons}
onChange={(e) => {
setState(draft => {
draft.reasonIndex = e.detail.value
})
}}
>
<View className="after-item-input">
<View className={`input-txt`}>{`${reasons?.[reasonIndex] || '请选择退货原因'}`}</View>
<View className="iconfont icon-arrowRight" style={{ color: reasons?.[reasonIndex] ? '#000' : '#a5a5a5' }}></View>
</View>
</Picker> : <View className="after-item-input">
<View className={`input-txt color-hui`}>{`${aftersales?.reason || reasons?.[reasonIndex] || '请选择退货原因'}`}</View>
</View>}
</View>
<View className="after-item mt-40">
<View className="after-item-label color-hui">退货数量*</View>
<View className="after-item-input">
<View className="input-txt color-hui">{`${afterSaleTotalNum || '请选择退货数量'}`}</View>
</View>
</View>
{/* <View className='picker-reason'>
<View className='picker-reason'>
<Picker
mode='selector'
range={reasons}
@ -477,11 +259,9 @@ function TradeAfterSale (props) {
>
<SpCell title='退款原因' isLink value={<Text>{`${reasons?.[reasonIndex] || '请选择取消原因'}`}</Text>}></SpCell>
</Picker>
</View> */}
<View className='refund-desc-container'>
</View>
{false && <View className='refund-detail'>
<View className='refund-detail'>
<View className='refund-amount'>
<SpCell title='退款金额' value={getRealRefundFee()} />
</View>
@ -490,9 +270,9 @@ function TradeAfterSale (props) {
{/* <SpCell title='退积分' value={info?.point} /> */}
<SpCell title='退积分' value={getRealRefundPoint()} />
</View>
</View>}
</View>
{/* {curTabIdx == 1 && <View className='return-goods-type'>
{curTabIdx == 1 && <View className='return-goods-type'>
<SpCell border title='退货方式' value={getRefundTypeName()} isLink onClick={() => {
setState(draft => {
draft.openRefundType = true
@ -531,28 +311,19 @@ function TradeAfterSale (props) {
/>}></SpCell>
</>
}
</View>} */}
</View>}
<View className='desc-container'>
<View className='title'>
<Text>退货商品{afterSaleTotalNum}</Text>
<Text>退款金额<SpPrice size={30} value={afterSaleTotalprice} showSeparator noDecimal={false} /></Text>
</View>
{!afterSaleTid ? <View className='desc-content'>
{/* <Text className='iconfont icon-bianji1'></Text> */}
{/* <AtTextarea type='textarea' name='description' value={description} placeholder='' maxLength={200} onChange={(e) => {
<View className='title'>补充描述</View>
<View className='desc-content'>
<Text className='iconfont icon-bianji1'></Text>
<AtTextarea type='textarea' name='description' value={description} placeholder='请输入您的补充描述(选填)' maxLength={200} onChange={(e) => {
setState(draft => {
draft.description = e
})
}} /> */}
<Input className="desc-ipt" value={description} placeholder='在此填写备注要求' onInput={(e) => {
setState(draft => {
draft.description = e.detail.value
})
}}></Input>
}} />
</View>
: <View style={{ opacity: '0.8', fontSize: '24rpx' }}>备注{aftersales?.description || description}</View>}
{/* <SpUpload
<SpUpload
value={pic}
max={3}
onChange={(val) => {
@ -560,7 +331,7 @@ function TradeAfterSale (props) {
draft.pic = val
})
}}
/> */}
/>
</View>
{
@ -604,89 +375,6 @@ function TradeAfterSale (props) {
</View>
))}
</SpFloatLayout>
<AtCurtain
className='curtain'
isOpened={isOpened}
onClose={() => {
setState((draft) => {
draft.isOpened = false
})
}}
>
<View className="curtain_content">
<View className="curtain_content_title">
<SpImage src={`member/logo-black.png`} height={32} mode='heightFix' isNew />
<Text style={{ marginLeft: '6px' }}>退货流程</Text>
</View>
<View className={`receiver_name ${false && 'active'}`}>提交申请</View>
<View className={`receiver_name ${aftersales?.progress == 0 && 'active'}`} style={{ display: 'flex', alignItems: 'flex-end' }}>
<Text style={{ marginRight: '36px' }}>商家处理</Text>
{/* <View style={{ color: '#000', fontSize: '20rpx' }}><AtCountdown
format={{ day: '天', hours: '时', minutes: '分', seconds: '' }}
isShowDay
day={1}
hours={23}
minutes={59}
seconds={0}
/></View> */}
</View>
<View className="receiver_name op">商家同意后请按照给出的退货地址退货并请记录退货运单</View>
<View className="receiver_name op">如商家拒绝您可以修改申请后再次发起商家会重新处理</View>
<View className="receiver_name op" style={{ marginBottom: '50rpx' }}>如商家超时未处理退货申请将达成请按系统给出的退货地址退货</View>
<View className={`receiver_name ${[2].includes(aftersales?.progress) && 'active'}`}>寄回商品</View>
<View className={`receiver_name ${aftersales?.progress == 4 && aftersales?.aftersalesStatus != 2 && 'active'}`}>商家退款</View>
<View className={`receiver_name ${aftersales?.progress == 4 && aftersales?.aftersalesStatus == 2 && 'active'}`}>退款成功</View>
<View className="line"></View>
<View className="curtain_content_text">
<View className="curtain_content_text_title">温馨提示</View>
<View class="receiver_item">
BIRKENSTOCK支持七天(从收到商品之日起开始计算)无理由退换货如需退换货退回货品需不影响二次销售原装鞋盒务必完好(如鞋盒有遗失需补偿20元)试穿时需将鞋盒内的包装纸垫于脚下过程中不刻意踩踏后跟如鞋面或鞋底出现脏污磨损破损鞋跟出现折痕等都将影响商品的二次销售我们将无法为您提供七天无理由退换货服务敬请谅解如果您还有其他问题或需要更多帮助可及时联系客服我们将竭诚为您服务(特别提示:仓库不接受到付平邮邮政小包)
</View>
</View>
<AtButton type='primary' onClick={() => setState((draft) => { draft.isOpened = false })}>我知道了</AtButton>
</View>
</AtCurtain>
<AtCurtain
className='curtain'
isOpened={isAddrOpened}
onClose={() => {
setState((draft) => {
draft.isAddrOpened = false
})
}}
>
<View className="curtain_content">
<View className="curtain_content_title">
<SpImage src={`member/logo-black.png`} height={32} mode='heightFix' isNew />
<Text style={{ marginLeft: '6px' }}>退货地址</Text>
</View>
<View className={`addr_item`}>
<View className="addr_item_left">收件人</View>
<View className="addr_item_right">{aftersales?.afterSalesContact}</View>
</View>
<View className={`addr_item`}>
<View className="addr_item_left">联系电话</View>
<View className="addr_item_right">{aftersales?.afterSalesMobile}</View>
</View>
<View className={`addr_item`}>
<View className="addr_item_left">收件地址</View>
<View className="addr_item_right">{aftersales?.afterSalesAddress}</View>
</View>
<View className={`addr_item`}>
<View className="addr_item_left">邮编</View>
<View className="addr_item_right">{aftersales?.afterSalesZip}</View>
</View>
<View className="fuzhi">复制地址</View>
<View className="line" style={{ margin: '130rpx 0 110rpx 0' }}></View>
<View className="curtain_content_text">
<View className="curtain_content_text_title">温馨提示</View>
<View class="receiver_item">
BIRKENSTOCK支持七天(从收到商品之日起开始计算)无理由退换货如需退换货退回货品需不影响二次销售原装鞋盒务必完好(如鞋盒有遗失需补偿20元)试穿时需将鞋盒内的包装纸垫于脚下过程中不刻意踩踏后跟如鞋面或鞋底出现脏污磨损破损鞋跟出现折痕等都将影响商品的二次销售我们将无法为您提供七天无理由退换货服务敬请谅解如果您还有其他问题或需要更多帮助可及时联系客服我们将竭诚为您服务(特别提示:仓库不接受到付平邮邮政小包)
</View>
</View>
</View>
</AtCurtain>
</SpPage>
}

View File

@ -1,61 +1,6 @@
.page-trade-after-sale {
.sp-page-body {
padding-bottom: 50px;
}
.after-item {
padding: 0 22px;
margin-top: 30px;
&.mt-40 {
margin-top: 40px;
}
&-label {
color: #000;
font-size: 26px;
line-height: 1;
margin-bottom: 20px;
}
.color-hui {
color: #00000060;
}
&-input {
box-sizing: border-box;
background: #f5f5f5;
border-radius: 6px;
padding: 20px 50px;
color: #000;
position: relative;
.icon-arrowRight {
font-size: 34px;
position: absolute;
right: 60px;
top: 30%;
// transform: translateY(-50%);
color: #000;
rotate: 90deg;
}
}
}
.at-countdown {
line-height: 30px;
&__item:last-child {
display: none;
}
&__time-box {
font-size: 20px;
font-family: inherit;
font-weight: normal;
}
&__separator {
padding: 0;
font-size: 22px;
}
}
.btn-wrap {
padding: 50px;
margin-bottom: 100px;
.at-button__text {
font-size: 36px;
}
padding: 20px;
}
.comp-trade-info {
margin-top: 20px;
@ -85,24 +30,6 @@
border-radius: 16px;
overflow: hidden;
}
.choose-item {
margin: 26px 22px 24px;
font-size: 26px;
}
.choose-all {
display: flex;
padding-left: 54px;
box-sizing: border-box;
.sp-checkbox-new .icon-checkbox-weixuan,
.sp-checkbox-new .icon-checkbox-xuanzhong {
color: #00000090;
font-size: 30px;
}
.sp-checkbox-new__label {
font-size: 26px;
}
}
.reason-container {
background-color: #e2e4ea;
margin-top: 32px;
@ -112,7 +39,7 @@
}
.refund-items {
background-color: #fff;
margin: 0px 22px 0;
margin: 24px 16px 0;
border-radius: 16px;
.title {
font-size: 30px;
@ -123,35 +50,13 @@
}
.items-container {
// padding: 0 32px 20px;
// padding: 24px 0;
margin-top: 30px;
&:not(:last-child) {
margin-bottom: 10px;
}
}
.item-box {
padding: 30px;
background: #f7f7f7;
border-radius: 6px;
&:not(:last-child) {
margin-bottom: 10px;
}
.sp-price {
display: block;
text-align: end;
}
padding: 24px 20px;
}
.item-wrap {
display: flex;
align-items: center;
}
.item-hd {
margin-right: 40px;
.sp-checkbox-new .icon-checkbox-weixuan,
.sp-checkbox-new .icon-checkbox-xuanzhong {
color: #00000090;
font-size: 30px;
&:not(:last-child) {
margin-bottom: 20px;
}
}
.item-bd {
@ -160,46 +65,31 @@
align-items: center;
}
.goods-info {
margin-left: 60px;
margin-left: 24px;
flex: 1;
height: 150px;
display: flex;
justify-content: space-between;
flex-direction: column;
padding: 10px 0;
box-sizing: border-box;
margin-top: 8px;
&-hd {
display: flex;
font-size: 20px;
justify-content: space-between;
}
&-bd {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 20px;
.num {
font-size: 24px;
}
}
&-ft {
display: flex;
// justify-content: space-between;
justify-content: space-between;
align-items: center;
// margin-top: 10px;
font-size: 20px;
.sp-price {
margin-left: 30px;
.sp-price__symbol {
margin-right: 2px !important;
}
}
margin-top: 10px;
}
.goods-title {
font-weight: 500;
// color: #111a34;
color: #000;
font-size: 20px;
color: #111a34;
font-size: 26px;
}
.goods-num {
font-size: 22px;
@ -207,11 +97,13 @@
color: #111a34;
}
.sku-info {
padding: 20px 0;
font-size: 24px;
font-weight: 400;
color: #858b9c;
background: #f5f5f5;
padding: 0 10px;
height: 34px;
line-height: 34px;
font-size: 20px;
opacity: 0.85;
}
}
.refund-detail {
@ -289,22 +181,13 @@
}
.desc-container {
background-color: #fff;
margin: 24px 22px 0;
margin: 24px 16px 0;
padding-bottom: 30px;
border-radius: 16px;
.desc-content {
padding: 16px 18px;
border: 2px solid #00000090;
border-radius: 6px;
margin: 0 32px;
display: flex;
overflow: hidden;
.desc-ipt {
font-size: 26px;
}
.input-placeholder {
color: #a5a5a5;
font-size: 26px;
}
}
.icon-bianji1 {
color: #aaaaaa;
@ -320,11 +203,8 @@
.title {
font-size: 30px;
font-weight: 500;
color: #000;
padding: 50px 0 26px;
display: flex;
align-items: center;
justify-content: space-between;
color: #333;
padding: 28px 32px;
}
}
.sp-upload {
@ -432,118 +312,4 @@
margin-left: 30px;
}
}
.curtain {
.at-curtain__container {
width: 100%;
padding: 0 30px;
}
.at-curtain__btn-close--bottom {
// display: none;
border: none;
top: 10px;
right: 10px;
left: auto;
&::after,
&::before {
background-color: #000;
}
}
&_content {
width: 100%;
background-color: #fff;
border-radius: 10px;
padding: 100px 44px 50px;
box-sizing: border-box;
&_title {
display: flex;
justify-content: center;
align-items: center;
font-size: 36px;
line-height: 1;
margin-bottom: 80px;
color: #000;
.sp-image {
margin-right: 4px;
}
}
.receiver_name {
font-size: 20px;
color: #000;
&:not(:last-child) {
margin-bottom: 34px;
}
&.active {
color: #163586;
font-size: 26px;
}
}
.op {
opacity: 0.6;
}
.line {
padding: 0 30px;
box-sizing: border-box;
height: 2px;
background: #ccc;
margin-top: -10px;
}
.addr_item {
display: flex;
align-items: center;
font-size: 20px;
margin: 24px 0;
&_left {
width: 150px;
font-size: 20px;
}
&_right {
flex: 1;
font-size: 20px;
}
}
.fuzhi {
font-size: 20px;
margin-top: 50px;
border-bottom: 2px solid #000;
line-height: 0.85;
margin: 0 auto;
margin-top: 56px;
text-align: center;
width: 78px;
}
&_text {
line-height: 1.4;
height: 250px;
color: #000;
font-size: 20px;
padding: 60px 10px;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
&_title {
font-size: 26px;
color: #000;
margin-bottom: 30px;
}
.receiver_item {
display: flex;
box-sizing: border-box;
font-size: 16px;
text-align: center;
line-height: 1.8;
opacity: 0.8;
}
}
.at-button__text {
font-style: 36px;
}
}
.no-text {
color: #7e7e7e;
font-size: 20rpx;
margin-top: 28rpx;
line-height: 1.4;
}
}
}

View File

@ -35,8 +35,8 @@ export function isFunction (val) {
}
export function uniqueFunc(arr, uniId) {
const res = new Map()
return arr.filter((item) => !res.has(item[uniId]) && res.set(item[uniId], 1))
const res = new Map();
return arr.filter((item) => !res.has(item[uniId]) && res.set(item[uniId], 1));
}
export function isNumber(val) {
@ -274,9 +274,6 @@ export function resolvePath (baseUrl, params = {}) {
return `${baseUrl}${baseUrl.indexOf('?') >= 0 ? '&' : '?'}${queryStr}`
}
export function diffInDays (time1, time2) {
return Math.abs(dayjs(time1).diff(dayjs(time2), 'day'))
}
export function formatTime(time, formatter = 'YYYY-MM-DD') {
const newTime = time.toString().length < 13 ? time * 1000 : time
return dayjs(newTime).format(formatter)
@ -300,7 +297,7 @@ export function copyText (text, msg = '内容已复制') {
console.log('copyText:text', text)
my.setClipboard({
text: text,
})
});
resolve(text)
return
}
@ -801,7 +798,7 @@ const alipayAutoLogin = () => {
my.getAuthCode({
scopes: 'auth_base',
success: (res) => {
const code = res.authCode
const code = res.authCode;
resolve({ code })
},
fail: (res) => {
@ -818,19 +815,19 @@ const requestAlipayminiPayment = (tradeNO) => {
my.tradePay({
tradeNO: tradeNO,
success: (res) => {
console.log('支付回调成功res', res)
console.log('支付回调成功res', res);
resolve(res)
},
fail: (res) => {
console.log('支付回调失败res', res)
console.log('支付回调失败res', res);
reject(res)
}
})
});
})
}
const htmlStringToNodeArray = (htmlString) => {
let nodeArray = null
let nodeArray = null;
parse(htmlString, (err, nodes) => {
if (!err) {
nodeArray = nodes
@ -838,7 +835,7 @@ const htmlStringToNodeArray = (htmlString) => {
log.error('htmlStringToNodeArray error')
}
})
return nodeArray
return nodeArray;
}
const getCurrentPageRouteParams = () => {
@ -864,7 +861,7 @@ const resolveUrlParamsParse = (url) => {
const itemArr = item.split('=')
const key = itemArr[0]
const value = itemArr[1]
res[key] = value
res[key] = value;
})
return res
}