Commit d2e526cb by 展昭

修改main.js用于测试jsbridge 03

parent c5111d9b
Showing with 49 additions and 49 deletions
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import 'lib-flexible/flexible'
import './assets/css/index.css'
import './utils/filter'
import FastClick from 'fastclick'
// import initJsBridge from "./assets/js/JsBridge";
import bridge from "./assets/js/bridge/birdge";
// import Vue from 'vue'
// import App from './App.vue'
// import router from './router'
// import store from './store'
// import 'lib-flexible/flexible'
// import './assets/css/index.css'
// import './utils/filter'
// import FastClick from 'fastclick'
// // import initJsBridge from "./assets/js/JsBridge";
// import bridge from "./assets/js/bridge/birdge";
Vue.config.productionTip = false
// Vue.config.productionTip = false
Vue.prototype.globalNavLeftArrowClick = function (callback) {
document.getElementsByClassName("van-nav-bar__left")[0].onclick = function () {
callback();
};
};
// Vue.prototype.globalNavLeftArrowClick = function (callback) {
// document.getElementsByClassName("van-nav-bar__left")[0].onclick = function () {
// callback();
// };
// };
FastClick.attach(document.body);
// FastClick.attach(document.body);
FastClick.prototype.focus = function (targetElement) {
let length;
if (targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month') {
length = targetElement.value.length;
targetElement.focus();
targetElement.setSelectionRange(length, length);
} else {
targetElement.focus();
}
};
// FastClick.prototype.focus = function (targetElement) {
// let length;
// if (targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month') {
// length = targetElement.value.length;
// targetElement.focus();
// targetElement.setSelectionRange(length, length);
// } else {
// targetElement.focus();
// }
// };
Vue.prototype.setPageNavState = function () {
bridge.setPageNavState({
isShowClose: false,
isShowBack: false,
isCloseLeft: false,
isShowTitle: false,
isShowNav: false,
isCloseWebView: false
});
// Vue.prototype.setPageNavState = function () {
// bridge.setPageNavState({
// isShowClose: false,
// isShowBack: false,
// isCloseLeft: false,
// isShowTitle: false,
// isShowNav: false,
// isCloseWebView: false
// });
bridge.getBarHeight().then(response => {
response = JSON.parse(response);
const barHeight = response.statusBarHeight;
localStorage.setItem("barHeight", barHeight);
console.log('main barHeight=', barHeight);
})
// bridge.getBarHeight().then(response => {
// response = JSON.parse(response);
// const barHeight = response.statusBarHeight;
// localStorage.setItem("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') {
const VConsole = require('vconsole')
const my_console = new VConsole();
}
// if (process.env.NODE_ENV === 'development'||process.env.NODE_ENV === 'staging') {
// const VConsole = require('vconsole')
// const my_console = new VConsole();
// }
// new Vue({
......
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 sign in to comment