index.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <u-popup :show="showPrivateBox" @close="" @open="" :round="10">
  3. <view class="popup-box">
  4. <view class="weui-half-screen-dialog__hd">
  5. {{title}}
  6. </view>
  7. <view class="weui-half-screen-dialog__bd">
  8. <text class="weui-half-screen-dialog__tips">{{desc1}}</text>
  9. <text class="weui-half-screen-dialog__tips color-8BC21F" @click="openPrivacyContract">
  10. {{urlTitle}}
  11. </text>
  12. <text class="weui-half-screen-dialog__tips">{{desc2}}</text>
  13. </view>
  14. <view class="weui-half-screen-dialog__ft">
  15. <button class="weui-btn" @click="handleDisagree">拒绝</button>
  16. <button id="agree-btn" type="default" open-type="agreePrivacyAuthorization" class="weui-btn agree"
  17. @agreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button>
  18. </view>
  19. </view>
  20. </u-popup>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. title: "用户隐私保护提示",
  27. desc1: "感谢您使用本产品,您使用本产品前应当仔细阅读并同意",
  28. urlTitle: "《小程序隐私保护指引》",
  29. desc2: "当您点击同意并开始使用产品服务时,即表示你已理解并同意该条款内容,该条款将对您产生法律约束力。如您拒绝,将无法更好的体验产品。",
  30. };
  31. },
  32. props: ['showPrivateBox'],
  33. methods: {
  34. openPrivacyContract() {
  35. wx.openPrivacyContract({
  36. // success: () => {}, // 打开成功
  37. // fail: () => {}, // 打开失败
  38. // complete() => {}
  39. });
  40. },
  41. handleAgreePrivacyAuthorization() {
  42. getApp().globalData.showPrivacy = false;
  43. this.$emit('confirmP');
  44. },
  45. handleDisagree() {
  46. console.log('handleDisagree()');
  47. this.$emit('cancleP');
  48. }
  49. }
  50. }
  51. </script>
  52. <style lang="scss" scoped>
  53. @import "./index.scss";
  54. </style>