mirror of
https://gitee.com/ShopeX/ECShopX_mobile-frontend
synced 2026-08-09 21:45:57 +08:00
[TBID:ECX-9664] chore: merge master changes for release
This commit is contained in:
@@ -11,7 +11,8 @@ export const CATEGORY_LIST = {
|
||||
hot: 'hot',
|
||||
id: 'id',
|
||||
category_id: 'category_id',
|
||||
main_category_id: 'main_category_id'
|
||||
main_category_id: 'main_category_id',
|
||||
is_main_category: 'is_main_category'
|
||||
}
|
||||
|
||||
export const CATEGORY_STORE_LIST = {
|
||||
|
||||
@@ -96,9 +96,17 @@ function CategoryFlatLayout() {
|
||||
console.log('query', item)
|
||||
}
|
||||
|
||||
const buildListUrl = (item) => {
|
||||
const cateName = encodeURIComponent(item.category_name || '')
|
||||
if (item.is_main_category === true) {
|
||||
return `/subpages/item/list?main_cat_id=${item.category_id}&cate_name=${cateName}&hide_search=1`
|
||||
}
|
||||
return `/subpages/item/list?cat_id=${item.category_id}&cate_name=${cateName}&hide_search=1`
|
||||
}
|
||||
|
||||
const handleSubCategoryClick = (item, pindex, index, category_name) => {
|
||||
Taro.navigateTo({
|
||||
url: `/subpages/item/list?cat_id=${item.category_id}&cate_name=${item.category_name}&hide_search=1`
|
||||
url: buildListUrl(item)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -142,7 +150,7 @@ function CategoryFlatLayout() {
|
||||
className='flex justify-between pt-48 pb-24 pl-32 pr-32'
|
||||
onClick={() => {
|
||||
Taro.navigateTo({
|
||||
url: `/subpages/item/list?cat_id=${category.category_id}&cate_name=${category.category_name}&hide_search=1`
|
||||
url: buildListUrl(category)
|
||||
})
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -21,15 +21,14 @@ const CompSeries = (props) => {
|
||||
}, [info])
|
||||
|
||||
const handleClickItem = (item) => {
|
||||
const { category_id, main_category_id } = item
|
||||
const { category_id, main_category_id, is_main_category } = item
|
||||
console.log('item', item)
|
||||
let url = ''
|
||||
if (category_id) {
|
||||
if (is_main_category === true || main_category_id) {
|
||||
url = `/subpages/item/list?main_cat_id=${main_category_id || category_id}&all=true`
|
||||
} else if (category_id) {
|
||||
url = `/subpages/item/list?cat_id=${category_id}&all=true`
|
||||
}
|
||||
if (main_category_id) {
|
||||
url = `/subpages/item/list?main_cat_id=${main_category_id}&all=true`
|
||||
}
|
||||
if (url) {
|
||||
Taro.navigateTo({
|
||||
url
|
||||
|
||||
@@ -39,7 +39,7 @@ const initialState = {
|
||||
goodsSort: 0,
|
||||
seriesList: [],
|
||||
cat_id: undefined,
|
||||
cat_type: undefined,
|
||||
is_main_category: false,
|
||||
show: false,
|
||||
secondList: [],
|
||||
thirdList: [],
|
||||
@@ -65,7 +65,7 @@ function CompsCategoryAddCart(props) {
|
||||
categorySecondIndex,
|
||||
categoryThirdIndex,
|
||||
cat_id,
|
||||
cat_type,
|
||||
is_main_category,
|
||||
secondList,
|
||||
thirdList,
|
||||
info,
|
||||
@@ -196,21 +196,21 @@ function CompsCategoryAddCart(props) {
|
||||
name: 'category_name',
|
||||
img: 'image_url',
|
||||
id: 'category_id',
|
||||
type: !VERSION_PLATFORM,
|
||||
category_id: 'category_id',
|
||||
is_main_category: 'is_main_category',
|
||||
children: ({ children }) =>
|
||||
pickBy(children, {
|
||||
name: 'category_name',
|
||||
img: 'image_url',
|
||||
id: 'category_id',
|
||||
type: !VERSION_PLATFORM,
|
||||
category_id: 'category_id',
|
||||
is_main_category: 'is_main_category',
|
||||
children: ({ children: children_ }) =>
|
||||
pickBy(children_, {
|
||||
name: 'category_name',
|
||||
img: 'image_url',
|
||||
type: !VERSION_PLATFORM,
|
||||
id: 'category_id'
|
||||
id: 'category_id',
|
||||
is_main_category: 'is_main_category'
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -219,7 +219,7 @@ function CompsCategoryAddCart(props) {
|
||||
draft.seriesList = currentList
|
||||
draft.hasSeries = true
|
||||
draft.cat_id = currentList[0]?.id
|
||||
draft.cat_type = currentList[0]?.type
|
||||
draft.is_main_category = currentList[0]?.is_main_category === true
|
||||
})
|
||||
}
|
||||
|
||||
@@ -237,10 +237,10 @@ function CompsCategoryAddCart(props) {
|
||||
// category_id: cat_id,
|
||||
v_store: cusIndex
|
||||
}
|
||||
if (cat_type) {
|
||||
params.category_id = cat_id
|
||||
if (is_main_category === true) {
|
||||
params.main_category = cat_id
|
||||
} else {
|
||||
params.category = cat_id
|
||||
params.category_id = cat_id
|
||||
}
|
||||
|
||||
const { list: _list, total_count } = await api.item.search(params)
|
||||
@@ -278,7 +278,7 @@ function CompsCategoryAddCart(props) {
|
||||
draft.categoryThirdIndex = 0
|
||||
draft.allList = []
|
||||
draft.cat_id = seriesList[index]?.id
|
||||
draft.cat_type = seriesList[index]?.type
|
||||
draft.is_main_category = seriesList[index]?.is_main_category === true
|
||||
})
|
||||
}, 200)
|
||||
|
||||
@@ -289,7 +289,10 @@ function CompsCategoryAddCart(props) {
|
||||
draft.categoryThirdIndex = 0
|
||||
draft.allList = []
|
||||
draft.cat_id = index == 0 ? seriesList[categoryFirstIndex]?.id : secondList[index]?.id
|
||||
draft.cat_type = index == 0 ? seriesList[categoryFirstIndex]?.type : secondList[index]?.type
|
||||
draft.is_main_category =
|
||||
index == 0
|
||||
? seriesList[categoryFirstIndex]?.is_main_category === true
|
||||
: secondList[index]?.is_main_category === true
|
||||
})
|
||||
}, 200)
|
||||
|
||||
@@ -299,7 +302,10 @@ function CompsCategoryAddCart(props) {
|
||||
draft.categoryThirdIndex = index
|
||||
draft.allList = []
|
||||
draft.cat_id = index == 0 ? secondList[categorySecondIndex]?.id : thirdList[index]?.id
|
||||
draft.cat_type = index == 0 ? secondList[categorySecondIndex]?.type : thirdList[index]?.type
|
||||
draft.is_main_category =
|
||||
index == 0
|
||||
? secondList[categorySecondIndex]?.is_main_category === true
|
||||
: thirdList[index]?.is_main_category === true
|
||||
})
|
||||
}, 200)
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ const CompsCategoryTile = (props) => {
|
||||
id: 'id',
|
||||
category_id: 'category_id',
|
||||
main_category_id: 'main_category_id',
|
||||
is_main_category: 'is_main_category',
|
||||
children: ({ children }) =>
|
||||
pickBy(children, {
|
||||
name: 'category_name',
|
||||
@@ -68,12 +69,14 @@ const CompsCategoryTile = (props) => {
|
||||
id: 'id',
|
||||
category_id: 'category_id',
|
||||
main_category_id: 'main_category_id',
|
||||
is_main_category: 'is_main_category',
|
||||
children: ({ children }) =>
|
||||
pickBy(children, {
|
||||
name: 'category_name',
|
||||
img: 'image_url',
|
||||
category_id: 'category_id',
|
||||
main_category_id: 'main_category_id'
|
||||
main_category_id: 'main_category_id',
|
||||
is_main_category: 'is_main_category'
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -32,7 +32,7 @@ function WgtClassify(props) {
|
||||
} else {
|
||||
//销售分类
|
||||
Taro.navigateTo({
|
||||
url: `/subpages/item/list?category_id=${category_id}&store_ids=${store_ids}&hide_search=1`
|
||||
url: `/subpages/item/list?cat_id=${category_id}&store_ids=${store_ids}&hide_search=1`
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ function WgtClassify(props) {
|
||||
} else {
|
||||
//销售分类
|
||||
Taro.navigateTo({
|
||||
url: `/subpages/item/list?category_id=${category_id}&store_ids=${store_ids}&hide_search=1`
|
||||
url: `/subpages/item/list?cat_id=${category_id}&store_ids=${store_ids}&hide_search=1`
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,12 +128,22 @@ function ItemList() {
|
||||
|
||||
useEffect(() => {
|
||||
// card_id, user_card_id: 兑换券参数
|
||||
entryLaunch.getRouteParams($instance?.router?.params).then((params) => {
|
||||
const { cat_id, keywords, main_cat_id, tag_id, card_id, user_card_id, all = false } = params
|
||||
// 分类挂件跳转传 category_id,兼容历史 cat_id
|
||||
entryLaunch.getRouteParams({ params: $instance?.router?.params }).then((params) => {
|
||||
const {
|
||||
cat_id,
|
||||
category_id,
|
||||
keywords,
|
||||
main_cat_id,
|
||||
tag_id,
|
||||
card_id,
|
||||
user_card_id,
|
||||
all = false
|
||||
} = params
|
||||
|
||||
setState((draft) => {
|
||||
draft.routerParams = {
|
||||
cat_id,
|
||||
cat_id: cat_id || category_id,
|
||||
keywords,
|
||||
main_cat_id,
|
||||
tag_id,
|
||||
|
||||
@@ -110,12 +110,13 @@ function ItemList() {
|
||||
|
||||
useEffect(() => {
|
||||
// card_id, user_card_id: 兑换券参数
|
||||
entryLaunch.getRouteParams($instance?.router?.params).then((params) => {
|
||||
const { cat_id, main_cat_id, tag_id, card_id, user_card_id } = params
|
||||
// 分类挂件跳转传 category_id,兼容历史 cat_id
|
||||
entryLaunch.getRouteParams({ params: $instance?.router?.params || router?.params }).then((params) => {
|
||||
const { cat_id, category_id, main_cat_id, tag_id, card_id, user_card_id } = params
|
||||
|
||||
setState((draft) => {
|
||||
draft.routerParams = {
|
||||
cat_id,
|
||||
cat_id: cat_id || category_id,
|
||||
main_cat_id,
|
||||
tag_id,
|
||||
card_id,
|
||||
@@ -232,7 +233,7 @@ function ItemList() {
|
||||
}
|
||||
|
||||
if (main_cat_id) {
|
||||
params['main_category'] = main_cat_id
|
||||
params['main_cat_id'] = main_cat_id
|
||||
}
|
||||
|
||||
if (VERSION_STANDARD) {
|
||||
|
||||
@@ -28,7 +28,7 @@ const initialState = {
|
||||
goodsSort: 0,
|
||||
seriesList: [],
|
||||
cat_id: undefined,
|
||||
show: false,
|
||||
is_main_category: false,
|
||||
secondList: [],
|
||||
thirdList: []
|
||||
}
|
||||
@@ -49,6 +49,7 @@ function StoreItemList(props) {
|
||||
categorySecondIndex,
|
||||
categoryThirdIndex,
|
||||
cat_id,
|
||||
is_main_category,
|
||||
secondList,
|
||||
thirdList
|
||||
} = state
|
||||
@@ -81,17 +82,20 @@ function StoreItemList(props) {
|
||||
img: 'image_url',
|
||||
id: 'category_id',
|
||||
category_id: 'category_id',
|
||||
is_main_category: 'is_main_category',
|
||||
children: ({ children }) =>
|
||||
pickBy(children, {
|
||||
name: 'category_name',
|
||||
img: 'image_url',
|
||||
id: 'category_id',
|
||||
category_id: 'category_id',
|
||||
is_main_category: 'is_main_category',
|
||||
children: ({ children: children_ }) =>
|
||||
pickBy(children_, {
|
||||
name: 'category_name',
|
||||
img: 'image_url',
|
||||
id: 'category_id'
|
||||
id: 'category_id',
|
||||
is_main_category: 'is_main_category'
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -99,6 +103,7 @@ function StoreItemList(props) {
|
||||
draft.seriesList = currentList
|
||||
draft.hasSeries = true
|
||||
draft.cat_id = currentList[0].id
|
||||
draft.is_main_category = currentList[0]?.is_main_category === true
|
||||
})
|
||||
}
|
||||
|
||||
@@ -114,9 +119,13 @@ function StoreItemList(props) {
|
||||
distributor_id: dtid,
|
||||
// distributor_id: dis_id || Taro.getStorageSync('distributor_id'),
|
||||
goodsSort,
|
||||
category_id: cat_id,
|
||||
v_store: cusIndex
|
||||
}
|
||||
if (is_main_category === true) {
|
||||
params.main_category = cat_id
|
||||
} else {
|
||||
params.category_id = cat_id
|
||||
}
|
||||
|
||||
const { list: _list, total_count } = await api.item.search(params)
|
||||
|
||||
@@ -153,6 +162,7 @@ function StoreItemList(props) {
|
||||
draft.categoryThirdIndex = 0
|
||||
draft.allList = []
|
||||
draft.cat_id = seriesList[index]?.id
|
||||
draft.is_main_category = seriesList[index]?.is_main_category === true
|
||||
})
|
||||
}, 200)
|
||||
|
||||
@@ -163,6 +173,10 @@ function StoreItemList(props) {
|
||||
draft.categoryThirdIndex = 0
|
||||
draft.allList = []
|
||||
draft.cat_id = index == 0 ? seriesList[categoryFirstIndex]?.id : secondList[index]?.id
|
||||
draft.is_main_category =
|
||||
index == 0
|
||||
? seriesList[categoryFirstIndex]?.is_main_category === true
|
||||
: secondList[index]?.is_main_category === true
|
||||
})
|
||||
}, 200)
|
||||
|
||||
@@ -172,6 +186,10 @@ function StoreItemList(props) {
|
||||
draft.categoryThirdIndex = index
|
||||
draft.allList = []
|
||||
draft.cat_id = index == 0 ? secondList[categorySecondIndex]?.id : thirdList[index]?.id
|
||||
draft.is_main_category =
|
||||
index == 0
|
||||
? secondList[categorySecondIndex]?.is_main_category === true
|
||||
: thirdList[index]?.is_main_category === true
|
||||
})
|
||||
}, 200)
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@ import {
|
||||
SpRecommend,
|
||||
SpSkuSelect,
|
||||
SpLogin,
|
||||
SpPoweredBy
|
||||
SpPoweredBy,
|
||||
SpImage
|
||||
} from '@/components'
|
||||
import api from '@/api'
|
||||
import doc from '@/doc'
|
||||
@@ -63,7 +64,9 @@ const initState = {
|
||||
open: false,
|
||||
hideClose: true,
|
||||
/** 页面滚动超过 20px 时搜索条白底 */
|
||||
searchSolidBg: false
|
||||
searchSolidBg: false,
|
||||
/** 自定义导航高度,沉浸式时用于顶起搜索/头图内容 */
|
||||
navbarHeight: 0
|
||||
}
|
||||
|
||||
function StoreIndex() {
|
||||
@@ -87,7 +90,8 @@ function StoreIndex() {
|
||||
skuPanelOpen,
|
||||
selectType,
|
||||
open,
|
||||
searchSolidBg
|
||||
searchSolidBg,
|
||||
navbarHeight
|
||||
} = state
|
||||
|
||||
const dispatch = useDispatch()
|
||||
@@ -347,7 +351,19 @@ function StoreIndex() {
|
||||
scrollToTopBtn
|
||||
ref={pageRef}
|
||||
showpoweredBy={false}
|
||||
pageConfig={pageData?.base}
|
||||
immersive
|
||||
pageConfig={{
|
||||
...(pageData?.base || {}),
|
||||
// 未滚动时导航透明,让店铺 banner 顶到屏幕顶部
|
||||
navigateBackgroundColor: searchSolidBg
|
||||
? pageData?.base?.navigateBackgroundColor || '#fff'
|
||||
: 'transparent'
|
||||
}}
|
||||
onReady={({ gNavbarH }) => {
|
||||
setState((draft) => {
|
||||
draft.navbarHeight = gNavbarH || 0
|
||||
})
|
||||
}}
|
||||
renderFloat={
|
||||
<View>
|
||||
<SpFloatMenuItem
|
||||
@@ -384,6 +400,7 @@ function StoreIndex() {
|
||||
className={classNames('search', {
|
||||
'search--solid': searchSolidBg
|
||||
})}
|
||||
style={navbarHeight ? { top: `${navbarHeight}px` } : undefined}
|
||||
>
|
||||
<SpSearch
|
||||
// isFixTop={searchComp?.config?.fixTop}
|
||||
@@ -397,10 +414,21 @@ function StoreIndex() {
|
||||
</View>
|
||||
)}
|
||||
|
||||
<View
|
||||
className={searchComp ? 'header-block' : 'header-block-pad'}
|
||||
style={{ background: `url('${storeInfo?.banner}') no-repeat center center / cover` }}
|
||||
>
|
||||
<View className={searchComp ? 'header-block' : 'header-block-pad'}>
|
||||
{/* widthFix:按原图比例完整展示,高度随图片自适应 */}
|
||||
{storeInfo?.banner ? (
|
||||
<SpImage
|
||||
className='store-banner'
|
||||
src={storeInfo.banner}
|
||||
mode='widthFix'
|
||||
width={750}
|
||||
/>
|
||||
) : (
|
||||
<View
|
||||
className='store-banner store-banner--empty'
|
||||
style={navbarHeight ? { paddingTop: `${navbarHeight}px` } : undefined}
|
||||
/>
|
||||
)}
|
||||
<CompShopBrand storeInfo={storeInfo} dtid={distributorId} />
|
||||
</View>
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
.search {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 2;
|
||||
@@ -65,14 +66,28 @@
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.header-block {
|
||||
padding-top: 150px;
|
||||
// background: transparent;
|
||||
// box-shadow: inset 0px -242px 700px 0px rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
|
||||
.header-block,
|
||||
.header-block-pad {
|
||||
padding-top: 80px;
|
||||
position: relative;
|
||||
|
||||
.store-banner {
|
||||
width: 100%;
|
||||
display: block;
|
||||
vertical-align: top;
|
||||
|
||||
&--empty {
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
}
|
||||
|
||||
// 店铺信息卡叠在 banner 底部,保留原圆角压图效果
|
||||
.comp-shop-brand {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin-top: -48px;
|
||||
}
|
||||
}
|
||||
|
||||
.icon-huiyuanzhongxin {
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
* Copyright © ShopeX (http://www.shopex.cn). All rights reserved.
|
||||
* See LICENSE file for license details.
|
||||
*/
|
||||
import React, { useEffect, useRef, useMemo } from 'react'
|
||||
import React, { useEffect, useRef, useMemo, useCallback } from 'react'
|
||||
import { useSelector } from 'react-redux'
|
||||
import Taro, { useRouter } from '@tarojs/taro'
|
||||
import Taro, { useRouter, useDidShow } from '@tarojs/taro'
|
||||
import { View, ScrollView } from '@tarojs/components'
|
||||
import { AtButton } from 'taro-ui'
|
||||
import { useImmer } from 'use-immer'
|
||||
import { SpPage, SpScrollView, SpSearchBar } from '@/components'
|
||||
import { SpTagBar } from '@/subpages/components'
|
||||
@@ -24,15 +23,22 @@ const initialState = {
|
||||
typeVal: '0',
|
||||
tradeList: [],
|
||||
refresherTriggered: false,
|
||||
order_id: '',
|
||||
selectAftersn: []
|
||||
order_id: ''
|
||||
}
|
||||
function TradeAfterSaleList(props) {
|
||||
useTranslation()
|
||||
const { setNavigationBarTitle } = useNavigation()
|
||||
const [state, setState] = useImmer(initialState)
|
||||
const { status, tradeList, refresherTriggered, typeVal, order_id, selectAftersn } = state
|
||||
const { status, tradeList, refresherTriggered, typeVal, order_id } = state
|
||||
const tradeRef = useRef()
|
||||
const needRefreshRef = useRef(false)
|
||||
|
||||
const refreshList = useCallback(() => {
|
||||
setState((draft) => {
|
||||
draft.tradeList = []
|
||||
})
|
||||
tradeRef.current?.reset()
|
||||
}, [setState])
|
||||
|
||||
const tradeStatus = useMemo(
|
||||
() => [
|
||||
@@ -53,19 +59,26 @@ function TradeAfterSaleList(props) {
|
||||
}, [setNavigationBarTitle])
|
||||
|
||||
useEffect(() => {
|
||||
// 撤销售后事件
|
||||
Taro.eventCenter.on('onEventAfterSalesCancel', () => {
|
||||
setState((draft) => {
|
||||
draft.tradeList = []
|
||||
})
|
||||
tradeRef.current.reset()
|
||||
})
|
||||
const handleRefresh = () => {
|
||||
needRefreshRef.current = true
|
||||
}
|
||||
// 撤销售后 / 填写物流回寄成功后刷新列表
|
||||
Taro.eventCenter.on('onEventAfterSalesCancel', handleRefresh)
|
||||
Taro.eventCenter.on('onEventAfterSalesSendback', handleRefresh)
|
||||
|
||||
return () => {
|
||||
Taro.eventCenter.off('onEventAfterSalesCancel')
|
||||
Taro.eventCenter.off('onEventAfterSalesCancel', handleRefresh)
|
||||
Taro.eventCenter.off('onEventAfterSalesSendback', handleRefresh)
|
||||
}
|
||||
}, [])
|
||||
|
||||
useDidShow(() => {
|
||||
if (needRefreshRef.current) {
|
||||
needRefreshRef.current = false
|
||||
refreshList()
|
||||
}
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
setState((draft) => {
|
||||
draft.tradeList = []
|
||||
@@ -94,7 +107,6 @@ function TradeAfterSaleList(props) {
|
||||
const onChangeTradeState = (e) => {
|
||||
setState((draft) => {
|
||||
draft.status = tradeStatus[e].value
|
||||
draft.selectAftersn = []
|
||||
})
|
||||
}
|
||||
|
||||
@@ -135,46 +147,8 @@ function TradeAfterSaleList(props) {
|
||||
await tradeRef.current.reset()
|
||||
}
|
||||
|
||||
const onSelect = (sn) => {
|
||||
let list = [...selectAftersn]
|
||||
const index = list.indexOf(sn)
|
||||
if (index > -1) {
|
||||
list.splice(index, 1)
|
||||
} else {
|
||||
list.push(sn)
|
||||
}
|
||||
setState((draft) => {
|
||||
draft.selectAftersn = list
|
||||
})
|
||||
}
|
||||
|
||||
const onSubmit = () => {
|
||||
console.log(tradeList, selectAftersn)
|
||||
const fliterList = tradeList?.filter(
|
||||
(item) => selectAftersn.includes(item.aftersalesBn) && item.aftersalesAddress
|
||||
)
|
||||
debugger
|
||||
const address = fliterList[0].aftersalesAddress
|
||||
Taro.setStorageSync('moreAftersalesBn', {
|
||||
aftersalesBn: selectAftersn,
|
||||
address
|
||||
})
|
||||
Taro.navigateTo({ url: `/subpages/trade/logistics-info?type=more` })
|
||||
}
|
||||
|
||||
const renderFooter = () => {
|
||||
if (status != '1') return null
|
||||
return (
|
||||
<View className='btn-wrap'>
|
||||
<AtButton circle type='primary' disabled={selectAftersn.length === 0} onClick={onSubmit}>
|
||||
{$t('b1e93f22.ba7290')}
|
||||
</AtButton>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<SpPage className='page-trade-aftersale-list' renderFooter={renderFooter()}>
|
||||
<SpPage className='page-trade-aftersale-list'>
|
||||
<View className='search-bar-container'>
|
||||
<SpSearchBar
|
||||
keyword={order_id}
|
||||
@@ -205,12 +179,7 @@ function TradeAfterSaleList(props) {
|
||||
>
|
||||
{tradeList.map((item, index) => (
|
||||
<View className='trade-item-wrap' key={index}>
|
||||
<CompAfterTradeItem
|
||||
info={item}
|
||||
selectAftersn={selectAftersn}
|
||||
isShowChecked={status == '1' && item.progress == 1}
|
||||
onSelect={onSelect}
|
||||
/>
|
||||
<CompAfterTradeItem info={item} />
|
||||
</View>
|
||||
))}
|
||||
</SpScrollView>
|
||||
|
||||
@@ -32,4 +32,8 @@ $tag-bar-height: 90px;
|
||||
.comp-tradeitem .shop-info .shop-name {
|
||||
width: 400px;
|
||||
}
|
||||
.btn-wrap {
|
||||
width: 80%;
|
||||
margin: 20px auto;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import { useSelector } from 'react-redux'
|
||||
import Taro from '@tarojs/taro'
|
||||
import { View, Text } from '@tarojs/components'
|
||||
import { AtButton } from 'taro-ui'
|
||||
import { SpImage, SpPrice, SpTradeItem, SpCheckboxNew, SpPoint } from '@/components'
|
||||
import { SpImage, SpPrice, SpTradeItem, SpPoint } from '@/components'
|
||||
import { VERSION_STANDARD } from '@/utils'
|
||||
import { useTranslation, $t, ti } from '@/i18n'
|
||||
import { AFTER_SALE_STATUS } from '@/consts'
|
||||
@@ -16,7 +16,7 @@ import './comp-aftertrade-item.scss'
|
||||
function CompTradeItem(props) {
|
||||
useTranslation()
|
||||
const { pointName } = useSelector((state) => state.sys)
|
||||
const { info, isShowChecked = false, selectAftersn = [], onSelect = () => {} } = props
|
||||
const { info } = props
|
||||
if (!info) {
|
||||
return null
|
||||
}
|
||||
@@ -67,7 +67,7 @@ function CompTradeItem(props) {
|
||||
<View>
|
||||
<View className='shop-info' onClick={onViewStorePage}>
|
||||
<SpImage src={distributorInfo?.logo} width={100} height={100} />
|
||||
<View className='shop-name'>
|
||||
<View className='shop-name nochecked'>
|
||||
{distributorInfo?.name}
|
||||
{!VERSION_STANDARD && <Text className='iconfont icon-qianwang-01'></Text>}
|
||||
</View>
|
||||
|
||||
@@ -74,9 +74,15 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.aftersale-checkbox {
|
||||
margin-right: 24px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.sp-image {
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
margin-right: 16px;
|
||||
}
|
||||
.nochecked {
|
||||
margin-left: 0px !important;
|
||||
|
||||
@@ -76,9 +76,11 @@ function TradeLogisticsInfo(props) {
|
||||
aftersales_data: aftersInfo?.aftersalesBn
|
||||
})
|
||||
showToast($t('3d2b7bcd.33130f'))
|
||||
Taro.eventCenter.trigger('onEventAfterSalesSendback')
|
||||
setTimeout(() => {
|
||||
// 批量:列表→物流 回 1 层;单笔:详情→物流 回 2 层到列表
|
||||
Taro.navigateBack({
|
||||
delta: 2
|
||||
delta: type == 'more' ? 1 : 2
|
||||
})
|
||||
}, 1000)
|
||||
} catch (error) {
|
||||
|
||||
@@ -58,9 +58,17 @@ class EntryLaunch {
|
||||
const routerParams = $instance?.router?.params || {}
|
||||
const h5Query = Taro.getEnv() === Taro.ENV_TYPE.WEB ? getH5LocationQuery() : {}
|
||||
// H5 useDidShow(options) 往往不含 query,需合并 location / 实时 router
|
||||
// 兼容直接传入扁平 params:getRouteParams(router.params)
|
||||
const isFlatParams =
|
||||
options &&
|
||||
typeof options === 'object' &&
|
||||
!options.params &&
|
||||
!options.query &&
|
||||
!options.path
|
||||
const params = {
|
||||
...h5Query,
|
||||
...routerParams,
|
||||
...(isFlatParams ? options : {}),
|
||||
...(options?.params || {}),
|
||||
...(options?.query && typeof options.query === 'object' && !Array.isArray(options.query)
|
||||
? options.query
|
||||
|
||||
Reference in New Issue
Block a user