diff --git a/src/pages/details/index.tsx b/src/pages/details/index.tsx index 537a5e1..f36751e 100644 --- a/src/pages/details/index.tsx +++ b/src/pages/details/index.tsx @@ -254,7 +254,7 @@ export default (props: Params) => { sendMessageImg={shareImg} sendMessageTitle={productName} showMessageCard={true} - sendMessagePath={`pages/details/index?id=${productInfo.id}`}> + sendMessagePath={`/pages/details/index?id=${productInfo.id}`}> setShowCart(true)}> diff --git a/src/pages/order/components/movableAreaBtn/index.module.scss b/src/pages/order/components/movableAreaBtn/index.module.scss new file mode 100644 index 0000000..567e62b --- /dev/null +++ b/src/pages/order/components/movableAreaBtn/index.module.scss @@ -0,0 +1,43 @@ +.movableItem { + width: 100%; + height: 100%; + position: relative; +} +.moveBtn { + width: 100px; + height: 100px; + border-radius: 50%; + border: 2px solid #cde5ff; + box-shadow: 0px 0px 20px 0px rgba(104, 180, 255, 0.7); + background-color: #fff; + display: flex; + justify-content: center; + align-items: center; + z-index: 999; + .shop_icon { + font-size: 70px; + color: $color_main; + } + .product_num { + position: absolute; + font-size: 23px; + background-color: red; + color: #fff; + height: 36px; + line-height: 36px; + padding: 0 6px; + border-radius: 72px; + min-width: 25px; + text-align: center; + top: 0; + right: 0; + } + .wxBtn { + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; + opacity: 0; + } +} diff --git a/src/pages/order/components/movableAreaBtn/index.tsx b/src/pages/order/components/movableAreaBtn/index.tsx new file mode 100644 index 0000000..c813fab --- /dev/null +++ b/src/pages/order/components/movableAreaBtn/index.tsx @@ -0,0 +1,38 @@ +import { Button, MovableArea, MovableView, View } from '@tarojs/components' +import Taro, { useReady } from '@tarojs/taro' +import { ReactElement, useEffect, useLayoutEffect, useRef, useState } from 'react' +import classnames from 'classnames' +import styles from './index.module.scss' + +type param = { + children?: ReactElement | null + orderInfo?: any +} +export default ({ children = null, orderInfo }: param) => { + const [screenHeight, setScreenHeight] = useState(0) + const screenWidthRef = useRef(0) + useLayoutEffect(() => { + const res = Taro.getSystemInfoSync() + if (res.screenHeight) { + let ratio = 750 / res.screenWidth + setScreenHeight(res.screenHeight * ratio - 600) + screenWidthRef.current = res.screenWidth / 2 + } + }) + + return ( + + {children} + + + + + + + ) +} diff --git a/src/pages/order/index.module.scss b/src/pages/order/index.module.scss index 9220587..be4c9bc 100644 --- a/src/pages/order/index.module.scss +++ b/src/pages/order/index.module.scss @@ -1,3 +1,6 @@ +.movable_area { + width: 100%; +} .order_main { min-height: 100%; background-color: $color_bg_one; diff --git a/src/pages/order/index.tsx b/src/pages/order/index.tsx index 348cec5..03c1abf 100644 --- a/src/pages/order/index.tsx +++ b/src/pages/order/index.tsx @@ -9,7 +9,7 @@ import Popup from '@/components/popup' import SearchInput from '@/components/searchInput' import ShopCart from '@/components/shopCart' import useLogin from '@/use/useLogin' -import { Text, View } from '@tarojs/components' +import { MovableArea, Text, View } from '@tarojs/components' import Taro, { useDidShow, usePullDownRefresh, useRouter } from '@tarojs/taro' import classnames from 'classnames' import { useCallback, useEffect, useMemo, useRef, useState } from 'react' @@ -17,6 +17,7 @@ import AddressInfoDetail from './components/addressInfoDetail' import AdvanceOrderState from './components/advanceOrderState' import ApplyRefund from './components/applyRefund' import KindList from './components/kindList' +import MovableAreaBtn from './components/movableAreaBtn' import OrderState from './components/orderState' import Payment from './components/payment' import Remark from './components/remark' @@ -283,61 +284,63 @@ export default () => { const [showScanPayCheck, setShowScanPayCheck] = useState(false) return ( - - {(orderDetail?.status != SaleorderstatusWaitingPrePayment.value && ) || ( - - )} - - - - - - 订单信息 - - - {orderDetail?.order_no} - clipboardData()}> - 复制 - - - - - {formatDateTime(orderDetail?.create_time)} - - {orderDetail?.payment_time && ( - - {formatDateTime(orderDetail?.payment_time)} - + + + {(orderDetail?.status != SaleorderstatusWaitingPrePayment.value && ) || ( + )} - - - 订单备注 - {(orderRemark && {orderDetail?.remark}) || ( - 填写备注 - )} - - - {orderDetail?.status != SaleOrderStatusCancel.value && ( - - - + + - )} - setShowDesc(false)}> - getRemark(e)} defaultValue={orderDetail?.remark} /> - - - setShowScanPayCheck(false)} orderInfo={orderDetail} /> - - setShowCart(false)} /> - - - + + + 订单信息 + + + {orderDetail?.order_no} + clipboardData()}> + 复制 + + + + + {formatDateTime(orderDetail?.create_time)} + + {orderDetail?.payment_time && ( + + {formatDateTime(orderDetail?.payment_time)} + + )} + + + 订单备注 + {(orderRemark && {orderDetail?.remark}) || ( + 填写备注 + )} + + + {orderDetail?.status != SaleOrderStatusCancel.value && ( + + + + + )} + setShowDesc(false)}> + getRemark(e)} defaultValue={orderDetail?.remark} /> + + + setShowScanPayCheck(false)} orderInfo={orderDetail} /> + + setShowCart(false)} /> + + + + ) }