Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
XBRLPX-LS-h5
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
刘旭
XBRLPX-LS-h5
Commits
9bb0a4ee
提交
9bb0a4ee
authored
7月 25, 2023
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新地图完成按钮位置
上级
4b27f50d
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
168 行增加
和
162 行删除
+168
-162
index.vue
src/components/header/index.vue
+107
-73
setPositionItem.vue
src/pages/setPositioning/components/setPositionItem.vue
+0
-21
map.vue
src/pages/setPositioning/map.vue
+49
-56
request.ts
src/utils/request.ts
+8
-5
vite.config.ts
vite.config.ts
+4
-7
没有找到文件。
src/components/header/index.vue
浏览文件 @
9bb0a4ee
<
template
>
<u-navbar
back-text=
""
:title=
"title"
:is-back=
"isBack"
:back-icon-name=
"backIconName"
title-color=
"#000000"
:background=
"
{ background }" title-width="400" height="48" back-icon-color="#000000"
@click-left="handleLeftIconClick">
<template
#
default
>
<u-icon
:name=
"backIconName"
:size=
"22"
color=
"#000000"
style=
"padding: 14rpx 14rpx 14rpx 24rpx;"
@
tap=
"handleLeftIconClick"
/>
</
template
>
<
template
#
right
>
<u-icon
:name=
"iconName"
:size=
"22"
color=
"#000000"
style=
"padding: 14rpx 14rpx 14rpx 24rpx;"
@
tap=
"handleRight"
/>
</
template
>
</u-navbar>
<u-action-sheet
:list=
"sheetState.list"
v-model=
"sheetState.show"
@
click=
"onConfirm"
/>
<u-navbar
back-text=
""
:title=
"title"
:is-back=
"isBack"
:back-icon-name=
"backIconName"
title-color=
"#000000"
:background=
"
{ background }"
title-width="400"
height="48"
back-icon-color="#000000"
@click-left="handleLeftIconClick"
>
<template
#
default
>
<u-icon
:name=
"backIconName"
:size=
"22"
color=
"#000000"
style=
"padding: 14rpx 14rpx 14rpx 24rpx"
@
tap=
"handleLeftIconClick"
/>
</
template
>
<
template
#
right
>
<u-icon
v-if=
"isButton"
:name=
"iconName"
:size=
"22"
color=
"#000000"
style=
"padding: 14rpx 14rpx 14rpx 24rpx"
@
tap=
"handleRight"
/>
<u-button
v-else
type=
"primary"
size=
"mini"
@
tap=
"submit"
style=
"margin-right: 30rpx"
>
完成
</u-button
>
</
template
>
</u-navbar>
<u-action-sheet
:list=
"sheetState.list"
v-model=
"sheetState.show"
@
click=
"onConfirm"
/>
</template>
<
script
setup
lang=
'ts'
>
<
script
setup
lang=
"ts"
>
defineProps
({
title
:
{
type
:
String
,
default
:
""
,
},
backIconName
:
{
type
:
String
,
default
:
"arrow-left"
,
},
iconName
:
{
type
:
String
,
default
:
"more-dot-fill"
,
},
background
:
{
type
:
String
,
default
:
"#eeeeee"
,
},
sheetList
:
{
type
:
Object
,
default
:
[],
},
isBack
:
{
type
:
Boolean
,
default
:
false
,
},
isButton
:
{
type
:
Boolean
,
default
:
true
,
},
})
const
props
=
defineProps
({
title
:
{
type
:
String
,
default
:
''
},
backIconName
:
{
type
:
String
,
default
:
'arrow-left'
},
iconName
:
{
type
:
String
,
default
:
'more-dot-fill'
const
emits
=
defineEmits
([
"handleRight"
,
"goback"
,
"submit"
])
const
sheetState
=
reactive
({
list
:
[
{
text
:
"点赞"
,
color
:
"blue"
,
fontSize
:
28
,
subText
:
"感谢您的点赞"
,
},
background
:
{
type
:
String
,
default
:
'#eeeeee'
{
text
:
"分享"
,
},
sheetList
:
{
type
:
Object
,
default
:
[]
{
text
:
"评论"
,
},
isBack
:
{
type
:
Boolean
,
default
:
false
}
],
show
:
false
,
})
const
emits
=
defineEmits
([
'handleRight'
,
'goback'
])
const
handleRight
=
()
=>
{
sheetState
.
show
=
true
// emits('handleRight')
sheetState
.
show
=
true
// emits('handleRight')
}
// 点击左侧返回图标
const
handleLeftIconClick
=
()
=>
{
uni
.
navigateBack
()
uni
.
navigateBack
()
}
const
sheetState
=
reactive
({
list
:
[{
text
:
'点赞'
,
color
:
'blue'
,
fontSize
:
28
,
subText
:
'感谢您的点赞'
},
{
text
:
'分享'
},
{
text
:
'评论'
}],
show
:
false
})
const
onConfirm
=
(
index
:
number
)
=>
{
const
item
=
sheetState
.
list
[
index
]
console
.
log
(
item
);
const
item
=
sheetState
.
list
[
index
]
console
.
log
(
item
)
// switch (item.options.operate) {
// case 'save':
// switch (item.options.operate) {
// case 'save':
// break;
// }
}
// break;
// }
const
submit
=
()
=>
{
emits
(
"submit"
)
}
</
script
>
<
style
lang =
"scss"
scoped
>
:deep
(
.u-line-1
)
{
font-weight
:
bold
!
important
;
font-size
:
16px
!
important
;
}
<
style
lang=
"scss"
scoped
>
:deep
(
.u-icon__icon
)
{
font-size
:
20px
!
important
;
font-weight
:
bold
!
important
;
font-size
:
20px
!
important
;
font-weight
:
bold
!
important
;
}
</
style
>
\ No newline at end of file
</
style
>
src/pages/setPositioning/components/setPositionItem.vue
浏览文件 @
9bb0a4ee
...
...
@@ -39,27 +39,6 @@ const props = defineProps({
})
const
openMap
=
()
=>
{
// uni.getLocation({
// type: 'gcj02',
// success(res: any) {
// console.log(res, 'kkk');
// state.coord = res.latitude + ',' + res.longitude
// // alert(state.coord)
// var geolocation = new window.qq.maps.Geolocation(
// "3M5BZ-SFCRJ-AHSF7-XRA5Q-Y6NIJ-DXBH4",
// "myapp"
// )
// geolocation.getLocation(showPosition, showErr)
// function showPosition(position: any) {
// console.log(position, '打印位置信息');
// let backurl = '/pages/setPositioning/map'
// let url = `https://apis.map.qq.com/tools/locpicker?search=1&type=0&backurl=${backurl}&key=3M5BZ-SFCRJ-AHSF7-XRA5Q-Y6NIJ-DXBH4&referer=myapp`
// window.open(url)
// }
// function showErr() { }
// }
// })
uni
.
navigateTo
({
url
:
'/pages/setPositioning/map'
})
...
...
src/pages/setPositioning/map.vue
浏览文件 @
9bb0a4ee
<
template
>
<headers
title=
'考勤地点设置'
/>
<view
v-if=
"flag"
style=
"width: 100%; height: 100vh
"
>
<iframe
id=
"mapPage"
width=
"100%"
height=
"100%"
frameborder=
0
:src=
"src"
>
</iframe>
</view>
<headers
title=
"考勤地点设置"
:is-button=
"false"
@
submit=
"submit"
/>
<view
v-if=
"flag"
class=
"map
"
>
<iframe
id=
"mapPage"
width=
"100%"
height=
"100%"
frameborder=
"0"
:src=
"src"
>
</iframe>
</view>
</
template
>
<
script
setup
lang=
'ts'
>
import
headers
from
'@/components/header/index.vue'
import
{
zalert
}
from
'@/utils/util'
<
script
setup
lang=
"ts"
>
import
headers
from
"@/components/header/index.vue"
import
{
zalert
,
toast
}
from
"@/utils/util"
const
state
=
reactive
({
key
:
'3M5BZ-SFCRJ-AHSF7-XRA5Q-Y6NIJ-DXBH4'
,
coord
:
''
key
:
"3M5BZ-SFCRJ-AHSF7-XRA5Q-Y6NIJ-DXBH4"
,
coord
:
""
,
})
const
src
=
ref
()
const
flag
=
ref
(
false
)
const
addrDetail
=
ref
()
window
.
addEventListener
(
'message'
,
function
(
event
)
{
window
.
addEventListener
(
"message"
,
function
(
event
)
{
// 接收位置信息,用户选择确认位置点后选点组件会触发该事件,回传用户的位置信息
var
loc
=
event
.
data
;
if
(
loc
&&
loc
.
module
==
'locationPicker'
)
{
//防止其他应用也会向该页面post信息,需判断module是否为'locationPicker'
console
.
log
(
'location'
,
loc
);
// uni.navigateBack()
zalert
(
'确定设置为该地址?'
,
()
=>
{
uni
.
navigateBack
()
})
var
loc
=
event
.
data
if
(
loc
&&
loc
.
module
==
"locationPicker"
)
{
//防止其他应用也会向该页面post信息,需判断module是否为'locationPicker'
addrDetail
.
value
=
loc
}
},
false
)
},
false
)
const
submit
=
()
=>
{
if
(
!
addrDetail
.
value
)
return
toast
(
"请选择地址"
)
console
.
log
(
"location"
,
addrDetail
.
value
)
zalert
(
"确定设置为该地址?"
,
()
=>
{
uni
.
navigateBack
()
})
}
onMounted
(()
=>
{
uni
.
getLocation
({
type
:
'gcj02'
,
success
(
res
:
any
)
{
state
.
coord
=
res
.
latitude
+
','
+
res
.
longitude
src
.
value
=
`https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=
${
state
.
key
}
&referer=XBRLPX&coord=
${
state
.
coord
}
&zoom=18`
setTimeout
(()
=>
{
flag
.
value
=
true
},
100
)
}
})
uni
.
getLocation
({
type
:
"gcj02"
,
success
(
res
:
any
)
{
state
.
coord
=
res
.
latitude
+
","
+
res
.
longitude
src
.
value
=
`https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=
${
state
.
key
}
&referer=XBRLPX&coord=
${
state
.
coord
}
&zoom=18`
setTimeout
(()
=>
{
flag
.
value
=
true
},
100
)
},
})
})
</
script
>
<
style
lang=
"scss"
scoped
>
.map
{
width
:
100%
;
transition
:
height
.3s
;
map
{
width
:
100%
;
height
:
100%
;
}
.cotrons
{
text-align
:
end
;
padding
:
20rpx
;
}
}
position
:
relative
;
width
:
100%
;
height
:
100vh
;
.addr
{
position
:
fixed
;
bottom
:
0
;
width
:
100%
;
background-color
:
#ffffff
;
// height: 500px;
padding
:
10rpx
;
transition
:
height
.3s
;
border-top-left-radius
:
20rpx
;
border-top-right-radius
:
20rpx
;
.complete
{
position
:
absolute
;
top
:
5%
;
right
:
10rpx
;
}
}
</
style
>
\ No newline at end of file
</
style
>
src/utils/request.ts
浏览文件 @
9bb0a4ee
...
...
@@ -10,7 +10,7 @@ function request(
data
?:
object
|
any
,
responseType
?:
string
)
{
return
new
Promise
<
any
>
(
function
(
resolve
,
reject
)
{
return
new
Promise
<
any
>
(
function
(
resolve
,
reject
)
{
let
header
:
any
;
const
globalStore
=
useGlobalStore
();
uni
.
showLoading
({
...
...
@@ -22,6 +22,9 @@ function request(
Authorization
:
globalStore
.
token
,
};
}
header
=
{
'content-type'
:
'application/json'
};
// #ifdef APP-PLUS
url
=
baseUrl
+
url
;
// 在app上不需要跨域
// #endif
...
...
@@ -36,10 +39,10 @@ function request(
uni
.
hideLoading
();
// 判断是否存在token
if
(
res
.
data
.
code
==
200
)
{
const
pages
=
getCurrentPages
();
let
currentRoute
=
pages
[
pages
.
length
-
1
].
route
;
if
(
!
globalStore
.
token
&&
currentRoute
!==
'pages/login/index'
)
return
uni
.
reLaunch
({
url
:
'/pages/login/index'
});
//
const pages = getCurrentPages();
//
let currentRoute = pages[pages.length - 1].route;
//
if (!globalStore.token && currentRoute !== 'pages/login/index')
//
return uni.reLaunch({ url: '/pages/login/index' });
resolve
(
res
);
}
else
if
(
res
.
data
.
code
==
500
||
res
.
data
.
code
===
401
)
{
uni
.
showToast
({
...
...
vite.config.ts
浏览文件 @
9bb0a4ee
...
...
@@ -61,17 +61,14 @@ export default defineConfig({
},
server
:
{
host
:
'0.0.0.0'
,
port
:
789
6
,
port
:
789
7
,
open
:
true
,
strictPort
:
false
,
// 端口被占用直接退出
https
:
true
,
// 默认用http方式
proxy
:
{
'/lowcodeplatform-system'
:
{
target
:
'http://192.168.1.156'
,
},
'/wms-system'
:
{
target
:
'http://192.168.1.156'
,
},
'/XiBU'
:
{
target
:
'http://192.168.1.12'
,
}
},
},
});
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论