fix
13404089107
2025-07-28 2e90f57e7d28d6a949247ef39b487d3e75b56683
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<template>
  <view class="cp-content">
    <uni-popup ref="protocolPopup" :maskClick="false" mask-background-color="#4C4C4C">
      <view class="protocolPopup">
        <view class="protocolPopup-title">
          <view class="protocolPopup-title-item" :class="{handle:current == 3}" @click="tabChange(3)">隐私协议</view>
          <view class="protocolPopup-title-item" :class="{handle:current == 2}" @click="tabChange(2)">用户协议</view>
        </view>
        <scroll-view scroll-y="true" class="protocolPopup-scroll">
          <view v-html="content" v-if="!loading"></view>
          <view class="nomore" style="padding-top: 60rpx;" v-if="loading">
            <u-loadmore status="loading" />
          </view>
        </scroll-view>
        <view class="protocolPopup-buttons">
          <button class="protocolPopup-button button h" @click="quit">不同意并退出</button>
          <button class="protocolPopup-button button" @click="close">同意</button>
        </view>
      </view>
    </uni-popup>
  </view>
</template>
 
<script>
  import uniPopup from '@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue'
  export default {
    name:"protocolPopup",
    components: { uniPopup },
    data() {
      return {
        loading:false,
        current:3,
        content:""
      };
    },
    mounted() {
      if(uni.getStorageSync('isProtocol') != 1){
        this.open()
      }
    },
    methods:{
      open(){
        this.init()
        this.$refs.protocolPopup.open()
      },
      init(){
        this.loading = true
        this.$apis.app.protocol({type:this.current,portType:1}).then(res=>{
          this.loading = false
          this.content = res.data.content1
        })
      },
      tabChange(ev){
        this.current = ev
        this.init()
      },
      quit(){
        uni.exitMiniProgram()
      },
      close(){
        uni.setStorageSync('isProtocol',1)
        this.$emit('confirm')
        this.$refs.protocolPopup.close()
      }
    }
  }
</script>
 
<style lang="scss" scoped>
.cp-content{
  .protocolPopup{
    width: 560rpx;
    height: 688rpx;
    background: #FFFFFF;
    border-radius: 12rpx;
    padding: 0 52rpx;
    .protocolPopup-title {
      display: flex;
      align-items: center;
      .protocolPopup-title-item{
        font-size: 28rpx;
        color: rgba(0, 0, 0, 0.6);
        line-height: 38rpx;
        height: 100rpx;
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        &.handle {
          color: rgba(0, 0, 0, 0.8);
        }
        &.handle::after{
          content: '';
          display: block;
          width: 32rpx;
          height: 4rpx;
          background: #FF2729;
          border-radius: 2rpx;
          position: absolute;
          bottom: 30rpx;
          left: 50%;
          transform: translateX(-50%);
        }
      }
    }
    .protocolPopup-scroll{
      width: 438rpx;
      height: 448rpx;
    }
    .protocolPopup-buttons {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-top: 30rpx;
      .protocolPopup-button {
        width: 200rpx;
        height: 69rpx;
        background: #FF2729;
        border-radius: 38rpx;
        font-size: 27rpx;
        color: #FFFFFF;
        line-height: 38rpx;
        &.h{
          background-color: rgba(0, 0, 0, 0.2);
        }
      }
    }
  }
}
</style>