forked from natuka/web.puabadge.com
iOS浏览器判断
This commit is contained in:
1 parent
52c21e094e
commit
d8316cf49d
1 file changed
+15
-4
@@ -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(() => {
|
||||
getList()
|
||||
getOrderStat()
|
||||
getSizeList()
|
||||
openApp()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -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>
|
||||
Reference in new issue
Block a user