修复:已知问题
This commit is contained in:
2
.idea/AugmentWebviewStateStore.xml
generated
2
.idea/AugmentWebviewStateStore.xml
generated
File diff suppressed because one or more lines are too long
@@ -6,13 +6,10 @@ import './app.scss'
|
||||
import {loginByOpenId} from "@/api/layout";
|
||||
import {TenantId} from "@/utils/config";
|
||||
// import {saveStorageByLoginUser} from "@/utils/server";
|
||||
import {mqttStart} from "@/api/hjm/hjmCar";
|
||||
// import {mqttStart} from "@/api/hjm/hjmCar";
|
||||
|
||||
function App(props) {
|
||||
const reload = () => {
|
||||
mqttStart().then(() => {
|
||||
console.log('mqttStart')
|
||||
})
|
||||
Taro.login({
|
||||
success: (res) => {
|
||||
loginByOpenId({
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: '位置明细',
|
||||
navigationBarBackgroundColor: '#ffe0e0'
|
||||
navigationBarTitleText: '位置明细'
|
||||
})
|
||||
|
||||
@@ -6,6 +6,7 @@ import {HjmCar} from "@/api/hjm/hjmCar/model";
|
||||
import Taro from '@tarojs/taro'
|
||||
import './location.scss'
|
||||
import BestSellers from "./BestSellers";
|
||||
import {getUserInfo} from "@/api/layout";
|
||||
|
||||
/**
|
||||
* 文章终极列表
|
||||
@@ -19,31 +20,30 @@ const List = () => {
|
||||
setKeywords(keywords)
|
||||
}
|
||||
|
||||
const reload = () => {
|
||||
const reload = async () => {
|
||||
// 搜索条件
|
||||
const where = {status: 1, deleted: 0, keywords}
|
||||
|
||||
// 读取用户信息
|
||||
const user = await getUserInfo();
|
||||
|
||||
// 判断身份
|
||||
const roleCode = Taro.getStorageSync('RoleCode');
|
||||
if(roleCode == 'kuaidiyuan'){
|
||||
// @ts-ignore
|
||||
where.driverId = Taro.getStorageSync('UserId')
|
||||
where.driverId = user.userId;
|
||||
}
|
||||
if(roleCode == 'zhandian'){
|
||||
// @ts-ignore
|
||||
where.organizationId = Taro.getStorageSync('OrganizationId');
|
||||
where.organizationId = user.organizationId;
|
||||
}
|
||||
if(roleCode == 'kuaidi'){
|
||||
if(Taro.getStorageSync('OrganizationId') == Taro.getStorageSync('OrganizationParentId')){
|
||||
// @ts-ignore
|
||||
where.organizationParentId = Taro.getStorageSync('OrganizationParentId');
|
||||
}else {
|
||||
// @ts-ignore
|
||||
where.organizationId = Taro.getStorageSync('OrganizationId');
|
||||
}
|
||||
where.organizationParentId = user.organizationId;
|
||||
}
|
||||
if(roleCode == 'Installer'){
|
||||
// @ts-ignore
|
||||
where.installerId = Taro.getStorageSync('UserId')
|
||||
where.installerId = user.userId;
|
||||
}
|
||||
if(roleCode == 'user'){
|
||||
return false;
|
||||
|
||||
@@ -28,8 +28,8 @@ function Home() {
|
||||
const [isAdmin, setIsAdmin] = useState<boolean>(false)
|
||||
const [search, setSearch] = useState(false)
|
||||
const [userInfo, setUserInfo] = useState<User>()
|
||||
const [longitude, setLongitude] = useState<any>(108.374959)
|
||||
const [latitude, setLatitude] = useState<any>(22.767024)
|
||||
const [longitude, setLongitude] = useState<any>()
|
||||
const [latitude, setLatitude] = useState<any>()
|
||||
const [markers, setMarkers] = useState<Market[]>([])
|
||||
const [scale, setScale] = useState<any>(12)
|
||||
const [keywords, setKeywords] = useState<string>('')
|
||||
@@ -110,6 +110,7 @@ function Home() {
|
||||
const res = await Taro.getLocation({
|
||||
type: 'gcj02' //返回可以用于wx.openLocation的经纬度
|
||||
})
|
||||
|
||||
if (res.latitude) {
|
||||
setLatitude(res.latitude)
|
||||
}
|
||||
@@ -145,10 +146,12 @@ function Home() {
|
||||
reload();
|
||||
}
|
||||
|
||||
const pageHjmCarByMap = (latitude?: any, longitude?: any) => {
|
||||
const pageHjmCarByMap = async (latitude?: any, longitude?: any) => {
|
||||
// 搜索条件
|
||||
const where = {}
|
||||
|
||||
const user = await getUserInfo();
|
||||
|
||||
// 交警和邮管不能在小程序主界面地图上看到任何一个车辆的定位
|
||||
if(Taro.getStorageSync('RoleCode') == 'jiaojing' || Taro.getStorageSync('RoleCode') == 'youzheng'){
|
||||
return false
|
||||
@@ -165,19 +168,19 @@ function Home() {
|
||||
const roleCode = Taro.getStorageSync('RoleCode');
|
||||
if (roleCode == 'kuaidiyuan') {
|
||||
// @ts-ignore
|
||||
where.driverId = Taro.getStorageSync('UserId')
|
||||
where.driverId = user.userId;
|
||||
}
|
||||
if (roleCode == 'zhandian') {
|
||||
// @ts-ignore
|
||||
where.organizationId = Taro.getStorageSync('OrganizationId');
|
||||
where.organizationId = user.organizationId;
|
||||
}
|
||||
if (roleCode == 'kuaidi') {
|
||||
// @ts-ignore
|
||||
where.organizationParentId = Taro.getStorageSync('OrganizationParentId');
|
||||
where.organizationParentId = user.organizationId;
|
||||
}
|
||||
|
||||
pageByQQMap(where).then(res => {
|
||||
console.log(res, 'pageByQQMap')
|
||||
console.log(res?.count, 'pageByQQMap')
|
||||
if (res?.list && res?.list.length > 0) {
|
||||
const data = res?.list;
|
||||
const arr = []
|
||||
@@ -323,11 +326,6 @@ function Home() {
|
||||
}
|
||||
}).catch(() => {
|
||||
setIsLogin(false);
|
||||
setMarkers([{
|
||||
id: 123,
|
||||
latitude: latitude,
|
||||
longitude: longitude
|
||||
}])
|
||||
console.log('未登录')
|
||||
});
|
||||
}
|
||||
|
||||
@@ -57,8 +57,10 @@ const UserCell = () => {
|
||||
/>
|
||||
</Cell.Group>
|
||||
{
|
||||
(roleName === 'kuaidi' || roleName == 'zhandian') && (
|
||||
(roleName === 'kuaidi' || roleName == 'zhandian' || roleName == 'youzheng') && (
|
||||
<>
|
||||
{
|
||||
roleName != 'youzheng' && (
|
||||
<Cell.Group divider={true}>
|
||||
<Cell
|
||||
className="nutui-cell-clickable"
|
||||
@@ -75,6 +77,8 @@ const UserCell = () => {
|
||||
}}
|
||||
/>
|
||||
</Cell.Group>
|
||||
)
|
||||
}
|
||||
<Cell.Group divider={true}>
|
||||
<Cell
|
||||
className="nutui-cell-clickable"
|
||||
|
||||
Reference in New Issue
Block a user