diff --git a/src/pages/editOrder/index.config.ts b/src/pages/editOrder/index.config.ts index 1f88149..1c3223c 100644 --- a/src/pages/editOrder/index.config.ts +++ b/src/pages/editOrder/index.config.ts @@ -1,5 +1,5 @@ export default { - navigationBarTitleText: '电子商城', + navigationBarTitleText: '修改地址', enablePullDownRefresh: true, backgroundTextStyle: 'dark' } diff --git a/src/pages/editOrder/index.module.scss b/src/pages/editOrder/index.module.scss index e1ccdaa..c6e2906 100644 --- a/src/pages/editOrder/index.module.scss +++ b/src/pages/editOrder/index.module.scss @@ -72,6 +72,7 @@ align-items: center; background-color: #fff; border-radius: 30px 30px 0px 0px; + position: relative; .title{ font-size: $font_size; font-weight: 700; @@ -82,5 +83,38 @@ height: 0; margin-top: 50px; } + .submitBtn{ + display: flex; + font-size: $font_size_big ; + justify-content: center; + height: 82px; + margin-bottom: 20px; + position: absolute; + bottom:0; + .addressBtn{ + flex:1; + text-align: center; + height: 100%; + border: 3px solid #cde5ff; + width: 348px; + justify-content: center; + align-items: center; + } + .addAddress{ + border-left: 0; + display: flex; + border-radius: 50px 0px 0px 50px; + color: $color_main; + background-color: #fff; + } + .submitUpdate{ + display: flex; + justify-content: center; + align-items: center; + border-radius: 0px 50px 50px 0px; + background-color: $color_main; + color: #fff; + } + } } } \ No newline at end of file diff --git a/src/pages/editOrder/index.tsx b/src/pages/editOrder/index.tsx index 3f89bfb..31fcd81 100644 --- a/src/pages/editOrder/index.tsx +++ b/src/pages/editOrder/index.tsx @@ -4,6 +4,7 @@ import classnames from "classnames"; import { useCallback, useRef, useState } from "react"; import ShipmentMode from "./components/shipmentMode"; import AddressList from "@/components/AddressList"; +import { goLink } from "@/common/common"; export default () => { //提交的数据 const [submitData, setSubmitData] = useState({ @@ -11,7 +12,6 @@ export default () => { id:0, shipment_mode: 0 }) - //获取收货方法 const getShipmentMode = useCallback((num) => { setSubmitData((val) => ({...val, shipment_mode:num})) @@ -19,7 +19,7 @@ export default () => { return ( - + 修改收货地址可能会影响发货时效 若商品已发货,则不能修改 @@ -41,7 +41,12 @@ export default () => { + + goLink('/pages/addressAdd/index', {type:'add'})} className={classnames(styles.addAddress, styles.addressBtn)}>添加新地址 + 提交修改 + + ) } \ No newline at end of file diff --git a/src/pages/order/comfirm.tsx b/src/pages/order/comfirm.tsx index 015ad57..5db9fc2 100644 --- a/src/pages/order/comfirm.tsx +++ b/src/pages/order/comfirm.tsx @@ -16,6 +16,7 @@ import { getParam } from "@/common/system"; import useLogin from "@/use/useLogin"; import { alert, goLink } from "@/common/common"; import ShipmentMode from "../editOrder/components/shipmentMode"; +import SubmitOrderBtn from "./components/submitOrderBtn"; export default () => { const {checkLogin} = useLogin() @@ -134,8 +135,11 @@ import ShipmentMode from "../editOrder/components/shipmentMode"; //提交按钮是否可用 const btnStatus = useMemo(() => { - console.log('submitOrder::',submitOrderData) - return submitOrderData?.address_id&& submitOrderData.list?.length &&submitOrderData.shipment_mode + if( submitOrderData?.list?.length == 0 || !submitOrderData?.shipment_mode || (submitOrderData?.shipment_mode == 2 && !submitOrderData?.address_id)) { + return false + } else { + return true + } }, [submitOrderData]) //提交订单 @@ -180,7 +184,7 @@ import ShipmentMode from "../editOrder/components/shipmentMode"; - + {`${formatPreViewOrder?.list.length}种面料,${formatPreViewOrder?.colo_count}种颜色,共${formatPreViewOrder?.num_count + formatPreViewOrder?.unit}`} submitOrderEven()}>提交订单 diff --git a/src/pages/order/components/orderState/index.tsx b/src/pages/order/components/orderState/index.tsx index d121e7e..e5a4d61 100644 --- a/src/pages/order/components/orderState/index.tsx +++ b/src/pages/order/components/orderState/index.tsx @@ -36,9 +36,9 @@ export default memo(({list = []}:{list?:Param[]}) => { {showMore&&'收起物流详情'||'点击查看更多物流详情'} } - + {/* - + */} ) }) \ No newline at end of file diff --git a/src/pages/order/components/submitOrderBtn/index.module.scss b/src/pages/order/components/submitOrderBtn/index.module.scss new file mode 100644 index 0000000..c5ac9ed --- /dev/null +++ b/src/pages/order/components/submitOrderBtn/index.module.scss @@ -0,0 +1,69 @@ +.order_price{ + display: flex; + align-items: center; + justify-content: space-between; + width: 100%; + &:nth-last-child(n+2) { + margin-bottom: 30px; + } + .order_price_text{ + font-size: $font_size_medium; + // margin-right: 10px; + display: flex; + .iconfont_msg{ + position: relative; + } + .miconfont{ + font-size: 30px; + font-weight: normal; + } + .message{ + position: absolute; + top: -50px; + background: #A8B3BD; + z-index: 9; + min-height: 50px; + border-radius: 10px; + padding: 10px; + box-sizing: border-box; + &::before{ + z-index: 1; + position: absolute; + bottom: -7px; + left: 10px; + width: 15px; + height: 15px; + content: " "; + transform: rotate(45deg); + background: #A8B3BD; + box-sizing: border-box; + } + } + } + .emphasis{ + font-weight: 700; + } + .order_price_num{ + color: $color_main; + font-weight: 700; + text{ + &:nth-child(1) { + font-size: $font_size_min; + } + &:nth-child(2) { + font-size: 26px; + } + &:nth-child(3) { + font-size: $font_size_medium; + } + } + } + .emphasis_num{ + text{ + &:nth-child(2) { + font-size: $font_size_big; + } + } + } + +} \ No newline at end of file diff --git a/src/pages/order/components/submitOrderBtn/index.tsx b/src/pages/order/components/submitOrderBtn/index.tsx new file mode 100644 index 0000000..770d805 --- /dev/null +++ b/src/pages/order/components/submitOrderBtn/index.tsx @@ -0,0 +1,39 @@ +import { Text, View } from "@tarojs/components" +import { memo, useCallback, useEffect, useMemo } from "react" +import {formatKbPrice} from '@/common/common' +import classnames from "classnames"; +import styles from './index.module.scss' +type Param = { + style?: Object, + number?: number +} +export default memo(({style, number = 0}:Param) => { + const priceDom = useCallback(() => { + let res = number.toFixed(2).split('.') + let int_num = parseInt(res[0]) + '' + let decimals_num = res[1] + return ( + <> + ¥ + {Number(int_num).toLocaleString()} + .{decimals_num} + + ) + }, [number]) + return ( + <> + + + 应付金额 + + + {/* 123123123121212312312312312 */} + + + + {priceDom()} + + + + ) +}) \ No newline at end of file