index.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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', 'urlTitle'],
  33. created() {
  34. console.log('showPrivateBox-----', this.showPrivateBox);
  35. },
  36. methods: {
  37. openPrivacyContract() {
  38. wx.openPrivacyContract({
  39. // success: () => {}, // 打开成功
  40. // fail: () => {}, // 打开失败
  41. // complete() => {}
  42. });
  43. },
  44. handleAgreePrivacyAuthorization() {
  45. getApp().globalData.showPrivacy = false;
  46. this.$emit('confirmP');
  47. },
  48. handleDisagree() {
  49. console.log('handleDisagree()');
  50. this.$emit('cancleP');
  51. }
  52. }
  53. }
  54. </script>
  55. <style lang="scss" scoped>
  56. @import "./index.scss";
  57. </style>