提交 cfc3e746 编写于 作者: M mahaifeng

[privacy] 添加隐私弹框示例

上级 8aa250af
......@@ -6,6 +6,10 @@
wrong path</button>
<button class="uni-common-mt" id="go-next-page-open-dialog1" @click="goNextPageOpenDialog1">go next page & open
dialog1</button>
<!-- #ifdef APP-ANDROID -->
<button class="uni-common-mt" id="privacy_test" @click="privacy">隐私协议</button>
<!-- #endif -->
</view>
</template>
......@@ -190,7 +194,12 @@
},
getLifeCycleNum(): number {
return state.lifeCycleNum
}
},
privacy() {
uni.openDialogPage({
url: '/pages/API/dialog-page/dialog-privacytest',
})
},
}
}
</script>
<template>
<view class="dialog-container">
<view class="dialog-content">
<text style="text-align: center;margin: 12px;font-size: 20px;"> 隐私协议弹框</text>
<button type="primary" style="margin-top: 12px;margin-bottom: 12px;" open-type="agreePrivacyAuthorization"
@click="agree">同意</button>
<button @click="reject">拒绝</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
agree() {
// #ifdef APP-ANDROID
uni.showToast({
title: 'isPrivacyAgree:' + UTSAndroid.isPrivacyAgree()
})
uni.closeDialogPage({
dialogPage: this.$page as UniDialogPage
})
// #endif
},
reject() {
// #ifdef APP-ANDROID
UTSAndroid.setPrivacyAgree(false)
uni.showToast({
title: 'isPrivacyAgree:' + UTSAndroid.isPrivacyAgree()
})
uni.closeDialogPage({
dialogPage: this.$page as UniDialogPage
})
// #endif
}
}
}
</script>
<style>
.dialog-container {
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.3);
display: flex;
justify-content: center;
align-items: center;
}
.dialog-content {
width: 80%;
padding: 10px;
background-color: #fff;
border-radius: 6px;
}
.mt-10 {
margin-top: 10px;
}
</style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册