帧视界壹通告,付费看视频的微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
2.6 KiB

11 months ago
  1. <template>
  2. <uv-popup ref="privacyPopup">
  3. <view class="privacyPopup">
  4. <view class="title">
  5. <view class="title_circle"></view>
  6. <view>{{ title }}</view>
  7. </view>
  8. <view class="content_pri">
  9. <text>在你使用{{ title }}服务之前请仔细阅读</text>
  10. <text style="color: #1793ee;" @click="goToPrivacy">{{ title }}小程序隐私保护指引</text>
  11. <text>如你同意{{ title }}小程序隐私保护指引请点击同意开始使用{{ title }}</text>
  12. </view>
  13. <view class="pri_btn">
  14. <button class="confuse_btn" @click="confusePrivacy">拒绝</button>
  15. <button class="confirm_btn" id="agree-btn" open-type="agreePrivacyAuthorization"
  16. @agreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button>
  17. </view>
  18. </view>
  19. </uv-popup>
  20. </template>
  21. <script>
  22. export default {
  23. data(){
  24. return{
  25. title : '帧视界',
  26. }
  27. },
  28. methods:{
  29. init(resolve){
  30. this.$refs.privacyPopup.open()
  31. this.resolvePrivacyAuthorization = resolve
  32. },
  33. // 打开隐私协议
  34. goToPrivacy(){
  35. wx.openPrivacyContract({
  36. success: () => {
  37. console.log('打开成功');
  38. }, // 打开成功
  39. fail: () => {
  40. uni.showToast({
  41. title:'打开失败,稍后重试',
  42. icon: 'none'
  43. })
  44. } // 打开失败
  45. })
  46. },
  47. // 拒绝
  48. confusePrivacy(){
  49. this.$refs.privacyPopup.close()
  50. this.resolvePrivacyAuthorization({ event:'disagree' })
  51. },
  52. // 同意
  53. handleAgreePrivacyAuthorization(){
  54. // 告知平台用户已经同意,参数传同意按钮的id
  55. this.resolvePrivacyAuthorization({ buttonId: 'agree-btn', event: 'agree' })
  56. this.$refs.privacyPopup.close()
  57. }
  58. }
  59. }
  60. </script>
  61. <style scoped lang="scss">
  62. *{
  63. box-sizing: border-box;
  64. }
  65. .privacyPopup{
  66. width: 520rpx;
  67. /* height: 500rpx; */
  68. background-color: #fff;
  69. border-radius: 50rpx;
  70. padding: 20rpx 40rpx;
  71. }
  72. .title{
  73. display: flex;
  74. align-items: center;
  75. justify-content: start;
  76. margin: 20rpx 0;
  77. font-size: 38rpx;
  78. font-weight: 600;
  79. }
  80. .title .title_circle{
  81. width: 60rpx;
  82. height: 60rpx;
  83. background-color: #efefef;
  84. border-radius: 50%;
  85. margin-right: 20rpx;
  86. }
  87. .content_pri{
  88. width: 480rpx;
  89. margin: 0 auto;
  90. font-size: 34rpx;
  91. line-height: 1.5;
  92. }
  93. .pri_btn{
  94. width: 100%;
  95. height: 158rpx;
  96. display: flex;
  97. align-items: center;
  98. justify-content: space-evenly;
  99. }
  100. .pri_btn .confuse_btn,.pri_btn .confirm_btn{
  101. width: 200rpx;
  102. height: 90rpx;
  103. border-radius: 20rpx;
  104. font-size: 34rpx;
  105. }
  106. .pri_btn .confuse_btn{
  107. background-color: #eee;
  108. color: #52bf6b;
  109. }
  110. .pri_btn .confirm_btn{
  111. background-color: #52bf6b;
  112. color: #fff;
  113. }
  114. </style>