🎈 perf(优化我的页面获取手机号码操作):

This commit is contained in:
czm 2022-12-12 11:33:25 +08:00
parent 87b45dc855
commit 09d8d8f1ca
5 changed files with 35 additions and 16 deletions

View File

@ -1,3 +1,4 @@
<<<<<<< HEAD
import React, { useState, useEffect, FC } from "react";
import { Block, View } from "@tarojs/components";
import "./iconfont.scss";
@ -24,7 +25,7 @@ function hex2rgb(hex) {
return "rgb(" + rgb.join(",") + ")";
}
export type IconNames = 'icon-rukou' | 'icon-renzhengchenggong' | 'icon-wodekefu' | 'icon-yanseduibi' | 'icon-dizhiguanli' | 'icon-weixin' | 'icon-riqi' | 'icon-shuru' | 'icon-a-0tianzhangqi' | 'icon-huodaofukuan' | 'icon-huozhuziti' | 'icon-saomazhifu' | 'icon-xianxiahuikuan' | 'icon-yufukuan' | 'icon-xinzengshoucangjia' | 'icon-qingchusousuo' | 'icon-xuanzechenggong' | 'icon-gongnengtubiao-saomiao' | 'icon-bianjizidingyimadan' | 'icon-zidingyimadanyulan' | 'icon-yuanshimadanyulan' | 'icon-xiala' | 'icon-shangla' | 'icon-qingchuxinxi' | 'icon-sousuo' | 'icon-guanli' | 'icon-bianji' | 'icon-shoucangjia' | 'icon-shezhi' | 'icon-tishi' | 'icon-erweima' | 'icon-dianjishoucang' | 'icon-gouwuche' | 'icon-shoucangchenggong' | 'icon-fenxiangshangpin' | 'icon-kefu' | 'icon-xinzenganniu' | 'icon-jianshaoanniu' | 'icon-daifahuo2' | 'icon-daishouhuo2' | 'icon-tuikuan-shouhou' | 'icon-daipeibu2' | 'icon-daifukuan2';
export type IconNames = 'icon-rukou' | 'icon-renzhengchenggong' | 'icon-paixu' | 'icon-shaixuan' | 'icon-bodakehujingli' | 'icon-guanfangweixinkefu' | 'icon-tuijianbiaoqian' | 'icon-rukou' | 'icon-renzhengchenggong' | 'icon-wodekefu' | 'icon-yanseduibi' | 'icon-dizhiguanli' | 'icon-weixin' | 'icon-riqi' | 'icon-shuru' | 'icon-a-0tianzhangqi' | 'icon-huodaofukuan' | 'icon-huozhuziti' | 'icon-saomazhifu' | 'icon-xianxiahuikuan' | 'icon-yufukuan' | 'icon-xinzengshoucangjia' | 'icon-qingchusousuo' | 'icon-xuanzechenggong' | 'icon-gongnengtubiao-saomiao' | 'icon-bianjizidingyimadan' | 'icon-zidingyimadanyulan' | 'icon-yuanshimadanyulan' | 'icon-xiala' | 'icon-shangla' | 'icon-qingchuxinxi' | 'icon-sousuo' | 'icon-guanli' | 'icon-bianji' | 'icon-shoucangjia' | 'icon-shezhi' | 'icon-tishi' | 'icon-erweima' | 'icon-dianjishoucang' | 'icon-gouwuche' | 'icon-shoucangchenggong' | 'icon-fenxiangshangpin' | 'icon-kefu' | 'icon-xinzenganniu' | 'icon-jianshaoanniu' | 'icon-daifahuo2' | 'icon-daishouhuo2' | 'icon-tuikuan-shouhou' | 'icon-daipeibu2' | 'icon-daifukuan2';
type PropsType = {
name: IconNames;
@ -82,7 +83,22 @@ const IconFont:FC<PropsType> = ({
className={classnames(icon, customClassName)}
/>
)} */}
{/* icon-rukou */}
{/* icon-paixu */}
{ name === 'icon-paixu' && (<View style={{backgroundImage: `url(${quot}data:image/svg+xml, %3Csvg viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg' width='${svgSize}px' height='${svgSize}px'%3E%3Cpath d='M512 940l200-260H312zM512 84l200 260H312z' fill='${(isStr ? colors : colors?.[0]) || 'rgb(0,0,0)'}' opacity='.5' /%3E%3C/svg%3E${quot})`, width: `${svgSize}px`, height: `${svgSize}px`, ...customStyle}} className={classnames("icon", customClassName)} />) }
{/* icon-shaixuan */}
{ name === 'icon-shaixuan' && (<View style={{backgroundImage: `url(${quot}data:image/svg+xml, %3Csvg viewBox='0 0 1105 1024' xmlns='http://www.w3.org/2000/svg' width='${svgSize}px' height='${svgSize}px'%3E%3Cpath d='M725.85216 20.48a61.44 61.44 0 0 1 41.69728 106.57792L552.96 325.09952V960.9216a61.44 61.44 0 0 1-57.83552 61.31712L491.52 1022.3616a61.44 61.44 0 0 1-38.37952-13.47584l-163.84-131.072A61.44 61.44 0 0 1 266.24 829.8496V325.14048L51.65056 127.05792a61.44 61.44 0 0 1-6.02112-83.88608l2.58048-2.90816A61.44 61.44 0 0 1 93.34784 20.48z m-52.38784 81.92H145.73568l182.6816 168.63232a61.44 61.44 0 0 1 19.57888 40.87808l0.16384 4.25984v503.808l122.88 98.304V316.2112a61.44 61.44 0 0 1 16.71168-42.14784l3.072-2.99008L673.46432 102.4zM1064.96 798.72a40.96 40.96 0 0 1 3.072 81.79712L1064.96 880.64h-327.68a40.96 40.96 0 0 1-3.072-81.79712L737.28 798.72h327.68z m0-245.76a40.96 40.96 0 0 1 3.072 81.79712L1064.96 634.88h-327.68a40.96 40.96 0 0 1-3.072-81.79712L737.28 552.96h327.68z m0-245.76a40.96 40.96 0 0 1 3.072 81.79712L1064.96 389.12h-327.68a40.96 40.96 0 0 1-3.072-81.79712L737.28 307.2h327.68z' fill='${(isStr ? colors : colors?.[0]) || 'rgb(124,124,124)'}' /%3E%3C/svg%3E${quot})`, width: `${svgSize}px`, height: `${svgSize}px`, ...customStyle}} className={classnames("icon", customClassName)} />) }
{/* icon-bodakehujingli */}
{ name === 'icon-bodakehujingli' && (<View style={{backgroundImage: `url(${quot}data:image/svg+xml, %3Csvg viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg' width='${svgSize}px' height='${svgSize}px'%3E%3Cpath d='M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z' fill='${(isStr ? colors : colors?.[0]) || 'rgb(252,168,70)'}' /%3E%3Cpath d='M742.257778 704.981333c19.712-34.204444 8.789333-60.472889-26.126222-86.755555-41.059556-30.890667-81.180444-51.669333-110.023112-18.375111 0 0-30.606222 36.309333-120.704-48.668445-104.746667-99.512889-60.785778-134.812444-60.785777-134.812444 36.437333-36.494222 13.269333-63.729778-17.28-104.96-30.563556-41.244444-61.425778-54.300444-105.728-18.830222-85.390222 68.352 35.015111 228.835556 95.886222 291.242666 0 0 92.558222 95.431111 150.812444 127.189334l31.160889 17.365333c44.700444 22.855111 94.904889 33.322667 130.247111 12.088889 0 0 17.038222-8.732444 32.526223-35.484445z' fill='${(isStr ? colors : colors?.[1]) || 'rgb(255,255,255)'}' /%3E%3C/svg%3E${quot})`, width: `${svgSize}px`, height: `${svgSize}px`, ...customStyle}} className={classnames("icon", customClassName)} />) }
{/* icon-guanfangweixinkefu */}
{ name === 'icon-guanfangweixinkefu' && (<View style={{backgroundImage: `url(${quot}data:image/svg+xml, %3Csvg viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg' width='${svgSize}px' height='${svgSize}px'%3E%3Cpath d='M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z' fill='${(isStr ? colors : colors?.[0]) || 'rgb(74,127,255)'}' /%3E%3Cpath d='M614.499556 321.991111c53.191111 0 96.312889 43.491556 96.312888 97.123556a97.095111 97.095111 0 0 1-64.241777 91.591111c77.169778 14.179556 135.424 78.620444 135.424 155.975111a35.313778 35.313778 0 0 1-35.313778 35.313778H482.318222a35.313778 35.313778 0 0 1-35.242666-32.995556l-0.071112-2.318222c0-77.354667 58.254222-141.795556 135.424-155.989333a97.052444 97.052444 0 0 1-64.241777-91.591112c0-53.617778 43.121778-97.095111 96.312889-97.095111z' fill='${(isStr ? colors : colors?.[1]) || 'rgb(255,255,255)'}' opacity='.3' /%3E%3Cpath d='M399.502222 321.991111c53.191111 0 96.312889 43.491556 96.312889 97.123556a97.095111 97.095111 0 0 1-64.241778 91.591111c77.169778 14.179556 135.424 78.620444 135.424 155.975111a35.313778 35.313778 0 0 1-35.313777 35.313778H267.306667a35.313778 35.313778 0 0 1-35.228445-32.995556l-0.085333-2.318222c0-77.354667 58.268444-141.795556 135.438222-155.989333a97.052444 97.052444 0 0 1-64.241778-91.591112c0-53.617778 43.121778-97.095111 96.312889-97.095111z' fill='${(isStr ? colors : colors?.[2]) || 'rgb(255,255,255)'}' opacity='.3' /%3E%3Cpath d='M512 262.001778a125.013333 125.013333 0 0 1 38.812444 243.854222c91.875556 18.474667 161.194667 101.304889 161.194667 200.689778a45.454222 45.454222 0 0 1-45.468444 45.454222H357.461333a45.454222 45.454222 0 0 1-45.411555-43.320889l-0.042667-2.133333c0-99.384889 69.304889-182.215111 161.194667-200.704A125.027556 125.027556 0 0 1 512 262.001778z' fill='${(isStr ? colors : colors?.[3]) || 'rgb(255,255,255)'}' /%3E%3C/svg%3E${quot})`, width: `${svgSize}px`, height: `${svgSize}px`, ...customStyle}} className={classnames("icon", customClassName)} />) }
{/* icon-tuijianbiaoqian */}
{ name === 'icon-tuijianbiaoqian' && (<View style={{backgroundImage: `url(${quot}data:image/svg+xml, %3Csvg viewBox='0 0 2291 1024' xmlns='http://www.w3.org/2000/svg' width='${svgSize}px' height='${svgSize}px'%3E%3Cpath d='M361.130667 421.302857h91.428571v581.729524h164.571429v-52.565333H1120.060952v-78.848H914.285714v-180.565334h182.857143v-79.969524h-182.857143v-176.030476h182.857143v-79.969524h-182.857143v-169.203809h196.559238v-79.969524h-189.683809L882.297905 7.606857h-178.322286l36.571429 98.304H644.632381l31.987809-105.130667h-171.446857L361.130667 421.302857z m256 450.316191v-180.565334h132.583619v180.565334h-132.583619z m0-260.583619v-176.030477h132.583619v176.030477h-132.583619z m0-256V185.929143h132.583619V354.986667h-132.583619zM292.571429 597.333333l82.310095-38.863238v-79.969524L292.571429 515.072V254.439619h91.428571v-79.969524H292.571429V0.731429H128v173.689904H43.446857v79.969524h84.553143v326.89981l-82.310095 41.155047V707.047619l82.310095-41.155048v258.29181H73.142857v78.848H292.571429v-405.699048zM1990.851048 739.035429v178.273523h-402.285715v78.896762h571.440762v-257.170285h109.714286v-79.969524H2018.255238l226.255238-132.632381V455.68H1515.422476v79.969524h457.142857l-201.142857 123.465143h-287.987809v79.969523h507.416381zM1892.547048 5.36381v73.142857h-265.118477V5.36381h-169.155047v73.142857h-219.428572V158.47619h219.428572v70.851048h169.155047V158.47619h265.167239v82.310096h169.106285V158.47619h210.310095V78.506667H2061.653333V5.36381h-169.106285z m-370.249143 365.714285H2267.428571V291.108571H1577.155048l22.820571-38.863238h-189.683809l-22.869334 38.863238h-139.459047v79.969524h82.310095l-150.820572 253.756953h105.130667v378.246095h164.571429v-437.686857h-38.863238l112.006095-194.316191z' fill='${(isStr ? colors : colors?.[0]) || 'rgb(82,43,15)'}' /%3E%3C/svg%3E${quot})`, width: `${svgSize}px`, height: `${svgSize}px`, ...customStyle}} className={classnames("icon", customClassName)} />) }
{/* icon-rukou */}
{ name === 'icon-rukou' && (<View style={{backgroundImage: `url(${quot}data:image/svg+xml, %3Csvg viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg' width='${svgSize}px' height='${svgSize}px'%3E%3Cpath d='M397.728 195.2a32 32 0 0 0-1.6 43.52l1.6 1.76L669.248 512l-271.52 271.52a32 32 0 0 0-1.6 43.52l1.6 1.728a32 32 0 0 0 43.52 1.632l1.728-1.6 294.176-294.176a32 32 0 0 0 1.6-43.52l-1.6-1.728L442.976 195.2a32 32 0 0 0-45.248 0z' fill='${(isStr ? colors : colors?.[0]) || 'rgb(51,127,255)'}' /%3E%3C/svg%3E${quot})`, width: `${svgSize}px`, height: `${svgSize}px`, ...customStyle}} className={classnames("icon", customClassName)} />) }
{/* icon-renzhengchenggong */}

View File

@ -1,6 +1,16 @@
.user_main {
min-height: 100vh;
background: #f7f7f7;
position: relative;
.getPhoneButton {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
z-index: 1000;
}
.user_main__header {
min-height: 315px;
width: 100%;
@ -38,14 +48,7 @@
flex-direction: column;
flex: 1;
position: relative;
.getPhoneButton {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
}
.arcd-info-left-phone {
position: relative;
.header_title {
@ -68,7 +71,7 @@
.header_picture {
display: flex;
align-items: center;
padding: 5px 0;
padding: 5px 10px;
padding-right: 10px;
height: 38px;
background: #3e6cff;

View File

@ -15,7 +15,6 @@ import IconFont from '@/components/iconfont/iconfont'
export default () => {
const userInfo = useSelector(state => state.userInfo)
const { fetchData: Apiassets, state: priceState } = userassets()
const { fetchData: ApigetTotal, state: orderState } = userorderStatistics()
const { getAdminUserInfo, getPhoneNumber } = useLogin()
@ -78,6 +77,7 @@ export default () => {
})
return <View className={styles.user_main}>
{!userInfo?.adminUserInfo?.phone && <Button className={styles.getPhoneButton} openType="getPhoneNumber" onGetPhoneNumber={mGetPhoneNumber}></Button>}
<View className={styles.user_main__header}>
<View className={styles.header_img_name}>
<View className={styles.header_img}>
@ -88,8 +88,7 @@ export default () => {
<View className={styles['arcd-info-left-phone']}>
<View className={styles.header_title}> {userInfo?.adminUserInfo?.phone || 'Hi,欢迎来到陆盈商城'}</View>
</View>
<View className={styles.header_picture} ><IconFont name="icon-a-0tianzhangqi" size={47} /><View className={styles.header_picture_name}>{userInfo?.adminUserInfo?.company_name}</View></View>
{!userInfo?.adminUserInfo?.phone && <Button className={styles.getPhoneButton} openType="getPhoneNumber" onGetPhoneNumber={mGetPhoneNumber}></Button>}
<View className={styles.header_picture} ><IconFont name="icon-renzhengchenggong" size={30} /><View className={styles.header_picture_name}>{userInfo?.adminUserInfo?.company_name}</View></View>
</View>
<View className={styles.header_setting} onClick={() => goLink('/pages/userEdit/index')}>
<IconFont name="icon-shezhi" size={50} />

View File

@ -216,7 +216,7 @@ export default () => {
/>
</View>
<View className="customer_service">
{userInfo?.adminUserInfo?.sale_user_id && <View className="customer_service">
<Image className="customer_service_image" src={formatImgUrl('/mall/avatar2.png', '')}></Image>
<View className="customer_service_name_and_phone">
<View className="customer_service_name">
@ -229,7 +229,7 @@ export default () => {
<IconFont name="icon-a-0tianzhangqi" />
<Text></Text>
</View>
</View>
</View>}
{/* <Button hoverClass="none" className="user-edit-logout" onClick={outLogin}>
退

View File

@ -54,6 +54,7 @@ export interface UserAdminParam {
collection_quantity?: number
sale_user_phone?: string
sale_user_name?: string
sale_user_id?: number|string
}
export interface SortCodeParam {