|
@@ -1,8 +1,12 @@
|
|
|
import './index.less'
|
|
|
import React, { useEffect, useState } from "react";
|
|
|
import utils from '~/utils/utils';
|
|
|
+import api from '~/api';
|
|
|
+
|
|
|
export const DownloadCaigong2: React.FC = (props: any) => {
|
|
|
+
|
|
|
const [tip, setTip] = useState('none')
|
|
|
+ const [androidUrl, setAndroidUrl] = useState("#没获取到链接")
|
|
|
const is_weixin = () => {
|
|
|
var ua = navigator.userAgent.toLowerCase();
|
|
|
if (ua.search('micromessenger') !== -1) {
|
|
@@ -10,16 +14,6 @@ export const DownloadCaigong2: React.FC = (props: any) => {
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
- }
|
|
|
- const openWxDownloadTip = () => {
|
|
|
- setTip('block')
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- const closeWxDownloadTip = () => {
|
|
|
- setTip('none')
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
const downloadButtons = () => {
|
|
|
if (utils.isWeixin() && utils.isAndroid()) {
|
|
@@ -59,12 +53,12 @@ export const DownloadCaigong2: React.FC = (props: any) => {
|
|
|
}
|
|
|
else {
|
|
|
return (<React.Fragment>
|
|
|
- <a href="https://t1-1305573081.file.myqcloud.com/ctjk/apk/ctjk1.0.0.apk">
|
|
|
+ <a href={androidUrl}>
|
|
|
<div className="download1">
|
|
|
点击下载1
|
|
|
</div>
|
|
|
</a>
|
|
|
- <a href="https://t1-1305573081.file.myqcloud.com/ctjk/apk/ctjk1.0.0.apk">
|
|
|
+ <a href={androidUrl}>
|
|
|
<div className="download2">
|
|
|
点击下载(备用)
|
|
|
</div>
|
|
@@ -76,19 +70,29 @@ export const DownloadCaigong2: React.FC = (props: any) => {
|
|
|
|
|
|
|
|
|
}
|
|
|
+ const openWxDownloadTip = () => {
|
|
|
+ setTip('block')
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ const closeWxDownloadTip = () => {
|
|
|
+ setTip('none')
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
useEffect(() => {
|
|
|
- if (is_weixin()) {
|
|
|
- document.querySelectorAll<HTMLElement>('#app a')[0].style.display = 'none'
|
|
|
- document.querySelectorAll<HTMLElement>('#app a')[1].style.display = 'none'
|
|
|
+ document.title = 'APP下载'
|
|
|
+ api.openapiSystemDictDataType("android_update").then(res => {
|
|
|
+ console.log(res.data.data[0].dictValue)
|
|
|
+ setAndroidUrl(res.data.data[0].dictValue)
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- }
|
|
|
- else {
|
|
|
- document.querySelectorAll<HTMLElement>('#app a')[2].style.display = 'none'
|
|
|
- document.querySelectorAll<HTMLElement>('#app a')[3].style.display = 'none'
|
|
|
|
|
|
- }
|
|
|
|
|
|
- })
|
|
|
+ }, [])
|
|
|
return (
|
|
|
<div id="app">
|
|
|
<div style={{ display: tip }} id="tip">
|