修复已知bug

main
王文龙 2024-02-29 13:42:55 +08:00
parent 3581889d7a
commit a2474dddc0
10 changed files with 34 additions and 20 deletions

View File

@ -4,6 +4,10 @@ export function search (params = {}) {
// return req.get('/item.search', params)
return req.get('/goods/items', params)
}
export function searchHotKey (params = {}) {
// return req.get('/item.search', params)
return req.get('/goods/keywords', params)
}
export function detail (item_id, params = {}) {
return req.get(`/goods/items/${item_id}`, params)

View File

@ -49,7 +49,6 @@ export default class GoodsEvaluation extends Component {
}
fortmatStr (desc) {
console.log("🚀 ~ GoodsEvaluation ~ desc:", desc)
let desc_info = '颜色分类:'
if (desc) {
try {
@ -106,7 +105,7 @@ export default class GoodsEvaluation extends Component {
</View>
<View className='evaluation-item__main'>
<View className='name-wrap'>
<View className='name'>{info.anonymous ? '匿名用户' : info.username}
<View className='name'>{'匿名用户' || info.anonymous ? '匿名用户' : info.username}
<Text style={{ marginLeft: '10rpx' }}>{info.item_spec_desc_txt}</Text>
</View>
<AtRate size='14' value={info.star} />

View File

@ -111,7 +111,7 @@ export default class SearchBar extends Component {
}
handleClickHotItem = (item) => {
this.handleConfirm({ detail: { value: item.tit } })
this.handleConfirm({ detail: { value: item } })
}
handleBlurSearch = () => {
@ -123,7 +123,7 @@ export default class SearchBar extends Component {
}
render () {
const { isFixed, keyword, showDailog, placeholder } = this.props
const { isFixed, keyword, showDailog, placeholder, hotSearch } = this.props
const { showSearchDailog, historyList, isShowAction, searchValue } = this.state
return (
<View
@ -230,8 +230,8 @@ export default class SearchBar extends Component {
<Text className='hot-title__desc'>近期大家搜索最多</Text>
</View>
<View className='hot-list'>
{[{ tit: '#测试数据' }].map((item, index) => <View className='hot-list__item' onClick={this.handleClickHotItem.bind(this, item)} key={index}>
<Text>{item.tit}</Text>
{hotSearch.map((item, index) => <View className='hot-list__item' onClick={this.handleClickHotItem.bind(this, item.content)} key={index}>
<Text>{item.content ? '#' + item.content : ''}</Text>
{/* <View className='at-icon at-icon-chevron-right'></View> */}
</View>)}
</View>

View File

@ -98,12 +98,15 @@
padding: 40px 30px;
&__item {
padding: 24px 42px;
margin-right: 30px 30px 0 0;
margin: 0 20px 20px 0;
text-align: center;
display: inline-block;
color: #000;
background-color: #9e9e9e40;
border-radius: 6px;
// &:nth-child(3n) {
// margin-right: 0;
// }
}
.at-icon {
font-size: 40px;

View File

@ -1097,7 +1097,7 @@ function CartCheckout (props) {
)}
{!bargain_id && (
<View>
<View style={{ marginBottom: '40rpx' }}>
<SpCell
isLink
className='cart-checkout__pay'

View File

@ -53,7 +53,7 @@ function CompEvaluation (props) {
</View> */}
<View className='evaluation-bd'>
{list.map((item) => (
<View className='evaluation-item-wrap'>
<View className='evaluation-item-wrap' onClick={onViewMore}>
<View className='item-hd'>
<SpImage src={item.avatar} className='evaluation-icon' width={50} height={50} />
<Text className='evaluation-name'>{'匿名用户' || item.username}

View File

@ -1,7 +1,7 @@
.comp-evaluation {
// margin: 0 16px;
background-color: #fff;
padding: 0 30px;
// padding: 0 30px;
// box-shadow: 0px 2px 10px 0px #eae7e0;
.evaluation-hd {
display: flex;

View File

@ -50,6 +50,7 @@ const initialState = {
routerParams: null,
card_id: null, // 兑换券
total: undefined,
historyList: []
}
function ItemList () {
@ -68,7 +69,8 @@ function ItemList () {
show,
fixTop,
routerParams,
total
total,
historyList
} = state
const [isShowSearch, setIsShowSearch] = useState(false)
const { cat_id, main_cat_id, tag_id, card_id, user_card_id } = routerParams || {}
@ -202,7 +204,6 @@ function ItemList () {
select_tags_list = [],
brand_list
} = await api.item.search(params)
console.time('list render')
console.log('fetch list:', list)
const n_list = pickBy(list, doc.goods.ITEM_LIST_GOODS)
const resLeftList = n_list.filter((item, index) => {
@ -216,12 +217,14 @@ function ItemList () {
}
})
console.timeEnd('list render')
const _historyList = await api.item.searchHotKey({ distributor_id: 0, page: 1, pageSize: 10 })
setState((v) => {
v.total = total_count
v.leftList[pageIndex - 1] = resLeftList
v.rightList[pageIndex - 1] = resRightList
v.brandList = pickBy(brand_list?.list, doc.goods.WGT_GOODS_BRAND)
v.historyList = _historyList?.list || []
if (v.tagList.length < 1) {
if (select_tags_list.length > 0) {
v.tagList = [
@ -266,12 +269,13 @@ function ItemList () {
})
}
const handleConfirm = async (val) => {
const handleConfirm = (val) => {
setIsShowSearch(false)
await setState((draft) => {
setState((draft) => {
draft.leftList = []
draft.rightList = []
draft.keywords = val
// draft.keywords = ''
})
goodsRef.current.reset()
}
@ -354,10 +358,11 @@ function ItemList () {
<SpSearchBar
className='search-wrap'
keyword={keywords}
hotSearch={historyList}
placeholder='搜索商品'
isOpened={true}
onFocus={handleOnFocus}
onBlur={() => handleConfirm(keywords)}
// onBlur={() => handleConfirm('')}
onChange={handleOnChange}
onClear={handleOnClear}
onCancel={handleSearchOff}

View File

@ -756,7 +756,7 @@ export default class TradeDetail extends Component {
</View>
)}
<ScrollView scroll-y className='scroll-view' scrollIntoView={scrollIntoView}>
<ScrollView scroll-y className='scroll-view' style={{ bottom: info.status === 'WAIT_BUYER_PAY' || info.can_apply_aftersales === 1 || info.status === 'WAIT_BUYER_CONFIRM_GOODS' ? '140rpx' : '40rpx' }} scrollIntoView={scrollIntoView}>
{false && <View className='trade-detail-header' id='order-0'>
<View className='trade-detail-waitdeliver'>
{info.is_logistics && <View className='oneline'>线上订单</View>}

View File

@ -304,8 +304,11 @@ function TradeAfterSale (props) {
}
>
{!afterSaleTid ? <View className="after-item">
<View className="after-item-label">请选择售后类型:</View>
<Picker
<View className="after-item-label">售后类型:</View>
<View className="after-item-input">
<View className="input-txt color-hui">{tabList[curTabIdx] ? tabList[curTabIdx].title : '请选择售后类型'}</View>
</View>
{/* <Picker
mode='selector'
range={tabList.map(item => item.title)}
onChange={(e) => {
@ -318,7 +321,7 @@ function TradeAfterSale (props) {
<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>
</Picker> */}
</View> : aftersales.progress >= 0 && 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' }}>
@ -441,7 +444,7 @@ function TradeAfterSale (props) {
</View>
<View className="after-item mt-40" style={{ marginTop: '60rpx' }}>
<View className="after-item-label color-hui">退货原因</View>
<View className="after-item-label color-hui">退货原因*</View>
{!afterSaleTid ? <Picker
mode='selector'
range={reasons}