优化滚动
This commit is contained in:
parent
f30e174e3e
commit
8112d38499
@ -29,3 +29,34 @@ export const SaleOrderApi = () => {
|
|||||||
method: "get",
|
method: "get",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改销售单备注
|
||||||
|
*/
|
||||||
|
export const EditSaleOrderRemarkApi = () => {
|
||||||
|
return useRequest({
|
||||||
|
url: `/v1/mall/saleOrder/remark`,
|
||||||
|
method: "put",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改销售单地址
|
||||||
|
*/
|
||||||
|
export const EditSaleOrderAddressApi = () => {
|
||||||
|
return useRequest({
|
||||||
|
url: `/v1/mall/saleOrder/address`,
|
||||||
|
method: "put",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改销售单收货方法
|
||||||
|
*/
|
||||||
|
export const EditSaleOrderShipmentModeApi = () => {
|
||||||
|
return useRequest({
|
||||||
|
url: `/v1/mall/saleOrder/shipmentMode`,
|
||||||
|
method: "put",
|
||||||
|
})
|
||||||
|
}
|
@ -5,8 +5,8 @@
|
|||||||
// export const BASE_URL = `http://192.168.0.89:40001/lymarket`
|
// export const BASE_URL = `http://192.168.0.89:40001/lymarket`
|
||||||
// export const BASE_URL = `http://192.168.1.165:40001/lymarket` // 王霞
|
// export const BASE_URL = `http://192.168.1.165:40001/lymarket` // 王霞
|
||||||
// export const BASE_URL = `https://test.zzfzyc.com/lymarket` // 测试环境
|
// export const BASE_URL = `https://test.zzfzyc.com/lymarket` // 测试环境
|
||||||
export const BASE_URL = `http://192.168.1.30:40001/lymarket` // 发
|
// export const BASE_URL = `http://192.168.1.30:40001/lymarket` // 发
|
||||||
// export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境
|
export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境
|
||||||
// export const BASE_URL = `https://www.zzfzyc.com/lymarket` // 正式环境
|
// export const BASE_URL = `https://www.zzfzyc.com/lymarket` // 正式环境
|
||||||
// export const BASE_URL = `http://192.168.1.4:40001/lymarket` // 王霞
|
// export const BASE_URL = `http://192.168.1.4:40001/lymarket` // 王霞
|
||||||
// export const BASE_URL = `http://192.168.1.224:50002/lymarket` // 添
|
// export const BASE_URL = `http://192.168.1.224:50002/lymarket` // 添
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export const debounce = (fn, delay) => {
|
export const debounce = (fn, delay) => {
|
||||||
let timer = null;
|
let timer:any = null;
|
||||||
return (...param) => {
|
return (...param) => {
|
||||||
if (timer) clearTimeout(timer);
|
if (timer) clearTimeout(timer);
|
||||||
timer = setTimeout(() => {
|
timer = setTimeout(() => {
|
||||||
@ -90,4 +90,17 @@ export const throttle = (fn, delay) => {
|
|||||||
*/
|
*/
|
||||||
export const screenshot = (url, suffix="!w200")=>{
|
export const screenshot = (url, suffix="!w200")=>{
|
||||||
return url+suffix;
|
return url+suffix;
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取数据加载状态 //0:数据从无到有加载数据,1,没有任何数据, 2:下拉加载,3:下拉没有数据
|
||||||
|
export const dataLoadingStatus = ({list = [], total = 0, status = false}:{list:any[], total:number, status:true|false}) => {
|
||||||
|
if(list.length == 0 && status) {
|
||||||
|
return 0
|
||||||
|
} else if (list.length == 0 && !status) {
|
||||||
|
return 1
|
||||||
|
} else if (list.length < total) {
|
||||||
|
return 2
|
||||||
|
} else {
|
||||||
|
return 3
|
||||||
|
}
|
||||||
}
|
}
|
@ -4,12 +4,14 @@ import style from "./index.module.scss"
|
|||||||
import DotLoading from "@/components/dotLoading"
|
import DotLoading from "@/components/dotLoading"
|
||||||
import LoadingCard from "../loadingCard"
|
import LoadingCard from "../loadingCard"
|
||||||
|
|
||||||
|
export type StatusParam = 0|1|2|3
|
||||||
|
|
||||||
type Params = {
|
type Params = {
|
||||||
styleObj?: Object,
|
styleObj?: Object,
|
||||||
selfonScrollToLower?: () => void,
|
selfonScrollToLower?: () => void,
|
||||||
hasMore?: false|true,
|
hasMore?: false|true,
|
||||||
moreStatus?: false|true,
|
moreStatus?: false|true,
|
||||||
statusMore?: 0|1|2, //0:没数据加载,1:下拉加载,2:没有数据
|
statusMore?: StatusParam //0:数据从无到有加载数据,1,没有任何数据, 2:下拉加载,3:下拉没有数据
|
||||||
children?: ReactNode,
|
children?: ReactNode,
|
||||||
lowerThresholdNum?: number,
|
lowerThresholdNum?: number,
|
||||||
selfOnScrollToUpper?:() => void
|
selfOnScrollToUpper?:() => void
|
||||||
@ -80,20 +82,28 @@ export default memo(({
|
|||||||
onRefresherAbort = {() => refresherAbort()}
|
onRefresherAbort = {() => refresherAbort()}
|
||||||
refresherBackground ='#F8F8F8'
|
refresherBackground ='#F8F8F8'
|
||||||
>
|
>
|
||||||
{(statusMore != 0)&&<View style={{paddingBottom:paddingBottom + 'rpx'}} className={style.scrollViewCon}>
|
{!moreStatus&&<>
|
||||||
{children}
|
<View style={{paddingBottom:paddingBottom + 'rpx'}} className={style.scrollViewCon}>
|
||||||
{moreStatus&&<View className={style.infinite_scroll}>
|
{children}
|
||||||
{
|
</View>
|
||||||
hasMore&&<View className={style.loading_more}>加载中<DotLoading/></View>||
|
</>||
|
||||||
<View>没有更多数据了</View>
|
<>
|
||||||
}
|
{(statusMore == 2 || statusMore == 3)&&<View style={{paddingBottom:paddingBottom + 'rpx'}} className={style.scrollViewCon}>
|
||||||
</View>}
|
{children}
|
||||||
</View>||
|
<View className={style.infinite_scroll}>
|
||||||
<LoadingCard/>
|
{
|
||||||
}
|
(statusMore == 2)&&<View className={style.loading_more}>加载中<DotLoading/></View>||
|
||||||
|
<View>没有更多数据了</View>
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
}
|
||||||
|
{(statusMore == 0)&&<LoadingCard/>}
|
||||||
|
{(statusMore == 1)&&<LoadingCard loadingIcon={false} title="暂无数据"/>}
|
||||||
|
</>}
|
||||||
|
|
||||||
<View className="common_safe_area_y"></View>
|
<View className="common_safe_area_y"></View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
})
|
})
|
@ -1,13 +1,12 @@
|
|||||||
import { ScrollView, View } from "@tarojs/components"
|
import { ScrollView, View } from "@tarojs/components"
|
||||||
import { memo, ReactNode, useEffect, useRef, useState } from "react"
|
import React, { memo, ReactNode, useEffect, useRef, useState } from "react"
|
||||||
import styles from "./index.module.scss"
|
import styles from "./index.module.scss"
|
||||||
import classnames from "classnames";
|
import classnames from "classnames";
|
||||||
import Taro, { useReady } from "@tarojs/taro";
|
import Taro, { useReady } from "@tarojs/taro";
|
||||||
import InfiniteScroll from "../infiniteScroll";
|
import InfiniteScroll, {StatusParam} from "../infiniteScroll";
|
||||||
import LoadingCard from "../loadingCard";
|
import LoadingCard from "../loadingCard";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
type Params = {
|
type Params = {
|
||||||
list?: any[],
|
list?: any[],
|
||||||
defaultValue?: number|string,
|
defaultValue?: number|string,
|
||||||
@ -18,7 +17,8 @@ type Params = {
|
|||||||
refresherTriggered?: true|false,
|
refresherTriggered?: true|false,
|
||||||
selfOnRefresherRefresh?: () => void
|
selfOnRefresherRefresh?: () => void
|
||||||
selfOnScrolltolower?: () => void,
|
selfOnScrolltolower?: () => void,
|
||||||
hasMore?: true|false
|
hasMore?: true|false,
|
||||||
|
statusMore?: StatusParam
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(({list = [],
|
export default memo(({list = [],
|
||||||
@ -30,7 +30,8 @@ export default memo(({list = [],
|
|||||||
refresherTriggered = false,
|
refresherTriggered = false,
|
||||||
selfOnRefresherRefresh,
|
selfOnRefresherRefresh,
|
||||||
selfOnScrolltolower,
|
selfOnScrolltolower,
|
||||||
hasMore = true
|
hasMore = true,
|
||||||
|
statusMore = 0
|
||||||
}: Params) => {
|
}: Params) => {
|
||||||
|
|
||||||
let num_half = useRef(0)
|
let num_half = useRef(0)
|
||||||
@ -82,8 +83,6 @@ export default memo(({list = [],
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<View className={classnames(styles.sideBar_main,'side_bar_select')}>
|
<View className={classnames(styles.sideBar_main,'side_bar_select')}>
|
||||||
@ -108,8 +107,7 @@ export default memo(({list = [],
|
|||||||
<View className="common_safe_area_y"></View>
|
<View className="common_safe_area_y"></View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
<View className={styles.sideBar_con}>
|
<View className={styles.sideBar_con}>
|
||||||
|
<InfiniteScroll statusMore={statusMore} hasMore={hasMore} selfonScrollToLower={() => selfOnScrolltolower?.()} refresherTriggered={refresherTriggered} refresherEnabled={true} selfOnRefresherRefresh={() => selfOnRefresherRefresh?.()}>
|
||||||
<InfiniteScroll hasMore={hasMore} selfonScrollToLower={() => selfOnScrolltolower?.()} refresherTriggered={refresherTriggered} refresherEnabled={true} selfOnRefresherRefresh={() => selfOnRefresherRefresh?.()}>
|
|
||||||
{children}
|
{children}
|
||||||
</InfiniteScroll>
|
</InfiniteScroll>
|
||||||
</View>
|
</View>
|
||||||
|
@ -4,13 +4,13 @@ import Search from '@/components/search'
|
|||||||
import Product from '@/components/product'
|
import Product from '@/components/product'
|
||||||
import InfiniteScroll from '@/components/infiniteScroll'
|
import InfiniteScroll from '@/components/infiniteScroll'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||||
import Filter from "@/components/filter";
|
import Filter from "@/components/filter";
|
||||||
import SortBtn from "@/components/sortBtn";
|
import SortBtn from "@/components/sortBtn";
|
||||||
import SelectData, {ListProps} from "../searchList/components/selectData";
|
import SelectData, {ListProps} from "../searchList/components/selectData";
|
||||||
import {GetProductListApi} from '@/api/material'
|
import {GetProductListApi} from '@/api/material'
|
||||||
import { useRouter } from "@tarojs/taro";
|
import { useRouter } from "@tarojs/taro";
|
||||||
import { getFilterData } from "@/common/util";
|
import { dataLoadingStatus, getFilterData } from "@/common/util";
|
||||||
import LoadingCard from "@/components/loadingCard";
|
import LoadingCard from "@/components/loadingCard";
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
@ -56,9 +56,9 @@ export default () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//监听获得的数据变化
|
//数据加载状态
|
||||||
useEffect(() => {
|
const statusMore = useMemo(() => {
|
||||||
(categoryList.list.length < categoryList.total)?setHasMore(true):setHasMore(false)
|
return dataLoadingStatus({list:categoryList.list, total: categoryList.total, status: state.loading})
|
||||||
}, [categoryList])
|
}, [categoryList])
|
||||||
|
|
||||||
//获取筛选条件
|
//获取筛选条件
|
||||||
@ -118,11 +118,9 @@ export default () => {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.list}>
|
<View className={styles.list}>
|
||||||
{(categoryList.list.length == 0&&state.loading)&&<LoadingCard/>}
|
<InfiniteScroll selfonScrollToLower={() => getScrolltolower()} statusMore={statusMore}>
|
||||||
{(categoryList.list.length == 0 && !state.loading)&&<LoadingCard title="暂无数据" loadingIcon={false}/>}
|
|
||||||
{(categoryList.list.length > 0)&&<InfiniteScroll selfonScrollToLower={() => getScrolltolower()} hasMore={hasMore}>
|
|
||||||
<Product desStatus={false} productList={categoryList.list}/>
|
<Product desStatus={false} productList={categoryList.list}/>
|
||||||
</InfiniteScroll>}
|
</InfiniteScroll>
|
||||||
</View>
|
</View>
|
||||||
<Filter show={showPopup} onClose={() => setShowPopup(false)} onFiltr={getFiltr}/>
|
<Filter show={showPopup} onClose={() => setShowPopup(false)} onFiltr={getFiltr}/>
|
||||||
</View>
|
</View>
|
||||||
|
@ -1,18 +1,22 @@
|
|||||||
import { Text, View } from "@tarojs/components"
|
import { Text, View } from "@tarojs/components"
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import classnames from "classnames";
|
import classnames from "classnames";
|
||||||
import { memo, useRef, useState } from "react";
|
import { memo, useEffect, useRef, useState } from "react";
|
||||||
|
|
||||||
type Param = {
|
type Param = {
|
||||||
onSelect?:(val:number) => void
|
onSelect?:(val:number) => void
|
||||||
|
defaultValue?: 0|1|2
|
||||||
}
|
}
|
||||||
export default memo(({onSelect}: Param) => {
|
export default memo(({onSelect, defaultValue = 0}: Param) => {
|
||||||
//收货方法 1:自提,2:物流
|
//收货方法 0:没选择, 1:自提,2:物流
|
||||||
const shipmentMode = useRef([
|
const shipmentMode = useRef([
|
||||||
{value:1, label:'上门自提', selected:false},
|
{value:1, label:'上门自提', selected:false},
|
||||||
{value:2, label:'物流', selected:false}
|
{value:2, label:'物流', selected:false}
|
||||||
])
|
])
|
||||||
const [selectValue, setSelectValue] = useState()
|
const [selectValue, setSelectValue] = useState<number>()
|
||||||
|
useEffect(() => {
|
||||||
|
setSelectValue(defaultValue)
|
||||||
|
}, [defaultValue])
|
||||||
const selectShipmentMode = (value) => {
|
const selectShipmentMode = (value) => {
|
||||||
setSelectValue(() => value)
|
setSelectValue(() => value)
|
||||||
onSelect?.(value)
|
onSelect?.(value)
|
||||||
|
@ -1,21 +1,62 @@
|
|||||||
import { Text, View } from "@tarojs/components"
|
import { Text, View } from "@tarojs/components"
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import classnames from "classnames";
|
import classnames from "classnames";
|
||||||
import { useCallback, useRef, useState } from "react";
|
import { useCallback, useMemo, useRef, useState } from "react";
|
||||||
import ShipmentMode from "./components/shipmentMode";
|
import ShipmentMode from "./components/shipmentMode";
|
||||||
import AddressList from "@/components/AddressList";
|
import AddressList from "@/components/AddressList";
|
||||||
import { goLink } from "@/common/common";
|
import { alert, goLink } from "@/common/common";
|
||||||
|
import { getParam } from "@/common/system";
|
||||||
|
import {EditSaleOrderAddressApi, EditSaleOrderShipmentModeApi} from "@/api/order";
|
||||||
|
import Taro from "@tarojs/taro";
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
|
|
||||||
|
//获取临时传递的数据
|
||||||
|
const params = getParam()
|
||||||
|
const [paramsData, setParamsData] = useState<any>(params)
|
||||||
|
|
||||||
//提交的数据
|
//提交的数据
|
||||||
const [submitData, setSubmitData] = useState({
|
const [submitData, setSubmitData] = useState({
|
||||||
address_id:0,
|
address_id:0,
|
||||||
id:0,
|
id:params.id,
|
||||||
shipment_mode: 0
|
shipment_mode: params.shipment_mode
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
//格式化地址
|
||||||
|
const address = useMemo(() => {
|
||||||
|
return paramsData.province_name+' '+paramsData.city_name+' '+paramsData.district_name+' '+paramsData.address_detail
|
||||||
|
}, [paramsData])
|
||||||
|
|
||||||
//获取收货方法
|
//获取收货方法
|
||||||
const getShipmentMode = useCallback((num) => {
|
const getShipmentMode = useCallback((num) => {
|
||||||
setSubmitData((val) => ({...val, shipment_mode:num}))
|
setSubmitData((val) => ({...val, shipment_mode:num}))
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
//获取地址
|
||||||
|
const getSelectAddress = useCallback((e) => {
|
||||||
|
setSubmitData((val) => ({...val, address_id:e.id}))
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
//修改请求
|
||||||
|
const {fetchData: addressFetchData} = EditSaleOrderAddressApi()
|
||||||
|
const {fetchData: shipmentFetchData} = EditSaleOrderShipmentModeApi()
|
||||||
|
const editData = async () => {
|
||||||
|
if(submitData.address_id) {
|
||||||
|
let res = await addressFetchData(submitData)
|
||||||
|
if(!res.success) {
|
||||||
|
alert.error(res.msg)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let res = await shipmentFetchData(submitData)
|
||||||
|
if(!res.success) {
|
||||||
|
alert.error(res.msg)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
Taro.navigateBack()
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={styles.order_edit_main}>
|
<View className={styles.order_edit_main}>
|
||||||
<View className={classnames(styles.title_msg)}>
|
<View className={classnames(styles.title_msg)}>
|
||||||
@ -26,24 +67,24 @@ export default () => {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.shipmentMode_con}>
|
<View className={styles.shipmentMode_con}>
|
||||||
<ShipmentMode onSelect={getShipmentMode}/>
|
<ShipmentMode onSelect={getShipmentMode} defaultValue={paramsData.shipment_mode}/>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.old_address}>
|
<View className={styles.old_address}>
|
||||||
<Text className={styles.old_address_text}>原地址:</Text>
|
<Text className={styles.old_address_text}>原地址:</Text>
|
||||||
<Text className={styles.old_address_text}>广东省 佛山市 禅城区 张槎街道 清风路1988号麦兜的大 大仓库</Text>
|
<Text className={styles.old_address_text}>{address}</Text>
|
||||||
<View className={styles.userInfo}>
|
<View className={styles.userInfo}>
|
||||||
<Text className={styles.userInfo_text}>陈先生</Text>
|
<Text className={styles.userInfo_text}>{paramsData.name}</Text>
|
||||||
<Text className={styles.userInfo_text}>1818877790</Text>
|
<Text className={styles.userInfo_text}>{paramsData.phone}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.select_address_con}>
|
<View className={styles.select_address_con}>
|
||||||
<View className={styles.title}>重新选择收货地址</View>
|
<View className={styles.title}>重新选择收货地址</View>
|
||||||
<View className={styles.address_list}>
|
<View className={styles.address_list}>
|
||||||
<AddressList focusBorderEnabled={true} addButtonEnabled={false}/>
|
<AddressList focusBorderEnabled={true} addButtonEnabled={false} onSelect={getSelectAddress}/>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.submitBtn}>
|
<View className={styles.submitBtn}>
|
||||||
<View onClick={() => goLink('/pages/addressAdd/index', {type:'add'})} className={classnames(styles.addAddress, styles.addressBtn)}>添加新地址</View>
|
<View onClick={() => goLink('/pages/addressAdd/index', {type:'add'})} className={classnames(styles.addAddress, styles.addressBtn)}>添加新地址</View>
|
||||||
<View className={classnames(styles.submitUpdate, styles.addressBtn)}>提交修改</View>
|
<View className={classnames(styles.submitUpdate, styles.addressBtn)} onClick={() => editData()}>提交修改</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className="common_safe_area_y"></View>
|
<View className="common_safe_area_y"></View>
|
||||||
|
3
src/pages/index/context.ts
Normal file
3
src/pages/index/context.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import React from "react";
|
||||||
|
|
||||||
|
export const ParamsContext = React.createContext<any>(null)
|
@ -1,3 +1,3 @@
|
|||||||
export default {
|
export default {
|
||||||
navigationBarTitleText: '修改地址',
|
navigationBarTitleText: '首页',
|
||||||
}
|
}
|
||||||
|
@ -7,11 +7,12 @@ import MoveBtn from '@/components/moveBtn'
|
|||||||
import ShopCart from '@/components/shopCart'
|
import ShopCart from '@/components/shopCart'
|
||||||
import { goLink } from '@/common/common'
|
import { goLink } from '@/common/common'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import { useEffect, useRef, useState } from 'react'
|
import React, { useEffect, useMemo, useRef, useState } from 'react'
|
||||||
import Taro, { Events, useDidShow, usePullDownRefresh, useRouter } from '@tarojs/taro'
|
import Taro, { Events, useDidShow, usePullDownRefresh, useRouter } from '@tarojs/taro'
|
||||||
import {GetProductKindListApi, GetProductListApi} from '@/api/material'
|
import {GetProductKindListApi, GetProductListApi} from '@/api/material'
|
||||||
import useLogin from '@/use/useLogin'
|
import useLogin from '@/use/useLogin'
|
||||||
import LoadingCard from '@/components/loadingCard'
|
import LoadingCard from '@/components/loadingCard'
|
||||||
|
import { dataLoadingStatus } from '@/common/util'
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
|
|
||||||
@ -54,6 +55,7 @@ export default () => {
|
|||||||
getProductList()
|
getProductList()
|
||||||
}, [filtrate])
|
}, [filtrate])
|
||||||
|
|
||||||
|
|
||||||
//点击面料类型
|
//点击面料类型
|
||||||
const getProductKindId = async (e) => {
|
const getProductKindId = async (e) => {
|
||||||
pageNum.current.page = 1
|
pageNum.current.page = 1
|
||||||
@ -90,6 +92,11 @@ export default () => {
|
|||||||
usePullDownRefresh(() => {
|
usePullDownRefresh(() => {
|
||||||
console.log('123')
|
console.log('123')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
//数据加载状态
|
||||||
|
const statusMore = useMemo(() => {
|
||||||
|
return dataLoadingStatus({list:productData.list, total: productData.total, status: productState.loading})
|
||||||
|
}, [productData])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MoveBtn onClick={() => setShowShopCart(!showShopCart)}>
|
<MoveBtn onClick={() => setShowShopCart(!showShopCart)}>
|
||||||
@ -102,9 +109,9 @@ export default () => {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.products}>
|
<View className={styles.products}>
|
||||||
<SideBar list={kindData.list} height="100%" defaultValue={kindData.defaultId} hasMore={hasMore} selfOnScrolltolower={() => getScrolltolower()} sideBarOnClick={(e) => getProductKindId(e)} heightItem={150} refresherTriggered={refresherTriggeredStatus} selfOnRefresherRefresh={() => getRefresherRefresh()}>
|
<SideBar list={kindData.list} height="100%" defaultValue={kindData.defaultId} hasMore={hasMore} statusMore={statusMore} selfOnScrolltolower={() => getScrolltolower()} sideBarOnClick={(e) => getProductKindId(e)} heightItem={150} refresherTriggered={refresherTriggeredStatus} selfOnRefresherRefresh={() => getRefresherRefresh()}>
|
||||||
<Product productList={productData.list}/>
|
<Product productList={productData.list}/>
|
||||||
</SideBar>
|
</SideBar>
|
||||||
</View>
|
</View>
|
||||||
<View className='common_safe_area_y'></View>
|
<View className='common_safe_area_y'></View>
|
||||||
<ShopCart show={showShopCart} onClose={() => setShowShopCart(false)}/>
|
<ShopCart show={showShopCart} onClose={() => setShowShopCart(false)}/>
|
||||||
@ -112,3 +119,4 @@ export default () => {
|
|||||||
</MoveBtn>
|
</MoveBtn>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ export type AddressInfoParam = {
|
|||||||
city_name: string,
|
city_name: string,
|
||||||
district_name: string,
|
district_name: string,
|
||||||
address_detail: string,
|
address_detail: string,
|
||||||
id: number,
|
id?: number,
|
||||||
name: string,
|
name: string,
|
||||||
phone: string
|
phone: string
|
||||||
}
|
}
|
||||||
|
@ -5,9 +5,11 @@ import classnames from "classnames";
|
|||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
type Param = {
|
type Param = {
|
||||||
style?: Object,
|
style?: Object,
|
||||||
number?: number
|
number?: number,
|
||||||
|
title?: string,
|
||||||
|
status?: true|false, //true 加大加深
|
||||||
}
|
}
|
||||||
export default memo(({style, number = 0}:Param) => {
|
export default memo(({style, number = 0, status = true, title = ''}:Param) => {
|
||||||
const priceDom = useCallback(() => {
|
const priceDom = useCallback(() => {
|
||||||
let res = number.toFixed(2).split('.')
|
let res = number.toFixed(2).split('.')
|
||||||
let int_num = parseInt(res[0]) + ''
|
let int_num = parseInt(res[0]) + ''
|
||||||
@ -21,40 +23,16 @@ export default memo(({style, number = 0}:Param) => {
|
|||||||
)
|
)
|
||||||
}, [number])
|
}, [number])
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<View className={styles.order_price}>
|
<View className={styles.order_price}>
|
||||||
<View className={styles.order_price_text}>
|
<View className={classnames(styles.order_price_text, status&&styles.emphasis)}>
|
||||||
<Text>合计金额</Text>
|
<Text>{title}</Text>
|
||||||
<View className={styles.iconfont_msg}>
|
<View className={styles.iconfont_msg}>
|
||||||
<Text className={classnames(styles.miconfont, 'iconfont icon-zhushi')}></Text>
|
<Text className={classnames(styles.miconfont, 'iconfont icon-zhushi')}></Text>
|
||||||
{/* <View className={classnames(styles.message)}>123123123121212312312312312</View> */}
|
{/* <View className={classnames(styles.message)}>123123123121212312312312312</View> */}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.order_price_num} style={style}>
|
<View className={classnames(styles.order_price_num, status&&styles.emphasis_num)} style={style}>
|
||||||
{priceDom()}
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View className={styles.order_price}>
|
|
||||||
<View className={styles.order_price_text}>
|
|
||||||
<Text>空差优惠</Text>
|
|
||||||
<View className={styles.iconfont_msg}>
|
|
||||||
<Text className={classnames(styles.miconfont, 'iconfont icon-zhushi')}></Text>
|
|
||||||
{/* <View className={classnames(styles.message)}>123123123121212312312312312</View> */}
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View className={styles.order_price_num} style={style}>
|
|
||||||
{priceDom()}
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View className={styles.order_price}>
|
|
||||||
<View className={classnames(styles.order_price_text, styles.emphasis)}>
|
|
||||||
<Text>应付金额</Text>
|
|
||||||
<View className={styles.iconfont_msg}>
|
|
||||||
<Text className={classnames(styles.miconfont, 'iconfont icon-zhushi')}></Text>
|
|
||||||
{/* <View className={classnames(styles.message)}>123123123121212312312312312</View> */}
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View className={classnames(styles.order_price_num, styles.emphasis_num)} style={style}>
|
|
||||||
{priceDom()}
|
{priceDom()}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
@ -64,7 +64,7 @@ export default memo(({value}:{value:OrderParam|null}) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
<View className={styles.order_estimated_amount}>
|
<View className={styles.order_estimated_amount}>
|
||||||
<EstimatedAmount number={formatPriceDiv(value?.estimate_amount)}/>
|
<EstimatedAmount number={formatPriceDiv(value?.estimate_amount)} title="预估金额" />
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</>
|
</>
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
export default {
|
export default {
|
||||||
navigationBarTitleText: '确认订单'
|
navigationBarTitleText: '订单详情'
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import { GetSaleOrderDetailApi } from "@/api/order";
|
import { GetSaleOrderDetailApi, EditSaleOrderRemarkApi } from "@/api/order";
|
||||||
import { goLink } from "@/common/common";
|
import { alert, goLink } from "@/common/common";
|
||||||
import { formatDateTime, formatPriceDiv } from "@/common/fotmat";
|
import { formatDateTime, formatPriceDiv } from "@/common/fotmat";
|
||||||
|
import { setParam } from "@/common/system";
|
||||||
import Popup from "@/components/popup";
|
import Popup from "@/components/popup";
|
||||||
import SearchInput from "@/components/searchInput";
|
import SearchInput from "@/components/searchInput";
|
||||||
import { Text, Textarea, View } from "@tarojs/components"
|
import { Text, Textarea, View } from "@tarojs/components"
|
||||||
import Taro, { useRouter } from "@tarojs/taro";
|
import Taro, { useDidShow, useRouter } from "@tarojs/taro";
|
||||||
import classnames from "classnames";
|
import classnames from "classnames";
|
||||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||||
import AddressInfo from "./components/addressInfo";
|
import AddressInfo from "./components/addressInfo";
|
||||||
@ -18,17 +19,20 @@ import styles from './index.module.scss'
|
|||||||
const [showDesc, setShowDesc] = useState(false)
|
const [showDesc, setShowDesc] = useState(false)
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
useEffect(() => {
|
const orderId = useRef<number>(Number(router.params.id))
|
||||||
|
|
||||||
|
useDidShow(() => {
|
||||||
getSaleOrderPreView()
|
getSaleOrderPreView()
|
||||||
}, [])
|
})
|
||||||
|
|
||||||
//获取订单详情
|
//获取订单详情
|
||||||
const [orderDetail, setOrderDetail] = useState<any>() //获取到的原始数据
|
const [orderDetail, setOrderDetail] = useState<any>() //获取到的原始数据
|
||||||
const {fetchData: getOrderFetchData} = GetSaleOrderDetailApi()
|
const {fetchData: getOrderFetchData} = GetSaleOrderDetailApi()
|
||||||
const getSaleOrderPreView = async () => {
|
const getSaleOrderPreView = async () => {
|
||||||
if(router.params.id) {
|
if(orderId.current) {
|
||||||
let res = await getOrderFetchData({id: router.params.id})
|
let res = await getOrderFetchData({id: orderId.current})
|
||||||
setOrderDetail(res.data)
|
setOrderDetail(res.data)
|
||||||
|
setOrderRemark(res.data.remark)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,32 +93,48 @@ import styles from './index.module.scss'
|
|||||||
|
|
||||||
//格式化初始地址
|
//格式化初始地址
|
||||||
const defaultAddress = useMemo(() => {
|
const defaultAddress = useMemo(() => {
|
||||||
const address = orderDetail?.default_address
|
return {
|
||||||
if(address) {
|
province_name: orderDetail?.province_name,
|
||||||
return {
|
city_name: orderDetail?.city_name,
|
||||||
province_name: address.province_name,
|
district_name: orderDetail?.district_name,
|
||||||
city_name: address.city_name,
|
address_detail: orderDetail?.address_detail,
|
||||||
district_name: address.district_name,
|
// id: address.id,
|
||||||
address_detail: address.address_detail,
|
name: orderDetail?.target_user_name,
|
||||||
id: address.id,
|
phone: orderDetail?.target_user_phone
|
||||||
name: address.name,
|
|
||||||
phone: address.phone
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return null
|
|
||||||
}, [orderDetail])
|
}, [orderDetail])
|
||||||
|
|
||||||
//订单备注
|
//订单备注
|
||||||
|
const {fetchData: remarkFetchData} = EditSaleOrderRemarkApi()
|
||||||
const [orderRemark, setOrderRemark] = useState('')
|
const [orderRemark, setOrderRemark] = useState('')
|
||||||
const getRemark = useCallback((e) => {
|
const getRemark = useCallback(async (e) => {
|
||||||
setOrderRemark(() => e)
|
setOrderRemark(() => e)
|
||||||
|
let res = await remarkFetchData({remark:e, id: orderId.current})
|
||||||
|
if(res.success) {
|
||||||
|
alert.success('修改成功')
|
||||||
|
} else {
|
||||||
|
alert.error(res.msg)
|
||||||
|
}
|
||||||
setShowDesc(() => false)
|
setShowDesc(() => false)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
//修改地址
|
//修改地址
|
||||||
const changeAddress = useCallback(() => {
|
const changeAddress = () => {
|
||||||
goLink('/pages/editOrder/index', {id: router.params.id})
|
//临时传递数据
|
||||||
}, [router.params])
|
setParam({
|
||||||
|
province_name: orderDetail?.province_name,
|
||||||
|
city_name: orderDetail?.city_name,
|
||||||
|
district_name: orderDetail?.district_name,
|
||||||
|
address_detail: orderDetail?.address_detail,
|
||||||
|
id: orderId.current,
|
||||||
|
name: orderDetail?.target_user_name,
|
||||||
|
phone: orderDetail?.target_user_phone,
|
||||||
|
shipment_mode: orderDetail?.shipment_mode,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
goLink('/pages/editOrder/index')
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<View className={styles.order_main}>
|
<View className={styles.order_main}>
|
||||||
<View className={styles.weight_memo_con}>
|
<View className={styles.weight_memo_con}>
|
||||||
|
@ -58,7 +58,6 @@ export default () => {
|
|||||||
return <View className={styles.order_item}> <Order/></View>
|
return <View className={styles.order_item}> <Order/></View>
|
||||||
|
|
||||||
})}
|
})}
|
||||||
|
|
||||||
</InfiniteScroll>
|
</InfiniteScroll>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
@ -8,10 +8,10 @@ import LinkBlueTooth from "@/components/bluetooth/LinkBlueTooth";
|
|||||||
import {useBluetooth} from "@/use/contextBlueTooth"
|
import {useBluetooth} from "@/use/contextBlueTooth"
|
||||||
import {toRgb} from '@/common/bluetooth/color/colorSpace'
|
import {toRgb} from '@/common/bluetooth/color/colorSpace'
|
||||||
import styles from './hightSearchList.module.scss'
|
import styles from './hightSearchList.module.scss'
|
||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||||
import Taro, { useDidShow, usePullDownRefresh, useReady } from "@tarojs/taro";
|
import Taro, { useDidShow, usePullDownRefresh, useReady } from "@tarojs/taro";
|
||||||
import {GetLabProductApi} from "@/api/material"
|
import {GetLabProductApi} from "@/api/material"
|
||||||
import { getFilterData } from "@/common/util";
|
import { dataLoadingStatus, getFilterData } from "@/common/util";
|
||||||
import { formatHashTag, formatImgUrl } from "@/common/fotmat";
|
import { formatHashTag, formatImgUrl } from "@/common/fotmat";
|
||||||
import LoadingCard from "@/components/loadingCard";
|
import LoadingCard from "@/components/loadingCard";
|
||||||
import useLogin from "@/use/useLogin";
|
import useLogin from "@/use/useLogin";
|
||||||
@ -64,11 +64,11 @@ export default () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//监听获得的数据变化
|
|
||||||
useEffect(() => {
|
|
||||||
(materialList.list.length < materialList.total)?setHasMore(true):setHasMore(false)
|
|
||||||
}, [materialList])
|
|
||||||
|
|
||||||
|
//数据加载状态
|
||||||
|
const statusMore = useMemo(() => {
|
||||||
|
return dataLoadingStatus({list:materialList.list, total: materialList.total, status: materialState.loading})
|
||||||
|
}, [materialList])
|
||||||
|
|
||||||
const [scrollStatus, setScrollStatus] = useState(false)
|
const [scrollStatus, setScrollStatus] = useState(false)
|
||||||
const onscroll = useCallback((e) => {
|
const onscroll = useCallback((e) => {
|
||||||
@ -176,12 +176,11 @@ export default () => {
|
|||||||
<View className={styles.list}>
|
<View className={styles.list}>
|
||||||
<View className={classnames(styles.list_num, scrollStatus&&styles.list_num_shadow)}>搜索结果 ({materialList.total}条记录)</View>
|
<View className={classnames(styles.list_num, scrollStatus&&styles.list_num_shadow)}>搜索结果 ({materialList.total}条记录)</View>
|
||||||
<View className={styles.scroll}>
|
<View className={styles.scroll}>
|
||||||
{(materialList.list.length == 0&&materialState.loading)&&<LoadingCard/>}
|
|
||||||
{(materialList.list.length == 0 && !materialState.loading)&&<LoadingCard title="暂无数据" loadingIcon={false}/>}
|
<InfiniteScroll
|
||||||
{(materialList.list.length > 0)&&<InfiniteScroll
|
|
||||||
selfonScrollToLower={() => getScrolltolower()}
|
selfonScrollToLower={() => getScrolltolower()}
|
||||||
selfOnScroll={(e) => onscroll(e)}
|
selfOnScroll={(e) => onscroll(e)}
|
||||||
hasMore={hasMore}
|
statusMore={statusMore}
|
||||||
>
|
>
|
||||||
<View className={styles.product_list}>
|
<View className={styles.product_list}>
|
||||||
{materialList.list.map(item => {
|
{materialList.list.map(item => {
|
||||||
@ -197,7 +196,7 @@ export default () => {
|
|||||||
</View>
|
</View>
|
||||||
})}
|
})}
|
||||||
</View>
|
</View>
|
||||||
</InfiniteScroll>}
|
</InfiniteScroll>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<Filter show={showFilter} onFiltr={(e) => getFiltr(e)} onClose={() => setShowFilter(false)}/>
|
<Filter show={showFilter} onFiltr={(e) => getFiltr(e)} onClose={() => setShowFilter(false)}/>
|
||||||
|
@ -7,12 +7,12 @@ import SortBtn from "@/components/sortBtn";
|
|||||||
import SelectData, {ListProps} from "./components/selectData";
|
import SelectData, {ListProps} from "./components/selectData";
|
||||||
import { goLink } from "@/common/common";
|
import { goLink } from "@/common/common";
|
||||||
import styles from './searchList.module.scss'
|
import styles from './searchList.module.scss'
|
||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||||
import useManualPullDownRefresh from "@/use/useManualPullDownRefresh";
|
import useManualPullDownRefresh from "@/use/useManualPullDownRefresh";
|
||||||
import {GetProductListApi} from "@/api/material"
|
import {GetProductListApi} from "@/api/material"
|
||||||
import Taro, { useDidShow, usePullDownRefresh, useRouter } from "@tarojs/taro";
|
import Taro, { useDidShow, usePullDownRefresh, useRouter } from "@tarojs/taro";
|
||||||
import { formatHashTag, formatImgUrl } from "@/common/fotmat";
|
import { formatHashTag, formatImgUrl } from "@/common/fotmat";
|
||||||
import { getFilterData } from "@/common/util";
|
import { dataLoadingStatus, getFilterData } from "@/common/util";
|
||||||
import LoadingCard from "@/components/loadingCard";
|
import LoadingCard from "@/components/loadingCard";
|
||||||
import useLogin from "@/use/useLogin";
|
import useLogin from "@/use/useLogin";
|
||||||
|
|
||||||
@ -53,7 +53,6 @@ export default () => {
|
|||||||
|
|
||||||
//上拉加载数据
|
//上拉加载数据
|
||||||
const pageNum = useRef({size: searchField.size, page: searchField.page})
|
const pageNum = useRef({size: searchField.size, page: searchField.page})
|
||||||
const [hasMore, setHasMore] = useState(true)
|
|
||||||
const getScrolltolower = () => {
|
const getScrolltolower = () => {
|
||||||
if(materialList.list.length < materialList.total) {
|
if(materialList.list.length < materialList.total) {
|
||||||
pageNum.current.page++
|
pageNum.current.page++
|
||||||
@ -62,9 +61,9 @@ export default () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//监听获得的数据变化
|
//数据加载状态
|
||||||
useEffect(() => {
|
const statusMore = useMemo(() => {
|
||||||
(materialList.list.length < materialList.total)?setHasMore(true):setHasMore(false)
|
return dataLoadingStatus({list:materialList.list, total: materialList.total, status: materialState.loading})
|
||||||
}, [materialList])
|
}, [materialList])
|
||||||
|
|
||||||
//输入了搜索关键字
|
//输入了搜索关键字
|
||||||
@ -156,12 +155,10 @@ export default () => {
|
|||||||
<View className={styles.list}>
|
<View className={styles.list}>
|
||||||
<View className={classnames(styles.list_num, scrollStatus&&styles.list_num_shadow)}>搜索结果 ({materialList.total}条记录)</View>
|
<View className={classnames(styles.list_num, scrollStatus&&styles.list_num_shadow)}>搜索结果 ({materialList.total}条记录)</View>
|
||||||
<View className={styles.scroll}>
|
<View className={styles.scroll}>
|
||||||
{(materialList.list.length == 0&&materialState.loading)&&<LoadingCard/>}
|
<InfiniteScroll
|
||||||
{(materialList.list.length == 0 && !materialState.loading)&&<LoadingCard title="暂无数据" loadingIcon={false}/>}
|
|
||||||
{(materialList.list.length > 0)&&<InfiniteScroll
|
|
||||||
selfonScrollToLower={() => getScrolltolower()}
|
selfonScrollToLower={() => getScrolltolower()}
|
||||||
hasMore={hasMore}
|
|
||||||
selfOnScroll={(e) => onscroll(e)}
|
selfOnScroll={(e) => onscroll(e)}
|
||||||
|
statusMore={statusMore}
|
||||||
>
|
>
|
||||||
<View className={styles.product_list}>
|
<View className={styles.product_list}>
|
||||||
{materialList.list.map(item => {
|
{materialList.list.map(item => {
|
||||||
@ -181,7 +178,7 @@ export default () => {
|
|||||||
</View>
|
</View>
|
||||||
})}
|
})}
|
||||||
</View>
|
</View>
|
||||||
</InfiniteScroll>}
|
</InfiniteScroll>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<Filter show={showFilter} onClose={() => setShowFilter(false)} onFiltr={(e) => getFiltr(e)} />
|
<Filter show={showFilter} onClose={() => setShowFilter(false)} onFiltr={(e) => getFiltr(e)} />
|
||||||
|
@ -4,13 +4,13 @@ import Search from '@/components/search'
|
|||||||
import Product from '@/components/product'
|
import Product from '@/components/product'
|
||||||
import InfiniteScroll from '@/components/infiniteScroll'
|
import InfiniteScroll from '@/components/infiniteScroll'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||||
import Filter from "@/components/filter";
|
import Filter from "@/components/filter";
|
||||||
import SortBtn from "@/components/sortBtn";
|
import SortBtn from "@/components/sortBtn";
|
||||||
import SelectData, {ListProps} from "../searchList/components/selectData";
|
import SelectData, {ListProps} from "../searchList/components/selectData";
|
||||||
import {GetProductListApi} from '@/api/material'
|
import {GetProductListApi} from '@/api/material'
|
||||||
import { useRouter } from "@tarojs/taro";
|
import { useRouter } from "@tarojs/taro";
|
||||||
import { getFilterData } from "@/common/util";
|
import { dataLoadingStatus, getFilterData } from "@/common/util";
|
||||||
import LoadingCard from "@/components/loadingCard";
|
import LoadingCard from "@/components/loadingCard";
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
@ -56,9 +56,9 @@ export default () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//监听获得的数据变化
|
//数据加载状态
|
||||||
useEffect(() => {
|
const statusMore = useMemo(() => {
|
||||||
(subjectList.list.length < subjectList.total)?setHasMore(true):setHasMore(false)
|
return dataLoadingStatus({list:subjectList.list, total: subjectList.total, status: state.loading})
|
||||||
}, [subjectList])
|
}, [subjectList])
|
||||||
|
|
||||||
//获取筛选条件
|
//获取筛选条件
|
||||||
@ -118,11 +118,9 @@ export default () => {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.list}>
|
<View className={styles.list}>
|
||||||
{(subjectList.list.length == 0&&state.loading)&&<LoadingCard/>}
|
<InfiniteScroll selfonScrollToLower={() => getScrolltolower()} statusMore={statusMore}>
|
||||||
{(subjectList.list.length == 0 && !state.loading)&&<LoadingCard title="暂无数据" loadingIcon={false}/>}
|
|
||||||
{(subjectList.list.length > 0)&&<InfiniteScroll selfonScrollToLower={() => getScrolltolower()} hasMore={hasMore}>
|
|
||||||
<Product desStatus={false} productList={subjectList.list}/>
|
<Product desStatus={false} productList={subjectList.list}/>
|
||||||
</InfiniteScroll>}
|
</InfiniteScroll>
|
||||||
</View>
|
</View>
|
||||||
<Filter show={showPopup} onClose={() => setShowPopup(false)} onFiltr={getFiltr}/>
|
<Filter show={showPopup} onClose={() => setShowPopup(false)} onFiltr={getFiltr}/>
|
||||||
</View>
|
</View>
|
||||||
|
@ -107,7 +107,7 @@ export const useRequest = (options:option = {
|
|||||||
success: false, // 请求是否成功
|
success: false, // 请求是否成功
|
||||||
data: {},
|
data: {},
|
||||||
msg: '',
|
msg: '',
|
||||||
loading: false,
|
loading: true,
|
||||||
error: null,
|
error: null,
|
||||||
query: {},
|
query: {},
|
||||||
filter: null,
|
filter: null,
|
||||||
@ -170,7 +170,6 @@ export const useRequest = (options:option = {
|
|||||||
if (statusCode === 401) {
|
if (statusCode === 401) {
|
||||||
removeToken()
|
removeToken()
|
||||||
removeSessionKey()
|
removeSessionKey()
|
||||||
// remove
|
|
||||||
// Taro.reLaunch({
|
// Taro.reLaunch({
|
||||||
// url: router.path +'?' + qs.stringify(router.params)
|
// url: router.path +'?' + qs.stringify(router.params)
|
||||||
// })
|
// })
|
||||||
|
Loading…
x
Reference in New Issue
Block a user