From eea90ce2ac53d456e76c4934972762a453992ba9 Mon Sep 17 00:00:00 2001 From: xuan Date: Sat, 11 Mar 2023 18:44:41 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=88=20perf(=E4=B8=8B=E5=8D=95=E8=BF=94?= =?UTF-8?q?=E7=8E=B0):=20BD=E6=A0=87=E8=AF=86=E4=B8=8B=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/constant.ts | 1 + src/components/InputX/index.module.scss | 3 + src/components/InputX/index.tsx | 4 +- src/components/counter/index.tsx | 1 + src/components/moveBtn/index.tsx | 2 +- src/components/search/index.module.scss | 3 +- src/components/search/index.tsx | 9 +- .../components/swiper/index.module.scss | 2 +- src/pages/details/index.module.scss | 313 +++++++++--------- src/pages/details/index.tsx | 137 ++++---- src/pages/order/comfirm.module.scss | 5 +- src/pages/order/comfirm.tsx | 4 +- src/pages/order/index.module.scss | 26 +- src/pages/order/index.tsx | 89 ++--- src/pages/order/speedComfirm.tsx | 10 +- src/pages/user/index.tsx | 22 +- 16 files changed, 346 insertions(+), 285 deletions(-) create mode 100644 src/components/InputX/index.module.scss diff --git a/src/common/constant.ts b/src/common/constant.ts index 01bfccd..c4ed910 100644 --- a/src/common/constant.ts +++ b/src/common/constant.ts @@ -54,6 +54,7 @@ export const HOME_ITEM1 = getCDNSource('/mall/home_item1.png') export const HOME_ITEM2 = getCDNSource('/mall/home_item2.png') export const HOME_ITEM3 = getCDNSource('/mall/home_item3.png') export const HOME_ITEM4 = getCDNSource('/mall/home_item4.png') +export const BUSINESS_MANAGER = getCDNSource('/color_card/businessManager.png') // 场景值 export const SCENE = { diff --git a/src/components/InputX/index.module.scss b/src/components/InputX/index.module.scss new file mode 100644 index 0000000..fd0af56 --- /dev/null +++ b/src/components/InputX/index.module.scss @@ -0,0 +1,3 @@ +.input_bar { + width: 100%; +} diff --git a/src/components/InputX/index.tsx b/src/components/InputX/index.tsx index 5a761db..2b63f83 100644 --- a/src/components/InputX/index.tsx +++ b/src/components/InputX/index.tsx @@ -1,6 +1,8 @@ import { CustomWrapper, Input, View } from '@tarojs/components' +import classNames from 'classnames' import type { FC } from 'react' import React from 'react' +import styes from './index.module.scss' // 解决 input 组件输入过快会出现闪烁的问题 // https://github.com/NervJS/taro/issues/9664 interface PropsType { @@ -13,7 +15,7 @@ interface PropsType { const InputX: FC = (props) => { const { customClassName, customStyle, customInputStyle, customInputClassName, ...inputProps } = props return ( - + diff --git a/src/components/counter/index.tsx b/src/components/counter/index.tsx index 647b015..b90a569 100644 --- a/src/components/counter/index.tsx +++ b/src/components/counter/index.tsx @@ -2,6 +2,7 @@ import { CustomWrapper, Input, View } from '@tarojs/components' import { memo, useEffect, useMemo, useRef, useState } from 'react' import Big from 'big.js' import IconFont from '../iconfont/iconfont' +import InputX from '../InputX' import styles from './index.module.scss' interface params { diff --git a/src/components/moveBtn/index.tsx b/src/components/moveBtn/index.tsx index 21e18fe..e5dc9f6 100644 --- a/src/components/moveBtn/index.tsx +++ b/src/components/moveBtn/index.tsx @@ -126,7 +126,7 @@ const MoveBtn = ({ orderObj = {}, children = null, onShopClick, showList = [], m x="630rpx" y={`${screenHeight.customer}rpx`} > - + } {showCode && } diff --git a/src/components/search/index.module.scss b/src/components/search/index.module.scss index 07587b6..6fa1bba 100644 --- a/src/components/search/index.module.scss +++ b/src/components/search/index.module.scss @@ -13,7 +13,8 @@ display: flex; align-items: center; width: 100%; - input { + .input_bar { + overflow: hidden; font-size: 27px; background: #f6f7f9; width: 100%; diff --git a/src/components/search/index.tsx b/src/components/search/index.tsx index 988bd67..540d3f2 100644 --- a/src/components/search/index.tsx +++ b/src/components/search/index.tsx @@ -1,6 +1,7 @@ import { Input, View } from '@tarojs/components' import classnames from 'classnames' import { forwardRef, memo, useEffect, useImperativeHandle, useRef, useState } from 'react' +import InputX from '../InputX' import styles from './index.module.scss' import CloseBtn from '@/components/closeBtn' import { debounce } from '@/common/util' @@ -80,18 +81,18 @@ const Search = ( )} > )} - onInputEven(e)} - > + /> {!!inputCon && ( clearInput()} styleObj={{ width: '20rpx', height: '20rpx', border: '0' }} /> diff --git a/src/pages/details/components/swiper/index.module.scss b/src/pages/details/components/swiper/index.module.scss index 926728e..c59d67e 100644 --- a/src/pages/details/components/swiper/index.module.scss +++ b/src/pages/details/components/swiper/index.module.scss @@ -3,7 +3,7 @@ width: 100%; position: relative; .swiper_item { - height: 100%; + height: 450px; width: 100%; } .image_item { diff --git a/src/pages/details/index.module.scss b/src/pages/details/index.module.scss index d61bdbd..095cfa0 100644 --- a/src/pages/details/index.module.scss +++ b/src/pages/details/index.module.scss @@ -1,172 +1,189 @@ +page { + height: 100vh; + display: flex; + flex-flow: column nowrap; + overflow: hidden; +} .main { - min-height: 100%; background-color: $color_bg_one; - padding: 20px 20px 100px 20px; - .product_header { - padding: 20px 20px 0 20px; + display: flex; + height: 100%; + flex-flow: column nowrap; + overflow: hidden; + .content { + flex: 1 1 auto; + overflow: scroll; display: flex; - height: 163.57px; - background-color: #fff; - box-sizing: border-box; - border-radius: 20px; - .title { - flex: 1; - .name { - font-size: 32px; - font-weight: 700; - color: $color_font_one; - @include common_ellipsis(1); - } - .des { - font-size: $font_size_medium; - color: $color_font_three; - @include common_ellipsis(1); - margin-top: 20px; - } - } - .share, - .collect { - width: 76px; + flex-flow: column nowrap; + .product_header { + margin: 20px; + margin-bottom: 0; + padding: 20px 20px 0 20px; display: flex; - flex-flow: column nowrap; - align-items: center; - font-size: $font_size_min; - text-align: center; - color: $color_font_three; - position: relative; - margin-left: 10px; - .text { - margin-top: 5px; - font-size: $font_size_medium; - } - } - .shareBtn { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - opacity: 0; - } - .miconfont { - font-size: 45px; - color: #333333; - } - .collected { - color: #ffc300; - } - } - .des_data { - background-color: #fff; - padding: 24px; - margin-top: 16px; - border-radius: 16px; - .flexBox { - display: flex; - justify-content: space-between; - align-items: center; - margin-bottom: 20px; + height: 163.57px; + background-color: #fff; + box-sizing: border-box; + border-radius: 20px; .title { - font-size: $font_size; - font-weight: 500; - color: $color_font_one; - } - .flexRight { - font-size: 26px; - font-weight: 500; - color: #337fff; - } - } - - .con { - display: grid; - grid-template-columns: 50% 50%; - grid-template-rows: auto auto auto; - grid-template-areas: 'a b' 'c d' 'e f'; - font-size: $font_size_medium; - color: $color_font_three; - background-color: rgba(247, 247, 247, 0.6); - border-radius: 8px; - padding: 24px; - padding-bottom: 0; - color: rgba(0, 0, 0, 0.4); - .des_text { - display: flex; - margin-bottom: 24px; - font-size: 26px; - &:nth-child(5) { - grid-area: e; - } - text { - flex: 1; - color: #333333; + flex: 1; + .name { + font-size: 32px; + font-weight: 700; + color: $color_font_one; @include common_ellipsis(1); } + .des { + font-size: $font_size_medium; + color: $color_font_three; + @include common_ellipsis(1); + margin-top: 20px; + } } - } - } - - .product_color { - background-color: #fff; - margin-top: 16px; - padding: 30px 20px 0; - color: $color_font_one; - font-size: $font_size_medium; - border-radius: 20px; - .title { - color: rgba(0, 0, 0, 0.8); - font-weight: 500; - font-size: 28px; - } - .list { - margin-top: 30px; - display: grid; - grid-template-columns: 25% 25% 25% 25%; - justify-content: space-between; - .item { - width: 100%; - margin-bottom: 28px; + .share, + .collect { + width: 76px; display: flex; - flex-direction: column; + flex-flow: column nowrap; align-items: center; - padding: 0 10px; - box-sizing: border-box; - .item_color { - width: 136px; - height: 136px; - border-radius: 50%; + font-size: $font_size_min; + text-align: center; + color: $color_font_three; + position: relative; + margin-left: 10px; + .text { + margin-top: 5px; + font-size: $font_size_medium; } - .item_name { - text-align: center; - margin-top: 10px; - font-size: 24px; - color: #666666; + } + .shareBtn { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + opacity: 0; + } + .miconfont { + font-size: 45px; + color: #333333; + } + .collected { + color: #ffc300; + } + } + .des_data { + margin: 20px; + margin-bottom: 0; + background-color: #fff; + padding: 24px; + border-radius: 16px; + .flexBox { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 20px; + .title { + font-size: $font_size; + font-weight: 500; + color: $color_font_one; + } + .flexRight { + font-size: 26px; + font-weight: 500; + color: #337fff; + } + } - @include common_ellipsis; - } - .bulk_price { - color: #999999; - font-size: 24px; - margin-top: 8px; - text-align: center; + .con { + display: grid; + grid-template-columns: 50% 50%; + grid-template-rows: auto auto auto; + grid-template-areas: 'a b' 'c d' 'e f'; + font-size: $font_size_medium; + color: $color_font_three; + background-color: rgba(247, 247, 247, 0.6); + border-radius: 8px; + padding: 24px; + padding-bottom: 0; + color: rgba(0, 0, 0, 0.4); + .des_text { + display: flex; + margin-bottom: 24px; + font-size: 26px; + &:nth-child(5) { + grid-area: e; + } + text { + flex: 1; + color: #333333; + @include common_ellipsis(1); + } } } } - } - .product_detail { - // padding: 20px; - background-color: #fff; - margin-top: 16px; + + .product_color { + margin: 20px; + background-color: #fff; + padding: 30px 20px 0; + color: $color_font_one; + font-size: $font_size_medium; + border-radius: 20px; + .title { + color: rgba(0, 0, 0, 0.8); + font-weight: 500; + font-size: 28px; + } + .list { + margin-top: 30px; + display: grid; + grid-template-columns: 25% 25% 25% 25%; + justify-content: space-between; + .item { + width: 100%; + margin-bottom: 28px; + display: flex; + flex-direction: column; + align-items: center; + padding: 0 10px; + box-sizing: border-box; + .item_color { + width: 136px; + height: 136px; + border-radius: 50%; + } + .item_name { + text-align: center; + margin-top: 10px; + font-size: 24px; + color: #666666; + + @include common_ellipsis; + } + .bulk_price { + color: #999999; + font-size: 24px; + margin-top: 8px; + text-align: center; + } + } + } + } + .product_detail { + // padding: 20px; + background-color: #fff; + margin: 20px; + } } .product_buy { + position: relative; + z-index: 9999; display: flex; justify-content: space-between; align-items: center; - height: 95px; + padding: 20px; + box-shadow: 6px 0px 12px 0px rgba(0, 0, 0, 0.16); width: 100vw; - position: fixed; - bottom: 0; - left: 0; background-color: #fff; padding-bottom: constant(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom); diff --git a/src/pages/details/index.tsx b/src/pages/details/index.tsx index 649c53a..2bdd837 100644 --- a/src/pages/details/index.tsx +++ b/src/pages/details/index.tsx @@ -277,86 +277,92 @@ const Details = (props: Params) => { return ( - - - - {productInfo.code && {productName}} - {productInfo.describe} + + + + + {productInfo.code && {productName}} + {productInfo.describe} + + + { + collectStatus ? : + } + 收藏 + + + + 分享 + + - - { - collectStatus ? : - } - 收藏 - - - - 分享 - - - - - - 商品参数 - { - productInfo.is_instruct && setshowPopup(true)}>{'特色百科 >'} - } - - - {/* + + + 商品参数 + { + productInfo.is_instruct && setshowPopup(true)}>{'特色百科 >'} + } + + + {/* 编号:{productInfo.code} */} - + 幅宽:{productInfo.width} - - + + 工艺:{productInfo.craft} - - + + 空差:{productInfo.weight_error_discount / 1000}KG - - + + 克重:{productInfo.weight_density} - - + + 成分:{productInfo.component} - - + + 纸筒:{productInfo.tube / 1000}KG - - + + 出米数:{productInfo.length_to_weight_rate / 100} - - + + 开单减空差:{productInfo.weight_error / 1000}KG + - - {!!productInfo?.product_screw_id && } - - 色号信息 ({productInfo?.product_color_list?.length}) - - {productInfo?.product_color_list?.map((item) => { - return ( - handleClickProductColor(item)}> - - + + {!!productInfo?.product_screw_id + && + + } + + 色号信息 ({productInfo?.product_color_list?.length}) + + {productInfo?.product_color_list?.map((item) => { + return ( + handleClickProductColor(item)}> + + + + {item.name} + {formatPriceDiv(item.bulk_price)}/Kg{ + (item!.last_bulk_price && item!.bulk_price !== item!.last_bulk_price) ? (item.bulk_price > item.last_bulk_price) ? : : null + } - {item.name} - {formatPriceDiv(item.bulk_price)}/Kg{ - (item!.last_bulk_price && item!.bulk_price !== item!.last_bulk_price) ? (item.bulk_price > item.last_bulk_price) ? : : null - } - - ) - })} + ) + })} + + + + - - - @@ -443,7 +449,6 @@ const Details = (props: Params) => { setShowColorSelect(false)} /> - ) diff --git a/src/pages/order/comfirm.module.scss b/src/pages/order/comfirm.module.scss index 8825f53..fe5a899 100644 --- a/src/pages/order/comfirm.module.scss +++ b/src/pages/order/comfirm.module.scss @@ -4,6 +4,7 @@ page { flex-flow: column nowrap; } .order_main { + height: 100%; background-color: $color_bg_one; box-sizing: border-box; display: flex; @@ -24,7 +25,6 @@ page { display: flex; justify-content: center; flex-direction: column; - align-items: center; text-align: center; .flexBox { display: flex; @@ -37,7 +37,6 @@ page { height: 24px; color: #fff; display: flex; - align-items: center; justify-content: center; background-color: #ffac00; font-size: 20px; @@ -112,6 +111,8 @@ page { } } .submit_order { + position: relative; + z-index: 9999; display: flex; justify-content: space-between; width: 100%; diff --git a/src/pages/order/comfirm.tsx b/src/pages/order/comfirm.tsx index a5a17bf..b0cc65c 100644 --- a/src/pages/order/comfirm.tsx +++ b/src/pages/order/comfirm.tsx @@ -223,7 +223,9 @@ const Comfirm = () => { setShowDesc(false)}> - getRemark(e)} /> + { + showDesc && getRemark(e)} /> + } diff --git a/src/pages/order/index.module.scss b/src/pages/order/index.module.scss index be4c9bc..fac28a5 100644 --- a/src/pages/order/index.module.scss +++ b/src/pages/order/index.module.scss @@ -1,13 +1,24 @@ +page { + height: 100vh; + display: flex; + flex-flow: column nowrap; +} .movable_area { width: 100%; } .order_main { - min-height: 100%; background-color: $color_bg_one; - padding: 20px; - padding-bottom: 190px; box-sizing: border-box; - + display: flex; + height: 100%; + flex-flow: column nowrap; + overflow: hidden; + .order_content { + flex: 1 1 auto; + display: flex; + flex-flow: column nowrap; + overflow-y: scroll; + } .order_title { display: flex; align-items: center; @@ -68,14 +79,15 @@ } } .submit_order_con { - position: fixed; - bottom: 0; - left: 0; + position: relative; + z-index: 9999; width: 100%; background-color: #fff; box-shadow: 6px 0px 12px 0px rgba(0, 0, 0, 0.16); padding: 20px 20px; box-sizing: border-box; + padding-bottom: constant(safe-area-inset-bottom); + padding-bottom: env(safe-area-inset-bottom); .order_btn { width: 152px; height: 72px; diff --git a/src/pages/order/index.tsx b/src/pages/order/index.tsx index 9ca06cc..ebe3950 100644 --- a/src/pages/order/index.tsx +++ b/src/pages/order/index.tsx @@ -303,60 +303,71 @@ const Order = () => { return ( - {(orderDetail?.status != SaleorderstatusWaitingPrePayment.value && ) || ( - - )} - - - - - - 订单信息 - - - {orderDetail?.order_no} - clipboardData()}> + + + {(orderDetail?.status != SaleorderstatusWaitingPrePayment.value && ) || ( + + )} + + + + + + + + + + + 订单信息 + + + {orderDetail?.order_no} + clipboardData()}> 复制 - + + + + + {formatDateTime(orderDetail?.create_time)} + + {orderDetail?.payment_time && ( + + {formatDateTime(orderDetail?.payment_time)} + + )} - - - {formatDateTime(orderDetail?.create_time)} - - {orderDetail?.payment_time && ( - - {formatDateTime(orderDetail?.payment_time)} - - )} - - - 订单备注 - {(orderRemark && {orderDetail?.remark}) || ( - 填写备注 - )} - + + + + 订单备注 + {(orderRemark && {orderDetail?.remark}) || ( + 填写备注 + )} + + + {orderDetail?.status != SaleOrderStatusCancel.value && ( - )} setShowDesc(false)}> - getRemark(e)} defaultValue={orderDetail?.remark} /> + { + showDesc && getRemark(e)} defaultValue={orderDetail?.remark} /> + } setShowScanPayCheck(false)} orderInfo={orderDetail} /> setShowCart(false)} /> - ) diff --git a/src/pages/order/speedComfirm.tsx b/src/pages/order/speedComfirm.tsx index 2ddfdf7..467bd31 100644 --- a/src/pages/order/speedComfirm.tsx +++ b/src/pages/order/speedComfirm.tsx @@ -225,13 +225,13 @@ const SpeedComfirm = () => { } - + - + - + setShowDesc(true)}> 订单备注 {(submitOrderData?.remark && {submitOrderData?.remark}) || 填写备注} @@ -253,7 +253,9 @@ const SpeedComfirm = () => { setShowDesc(false)}> - getRemark(e)} /> + { + showDesc && getRemark(e)} /> + } diff --git a/src/pages/user/index.tsx b/src/pages/user/index.tsx index 2167b80..e322cfd 100644 --- a/src/pages/user/index.tsx +++ b/src/pages/user/index.tsx @@ -181,18 +181,20 @@ export default () => { - - - 下单返现活动 - - - - 活动返现收益(元) - ¥ {formatPriceDiv(state.data.total_income, 100, true)} 昨日收益 {formatPriceDiv(state.data.today_income, 100, true)} + { + !userInfo?.adminUserInfo?.is_bd && + + 下单返现活动 + + + + 活动返现收益(元) + ¥ {formatPriceDiv(state.data.total_income, 100, true)} 昨日收益 {formatPriceDiv(state.data.today_income, 100, true)} + + goLink('/pages/activityIncome/index')}>查看收益 - goLink('/pages/activityIncome/index')}>查看收益 - + } 我的服务