修复已知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('/item.search', params)
return req.get('/goods/items', 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 = {}) { export function detail (item_id, params = {}) {
return req.get(`/goods/items/${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) { fortmatStr (desc) {
console.log("🚀 ~ GoodsEvaluation ~ desc:", desc)
let desc_info = '颜色分类:' let desc_info = '颜色分类:'
if (desc) { if (desc) {
try { try {
@ -106,7 +105,7 @@ export default class GoodsEvaluation extends Component {
</View> </View>
<View className='evaluation-item__main'> <View className='evaluation-item__main'>
<View className='name-wrap'> <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> <Text style={{ marginLeft: '10rpx' }}>{info.item_spec_desc_txt}</Text>
</View> </View>
<AtRate size='14' value={info.star} /> <AtRate size='14' value={info.star} />

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -756,7 +756,7 @@ export default class TradeDetail extends Component {
</View> </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'> {false && <View className='trade-detail-header' id='order-0'>
<View className='trade-detail-waitdeliver'> <View className='trade-detail-waitdeliver'>
{info.is_logistics && <View className='oneline'>线上订单</View>} {info.is_logistics && <View className='oneline'>线上订单</View>}

View File

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