|
@@ -5,12 +5,14 @@ import pagesArr from '@/js-pages'
|
|
|
import dayjs from 'dayjs'
|
|
|
import { config } from '../../config'
|
|
|
import h5JumpApp from './app'
|
|
|
+import emptyImg from '@/assets/img/custom-empty-image.png'
|
|
|
|
|
|
|
|
|
const h5jumpApp = new h5JumpApp();
|
|
|
export const $_sendAppFunction = (name: string | number, params: any) => { //跳企业Native
|
|
|
// eslint-disable-next-line no-undef
|
|
|
if (h5jumpApp.systemJudge() == 'Android') {
|
|
|
+ // @ts-ignore
|
|
|
winhc[name](params)
|
|
|
} else {
|
|
|
// eslint-disable-next-line no-undef
|
|
@@ -35,7 +37,8 @@ export const $copyText = (text:string, back:Function) => {
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+//全局注册方法
|
|
|
+export const $emptyImg = emptyImg
|
|
|
|
|
|
export const $nameByCompanyName = function (company: string | string[], type: string) {
|
|
|
let name = type
|
|
@@ -63,8 +66,41 @@ export const $dateFormat = (date: string) => {
|
|
|
//跳转企业
|
|
|
export const $goCompany = (companyName: string, companyId: string) => {
|
|
|
console.log(companyName, companyId)
|
|
|
+
|
|
|
+
|
|
|
+ try {
|
|
|
+ if (h5jumpApp.systemJudge() == 'Android') {
|
|
|
+ // @ts-ignore
|
|
|
+ winhc.goCompany(companyName)
|
|
|
+ } else {
|
|
|
+ h5jumpApp.ocMethod('goCompany', {
|
|
|
+ company:companyName,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+export const $goPersonal = function (personName:string, companyName:string) {//跳个人Native
|
|
|
+
|
|
|
+
|
|
|
+ if(personName && !['-','--'].includes(personName)){
|
|
|
+ if (h5jumpApp.systemJudge() == 'Android') {
|
|
|
+ // @ts-ignore
|
|
|
+ winhc.personalPage(personName, companyName,'')
|
|
|
+ } else {
|
|
|
+ h5jumpApp.ocMethod('personalPage', {
|
|
|
+ "personName": personName,
|
|
|
+ "companyName": companyName,
|
|
|
+ "humanId": "",
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+};
|
|
|
+
|
|
|
//跳APP内部页面
|
|
|
export const $goInnerPage = (page: string, comopanyName = '', monitorId = '0') => {
|
|
|
console.log(page, comopanyName, monitorId)
|
|
@@ -113,8 +149,10 @@ export const $goDetail = (url:string,type?:string)=>{//跳详情
|
|
|
// console.log('tempUrl=', tempUrl)
|
|
|
if (h5jumpApp.systemJudge() == 'Android') {
|
|
|
if(type == 'ws'){
|
|
|
+ // @ts-ignore
|
|
|
winhc.openLegalServiceWebPage(config.commonUrl + tempUrl,"Y")
|
|
|
}else{
|
|
|
+ // @ts-ignore
|
|
|
winhc.qccDetail(tempUrl)
|
|
|
}
|
|
|
} else {
|
|
@@ -136,6 +174,7 @@ export const $goDetail = (url:string,type?:string)=>{//跳详情
|
|
|
//定义返回按钮事件
|
|
|
export const $historyGoBack = ()=>{
|
|
|
if (h5jumpApp.systemJudge() == 'Android') {
|
|
|
+ // @ts-ignore
|
|
|
winhc.historyGoBack()
|
|
|
} else {
|
|
|
h5jumpApp.ocMethod('goBack', {})
|
|
@@ -144,6 +183,7 @@ export const $historyGoBack = ()=>{
|
|
|
|
|
|
export const $goInAppPage = (type?:string)=>{
|
|
|
if (h5jumpApp.systemJudge() == 'Android') {
|
|
|
+ // @ts-ignore
|
|
|
winhc.goInAppPage(type)
|
|
|
} else {
|
|
|
h5jumpApp.ocMethod('goInAppPage', {
|
|
@@ -171,6 +211,7 @@ export const $openBuyVipPopup = (type=0)=>{
|
|
|
// 司法案件监测(10,'司法案件监测')
|
|
|
try {
|
|
|
if (h5jumpApp.systemJudge() == 'Android') {
|
|
|
+ // @ts-ignore
|
|
|
winhc.openBuyVipPopupByParam('recharge',type)
|
|
|
} else {
|
|
|
h5jumpApp.ocMethod('openBuyVipPopupByParam', {
|
|
@@ -189,3 +230,22 @@ export const $openBuyVipPopup = (type=0)=>{
|
|
|
export const $goOuterUrl = (url: string) => {
|
|
|
window.open(url)
|
|
|
}
|
|
|
+
|
|
|
+export const methods ={
|
|
|
+ isemail:function (mail:string):boolean{
|
|
|
+ var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
|
|
|
+ return reg.test(mail);
|
|
|
+ },
|
|
|
+ is_weixin:function():boolean{
|
|
|
+ const ua = navigator.userAgent.toLowerCase();
|
|
|
+ return /micromessenger/i.test(ua);
|
|
|
+ },
|
|
|
+ isWeiBo:function():boolean{
|
|
|
+ const ua = navigator.userAgent.toLowerCase();
|
|
|
+ return /WeiBo/i.test(ua);
|
|
|
+ },
|
|
|
+ isQQ:function():boolean{
|
|
|
+ const ua = navigator.userAgent.toLowerCase();
|
|
|
+ return /QQ/i.test(ua);
|
|
|
+ }
|
|
|
+}
|