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

兼容鸿蒙

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