旅游教育出版社-数字教材移动端
litian
2025-06-27 f13b301e61d022787da1ef3e3adcd508b9422096
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<template>
  <div class="box">
    <div class="title">登录</div>
    <div class="btn" @click="bindingWeChat">使用微信登录</div>
    <div class="checkbox">
      <van-checkbox v-model="checked" shape="square"
        >我已阅读并同意
        <span
          style="color: #3586ff; z-index: 1"
          @click.stop="dialogVisible = true"
          >用户条款</span
        >与<span
          style="color: #3586ff; z-index: 1"
          @click.stop="privacyDialogVisible = true"
          >隐私协议</span
        >
      </van-checkbox>
    </div>
    <van-dialog
      v-model="dialogVisible"
      title="《用户条款》"
      width="90%"
      confirmButtonColor="#3586ff"
      messageAlign="left"
    >
      <div>
        <div class="protocolBox" v-html="protocolTxt"></div>
      </div>
    </van-dialog>
 
    <van-dialog
      v-model="privacyDialogVisible"
      title="《隐私协议》"
      width="90%"
      confirmButtonColor="#3586ff"
      messageAlign="left"
    >
      <div>
        <div class="protocolBox" v-html="privacyTxt"></div>
      </div>
    </van-dialog>
  </div>
</template>
 
<script>
import Vue from "vue";
import { Toast } from "vant";
Vue.use(Toast);
export default {
  data() {
    return {
      checked: false,
      dialogVisible: false,
      protocolTxt: "",
      privacyTxt: "",
      privacyDialogVisible: false
    };
  },
  created() {
    this.getProtocol();
  },
  methods: {
    bindingWeChat() {
      if (this.checked) {
        this.WeChat.getCode("weChatLogin");
      } else {
        Toast("请同意用户协议与隐私协议后再进行登录");
        return false;
      }
    },
    getProtocol() {
      var that = this;
      that.MG.resource
        .getItem({
          path: "tourism_protocol",
          fields: {
            tourism_content: []
          }
        })
        .then(res => {
          try {
            const data = res.datas.find(
              e => e.refCode == "tourism_userRegistrationAgreement"
            );
            const privacyTxtData = res.datas.find(
              e => e.refCode == "tourism_privacyPolicy"
            );
            this.protocolTxt = data ? data.tourism_content : "暂无协议";
            this.privacyTxt = privacyTxtData
              ? privacyTxtData.tourism_content
              : "暂无协议";
          } catch (error) {
            this.protocolTxt = "暂无协议";
            this.privacyTxt = "暂无协议";
          }
        });
    }
  }
};
</script>
 
<style scoped>
.box {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  color: #333;
  text-align: center;
  padding: 0 20px;
}
.title {
  font-size: 30px;
  font-weight: bold;
  margin-bottom: 20px;
  margin-top: 230px;
}
.content {
  margin-top: 130px;
 
  font-size: 16px;
}
.btn {
  width: 300px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  background-color: #409eff;
  color: #fff;
  border-radius: 20px;
  margin-top: 80px;
  cursor: pointer;
  font-size: 18px;
}
.checkbox {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  font-size: 14px;
}
.protocolBox {
  height: 60vh;
  padding: 10px 20px;
  box-sizing: border-box;
  overflow: auto;
}
</style>