对接确认订单
This commit is contained in:
@@ -35,13 +35,10 @@
|
||||
border: 2px solid $color_main;
|
||||
background-color: #ecf5ff;
|
||||
color: $color_main;
|
||||
width: 144px;
|
||||
height: 51px;
|
||||
}
|
||||
}
|
||||
.con{
|
||||
padding:30px;
|
||||
padding-bottom: 100px;
|
||||
box-sizing: border-box;
|
||||
flex:1;
|
||||
height: 0;
|
||||
@@ -49,7 +46,7 @@
|
||||
height: 100%;
|
||||
}
|
||||
.product_list{
|
||||
padding-bottom: 20px;
|
||||
padding-bottom: 120px;
|
||||
.product_item{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
@@ -148,7 +145,7 @@
|
||||
.buy_btn{
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
bottom: 20px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
@@ -163,6 +160,7 @@
|
||||
align-items: center;
|
||||
padding: 20px 0;
|
||||
box-sizing: border-box;
|
||||
box-shadow: 0px 4px 12px 0px rgba(0,0,0,0.5);
|
||||
.icon{
|
||||
width: 100px;
|
||||
height: 100%;
|
||||
|
||||
@@ -9,7 +9,8 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { alert, goLink } from "@/common/common";
|
||||
import {GetShoppingCartApi, DelShoppingCartApi} from "@/api/shopCart"
|
||||
import { formatHashTag, formatImgUrl, formatMillionYuan } from "@/common/fotmat";
|
||||
import { formatHashTag, formatImgUrl, formatPriceDiv } from "@/common/fotmat";
|
||||
import { setParam } from "@/common/system";
|
||||
|
||||
type param = {
|
||||
show?: true|false,
|
||||
@@ -175,13 +176,12 @@ export default ({show = false, onClose}: param) => {
|
||||
|
||||
//格式化金额
|
||||
const formatPirce = useCallback((price) => {
|
||||
const {num} = formatMillionYuan(price, 100)
|
||||
return Number(num)
|
||||
return Number(formatPriceDiv(price))
|
||||
}, [])
|
||||
|
||||
//格式化数量
|
||||
const formatCount = useCallback((item) => {
|
||||
return item.sale_mode == 0? item.roll + '件': item.length + 'm'
|
||||
return item.sale_mode == 0? item.roll + '件': (item.length/100) + 'm'
|
||||
}, [])
|
||||
|
||||
//预估金额
|
||||
@@ -190,7 +190,7 @@ export default ({show = false, onClose}: param) => {
|
||||
list.map(item => {
|
||||
if(item.select) count += item.sale_price
|
||||
})
|
||||
return Number(formatMillionYuan(count, 100).num)
|
||||
return Number(formatPriceDiv(count))
|
||||
},[list])
|
||||
|
||||
//去结算
|
||||
@@ -200,7 +200,8 @@ export default ({show = false, onClose}: param) => {
|
||||
alert.error('请选择面料')
|
||||
} else {
|
||||
let ids = selectIds.current.join('-')
|
||||
goLink('/pages/order/index',{ids, sale_mode:selectIndex})
|
||||
setParam({ids, sale_mode:selectIndex})
|
||||
goLink('/pages/order/comfirm')
|
||||
}
|
||||
|
||||
}
|
||||
@@ -212,8 +213,8 @@ export default ({show = false, onClose}: param) => {
|
||||
<View className={styles.header}>
|
||||
<View onClick={selectAll}>{!selectStatus?'全选':'反选'}</View>
|
||||
<View onClick={delSelect}>
|
||||
<text className={classnames('iconfont', 'icon-lajixiang', styles.miconfont)}></text>
|
||||
删除勾选项
|
||||
<text className={classnames('iconfont', 'icon-shanchu', styles.miconfont)}></text>
|
||||
删除所选
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.search}>
|
||||
@@ -223,7 +224,7 @@ export default ({show = false, onClose}: param) => {
|
||||
</View>
|
||||
<View className={styles.con}>
|
||||
{loading&&<LoadingCard/>}
|
||||
{!loading&&list?.length > 0&&<InfiniteScroll refresherTriggered={true} refresherEnabled={true} moreStatus={false} >
|
||||
{!loading&&list?.length > 0&&<InfiniteScroll moreStatus={false} >
|
||||
<View className={styles.product_list}>
|
||||
{list?.map((item, index) => {
|
||||
return <View key={index} className={classnames(styles.product_item, (selectIndex!=-1&&selectIndex!= item.sale_mode)&&styles.no_product_item_select)}>
|
||||
@@ -239,7 +240,7 @@ export default ({show = false, onClose}: param) => {
|
||||
<View className={styles.tag}>{item.sale_mode_name}</View>
|
||||
</View>
|
||||
<View className={styles.count}>
|
||||
<View className={styles.price}><text>¥</text>{formatPirce(item.sale_price)}<text>/kg</text></View>
|
||||
<View className={styles.price}><text>¥</text>{formatPirce(item.sale_price)}<text>/{selectList[selectIndex].eunit}</text></View>
|
||||
<View className={styles.long}>×{formatCount(item)}</View>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user