diff --git a/src/api/member.js b/src/api/member.js index 60ac26d..fb168bf 100755 --- a/src/api/member.js +++ b/src/api/member.js @@ -68,7 +68,7 @@ export function homeCouponGet (params = {}) { export function getCardDetail (params = {}) { // return req.get('/user/getCardDetail', params) - return req.get('/user/receiveCardByPoint', params) //积分换优惠券操作 + return req.post('/user/receiveCardByPoint', params) //积分换优惠券操作 } export function userUsedCard (params = {}) { diff --git a/src/components/sp-coupon/index.js b/src/components/sp-coupon/index.js index 04c2e33..a2a5048 100755 --- a/src/components/sp-coupon/index.js +++ b/src/components/sp-coupon/index.js @@ -41,6 +41,7 @@ function SpCoupon (props) { 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 @@ -60,7 +61,8 @@ function SpCoupon (props) { {isNew ? 有效日期:领取{fixedTerm}天内有效 : 有效日期:{beginDate}至{endDate}} - {!valid || info.tagClass === 'used' || info.tagClass === 'overdue' ? 已{info.tagClass === 'used' ? '使用' : '过期'} + {/* !valid || */} + {info.tagClass === 'used' || info.tagClass === 'overdue' ? 已{info.tagClass === 'used' ? '使用' : '过期'} : 立即{isNew ? '兑换' : '使用'}} ) diff --git a/src/components/sp-filter-bar-new/index.js b/src/components/sp-filter-bar-new/index.js index 34edfc0..da31d1c 100755 --- a/src/components/sp-filter-bar-new/index.js +++ b/src/components/sp-filter-bar-new/index.js @@ -31,7 +31,7 @@ export default class SpFilterBar extends Component { curIdx: current, sortOrder: 1, value: '0', - sortVal: '0', + sortVal: 0, showFilter: false } } diff --git a/src/components/sp-picker/picker-select.js b/src/components/sp-picker/picker-select.js index 06a2740..b28a41b 100755 --- a/src/components/sp-picker/picker-select.js +++ b/src/components/sp-picker/picker-select.js @@ -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 ( onChange(e)} + immediateChange // 使用acc.concat将多维数组打平成一维数组再求数组长度 > - {source.map((item, elementIndex) => ( - {item.text} + {list.map((item, elementIndex) => ( + {item.text} ))} - { - onPickerCancel() - setTimeout(() => { - handleConfirm(source[value[0]], value[0]) - }, 100) - }}>确定 + 确定 ) } diff --git a/src/components/sp-sku-select-new/index.js b/src/components/sp-sku-select-new/index.js index 2c124a5..609c440 100755 --- a/src/components/sp-sku-select-new/index.js +++ b/src/components/sp-sku-select-new/index.js @@ -48,7 +48,7 @@ function SpSkuSelect (props, ref) { hideInputNumber = false, onChangeImg } = props - // console.log('SpSkuSelect:info', info) + console.log('SpSkuSelect:info', info) // const [state, setState] = useImmer(initialState) const [state, setState] = useAsyncCallback(initialState) const { selection, curImage, disabledSet, curItem, skuText, num, loading } = state @@ -63,6 +63,7 @@ function SpSkuSelect (props, ref) { const init = () => { const { skuList, specItems } = info + console.log("🚀 ~ skuList:", skuList) specItems.forEach((item) => { const key = item.specItem.map((spec) => spec.specId).join('_') skuDictRef.current[key] = item @@ -78,11 +79,12 @@ function SpSkuSelect (props, ref) { } const calcDisabled = (selection, i = 0) => { + const { skuList } = 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) + console.log('regStr:', regStr) return new RegExp(regStr) } @@ -178,7 +180,7 @@ function SpSkuSelect (props, ref) { return null } - const { skuList } = info + // const { skuList } = info const addToCart = async () => { const { nospec } = info @@ -370,7 +372,7 @@ function SpSkuSelect (props, ref) { } - {skuList.map((item, index) => ( + {info.skuList.map((item, index) => ( {/* {item.skuName} */} diff --git a/src/doc/coupon.js b/src/doc/coupon.js index 53a93b8..ee7df02 100755 --- a/src/doc/coupon.js +++ b/src/doc/coupon.js @@ -31,13 +31,18 @@ export const COUPON_ITEM = { } }, 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 // 已领取 + 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), diff --git a/src/doc/trade.js b/src/doc/trade.js index 62b0086..b7ebf27 100755 --- a/src/doc/trade.js +++ b/src/doc/trade.js @@ -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 = { @@ -69,11 +87,11 @@ export const TRADE_AFTER_SALES_ITEM = { }) }, 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, + aftersalesHours: ({ aftersales_address }) => aftersales_address.aftersales_hours, refundFee: ({ refund_fee }) => refund_fee / 100, refundPoint: 'refund_point', reason: 'reason', diff --git a/src/pages/cart/espier-checkout.js b/src/pages/cart/espier-checkout.js index 24b6e49..b394c42 100755 --- a/src/pages/cart/espier-checkout.js +++ b/src/pages/cart/espier-checkout.js @@ -910,8 +910,8 @@ function CartCheckout (props) { 运费 {totalInfo.freight_type !== 'point' - ? `¥ ${totalInfo.freight_fee}` - : `${totalInfo.freight_fee * 100}${this.props.pointName}`} + ? `¥ ${+totalInfo.freight_fee / 100}` + : `${totalInfo.freight_fee}${this.props.pointName}`} diff --git a/src/pages/item/espier-detail.js b/src/pages/item/espier-detail.js index ef8f759..5f94c9f 100755 --- a/src/pages/item/espier-detail.js +++ b/src/pages/item/espier-detail.js @@ -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, @@ -256,15 +256,15 @@ function EspierDetail (props) { draft.defaultMsg = '商品已下架' }) } - if (selColorIdx != 0) { - const spec_values = data.itemSpecDesc?.[0]?.spec_values || [] - if (spec_values.length) { - const item = spec_values[selColorIdx] - setTimeout(() => { - skuSelectRef.current?.handleSelectSku({ specId: item.spec_value_id, specValueId: item.spec_value_id }, selColorIdx) - }, 100) - } - } + // if (selColorIdx != 0) { + // const spec_values = data.itemSpecDesc?.[0]?.spec_values || [] + // if (spec_values.length) { + // const item = spec_values[selColorIdx] + // setTimeout(() => { + // skuSelectRef.current?.handleSelectSku({ specId: item.spec_value_id, specValueId: item.spec_value_id }, selColorIdx) + // }, 100) + // } + // } } catch (e) { setState((draft) => { draft.isDefault = true @@ -289,7 +289,7 @@ function EspierDetail (props) { } }) } - console.log("🚀 ~ data.introList:", data.introList) + console.log("🚀 ~ data.introList:", data) setState((draft) => { draft.info = { ...data, diff --git a/src/pages/member/item-fav.js b/src/pages/member/item-fav.js index 624e502..2da92d5 100755 --- a/src/pages/member/item-fav.js +++ b/src/pages/member/item-fav.js @@ -309,9 +309,9 @@ export default class ItemFav extends Component { 人收藏 - this.handleClickItem(item)}> + {/* this.handleClickItem(item)}> 相似推荐 - + */} this.handleClickItem(item)}> 立即购买 diff --git a/src/subpage/pages/trade/cancel.scss b/src/subpage/pages/trade/cancel.scss index 1853d88..a30452d 100755 --- a/src/subpage/pages/trade/cancel.scss +++ b/src/subpage/pages/trade/cancel.scss @@ -1,4 +1,4 @@ -@import "@/style/imports"; +@import '@/style/imports'; .page-trade-cancel { .sp-cell { @@ -9,18 +9,25 @@ } &__bd { width: 100%; + .at-tag--active { + color: #000; + border-color: #000; + background-color: #fff; + } } .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; diff --git a/src/subpage/pages/trade/comps/new-item.js b/src/subpage/pages/trade/comps/new-item.js index c2affc6..095d09d 100755 --- a/src/subpage/pages/trade/comps/new-item.js +++ b/src/subpage/pages/trade/comps/new-item.js @@ -221,7 +221,7 @@ export default class TradeItem extends Component { {info.status_desc} - {info.receipt_type !== 'dada' && ( + {/* {info.receipt_type !== 'dada' && ( - )} + )} */} {info.receipt_type !== 'dada' && (