diff --git a/src/components/shopCart/index.tsx b/src/components/shopCart/index.tsx index 0915eb6..83f906b 100644 --- a/src/components/shopCart/index.tsx +++ b/src/components/shopCart/index.tsx @@ -92,6 +92,8 @@ export default ({show = false, onClose}: param) => { } }) } + + return ( diff --git a/src/pages/details/index.module.scss b/src/pages/details/index.module.scss index 1c1f42a..1b7d4ec 100644 --- a/src/pages/details/index.module.scss +++ b/src/pages/details/index.module.scss @@ -28,11 +28,20 @@ font-size: $font_size_min; text-align: center; color: $color_font_three; + position: relative; .text{ margin-top: 10px; font-size: $font_size_medium; } } + .shareBtn { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + opacity: 0; + } .miconfont{ font-size: 36px; } diff --git a/src/pages/details/index.tsx b/src/pages/details/index.tsx index 22b9543..a55e934 100644 --- a/src/pages/details/index.tsx +++ b/src/pages/details/index.tsx @@ -1,14 +1,15 @@ import { Button, Image, RichText, Swiper, SwiperItem, View } from '@tarojs/components' -import Taro, { useShareAppMessage } from '@tarojs/taro'; +import Taro, { useDidShow, useRouter, useShareAppMessage } from '@tarojs/taro'; import classnames from "classnames"; import DesSwiper from './components/swiper'; import OrderCount from './components/orderCount'; import ShopCart from '@/components/shopCart'; import Preview,{colorItem} from './components/preview'; import styles from './index.module.scss' -import { useMemo, useState } from 'react'; +import { useEffect, useMemo, useState } from 'react'; import useManualPullDownRefresh from '@/use/useManualPullDownRefresh'; +import { goLink } from '@/common/common'; type item = {title:string, img:string, url:string, id:number} type params = { @@ -18,6 +19,11 @@ type params = { } export default (props:params) => { + const router = useRouter() + useEffect(() => { + console.log('router::',router) + }, []) + //页面下拉刷新 const res = useManualPullDownRefresh() @@ -92,7 +98,8 @@ export default (props:params) => { } return { title: '自定义转发标题', - path: '/page/user?id=123' + path: '/pages/details/index?id=10', + imageUrl: list[0].img } }) @@ -108,7 +115,8 @@ export default (props:params) => { 分享 - + + changeCollect()}> diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index d5afe5c..e01441b 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -7,8 +7,8 @@ import MoveBtn from '@/components/moveBtn' import ShopCart from '@/components/shopCart' import styles from './index.module.scss' import { goLink } from '@/common/common' -import { useState } from 'react' -import Taro, { usePullDownRefresh } from '@tarojs/taro' +import { useEffect, useState } from 'react' +import Taro, { useDidShow, usePullDownRefresh, useRouter } from '@tarojs/taro' import useManualPullDownRefresh from '@/use/useManualPullDownRefresh' @@ -47,6 +47,8 @@ export default () => { }, 1000) } + + return ( setShowShopCart(!showShopCart)}> diff --git a/src/pages/search/index.tsx b/src/pages/search/index.tsx index 2c19f4b..c24f320 100644 --- a/src/pages/search/index.tsx +++ b/src/pages/search/index.tsx @@ -4,6 +4,7 @@ import Search from '@/components/search' import { goLink } from '@/common/common'; import classnames from "classnames"; import styles from './index.module.scss' +import { useEffect } from 'react'; export default () => { return (