Files
xdd-uniapp-new/pkg-video/views/county-lottery-rules.vue
T

172 lines
3.1 KiB
Vue

<template>
<view class="county-lottery-rules-page">
<!-- <view class="custom-header" :style="{ paddingTop: `${statusBarHeight}px` }">
<view class="header-inner">
<view class="header-back" @click="goBack">
<u-icon name="arrow-left" size="24" color="#333" class="header-back-icon"></u-icon>
</view>
<view class="header-title">活动规则</view>
<view class="header-right">
</view>
</view>
</view> -->
<view class="page-body" >
<view class="rule-card">
<view class="rule-content">
<rich-text v-if="ruleContent" :nodes="ruleContent" />
<view class="state-text" v-else>{{ loading ? '规则加载中...' : '暂无活动规则' }}</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { getDrawRuleConfig } from '@/api/lottery'
export default {
name: 'CountyLotteryRulesPage',
data() {
return {
statusBarHeight: 20,
loading: true,
ruleContent: ''
}
},
onLoad() {
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight || 20
this.fetchRuleConfig()
},
methods: {
fetchRuleConfig() {
this.loading = true
getDrawRuleConfig().then(res => {
const data = res.data || {}
this.ruleContent = data.ruleContent || ''
}).finally(() => {
this.loading = false
})
},
goBack() {
if (getCurrentPages().length > 1) {
uni.navigateBack()
return
}
uni.switchTab({
url: '/pages/home/index'
})
}
}
}
</script>
<style scoped lang="less">
.county-lottery-rules-page {
min-height: 100vh;
background: #f5f5f5;
}
.custom-header {
position: fixed;
left: 0;
top: 0;
width: 100%;
background: #f5f5f5;
z-index: 20;
}
.header-inner {
height: 88rpx;
padding: 0 24rpx;
display: flex;
align-items: center;
}
.header-back {
width: 56rpx;
height: 56rpx;
border-radius: 8rpx;
display: flex;
align-items: center;
justify-content: center;
background: #fff;
}
.header-back-icon {
font-size: 44rpx;
color: #111;
line-height: 1;
margin-top: -4rpx;
}
.header-title {
flex: 1;
text-align: center;
margin-left: 56rpx;
font-size: 34rpx;
color: #333;
font-weight: 700;
}
.header-right {
width: 88rpx;
height: 44rpx;
border-radius: 24rpx;
border: 2rpx solid #d8d8d8;
background: #fff;
display: flex;
align-items: center;
justify-content: center;
}
.right-dot {
width: 8rpx;
height: 8rpx;
border-radius: 50%;
background: #111;
margin-right: 14rpx;
}
.right-ring {
width: 18rpx;
height: 18rpx;
border-radius: 50%;
border: 2rpx solid #111;
}
.page-body {
padding: 24rpx;
box-sizing: border-box;
}
.rule-card {
background: #fff;
border-radius: 24rpx;
padding: 24rpx;
}
.rule-title {
font-size: 34rpx;
font-weight: 700;
color: #333;
line-height: 1.4;
}
.rule-content {
margin-top: 20rpx;
font-size: 32rpx;
color: #444;
line-height: 1.8;
}
.state-text {
color: #999;
font-size: 28rpx;
}
/deep/ .rule-content p {
margin-bottom: 10rpx;
}
</style>