|
|
@@ -78,27 +78,20 @@
|
|
|
<text>安全加密 · 保护您的账号信息</text>
|
|
|
</view>
|
|
|
|
|
|
- <!-- 隐私政策/用户服务协议弹窗 -->
|
|
|
- <policy-dialog v-model:visible="dialogVisible" :title="dialogTitle" :content="dialogContent"></policy-dialog>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import { ref } from 'vue'
|
|
|
import navBar from '@/components/nav-bar/index.vue'
|
|
|
-import policyDialog from '@/components/policy-dialog/index.vue'
|
|
|
import { login } from '@/api/auth'
|
|
|
import { getInfo } from '@/api/system/user'
|
|
|
-import { getAgreement } from '@/api/system/agreement'
|
|
|
import { AgreementType } from '@/enums/agreementType'
|
|
|
import { DEFAULT_HEADERS } from '@/utils/config'
|
|
|
|
|
|
const username = ref('')
|
|
|
const password = ref('')
|
|
|
const checked = ref(false)
|
|
|
-const dialogVisible = ref(false)
|
|
|
-const dialogTitle = ref('')
|
|
|
-const dialogContent = ref('')
|
|
|
|
|
|
const onClickLeft = () => uni.reLaunch({ url: '/pages/index/index' })
|
|
|
|
|
|
@@ -166,33 +159,11 @@ const onSubmit = async () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const showAgreement = async (agreementId) => {
|
|
|
- try {
|
|
|
- uni.showLoading({ title: '加载中...' })
|
|
|
- const res = await getAgreement(agreementId)
|
|
|
-
|
|
|
- if (res && res.title) {
|
|
|
- dialogTitle.value = res.title || '协议详情'
|
|
|
- let decodedContent = res.content || '暂无内容'
|
|
|
- if (res.content) {
|
|
|
- try {
|
|
|
- decodedContent = decodeURIComponent(escape(atob(res.content)))
|
|
|
- } catch (e) {
|
|
|
- decodedContent = res.content
|
|
|
- }
|
|
|
- }
|
|
|
- dialogContent.value = decodedContent
|
|
|
- dialogVisible.value = true
|
|
|
- } else {
|
|
|
- console.warn('接口返回数据格式异常:', res)
|
|
|
- uni.showToast({ title: '数据格式异常', icon: 'none' })
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.error('获取协议失败:', error)
|
|
|
- uni.showToast({ title: typeof error === 'string' ? error : '加载失败,请稍后重试', icon: 'none' })
|
|
|
- } finally {
|
|
|
- uni.hideLoading()
|
|
|
- }
|
|
|
+const showAgreement = (agreementId) => {
|
|
|
+ const title = agreementId === 1 ? '用户服务协议' : '隐私政策'
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/my/agreement/detail/index?id=${agreementId}&title=${encodeURIComponent(title)}`
|
|
|
+ })
|
|
|
}
|
|
|
</script>
|
|
|
|