🦄 refactor:订单列表对接100%

This commit is contained in:
Haiyi
2022-09-14 13:13:42 +08:00
committed by xuan
parent 5bc498ad31
commit 0ef88a4490
16 changed files with 878 additions and 69 deletions
@@ -44,5 +44,7 @@
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #4581FF;
text-align: center;
line-height: 72px;
}
}
+6 -6
View File
@@ -8,9 +8,9 @@ interface prosObj {
status?: Number,
payment_method?: Number
}
cancle?: () => void,
nextBuy?: () => void,
toPay?: () => void,
cancle?: (any) => void,
nextBuy?: (any) => void,
toPay?: (any) => void,
}
export default memo((props: prosObj) => {
@@ -67,13 +67,13 @@ export default memo((props: prosObj) => {
return (
<View className={style.flexBox}>
{
showCancel && <View className={style.cancle} onClick={() => cancle?.()}>取消订单</View>
showCancel && <View className={style.cancle} onClick={(e) => cancle?.(e)}>取消订单</View>
}
{
showBuy && <View className={style.nextBuy} onClick={() => nextBuy?.()}>再次购买</View>
showBuy && <View className={style.nextBuy} onClick={(e) => nextBuy?.(e)}>再次购买</View>
}
{
canBuy && <View className={style.toBuy} onClick={() => toPay?.()}>去付款</View>
canBuy && <View className={style.toBuy} onClick={(e) => toPay?.(e)}>去付款</View>
}
</View>
+13 -3
View File
@@ -116,11 +116,21 @@
}
}
.kongOne {
height: 100px;
}
}
.kongOne {
height: 200px;
}
.loading_more {
height: 300px;
padding-bottom: 200px;
display: flex;
align-items: center;
width: 100%;
justify-content: center;
}
.posBox {
width: 100%;
+23 -13
View File
@@ -7,6 +7,7 @@ import Popup from '@/components/popup'
import Goods from "@/components/goodsItem"
import BottomCustomer from "@/components/BottomCustomer"
import VirtualList from '@tarojs/components/virtual-list'
import DotLoading from "@/components/dotLoading"
interface prosObj {
showPopup?: false | true,
@@ -125,21 +126,30 @@ export default memo(forwardRef((props: prosObj, ref) => {
<View className={styles.searchBox}>
<Search placeholder='请输入搜索布料' showBtn={false} changeOnSearch={getSearchData} debounceTime={300} />
</View>
<View className={styles.scrollviewBig}>
<VirtualList
className={styles.scrollview}
height={300} /* 列表的高度 */
width='100%' /* 列表的宽度 */
itemData={goodList} /* 渲染列表的数据 */
itemCount={goodList.length + 0} /* 渲染列表的长度 */
itemSize={100} /* 列表单项的高度 */
overscanCount={1}>
{rows}
</VirtualList>
<View className={styles.kongOne}></View>
</View>
{
goodList.length > 0 && <>
<View className={styles.scrollviewBig}>
<VirtualList
className={styles.scrollview}
height={300} /* 列表的高度 */
width='100%' /* 列表的宽度 */
itemData={goodList} /* 渲染列表的数据 */
itemCount={goodList.length + 0} /* 渲染列表的长度 */
itemSize={100} /* 列表单项的高度 */
overscanCount={1}>
{rows}
</VirtualList>
</View>
<View className={styles.kongOne}></View>
</>
}
{
goodList.length === 0 && <>
<View className={styles.loading_more}>加载中<DotLoading /></View>
</>
}
<View className={styles.posBox}>
<BottomCustomer clientName={clientName} clientId={clientId} isDisabled={selectTotal > 0 && clientName !== '' ? false : true} handSure={() => { handSure() }}></BottomCustomer>
</View>