diff --git a/src/common/constant.ts b/src/common/constant.ts index 32af514..f6888af 100644 --- a/src/common/constant.ts +++ b/src/common/constant.ts @@ -1,4 +1,4 @@ -// export const BASE_URL = CURRENT_BASE_URL +export const BASE_URL = CURRENT_BASE_URL // export const BASE_URL = `http://192.168.0.75:50001/lymarket` // export const BASE_URL = `http://192.168.0.89:50001/lymarket` // export const BASE_URL = `http://10.0.0.5:50001/lymarket` diff --git a/src/pages/details/components/feature/index.tsx b/src/pages/details/components/feature/index.tsx index e3ee7fe..eb25d68 100644 --- a/src/pages/details/components/feature/index.tsx +++ b/src/pages/details/components/feature/index.tsx @@ -46,13 +46,32 @@ const FeaturePopup = (param: Props) => { } }, [showPopup]) + // 用户预览图片 + const richTextClick = () => { + // 富文本 + const richContent = nodes + // 判断含有图片 + if (richContent.includes('src')) { + const imgs: any[] = [] + richContent.replace(/]*src=['"]([^'"]+)[^>]*>/gi, (match, capture): any => { + imgs.push(capture) + }) + + Taro.previewImage({ + current: imgs[0], // 以后显示图片的http链接 + urls: imgs, + }) + } + } + return ( param.closePopup?.()}> {param?.productName} - + richTextClick()}> + {/* richTextClick()}> */} 推荐面料 { list.map((item, index) => {