Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
b4616c45
Commit
b4616c45
authored
Apr 06, 2021
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 移动端资讯页面
parent
12ee430b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
1 deletion
+96
-1
mobileDetail.less
src/pages/lxMall/information/mobileDetail.less
+35
-1
mobileDetail.tsx
src/pages/lxMall/information/mobileDetail.tsx
+61
-0
No files found.
src/pages/lxMall/information/mobileDetail.less
View file @
b4616c45
.detailContainer {
padding: 24px 12px;
padding-top: 64px;
}
.title {
...
...
@@ -31,7 +32,40 @@
.informationContent {
img, video {
img,
video {
width: 100%;
}
}
.downloadCard {
position: fixed;
display: flex;
top: 0;
left: 0;
width: 100%;
padding: 8px 16px;
border-bottom: 1px solid #F4F5F7;
align-items: center;
background-color: #FFF;
.downloadAppIcon {
overflow: hidden;
border-radius: 8px;
}
.downloadAppName {
font-size: 14px;
margin-left: 12px;
}
.downloadBtn {
margin-left: auto;
background: #00B37A;
padding: 4px 12px;
font-size: 12px;
border-radius: 12px;
color: #FFF;
}
}
src/pages/lxMall/information/mobileDetail.tsx
View file @
b4616c45
...
...
@@ -3,8 +3,10 @@ import { Helmet } from 'umi'
import
moment
from
'moment'
import
{
PublicApi
}
from
'@/services/api'
// import { RouteChildrenProps, RouteProps } from 'react-router'
import
ImageBox
from
'@/components/ImageBox'
import
{
GetManageContentInformationFindByIdResponse
}
from
'@/services/PassApi'
import
{
numFormat
}
from
'@/utils/numberFomat'
import
{
GlobalConfig
}
from
'@/global/config'
import
styles
from
'./mobileDetail.less'
const
MobileDetail
=
(
props
)
=>
{
...
...
@@ -12,6 +14,10 @@ const MobileDetail = (props) => {
const
[
newsDetail
,
setNewsDetail
]
=
useState
<
GetManageContentInformationFindByIdResponse
>
()
const
[
title
,
setTitle
]
=
useState
<
string
>
(
'资讯详情'
)
const
shopInfo
=
GlobalConfig
.
web
.
shopInfo
.
filter
((
item
)
=>
item
.
type
===
1
&&
item
.
environment
===
4
)
const
appInfo
:
any
=
shopInfo
?
shopInfo
[
0
]
:
{}
const
fetchNewsDetail
=
()
=>
{
const
param
=
{
id
...
...
@@ -30,12 +36,67 @@ const MobileDetail = (props) => {
}
},
[])
// const judgeExistApp = () => {
// if (navigator.userAgent.match(/android/i)) {
// // alert('android')
// // 通过iframe的方式试图打开APP,如果能正常打开,会直接切换到APP,并自动阻止a标签的默认行为
// // 否则打开a标签的href链接
// let isInstalled;
// //下面是安卓端APP接口调用的地址,自己根据情况去修改
// // const ifrSrc = 'mqq://';
// const ifrSrc = 'com.baidu.tieba://';
// const ifr = document.createElement('iframe');
// ifr.src = ifrSrc;
// ifr.style.display = 'none';
// document.body.appendChild(ifr);
// setTimeout(function() {
// document.body.removeChild(ifr);
// window.location.href = "https://www.baidu.com"
// }, 1000);
// }
// //ios判断
// if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
// //Animation://com.yz.animation
// let isInstalled;
// //var gz = '{"comName":"${com.short_name}","comID":"${com.id}","comPhoneNum":"${com.phone_num}","type":"0"}';
// //var jsongz =JSON.parse(gz);
// //下面是IOS调用的地址,自己根据情况去修改
// const ifrSrc = 'weixin://';
// const ifr = document.createElement( 'iframe' );
// ifr.src = ifrSrc;
// ifr.style.display = 'none' ;
// ifr.onload = function() {
// // alert('Is installed.');
// isInstalled = true ;
// alert(isInstalled);
// document.getElementById( 'openApp1' ).click();
// };
// ifr.onerror = function() {
// // alert('May be not installed.');
// isInstalled = false ;
// alert(isInstalled);
// }
// document.body.appendChild(ifr);
// setTimeout(function() {
// document.body.removeChild(ifr);
// }, 1000 );
// }
// }
return
(
<>
<
Helmet
>
<
meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
/>
<
title
>
{
title
}
</
title
>
</
Helmet
>
{
/* <div className={styles.downloadCard}>
<ImageBox width={40} height={40} className={styles.downloadAppIcon} imgUrl={appInfo.logoUrl} />
<span className={styles.downloadAppName}>{appInfo.name}</span>
<div className={styles.downloadBtn} onClick={() => judgeExistApp()}>打开</div>
</div> */
}
{
newsDetail
&&
(
<
div
className=
{
styles
.
detailContainer
}
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment