提交 81898d31 编写于 作者: Anne_LXM's avatar Anne_LXM 提交者: Anne_LXM

兼容鸿蒙

上级 bbdee866
......@@ -31,7 +31,7 @@
<!-- 通过body插槽定义布局 -->
<template v-slot:body>
<view class="main">
<text class="title">{{item.title}}-111</text>
<text class="title">{{item.title}}</text>
<view class="info">
<text class="author">{{item.user_id[0]?item.user_id[0].nickname:''}}</text>
<uni-dateformat class="last_modify_date" :date="item.last_modify_date"
......@@ -45,7 +45,7 @@
<uni-list-item>
<template v-slot:body>
<!-- #endif -->
<uni-load-state @networkResume="refresh" :state="{data,pagination,hasMore, loading, error}"
<uni-load-state class="load-state" @networkResume="refresh" :state="{data,pagination,hasMore, loading, error}"
@loadMore="loadMore">
</uni-load-state>
<!-- #ifdef APP -->
......@@ -126,13 +126,11 @@
// title:"获取定位中"
// });
//默认h5端不获取定位
// #ifndef H5
if(!this.isTest){
let location = await gps.getLocation({
geocode: true
})
}
// console.log(location);
// #ifndef H5 || APP-HARMONY
let location = await gps.getLocation({
geocode: true
})
console.log(location);
// #endif
// if(location){
// uni.showToast({
......@@ -258,4 +256,8 @@
z-index: 999;
/* #endif */
}
.load-state{
justify-content: center;
width: 750rpx;
}
</style>
// #ifdef APP-PLUS
// #ifdef APP
import permision from "./wa-permission/permission.js"
// #endif
class Gps {
......@@ -27,10 +27,10 @@ class Gps {
title: '定位获取失败',
icon: 'none'
});
console.error(err)
console.error(JSON.stringify(err))
callback(false)
// #ifdef APP-PLUS
// #ifdef APP
await this.checkGpsIsOpen()
// #endif
......@@ -63,7 +63,7 @@ class Gps {
});
})
}
// #ifdef APP-PLUS
// #ifdef APP
async checkGpsIsOpen() {
this.lock = true //加锁防止重复的请求
// console.log('检查定位设置开启问题', permision.checkSystemEnableLocation());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册