Commit c49953f1 by FE

merge and solve

parents 7be9a9c7 89924ea7
...@@ -80,6 +80,7 @@ ...@@ -80,6 +80,7 @@
"terser-webpack-plugin": "1.2.2", "terser-webpack-plugin": "1.2.2",
"url-loader": "1.1.2", "url-loader": "1.1.2",
"video.js": "^7.6.0", "video.js": "^7.6.0",
"web-launch-app": "^2.1.9",
"webpack": "4.28.3", "webpack": "4.28.3",
"webpack-dev-server": "3.1.14", "webpack-dev-server": "3.1.14",
"webpack-manifest-plugin": "2.0.4", "webpack-manifest-plugin": "2.0.4",
......
import React, { Component } from 'react' import React, { Component } from 'react';
import {ua, isIos, inWeixin, detector} from 'web-launch-app';
import CallApp from 'callapp-lib' import CallApp from 'callapp-lib'
const options = { const options = {
...@@ -22,6 +23,58 @@ const options = { ...@@ -22,6 +23,58 @@ const options = {
fallback: "http://www.julyedu.com/weekend/redir1" fallback: "http://www.julyedu.com/weekend/redir1"
} }
const inApp = /appname(.*)/.test(ua);
const appVersion = inApp ? /appname\/(\d+(\.\d+)*)/.exec(ua)[1] : '';
// 微信iOS7.0.5支持ulink(20190716)
const wxSupportLink = isIos && inWeixin && detector.browser.fullVersion > '7.0.4';
const config = {
inApp: inApp,
appVersion: appVersion,
pkgName: 'julyedu',
deeplink: {
scheme: {
android: {
protocol: 'julyedu',
index: {
path: '/',
},
frs: {
protocol: 'app',
path: 'forum/detail',
param: {from:'h5'},
paramMap: {
forumName: 'kw'
}
}
},
ios: {
protocol: 'julyedu',
index: {
path: '/',
},
frs: {
path: 'forum/detail'
}
}
},
link: {
index: {url: 'https://link.app.com'},
frs: {url: 'https://link.app.com/p/{forumName}'}
},
},
pkgs: {
android: 'https://cdn.app.com/package/app-defult.apk',
ios: 'https://itunes.apple.com/cn/app/id1102275343?mt=8',
yyb: 'hhttp://android.myapp.com/myapp/detail.htm?apkName=com.julyapp.julyonline',
},
useUniversalLink: supportLink,
useAppLink: supportLink,
autodemotion: true,
useYingyongbao: inWeixin,
useGuideMethod: inWeixin && !wxSupportLink, // 受限情况下使用引导方案
landPage: 'http://www.julyedu.com/weekend/redir1'
};
class OpenApp extends Component { class OpenApp extends Component {
callApp = new CallApp(options) callApp = new CallApp(options)
...@@ -30,11 +83,15 @@ class OpenApp extends Component { ...@@ -30,11 +83,15 @@ class OpenApp extends Component {
text: '在APP打开' text: '在APP打开'
} }
componentWillMount() {
// this.callApp = new CallApp(options);
this.lanchApp = new LaunchApp(config);
}
handleClick = () => { handleClick = () => {
this.callApp.open({ // this.callApp.open({})
path: this.props.path, this.anchApp.open()
// param:
})
} }
render() { render() {
......
...@@ -2772,11 +2772,6 @@ cli-width@^2.0.0: ...@@ -2772,11 +2772,6 @@ cli-width@^2.0.0:
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639"
integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=
clipboard-copy@^3.1.0:
version "3.1.0"
resolved "https://registry.npm.taobao.org/clipboard-copy/download/clipboard-copy-3.1.0.tgz#4c59030a43d4988990564a664baeafba99f78ca4"
integrity sha1-TFkDCkPUmImQVkpmS66vupn3jKQ=
cliui@^3.2.0: cliui@^3.2.0:
version "3.2.0" version "3.2.0"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d"
...@@ -11598,6 +11593,11 @@ wbuf@^1.1.0, wbuf@^1.7.3: ...@@ -11598,6 +11593,11 @@ wbuf@^1.1.0, wbuf@^1.7.3:
dependencies: dependencies:
minimalistic-assert "^1.0.0" minimalistic-assert "^1.0.0"
web-launch-app@^2.1.9:
version "2.1.9"
resolved "https://registry.npm.taobao.org/web-launch-app/download/web-launch-app-2.1.9.tgz#8da6e2b53331881d00e4ee3a8c2d630c29fc4550"
integrity sha1-jabitTMxiB0A5O46jC1jDCn8RVA=
web-namespaces@^1.1.2: web-namespaces@^1.1.2:
version "1.1.2" version "1.1.2"
resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-1.1.2.tgz#c8dc267ab639505276bae19e129dbd6ae72b22b4" resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-1.1.2.tgz#c8dc267ab639505276bae19e129dbd6ae72b22b4"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment