商城测试版v6
This commit is contained in:
parent
ed9f9420db
commit
fc930781e9
@ -33,5 +33,8 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
sass: {
|
sass: {
|
||||||
resource: path.resolve(__dirname, '..', 'src/styles/common.scss')
|
resource: path.resolve(__dirname, '..', 'src/styles/common.scss')
|
||||||
}
|
},
|
||||||
|
// plugins: [
|
||||||
|
// '@tarojs/plugin-react-devtools'
|
||||||
|
// ],
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.8.0",
|
"@babel/core": "^7.8.0",
|
||||||
"@tarojs/mini-runner": "3.3.10",
|
"@tarojs/mini-runner": "3.3.10",
|
||||||
|
"@tarojs/plugin-react-devtools": "^3.4.13",
|
||||||
"@tarojs/webpack-runner": "3.3.10",
|
"@tarojs/webpack-runner": "3.3.10",
|
||||||
"@types/qs": "^6.9.7",
|
"@types/qs": "^6.9.7",
|
||||||
"@types/react": "^17.0.2",
|
"@types/react": "^17.0.2",
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
// export const BASE_URL = `http://10.0.0.5:50001/lymarket`
|
// export const BASE_URL = `http://10.0.0.5:50001/lymarket`
|
||||||
// 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.9:40001/lymarket` // 发
|
// export const BASE_URL = `http://192.168.1.9:40001/lymarket` // 发
|
||||||
// export const BASE_URL = `http://192.168.1.9:50005/lymarket` // 发
|
// export const BASE_URL = `http://192.168.1.9:50005/lymarket` // 发
|
||||||
// export const BASE_URL = `http://192.168.1.30:50001/lymarket` // 发
|
// export const BASE_URL = `http://192.168.1.30:50001/lymarket` // 发
|
||||||
@ -12,7 +12,7 @@
|
|||||||
// 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.5:40001/lymarket` // 王霞
|
// export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞
|
||||||
// export const BASE_URL = `http://192.168.1.7:50002/lymarket` // 添
|
// export const BASE_URL = `http://192.168.1.7:50002/lymarket` // 添
|
||||||
export const BASE_URL = `http://192.168.1.42:50001/lymarket` // 杰
|
// export const BASE_URL = `http://192.168.1.42:50001/lymarket` // 杰
|
||||||
|
|
||||||
// CDN
|
// CDN
|
||||||
// 生成密钥
|
// 生成密钥
|
||||||
|
@ -37,10 +37,12 @@ export const weightDigit = 1000
|
|||||||
* 除以
|
* 除以
|
||||||
* @param {*} val
|
* @param {*} val
|
||||||
* @param {*} digit
|
* @param {*} digit
|
||||||
|
* @param {*} priceStatus //是否显示千位分割
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export const formatPriceDiv = (val, digit = Digit) => {
|
export const formatPriceDiv = (val, digit = Digit, priceStatus = false) => {
|
||||||
return strip(Number(val / digit)) || 0
|
let res = strip(Number(val / digit)) || 0
|
||||||
|
return priceStatus?res.toLocaleString('en', {minimumFractionDigits: 2}):res
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 乘以
|
* 乘以
|
||||||
|
@ -45,13 +45,14 @@ export default memo(({orderInfo, onClick, fixedBottom = true}:Param) => {
|
|||||||
// SaLeModeWeightCut,
|
// SaLeModeWeightCut,
|
||||||
// } = SALE_MODE
|
// } = SALE_MODE
|
||||||
|
|
||||||
//售后按钮按售后状态归类, value是该订单状态,可能该按钮会出现
|
//注册订单
|
||||||
const orderBtnsList = useRef([
|
const orderBtnsList = useRef([
|
||||||
{
|
{
|
||||||
id: 8,
|
id: 8,
|
||||||
big_value: [ReturnStageQualityCheckPendingRefund.value, ReturnStageServiceOrderPendingRefund.value],
|
big_value: [ReturnStageQualityCheckPendingRefund.value, ReturnStageServiceOrderPendingRefund.value],
|
||||||
cut_value: [ReturnStageQualityCheckPendingRefund.value, ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value ],
|
cut_value: [ReturnStageQualityCheckPendingRefund.value, ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value ],
|
||||||
model_value: [],
|
model_value: [],
|
||||||
|
|
||||||
label: '申请记录'
|
label: '申请记录'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -136,4 +136,20 @@
|
|||||||
font-size: 23px;
|
font-size: 23px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
.pay_title_tag{
|
||||||
|
margin-top: 10px;
|
||||||
|
font-size: 24px;
|
||||||
|
color: #EE7500;
|
||||||
|
background: rgba(255,230,206,0.36);
|
||||||
|
border-radius: 10px;
|
||||||
|
height: 56px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
position: relative;
|
||||||
|
z-index: 999;
|
||||||
|
.miconfont {
|
||||||
|
font-size: 30px;
|
||||||
|
padding: 0 20px;
|
||||||
|
}
|
||||||
}
|
}
|
@ -20,10 +20,15 @@ type Param = {
|
|||||||
logistics_details:List[], //订单状态列表
|
logistics_details:List[], //订单状态列表
|
||||||
payment_method: number, //支付方式
|
payment_method: number, //支付方式
|
||||||
status: number, //订单状态
|
status: number, //订单状态
|
||||||
|
account_period?: number, //账期
|
||||||
|
account_period_time?: string //还款日期
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(({orderInfo = {logistics_details: [],payment_method: 0, status: 0}, onRefresh}:Param) => {
|
export default memo(({orderInfo = {logistics_details: [],payment_method: 0, status: 0}, onRefresh}:Param) => {
|
||||||
|
useEffect(() => {
|
||||||
|
console.log('orderInfo33::',orderInfo)
|
||||||
|
}, [orderInfo])
|
||||||
|
|
||||||
const [showMore, setShowMore] = useState(false)
|
const [showMore, setShowMore] = useState(false)
|
||||||
const changeMore = () => {
|
const changeMore = () => {
|
||||||
@ -42,13 +47,6 @@ export default memo(({orderInfo = {logistics_details: [],payment_method: 0, stat
|
|||||||
PaymentMethodCashOnDelivery,
|
PaymentMethodCashOnDelivery,
|
||||||
} = PAYMENT_METHOD
|
} = PAYMENT_METHOD
|
||||||
|
|
||||||
//获取预付款最后时间
|
|
||||||
const endTime = useMemo(() => {
|
|
||||||
if(orderInfo.status == SaleorderstatusWaitingPrePayment.value && orderInfo.logistics_details.length > 0) {
|
|
||||||
return orderInfo.logistics_details[0].expire_time
|
|
||||||
}
|
|
||||||
return ''
|
|
||||||
}, [orderInfo])
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{(dataList?.length > 0)&&<View className={styles.order_flow_state}>
|
{(dataList?.length > 0)&&<View className={styles.order_flow_state}>
|
||||||
@ -61,7 +59,6 @@ export default memo(({orderInfo = {logistics_details: [],payment_method: 0, stat
|
|||||||
<View className={classnames(styles.order_status_time, (index == 0)&&styles.order_status_select)}>{formatDateTime(item.time)}</View>
|
<View className={classnames(styles.order_status_time, (index == 0)&&styles.order_status_select)}>{formatDateTime(item.time)}</View>
|
||||||
</View>
|
</View>
|
||||||
<Text className={classnames(styles.order_status_des, (index == 0)&&styles.order_status_des_select)}>{item.desc}</Text>
|
<Text className={classnames(styles.order_status_des, (index == 0)&&styles.order_status_des_select)}>{item.desc}</Text>
|
||||||
{(orderInfo.status == SaleorderstatusWaitingPrePayment.value)&&<CountDown onFinish={onRefresh} endTime={endTime}/>}
|
|
||||||
</View>)}
|
</View>)}
|
||||||
</View>
|
</View>
|
||||||
{(dataList.length > 2) && <View className={styles.more} onClick={() => changeMore()}>
|
{(dataList.length > 2) && <View className={styles.more} onClick={() => changeMore()}>
|
||||||
@ -72,59 +69,11 @@ export default memo(({orderInfo = {logistics_details: [],payment_method: 0, stat
|
|||||||
{(orderInfo.payment_method == PaymentMethodCashOnDelivery.value)&&<Image mode="aspectFit" src={formatImgUrl('/mall/order_pay_status.png')} className={styles.image}/>}
|
{(orderInfo.payment_method == PaymentMethodCashOnDelivery.value)&&<Image mode="aspectFit" src={formatImgUrl('/mall/order_pay_status.png')} className={styles.image}/>}
|
||||||
{(orderInfo.payment_method == PaymentMethodAccountPeriod.value)&&<Image mode="aspectFit" src={formatImgUrl('/mall/order_pay_status_day.png')} className={styles.image}/>}
|
{(orderInfo.payment_method == PaymentMethodAccountPeriod.value)&&<Image mode="aspectFit" src={formatImgUrl('/mall/order_pay_status_day.png')} className={styles.image}/>}
|
||||||
</View>
|
</View>
|
||||||
{(orderInfo.status == SaleorderstatusWaitingPrePayment.value)&&<View className={styles.refresh} onClick={onRefresh}>
|
</View>}
|
||||||
<Text className={classnames(styles.mconfont, 'iconfont icon-xianxiahuikuan')}></Text>
|
{(orderInfo.payment_method == PaymentMethodAccountPeriod.value)&&<View className={styles.pay_title_tag}>
|
||||||
<Text className={classnames(styles.refresh_text)}>刷新</Text>
|
<Text className={classnames(styles.miconfont, 'iconfont icon-zhuyi')}></Text>
|
||||||
</View>}
|
您使用了{orderInfo.account_period}天账期支付,还款日期为{formatDateTime(orderInfo.account_period_time)}
|
||||||
</View>}
|
</View>}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
//倒计时
|
|
||||||
const CountDown = ({endTime = '', onFinish}:{endTime:string, onFinish?:() => void}) => {
|
|
||||||
const [showTime, setShowTime] = useState('')
|
|
||||||
const timeObj:any = useRef()
|
|
||||||
useEffect(() => {
|
|
||||||
if(endTime) {
|
|
||||||
clearInterval(timeObj.current)
|
|
||||||
timeObj.current = setInterval(() => {
|
|
||||||
count_down()
|
|
||||||
}, 1000)
|
|
||||||
}
|
|
||||||
return () => {
|
|
||||||
clearInterval(timeObj.current)
|
|
||||||
}
|
|
||||||
}, [endTime])
|
|
||||||
const count_down = () => {
|
|
||||||
var startData = dayjs();
|
|
||||||
var endDate = dayjs(endTime);
|
|
||||||
if(startData >= endDate) {
|
|
||||||
clearInterval(timeObj.current)
|
|
||||||
onFinish?.()
|
|
||||||
setShowTime(() => '00:00:00')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
var _dd = endDate.diff(startData,'day');
|
|
||||||
var _hh = endDate.diff(startData,'hour');
|
|
||||||
var _mm = endDate.diff(startData,'minute');
|
|
||||||
var _ss = endDate.diff(startData,'second');
|
|
||||||
// 转换
|
|
||||||
var hh = _hh - (_dd*24);
|
|
||||||
var mm = _mm - (_hh*60);
|
|
||||||
var ss = _ss - (_mm*60);
|
|
||||||
// 格式化
|
|
||||||
var DD = ('00'+_dd).slice(-2);
|
|
||||||
var HH = ('00'+hh).slice(-2);
|
|
||||||
var MM = ('00'+mm).slice(-2);
|
|
||||||
var SS = ('00'+ss).slice(-2);
|
|
||||||
setShowTime(() => ` ${HH}:${MM}:${SS}`)
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<View className={styles.pay_time}>
|
|
||||||
剩<Text>{showTime||'--:--:--'}</Text>支付关闭,订单自动取消
|
|
||||||
</View>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
@ -1,9 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
GetSaleOrderDetailApi,
|
GetSaleOrderDetailApi,
|
||||||
EditSaleOrderRemarkApi,
|
EditSaleOrderRemarkApi,
|
||||||
CancelOrderApi
|
|
||||||
} from "@/api/order";
|
} from "@/api/order";
|
||||||
import { GetOrderPayApi } from "@/api/orderPay";
|
|
||||||
import { AddShoppingCartApi } from "@/api/shopCart";
|
import { AddShoppingCartApi } from "@/api/shopCart";
|
||||||
import { SubscriptionMessageApi } from "@/api/user";
|
import { SubscriptionMessageApi } from "@/api/user";
|
||||||
import { alert, goLink } from "@/common/common";
|
import { alert, goLink } from "@/common/common";
|
||||||
@ -14,10 +12,9 @@ import Popup from "@/components/popup";
|
|||||||
import SearchInput from "@/components/searchInput";
|
import SearchInput from "@/components/searchInput";
|
||||||
import ShopCart from "@/components/shopCart";
|
import ShopCart from "@/components/shopCart";
|
||||||
import useLogin from "@/use/useLogin";
|
import useLogin from "@/use/useLogin";
|
||||||
import { Text, Textarea, View } from "@tarojs/components"
|
import { Text, View } from "@tarojs/components"
|
||||||
import Taro, { useDidShow, usePullDownRefresh, useRouter } from "@tarojs/taro";
|
import Taro, { useDidShow, usePullDownRefresh, useRouter } from "@tarojs/taro";
|
||||||
import classnames from "classnames";
|
import classnames from "classnames";
|
||||||
import dayjs from "dayjs";
|
|
||||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||||
import AddressInfoDetail from "./components/addressInfoDetail";
|
import AddressInfoDetail from "./components/addressInfoDetail";
|
||||||
import AdvanceOrderState from "./components/advanceOrderState";
|
import AdvanceOrderState from "./components/advanceOrderState";
|
||||||
@ -93,6 +90,7 @@ import styles from './index.module.scss'
|
|||||||
total_weight_error_discount: orderDetail.total_weight_error_discount, //空差优惠
|
total_weight_error_discount: orderDetail.total_weight_error_discount, //空差优惠
|
||||||
actual_amount: orderDetail.actual_amount, //实付金额
|
actual_amount: orderDetail.actual_amount, //实付金额
|
||||||
the_previous_status: orderDetail.the_previous_status, //取消订单时的订单状态
|
the_previous_status: orderDetail.the_previous_status, //取消订单时的订单状态
|
||||||
|
account_period: orderDetail.account_period
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -252,7 +250,6 @@ import styles from './index.module.scss'
|
|||||||
urls: list // 需要预览的图片http链接列表
|
urls: list // 需要预览的图片http链接列表
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}, [orderDetail])
|
}, [orderDetail])
|
||||||
|
|
||||||
//添加购物车
|
//添加购物车
|
||||||
|
@ -130,7 +130,7 @@ export default memo(({value, onClickBtn}: Param) => {
|
|||||||
</View>
|
</View>
|
||||||
<View className={styles.color_count_num}>
|
<View className={styles.color_count_num}>
|
||||||
<Text>{numText}</Text>
|
<Text>{numText}</Text>
|
||||||
{(value.total_sale_price||value.estimate_amount)&& <Text className={styles.price}><Text>¥</Text>{value.total_sale_price||value.estimate_amount}</Text>}
|
{(value.total_sale_price/100||value.estimate_amount/100)&& <Text className={styles.price}><Text>¥</Text>{formatPriceDiv(value.total_sale_price, 100, true)||formatPriceDiv(value.estimate_amount, 100, true)}</Text>}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<OrderBtns orderInfo={orderInfo} onClick={orderBtnsClick}/>
|
<OrderBtns orderInfo={orderInfo} onClick={orderBtnsClick}/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user