lyg-popup.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template name="protocol-popup">
  2. <view @touchmove.stop.prevent="clear" v-show="showPopup">
  3. <view class="popup_mask" @touchmove.stop.prevent="clear"></view>
  4. <view class="popup_content">
  5. <view class="title">{{title}}</view>
  6. <view class="explain_text">
  7. <scroll-view scroll-y="true" style="height: 450rpx;">
  8. <u-parse :show-with-animation="true" use-cache lazy-load :html="nodeContent"></u-parse>
  9. </scroll-view>
  10. </view>
  11. <view class="button">
  12. <view @tap="back">暂不使用</view>
  13. <view @tap="confirm">同意</view>
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. name: "lyg-popup",
  21. props: {
  22. title: {
  23. type: String,
  24. default: "服务协议和隐私政策"
  25. },
  26. nodeContent: {
  27. type: String,
  28. default: "暂无协议"
  29. },
  30. // 协议路径
  31. protocolPath: {
  32. type: String
  33. },
  34. // 政策路径
  35. policyPath: {
  36. type: String
  37. },
  38. policyStorageKey: {
  39. type: String,
  40. default: "has_read_privacy"
  41. }
  42. },
  43. data() {
  44. return {
  45. showPopup: false
  46. };
  47. },
  48. created: function() {
  49. var that = this;
  50. that.showPopup = true;
  51. uni.showTabBar({});
  52. },
  53. methods: {
  54. // 禁止滚动
  55. clear() {
  56. return;
  57. },
  58. back() {
  59. this.$emit('popupState', false)
  60. // #ifdef APP-PLUS
  61. plus.runtime.quit();
  62. // #endif
  63. },
  64. // 关闭弹框
  65. confirm() {
  66. this.showPopup = false;
  67. this.$emit('popupState', true);
  68. uni.showTabBar({});
  69. }
  70. }
  71. };
  72. </script>
  73. <style lang="scss">
  74. .popup_mask {
  75. position: fixed;
  76. bottom: 0;
  77. top: 0;
  78. left: 0;
  79. right: 0;
  80. background-color: rgba(0, 0, 0, 0.4);
  81. transition-property: opacity;
  82. transition-duration: 0.3s;
  83. opacity: 0;
  84. z-index: 98;
  85. }
  86. .popup_mask {
  87. opacity: 1;
  88. }
  89. .popup_content {
  90. overflow: hidden;
  91. box-sizing: border-box;
  92. padding: 40upx 20upx 0 20upx;
  93. position: fixed;
  94. bottom: 30%;
  95. border-radius: 8px;
  96. left: 50%;
  97. margin-left: -40%;
  98. right: 0;
  99. // min-height: 400upx;
  100. background: #ffffff;
  101. width: 80%;
  102. z-index: 99;
  103. .title {
  104. text-align: center;
  105. font-size: 34upx;
  106. padding: 10upx 0 0 0;
  107. }
  108. .explain_text {
  109. font-size: 30upx;
  110. padding: 30upx 30upx 40upx 30upx;
  111. line-height: 38upx;
  112. .line {
  113. display: block;
  114. .path {
  115. color: #007aff;
  116. display: inline-block;
  117. text-align: center;
  118. }
  119. }
  120. }
  121. .button {
  122. display: flex;
  123. padding: 20upx;
  124. align-items: center;
  125. font-size: 34upx;
  126. justify-content: space-around;
  127. border-top: 1upx solid #f2f2f2;
  128. view {
  129. text-align: center;
  130. }
  131. }
  132. }
  133. </style>