Browse Source

iOS浏览器判断

lzm_web
Linzm 8 months ago
parent
commit
d8316cf49d
  1. 19
      src/views/badge/index.vue

19
src/views/badge/index.vue

@ -21,11 +21,14 @@ const options = ref({ @@ -21,11 +21,14 @@ const options = ref({
})
const openApp = () => {
var userAgent = navigator.userAgent;
if (userAgent.match(/iPhone|iPod|iPad/i)) {
const ua = navigator.userAgent;
const isIOS = /iPhone|iPad|iPod/i.test(ua);
const isAndroid = /Android/i.test(ua);
if (isIOS) {
option.value.ceilbutton = true
options.value.ceilbutton = true
} else if (userAgent.match(/Android/i)) {
} else if (isAndroid) {
option.value.ceilbutton = false
options.value.ceilbutton = false
} else {
@ -321,6 +324,7 @@ onMounted(() => { @@ -321,6 +324,7 @@ onMounted(() => {
getList()
getOrderStat()
getSizeList()
openApp()
})
</script>
@ -1054,9 +1058,16 @@ onMounted(() => { @@ -1054,9 +1058,16 @@ onMounted(() => {
}
.btndiv {
position: fixed;
bottom: 10vh;
bottom: 120px;
width: 80%;
left: 50%;
transform: translateX(-50%);
}
@media screen and (max-width: 767px) {
_::-webkit-full-page-media,
_:future,
:root .btndiv {
padding-bottom: 120px;
}
}
</style>

Loading…
Cancel
Save