update
parent
82a04ee96f
commit
6ae387165b
|
|
@ -58,7 +58,8 @@ export function getUserCardList(params = {}) {
|
|||
}
|
||||
|
||||
export function homeCouponList (params = {}) {
|
||||
return req.get('/getCardList', params)
|
||||
// return req.get('/getCardList', params)
|
||||
return req.get('/getRedeemDiscountCardList', params) //积分兑换优惠券列表
|
||||
}
|
||||
|
||||
export function homeCouponGet (params = {}) {
|
||||
|
|
@ -66,7 +67,8 @@ export function homeCouponGet(params = {}) {
|
|||
}
|
||||
|
||||
export function getCardDetail (params = {}) {
|
||||
return req.get('/user/getCardDetail', params)
|
||||
// return req.get('/user/getCardDetail', params)
|
||||
return req.get('/user/receiveCardByPoint', params) //积分换优惠券操作
|
||||
}
|
||||
|
||||
export function userUsedCard (params = {}) {
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@ const config = {
|
|||
"getLocation",
|
||||
"chooseAddress"
|
||||
],
|
||||
"__usePrivacyCheck__": true
|
||||
// "__usePrivacyCheck__": true
|
||||
}
|
||||
|
||||
if (process.env.TARO_ENV == 'weapp') {
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ const initialState = {
|
|||
isExpanded: false
|
||||
}
|
||||
function SpCoupon (props) {
|
||||
const { info, children, onClick = () => {} } = props
|
||||
const { info, children, onClick = () => { }, isNew } = props
|
||||
const [state, setState] = useImmer(initialState)
|
||||
const { isExpanded } = state
|
||||
if (!info) {
|
||||
|
|
@ -34,12 +34,37 @@ function SpCoupon(props) {
|
|||
description,
|
||||
quantity,
|
||||
getNum,
|
||||
distributorName
|
||||
distributorName,
|
||||
couponStatus,
|
||||
id,
|
||||
fixedTerm,
|
||||
status,
|
||||
valid,
|
||||
} = 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 (
|
||||
|
|
@ -92,8 +117,7 @@ function SpCoupon(props) {
|
|||
>
|
||||
{COUPON_TYPE[cardType].tag}
|
||||
</View>
|
||||
<View className='title'>{`${
|
||||
VERSION_PLATFORM && distributorName ? `${distributorName}: ${title}` : title
|
||||
<View className='title'>{`${VERSION_PLATFORM && distributorName ? `${distributorName}: ${title}` : title
|
||||
}`}</View>
|
||||
</View>
|
||||
<View className='coupon-datetime'>{`有效期: ${beginDate} - ${endDate}`}</View>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>}
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ function SpGoodsItem (props) {
|
|||
<View className={classNames('sp-goods-item')} onClick={handleClick.bind(this)}>
|
||||
<View className='goods-item__hd'>
|
||||
<SpImage lazyLoad src={selColorItem.item_image_url?.[0] || info.spec_images?.[0]?.item_image_url?.[0] || info.pic} height={height} width={width} mode={"scaleToFill"} />
|
||||
{info.tagList.map((item, index) => <View className="new" style={{ borderColor: item.tag_color, color: item.font_color, left: index === 0 ? '20rpx' : index * 30 + 8 + 'rpx' }} key={index + item.item_id}>{item.tag_name}</View>)}
|
||||
{info.tagList?.map((item, index) => <View className="new" style={{ borderColor: item.tag_color, color: item.font_color, left: index === 0 ? '20rpx' : index * 30 + 8 + 'rpx' }} key={index + item.item_id}>{item.tag_name}</View>)}
|
||||
{/* <View className="new" style={{ left: '120rpx' }}>NEW</View> */}
|
||||
</View>
|
||||
{/* {renderBrand && <View className='goods-brand-wrap'>{renderBrand}</View>} */}
|
||||
|
|
|
|||
|
|
@ -75,8 +75,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;
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { formatTime } from '@/utils'
|
||||
import { formatTime, diffInDays } from '@/utils'
|
||||
|
||||
export const COUPON_ITEM = {
|
||||
title: 'title',
|
||||
|
|
@ -29,7 +29,21 @@ export const COUPON_ITEM = {
|
|||
} else {
|
||||
return valid
|
||||
}
|
||||
},
|
||||
couponStatus: ({ quantity, get_limit, user_get_num, get_num }) => {
|
||||
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 = {
|
||||
|
|
@ -61,8 +75,10 @@ export const COUPON = {
|
|||
distributorName: ({ distributor_info }) => {
|
||||
return distributor_info?.name
|
||||
},
|
||||
fixedTerm: 'fixed_term',
|
||||
sourceType: 'source_type',
|
||||
sourceId: 'source_id',
|
||||
point: ({ point }) => +point,
|
||||
valid: ({ valid }) => {
|
||||
if (typeof valid === 'undefined') {
|
||||
return true
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ function AddressIndex (props) {
|
|||
)} */}
|
||||
|
||||
<View className='member-address-list'>
|
||||
{list?.length && list.map((item, index) => {
|
||||
{list?.length > 0 && list.map((item, index) => {
|
||||
return (
|
||||
<View
|
||||
key={item[ADDRESS_ID]}
|
||||
|
|
|
|||
|
|
@ -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' })
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
flex-direction: column;
|
||||
}
|
||||
.icon-roundcheckfill {
|
||||
font-size: 40px;
|
||||
font-size: 80px;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
.trade-txt {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
&-bd {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
height: 150px;
|
||||
}
|
||||
&-image {
|
||||
width: 220px;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ export const initialState = {
|
|||
paramsInfo: {}, // 结算接口参数
|
||||
discountInfo: [],
|
||||
couponInfo: {}, // 优惠券信息
|
||||
couponTotal: 0,
|
||||
remark: '', // 备注
|
||||
// 积分相关
|
||||
isPointOpen: false,
|
||||
|
|
|
|||
|
|
@ -105,7 +105,8 @@ function CartCheckout (props) {
|
|||
buildingNumber,
|
||||
houseNumber, // 房号
|
||||
routerParams, // 路由参数
|
||||
orderTtems
|
||||
orderTtems,
|
||||
couponTotal
|
||||
} = state
|
||||
|
||||
const {
|
||||
|
|
@ -127,6 +128,7 @@ function CartCheckout (props) {
|
|||
useEffect(() => {
|
||||
if (isLogin) {
|
||||
getTradeSetting()
|
||||
getCouponList()
|
||||
// tode 此处应有埋点
|
||||
return () => {
|
||||
dispatch(changeCoupon()) // 清空优惠券信息
|
||||
|
|
@ -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()
|
||||
|
|
@ -403,7 +419,10 @@ function CartCheckout (props) {
|
|||
price
|
||||
}
|
||||
})
|
||||
let url = `/subpages/marketing/coupon-picker?items=${JSON.stringify(
|
||||
|
||||
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) {
|
||||
|
|
@ -527,7 +546,7 @@ function CartCheckout (props) {
|
|||
receiver_district,
|
||||
item_fee_new,
|
||||
market_fee,
|
||||
items_promotion
|
||||
items_promotion,
|
||||
} = orderRes
|
||||
|
||||
let subdistrictRes
|
||||
|
|
@ -554,7 +573,8 @@ function CartCheckout (props) {
|
|||
// }
|
||||
coupon_id: id,
|
||||
coupon_code: coupon_code,
|
||||
title: info
|
||||
title: info,
|
||||
...coupon_info
|
||||
}
|
||||
setState((draft) => {
|
||||
draft.couponInfo = _info
|
||||
|
|
@ -587,7 +607,7 @@ function CartCheckout (props) {
|
|||
point_fee, //积分抵扣金额,
|
||||
item_point,
|
||||
freight_type,
|
||||
promotion_discount
|
||||
promotion_discount,
|
||||
}
|
||||
|
||||
const point_info = {
|
||||
|
|
@ -716,7 +736,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 +883,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,7 +904,7 @@ 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>
|
||||
|
|
|
|||
|
|
@ -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%;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -330,7 +330,7 @@ function EspierDetail (props) {
|
|||
|
||||
const res = await api.member.itemHistory()
|
||||
setState((draft) => {
|
||||
draft.historyList = res.list.filter((item) => item.item_id !== data.itemId).map((item) => ({ ...item.itemData, pic: item.itemData.pics?.[0] || '' }))
|
||||
draft.historyList = res.list.filter((item) => item.item_id !== data.itemId)?.map((item) => ({ ...item.itemData, pic: item.itemData.pics?.[0] || '' })) || []
|
||||
draft.historyTotal = res.total_count
|
||||
})
|
||||
|
||||
|
|
@ -585,21 +585,21 @@ 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'>
|
||||
|
|
@ -779,11 +779,11 @@ 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
|
||||
})
|
||||
}}
|
||||
title={item.title}
|
||||
|
|
@ -792,11 +792,11 @@ 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
|
||||
})
|
||||
}}>
|
||||
{item.isOpen ? <AtIcon value='subtract' size='16' color='#000' /> :
|
||||
|
|
@ -804,7 +804,7 @@ function EspierDetail (props) {
|
|||
{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 +819,7 @@ function EspierDetail (props) {
|
|||
</View>
|
||||
))}
|
||||
</ScrollView>
|
||||
</View>}
|
||||
</View> : <></>}
|
||||
</View>
|
||||
</ScrollView>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -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: []
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -480,10 +482,27 @@ 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) => {
|
||||
Taro.showLoading({ title: '' })
|
||||
let { delivery_type, delivery_id, order_type, tid: order_id } = this.state.info
|
||||
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]
|
||||
})
|
||||
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,7 +687,8 @@ export default class TradeDetail extends Component {
|
|||
tradeInfo,
|
||||
showQRcode,
|
||||
pickup_code,
|
||||
distributor
|
||||
distributor,
|
||||
showDeliveryModal
|
||||
} = this.state
|
||||
|
||||
if (!info) {
|
||||
|
|
@ -916,7 +936,7 @@ export default class TradeDetail extends Component {
|
|||
<>
|
||||
<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>
|
||||
|
|
@ -987,7 +1007,7 @@ export default class TradeDetail extends Component {
|
|||
</View>
|
||||
)}
|
||||
|
||||
<View className='trade-money'>
|
||||
{/* <View className='trade-money'> */}
|
||||
{/* <View>
|
||||
总计:
|
||||
{this.isPointitemGood() ? (
|
||||
|
|
@ -1015,7 +1035,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 +1159,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
|
||||
|
|
@ -1281,6 +1301,39 @@ 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="">物流信息</Text>
|
||||
</View>
|
||||
<View className="receiver_name">
|
||||
{info.receiver_name}:{info.receiver_phone}
|
||||
</View>
|
||||
<ScrollView scrollY
|
||||
scrollWithAnimation className="curtain_content_text" showScrollbar={false} enhanced>
|
||||
亲爱的用户,感谢您使用Birkenstock微信小程序!为了加强对您个人信息的保护,我们根据最新法律的要求制定/更新了
|
||||
,我们将基于合法以及正当必要的原则,按照本政策的规定向您提供各项服务
|
||||
<View>
|
||||
本政策旨在向您说明休迪贸易 (上海)有限公司及其在中国大陆境内的线上线下门店如何收集、使用、传输和保护您的个人信息
|
||||
通过《隐私政策》,我们向您主要说明:
|
||||
</View>
|
||||
<View className="">
|
||||
1.您在使用Birkenstock微信小程序时,可以选择浏览模式,也可以选择注册/登录成为Birkenstock微信小程序用户
|
||||
</View>
|
||||
<View className="">
|
||||
2为了向你提供Birkenstock微信小程序的其本服条,我们将基于合法以及正当必要的原则,按照本政策的规定向您提供各项服务
|
||||
</View>
|
||||
</ScrollView>
|
||||
</View>
|
||||
</AtCurtain>
|
||||
</SpPage>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -696,4 +696,57 @@ $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;
|
||||
}
|
||||
}
|
||||
.no-text {
|
||||
color: #7e7e7e;
|
||||
font-size: 20rpx;
|
||||
margin-top: 28rpx;
|
||||
line-height: 1.4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 />
|
||||
|
|
|
|||
|
|
@ -127,7 +127,8 @@ export default class TradeList extends Component {
|
|||
order_status_des: 'order_status_des',
|
||||
status: ({ order_status }) => resolveOrderStatus(order_status),
|
||||
totalItems: ({ items }) => items.reduce((acc, item) => +item.num + acc, 0),
|
||||
payment: ({ item_fee_new }) => (item_fee_new / 100).toFixed(2),
|
||||
// payment: ({ item_fee_new }) => (item_fee_new / 100).toFixed(2),
|
||||
payment: ({ total_fee }) => (+total_fee / 100).toFixed(2),
|
||||
total_fee: 'total_fee',
|
||||
pay_type: 'pay_type',
|
||||
point: 'point',
|
||||
|
|
@ -162,7 +163,8 @@ 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',
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
@ -18,6 +18,7 @@ function CouponCenter (props) {
|
|||
const $instance = getCurrentInstance()
|
||||
const [state, setState] = useImmer(initialState)
|
||||
const { couponList } = state
|
||||
const listRef = useRef(null)
|
||||
|
||||
useEffect(() => { getMypoint() }, [])
|
||||
|
||||
|
|
@ -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,7 +98,7 @@ function CouponCenter (props) {
|
|||
getCoupon(item, index)
|
||||
}
|
||||
} else {
|
||||
showToast('优惠券领取机会已用完')
|
||||
showToast('优惠券已领取完啦')
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -99,6 +117,7 @@ function CouponCenter (props) {
|
|||
})
|
||||
}
|
||||
showToast('优惠券领取成功')
|
||||
getMypoint()
|
||||
} else {
|
||||
showToast('优惠券领取失败')
|
||||
}
|
||||
|
|
@ -131,19 +150,27 @@ function CouponCenter (props) {
|
|||
console.log('handleRedeem:', item)
|
||||
}
|
||||
|
||||
const getPoint = async () => {
|
||||
await api.member.depositToPoint({ money: 50000 })
|
||||
showToast('积分+500')
|
||||
setState((draft) => {
|
||||
draft.couponList = []
|
||||
})
|
||||
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 +193,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>)
|
||||
})}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -103,15 +103,15 @@ function CouponPicker(props) {
|
|||
<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.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>
|
||||
|
|
|
|||
|
|
@ -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 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-right">
|
||||
<View className="coupons-list-item-right-box">
|
||||
<View className="coupons-list-item-integral">{item.integral || 500}积分兑换</View>
|
||||
{/* {item.start_time}至{item.end_time} */}
|
||||
<View className="coupons-list-item-desc">有效日期:领取7天内有效</View>
|
||||
</View>
|
||||
<View className="coupons-list-item-btn" onClick={() => handleRedeem(item)}>立即使用</View>
|
||||
</View>
|
||||
</View>)
|
||||
))}
|
||||
</SpScrollView>
|
||||
</SpPage>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ export function isFunction(val) {
|
|||
}
|
||||
|
||||
export function uniqueFunc (arr, uniId) {
|
||||
const res = new Map();
|
||||
return arr.filter((item) => !res.has(item[uniId]) && res.set(item[uniId], 1));
|
||||
const res = new Map()
|
||||
return arr.filter((item) => !res.has(item[uniId]) && res.set(item[uniId], 1))
|
||||
}
|
||||
|
||||
export function isNumber (val) {
|
||||
|
|
@ -274,6 +274,9 @@ export function resolvePath(baseUrl, params = {}) {
|
|||
return `${baseUrl}${baseUrl.indexOf('?') >= 0 ? '&' : '?'}${queryStr}`
|
||||
}
|
||||
|
||||
export function diffInDays (time1, time2) {
|
||||
return Math.abs(dayjs(time1).diff(dayjs(time2), 'day'))
|
||||
}
|
||||
export function formatTime (time, formatter = 'YYYY-MM-DD') {
|
||||
const newTime = time.toString().length < 13 ? time * 1000 : time
|
||||
return dayjs(newTime).format(formatter)
|
||||
|
|
@ -297,7 +300,7 @@ export function copyText(text, msg = '内容已复制') {
|
|||
console.log('copyText:text', text)
|
||||
my.setClipboard({
|
||||
text: text,
|
||||
});
|
||||
})
|
||||
resolve(text)
|
||||
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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue