Compare commits

...

7 Commits

Author SHA1 Message Date
王文龙 37a7089aa9 完成发票管理功能 2024-02-27 10:25:29 +08:00
王文龙 ab8ccc7741 update 2024-02-24 20:22:16 +08:00
王文龙 5545b6d619 update 2024-02-22 09:59:42 +08:00
王文龙 bf90b988f0 update 2024-02-21 15:11:17 +08:00
王文龙 9ffd570fbb update 2024-02-08 18:21:36 +08:00
王文龙 7dee2fac1f update 2024-02-06 18:13:35 +08:00
王文龙 6ae387165b update 2024-02-02 10:30:05 +08:00
74 changed files with 2844 additions and 1038 deletions

View File

@ -1,42 +1,42 @@
import req from './req'
import { platformTemplateName, transformPlatformUrl } from '@/utils/platform'
export function memberInfo() {
export function memberInfo () {
return req.get('/member')
}
// 修改用户信息
export function setMemberInfo(params = {}) {
export function setMemberInfo (params = {}) {
return req.put('/member', params)
}
export function updateMemberInfo(params = {}) {
export function updateMemberInfo (params = {}) {
return req.put('/memberinfo', params)
}
// 注销用户
export function deleteMember(params) {
export function deleteMember (params) {
return req.delete('/member', params)
}
// 更新会员手机号
export function setMemberMobile(params = {}) {
export function setMemberMobile (params = {}) {
return req.put('/member/mobile', params)
}
export function pointDetail() {
export function pointDetail () {
return req.get('/member.point.detail')
}
export function favsList(params = {}) {
export function favsList (params = {}) {
return req.get('/member/collect/item', params, null, { showError: false })
}
export function addFav(item_id, params) {
export function addFav (item_id, params) {
return req.post(`/member/collect/item/${item_id}`, params)
}
export function delFav(item_ids, params = {}) {
export function delFav (item_ids, params = {}) {
item_ids = Array.isArray(item_ids) ? item_ids : [item_ids]
const { is_empty = false } = params
return req.delete('/member/collect/item', {
@ -45,51 +45,53 @@ export function delFav(item_ids, params = {}) {
})
}
export function memberAssets() {
export function memberAssets () {
return req.get(`/member/statistical`)
}
export function couponList(params = {}) {
export function couponList (params = {}) {
return req.get('/user/newGetCardList', params)
}
export function getUserCardList(params = {}) {
export function getUserCardList (params = {}) {
return req.get('/user/getUserCardList', params)
}
export function homeCouponList(params = {}) {
return req.get('/getCardList', params)
export function homeCouponList (params = {}) {
// return req.get('/getCardList', params)
return req.get('/getRedeemDiscountCardList', params) //积分兑换优惠券列表
}
export function homeCouponGet(params = {}) {
export function homeCouponGet (params = {}) {
return req.get('/user/receiveCard', params)
}
export function getCardDetail(params = {}) {
return req.get('/user/getCardDetail', params)
export function getCardDetail (params = {}) {
// return req.get('/user/getCardDetail', params)
return req.post('/user/receiveCardByPoint', params) //积分换优惠券操作
}
export function userUsedCard(params = {}) {
export function userUsedCard (params = {}) {
return req.get('/user/usedCard', params)
}
export function addressList(params) {
export function addressList (params) {
return req.get('/member/addresslist', params)
}
export function crmAddressList(params = {}) {
export function crmAddressList (params = {}) {
//获取crm地址
return req.post('/member/crmaddresslist', params)
}
export function addressCreate(params = {}) {
export function addressCreate (params = {}) {
return req.post('/member/address', params)
}
export function addressUpdate(data) {
export function addressUpdate (data) {
return req.put(`/member/address/${data.address_id}`, data)
}
export function addressDelete(address_id) {
export function addressDelete (address_id) {
return req.delete(`/member/address/${address_id}`)
}
@ -97,267 +99,267 @@ export function addressDelete(address_id) {
return req.get('/member/addressarea')
}*/
export function areaList() {
export function areaList () {
return req.get('/espier/address')
}
export function addressCreateOrUpdate(data) {
export function addressCreateOrUpdate (data) {
const fn = data.address_id ? addressUpdate : addressCreate
return fn(data)
}
export function itemHistorySave(item_id) {
export function itemHistorySave (item_id) {
return req.post('/member/browse/history/save', { item_id })
}
export function itemHistory(params) {
export function itemHistory (params) {
return req.get('/member/browse/history/list', params)
}
export function getRechargeNumber() {
export function getRechargeNumber () {
return req.get('/deposit/rechargerules')
}
// 充值
export function rehcargePay(params) {
export function rehcargePay (params) {
return req.post('/deposit/recharge', params)
}
export function qrcodeData() {
export function qrcodeData () {
return req.get('/promoter/qrcode')
}
export function memberCode(params) {
export function memberCode (params) {
return req.get('/barcode', params)
}
export function promoter() {
export function promoter () {
return req.post('/promoter')
}
export function h5_qrcodeData() {
export function h5_qrcodeData () {
return req.get('/brokerage/qrcode')
}
export function pointList(params = {}) {
export function pointList (params = {}) {
return req.get('/member/dh/point/history', params)
}
export function pointTotal() {
export function pointTotal () {
return req.get('/point/member/info')
}
export function depositList(params = {}) {
export function depositList (params = {}) {
return req.get('/deposit/list', params)
}
export function depositTotal() {
export function depositTotal () {
return req.get('/deposit/info')
}
export function depositPay(params = {}) {
export function depositPay (params = {}) {
return req.post('/deposit/recharge_new', params)
}
export function depositPayRule() {
export function depositPayRule () {
return req.get('/deposit/recharge/agreement')
}
export function formId(formid) {
export function formId (formid) {
return req.post('/promotion/formid', { formid })
}
export function recommendUserInfo() {
export function recommendUserInfo () {
return req.get('/promoter/info')
}
export function recommendIndexInfo() {
export function recommendIndexInfo () {
return req.get('/promoter/index')
}
export function recommendMember(params = {}) {
export function recommendMember (params = {}) {
return req.get('/promoter/children', params)
}
export function recommendOrder(params = {}) {
export function recommendOrder (params = {}) {
return req.get('/promoter/brokerages', params)
}
export function depositToPoint(params = {}) {
export function depositToPoint (params = {}) {
return req.post('/deposit/to/point', params)
}
export function pointDraw(params = {}) {
export function pointDraw (params = {}) {
return req.get('/promotion/luckydraw', params)
}
export function pointDrawRule() {
export function pointDrawRule () {
return req.get('/promotion/luckyrules')
}
export function pointDrawSwiper() {
export function pointDrawSwiper () {
return req.get('/promotion/luckydraw_show')
}
export function pointDrawDetail(luckydraw_id) {
export function pointDrawDetail (luckydraw_id) {
return req.get(`/promotion/luckydraw/${luckydraw_id}`)
}
export function pointDrawIntro(item_id) {
export function pointDrawIntro (item_id) {
return req.get(`/goods/itemintro/${item_id}`)
}
export function pointDrawPay(params = {}) {
export function pointDrawPay (params = {}) {
return req.post('/promotion/luckydraworder', params)
}
export function pointDrawPayList(params = {}) {
export function pointDrawPayList (params = {}) {
return req.get('/promotion/luckydraw/joinactivitys', params)
}
export function pointDrawLuck(params = {}) {
export function pointDrawLuck (params = {}) {
return req.get('/promotion/luckydrawmember', params)
}
export function pointOrderDetail(luckydraw_trade_id) {
export function pointOrderDetail (luckydraw_trade_id) {
return req.get(`/promotion/member/luckydraworder/${luckydraw_trade_id}`)
}
export function pointOrderAddress(params = {}) {
export function pointOrderAddress (params = {}) {
return req.post('/promotion/member/luckyaddress', params)
}
export function pointOrderConfirm(params = {}) {
export function pointOrderConfirm (params = {}) {
return req.post('/promotion/member/luckyorderfinish', params)
}
export function pointDrawLuckAll() {
export function pointDrawLuckAll () {
return req.get(`/promotion/luckydrawmember`)
}
export function pointMyOrder(params = {}) {
export function pointMyOrder (params = {}) {
return req.get(`/promotion/luckydrawjoinlist`, params)
}
export function pointAllOrder(luckydraw_id, params = {}) {
export function pointAllOrder (luckydraw_id, params = {}) {
return req.get(`/promotion/luckydraw/alljoinlist/${luckydraw_id}`, params)
}
export function pointCompute(luckydraw_id) {
export function pointCompute (luckydraw_id) {
return req.get(`/promotion/luckydraw/winning/${luckydraw_id}`)
}
export function pointCheckLucky(luckydraw_id) {
export function pointCheckLucky (luckydraw_id) {
return req.get(`/promotion/luckydraw/checkwinning/${luckydraw_id}`)
}
export function pointComputeResult(luckydraw_id) {
export function pointComputeResult (luckydraw_id) {
return req.get(`/promotion/luckydraw/luckylogic/${luckydraw_id}`)
}
export function storeFav(id) {
export function storeFav (id) {
return req.post(`/member/collect/distribution/${id}`)
}
export function storeFavDel(id) {
export function storeFavDel (id) {
return req.delete('/member/collect/distribution', { distributor_id: id })
}
export function storeFavList() {
export function storeFavList () {
return req.get('/member/collect/distribution')
}
export function storeFavCount(params = {}) {
export function storeFavCount (params = {}) {
return req.get('/member/collect/distribution/num', params)
}
export function storeIsFav(id) {
export function storeIsFav (id) {
return req.get('/member/collect/distribution/check', { distributor_id: id })
}
export function receiveVip() {
export function receiveVip () {
return req.get('/promotion/getMemberCard')
}
// 获取导购信息
export function getSalesperson(params = {}) {
export function getSalesperson (params = {}) {
return req.get('/salesperson', params)
}
// 获取导购投诉列表
export function getComplaintsList(params = {}) {
export function getComplaintsList (params = {}) {
return req.get('/salesperson/complaintsList', params)
}
// 导购投诉
export function setComplaints(params = {}) {
export function setComplaints (params = {}) {
return req.post('/salesperson/complaints', params)
}
// 获取导购投诉详情
export function getComplaintsDetail(id, params = {}) {
export function getComplaintsDetail (id, params = {}) {
return req.get(`/salesperson/complaintsDetail/${id}`, params)
}
// 获取导购
export function getUsersalespersonrel(params = {}) {
export function getUsersalespersonrel (params = {}) {
return req.get('/usersalespersonrel', params)
}
// 绑定导购
export function setUsersalespersonrel(params = {}) {
export function setUsersalespersonrel (params = {}) {
return req.post('/usersalespersonrel', params)
}
// 获取积分列表
export function getPointList(params = {}) {
export function getPointList (params = {}) {
return req.get('/member/pointLogList', params)
}
//
export function getSalespersonNologin(params = {}) {
export function getSalespersonNologin (params = {}) {
return req.get('/salesperson/nologin', params)
}
//
export function getUserNewGetCardDetail(params = {}) {
export function getUserNewGetCardDetail (params = {}) {
return req.get('/user/newGetCardDetail', params)
}
// 经销商入驻申请
export function hfpayApplySave(params = {}) {
export function hfpayApplySave (params = {}) {
return req.post('/hfpay/applysave', params)
}
// 经销商入驻详情
export function hfpayUserApply(params = {}) {
export function hfpayUserApply (params = {}) {
return req.get('/hfpay/userapply', params)
}
// 绑定银行卡
export function hfpayBankSave(params = {}) {
export function hfpayBankSave (params = {}) {
return req.post('/hfpay/banksave', params)
}
// 获取绑定银行卡
export function hfpayBankInfo(params = {}) {
export function hfpayBankInfo (params = {}) {
return req.get('/hfpay/bankinfo', params)
}
// 获取获取支付方式
export function getTradePaymentList(params = {}) {
export function getTradePaymentList (params = {}) {
return req.get('/trade/payment/list', params)
}
// 获取新的支付方式
export function getNewTradePaymentList(params = {}) {
export function getNewTradePaymentList (params = {}) {
return req.get('/trade/withdraw/list', params)
}
export function getIsHf(params = {}) {
export function getIsHf (params = {}) {
return req.get('/trade/payment/hfpayversionstatus', params)
}
//获取是否开启获取crm地址
export function getCrmsetting() {
export function getCrmsetting () {
return req.get('/member/crmsetting')
}
// 配置地址
export function getSettingCenter() {
export function getSettingCenter () {
return req.get(transformPlatformUrl('/alipay/pageparams/setting'), {
template_name: platformTemplateName,
version: 'v1.0.1',
@ -366,20 +368,20 @@ export function getSettingCenter() {
}
// 获取核销码
export function getQRcode(params) {
export function getQRcode (params) {
return req.get('/user/exchangeCardInfo', params)
}
// 会员等级
export function getMemberCard() {
export function getMemberCard () {
return req.get('/membercard/grades')
}
// 会员中心分享配置
export function getMemberShareConfig() {
export function getMemberShareConfig () {
return req.get('/memberCenterShare/getInfo')
}
export function is_admin(params) {
export function is_admin (params) {
return req.get('/distributor/bind/checkout', params)
}

View File

@ -44,6 +44,9 @@ 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') {

BIN
src/assets/bo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
src/assets/info.png Normal file

Binary file not shown.

After

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'>+请选择收货地址</View>
<View className='address-info__bd' onClick={this.clickTo.bind(this, 'choose')}>+请选择收货地址</View>
)}
</View>
</View>

View File

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

View File

@ -12,8 +12,8 @@ import './index.scss'
const initialState = {
isExpanded: false
}
function SpCoupon(props) {
const { info, children, onClick = () => {} } = props
function SpCoupon (props) {
const { info, children, onClick = () => { }, isNew } = props
const [state, setState] = useImmer(initialState)
const { isExpanded } = state
if (!info) {
@ -34,12 +34,39 @@ function SpCoupon(props) {
description,
quantity,
getNum,
distributorName
distributorName,
couponStatus,
id,
fixedTerm,
status,
valid,
} = 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 (
@ -79,9 +106,9 @@ function SpCoupon(props) {
<View className='sp-coupon-content'>
<View
className='sp-coupon-hd'
// style={styleNames({
// backgroundImage: `url(${process.env.APP_IMAGE_CDN}${'/coupon_FFF.png'})`
// })}
// style={styleNames({
// backgroundImage: `url(${process.env.APP_IMAGE_CDN}${'/coupon_FFF.png'})`
// })}
>
<View className='couponn-info'>
<View
@ -92,32 +119,31 @@ function SpCoupon(props) {
>
{COUPON_TYPE[cardType].tag}
</View>
<View className='title'>{`${
VERSION_PLATFORM && distributorName ? `${distributorName}: ${title}` : title
}`}</View>
<View className='title'>{`${VERSION_PLATFORM && distributorName ? `${distributorName}: ${title}` : title
}`}</View>
</View>
<View className='coupon-datetime'>{`有效期: ${beginDate} - ${endDate}`}</View>
<View className='coupon-desc'>
{info.valid &&
(
<>
<Text className='coupon-desc-txt'>详细信息</Text>
<SpImage
src={`${isExpanded ? 'coupon_arrow_up.png' : 'coupon_arrow_down.png'}`}
width={24}
height={24}
onClick={() => {
setState((draft) => {
draft.isExpanded = !isExpanded
})
}}
/>
</>
)
}
{!info.valid && (
<View className='invaild-desc'>{info.invalidDesc}</View>
)}
{info.valid &&
(
<>
<Text className='coupon-desc-txt'>详细信息</Text>
<SpImage
src={`${isExpanded ? 'coupon_arrow_up.png' : 'coupon_arrow_down.png'}`}
width={24}
height={24}
onClick={() => {
setState((draft) => {
draft.isExpanded = !isExpanded
})
}}
/>
</>
)
}
{!info.valid && (
<View className='invaild-desc'>{info.invalidDesc}</View>
)}
</View>
</View>
<View

View File

@ -65,7 +65,7 @@
.coupon-desc-txt {
margin-right: 6px;
}
.invaild-desc{
.invaild-desc {
color: red;
font-size: 24px;
}
@ -181,3 +181,80 @@
}
}
}
.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,15 +88,16 @@ 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>
))} */}
<SpPicker mode="select" isTop source={list} value={value} pickerConfirm={this.handleConfirm.bind(this)} leftBtnTxt="筛选" rightBtnTxt={<AtIcon value="close" size={14} color="#000"></AtIcon>}>
{/* 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>}>
<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">
<View className="item item-right-1">
<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>
<View className='labels-block'>
{false && <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,6 +47,7 @@ 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)
@ -134,7 +135,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.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?.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>)}
{/* <View className="new" style={{ left: '120rpx' }}>NEW</View> */}
</View>
{/* {renderBrand && <View className='goods-brand-wrap'>{renderBrand}</View>} */}
@ -168,7 +169,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' }}></View>
<View className={`color${index == current ? ' active' : ''}`} style={{ backgroundColor: item.color_value || '#000', width: windowWidth >= 420 ? '14px' : '24rpx', height: windowWidth >= 420 ? '14px' : '24rpx' }}></View>
</View>
))}
</ScrollView>

View File

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

View File

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

View File

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

View File

@ -65,6 +65,7 @@ function SpLogin (props, ref) {
}
const handleBindPhone = async (e) => {
setLoginModal(false)
const { encryptedData, iv, cloudID } = e.detail
if (encryptedData && iv) {
const code = codeRef.current
@ -234,7 +235,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>
@ -258,10 +259,8 @@ function SpLogin (props, ref) {
</View>
</ScrollView>
<View className='btn-wrap'>
{isNewUser && <AtButton className='btn' type='primary' openType="getPhoneNumber" onGetPhoneNumber={(e) => {
setLoginModal(false)
handleBindPhone(e)
}}>
{isNewUser && <AtButton className='btn' type='primary' openType="getPhoneNumber" onGetPhoneNumber={handleBindPhone
}>
同意并继续
</AtButton>}
{!isNewUser && <AtButton className='btn' type='primary' onClick={handleUserLogin}>
@ -272,7 +271,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: 38%;
width: 42%;
// margin-bottom: 40px;
padding: 20px 0;
position: relative;
@ -26,7 +26,7 @@
&__ft {
flex: 1;
text-align: right;
padding-top: 10px;
padding-top: 8px;
// font-size: $font-size-small;
}
&__title {
@ -34,6 +34,7 @@
@include multi-ellipsis(1);
margin-bottom: 26px;
color: #000;
font-size: 20px;
// margin: 0 0 15px;
&-tag {
display: inline-block;
@ -45,6 +46,7 @@
}
}
&__desc {
opacity: 0.85;
// color: $color-gray;
// font-size: $font-size-small;
// margin-bottom: 10px;
@ -67,6 +69,7 @@
&__num {
display: block;
margin-top: 26px;
opacity: 0.85;
// color: $color-gray;
}
&__pay-type {
@ -75,8 +78,9 @@
font-size: 20px;
color: #c1c1c1;
}
.sp-price__symbol,
.sp-price__int {
font-weight: bold !important;
}
// .sp-price__symbol,
// .sp-price__int,
// .sp-price__decimal {
// 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'].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 = 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 && <AtBadge value={cartCount} maxValue={99}><SpImage src={`member/cart.png`} onClick={() => Taro.redirectTo({ url: '/pages/cart/espier-index' })} height={36} mode='heightFix' isNew /></AtBadge>}
{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}
{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 {
height: $page-ipx-footer-height;
min-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 } from 'react'
import React, { useEffect, useState } 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,33 +19,18 @@ function PickerDateTime (props) {
{ mode: 'day', unit: '日' },
]
// const [state, setState] = useAsyncCallback({ source: props.list || [], value: props.value || '' })
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 [state, setState] = useImmer({ value: [props.value || 0] })
// const { source, value } = state
const [value, setState] = useState(props.value || [0])
const onChange = (e, index) => {
const onChange = (e) => {
// const _value = [...value]
// _value[index] = e.detail.value
// console.log(value, e.detail.value)
// const { source, value } = state
// source.item[]
setState(
(draft) => {
draft.value = e.detail.value
},
e.detail.value
// ({ source, value }) => {
// const res = []
// for (let i = 0; i < source.length; i++) {
@ -69,27 +54,26 @@ function PickerDateTime (props) {
// }
)
}
console.log(value)
const handleClick = () => {
onPickerCancel()
handleConfirm(list[value[0]], value[0])
}
return (
<View className='picker-custom'>
<PickerView
indicator-style='height: 40px;'
value={value}
onChange={(e) => onChange(e)}
immediateChange
// 使用acc.concat将多维数组打平成一维数组再求数组长度
>
<PickerViewColumn>
{source.map((item, elementIndex) => (
<View key={elementIndex} >{item.text}</View>
{list.map((item, elementIndex) => (
<View key={'list' + elementIndex} >{item.text}</View>
))}
</PickerViewColumn>
</PickerView>
<View className="picker-btn" onClick={() => {
onPickerCancel()
setTimeout(() => {
handleConfirm(source[value[0]], value[0])
}, 100)
}}>确定</View>
<View className="picker-btn" onClick={handleClick}>确定</View>
</View>
)
}

View File

@ -16,9 +16,9 @@ const initState = {
privacy: ''
}
function SpPrivacyModal(props) {
function SpPrivacyModal (props) {
const { login, updatePolicyTime, getUserInfoAuth } = useLogin()
const { open = false, onCancel = () => {}, onConfirm = () => {} } = props
const { open = false, onCancel = () => { }, onConfirm = () => { } } = props
const [info, setInfo] = useImmer(initState)
useEffect(() => {
if (open) {

View File

@ -66,6 +66,10 @@ 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))
@ -74,23 +78,28 @@ function SpSkuSelect (props, ref) {
selection = defaultSpecItem.specItem.map((item) => item.specId)
}
calcDisabled(selection)
calcDisabled(selection, -1)
}
const calcDisabled = (selection, i = 0) => {
const calcDisabled = (selection, e = 0) => {
const { skuList, specItems } = info
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('_')
// console.log('regStr:', regStr)
return new RegExp(regStr)
return regStr
// return new RegExp(regStr)
}
const isNotDisabled = (sel, row, val) => {
const reg = makeReg(sel, row, val)
return Object.keys(skuDictRef.current).some((key) => {
return key.match(reg) && skuDictRef.current[key].store > 0 && ['onsale'].includes(skuDictRef.current[key].approveStatus)
if (key == reg) {
return skuDictRef.current[key].store > 0 && ['onsale'].includes(skuDictRef.current[key].approveStatus)
} else {
return false
}
})
}
@ -112,22 +121,22 @@ function SpSkuSelect (props, ref) {
// disabledSet
// )
const curItem = skuDictRef.current[selection.join('_')]
const curItem = skuDictRef.current[selection.join('_')] || skuDictRef.current[Object.keys(skuDictRef.current)[0]]
// const skuText = curItem
// ? `已选:${curItem.specItem.map((item) => `${item.skuName}:${item.specName}`).join(',')}`
// : '请选择规格'
const skuText = curItem
? `已选择 ${curItem.specItem.map((item, index) => `${index === 1 ? item.specName.substr(0, 2) : item.specName}`).join(' ')}`
? `已选择 ${curItem.specItem.map((item, index) => `${index === 1 ? item.specName.substr(0, 2) : item.specName}`).join(' ')}`
: '请选择规格'
setState((draft) => {
draft.selection = selection
draft.disabledSet = disabledSet
draft.curItem = curItem
draft.skuText = skuText
draft.skuText = e === -1 ? '' : skuText
})
onChange(skuText, curItem, i)
onChange(skuText, curItem, e === -1 ? 0 : e)
}
// calcDisabled(initSelection)
@ -135,7 +144,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) => {
@ -178,7 +187,7 @@ function SpSkuSelect (props, ref) {
return null
}
const { skuList } = info
// const { skuList } = info
const addToCart = async () => {
const { nospec } = info
@ -370,7 +379,7 @@ function SpSkuSelect (props, ref) {
</View>
</View>}
<View className='sku-list'>
{skuList.map((item, index) => (
{info.skuList.map((item, index) => (
<View className='sku-group' key={`sku-group__${index}`}>
{/* <View className='sku-name'>{item.skuName}</View> */}
<View className='sku-values'>
@ -390,27 +399,29 @@ function SpSkuSelect (props, ref) {
)}
</ScrollView>}
{index > 0 && item.skuValue.map((spec, idx) => (
<View
className={classNames('sku-btn btn-noac', {
'active': spec.specId == selection[index],
'btn-primary': spec.specId == selection[index],
'disabled': disabledSet.has(spec.specId),
'sku-img': spec.specImgs.length > 0
})}
onClick={handleSelectSku.bind(this, spec, index)}
key={`sku-values-item__${idx}`}
>
{/* {spec.specImgs.length > 0 && (
<SpImage src={spec.specImgs[0]} width={260} height={260} />
)} */}
<View className={classNames('spec-name', { 'pad': index === 2 })}>{spec.specName}</View>
</View>
<>
{!disabledSet.has(spec.specId) && <View
className={classNames('sku-btn btn-noac', {
'active': spec.specId == selection[index],
'btn-primary': spec.specId == selection[index],
'disabled': disabledSet.has(spec.specId),
'sku-img': spec.specImgs.length > 0
})}
onClick={handleSelectSku.bind(this, spec, index)}
key={`sku-values-item__${idx}`}
>
{/* {spec.specImgs.length > 0 && (
<SpImage src={spec.specImgs[0]} width={260} height={260} />
)} */}
<View className={classNames('spec-name', { 'pad': index === 2 })}>{spec.specName}</View>
</View>}
</>
))}
</View>
</View>
))}
{!hideInputNumber && renderLimitTip()}
<View className="select">{skuText}</View>
{/* {!hideInputNumber && renderLimitTip()} */}
<View className="select">{skuText.split(' ').map((item, index) => <Text key={`sku-text__${index}`} style={{ marginRight: '14px' }}>{item}</Text>)}</View>
</View>
{/* </SpFloatLayout> */}
</View>
@ -421,4 +432,4 @@ SpSkuSelect.options = {
addGlobalClass: true
}
export default React.forwardRef(SpSkuSelect)
export default React.memo(React.forwardRef(SpSkuSelect))

View File

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

View File

@ -1,4 +1,4 @@
import { formatTime } from '@/utils'
import { formatTime, diffInDays } from '@/utils'
export const COUPON_ITEM = {
title: 'title',
@ -6,7 +6,7 @@ export const COUPON_ITEM = {
cardId: 'card_id',
cardType: 'card_type',
code: 'code',
invalidDesc:'invalid_desc',
invalidDesc: 'invalid_desc',
beginDate: ({ begin_date }) => begin_date.replace(/-/g, '.'),
endDate: ({ end_date }) => end_date.replace(/-/g, '.'),
tagClass: 'tagClass',
@ -24,12 +24,31 @@ export const COUPON_ITEM = {
status: 'status',
getNum: 'get_num',
valid: ({ valid }) => {
if(typeof valid === 'undefined') {
if (typeof valid === 'undefined') {
return true
} 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 = {
@ -49,22 +68,24 @@ export const COUPON = {
description: 'description',
quantity: ({ quantity }) => parseInt(quantity),
getNum: 'get_num',
couponStatus: ({ quantity, get_limit, user_get_num, get_num}) => {
if(quantity - get_num <= 0) {
couponStatus: ({ quantity, get_limit, user_get_num, get_num }) => {
if (quantity - get_num <= 0) {
return 0 // 已领完
} else if(get_limit - user_get_num > 0) {
} else if (get_limit - user_get_num > 0) {
return 1 // 立即领取
} else if(get_limit - user_get_num <= 0) {
} else if (get_limit - user_get_num <= 0) {
return 2 // 已领取
}
},
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') {
if (typeof valid === 'undefined') {
return true
} else {
return valid

View File

@ -122,6 +122,8 @@ 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,7 +36,25 @@ export const TRADE_ITEM = {
refundNum: 1,
itemSpecDesc: 'item_spec_desc',
point: 'point',
checked: () => false
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
}
}
})
},
point: 'point',
@ -44,7 +62,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 = {
@ -54,27 +72,67 @@ 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,
// 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
}
}
})
},
hasAftersalesAddress: ({ aftersales_address }) => isObject(aftersales_address),
afterSalesName: ({ aftersales_address }) => aftersales_address.aftersales_name,
afterSalesMobile: ({ aftersales_address }) => aftersales_address.aftersales_mobile,
afterSalesAddress: ({ aftersales_address }) => aftersales_address.aftersales_address,
afterSalesContact: ({ aftersales_address }) => aftersales_address.aftersales_contact,
aftersalesHours: ({ aftersales_address }) => aftersales_address.aftersales_hours,
afterSalesName: ({ aftersales_address }) => aftersales_address.aftersales_name,
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,6 +37,7 @@ export default (props = {}) => {
const login = async () => {
if (isWeixin || isAlipay) {
// await getUserInfoAuth(false)
// 隐私协议
// const checkResult = await checkPolicyChange()
// if (checkResult) {

View File

@ -19,10 +19,11 @@ export default (props = {}) => {
// const { params, orderInfo } = state
const cashierResultUrl = `/pages/cart/cashier-result`
const $instance = getCurrentInstance()
const currentPath = $instance.router.path
// console.log("🚀 ~ $instance.router:", $instance.router)
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':
@ -101,13 +102,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,10 +1,11 @@
import React, { useEffect } from 'react'
import { useImmer } from 'use-immer'
import Taro, { getCurrentInstance, getCurrentPages } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import { View, Text, Image } from '@tarojs/components'
import { AtButton, AtSwipeAction } from 'taro-ui'
import { useDispatch, useSelector } from 'react-redux'
import { SpToast, SpNavBar, SpPage } from '@/components'
import { SpToast, SpNavBar, SpPage, SpCheckboxNew } from '@/components'
import { classNames } from '@/utils'
import S from '@/spx'
import api from '@/api'
@ -15,7 +16,11 @@ const ADDRESS_ID = 'address_id'
const initialState = {
list: [],
isPicker: false,
selectedId: null
selectedId: null,
isSelected: '',
selItem: null,
editId: null,
visible: false
}
function AddressIndex (props) {
@ -34,12 +39,17 @@ function AddressIndex (props) {
}
const fetch = async (isDelete = false) => {
const { isPicker, receipt_type = '', city = '' } = $instance.router.params
const { isPicker, isSelected = '', 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()
@ -64,9 +74,14 @@ 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
})
}
@ -168,7 +183,7 @@ function AddressIndex (props) {
Taro.navigateBack()
}
const { selectedId, isPicker, list } = state
const { selectedId, isPicker, list, isSelected, selItem, editId, visible } = state
const options = [
{
text: '',
@ -180,15 +195,30 @@ 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 type='primary' onClick={handleClickToEdit}>
<AtButton onClick={handleClickToEdit}>
新增地址
</AtButton>
{!!isSelected && <AtButton type='primary' disabled={!editId} onClick={editAddr} style={{ margin: '30rpx 0 100rpx 0' }}>
确认修改
</AtButton>}
</View>
}
>
@ -214,87 +244,123 @@ function AddressIndex (props) {
)} */}
<View className='member-address-list'>
{list?.length && list.map((item, index) => {
{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) => {
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'>
<View className='address-item__title'>
<View className='address-item__info'>
<Text>{item.username}</Text>
<Text className='address-item__info_edit' onClick={e => handleClickToEdit(e, item)}>编辑</Text>
</View>
<Text className='address-item__info_tel'>{item.telephone}</Text>
</View>
<View className='address-item__detail_box'>
<View className='address-item__detail'>
{item.province}
{item.city}
{item.county}
{item.adrdetail}
</View>
{isPicker && !item.disabled && (
<View className='address-item__check' onClick={e => handleClickChecked(e, item)}>
{item[ADDRESS_ID] === selectedId ? (
<Text
className='iconfont icon-check address-item__checked'
style={{ color: colors.colorPrimary }}
></Text>
) : (
<Text
className='address-item__unchecked'
style={{ borderColor: colors.colorPrimary }}
>
{' '}
</Text>
)}
<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__title'>
<View className='address-item__info'>
<Text>{item.username}</Text>
{!isSelected && <Text className='address-item__info_edit' onClick={e => handleClickToEdit(e, item)}>编辑</Text>}
</View>
<Text className='address-item__info_tel'>{item.telephone}</Text>
</View>
<View className='address-item__detail_box'>
<View className='address-item__detail'>
{item.province}
{item.city}
{item.county}
{item.adrdetail}
</View>
)}
</View>
<View className='address-item__footer'>
<View
className='address-item__footer_default'
onClick={(e) => handleChangeDefault(e, item)}
>
{item.is_def ? (
<>
<Text
// className='iconfont icon-check default__icon default__checked'
className='icon-my icon-checkbox-xuanzhong'
style={{ color: colors.colorPrimary }}
>
{' '}
</Text>
<Text className='default-text'>已设为默认</Text>
</>
) : (
<>
<Text
// className='address-item__unchecked'
className='icon-my icon-checkbox-weixuan'
style={{ borderColor: colors.colorPrimary }}
>
{' '}
</Text>
<Text className='default-text'>设为默认</Text>
</>
{isPicker && !item.disabled && (
<View className='address-item__check' onClick={e => handleClickChecked(e, item)}>
{item[ADDRESS_ID] === selectedId ? (
<Text
className='iconfont icon-check address-item__checked'
style={{ color: colors.colorPrimary }}
></Text>
) : (
<Text
className='address-item__unchecked'
style={{ borderColor: colors.colorPrimary }}
>
{' '}
</Text>
)}
</View>
)}
</View>
{/* <View className='address-item__footer_edit'>
<View className='footer-text' onClick={(e) => handleDelete(e, item, index)}>
<Text className='iconfont icon-trashCan footer-icon'> </Text>
<Text>删除</Text>
{!isSelected && <View className='address-item__footer'>
<View
className='address-item__footer_default'
onClick={(e) => handleChangeDefault(e, item)}
>
{item.is_def ? (
<>
<Text
// className='iconfont icon-check default__icon default__checked'
className='icon-my icon-checkbox-xuanzhong'
style={{ color: colors.colorPrimary }}
>
{' '}
</Text>
<Text className='default-text'>已设为默认</Text>
</>
) : (
<>
<Text
// className='address-item__unchecked'
className='icon-my icon-checkbox-weixuan'
style={{ borderColor: colors.colorPrimary }}
>
{' '}
</Text>
<Text className='default-text'>设为默认</Text>
</>
)}
</View>
<View className='footer-text' onClick={(e) => handleClickToEdit(e, item)}>
<Text className='iconfont icon-edit footer-icon'> </Text>
<Text>编辑</Text>
</View>
</View> */}
{/* <View className='address-item__footer_edit'>
<View className='footer-text' onClick={(e) => handleDelete(e, item, index)}>
<Text className='iconfont icon-trashCan footer-icon'> </Text>
<Text>删除</Text>
</View>
<View className='footer-text' onClick={(e) => handleClickToEdit(e, item)}>
<Text className='iconfont icon-edit footer-icon'> </Text>
<Text>编辑</Text>
</View>
</View> */}
</View>}
</View>
</View>
</AtSwipeAction>
@ -303,6 +369,12 @@ function AddressIndex (props) {
})}
</View>
<SpToast />
<View className={classNames('toast', {
'visible': visible
})}>
<View>修改成功</View>
</View>
</View>
</SpPage>
)

View File

@ -4,11 +4,16 @@
// background: #f5f5f5;
padding: 20px;
.btn-wrap {
padding: 0 50px;
padding: 20px 50px 0;
border: transparent 1px solid;
.at-button__text {
font-size: 32px;
}
.at-button {
&:not(:first-child) {
margin: 30px 0 100px;
}
}
}
.member-address-list {
// /* #ifdef h5 */
@ -63,6 +68,16 @@
// 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;
@ -89,7 +104,7 @@
}
&__detail {
@include multi-ellipsis(2);
margin: 0 30px 50px 0;
// margin: 0 30px 50px 0;
color: #959595;
}
.at-swipe-action {
@ -107,6 +122,7 @@
.address-item__footer {
display: flex;
justify-content: space-between;
margin-top: 50px;
// color: #9d9d9d;
// padding-top: 19px;
&_default {
@ -158,4 +174,30 @@
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

@ -17,7 +17,7 @@ const initialState = {
czOrder: false
}
function CashierResult(props) {
function CashierResult (props) {
const $instance = getCurrentInstance()
const { cashierPayment } = usePayment()
@ -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,7 +114,24 @@ function CashierResult(props) {
onConfirm={() => {
Taro.redirectTo({ url: `/subpage/pages/trade/detail?id=${orderId}` })
}}
></SpButton>
></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>
</View>
)}
@ -123,7 +140,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: 40px;
font-size: 80px;
color: var(--color-primary);
}
.trade-txt {

View File

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

View File

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

View File

@ -105,7 +105,8 @@ function CartCheckout (props) {
buildingNumber,
houseNumber, // 房号
routerParams, // 路由参数
orderTtems
orderTtems,
couponTotal
} = state
const {
@ -123,10 +124,11 @@ 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()) // 清空优惠券信息
@ -146,7 +148,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()
}
@ -161,6 +163,20 @@ 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()
@ -233,7 +249,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) {
@ -349,6 +365,24 @@ 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') {
@ -403,9 +437,12 @@ function CartCheckout (props) {
price
}
})
let url = `/subpages/marketing/coupon-picker?items=${JSON.stringify(
items
)}&is_checkout=true&cart_type=${cart_type}&distributor_id=${shop_id || id}&source=${source}`
let url = `/subpages/marketing/coupon-picker`
// let url = `/subpages/marketing/coupon`
+ `?items=${JSON.stringify(
items
)}&is_checkout=true&cart_type=${cart_type}&distributor_id=${shop_id || id}&source=${source}`
if (couponInfo?.coupon_code) {
url = `${url}&coupon=${couponInfo?.coupon_code}`
}
@ -527,7 +564,7 @@ function CartCheckout (props) {
receiver_district,
item_fee_new,
market_fee,
items_promotion
items_promotion,
} = orderRes
let subdistrictRes
@ -554,7 +591,8 @@ function CartCheckout (props) {
// }
coupon_id: id,
coupon_code: coupon_code,
title: info
title: info,
...coupon_info
}
setState((draft) => {
draft.couponInfo = _info
@ -587,7 +625,7 @@ function CartCheckout (props) {
point_fee, //积分抵扣金额,
item_point,
freight_type,
promotion_discount
promotion_discount,
}
const point_info = {
@ -716,7 +754,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
@ -863,6 +901,14 @@ 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>
@ -876,14 +922,14 @@ function CartCheckout (props) {
<View className='line'>
<View className='left'>优惠金额</View>
{/* 促销 + 优惠券 */}
<View className='right'>{`¥${parseFloat(totalInfo.promotion_discount + totalInfo.coupon_discount).toFixed(2)}`}</View>
<View className='right'>{`¥ ${parseFloat(totalInfo.promotion_discount + (totalInfo.coupon_discount || 0) / 100).toFixed(2)}`}</View>
</View>
<View className='line'>
<View className='left'>运费</View>
<View className='right'>
{totalInfo.freight_type !== 'point'
? `¥${totalInfo.freight_fee}`
: `${totalInfo.freight_fee * 100}${this.props.pointName}`}
? `¥ ${+totalInfo.freight_fee / 100}`
: `${totalInfo.freight_fee}${this.props.pointName}`}
</View>
</View>
</View>
@ -920,7 +966,7 @@ function CartCheckout (props) {
// : ''
return (
<SpPage ref={pageRef} className='page-cart-checkout' renderFooter={renderFooter()}>
<SpPage ref={pageRef} className='page-cart-checkout' renderFooter={renderFooter()} title="订单结算">
{isObjectsValue(shoppingGuideData) && (
<View className='shopping-guide__header'>
此订单商品来自{shoppingGuideData.store_name}导购 {shoppingGuideData.name}的推荐
@ -994,7 +1040,7 @@ function CartCheckout (props) {
value={couponText || '请选择'}
/>
)} */}
{/* {isWeixin && !bargain_id && totalInfo.invoice_status && (
{isWeixin && !bargain_id && totalInfo.invoice_status && (
<SpCell
isLink
title='开发票'
@ -1012,7 +1058,7 @@ function CartCheckout (props) {
</View>
}
/>
)} */}
)}
{packInfo.is_open && (
<SpCell

View File

@ -219,8 +219,21 @@ $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 24px;
padding: 20px 0px;
.line {
display: flex;
width: 100%;

View File

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

View File

@ -37,6 +37,7 @@
padding-top: 40px;
/* #endif */
margin-bottom: 36px;
padding-bottom: 100px;
&-shadow {
// box-shadow: 0px 2px 10px 0px #eae7e0;
}
@ -154,7 +155,7 @@
}
.cart-item-wrap {
padding: 60px 36px;
padding: 60px 36px 100px;
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 || ''
const currentID = info[activeIndex].id || info[activeIndex].category_id || ''
return (
<View className='comp-series'>
{/* left */}
@ -146,9 +146,13 @@ const CompSeries = (props) => {
)}
<View className='comp-series__content_box'>
{!showChild ? currentChildren.map((item, index) => {
return (<View className='group' key={index} onClick={() => {
setShowChild(true)
setSelChild(item)
return (index === 0 || currentID === '18' ? <View className='group' key={index} onClick={() => {
if (item.children?.length) {
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>
@ -159,6 +163,18 @@ 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,13 +73,15 @@ 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 - 620px - #{$tabbar-height} - var(--status-bar-height));
height: calc(100vh - 420px - #{$tabbar-height} - var(--status-bar-height));
transition: height 0.35s linear;
margin-top: -200px;
}
.item-btns {
display: flex;
@ -139,7 +141,7 @@ page {
}
}
.icon-kf {
position: absolute;
position: fixed;
right: 20px;
top: 60%;
width: 80px;
@ -236,6 +238,29 @@ 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,12 +102,14 @@ const initialState = {
pic: 'https://espier-oss-cdn.oss-cn-shanghai.aliyuncs.com/default_project/image/1/2024/01/15/46fe6ca52277038e39ee2c026a4af3c90XruENsSSAhRiz0HPI3PjR8XQNVgbxHb'
},
],
goodList: []
goodList: [],
recommend: []
}
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(
@ -120,8 +122,10 @@ 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 } = state
const { wgts, loading, searchComp, pageData, fixedTop, filterWgts, isShowHomeHeader, isUpOperation, showRecommend, shopList, swiperList, goodList, recommend } = state
const dispatch = useDispatch()
@ -130,6 +134,7 @@ function Home () {
init()
setNavigationBarTitle(appName)
getSwiperList()
getRecommendItems()
}
}, [initState])
@ -188,6 +193,50 @@ 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) => {
@ -197,12 +246,11 @@ 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,
price: ite.price ? ite.price / 100 : 0,
spec_images: ite.spec_images || [],
tagList: ite.tagList || []
}
@ -294,12 +342,16 @@ function Home () {
}
const handleTouchStart = (e) => {
setStartY(e.touches[0].clientY)
const { clientY, clientX } = e.touches[0]
setStartY(clientY)
setStartX(clientX)
}
const handleTouchEnd = (e) => {
const endY = e.changedTouches[0].clientY
const deltaY = endY - startY
const { clientX, clientY } = e.changedTouches[0]
const deltaY = clientY - startY
const deltaX = clientX - startX
if (Math.abs(deltaY) < 50) return
if (deltaY > 0) {
// 下滑操作
@ -415,7 +467,7 @@ function Home () {
<Image
src={item.src}
style={{ width: "100%", height: "100%", objectPosition: "center" }}
mode="aspectFill"
mode={isUpOperation ? 'aspectFill' : 'aspectFill'}
showMenuByLongpress={false}
/>
// <SpImage style={{ width: "100%", height: "100%" }} height="100%" src={item.src} isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
@ -464,7 +516,7 @@ function Home () {
<SpChat><SpImage height="62" src='index/kf.png' isShowMenuByLongpress={false} lazyLoad isNew /></SpChat>
</View>}
</View>
{isUpOperation && <ScrollView scrollX scrollWithAnimation showScrollbar={false} scrollLeft={0} className="shop-box fadeIn" >
{isUpOperation && <ScrollView scrollX scrollWithAnimation showScrollbar={true} 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
@ -476,29 +528,52 @@ function Home () {
</View>
))}
</ScrollView>}
{isUpOperation && showRecommend && <View className="brand">
{/* 推荐图片+商品 */}
{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' }}>
<View className="brand-title">品牌介绍</View>
<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>
<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>
</View>
<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 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>
<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 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>
</ScrollView>
<SpImage onClick={() => Taro.navigateTo({
url: '/pages/webview?url=' + encodeURIComponent('https://www.baidu.com')
})} className="brand-guanzhu" width={690} mode="widthFix" src="index/guanzhu.png" isShowMenuByLongpress={false} lazyLoad isNew></SpImage>
})} className="brand-guanzhu" 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,12 +81,11 @@ function CompGoodsBuyToolbar (props) {
return
}
btns.push(BUY_TOOL_BTNS.ADD_CART)
btns.push(BUY_TOOL_BTNS.FAST_BUY)
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' })
}
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;
color: #8d8d8d !important;
}
&.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 = React.memo(SpSkuSelectNew)
const MSpSkuSelect = SpSkuSelectNew
const initialState = {
id: null,
@ -102,7 +102,8 @@ const initialState = {
selSkuImg: '',
swiperList: [],
selColorIdx: 0,
introList: []
introList: [],
scrollTop: 0
}
function EspierDetail (props) {
@ -148,7 +149,8 @@ function EspierDetail (props) {
selSkuImg,
swiperList,
selColorIdx,
introList
introList,
scrollTop
} = state
useEffect(() => {
@ -256,15 +258,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
@ -289,7 +291,7 @@ function EspierDetail (props) {
}
})
}
console.log("🚀 ~ data.introList:", data.introList)
console.log("🚀 ~ data.introList:", data)
setState((draft) => {
draft.info = {
...data,
@ -330,7 +332,7 @@ function EspierDetail (props) {
const res = await api.member.itemHistory()
setState((draft) => {
draft.historyList = res.list.filter((item) => item.item_id !== data.itemId).map((item) => ({ ...item.itemData, pic: item.itemData.pics?.[0] || '' }))
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.historyTotal = res.total_count
})
@ -455,10 +457,9 @@ function EspierDetail (props) {
{/* <Canvas id="canvas2" type="2d" onReady={onCanvasReady} /> */}
{!info && <SpLoading />}
{info && (
<ScrollView scrollY scrollWithAnimation showScrollbar={false} scrollTop={0} className='goods-contents' onScroll={(e) => {
// console.log('e', e.detail)
<ScrollView scrollY scrollWithAnimation showScrollbar={false} scrollTop={scrollTop} className='goods-contents' onScroll={(e) => {
const { scrollTop } = e.detail
if (scrollTop >= 640) {
if (scrollTop >= 600) {
setState((draft) => {
draft.isShowScroll = true
})
@ -471,7 +472,7 @@ function EspierDetail (props) {
<View className='goods-pic-container'>
<Swiper
className='goods-swiper'
// current={curImgIdx}
current={curImgIdx}
onChange={onChangeSwiper}
style={{
height: windowWidth
@ -480,7 +481,7 @@ function EspierDetail (props) {
interval={3000}
circular
>
{(info.imgs || swiperList).map((img, idx) => (
{(swiperList || info.imgs).map((img, idx) => (
<SwiperItem key={`swiperitem__${idx}`}>
<SpImage
mode='aspectFill'
@ -518,7 +519,7 @@ function EspierDetail (props) {
</Swiper>
{info.imgs.length > 1 && (
<View className='swiper-pagegation'>{`${curImgIdx + 1}/${info.imgs.length}`}</View>
<View className='swiper-pagegation'>{`${curImgIdx + 1}/${(swiperList)?.length || 1}`}</View>
)}
{info.video && play && (
@ -585,26 +586,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'>
<View className='title'>{info?.itemName}</View>
{/* <View className='brief'>{info.brief}</View> */}
{info.pdp && <View className='brief'>{info.pdp}</View>}
<View className='title'>{info?.itemName2 || info?.itemName}</View>
</View>
{/* {(isWeixin || isAPP()) && (
// {(
@ -731,18 +732,18 @@ function EspierDetail (props) {
}}
onChange={(skuText, curItem, idx) => {
console.log("🚀 ~ curItem:", curItem, idx)
setState((draft) => {
curItem && 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]}
@ -754,7 +755,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) => (
@ -779,12 +780,17 @@ 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 = (i === index)
v.isOpen = false
return v
})
draft.introList[index].isOpen = !item.isOpen
})
if (!item.isOpen) {
setState((draft) => {
draft.scrollTop = 1010 + Math.random()
})
}
}}
title={item.title}
>
@ -792,19 +798,24 @@ 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 = (i === index)
v.isOpen = false
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>}
{historyList.length && <View className='bottom-box'>
{isArray(historyList) ? <View className='bottom-box'>
<View className="bottom-box-tit">浏览历史</View>
<ScrollView scrollX scrollWithAnimation showScrollbar={true} scrollLeft={0} className="shop-box">
{historyList.map((item, idx) => (
@ -819,7 +830,7 @@ function EspierDetail (props) {
</View>
))}
</ScrollView>
</View>}
</View> : <></>}
</View>
</ScrollView>
)}

View File

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

View File

@ -357,6 +357,7 @@ 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}></Image>
<Image className="goods-list__item__img" src={item.img} onClick={() => this.handleClickItem(item)}></Image>
<View className="goods-list__item__right">
<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__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__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 } from '@tarojs/components'
import { View, Text, ScrollView, Picker, Video } from '@tarojs/components'
import { SpAddress } from '@/components'
import { withPager, withBackToTop } from '@/hocs'
import { connect } from 'react-redux'
@ -13,10 +13,11 @@ import {
SpNote,
FilterBar,
SpTabbar,
SpPage
SpPage,
SpImage
} from '@/components'
import api from '@/api'
import { classNames, pickBy } from '@/utils'
import { classNames, pickBy, isWeixin } from '@/utils'
import S from '@/spx'
import './list.scss'
@ -24,7 +25,7 @@ import './list.scss'
@connect(({ colors }) => ({
colors: colors.current
}))
@withPager
// @withPager
@withBackToTop
export default class RecommendList extends Component {
$instance = getCurrentInstance()
@ -45,6 +46,10 @@ export default class RecommendList extends Component {
isShowSearch: false,
shareInfo: {},
isSpAddressOpened: false,
play: false,
page: {
isLoading: true
}
}
}
@ -68,14 +73,19 @@ export default class RecommendList extends Component {
}
})
}
Taro.showLoading({ title: '' })
this.resetPage()
this.setState({
list: []
})
// Taro.showLoading({ title: '' })
// this.resetPage()
// this.setState({
// list: []
// })
setTimeout(() => {
this.nextPage()
Taro.hideLoading()
// this.nextPage()
// Taro.hideLoading()
this.setState({
page: {
isLoading: false
}
})
}, 200)
// this.praiseNum()
@ -529,6 +539,30 @@ 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,
@ -543,36 +577,38 @@ export default class RecommendList extends Component {
areaList,
query,
isShowSearch,
isSpAddressOpened
isSpAddressOpened,
play
} = this.state
const { colors } = this.props
let address = info.province + info.city
return (
<SpPage renderFooter={<SpTabbar />} className='has-nav' title="鞋床故事">
<SpPage renderFooter={<SpTabbar />} className='has-nav' title="" isBlack>
<View className='page-recommend-list'>
<View className='recommend-list__toolbar'>
<View
className={`recommend-list__search ${query && query.title && isShowSearch ? 'on-search' : null
}`}
>
<SearchBar
showDailog={false}
keyword={query ? query.title : ''}
onFocus={this.handleSearchOn}
onChange={this.handleSearchChange}
onClear={this.handleSearchClear}
onCancel={this.handleSearchOff}
onConfirm={this.handleConfirm.bind(this)}
/>
</View>
<FilterBar className='recommend-list__tabs'>
<View className='filter-bar__item' onClick={this.handleClickFilter.bind(this)}>
<View className='iconfont icon-menu'></View>
<Text>{selectColumn.name || '栏目'}</Text>
{false && <>
<View className='recommend-list__toolbar'>
<View
className={`recommend-list__search ${query && query.title && isShowSearch ? 'on-search' : null
}`}
>
<SearchBar
showDailog={false}
keyword={query ? query.title : ''}
onFocus={this.handleSearchOn}
onChange={this.handleSearchChange}
onClear={this.handleSearchClear}
onCancel={this.handleSearchOff}
onConfirm={this.handleConfirm.bind(this)}
/>
</View>
<View className='filter-bar__item region-picker'>
{/* <Picker
<FilterBar className='recommend-list__tabs'>
<View className='filter-bar__item' onClick={this.handleClickFilter.bind(this)}>
<View className='iconfont icon-menu'></View>
<Text>{selectColumn.name || '栏目'}</Text>
</View>
<View className='filter-bar__item region-picker'>
{/* <Picker
mode='multiSelector'
onClick={this.handleClickPicker}
onChange={this.bindMultiPickerChange}
@ -585,104 +621,160 @@ export default class RecommendList extends Component {
<Text>{address || '地区'}</Text>
</View>
</Picker> */}
<View onClick={this.handleClickOpenSpAddress.bind(this)}>
<View className='iconfont icon-periscope'></View>
<Text>{address || '地区'}</Text>
</View>
<SpAddress isOpened={isSpAddressOpened} onClose={this.handleClickCloseSpAddress} onChange={this.onPickerChange} />
<View onClick={this.handleClickOpenSpAddress.bind(this)}>
<View className='iconfont icon-periscope'></View>
<Text>{address || '地区'}</Text>
</View>
<SpAddress isOpened={isSpAddressOpened} onClose={this.handleClickCloseSpAddress} onChange={this.onPickerChange} />
{address ? (
<View
className='zoom-btn icon-close iconfont'
onClick={this.handleRegionRefresh.bind(this)}
></View>
// <Text className='icon-close' onClick={this.handleRegionRefresh.bind(this)}>x</Text>
) : (
''
)}
</View>
</FilterBar>
</View>
<AtDrawer
show={showDrawer}
right
mask
width={`${Taro.pxTransform(570)}`}
onClose={this.handleClose}
>
<View className='drawer-item'>
<View className='drawer-item__options'>
{columnList.map((item, index) => {
return (
{address ? (
<View
className={classNames(
'drawer-item__options__item',
item.isChooseColumn ? 'drawer-item__options__checked' : ''
)}
// className='drawer-item__options__item'
style={
item.isChooseColumn
? {
background: (colors && colors.data && colors.data[0].primary) || null
}
: {}
}
key={`${index}1`}
onClick={this.handleClickParmas.bind(this, item.id)}
>
{item.name}
className='zoom-btn icon-close iconfont'
onClick={this.handleRegionRefresh.bind(this)}
></View>
// <Text className='icon-close' onClick={this.handleRegionRefresh.bind(this)}>x</Text>
) : (
''
)}
</View>
</FilterBar>
</View>
<AtDrawer
show={showDrawer}
right
mask
width={`${Taro.pxTransform(570)}`}
onClose={this.handleClose}
>
<View className='drawer-item'>
<View className='drawer-item__options'>
{columnList.map((item, index) => {
return (
<View
className={classNames(
'drawer-item__options__item',
item.isChooseColumn ? 'drawer-item__options__checked' : ''
)}
// className='drawer-item__options__item'
style={
item.isChooseColumn
? {
background: (colors && colors.data && colors.data[0].primary) || null
}
: {}
}
key={`${index}1`}
onClick={this.handleClickParmas.bind(this, item.id)}
>
{item.name}
</View>
)
})}
<View className='drawer-item__options__none'> </View>
<View className='drawer-item__options__none'> </View>
<View className='drawer-item__options__none'> </View>
</View>
</View>
<View className='drawer-footer'>
<Text
className='drawer-footer__btn'
onClick={this.handleClickSearchParams.bind(this, 'reset')}
>
重置
</Text>
<Text
className='drawer-footer__btn drawer-footer__btn_active'
style={{ background: (colors && colors.data && colors.data[0].primary) || null }}
onClick={this.handleClickSearchParams.bind(this, 'submit')}
>
确定
</Text>
</View>
</AtDrawer>
<ScrollView
className='recommend-list__scroll'
scrollY
scrollTop={scrollTop}
scrollWithAnimation
onScroll={this.handleScroll}
onScrollToLower={this.nextPage}
>
<View className='recommend-list recommend-list__type-grid'>
{list.map((item) => {
return (
<View className='recommend-list__item'>
<RecommendItem
key={item.item_id}
info={item}
onClick={() => this.handleClickItem(item)}
/>
</View>
)
})}
<View className='drawer-item__options__none'> </View>
<View className='drawer-item__options__none'> </View>
<View className='drawer-item__options__none'> </View>
</View>
{page.isLoading ? <Loading>正在加载...</Loading> : null}
{!page.isLoading && !page.hasNext && !list.length && (
<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>
<View className='drawer-footer'>
<Text
className='drawer-footer__btn'
onClick={this.handleClickSearchParams.bind(this, 'reset')}
>
重置
</Text>
<Text
className='drawer-footer__btn drawer-footer__btn_active'
style={{ background: (colors && colors.data && colors.data[0].primary) || null }}
onClick={this.handleClickSearchParams.bind(this, 'submit')}
>
确定
</Text>
</View>
</AtDrawer>
<ScrollView
className='recommend-list__scroll'
scrollY
scrollTop={scrollTop}
scrollWithAnimation
onScroll={this.handleScroll}
onScrollToLower={this.nextPage}
>
<View className='recommend-list recommend-list__type-grid'>
{list.map((item) => {
return (
<View className='recommend-list__item'>
<RecommendItem
key={item.item_id}
info={item}
onClick={() => this.handleClickItem(item)}
/>
</View>
)
})}
</View>
{page.isLoading ? <Loading>正在加载...</Loading> : null}
{!page.isLoading && !page.hasNext && !list.length && (
<SpNote img='trades_empty.png'>暂无数据~</SpNote>
)}
</ScrollView>
}
<BackToTop show={showBackToTop} onClick={this.scrollBackToTop} />
</View>

View File

@ -3,6 +3,41 @@
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,8 +191,10 @@
}
&--normal {
/* prettier-ignore */
border: 1PX solid #E5E5E5;
color: #444;
// border: 1PX solid #E5E5E5;
// color: #444;
border: 1px solid #000;
color: #000;
}
&--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,18 +9,28 @@
}
&__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: 0;
bottom: 0;
left: 30px;
right: 30px;
bottom: 50px;
width: 690px;
}
.toolbar_btn {
border-radius: 10px;
width: 100%;
box-sizing: border-box;
display: inline-block;

View File

@ -4,6 +4,7 @@ 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'
@ -42,6 +43,7 @@ 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)) {
@ -72,6 +74,16 @@ 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,
@ -81,7 +93,8 @@ export default class TradeItem extends Component {
showActions,
colors,
rateStatus,
isShowDistributorInfo
isShowDistributorInfo,
onTimeUp = () => { }
} = this.props
if (!info) {
@ -97,7 +110,21 @@ export default class TradeItem extends Component {
</View>
)}
<View className='trade-item__msg'>
<View className='item lineone'>订单编号{info.tid}</View>
<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}>
@ -119,7 +146,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 &&
@ -134,7 +161,7 @@ export default class TradeItem extends Component {
) : null}
<Button
className='btn-action'
style={`background: ${colors.data[0].primary}`}
style={`background: ${colors.data[0].primary};width:120rpx`}
onClick={this.handleClickBtn.bind(this, 'pay')}
>
去支付
@ -146,17 +173,19 @@ 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>
{(info.order_status_des === 'PAYED' || info.order_status_des === 'NOTPAY') &&
{/* <Text className='trade-item__status'>{info.status_desc}</Text> */}
{false && (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.handleClickBtn.bind(this, 'cancel')}
onClick={this.clickToEditAddress.bind(this)}
>
取消订单
{/* 取消订单 */}
修改地址
</Button>
) : null}
{info.pay_status === 'PAYED' &&
@ -184,7 +213,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}`}
@ -220,7 +249,16 @@ export default class TradeItem extends Component {
)}
</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.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>
)} */}
{info.receipt_type !== 'dada' && (
<Button
className='btn-action'
@ -230,22 +268,21 @@ export default class TradeItem extends Component {
查看物流
</Button>
)}
{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, 'confirm')}
>
确认收货
</Button>
)}
<Button
{!info.aftersales_bn ? <Button
className='btn-action'
style={`background: ${colors.data[0].primary}`}
onClick={this.handleClickBtn.bind(this, 'detail')}
// onClick={this.handleClickBtn.bind(this, 'detail')}
onClick={this.handleClickBtn.bind(this, 'confirm')}
>
订单详情
</Button>
确认收货
</Button> :
<Button
className='btn-action'
style={`background: ${colors.data[0].primary}`}
onClick={this.handleClickBtn.bind(this, 'aftersales')}
>
售后进度
</Button>}
</View>
</View>
)}
@ -266,8 +303,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}`}
@ -275,22 +312,41 @@ export default class TradeItem extends Component {
>
评价
</Button>
) : 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, 'delivery')}
>
查看物流
</Button>
)}
) : null} */}
{
!info.aftersales_bn && (
<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')}
>
{/* 查看物流 */}
{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, 'detail')}
onClick={this.handleClickBtn.bind(this, 'aftersales')}
>
订单详情
售后进度
</Button>
</View>
</View>

View File

@ -54,6 +54,20 @@
.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 } from 'taro-ui'
import { Loading, SpNavBar, FloatMenuMeiQia, SpNewShopItem, SpPage, SpPrice } from '@/components'
import { AtCountdown, AtCurtain } from 'taro-ui'
import { Loading, SpNavBar, FloatMenuMeiQia, SpNewShopItem, SpPage, SpPrice, SpImage } from '@/components'
import {
log,
pickBy,
@ -84,7 +84,9 @@ export default class TradeDetail extends Component {
cancelData: {},
tradeInfo: {},
showQRcode: false,
distributor: {}
distributor: {},
showDeliveryModal: false,
deliveryList: []
}
}
@ -167,16 +169,20 @@ 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: 'delivery_code',
delivery_name: 'delivery_corp_name',
delivery_code: ({ order_delivery = {} }) => {
const { delivery_code, delivery_corp, delivery_corp_name, delivery_id } = order_delivery.list?.[0] || {}
return delivery_code
},
delivery_name: ({ order_delivery = {} }) => {
const { delivery_code, delivery_corp, delivery_corp_name, delivery_id } = order_delivery.list?.[0] || {}
return delivery_corp_name
},
delivery_type: 'delivery_type',
delivery_status: 'delivery_status',
pay_status: 'pay_status',
@ -220,8 +226,13 @@ 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'
ziti_info: 'ziti_info',
timer: ({ auto_cancel_seconds }) => auto_cancel_seconds > 0 ? this.calcTimer(auto_cancel_seconds) : null
})
const delivery = data.order_delivery?.list?.[0] || {}
info.delivery_corp_name = delivery.delivery_corp_name
info.delivery_corp = delivery.delivery_corp
info.delivery_code = delivery.delivery_code
const ziti = pickBy(data.distributor, {
store_name: 'store_name',
@ -480,10 +491,30 @@ export default class TradeDetail extends Component {
}
}
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}`
})
handleClickDelivery = async (flag) => {
if (flag) {
Taro.showLoading({ title: '' })
let { delivery_type, delivery_id, order_type, tid: order_id } = this.state.info
console.log("🚀 ~ TradeDetail ~ delivery_type, delivery_id, order_type, tid: order_id:", delivery_type, delivery_id, order_type, order_id)
let list = []
if (delivery_type !== 'new') {
list = await api.trade.deliveryInfoNew({ delivery_id })
} else {
list = await api.trade.deliveryInfo(order_type, order_id)
}
const nList = pickBy(list, {
title: 'AcceptStation',
content: ({ AcceptTime }) => AcceptTime ? AcceptTime.substring(5, 16) : ''
})
this.setState({
deliveryList: nList
})
}
this.setState({ showDeliveryModal: flag })
Taro.hideLoading()
// Taro.navigateTo({
// url: `/subpage/pages/trade/delivery-info?order_type=${this.state.info.order_type}&order_id=${this.state.info.tid}&delivery_code=${this.state.info.delivery_code}&delivery_corp=${this.state.info.delivery_corp}&delivery_name=${this.state.info.delivery_name}`
// })
}
handleClickCopy = (val) => {
@ -668,15 +699,15 @@ export default class TradeDetail extends Component {
tradeInfo,
showQRcode,
pickup_code,
distributor
distributor,
showDeliveryModal,
deliveryList
} = this.state
if (!info) {
return <Loading></Loading>
return <View style={{ marginTop: '100px' }}><Loading ></Loading></View>
}
console.log('==tradeInfo==>', tradeInfo)
//订单未支付
const NOT_PAY = tradeInfo && tradeInfo.tradeState === 'NOTPAY'
@ -913,14 +944,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'>查看详情</Text>
<Text className='right' onClick={() => this.handleClickDelivery(true)}>查看详情</Text>
</View>
<View className='address-detail' style={{ marginTop: '4rpx' }}>物流单号{info.receiver_name}</View>
<View className='address-detail'>物流公司{info.receiver_name}</View>
</>
<View className='address-detail' style={{ marginTop: '4rpx' }}>物流单号{info.delivery_code}</View>
<View className='address-detail'>物流公司{info.delivery_corp_name}</View>
</>}
<View className="address-txt info-trade">
<Text>支付方式</Text>
</View>
@ -934,19 +965,21 @@ export default class TradeDetail extends Component {
<View className='line'>
<View className='left'>订单金额</View>
<View className='right'>
{transformTextByPoint(this.isPointitemGood(), info.item_fee_new, info.item_point)}
<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), '-------')}
</View>
</View>
<View className='line'>
<View className='left'>优惠金额</View>
{/* 促销 + 优惠券 */}
<View className='right'>{`¥${parseFloat(info.promotion_discount + info.coupon_discount).toFixed(2)}`}</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>
<View className='line'>
<View className='left'>运费</View>
<View className='right'>
{info.freight_type !== 'point'
? `¥${info.freight_fee}`
? <SpPrice size={20} value={info.freight_fee} showSeparator noDecimal={false} />
: `${info.freight_fee * 100}${this.props.pointName}`}
</View>
</View>
@ -987,8 +1020,8 @@ export default class TradeDetail extends Component {
</View>
)}
<View className='trade-money'>
{/* <View>
{/* <View className='trade-money'> */}
{/* <View>
总计
{this.isPointitemGood() ? (
<Text className='trade-money__point'>
@ -1002,7 +1035,7 @@ export default class TradeDetail extends Component {
<Text className='trade-money__num'>{info.totalpayment}</Text>
)}
</View> */}
{/* {!info.is_logistics &&
{/* {!info.is_logistics &&
info.can_apply_cancel != 0 &&
(info.status === 'WAIT_BUYER_PAY' ||
(info.status === 'WAIT_SELLER_SEND_GOODS' &&
@ -1015,7 +1048,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>
@ -1139,7 +1172,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)}>
<Text className='info-text-btn' onClick={this.handleClickDelivery.bind(this, true)}>
查看物流
</Text>
<Text
@ -1166,7 +1199,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}`}
style={`background: ${colors.data[0].primary}; border-color: ${colors.data[0].primary}; color: #fff;`}
loading={payLoading}
onClick={this.handleClickBtn.bind(this, 'pay')}
>
@ -1188,6 +1221,7 @@ 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 &&
@ -1200,8 +1234,8 @@ export default class TradeDetail extends Component {
)
}
{
// 继续购物
(info.status === 'WAIT_SELLER_SEND_GOODS' ||
// 继续购物 先禁止掉!!!
false && (info.status === 'WAIT_SELLER_SEND_GOODS' ||
(info.status === 'WAIT_BUYER_CONFIRM_GOODS' &&
info.receipt_type === 'dada' &&
info.receipt_type !== 'dada') ||
@ -1231,14 +1265,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}`}
style={`background: ${colors.data[0].primary}; border-color: ${colors.data[0].primary};color:#fff`}
onClick={this.handleClickBtn.bind(this, 'confirm')}
>
确认收货
</View>
)
}
{
{/* {
// 联系客服
(info.status === 'TRADE_SUCCESS' ||
(info.receipt_type === 'dada' && info.dada.dada_status === 9)) &&
@ -1265,7 +1299,7 @@ export default class TradeDetail extends Component {
)}
</View>
)
}
} */}
</View>
)}
@ -1281,6 +1315,35 @@ 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(var(--nav-height), 140px);
@include page-scroll(calc(var(--nav-height) + 16px), 140px);
}
&.has-navbar {
@ -249,7 +249,7 @@ $paddingBottom: 100px;
}
}
.trade-detail-goods {
margin: 14px 22px 0;
margin: 0px 22px;
// padding-top: 16px;
padding: 40px 30px 40px 20px;
min-height: 100px;
@ -456,7 +456,8 @@ $paddingBottom: 100px;
left: 0;
width: 100%;
height: 100px;
bottom: $edge-margin;
// bottom: $edge-margin;
bottom: 0;
background: #fff;
display: flex;
justify-content: space-evenly;
@ -515,6 +516,7 @@ $paddingBottom: 100px;
position: initial;
transform: inherit;
margin: 0 20px;
margin-bottom: 80px;
width: calc(100% - 40px);
}
}
@ -696,4 +698,73 @@ $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,26 +5,59 @@ 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 { log, pickBy, resolveOrderStatus, authSetting } from '@/utils'
import doc from '@/doc'
import './invoice-info.scss'
import { useImmer } from 'use-immer'
import { useEffect } from 'react'
const initState = {
formList: [
{
name: '抬头类型',
type: 'checkbox',
key: 'invoice_title',
key: 'title',
required: true,
},
{
name: '发票抬头',
type: 'input',
key: 'invoice_title',
key: 'content',
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',
@ -32,42 +65,52 @@ 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
showDetail: false,
invoiceId: '',
invoice: {},
orderInfo: {},
loading: false,
title: '',
totalFee: '',
toastShow: false,
invoiceInfo: {}
}
function InvoiceInfo (props) {
const $instance = getCurrentInstance()
const [state, setState] = useImmer(initState)
const { formList, form, showModal, visible, showDetail } = state
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 onChangeItemCheck = () => {
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 = (val) => {
setState((draft) => {
draft.form = { ...form, title: val }
})
}
const hadnleInput = (val, item) => {
@ -83,41 +126,171 @@ function InvoiceInfo (props) {
})
}
return <SpPage className='page-invoice-info has-navbar' navigationBarTitleText='开票信息'>
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='开票信息'>
<View className="info-bd">
{showDetail && <View className="info-bd-tips">{0}张发票{1}个订单</View>}
{showDetail && <View className="info-bd-tips">{1}张发票{1}个订单</View>}
<View className="info-item">
<View className="tit">发票类型</View>
<View className="content">
<Text>电子发票</Text>
{showDetail ? <View className='flex'>
<Text className='ck'>查看</Text>
<AtIcon value='chevron-right' size='18' color='#000'></AtIcon>
</View> : <Text className='sq'></Text>}
<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>}
</View>
</View>
{showDetail && <View className="info-item">
<View className="tit">发票状态</View>
<View className="content">
<Text>已申请</Text>
<Text>{orderInfo.is_invoiced == 1 ? '已开票' : '已申请'}</Text>
</View>
</View>}
<View className="info-item">
<View className="tit">发票金额</View>
<View className="content">
<Text>¥9999</Text>
<Text>¥{totalFee ? parseFloat(totalFee).toFixed(2) : (orderInfo.total_fee ? (orderInfo.total_fee / 100).toFixed(2) : 0)}</Text>
</View>
</View>
{formList.map((item) => <View className="info-item">
<View className="tit">{item.name}</View>
{showDetail ? <View className="content">{form[item.key] || '测试'}</View> : <>{item.type === 'checkbox' && <View className="content">
{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">
<View className="content-item">
<SpCheckboxNew checked={form.gr === '1'} onChange={() => onChangeItemCheck()} >
<SpCheckboxNew checked={form.title === 'individual'} onChange={() => onChangeItemCheck('individual')} >
<Text className="">个人/非企业单位</Text>
</SpCheckboxNew>
</View>
<View className="content-item">
<SpCheckboxNew checked={form.gr === '2'} onChange={onChangeItemCheck()} >
<SpCheckboxNew checked={form.title === 'unit'} onChange={() => onChangeItemCheck('unit')} >
<Text className="">企业</Text>
</SpCheckboxNew>
</View>
@ -137,11 +310,20 @@ function InvoiceInfo (props) {
</View>
</View>}
</View>
<View className={classNames("bottom")}>
<View onClick={() => setState((draft) => {
draft.visible = true
})} className={classNames("btn", { "btn-disabled": true })}>提交申请</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) => {
draft.visible = true
})
}} className={classNames("btn")}>重发发票</View>
</View>}
<View className="sp-picker">
<View
@ -168,29 +350,31 @@ function InvoiceInfo (props) {
</View>
<View className='sp-picker-bd-item'>
<View className="tit">抬头类型</View>
<View className="content">电子发票</View>
<View className="content">{form.title === 'unit' ? '企业' : '个人'}</View>
</View>
<View className='sp-picker-bd-item'>
<View className="tit">发票抬头</View>
<View className="content">电子发票</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>
</>}
<View className='sp-picker-bd-item'>
<View className="tit">邮箱地址</View>
<View className="content">电子发票</View>
<View className="content">{form.email}</View>
</View>
<View onClick={() => setState((draft) => {
draft.visible = false
draft.showModal = true
})} className={classNames("btn", { "notop": showDetail })}>提交申请</View>
<View onClick={handleSubmit} className={classNames("btn", { "notop": showDetail })}>提交申请</View>
</View>
</View>
</View>
<View className={classNames('toast', {
visible: false
visible: toastShow
})}>
<View>已超重开发票时限</View>
<View>不可操作重开发票</View>
{/* <View></View>
<View>不可操作重开发票</View> */}
<View>提交申请成功请耐心等待</View>
</View>
<AtModal

View File

@ -58,6 +58,10 @@
color: #163586;
margin-right: 2px;
}
.icon-qianwang-01 {
font-size: 20px;
color: #000;
}
}
}
.ipt {
@ -66,7 +70,7 @@
font-size: 26px;
line-height: 1;
color: #000;
padding-right: 40px;
// padding-right: 40px;
box-sizing: border-box;
&-placeholder {
color: #808080;
@ -190,6 +194,9 @@
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 && <View className="bottom">
{!page.isLoading && list?.length > 0 && <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">下一步</View>
<View className="bottom-btn" onClick={() => Taro.navigateTo({ url: '/subpage/pages/trade/invoice-info' })}>下一步</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 } from '@/utils'
import { log, pickBy, resolveOrderStatus, authSetting, formatDateTime } from '@/utils'
import { AtIcon } from 'taro-ui'
import './invoice-record.scss'
@ -45,27 +45,32 @@ 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',
order: ({ items }) =>
pickBy(items, {
order_id: 'order_id',
item_id: 'item_id',
pic_path: 'pic',
title: 'item_name',
price: ({ item_fee }) => (+item_fee / 100).toFixed(2),
point: 'item_point',
num: 'num'
})
invoice: ({ invoice }) => invoice ? JSON.parse(invoice) : {},
id: 'id',
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
} : {}
}
})
log.debug('[trade list] list fetched and processed: ', nList)
this.setState({
list: [...this.state.list, ...nList, {}, {}, {}, {}, {}, {}, {}, {}]
list: [...this.state.list, ...nList]
})
return { total }
@ -130,6 +135,14 @@ 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
@ -139,18 +152,23 @@ export default class InvoiceList extends Component {
<ScrollView scrollY className='trade-list__scroll' onScrollToLower={this.nextPage}>
{list.map((item, idx) => {
return (
<View className='invoice-item' key={`invoice_item_${idx}`}>
<View className="right">
<View className="right-item">{idx + 1}发票金额
<SpPrice size={28} className='total-pirce' value={item.payment / 100} showSeparator noDecimal />
<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="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>
<View className="right-item">发票类型电子发票</View>
<View className="right-item">抬头类型{item.order?.invoice?.title === 'unit' ? '企业' : '个人'}</View>
<View className="right-item">申请时间{item.order?.time || ''}</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>
<View className="right-item">发票类型电子发票</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">已申请</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), 140px);
@include page-scroll(var(--nav-height), 10px);
padding-top: 20px;
padding-bottom: 210px;
padding-bottom: 50px;
}
}
.invoice-item {
@ -15,18 +15,23 @@
box-sizing: border-box;
background: #f7f7f7;
border-radius: 6px;
display: flex;
align-items: center;
justify-content: space-between;
&-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;
}
@ -36,7 +41,7 @@
display: flex;
align-items: center;
.txt {
margin-right: 20px;
margin-right: 14px;
}
}
}

View File

@ -1,10 +1,10 @@
import React, { Component } from 'react'
import Taro, { getCurrentInstance } from '@tarojs/taro'
import { View, ScrollView } from '@tarojs/components'
import { View, ScrollView, Text } from '@tarojs/components'
import { connect } from 'react-redux'
import { AtTabs, AtTabsPane } from 'taro-ui'
import { AtTabs, AtTabsPane, AtCurtain } from 'taro-ui'
import _mapKeys from 'lodash/mapKeys'
import { Loading, SpNote, SpNavBar, SpPage } from '@/components'
import { Loading, SpNote, SpNavBar, SpPage, SpImage } from '@/components'
import api from '@/api'
import { withPager } from '@/hocs'
import {
@ -15,7 +15,8 @@ import {
classNames,
isNavbar,
getBrowserEnv,
VERSION_PLATFORM
VERSION_PLATFORM,
formatDateTime
} from '@/utils'
import { Tracker } from '@/service'
import TradeItem from './comps/new-item'
@ -44,7 +45,11 @@ export default class TradeList extends Component {
evaluate: 1,
list: [],
rate_status: false,
curItemActionsId: null
curItemActionsId: null,
showDeliveryModal: false,
deliveryList: [],
deliveryName: '',
deliveryCode: ''
}
}
@ -52,7 +57,8 @@ 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)
@ -80,7 +86,10 @@ export default class TradeList extends Component {
onPullDownRefresh = () => {
Tracker.dispatch('PAGE_PULL_DOWN_REFRESH')
this.refresh()
}
refresh = () => {
Taro.showLoading({
title: '加载中',
icon: 'none'
@ -98,6 +107,24 @@ 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
@ -116,18 +143,39 @@ export default class TradeList extends Component {
}
)
const {
list,
pager: { count: total },
rate_status
} = await api.trade.list(params)
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
} = 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),
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),
total_fee: 'total_fee',
pay_type: 'pay_type',
point: 'point',
@ -137,7 +185,9 @@ export default class TradeList extends Component {
type: 'type',
is_rate: 'is_rate',
dada: 'dada',
create_date: 'create_date',
create_date: ({ create_date, create_time }) => {
return create_date || formatDateTime(create_time * 1000)
},
is_all_delivery: 'is_all_delivery',
is_logistics: 'is_split',
receipt_type: 'receipt_type',
@ -152,8 +202,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 }) =>
pickBy(items, {
order: ({ items, detail }) =>
pickBy(items || detail, {
order_id: 'order_id',
item_id: 'item_id',
pic_path: 'pic',
@ -162,12 +212,14 @@ 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: ({ item_fee_new }) => (item_fee_new / 100).toFixed(2),
price: ({ total_fee }) => (+total_fee / 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)
@ -204,9 +256,11 @@ export default class TradeList extends Component {
}
handleClickItem = (trade) => {
const { tid } = trade
const { tid, aftersales_bn } = 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`
@ -219,7 +273,7 @@ export default class TradeList extends Component {
handleClickItemBtn = async (trade, type) => {
console.log(trade)
const { tid } = trade
const { tid, aftersales_bn } = trade
let detailUrl = `/subpage/pages/trade/detail?id=${tid}`
@ -247,6 +301,11 @@ 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 {
@ -259,16 +318,17 @@ export default class TradeList extends Component {
tid,
order_type
} = 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}`
})
}
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}`
// })
// }
}
break
default:
@ -278,13 +338,38 @@ 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
})
@ -305,7 +390,12 @@ export default class TradeList extends Component {
list = [],
page,
rateStatus,
evaluate
evaluate,
showDeliveryModal,
deliveryList,
info = {},
deliveryName,
deliveryCode
} = this.state
return (
@ -347,6 +437,7 @@ 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}
/>
)
})}
@ -358,6 +449,34 @@ 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,6 +148,75 @@
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 } from '@/components'
import { Loading, SpToast, SpNavBar, FloatMenuMeiQia, SpImg, SpPage } from '@/components'
import { pickBy, formatTime, resolveOrderStatus } from '@/utils'
import api from '@/api'
@ -27,7 +27,7 @@ import './split-bagpack.scss'
// }
export default class TradeDetail extends Component {
$instance = getCurrentInstance()
constructor (props) {
constructor(props) {
super(props)
this.state = {
@ -68,8 +68,8 @@ export default class TradeDetail extends Component {
}
return (
<View className='wuliu-detail'>
<SpNavBar title='订单详情' leftIconType='chevron-left' fixed='true' />
<SpPage className='wuliu-detail has-nav' title='订单详情'>
{/* <SpNavBar title='订单详情' leftIconType='chevron-left' fixed='true' /> */}
<View className='wuliu-detail'>
<View className='title-status'>您有{delivery_num}个包裹已发出</View>
@ -97,7 +97,7 @@ export default class TradeDetail extends Component {
)}
<View className='good-list'>
{/* <OrderItem
info={info.orders[0]}
/> */}
<ScrollView scrollX>
@ -112,7 +112,7 @@ export default class TradeDetail extends Component {
{/* <DetailItem info={info} /> */}
</View>
<SpToast></SpToast>
</View>
</SpPage>
)
}
}

View File

@ -1,4 +1,4 @@
import React, { useEffect } from 'react'
import React, { useEffect, useRef } 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 } from '@/utils'
import { pickBy, showToast, isWeixin, entryLaunch, styleNames, thousandthFormat } from '@/utils'
import { SpPage, SpScrollView, SpCoupon, SpImage } from '@/components'
import './coupon-center.scss'
@ -18,14 +18,15 @@ 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 = point
draft.point = thousandthFormat(point)
})
}
@ -54,6 +55,23 @@ 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) {
@ -80,12 +98,12 @@ function CouponCenter (props) {
getCoupon(item, index)
}
} else {
showToast('优惠券领取机会已用完')
showToast('优惠券领取完')
}
}
const getCoupon = async ({ cardId }, index) => {
const { status } = await api.member.homeCouponGet({
const { status } = await api.member.getCardDetail({
card_id: cardId
})
if (status) {
@ -99,6 +117,7 @@ function CouponCenter (props) {
})
}
showToast('优惠券领取成功')
getMypoint()
} else {
showToast('优惠券领取失败')
}
@ -131,19 +150,28 @@ 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'>我的积分</Text>
<Text className='title' onClick={getPoint}>我的积分</Text>
<Text className='point'>{(point || 0).toString()}</Text>
</View>
<View className="coupon" onClick={() => Taro.navigateTo({ url: '/subpages/marketing/coupon' })}>我的优惠券</View>
</View>
</View>
<SpScrollView className='list-scroll' fetch={fetch} renderEmpty={<View className='empty'>
<SpScrollView ref={listRef} 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) => {
@ -166,21 +194,22 @@ 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.type === "quan" ? "quan-hui" : "quan-lan"}.png) no-repeat`,
background: `url(${process.env.APP_IMAGE_CDN_NEW}/member/${item.couponStatus != 1 ? "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 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>
<View className="coupons-list-item-right">
<View className="coupons-list-item-right-box">
<View className="coupons-list-item-integral">{item.integral || 500}积分兑换</View>
<View className="coupons-list-item-integral">{item.title}</View>
{/* {item.start_time}至{item.end_time} */}
<View className="coupons-list-item-desc">有效日期领取7天内有效</View>
<View className="coupons-list-item-desc">有效日期领取{item.fixedTerm}天内有效</View>
</View>
<View className="coupons-list-item-btn" onClick={() => handleRedeem(item)}>立即兑换</View>
<View className="coupons-list-item-btn" onClick={handleClickCouponItem.bind(this, item, index)}>立即兑换</View>
</View>
</View>)
})}

View File

@ -46,7 +46,8 @@
}
}
.list-scroll {
padding: 20px;
// padding: 20px;
padding: 0 50px;
.coupon-item-wrap {
&:not(:last-child) {
margin-bottom: 20px;
@ -57,8 +58,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

@ -15,10 +15,10 @@ const initialState = {
couponListInVaild: [],
select: null
}
function CouponPicker(props) {
function CouponPicker (props) {
const $instance = getCurrentInstance()
const [state, setState] = useImmer(initialState)
let { couponListVaild,couponListInVaild, select } = state
let { couponListVaild, couponListInVaild, select } = state
const dispatch = useDispatch()
const fetch = async ({ pageIndex, pageSize }) => {
@ -47,12 +47,12 @@ function CouponPicker(props) {
const { list, total_count: total } = await api.cart.coupons(params)
const couponListNewVaul = pickBy(list, doc.coupon.COUPON_ITEM)
couponListVaild = couponListNewVaul.filter(item=>item.valid)
couponListInVaild = couponListNewVaul.filter(item=>!item.valid)
couponListVaild = couponListNewVaul.filter(item => item.valid)
couponListInVaild = couponListNewVaul.filter(item => !item.valid)
setState((draft) => {
draft.couponListVaild = couponListVaild,
draft.couponListInVaild = couponListInVaild,
draft.select = coupon
draft.couponListInVaild = couponListInVaild,
draft.select = coupon
})
return {
total
@ -62,7 +62,7 @@ function CouponPicker(props) {
const onChangeSelectCoupon = (item, e) => {
let payload = null
// 不使用优惠券
if(item) {
if (item) {
const { cardId, code, title } = item
payload = {
coupon_id: cardId,
@ -97,21 +97,22 @@ 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} />
<SpCheckboxNew onChange={onChangeSelectCoupon.bind(this, item)} disabled={!item.valid} checked={select == item.code}/>
<SpCoupon info={item} onClick={onChangeSelectCoupon.bind(this, item)} />
{/* <SpCheckboxNew onChange={onChangeSelectCoupon.bind(this, item)} disabled={!item.valid} checked={select == item.code}/> */}
</View>
))}
{ couponListInVaild.length>0 ? <View className='invalid-title'>不可用优惠券</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} />
<SpCheckboxNew onChange={onChangeSelectCoupon.bind(this, item)} disabled={!item.valid} checked={select == item.code}/>
<SpCoupon info={item} onClick={onChangeSelectCoupon.bind(this, item)} />
{/* <SpCheckboxNew onChange={onChangeSelectCoupon.bind(this, item)} disabled={!item.valid} checked={select == item.code}/> */}
</View>
))}
</SpScrollView>

View File

@ -120,38 +120,21 @@ 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>
(<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>)
<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>
))}
</SpScrollView>
</SpPage>

View File

@ -1,18 +1,18 @@
.page-marketing-coupon {
.list-scroll {
padding: 20px 50px;
.coupon-item-wrap {
&:not(:last-child) {
margin-bottom: 20px;
}
}
padding: 0px 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: false,
autoLogin: true,
// policyUpdateHook: (isUpdate) => {
// // isUpdate && setPolicyModal(true)
// if (isUpdate) {
@ -304,6 +304,15 @@ 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, // 待处理售后
@ -443,7 +452,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>
@ -603,9 +612,9 @@ function MemberIndex (props) {
>
<View className='order-item-view'>
<SpImage src='member/daishouhuo.png' className='icon-style' isNew />
{state.waitEvaluateNum > 0 && (
{state.waitRecevieNum > 0 && (
<View className='order-bradge'>
<Text>{state.waitEvaluateNum}</Text>
<Text>{state.waitRecevieNum}</Text>
</View>
)}
<Text className='order-txt'>待收货</Text>
@ -617,15 +626,16 @@ function MemberIndex (props) {
>
<View className='order-item-view'>
<SpImage src='member/yiwancheng.png' className='icon-style' isNew />
{state.afterSalesNum > 0 && (
{state.waitEvaluateNum > 0 && (
<View className='order-bradge'>
<Text>{state.afterSalesNum}</Text>
<Text>{state.waitEvaluateNum}</Text>
</View>
)}
<Text className='order-txt'>已完成</Text>
</View>
</SpLogin>
<SpLogin
{/* 先隐藏评价功能 02-24 */}
{false && <SpLogin
className='order-item'
// /subpage/pages/trade/after-sale
onChange={handleClickLink.bind(this, '/subpage/pages/trade/list?status=7')}
@ -639,7 +649,7 @@ function MemberIndex (props) {
)}
<Text className='order-txt'>评价</Text>
</View>
</SpLogin>
</SpLogin>}
</View>
</CompPanel>
@ -699,51 +709,13 @@ 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-list')}>
<View className="member_con_item" onClick={isLogin && handleClickLink.bind(this, '/subpage/pages/trade/invoice-record')}>
<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,6 +155,7 @@
padding: 30px 16px 50px;
.comp-panel {
&-bd {
padding: 24px 50px;
margin-top: 20px;
}
.extra {

View File

@ -27,6 +27,7 @@ const initialState = {
listLength: 0,
nList: [],
listLength: 0,
loading: true
}
function MemberUserInfo () {
@ -44,6 +45,7 @@ function MemberUserInfo () {
areaList,
multiIndex,
nList,
loading
} = state
const { userInfo = {} } = useSelector((_state) => _state.user)
const pageRef = useRef()
@ -180,6 +182,7 @@ function MemberUserInfo () {
draft.formUserInfo = _formUserInfo
draft.areaList = [arrProvice, arrCity, arrCounty]
draft.multiIndex = _multiIndex
draft.loading = false
})
}
@ -520,7 +523,7 @@ function MemberUserInfo () {
if (isWeixin) {
return (
<Button class='avatar-wrapper' open-type='chooseAvatar' onChooseAvatar={onChooseAvatar}>
<SpImage src={'cart/logo-hui.png'} width={110} height={110} circle isNew />
{formUserInfo.avatar ? <SpImage src={formUserInfo.avatar} width={110} height={110} circle /> : <SpImage src={'cart/logo-hui.png'} width={110} height={110} circle isNew />}
</Button>
)
} else {
@ -540,6 +543,7 @@ 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, 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";
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"
const initialState = {
info: null,
curTabIdx: 0,
curTabIdx: 1,
tabList: AFTER_SALE_TYPE,
reasonIndex: '',
reasons: [],
@ -34,15 +34,27 @@ 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) {
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 } = state
refundStore, contact, mobile, afterSaleDesc, offlineAftersalesIsOpen, offlineAftersales, afterSaleTotalNum, allClicked, afterSaleTotalprice, loading, isOpened, isAddrOpened, aftersales, expressList, corpIndex, logi_no } = state
useEffect(() => {
fetch()
@ -52,6 +64,15 @@ 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')
@ -70,12 +91,67 @@ 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 } = $instance.router.params
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 { 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()
const { offline_aftersales } = distributor
const { offline_aftersales } = distributor
const _info = pickBy(orderInfo, doc.trade.TRADE_ITEM)
setState(draft => {
draft.info = _info
@ -90,17 +166,29 @@ function TradeAfterSale(props) {
draft.refundTypeList = REFUND_FEE_TYPE.filter(item => item.value != 'offline')
draft.refundType = 'logistics'
}
draft.loading = false
})
}
const onChangeItemCheck = (item, index, e) => {
const onChangeItemCheck = (item, index, type) => {
// const _info = info
// _info.items[index].checked = e
setState(draft => {
draft.info.items[index].checked = e
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)
})
}
const onChangeItemNum = (e, index) => {
setState(draft => {
draft.info.items[index].refundNum = e
})
@ -147,15 +235,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 }) => {
detail: checkedItems.map(({ id: _id, refundNum, num }) => {
return {
id: _id,
num: refundNum
num: num || refundNum
}
}),
order_id: id,
@ -193,61 +281,191 @@ function TradeAfterSale(props) {
await api.aftersales.apply(params)
showToast('提交成功')
setTimeout(() => {
Taro.redirectTo({
url: `/subpage/pages/trade/detail?id=${id}`
})
}, 200)
// Taro.redirectTo({
// url: `/subpage/pages/trade/detail?id=${id}`
// })
// fetch()
Taro.navigateBack()
}, 500)
}
return <SpPage ref={pageRef} className='page-trade-after-sale' renderFooter={
<View className='btn-wrap'>
<AtButton circle type='primary' onClick={onSubmit}>提交</AtButton>
</View>
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
}
>
<SpTabs current={curTabIdx} tablist={tabList} onChange={(e) => {
{!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) => {
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'>
{
info?.items.map((item, index) => (
<View className='item-wrap' key={`item-wrap__${index}`}>
<View className='item-hd'>
<SpCheckbox disabled={!item.leftAftersalesNum} checked={item.checked} onChange={onChangeItemCheck.bind(this, item, index)} />
</View>
<View className='item-bd'>
<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.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>退款数量</Text>
<SpInputNumber
disabled={!item.leftAftersalesNum}
value={item.refundNum}
max={item.leftAftersalesNum}
min={1}
onChange={(e) => onChangeItemNum(e, index)}
/>
(aftersales?.items || info?.items || []).map((item, index) => (
<View className="item-box" onClick={onChangeItemCheck.bind(this, 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-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} />
<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>
<View className='goods-info-ft'>
<Text>数量{item.num}</Text>
<SpPrice size={20} value={item.price / item.num} showSeparator noDecimal={false} />
{/* <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='picker-reason'>
<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'>
<Picker
mode='selector'
range={reasons}
@ -259,9 +477,11 @@ function TradeAfterSale(props) {
>
<SpCell title='退款原因' isLink value={<Text>{`${reasons?.[reasonIndex] || '请选择取消原因'}`}</Text>}></SpCell>
</Picker>
</View>
</View> */}
<View className='refund-desc-container'>
<View className='refund-detail'>
</View>
{false && <View className='refund-detail'>
<View className='refund-amount'>
<SpCell title='退款金额' value={getRealRefundFee()} />
</View>
@ -270,9 +490,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
@ -311,19 +531,28 @@ function TradeAfterSale(props) {
/>}></SpCell>
</>
}
</View>}
</View>} */}
<View className='desc-container'>
<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) => {
<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) => {
setState(draft => {
draft.description = e
})
}} />
}} /> */}
<Input className="desc-ipt" value={description} placeholder='在此填写备注要求' onInput={(e) => {
setState(draft => {
draft.description = e.detail.value
})
}}></Input>
</View>
<SpUpload
: <View style={{ opacity: '0.8', fontSize: '24rpx' }}>备注{aftersales?.description || description}</View>}
{/* <SpUpload
value={pic}
max={3}
onChange={(val) => {
@ -331,7 +560,7 @@ function TradeAfterSale(props) {
draft.pic = val
})
}}
/>
/> */}
</View>
{
@ -375,6 +604,89 @@ 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,6 +1,61 @@
.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: 20px;
padding: 50px;
margin-bottom: 100px;
.at-button__text {
font-size: 36px;
}
}
.comp-trade-info {
margin-top: 20px;
@ -30,6 +85,24 @@
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;
@ -39,7 +112,7 @@
}
.refund-items {
background-color: #fff;
margin: 24px 16px 0;
margin: 0px 22px 0;
border-radius: 16px;
.title {
font-size: 30px;
@ -50,13 +123,35 @@
}
.items-container {
// padding: 0 32px 20px;
padding: 24px 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;
}
}
.item-wrap {
display: flex;
align-items: center;
&:not(:last-child) {
margin-bottom: 20px;
}
.item-hd {
margin-right: 40px;
.sp-checkbox-new .icon-checkbox-weixuan,
.sp-checkbox-new .icon-checkbox-xuanzhong {
color: #00000090;
font-size: 30px;
}
}
.item-bd {
@ -65,31 +160,46 @@
align-items: center;
}
.goods-info {
margin-left: 24px;
margin-left: 60px;
flex: 1;
margin-top: 8px;
height: 150px;
display: flex;
justify-content: space-between;
flex-direction: column;
padding: 10px 0;
box-sizing: border-box;
&-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;
// margin-top: 10px;
font-size: 20px;
.sp-price {
margin-left: 30px;
.sp-price__symbol {
margin-right: 2px !important;
}
}
}
.goods-title {
font-weight: 500;
color: #111a34;
font-size: 26px;
// color: #111a34;
color: #000;
font-size: 20px;
}
.goods-num {
font-size: 22px;
@ -97,13 +207,11 @@
color: #111a34;
}
.sku-info {
font-size: 24px;
font-weight: 400;
color: #858b9c;
background: #f5f5f5;
padding: 0 10px;
padding: 20px 0;
height: 34px;
line-height: 34px;
font-size: 20px;
opacity: 0.85;
}
}
.refund-detail {
@ -181,13 +289,22 @@
}
.desc-container {
background-color: #fff;
margin: 24px 16px 0;
margin: 24px 22px 0;
padding-bottom: 30px;
border-radius: 16px;
.desc-content {
margin: 0 32px;
padding: 16px 18px;
border: 2px solid #00000090;
border-radius: 6px;
display: flex;
overflow: hidden;
.desc-ipt {
font-size: 26px;
}
.input-placeholder {
color: #a5a5a5;
font-size: 26px;
}
}
.icon-bianji1 {
color: #aaaaaa;
@ -203,8 +320,11 @@
.title {
font-size: 30px;
font-weight: 500;
color: #333;
padding: 28px 32px;
color: #000;
padding: 50px 0 26px;
display: flex;
align-items: center;
justify-content: space-between;
}
}
.sp-upload {
@ -312,4 +432,118 @@
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

@ -30,49 +30,49 @@ export * from './platforms'
const isPrimitiveType = (val, type) => Object.prototype.toString.call(val) === type
export function isFunction(val) {
export function isFunction (val) {
return isPrimitiveType(val, '[object Function]')
}
export function uniqueFunc(arr, uniId) {
const res = new Map();
return arr.filter((item) => !res.has(item[uniId]) && res.set(item[uniId], 1));
export function uniqueFunc (arr, uniId) {
const res = new Map()
return arr.filter((item) => !res.has(item[uniId]) && res.set(item[uniId], 1))
}
export function isNumber(val) {
export function isNumber (val) {
return isPrimitiveType(val, '[object Number]')
}
export function isPointerEvent(val) {
export function isPointerEvent (val) {
return isPrimitiveType(val, '[object PointerEvent]')
}
export function isObject(val) {
export function isObject (val) {
return isPrimitiveType(val, '[object Object]')
}
export function isBoolean(val) {
export function isBoolean (val) {
return isPrimitiveType(val, '[object Boolean]')
}
export function isArray(arr) {
export function isArray (arr) {
return Array.isArray(arr)
}
export function isString(val) {
export function isString (val) {
return typeof val === 'string'
}
export function isEmpty(obj) {
export function isEmpty (obj) {
return _isEmpty(obj)
}
export function removeItemInArray(array, fn) {
export function removeItemInArray (array, fn) {
_remove(array, fn)
// return array
}
export function isObjectsValue(val) {
export function isObjectsValue (val) {
// 判断对象是否有值 true有 false
return val && Object.keys(val).length > 0
}
@ -122,7 +122,7 @@ export const getBrowserEnv = () => {
/** 在H5平台(微信浏览器) */
export const isWxWeb = isWeb && !!getBrowserEnv().weixin
export function isObjectValueEqual(a, b) {
export function isObjectValueEqual (a, b) {
var aProps = Object.getOwnPropertyNames(a)
var bProps = Object.getOwnPropertyNames(b)
if (aProps.length != bProps.length) {
@ -177,7 +177,7 @@ export const isIphoneX = () => {
}
// TODO: 验证方法在h5及边界情况稳定性
export function getCurrentRoute() {
export function getCurrentRoute () {
const router = getCurrentInstance().router
// eslint-disable-next-line
const { $taroTimestamp, ...params } = router.params || {}
@ -192,7 +192,7 @@ export function getCurrentRoute() {
}
// 除以100以后的千分符
export function formatPriceToHundred(price) {
export function formatPriceToHundred (price) {
if (price) {
return (Number(price) / 100)
.toFixed(2)
@ -203,11 +203,11 @@ export function formatPriceToHundred(price) {
}
}
export function thousandthFormat(value) {
export function thousandthFormat (value) {
return (value.toString() + '').replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
}
export async function normalizeQuerys(params = {}) {
export async function normalizeQuerys (params = {}) {
const { scene, ...rest } = params
const queryStr = decodeURIComponent(scene)
const obj = qs.parse(queryStr)
@ -228,7 +228,7 @@ export async function normalizeQuerys(params = {}) {
return ret
}
export function pickBy(arr = [], keyMaps = {}) {
export function pickBy (arr = [], keyMaps = {}) {
const picker = (item) => {
const ret = {}
@ -256,7 +256,7 @@ export function pickBy(arr = [], keyMaps = {}) {
}
}
export function navigateTo(url, isRedirect) {
export function navigateTo (url, isRedirect) {
if (isObject(isRedirect) || isPointerEvent(isRedirect)) {
isRedirect = false
}
@ -268,23 +268,26 @@ export function navigateTo(url, isRedirect) {
return Taro.navigateTo({ url })
}
export function resolvePath(baseUrl, params = {}) {
export function resolvePath (baseUrl, params = {}) {
const queryStr = typeof params === 'string' ? params : qs.stringify(params)
return `${baseUrl}${baseUrl.indexOf('?') >= 0 ? '&' : '?'}${queryStr}`
}
export function formatTime(time, formatter = 'YYYY-MM-DD') {
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)
}
export function formatDateTime(time, formatter = 'YYYY-MM-DD HH:mm:ss') {
export function formatDateTime (time, formatter = 'YYYY-MM-DD HH:mm:ss') {
const newTime = time.toString().length < 13 ? time * 1000 : time
return dayjs(newTime).format(formatter)
}
export function copyText(text, msg = '内容已复制') {
export function copyText (text, msg = '内容已复制') {
return new Promise((resolve, reject) => {
if (process.env.TARO_ENV === 'weapp') {
Taro.setClipboardData({
@ -297,7 +300,7 @@ export function copyText(text, msg = '内容已复制') {
console.log('copyText:text', text)
my.setClipboard({
text: text,
});
})
resolve(text)
return
}
@ -311,7 +314,7 @@ export function copyText(text, msg = '内容已复制') {
})
}
export function calcTimer(totalSec) {
export function calcTimer (totalSec) {
let remainingSec = totalSec
const dd = Math.floor(totalSec / 24 / 3600)
remainingSec -= dd * 3600 * 24
@ -329,7 +332,7 @@ export function calcTimer(totalSec) {
}
}
export function resolveOrderStatus(status, isBackwards) {
export function resolveOrderStatus (status, isBackwards) {
if (isBackwards) {
return _findKey(STATUS_TYPES_MAP, (o) => o === status)
}
@ -337,7 +340,7 @@ export function resolveOrderStatus(status, isBackwards) {
return STATUS_TYPES_MAP[status]
}
export function goToPage(page) {
export function goToPage (page) {
// eslint-disable-next-line
const loc = location
page = page.replace(/^\//, '')
@ -346,14 +349,14 @@ export function goToPage(page) {
loc.href = url
}
export function maskMobile(mobile) {
export function maskMobile (mobile) {
return mobile.replace(/^(\d{2})(\d+)(\d{2}$)/, '$1******$3')
}
// 不可使用promise/async异步写法
export function authSetting(scope, succFn, errFn) {
export function authSetting (scope, succFn, errFn) {
Taro.getSetting({
success(res) {
success (res) {
const result = res.authSetting[isWeixin ? `scope.${scope}` : `${scope}`]
if (isWeixin) {
if (result === undefined) {
@ -377,13 +380,13 @@ export function authSetting(scope, succFn, errFn) {
}
}
},
fail(res) {
fail (res) {
console.error(res)
}
})
}
export function imgCompression(url) {
export function imgCompression (url) {
const rule = '?imageView2/1/w/80'
return url + rule
}
@ -442,7 +445,7 @@ const getUrl = (url) => {
return `${hrefList[0]}//${hrefList[2]}${url}`
}
export function tokenParseH5(token) {
export function tokenParseH5 (token) {
try {
let base64Url = token.split('.')[1]
return JSON.parse(atob(base64Url))
@ -451,7 +454,7 @@ export function tokenParseH5(token) {
}
}
export function tokenParse(token) {
export function tokenParse (token) {
var base64Url = token.split('.')[1]
var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/')
console.log('Taro.base64ToArrayBuffer', base64)
@ -470,7 +473,7 @@ export function tokenParse(token) {
}
// 解析字符串
function getQueryVariable(herf) {
function getQueryVariable (herf) {
const url = herf.split('?')
let query = {}
if (url[1]) {
@ -485,7 +488,7 @@ function getQueryVariable(herf) {
return query
}
/** 是否是合法的color */
function validColor(color) {
function validColor (color) {
var re1 = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i
var re2 =
/^rgb\(([0-9]|[0-9][0-9]|25[0-5]|2[0-4][0-9]|[0-1][0-9][0-9])\,([0-9]|[0-9][0-9]|25[0-5]|2[0-4][0-9]|[0-1][0-9][0-9])\,([0-9]|[0-9][0-9]|25[0-5]|2[0-4][0-9]|[0-1][0-9][0-9])\)$/i
@ -506,7 +509,7 @@ function validColor(color) {
* }
* } data 新增上报数据
*/
export async function buriedPoint(data) {
export async function buriedPoint (data) {
const params = getCurrentInstance().router.params
let {
gu,
@ -559,7 +562,7 @@ export async function buriedPoint(data) {
*
*/
export function paramsSplice(params) {
export function paramsSplice (params) {
let str = ''
let arr = []
for (var key in params) {
@ -570,7 +573,7 @@ export function paramsSplice(params) {
return str
}
export function resolveFavsList(list, favs) {
export function resolveFavsList (list, favs) {
return list.map((t) => {
const { item_id } = t
return {
@ -581,7 +584,7 @@ export function resolveFavsList(list, favs) {
}
// 判断是否在导购货架
export function isGoodsShelves() {
export function isGoodsShelves () {
const system = Taro.getSystemInfoSync()
log.debug(`this system is: ${JSON.stringify(system)}`)
if (system && system.environment && system.environment === 'wxwork') {
@ -591,7 +594,7 @@ export function isGoodsShelves() {
}
}
export function styleNames(styles) {
export function styleNames (styles) {
if (!styles || typeof styles !== 'object') {
return '""'
}
@ -619,7 +622,7 @@ export function styleNames(styles) {
return `${styleNames}`
}
export function getThemeStyle() {
export function getThemeStyle () {
const result = store.getState()
const { colorPrimary, colorMarketing, colorAccent, rgb } = result.sys
return {
@ -630,13 +633,13 @@ export function getThemeStyle() {
}
}
export function isNavbar() {
export function isNavbar () {
return isWeb && !getBrowserEnv().weixin
}
export const hasNavbar = isWeb && !getBrowserEnv().weixin
export function showToast(title, callback) {
export function showToast (title, callback) {
Taro.showToast({
title,
icon: 'none'
@ -646,7 +649,7 @@ export function showToast(title, callback) {
}, 2000)
}
export function hex2rgb(hex) {
export function hex2rgb (hex) {
if (![4, 7].includes(hex.length)) {
throw new Error('格式错误')
}
@ -663,7 +666,7 @@ export function hex2rgb(hex) {
for (let i = 0, len = result.length; i < len; i += 2) {
rgb[i / 2] = getHexVal(result[i]) * 16 + getHexVal(result[i + 1])
}
function getHexVal(letter) {
function getHexVal (letter) {
let num = -1
switch (letter.toUpperCase()) {
case 'A':
@ -695,12 +698,12 @@ export function hex2rgb(hex) {
return rgb
}
export function exceedLimit({ size: fileSize }) {
export function exceedLimit ({ size: fileSize }) {
const size = fileSize / 1024 / 1024
return size > 15
}
function isBase64(str) {
function isBase64 (str) {
let isStr = str?.url ? str?.url : str
if (isStr.indexOf('data:') != -1 && isStr.indexOf('base64') != -1) {
return true
@ -715,7 +718,7 @@ const isMerchantModule = () => {
return /\/subpages\/merchant/.test(pathname)
}
function isUndefined(val) {
function isUndefined (val) {
return typeof val === 'undefined'
}
@ -725,7 +728,7 @@ const merchantIsvaild = async (parmas) => {
return status
}
export function getExtConfigData() {
export function getExtConfigData () {
const extConfig = Taro.getExtConfigSync ? Taro.getExtConfigSync() : {}
if (_isEmpty(extConfig)) {
return {
@ -798,7 +801,7 @@ const alipayAutoLogin = () => {
my.getAuthCode({
scopes: 'auth_base',
success: (res) => {
const code = res.authCode;
const code = res.authCode
resolve({ code })
},
fail: (res) => {
@ -815,19 +818,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
@ -835,7 +838,7 @@ const htmlStringToNodeArray = (htmlString) => {
log.error('htmlStringToNodeArray error')
}
})
return nodeArray;
return nodeArray
}
const getCurrentPageRouteParams = () => {
@ -861,7 +864,7 @@ const resolveUrlParamsParse = (url) => {
const itemArr = item.split('=')
const key = itemArr[0]
const value = itemArr[1]
res[key] = value;
res[key] = value
})
return res
}