Showing
4 changed files
with
72 additions
and
20 deletions
| ... | @@ -30,6 +30,7 @@ const Api = { | ... | @@ -30,6 +30,7 @@ const Api = { |
| 30 | DOWN_EMAIL: '/srv/?a=down_email', | 30 | DOWN_EMAIL: '/srv/?a=down_email', |
| 31 | DOWN_ZIP: '/srv/?a=down_zip', | 31 | DOWN_ZIP: '/srv/?a=down_zip', |
| 32 | CONCAT: '/srv/?a=contact', | 32 | CONCAT: '/srv/?a=contact', |
| 33 | + ARTICLE: '/srv/?a=article', | ||
| 33 | }; | 34 | }; |
| 34 | 35 | ||
| 35 | export const honorAPI = (params) => fn(fetch.get(Api.HONOR, params)); | 36 | export const honorAPI = (params) => fn(fetch.get(Api.HONOR, params)); |
| ... | @@ -67,3 +68,4 @@ export const downEmailAPI = (params) => fn(fetch.post(Api.DOWN_EMAIL, params)); | ... | @@ -67,3 +68,4 @@ export const downEmailAPI = (params) => fn(fetch.post(Api.DOWN_EMAIL, params)); |
| 67 | export const downZipAPI = (params) => fn(fetch.post(Api.DOWN_ZIP, params)); | 68 | export const downZipAPI = (params) => fn(fetch.post(Api.DOWN_ZIP, params)); |
| 68 | 69 | ||
| 69 | export const concatAPI = (params) => fn(fetch.get(Api.CONCAT, params)); | 70 | export const concatAPI = (params) => fn(fetch.get(Api.CONCAT, params)); |
| 71 | +export const getArticleAPI = (params) => fn(fetch.get(Api.ARTICLE, params)); | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2024-10-25 12:46:06 | 2 | * @Date: 2024-10-25 12:46:06 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-10-25 12:46:26 | 4 | + * @LastEditTime: 2024-12-11 14:09:28 |
| 5 | * @FilePath: /hager/src/components/privacy.vue | 5 | * @FilePath: /hager/src/components/privacy.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| 8 | <template> | 8 | <template> |
| 9 | <div class="privacy-page"> | 9 | <div class="privacy-page"> |
| 10 | - Privacy | 10 | + <div v-html="content"></div> |
| 11 | </div> | 11 | </div> |
| 12 | </template> | 12 | </template> |
| 13 | 13 | ||
| ... | @@ -16,6 +16,12 @@ import mixin from 'common/mixin'; | ... | @@ -16,6 +16,12 @@ import mixin from 'common/mixin'; |
| 16 | 16 | ||
| 17 | export default { | 17 | export default { |
| 18 | mixins: [mixin.init], | 18 | mixins: [mixin.init], |
| 19 | + props: { | ||
| 20 | + content: { | ||
| 21 | + type: String, | ||
| 22 | + default: '' | ||
| 23 | + } | ||
| 24 | + }, | ||
| 19 | data () { | 25 | data () { |
| 20 | return { | 26 | return { |
| 21 | 27 | ||
| ... | @@ -31,5 +37,7 @@ export default { | ... | @@ -31,5 +37,7 @@ export default { |
| 31 | </script> | 37 | </script> |
| 32 | 38 | ||
| 33 | <style lang="less" scoped> | 39 | <style lang="less" scoped> |
| 40 | + .privacy-page { | ||
| 34 | 41 | ||
| 42 | + } | ||
| 35 | </style> | 43 | </style> | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2024-10-18 18:00:47 | 2 | * @Date: 2024-10-18 18:00:47 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-10-25 13:52:46 | 4 | + * @LastEditTime: 2024-12-11 14:16:50 |
| 5 | * @FilePath: /hager/src/views/user/info.vue | 5 | * @FilePath: /hager/src/views/user/info.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -26,16 +26,16 @@ | ... | @@ -26,16 +26,16 @@ |
| 26 | <div class="privacy" @click="openPrivacy"><span>隐私政策</span></div> | 26 | <div class="privacy" @click="openPrivacy"><span>隐私政策</span></div> |
| 27 | </div> | 27 | </div> |
| 28 | </div> | 28 | </div> |
| 29 | - <el-dialog title="隐私政策" :visible.sync="dialogVisible"> | 29 | + <el-dialog :title="privacyInfo.post_title" :visible.sync="dialogVisible" top="10vh" width="60%"> |
| 30 | - <privacy></privacy> | 30 | + <privacy :content="privacyInfo.post_content" style="overflow: overlay; max-height: 70vh;"></privacy> |
| 31 | </el-dialog> | 31 | </el-dialog> |
| 32 | 32 | ||
| 33 | <el-drawer | 33 | <el-drawer |
| 34 | - title="隐私政策" | 34 | + :title="privacyInfo.post_title" |
| 35 | size="100%" | 35 | size="100%" |
| 36 | :visible.sync="drawer" | 36 | :visible.sync="drawer" |
| 37 | :direction="direction"> | 37 | :direction="direction"> |
| 38 | - <privacy></privacy> | 38 | + <privacy :content="privacyInfo.post_content" style="padding: 1rem;"></privacy> |
| 39 | </el-drawer> | 39 | </el-drawer> |
| 40 | </div> | 40 | </div> |
| 41 | </template> | 41 | </template> |
| ... | @@ -45,7 +45,7 @@ import mixin from 'common/mixin'; | ... | @@ -45,7 +45,7 @@ import mixin from 'common/mixin'; |
| 45 | import hagerInput from '@/components/common/hagerInput.vue'; | 45 | import hagerInput from '@/components/common/hagerInput.vue'; |
| 46 | import $ from 'jquery'; | 46 | import $ from 'jquery'; |
| 47 | import privacy from '@/components/privacy.vue'; | 47 | import privacy from '@/components/privacy.vue'; |
| 48 | -import { getUserInfoAPI, editUserInfoAPI } from "@/api/hager.js"; | 48 | +import { getUserInfoAPI, editUserInfoAPI, getArticleAPI } from "@/api/hager.js"; |
| 49 | import { MessageBox, Message } from 'element-ui'; | 49 | import { MessageBox, Message } from 'element-ui'; |
| 50 | 50 | ||
| 51 | export default { | 51 | export default { |
| ... | @@ -62,6 +62,10 @@ export default { | ... | @@ -62,6 +62,10 @@ export default { |
| 62 | dialogVisible: false, | 62 | dialogVisible: false, |
| 63 | drawer: false, | 63 | drawer: false, |
| 64 | direction: 'rtl', | 64 | direction: 'rtl', |
| 65 | + privacyInfo: { | ||
| 66 | + post_title: '', | ||
| 67 | + content: '', | ||
| 68 | + } | ||
| 65 | } | 69 | } |
| 66 | }, | 70 | }, |
| 67 | async mounted () { | 71 | async mounted () { |
| ... | @@ -70,8 +74,16 @@ export default { | ... | @@ -70,8 +74,16 @@ export default { |
| 70 | } | 74 | } |
| 71 | // 获取用户信息 | 75 | // 获取用户信息 |
| 72 | this.getUserInfo(); | 76 | this.getUserInfo(); |
| 77 | + // 获取隐私信息 | ||
| 78 | + this.getPrivacyInfo(); | ||
| 73 | }, | 79 | }, |
| 74 | methods: { | 80 | methods: { |
| 81 | + async getPrivacyInfo () { | ||
| 82 | + const { code, data } = await getArticleAPI({ id: '84775' }); | ||
| 83 | + if (code === 1) { | ||
| 84 | + this.privacyInfo = data; | ||
| 85 | + } | ||
| 86 | + }, | ||
| 75 | async getUserInfo () { | 87 | async getUserInfo () { |
| 76 | const { code, data } = await getUserInfoAPI(); | 88 | const { code, data } = await getUserInfoAPI(); |
| 77 | if (code === 1) { // 已登录 | 89 | if (code === 1) { // 已登录 | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2024-10-18 18:00:47 | 2 | * @Date: 2024-10-18 18:00:47 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-10-25 13:37:44 | 4 | + * @LastEditTime: 2024-12-11 14:15:20 |
| 5 | * @FilePath: /hager/src/views/user/register.vue | 5 | * @FilePath: /hager/src/views/user/register.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -19,20 +19,20 @@ | ... | @@ -19,20 +19,20 @@ |
| 19 | <div class="register-footer"> | 19 | <div class="register-footer"> |
| 20 | <div class="submit-btn" @click="onSubmit">提交</div> | 20 | <div class="submit-btn" @click="onSubmit">提交</div> |
| 21 | <div class="register-subsidiary"> | 21 | <div class="register-subsidiary"> |
| 22 | - <div class="privacy" @click="openPrivacy"><span>隐私政策</span></div> | 22 | + <div class="privacy"><span @click="checkPrivacy" :class="[is_check ? 'is-check' : '']"><i class="el-icon-circle-check" style="font-size: 1rem;"></i> 我已同意</span> <span class="text" @click="openPrivacy">隐私政策</span></div> |
| 23 | - <div class="login">已有账号,<span @click="goToLogin">立即登录</span></div> | 23 | + <div class="login">已有账号,<span class="text" @click="goToLogin">立即登录</span></div> |
| 24 | </div> | 24 | </div> |
| 25 | </div> | 25 | </div> |
| 26 | - <el-dialog title="隐私政策" :visible.sync="dialogVisible"> | 26 | + <el-dialog :title="privacyInfo.post_title" :visible.sync="dialogVisible" top="10vh" width="60%"> |
| 27 | - <privacy></privacy> | 27 | + <privacy :content="privacyInfo.post_content" style="overflow: overlay; max-height: 70vh;"></privacy> |
| 28 | </el-dialog> | 28 | </el-dialog> |
| 29 | 29 | ||
| 30 | <el-drawer | 30 | <el-drawer |
| 31 | - title="隐私政策" | 31 | + :title="privacyInfo.post_title" |
| 32 | size="100%" | 32 | size="100%" |
| 33 | :visible.sync="drawer" | 33 | :visible.sync="drawer" |
| 34 | :direction="direction"> | 34 | :direction="direction"> |
| 35 | - <privacy></privacy> | 35 | + <privacy :content="privacyInfo.post_content" style="padding: 1rem;"></privacy> |
| 36 | </el-drawer> | 36 | </el-drawer> |
| 37 | </div> | 37 | </div> |
| 38 | </template> | 38 | </template> |
| ... | @@ -41,7 +41,7 @@ | ... | @@ -41,7 +41,7 @@ |
| 41 | import mixin from 'common/mixin'; | 41 | import mixin from 'common/mixin'; |
| 42 | import hagerInput from '@/components/common/hagerInput.vue'; | 42 | import hagerInput from '@/components/common/hagerInput.vue'; |
| 43 | import $ from 'jquery'; | 43 | import $ from 'jquery'; |
| 44 | -import { registerAPI } from '@/api/hager'; | 44 | +import { registerAPI, getArticleAPI } from '@/api/hager'; |
| 45 | import { MessageBox, Message } from 'element-ui'; | 45 | import { MessageBox, Message } from 'element-ui'; |
| 46 | import privacy from '@/components/privacy.vue'; | 46 | import privacy from '@/components/privacy.vue'; |
| 47 | 47 | ||
| ... | @@ -58,15 +58,35 @@ export default { | ... | @@ -58,15 +58,35 @@ export default { |
| 58 | dialogVisible: false, | 58 | dialogVisible: false, |
| 59 | drawer: false, | 59 | drawer: false, |
| 60 | direction: 'rtl', | 60 | direction: 'rtl', |
| 61 | + is_check: false, | ||
| 62 | + privacyInfo: { | ||
| 63 | + post_title: '', | ||
| 64 | + post_content: '', | ||
| 65 | + } | ||
| 61 | } | 66 | } |
| 62 | }, | 67 | }, |
| 63 | mounted () { | 68 | mounted () { |
| 64 | if ($('#router-view').outerHeight() < $('.user-box').height()) { | 69 | if ($('#router-view').outerHeight() < $('.user-box').height()) { |
| 65 | $('#router-view').height($('.user-box').outerHeight()) | 70 | $('#router-view').height($('.user-box').outerHeight()) |
| 66 | } | 71 | } |
| 72 | + // 获取隐私信息 | ||
| 73 | + this.getPrivacyInfo(); | ||
| 67 | }, | 74 | }, |
| 68 | methods: { | 75 | methods: { |
| 76 | + async getPrivacyInfo () { | ||
| 77 | + const { code, data } = await getArticleAPI({ id: '84775' }); | ||
| 78 | + if (code === 1) { | ||
| 79 | + this.privacyInfo = data; | ||
| 80 | + } | ||
| 81 | + }, | ||
| 69 | async onSubmit () { | 82 | async onSubmit () { |
| 83 | + if (!this.is_check) { | ||
| 84 | + Message({ | ||
| 85 | + type: 'error', | ||
| 86 | + message: '请勾选同意隐私政策' | ||
| 87 | + }); | ||
| 88 | + return; | ||
| 89 | + } | ||
| 70 | if (!this.email) { | 90 | if (!this.email) { |
| 71 | Message({ | 91 | Message({ |
| 72 | type: 'error', | 92 | type: 'error', |
| ... | @@ -107,6 +127,9 @@ export default { | ... | @@ -107,6 +127,9 @@ export default { |
| 107 | } else { | 127 | } else { |
| 108 | this.dialogVisible = true; | 128 | this.dialogVisible = true; |
| 109 | } | 129 | } |
| 130 | + }, | ||
| 131 | + checkPrivacy () { | ||
| 132 | + this.is_check = !this.is_check; | ||
| 110 | } | 133 | } |
| 111 | } | 134 | } |
| 112 | } | 135 | } |
| ... | @@ -148,15 +171,22 @@ export default { | ... | @@ -148,15 +171,22 @@ export default { |
| 148 | font-size: 0.85rem; | 171 | font-size: 0.85rem; |
| 149 | margin-top: 1rem; | 172 | margin-top: 1rem; |
| 150 | span { | 173 | span { |
| 151 | - color: @primary-color; | 174 | + &.text { |
| 152 | - text-decoration: underline; | 175 | + color: @primary-color; |
| 153 | - font-weight: bold; | 176 | + text-decoration: underline; |
| 177 | + font-weight: bold; | ||
| 178 | + } | ||
| 179 | + &.is-check { | ||
| 180 | + color: @primary-color; | ||
| 181 | + font-weight: bold; | ||
| 182 | + } | ||
| 154 | &:hover { | 183 | &:hover { |
| 155 | cursor: pointer; | 184 | cursor: pointer; |
| 156 | } | 185 | } |
| 157 | } | 186 | } |
| 158 | .privacy { | 187 | .privacy { |
| 159 | - | 188 | + display: flex; |
| 189 | + align-items: center; | ||
| 160 | } | 190 | } |
| 161 | .login { | 191 | .login { |
| 162 | 192 | ... | ... |
-
Please register or login to post a comment