Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
hrs_app_h5
/
bill
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d2e526cb
authored
Aug 28, 2020
by
展昭
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改main.js用于测试jsbridge 03
parent
c5111d9b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
49 deletions
src/main.js
src/main.js
View file @
d2e526cb
import
Vue
from
'vue'
//
import Vue from 'vue'
import
App
from
'./App.vue'
//
import App from './App.vue'
import
router
from
'./router'
//
import router from './router'
import
store
from
'./store'
//
import store from './store'
import
'lib-flexible/flexible'
//
import 'lib-flexible/flexible'
import
'./assets/css/index.css'
//
import './assets/css/index.css'
import
'./utils/filter'
//
import './utils/filter'
import
FastClick
from
'fastclick'
//
import FastClick from 'fastclick'
// import initJsBridge from "./assets/js/JsBridge";
//
//
import initJsBridge from "./assets/js/JsBridge";
import
bridge
from
"./assets/js/bridge/birdge"
;
//
import bridge from "./assets/js/bridge/birdge";
Vue
.
config
.
productionTip
=
false
//
Vue.config.productionTip = false
Vue
.
prototype
.
globalNavLeftArrowClick
=
function
(
callback
)
{
//
Vue.prototype.globalNavLeftArrowClick = function (callback) {
document
.
getElementsByClassName
(
"van-nav-bar__left"
)[
0
].
onclick
=
function
()
{
//
document.getElementsByClassName("van-nav-bar__left")[0].onclick = function () {
callback
();
//
callback();
};
//
};
};
//
};
FastClick
.
attach
(
document
.
body
);
//
FastClick.attach(document.body);
FastClick
.
prototype
.
focus
=
function
(
targetElement
)
{
//
FastClick.prototype.focus = function (targetElement) {
let
length
;
//
let length;
if
(
targetElement
.
setSelectionRange
&&
targetElement
.
type
.
indexOf
(
'date'
)
!==
0
&&
targetElement
.
type
!==
'time'
&&
targetElement
.
type
!==
'month'
)
{
//
if (targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month') {
length
=
targetElement
.
value
.
length
;
//
length = targetElement.value.length;
targetElement
.
focus
();
//
targetElement.focus();
targetElement
.
setSelectionRange
(
length
,
length
);
//
targetElement.setSelectionRange(length, length);
}
else
{
//
} else {
targetElement
.
focus
();
//
targetElement.focus();
}
//
}
};
//
};
Vue
.
prototype
.
setPageNavState
=
function
()
{
//
Vue.prototype.setPageNavState = function () {
bridge
.
setPageNavState
({
//
bridge.setPageNavState({
isShowClose
:
false
,
//
isShowClose: false,
isShowBack
:
false
,
//
isShowBack: false,
isCloseLeft
:
false
,
//
isCloseLeft: false,
isShowTitle
:
false
,
//
isShowTitle: false,
isShowNav
:
false
,
//
isShowNav: false,
isCloseWebView
:
false
//
isCloseWebView: false
});
//
});
bridge
.
getBarHeight
().
then
(
response
=>
{
//
bridge.getBarHeight().then(response => {
response
=
JSON
.
parse
(
response
);
//
response = JSON.parse(response);
const
barHeight
=
response
.
statusBarHeight
;
//
const barHeight = response.statusBarHeight;
localStorage
.
setItem
(
"barHeight"
,
barHeight
);
//
localStorage.setItem("barHeight", barHeight);
console
.
log
(
'main barHeight='
,
barHeight
);
//
console.log('main barHeight=', barHeight);
})
//
})
bridge
.
setBarColor
({
"barColor"
:
"#0978e7"
});
//
bridge.setBarColor({ "barColor": "#0978e7" });
};
//
};
Vue
.
prototype
.
$bridge
=
bridge
;
//
Vue.prototype.$bridge = bridge;
if
(
process
.
env
.
NODE_ENV
===
'development'
||
process
.
env
.
NODE_ENV
===
'staging'
)
{
//
if (process.env.NODE_ENV === 'development'||process.env.NODE_ENV === 'staging') {
const
VConsole
=
require
(
'vconsole'
)
//
const VConsole = require('vconsole')
const
my_console
=
new
VConsole
();
//
const my_console = new VConsole();
}
//
}
// new Vue({
// new Vue({
...
...
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