2024-12-03 09:34:24 +08:00
|
|
|
<!-- 纯富文本展示页 -->
|
|
|
|
<template>
|
|
|
|
<!-- #ifdef APP -->
|
|
|
|
<view class="rich-detail" :style="{ backgroundImage: `url(${myFileUrl+background})`,paddingTop: CustomBar+'rpx' }">
|
|
|
|
<view class="app-top" :style="{ height: CustomBar+'rpx',
|
|
|
|
background: topLevel===0? '#ffffff00' : `rgba(255, 255, 255,${topLevel})` }"></view>
|
|
|
|
<!-- #endif -->
|
|
|
|
<!-- #ifndef APP -->
|
|
|
|
<view class="rich-detail" :style="{ backgroundImage: `url(${myFileUrl+background})` }">
|
|
|
|
<!-- #endif -->
|
|
|
|
<view class="rdt-top">
|
2025-01-22 20:25:38 +08:00
|
|
|
<!-- #ifdef MP -->
|
|
|
|
<view :style="{height: `${StatusBar}px`}"></view>
|
|
|
|
<view class="app-top" :style="{height: `${StatusBar}px`,background: topLevel===0? '#ffffff00' : `rgba(255, 255, 255,${topLevel})`}"></view>
|
|
|
|
<view class="mobile-logo" :style="{height: `${CustomBarHeight}px`,backgroundColor: `rgba(255, 255, 255,${topLevel})`}">
|
|
|
|
<!-- #endif -->
|
|
|
|
<!-- #ifndef MP -->
|
2024-12-03 09:34:24 +08:00
|
|
|
<view class="mobile-logo" :style="{backgroundColor: `rgba(255, 255, 255,${topLevel})`}">
|
2025-01-22 20:25:38 +08:00
|
|
|
<!-- #endif -->
|
2024-12-05 11:46:54 +08:00
|
|
|
<u-icon name="arrow-left" size="40" class="back" @click="back"
|
|
|
|
:color="topLevel===0? '#f9f9f9' : `rgba(194, 234, 4,${topLevel})`"></u-icon>
|
2024-12-03 09:34:24 +08:00
|
|
|
<image :src="myFileUrl+logo"></image>
|
|
|
|
<view style="width: 75rpx;"></view>
|
|
|
|
</view>
|
|
|
|
<view class="detail-content">
|
|
|
|
<u-parse :html="content"></u-parse>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<Loading :show="loading" />
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import configService from '@/common/config.service.js';
|
|
|
|
export default {
|
|
|
|
data(){
|
|
|
|
return{
|
2025-01-22 20:25:38 +08:00
|
|
|
// #ifdef MP
|
|
|
|
// 微信小程序自定义导航栏参数
|
|
|
|
StatusBar: this.StatusBar || 0,
|
|
|
|
CustomBarHeight: this.Custom.height+(this.Custom.top-this.StatusBar)*2 || 0,
|
|
|
|
// #endif
|
2024-12-03 09:34:24 +08:00
|
|
|
content: '',
|
|
|
|
loading: true,// 加载
|
|
|
|
// 基础路径
|
|
|
|
myFileUrl: configService.fileUrl + 'pixel/my/',
|
|
|
|
// 我的页面背景
|
|
|
|
background: 'background.png',
|
|
|
|
// logo图标
|
2025-01-22 20:25:38 +08:00
|
|
|
logo: 'logo-new.png',
|
2024-12-03 09:34:24 +08:00
|
|
|
// 顶部距离等级
|
|
|
|
topLevel: 0,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
// #ifndef H5
|
|
|
|
onPageScroll(e) {
|
|
|
|
const level = e.scrollTop/60;
|
|
|
|
if(level<=1) this.topLevel = level;
|
|
|
|
else this.topLevel = 1;
|
|
|
|
},
|
|
|
|
// #endif
|
|
|
|
|
|
|
|
// #ifdef H5
|
|
|
|
mounted(){
|
|
|
|
let that = this;
|
|
|
|
window.onscroll = function () {
|
|
|
|
//为了保证兼容性,这里取三个值,哪个有值取哪一个
|
|
|
|
//scrollTop就是触发滚轮事件时滚轮的高度
|
|
|
|
var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
|
|
|
|
const level = scrollTop/60;
|
|
|
|
if(level<=1) that.topLevel = level;
|
|
|
|
else that.topLevel = 1;
|
|
|
|
}
|
|
|
|
},
|
2024-12-05 11:46:54 +08:00
|
|
|
|
|
|
|
onHide() {
|
|
|
|
window.onscroll = null;
|
|
|
|
},
|
2024-12-03 09:34:24 +08:00
|
|
|
// #endif
|
|
|
|
methods:{
|
|
|
|
// 返回
|
|
|
|
back(){
|
|
|
|
uni.navigateBack();
|
|
|
|
},
|
2025-01-22 20:25:38 +08:00
|
|
|
// 获取协议内容
|
|
|
|
async getAgreement(name){
|
|
|
|
if(!name) {
|
|
|
|
this.content = '暂无协议内容';
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
try{
|
|
|
|
this.loading = true;
|
|
|
|
let res = await this.$api.getArticles({title: name});
|
|
|
|
if(res.success){
|
|
|
|
this.content = res.data.records[0].text;
|
|
|
|
}else{
|
|
|
|
this.content = name + '\n暂无协议内容';
|
|
|
|
}
|
|
|
|
}catch(e){
|
|
|
|
}finally{
|
|
|
|
this.loading = false;
|
|
|
|
}
|
|
|
|
}
|
2024-12-03 09:34:24 +08:00
|
|
|
},
|
|
|
|
onLoad(options) {
|
|
|
|
uni.setNavigationBarTitle({
|
|
|
|
title: options.name || '协议内容'
|
|
|
|
});
|
2025-01-22 20:25:38 +08:00
|
|
|
this.getAgreement(options.name);
|
2024-12-03 09:34:24 +08:00
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
.rich-detail{
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
min-height: 100vh;
|
|
|
|
background-size: cover;
|
2025-01-22 20:25:38 +08:00
|
|
|
// #ifdef APP || MP
|
2024-12-30 19:01:03 +08:00
|
|
|
.app-top{
|
|
|
|
width: 100%;
|
|
|
|
position: fixed;
|
|
|
|
z-index: 81;
|
|
|
|
top: 0;
|
|
|
|
}
|
|
|
|
// #endif
|
2024-12-03 09:34:24 +08:00
|
|
|
.rdt-top{
|
|
|
|
// #ifdef APP
|
|
|
|
.app-top{
|
|
|
|
width: 100%;
|
|
|
|
position: fixed;
|
|
|
|
z-index: 81;
|
|
|
|
top: 0;
|
|
|
|
}
|
|
|
|
// #endif
|
|
|
|
.mobile-logo{
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
2024-12-05 11:46:54 +08:00
|
|
|
align-items: center;
|
2024-12-03 09:34:24 +08:00
|
|
|
.back{
|
|
|
|
margin-left: 35rpx;
|
2024-12-05 11:46:54 +08:00
|
|
|
margin-top: 5rpx
|
2024-12-03 09:34:24 +08:00
|
|
|
}
|
|
|
|
position: fixed;
|
|
|
|
z-index: 81;
|
|
|
|
padding: 15rpx 0;
|
|
|
|
image{
|
|
|
|
width: 200rpx;
|
|
|
|
height: 45rpx;
|
|
|
|
}
|
|
|
|
// .u-icon{
|
|
|
|
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// padding: 40rpx;
|
|
|
|
.detail-content{
|
|
|
|
margin: 80rpx 40rpx 32rpx;
|
|
|
|
background-color: rgba(160, 160, 160, 0.4);
|
|
|
|
border-radius: 20rpx;
|
|
|
|
padding: 40rpx 25rpx 20rpx;
|
|
|
|
color: #f9f9f9;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|