1 Star 0 Fork 0

渠杉 / mengxiaoer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
App.vue 2.63 KB
一键复制 编辑 原始数据 按行查看 历史
渠杉 提交于 2021-01-03 21:50 . 第一次代码提交
<script>
import { log } from './util/helper.js'
export default {
async onLaunch() {
this.stopTouch(); // 禁用双指手势操作缩放与双击缩放
this.$store.commit('global/setSource'); //vuex执行获取当前设备类型的方法
const type = this.$store.state.global.source;
if(type == 'ios'){
console.log('高德地图注册')
cm.registerWithKey({
success:function(res){
console.log(res);
},
fail:function(res){
console.log(res)
}
})
}
},
methods:{
stopTouch(){
// 禁用双指手势操作缩放
window.onload=function () {
try {
// 禁用双击缩放
document.addEventListener("touchstart", function(event) {
if (event.touches.length > 1) {
event.preventDefault();
}
});
var lastTouchEnd = 0;
document.addEventListener(
"touchend",
function(event) {
var now = new Date().getTime();
if (now - lastTouchEnd <= 300) {
event.preventDefault();
}
lastTouchEnd = now;
},
false
);
// 禁用双指手势操作
document.addEventListener("gesturestart", function(event) {
event.preventDefault();
});
} catch (error) {console.log(error)}
};
}
},
onShow: function() {
},
onHide: function() {
},
onError(err) {
log.reportApi(err)
}
}
</script>
<style lang="scss">
@import "uview-ui/index.scss";
page{
height: 100%;
}
//ios系统会默认你的input字体大小不得小于16px,要是小于16px系统就会给你放大页面
input{
font-size: 32rpx !important;
}
/*每个页面公共css */
.g-border {
border: 1px solid #e6e6e6;
}
.g-border-bottom {
border-bottom: 1px solid #e6e6e6;
}
.g-border-top {
border-top: 1px solid #e6e6e6;
}
.g-border-left {
border-left: 1px solid #e6e6e6;
}
.g-border-right {
border-right: 1px solid #e6e6e6;
}
@media screen and (-webkit-min-device-pixel-ratio: 2) {
.g-border {
border: .5px solid #e6e6e6;
}
.g-border-bottom {
border-bottom: .5px solid #e6e6e6;
}
.g-border-top {
border-top: .5px solid #e6e6e6;
}
.g-border-left {
border-left: .5px solid #e6e6e6;
}
.g-border-right {
border-right: .5px solid #e6e6e6;
}
}
@media screen and (-webkit-min-device-pixel-ratio: 3) {
.g-border {
border: .5px solid #e6e6e6;
}
.g-border-bottom {
border-bottom: .5px solid #e6e6e6;
}
.g-border-top {
border-top: .5px solid #e6e6e6;
}
.g-border-left {
border-left: .5px solid #e6e6e6;
}
.g-border-right {
border-right: .5px solid #e6e6e6;
}
}
</style>
JavaScript
1
https://gitee.com/cpk1981783891/mengxiaoerh5.git
git@gitee.com:cpk1981783891/mengxiaoerh5.git
cpk1981783891
mengxiaoerh5
mengxiaoer
master

搜索帮助