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

Loading…
Cancel
Save