<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>
|