| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- <template>
- <view class="agreement-box" @touchmove.stop.prevent="moveHandle">
- <view class="input-agreement animate__animated" :class="{'animate__shakeX':consentShake}" @click="setIsConsent" >
- <image class="agreement-agree" v-if="isConsent" src="/static/img/login/Checked1@3x.png" mode="aspectFill"></image>
- <image class="agreement-agree" v-else src="/static/img/login/Checked2@3x.png" mode="aspectFill"></image>
- <view class="agreement-text text-color-666 sys-size-24">已阅读并同意</view>
- <view class="agreement-text text-color-dominant sys-size-24" @click.stop="showContent">《隐私政策》</view>
- </view>
- <view >
- <uni-popup ref="consentObj">
- <view class="iPhone-padding agreement-data sys-background-fff">
- <image class="data-title" src="/static/img/login/consent_bg.png" mode="widthFix"></image>
- <view class="data-content">
- <scroll-view class="content-box" scroll-y="true" scroll-left="120">
- <rich-text :nodes="content"></rich-text>
- </scroll-view>
- </view>
- <view class="data-but text-color-fff sys-background-dominant sys-size-30 sys-weight-500 sys-radius-100" @click.stop="setConsent()">同意</view>
- </view>
- </uni-popup>
- </view>
- </view>
- </template>
- <script>
- import tools from "@/service/tools";
- import {getMessage} from "@/api/common";
- export default {
- name:'agreement',
- data() {
- return {
- isConsent:false,
- consentShake:false,
- content:''
- };
- },
- mounted() {
- this.getMessage()
- },
- methods:{
- setConsent(){
- this.isConsent=true
- this.$emit('input', this.isConsent)
- this.$refs.consentObj.close('bottom')
- },
- async getMessage() {
- const res = await getMessage({
- type: 2
- })
- if (res.code === 1) {
- this.content = tools.imgDeal(res.data)
- }
- },
- showContent(){
- this.$refs.consentObj.open('bottom')
- },
- moveHandle() {
- console.log('--------------------------------hhhhhhhhhhhhhh')
- return false
- },
- setIsConsent(){
- this.isConsent=!this.isConsent
- this.$emit('input', this.isConsent)
- },
- setConsentShake(){
- this.consentShake=true
- console.log('consentShake:'+this.consentShake)
- setTimeout(()=>{
- this.consentShake=false
- },500)
- }
- }
- }
- </script>
- <style lang="scss">
- .agreement-box{
- margin-top: 25rpx;
- height: 32rpx;
- .input-agreement{
- display: flex;
- justify-content: flex-start;
- align-items: center;
- .agreement-agree{
- width: 32rpx;
- height: 32rpx;
- transition: .5s ease;
- }
- .agreement-text{
- margin-left: 18rpx;
- }
- }
- .agreement-data{
- border-radius: 30rpx 30rpx 0 0;
- .data-title{
- width: 100%;
- border-radius: 30rpx 30rpx 0 0;
- }
- .data-content{
- padding: 20rpx 40rpx;
- .content-box{
- height: 600rpx;
- }
- }
- .data-but{
- height: 96rpx;
- line-height: 96rpx;
- text-align: center;
- margin: 0 75rpx;
- }
- }
- }
- </style>
|