From 67d56b0e9ab091489f423a1d7ec436f5131f2541 Mon Sep 17 00:00:00 2001 From: fishcui Date: Mon, 15 Nov 2021 21:21:43 +0800 Subject: [PATCH 01/22] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E8=B7=B3=E8=BD=AC=E5=90=8E=E6=87=92=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/pages/plugin/[...path].jsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/web/pages/plugin/[...path].jsx b/web/pages/plugin/[...path].jsx index adf8dddaf..9b6c5b3c4 100644 --- a/web/pages/plugin/[...path].jsx +++ b/web/pages/plugin/[...path].jsx @@ -1,11 +1,16 @@ /* eslint-disable spaced-comment */ /* eslint-disable new-cap */ import React from 'react'; +import { Spin } from '@discuzq/design'; import { inject, observer } from 'mobx-react'; import { withRouter } from 'next/router'; import HOCFetchSiteData from '@middleware/HOCFetchSiteData'; import DZQPluginCenterInjectionPolyfill from '../../utils/DZQPluginCenterInjectionPolyfill'; +const PageLoading = () => { + return 页面加载中...; +}; + // 插件插槽埋入 /**DZQ->plugin->register**/ @@ -21,11 +26,19 @@ class PagePlugin extends React.Component { }; } + componentDidUpdate(prevProps) { + // when router path changed + if (prevProps.router.asPath !== this.props.router.asPath) { + this.props.router.reload(); + } + } + getTargetPlugin = () => ( pluginInfo.path === this.state.pluginPath} + condition={(pluginInfo) => pluginInfo.path === this.state.pluginPath} + loading={() => } /> ); @@ -35,6 +48,8 @@ class PagePlugin extends React.Component { }; render() { + const { plugin } = this.props; + return this.renderTargetPlugin(); } } -- Gitee From 87ae62167510a3b8ae4e00364614148e63a87f88 Mon Sep 17 00:00:00 2001 From: jsl Date: Tue, 23 Nov 2021 11:20:18 +0800 Subject: [PATCH 02/22] =?UTF-8?q?fix:=203771=20=E3=80=90=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F-=E6=8E=A8=E5=B9=BF=E9=82=80=E8=AF=B7-=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=8E=AF=E5=A2=83=E3=80=91=E6=98=B5=E7=A7=B0=E8=BF=87?= =?UTF-8?q?=E9=95=BF=E6=97=B6=EF=BC=8C=E6=8E=A8=E5=B9=BF=E9=82=80=E8=AF=B7?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F=E5=BC=82=E5=B8=B8=20http:/?= =?UTF-8?q?/bug.eims.com.cn/bug-view-3771.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mini/src/layout/invite/index.module.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mini/src/layout/invite/index.module.scss b/mini/src/layout/invite/index.module.scss index 523058b16..cf2221a49 100644 --- a/mini/src/layout/invite/index.module.scss +++ b/mini/src/layout/invite/index.module.scss @@ -69,6 +69,8 @@ color: $text-color-primary; opacity: 1; margin-top: rem(68); + max-width: rem(343); + @include text-ellipsis(); } .user_info_tag{ font-weight: normal; -- Gitee From cfe4b147e6346c3d5018761a494863d138191a49 Mon Sep 17 00:00:00 2001 From: v_zjxzzheng Date: Wed, 24 Nov 2021 10:18:52 +0800 Subject: [PATCH 03/22] =?UTF-8?q?feat:=20=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E5=88=86=E4=BA=AB=E6=B7=BB=E5=8A=A0=E5=A4=8D=E5=88=B6=E9=93=BE?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/server/genParamScheme.js | 5 ++ common/server/index.js | 1 + mini/src/components/site-share/index.jsx | 60 ++++++++++++++++++++++-- mini/src/layout/invite/index.jsx | 2 - mini/src/pages/index/index.jsx | 3 ++ 5 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 common/server/genParamScheme.js diff --git a/common/server/genParamScheme.js b/common/server/genParamScheme.js new file mode 100644 index 000000000..dc55c576c --- /dev/null +++ b/common/server/genParamScheme.js @@ -0,0 +1,5 @@ +import { readGenParamScheme } from '@discuzq/sdk/dist/api/content/read-genparamscheme'; +export default async function genParamScheme(opts, ctx = null) { + const res = await readGenParamScheme({ ...opts, __context: ctx }); + return res; +} \ No newline at end of file diff --git a/common/server/index.js b/common/server/index.js index 10a414880..8322ea5c6 100644 --- a/common/server/index.js +++ b/common/server/index.js @@ -57,6 +57,7 @@ export { default as h5WechatCodeBind } from './h5WechatCodeBind'; export { default as miniQrcodeLogin } from './login/miniQrcodeLogin'; export { default as miniQrcodeBind } from './login/miniQrcodeBind'; export { default as genMiniScheme } from './genMiniScheme'; +export { default as genParamScheme } from './genParamScheme'; export { default as genMiniBindScheme } from './genMiniBindScheme'; export { default as miniBind } from './login/miniBind'; export { default as miniLogin } from './login/miniLogin'; diff --git a/mini/src/components/site-share/index.jsx b/mini/src/components/site-share/index.jsx index 66bfe1650..4cace3316 100644 --- a/mini/src/components/site-share/index.jsx +++ b/mini/src/components/site-share/index.jsx @@ -1,13 +1,17 @@ -import React from 'react' +import React, { useRef } from 'react' import { View, Button, Text } from '@tarojs/components' -import styles from './index.module.scss' +import { genParamScheme } from '@server'; import Icon from '@discuzq/design/dist/components/icon/index'; -import Taro from '@tarojs/taro' +import Toast from '@discuzq/design/dist/components/toast/index'; +import Taro, { setClipboardData } from '@tarojs/taro' import classNames from 'classnames'; import Popup from '@discuzq/design/dist/components/popup/index'; import setUrlParam from '@common/utils/set-url-param'; +import styles from './index.module.scss' const Index = ({ show, onShareClose, site, customShareData, inviteCode = '', type }) => { + const copyOver = useRef(true); + const shareData = { title: customShareData?.title || site.webConfig?.setSite?.siteName || '', path: setUrlParam(customShareData?.path || 'pages/index/index', { inviteCode }), @@ -23,6 +27,47 @@ const Index = ({ show, onShareClose, site, customShareData, inviteCode = '', typ url: `/subPages/create-card/index`, }) } + + const CreateScheme = async () => { + if(!copyOver.current) { + return; + } + try { + copyOver.current = false; + const resp = await genParamScheme({ + params: { + type: "share_mini", + query:{ + scene : '', + inviteCode, + } + } + }); + if(resp.code !== 0) { + throw resp; + } + setClipboardData({ + data: resp?.data?.openLink, + fail: (err) => { + console.error(err); + Toast.error({ + content: '创建邀请链接失败', + duration: 1000, + }); + }, + complete: () => { + copyOver.current = true; + } + }) + + } catch (e) { + Toast.error({ + content: e.msg || e, + }); + copyOver.current = true; + } + } + return ( + + + + + + + 复制链接 + +