From ac4cd5ddb84df941ad7a686970a0642c7bf6d59b Mon Sep 17 00:00:00 2001 From: czm <2192718639@qq.com> Date: Mon, 1 Aug 2022 11:32:49 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=E4=BC=98=E5=8C=96=E5=88=86?= =?UTF-8?q?=E4=BA=AB=E5=9B=BE=E7=89=87=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=88=91?= =?UTF-8?q?=E7=9A=84=E9=A1=B5=E9=9D=A2=E6=97=A0=E6=B3=95=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E6=8E=88=E6=9D=83=E5=BC=B9?= =?UTF-8?q?=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/util.ts | 28 +-- src/components/uploadImage/index.tsx | 117 +++++++------ src/pages/details/index.tsx | 4 +- .../addressInfoDetail/index.module.scss | 164 +++++++++--------- src/pages/user/index.module.scss | 45 ++--- src/pages/user/index.tsx | 41 +++-- 6 files changed, 194 insertions(+), 205 deletions(-) diff --git a/src/common/util.ts b/src/common/util.ts index 4eb402d..a0d3273 100644 --- a/src/common/util.ts +++ b/src/common/util.ts @@ -44,12 +44,7 @@ export const throttle = (fn, delay) => { export const getFilterData = (val = {}, arr: string[] = []) => { let res = {} for (let key in val) { - if ( - val[key] !== undefined && - val[key] !== null && - val[key] !== '' && - !arr.includes(key) - ) { + if (val[key] !== undefined && val[key] !== null && val[key] !== '' && !arr.includes(key)) { if (typeof val[key] == 'number') { if (!isNaN(val[key])) { res[key] = val[key] @@ -100,15 +95,7 @@ export const screenshot = (url, suffix = '!w200') => { } //获取数据加载状态 //0:数据从无到有加载数据,1,没有任何数据, 2:下拉加载,3:下拉没有数据 -export const dataLoadingStatus = ({ - list = [], - total = 0, - status = false, -}: { - list: any[] - total: number - status: true | false -}) => { +export const dataLoadingStatus = ({ list = [], total = 0, status = false }: { list: any[]; total: number; status: true | false }) => { if (list.length == 0 && status) { return 0 } else if (list.length == 0 && !status) { @@ -132,25 +119,20 @@ export const shareShop = () => { let path = '' let title = '' let imageUrl = '' - let sortCode = Taro.getStorageSync('sort_code') - ? JSON.parse(Taro.getStorageSync('sort_code')) - : '' + let sortCode = Taro.getStorageSync('sort_code') ? JSON.parse(Taro.getStorageSync('sort_code')) : '' let pageInfo: any = page //商品详情分享 if (pageInfo.route === 'pages/details/index') { path = `/pages/details/index?share=${sortCode.shareShortDetail.code}` title = sortCode.shareShortDetail.title - imageUrl = sortCode.shareShortDetail.img + imageUrl = formatImgUrl(sortCode.shareShortDetail.img, '!w600') } else { path = pageInfo.route === 'pages/user/index' ? `/pages/user/index?share=${sortCode.shareShortPage.code}` : `/pages/index/index?share=${sortCode.shareShortPage.code}` title = sortCode.shareShortPage.title - imageUrl = - pageInfo.route === 'pages/user/index' - ? sortCode.shareShortPage.img - : formatImgUrl('/mall/share_img_02.png') + imageUrl = pageInfo.route === 'pages/user/index' ? formatImgUrl(sortCode.shareShortPage.img, '!w600') : formatImgUrl('/mall/share_img_02.png', '!w600') } return { title, diff --git a/src/components/uploadImage/index.tsx b/src/components/uploadImage/index.tsx index 204d5dc..f427e02 100644 --- a/src/components/uploadImage/index.tsx +++ b/src/components/uploadImage/index.tsx @@ -1,68 +1,71 @@ -import Taro, { FC } from "@tarojs/taro" -import { memo, useEffect, useState } from "react" -import useUploadCDNImg from "@/use/useUploadImage"; -import { Image, Text, View } from "@tarojs/components"; -import { formatImgUrl } from "@/common/fotmat"; -import classnames from "classnames"; -import styles from './index.module.scss' +import Taro, { FC } from '@tarojs/taro' +import { memo, useEffect, useState } from 'react' +import useUploadCDNImg from '@/use/useUploadImage' +import { Image, Text, View } from '@tarojs/components' +import { formatImgUrl } from '@/common/fotmat' +import classnames from 'classnames' +import styles from './index.module.scss' //图片列表 type ImageParam = { - onChange?:(val: string[]) => void, - defaultList?: string[], - onlyRead?: false|true + onChange?: (val: string[]) => void + defaultList?: string[] + onlyRead?: false | true } -const PictureItem:FC = memo(({onChange, defaultList, onlyRead = false}) => { - const {getWxPhoto} = useUploadCDNImg() - const [imageList, setImageLise] = useState([]) +const PictureItem: FC = memo(({ onChange, defaultList, onlyRead = false }) => { + const { getWxPhoto } = useUploadCDNImg() + const [imageList, setImageLise] = useState([]) - useEffect(() => { - setImageLise(defaultList||[]) - }, [defaultList]) + useEffect(() => { + setImageLise(defaultList || []) + }, [defaultList]) - //上传图片 - const uploadImage = async () => { - let list:any = await getWxPhoto('after-sale', 5) - let images:any[] = [] - list?.map(item => { - images.push(item.url) - }) - setImageLise([...imageList, ...images]) - } - //删除图片 - const delImage = (index) => { - imageList.splice(index,1) - setImageLise(() => [...imageList]) - } - //监听上传的图片变化 - useEffect(() => { - onChange?.(imageList) - }, [imageList]) + //上传图片 + const uploadImage = async () => { + let list: any = await getWxPhoto('after-sale', 5) + let images: any[] = [] + list?.map((item) => { + images.push(item.url) + }) + setImageLise([...imageList, ...images]) + } + //删除图片 + const delImage = (index) => { + imageList.splice(index, 1) + setImageLise(() => [...imageList]) + } + //监听上传的图片变化 + useEffect(() => { + onChange?.(imageList) + }, [imageList]) - //预览图片 - const showImage = () => { - let list = imageList?.map(item => { - return formatImgUrl(item, '!w800') - }) - Taro.previewImage({ - current: list[0], // 当前显示 - urls: list // 需要预览的图片http链接列表 - }) - } + //预览图片 + const showImage = () => { + let list = imageList?.map((item) => { + return formatImgUrl(item, '!w800') + }) + Taro.previewImage({ + current: list[0], // 当前显示 + urls: list, // 需要预览的图片http链接列表 + }) + } - return ( - - {imageList?.map((item, index) => - - - {!onlyRead && delImage(index)} className={classnames(styles.miconfont_close, 'iconfont icon-qingkong')}>} - )} - {!onlyRead && - - 上传照片 - } + return ( + + {imageList?.map((item, index) => ( + + + {!onlyRead && delImage(index)} className={classnames(styles.miconfont_close, 'iconfont icon-qingkong')}>} - ) + ))} + {!onlyRead && ( + + + 上传照片 + + )} + + ) }) -export default PictureItem \ No newline at end of file +export default PictureItem diff --git a/src/pages/details/index.tsx b/src/pages/details/index.tsx index 22cb3eb..e801c00 100644 --- a/src/pages/details/index.tsx +++ b/src/pages/details/index.tsx @@ -6,7 +6,7 @@ import OrderCount from './components/orderCount' import ShopCart from '@/components/shopCart' import styles from './index.module.scss' import { useCallback, useEffect, useMemo, useState } from 'react' -import { formatHashTag } from '@/common/fotmat' +import { formatHashTag, formatImgUrl } from '@/common/fotmat' import { GetProductDetailApi } from '@/api/material' import useLogin from '@/use/useLogin' import { AnalysisShortCodeApi, GetShortCodeApi } from '@/api/share' @@ -102,7 +102,7 @@ export default (props: Params) => { type: ShareDetail.value, product_id: parseInt(params.id), }) - const img = IMG_CND_Prefix + (productInfo.texture_url ? productInfo.texture_url.split(',')[0] : '/mall/share_img_01.png') + const img = formatImgUrl(productInfo.texture_url || '/mall/share_img_01.png', '!w400') setSortCode({ ...userObj.sort_code, shareShortDetail: { title: productName as string, code: resDetail.md5_key, img: img } }) } diff --git a/src/pages/salesAfter/components/addressInfoDetail/index.module.scss b/src/pages/salesAfter/components/addressInfoDetail/index.module.scss index 907e73f..95a6490 100644 --- a/src/pages/salesAfter/components/addressInfoDetail/index.module.scss +++ b/src/pages/salesAfter/components/addressInfoDetail/index.module.scss @@ -1,90 +1,88 @@ -.address_main{ - margin-top: 20px; +.address_main { + margin-top: 20px; } -.address_title_tag{ - font-size: 24px; - color: #EE7500; - background: rgba(255,230,206,0.36); - border-radius: 20px 20px 0px 0px; - height: 56px; - display: flex; - align-items: center; - position: relative; - z-index: 999; - .miconfont { - font-size: 30px; - padding: 0 20px; - } +.address_title_tag { + font-size: 24px; + color: #ee7500; + background: rgba(255, 230, 206, 0.36); + border-radius: 20px 20px 0px 0px; + height: 56px; + display: flex; + align-items: center; + position: relative; + z-index: 999; + .miconfont { + font-size: 30px; + padding: 0 20px; + } } -.order_address{ - height: 178px; - background: #ffffff; - border-radius: 0 0 20px 20px; - display: flex; - align-items: center; - padding: 30px; +.order_address { + min-height: 178px; + background: #ffffff; + border-radius: 0 0 20px 20px; + display: flex; + align-items: center; + padding: 30px; + box-sizing: border-box; + position: relative; + .order_address_icon { + font-size: 50px; + color: $color_main; + position: absolute; + top: 35px; + left: 20px; + } + .order_address_text_con { + flex: 1; + padding-left: 50px; box-sizing: border-box; - position: relative; - .order_address_icon{ - font-size: 50px; - color: $color_main; - position: absolute; - top: 35px; - left: 20px; - } - .order_address_text_con{ - flex:1; - padding-left: 50px; - box-sizing: border-box; - height: 100%; - display: flex; - flex-direction: column; - justify-content: space-between; - .order_address_text_title{ - font-size: $font_size_medium; - margin-top: 10px; - display: flex; - align-items: center; - justify-content: space-between; - .moreIconfont{ - font-size: 20px; - } - .address_text{ - word-break:break-all; - font-size: 28px; - font-weight: 700; - } - } - .order_address_text_name{ - color: #707070; - align-items: center; - display: flex; - margin-top: 20px; - text{ - &:nth-child(1) { - font-size: $font_size_medium; - margin-right: 40px; - } - &:nth-child(2) { - flex:1; - font-size: $font_size_medium; - } - } - } - } - .updateBtn{ - width:152px; + height: 100%; + display: flex; + flex-direction: column; + justify-content: space-between; + .order_address_text_title { + font-size: $font_size_medium; + margin-top: 10px; + display: flex; + align-items: center; + justify-content: space-between; + .moreIconfont { + font-size: 20px; + } + .address_text { + word-break: break-all; font-size: 28px; - height: 60px; - color:#007AFF; - z-index: 999; - border: 2px solid #007AFF; - border-radius: 36px; - text-align: center; - line-height: 60px; - + font-weight: 700; + } } - -} \ No newline at end of file + .order_address_text_name { + color: #707070; + align-items: center; + display: flex; + margin-top: 20px; + text { + &:nth-child(1) { + font-size: $font_size_medium; + margin-right: 40px; + } + &:nth-child(2) { + flex: 1; + font-size: $font_size_medium; + } + } + } + } + .updateBtn { + width: 152px; + font-size: 28px; + height: 60px; + color: #007aff; + z-index: 999; + border: 2px solid #007aff; + border-radius: 36px; + text-align: center; + line-height: 60px; + } +} diff --git a/src/pages/user/index.module.scss b/src/pages/user/index.module.scss index 1cffd23..ffe17de 100644 --- a/src/pages/user/index.module.scss +++ b/src/pages/user/index.module.scss @@ -1,5 +1,5 @@ .main { - background-color: #F8F8F8; + background-color: #f8f8f8; min-height: 100vh; display: flex; flex-direction: column; @@ -17,8 +17,12 @@ } .auth-suspension { - position: absolute; + position: fixed; + left: 0; + top: 0; z-index: 1; + width: 100vw; + height: 100vh; inset: 0; } @@ -58,7 +62,7 @@ .arcd-info-left-portrait { width: 170px; height: 170px; - background: rgba(0, 0, 0, 0.00); + background: rgba(0, 0, 0, 0); border: 4px solid #ffffff; border-radius: 50%; overflow: hidden; @@ -138,22 +142,21 @@ border-bottom: 2px solid #dddddd; padding: 0 5px 15px; box-sizing: border-box; - .card_main_title_order{ - flex:1; + .card_main_title_order { + flex: 1; font-size: 28px; font-weight: 700; } - .order_more{ + .order_more { display: flex; justify-content: flex-end; align-items: center; font-size: 25px; color: #707070; - text{ + text { width: auto; } } - } .card-main-title text { @@ -181,7 +184,7 @@ .card-main-title-content-item Text { font-size: 56px; - color: #3C3C3C; + color: #3c3c3c; } .card-main-title-content-item-badge { @@ -215,8 +218,8 @@ grid-template-columns: repeat(2, 1fr); } - .assets-content>view, - .assets-content>navigator { + .assets-content > view, + .assets-content > navigator { text-align: center; } @@ -282,7 +285,7 @@ .card-main-list-content-item-right text { font-size: 30px; - } + } .card-main-list-content-item .customer { position: absolute; opacity: 0; @@ -315,14 +318,14 @@ .auth-status, .auth-status-ongoing { - color: #EE7500; - background-color: #FFE6CE; + color: #ee7500; + background-color: #ffe6ce; } .auth-status, .auth-status-adopt { - color: #007AFF; - background-color: #CDE5FF; + color: #007aff; + background-color: #cde5ff; } .auth-tips { @@ -334,7 +337,7 @@ .auth-tips, .auth-tips-adopt { - color: #ABABAB; + color: #ababab; } .auth-tips text { @@ -426,7 +429,7 @@ .tips-modal-button { display: flex; - border-top: 1px solid #DDDDDD; + border-top: 1px solid #dddddd; margin-top: 45px; } @@ -445,7 +448,7 @@ font-weight: 400; color: #707070; border-radius: 0; - border-right: 1px solid #DDDDDD; + border-right: 1px solid #dddddd; } .tips-modal-button button::after { @@ -537,7 +540,7 @@ padding-left: 10px; width: 100px; height: 32px; - background: rgba(255, 0, 0, 0.10); + background: rgba(255, 0, 0, 0.1); border-radius: 10px; color: #ff0000; } @@ -559,4 +562,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/pages/user/index.tsx b/src/pages/user/index.tsx index 2bd2283..3ceaa50 100644 --- a/src/pages/user/index.tsx +++ b/src/pages/user/index.tsx @@ -23,6 +23,7 @@ export default () => { const handleAuth = async () => { console.log('授权面版') + if (adminUserInfo?.is_authorize_name) return false getSelfUserInfo() .then() .catch(() => { @@ -37,26 +38,28 @@ export default () => { getAdminUserInfo() Apiassets() }) - const checkGo = () => { - if ( - adminUserInfo?.authentication_status === 0 || - adminUserInfo?.authentication_status === 1 || - adminUserInfo?.authentication_status === 2 || - adminUserInfo?.authentication_status === 3 - ) { - Taro.showModal({ + const checkGo = async () => { + if (adminUserInfo?.authentication_status !== 4) { + let res = await Taro.showModal({ title: '提示', - content: '你还未认证,认证后解锁更多功能', + content: '你暂未开通授信,目前仅支持线下申请,开通后可使用账期采购。', cancelText: '稍后认证', - confirmText: '去认证', - success: function (res) { - if (res.confirm) { - Taro.navigateTo({ url: '/pages/certification/index' }) - } else if (res.cancel) { - console.log('用户点击取消') - } - }, + confirmText: '联系客服', }) + if (res.confirm) { + Taro.showModal({ + content: '联系电话:0757-8270 6695', + cancelText: '取消', + confirmText: '拨打', + success: function (res) { + if (res.confirm) { + Taro.makePhoneCall({ + phoneNumber: '(0757)82706695', + }) + } + }, + }) + } } else { Taro.navigateTo({ url: '/pages/creditLine/index', @@ -72,7 +75,7 @@ export default () => { {/* 测试暂时添加 */} {current_version} {current_env === 'development' && {BASE_URL}} - {!adminUserInfo?.is_authorize_name && } + {!adminUserInfo?.is_authorize_name && } ) } @@ -133,7 +136,7 @@ const Header = memo((props: any) => { }) } return ( - +