- 新增商家/信息详情页电话拨打接口,支持每日额度限制与拨打日志记录 - 新增平台免责声明内容及协议接口,完善用户服务协议相关配置 - 新增农产品分类图标与上市角标展示,优化分类管理界面样式 - 新增全国行政区划工具类与城市选择组件,重构地区数据结构 - 新增SSH自检与部署脚本,完善项目部署流程
184 行
3.8 KiB
Vue
184 行
3.8 KiB
Vue
<template>
|
||
<view class="agreement fc-page">
|
||
<!-- 沉浸式导航栏 -->
|
||
<fc-navbar :title="pageTitle" theme="gradient" :show-back="true" />
|
||
|
||
<!-- 内容区域 -->
|
||
<view class="agreement__body">
|
||
<view v-if="loading" class="agreement__loading">
|
||
<text class="agreement__loading-text">正在加载协议内容…</text>
|
||
</view>
|
||
|
||
<view v-else class="fc-card agreement__card">
|
||
<view class="agreement__header">
|
||
<text class="agreement__title">{{ title }}</text>
|
||
<text class="agreement__date">生效与更新日期:{{ updateTime }}</text>
|
||
</view>
|
||
|
||
<!-- 正文分段展示 -->
|
||
<view class="agreement__content">
|
||
<text class="agreement__paragraph" :user-select="true">{{ content }}</text>
|
||
</view>
|
||
|
||
<!-- 底部提示 -->
|
||
<view class="agreement__footer">
|
||
<text class="agreement__footer-text">{{ siteName }}便民平台 版权所有</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
/**
|
||
* 协议与隐私政策独立页面
|
||
* 支持在后台配置内容,根据入参 type 动态渲染「用户协议」或「隐私政策」
|
||
*/
|
||
import settingApi from '@/common/api/setting.js'
|
||
import { loadUiConfig, uiState } from '@/common/store/ui.js'
|
||
import FcNavbar from '@/components/fc-navbar/fc-navbar.vue'
|
||
|
||
export default {
|
||
components: { FcNavbar },
|
||
data() {
|
||
return {
|
||
type: 'service', // service | privacy | disclaimer
|
||
title: '用户服务协议',
|
||
content: '',
|
||
updateTime: '2026-10-20',
|
||
loading: true,
|
||
}
|
||
},
|
||
computed: {
|
||
/**
|
||
* 页面顶部标题
|
||
* @returns {string}
|
||
*/
|
||
pageTitle() {
|
||
if (this.type === 'privacy') return '隐私政策'
|
||
if (this.type === 'disclaimer') return '平台免责声明'
|
||
return '用户协议'
|
||
},
|
||
/** 站点名称(后台「小程序配置」下发) */
|
||
siteName() {
|
||
return uiState.siteName || uiState.appName || '同城分类信息'
|
||
},
|
||
},
|
||
/**
|
||
* 页面加载生命周期
|
||
* @param {Object} query 路由入参
|
||
*/
|
||
onLoad(query) {
|
||
if (query && query.type) {
|
||
this.type = query.type
|
||
}
|
||
loadUiConfig()
|
||
this.fetchAgreement()
|
||
},
|
||
/**
|
||
* 下拉刷新
|
||
*/
|
||
async onPullDownRefresh() {
|
||
try {
|
||
await this.fetchAgreement()
|
||
} finally {
|
||
uni.stopPullDownRefresh()
|
||
}
|
||
},
|
||
methods: {
|
||
/**
|
||
* 获取协议详情
|
||
*/
|
||
async fetchAgreement() {
|
||
this.loading = true
|
||
try {
|
||
const res = await settingApi.agreement({ type: this.type })
|
||
if (res) {
|
||
this.title = res.title || (this.type === 'privacy' ? '隐私政策' : '用户服务协议')
|
||
this.content = res.content || ''
|
||
this.updateTime = res.updateTime || '2026-10-20'
|
||
}
|
||
} catch (err) {
|
||
uni.showToast({ title: '加载协议失败', icon: 'none' })
|
||
} finally {
|
||
this.loading = false
|
||
}
|
||
},
|
||
},
|
||
}
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
.agreement {
|
||
min-height: 100vh;
|
||
background-color: $fc-bg;
|
||
}
|
||
|
||
.agreement__body {
|
||
padding: 24rpx 28rpx 60rpx;
|
||
}
|
||
|
||
.agreement__loading {
|
||
padding: 120rpx 0;
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
}
|
||
|
||
.agreement__loading-text {
|
||
font-size: 26rpx;
|
||
color: $fc-text-placeholder;
|
||
}
|
||
|
||
.agreement__card {
|
||
padding: 40rpx 32rpx;
|
||
border-radius: 28rpx;
|
||
background: #ffffff;
|
||
box-shadow: $fc-shadow-sm;
|
||
}
|
||
|
||
.agreement__header {
|
||
padding-bottom: 24rpx;
|
||
margin-bottom: 30rpx;
|
||
border-bottom: 1rpx solid #eef5f1;
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
|
||
.agreement__title {
|
||
font-size: 36rpx;
|
||
font-weight: 700;
|
||
color: $fc-text;
|
||
margin-bottom: 12rpx;
|
||
}
|
||
|
||
.agreement__date {
|
||
font-size: 22rpx;
|
||
color: $fc-text-placeholder;
|
||
}
|
||
|
||
.agreement__content {
|
||
line-height: 1.8;
|
||
}
|
||
|
||
.agreement__paragraph {
|
||
font-size: 28rpx;
|
||
color: $fc-text-secondary;
|
||
white-space: pre-wrap;
|
||
word-break: break-all;
|
||
display: block;
|
||
}
|
||
|
||
.agreement__footer {
|
||
margin-top: 60rpx;
|
||
padding-top: 24rpx;
|
||
border-top: 1rpx dashed #eef5f1;
|
||
text-align: center;
|
||
}
|
||
|
||
.agreement__footer-text {
|
||
font-size: 22rpx;
|
||
color: $fc-text-placeholder;
|
||
}
|
||
</style>
|