新增修改地址
This commit is contained in:
parent
b601c69aa3
commit
7e5481a7e1
@ -1,5 +1,5 @@
|
|||||||
export default {
|
export default {
|
||||||
navigationBarTitleText: '电子商城',
|
navigationBarTitleText: '修改地址',
|
||||||
enablePullDownRefresh: true,
|
enablePullDownRefresh: true,
|
||||||
backgroundTextStyle: 'dark'
|
backgroundTextStyle: 'dark'
|
||||||
}
|
}
|
||||||
|
@ -72,6 +72,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 30px 30px 0px 0px;
|
border-radius: 30px 30px 0px 0px;
|
||||||
|
position: relative;
|
||||||
.title{
|
.title{
|
||||||
font-size: $font_size;
|
font-size: $font_size;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
@ -82,5 +83,38 @@
|
|||||||
height: 0;
|
height: 0;
|
||||||
margin-top: 50px;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -4,6 +4,7 @@ import classnames from "classnames";
|
|||||||
import { useCallback, useRef, useState } from "react";
|
import { useCallback, 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";
|
||||||
export default () => {
|
export default () => {
|
||||||
//提交的数据
|
//提交的数据
|
||||||
const [submitData, setSubmitData] = useState({
|
const [submitData, setSubmitData] = useState({
|
||||||
@ -11,7 +12,6 @@ export default () => {
|
|||||||
id:0,
|
id:0,
|
||||||
shipment_mode: 0
|
shipment_mode: 0
|
||||||
})
|
})
|
||||||
|
|
||||||
//获取收货方法
|
//获取收货方法
|
||||||
const getShipmentMode = useCallback((num) => {
|
const getShipmentMode = useCallback((num) => {
|
||||||
setSubmitData((val) => ({...val, shipment_mode:num}))
|
setSubmitData((val) => ({...val, shipment_mode:num}))
|
||||||
@ -19,7 +19,7 @@ export default () => {
|
|||||||
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)}>
|
||||||
<Text className={classnames(styles.miconfont, 'iconfont icon-tick-pressed')}></Text>
|
<Text className={classnames(styles.miconfont, 'iconfont icon-zhuyi')}></Text>
|
||||||
<View className={styles.title_msg_con}>
|
<View className={styles.title_msg_con}>
|
||||||
<Text>修改收货地址可能会影响发货时效</Text>
|
<Text>修改收货地址可能会影响发货时效</Text>
|
||||||
<Text>若商品已发货,则不能修改</Text>
|
<Text>若商品已发货,则不能修改</Text>
|
||||||
@ -41,7 +41,12 @@ export default () => {
|
|||||||
<View className={styles.address_list}>
|
<View className={styles.address_list}>
|
||||||
<AddressList focusBorderEnabled={true} addButtonEnabled={false}/>
|
<AddressList focusBorderEnabled={true} addButtonEnabled={false}/>
|
||||||
</View>
|
</View>
|
||||||
|
<View className={styles.submitBtn}>
|
||||||
|
<View onClick={() => goLink('/pages/addressAdd/index', {type:'add'})} className={classnames(styles.addAddress, styles.addressBtn)}>添加新地址</View>
|
||||||
|
<View className={classnames(styles.submitUpdate, styles.addressBtn)}>提交修改</View>
|
||||||
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
<View className="common_safe_area_y"></View>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
@ -16,6 +16,7 @@ import { getParam } from "@/common/system";
|
|||||||
import useLogin from "@/use/useLogin";
|
import useLogin from "@/use/useLogin";
|
||||||
import { alert, goLink } from "@/common/common";
|
import { alert, goLink } from "@/common/common";
|
||||||
import ShipmentMode from "../editOrder/components/shipmentMode";
|
import ShipmentMode from "../editOrder/components/shipmentMode";
|
||||||
|
import SubmitOrderBtn from "./components/submitOrderBtn";
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const {checkLogin} = useLogin()
|
const {checkLogin} = useLogin()
|
||||||
@ -134,8 +135,11 @@ import ShipmentMode from "../editOrder/components/shipmentMode";
|
|||||||
|
|
||||||
//提交按钮是否可用
|
//提交按钮是否可用
|
||||||
const btnStatus = useMemo(() => {
|
const btnStatus = useMemo(() => {
|
||||||
console.log('submitOrder::',submitOrderData)
|
if( submitOrderData?.list?.length == 0 || !submitOrderData?.shipment_mode || (submitOrderData?.shipment_mode == 2 && !submitOrderData?.address_id)) {
|
||||||
return submitOrderData?.address_id&& submitOrderData.list?.length &&submitOrderData.shipment_mode
|
return false
|
||||||
|
} else {
|
||||||
|
return true
|
||||||
|
}
|
||||||
}, [submitOrderData])
|
}, [submitOrderData])
|
||||||
|
|
||||||
//提交订单
|
//提交订单
|
||||||
@ -180,7 +184,7 @@ import ShipmentMode from "../editOrder/components/shipmentMode";
|
|||||||
</View>
|
</View>
|
||||||
<View className={styles.submit_order}>
|
<View className={styles.submit_order}>
|
||||||
<View className={styles.submit_order_number}>
|
<View className={styles.submit_order_number}>
|
||||||
<EstimatedAmount style={{color:'#007AFF'}} number={formatPriceDiv(formatPreViewOrder?.estimate_amount)}/>
|
<SubmitOrderBtn style={{color:'#007AFF'}} number={formatPriceDiv(formatPreViewOrder?.estimate_amount)}/>
|
||||||
<View className={styles.order_number_desc}>{`${formatPreViewOrder?.list.length}种面料,${formatPreViewOrder?.colo_count}种颜色,共${formatPreViewOrder?.num_count + formatPreViewOrder?.unit}`}</View>
|
<View className={styles.order_number_desc}>{`${formatPreViewOrder?.list.length}种面料,${formatPreViewOrder?.colo_count}种颜色,共${formatPreViewOrder?.num_count + formatPreViewOrder?.unit}`}</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={classnames(styles.order_btn, btnStatus&&styles.ok_order_btn)} onClick={() => submitOrderEven()}>提交订单</View>
|
<View className={classnames(styles.order_btn, btnStatus&&styles.ok_order_btn)} onClick={() => submitOrderEven()}>提交订单</View>
|
||||||
|
@ -36,9 +36,9 @@ export default memo(({list = []}:{list?:Param[]}) => {
|
|||||||
<Text>{showMore&&'收起物流详情'||'点击查看更多物流详情'}</Text>
|
<Text>{showMore&&'收起物流详情'||'点击查看更多物流详情'}</Text>
|
||||||
<Text className={classnames('iconfont icon-a-moreback', styles.miconfonts, showMore&&styles.open_miconfonts)}></Text>
|
<Text className={classnames('iconfont icon-a-moreback', styles.miconfonts, showMore&&styles.open_miconfonts)}></Text>
|
||||||
</View>}
|
</View>}
|
||||||
<View className={styles.tag}>
|
{/* <View className={styles.tag}>
|
||||||
<Image src='./styles/image/hkfk.png' />
|
<Image src='./styles/image/hkfk.png' />
|
||||||
</View>
|
</View> */}
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
})
|
})
|
69
src/pages/order/components/submitOrderBtn/index.module.scss
Normal file
69
src/pages/order/components/submitOrderBtn/index.module.scss
Normal file
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
39
src/pages/order/components/submitOrderBtn/index.tsx
Normal file
39
src/pages/order/components/submitOrderBtn/index.tsx
Normal file
@ -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 (
|
||||||
|
<>
|
||||||
|
<Text>¥</Text>
|
||||||
|
<Text>{Number(int_num).toLocaleString()}</Text>
|
||||||
|
<Text>.{decimals_num}</Text>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}, [number])
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<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-a-tuikuanshouhou')}></Text>
|
||||||
|
{/* <View className={classnames(styles.message)}>123123123121212312312312312</View> */}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View className={classnames(styles.order_price_num, styles.emphasis_num)} style={style}>
|
||||||
|
{priceDom()}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
})
|
Loading…
x
Reference in New Issue
Block a user