feat: 新增sw(税务)与hj(生态环境)专区模块;自制hj/sw-tabbar底栏;hj-web内嵌阅读(双指缩放);hnlylaw三活动authorization隔离(Sft/Sw/Hj);缓存键Hj后缀;问卷1006/1007;home专区入口接线;sw/hj规则与隐私文案、学习清单及链接校修复

This commit is contained in:
lcj
2026-11-11 15:20:20 +08:00
parent ead48745c2
commit 8a1ff90d6b
30 changed files with 6365 additions and 40 deletions
+19 -6
View File
@@ -3,8 +3,21 @@ import { Encrypt, Decrypt } from '@/js_sdk/cainiao-crypto/cainiao-crypto.js'
const install = (Vue, vm) => {
const LYLAW_BASE = '/lylaw/api/hnlylaw'
const lylawPost = (url, params = {}) => {
console.log('[原始参数]', url, JSON.stringify(params));
return Vue.prototype.$u.post(url, { request: Encrypt(JSON.stringify(params)) }).then(res => {
const payload = Object.assign({}, params)
const forceSw = payload.__sw === true
const forceHj = payload.__hj === true
delete payload.__sw
delete payload.__hj
let authKey = 'authorizationSft'
if (forceSw || payload.wenjuan_id == 1006 || payload.wenjuanId == 1006) {
authKey = 'authorizationSw'
} else if (forceHj || payload.wenjuan_id == 1007 || payload.wenjuanId == 1007) {
authKey = 'authorizationHj'
}
const auth = uni.getStorageSync(authKey)
const header = auth ? { authorization: auth } : {}
console.log('[原始参数]', url, JSON.stringify(payload));
return Vue.prototype.$u.post(url, { request: Encrypt(JSON.stringify(payload)) }, header).then(res => {
if (res && res.Data) {
if (res.Data === 'VFXeGhPbmE9mfQeg2iiwdA==') {
res.Data = null
@@ -18,10 +31,10 @@ const install = (Vue, vm) => {
const k = Object.keys(obj).find(x => x.toLowerCase() === 'authorization')
return k ? obj[k] : ''
}
const auth = pickAuth(res.Data) || pickAuth(res)
if (auth) {
uni.setStorageSync('authorizationSft', auth)
console.log('[authorization已缓存]', auth)
const a = pickAuth(res.Data) || pickAuth(res)
if (a) {
uni.setStorageSync(authKey, a)
console.log('[authorization已缓存]', authKey, a)
}
}
console.log('[解密返回]', url, JSON.stringify(res));
+2 -18
View File
@@ -15,24 +15,8 @@ const install = (Vue, vm) => {
});
// 请求拦截,配置Token等参数
Vue.prototype.$u.http.interceptor.request = (config) => {
// config.header.Token = 'xxxxxx';
// 方式一,存放在vuex的token,假设使用了uView封装的vuex方式,见:https://uviewui.com/components/globalVariable.html
// config.header.token = vm.token;
// 方式二,如果没有使用uView封装的vuex方法,那么需要使用$store.state获取
// config.header.token = vm.$store.state.token;
// 方式三,如果token放在了globalData,通过getApp().globalData获取
// config.header.token = getApp().globalData.username;
// 方式四,如果token放在了Storage本地存储中,拦截是每次请求都执行的,所以哪怕您重新登录修改了Storage,下一次的请求将会是最新值
const authorization = uni.getStorageSync('authorizationSft');
if (authorization) {
config.header.authorization = authorization;
}
return config;
// authorization 由 http.api.js 中 lylawPost 按活动(wenjuan_id)逐请求注入,此处不再全局设置
return config;
}
// 响应拦截,判断状态码是否通过
Vue.prototype.$u.http.interceptor.response = (res) => {
+75
View File
@@ -0,0 +1,75 @@
<template>
<view class="hj-tabbar">
<view class="hj-tabbar-item" v-for="item in list" :key="item.key" @click="go(item)">
<image class="hj-tabbar-icon" :src="current === item.key ? item.activeIcon : item.icon" mode="aspectFit"></image>
<text class="hj-tabbar-text" :class="{ active: current === item.key }">{{ item.text }}</text>
</view>
</view>
</template>
<script>
export default {
name: 'hj-tabbar',
props: {
current: {
type: String,
default: 'index'
}
},
data() {
return {
list: [
{ key: 'index', text: '首页', path: '/pages/hj-index/hj-index', icon: '/static/shouye.png', activeIcon: '/static/shouye_select.png' },
{ key: 'winRecords', text: '中奖记录', path: '/pages/hj-win-records/hj-win-records', icon: '/static/zhongjiangjilu.png', activeIcon: '/static/zhongjiangjilu_select.png' },
{ key: 'profile', text: '我的', path: '/pages/hj-profile/hj-profile', icon: '/static/wode.png', activeIcon: '/static/wode_select.png' }
]
}
},
methods: {
go(item) {
if (item.key === this.current) return
uni.reLaunch({ url: item.path })
}
}
}
</script>
<style lang="scss" scoped>
.hj-tabbar {
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 998;
height: 120rpx;
display: flex;
background: linear-gradient(to bottom, #FFEBBC, #FFD67E);
box-shadow: 0 -2rpx 12rpx rgba(0, 0, 0, 0.05);
}
.hj-tabbar-item {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 16rpx 0;
box-sizing: border-box;
}
.hj-tabbar-icon {
width: 48rpx;
height: 48rpx;
}
.hj-tabbar-text {
font-size: 22rpx;
color: #5D533D;
margin-top: 4rpx;
line-height: 1.2;
}
.hj-tabbar-text.active {
color: #FD5401;
}
</style>
+75
View File
@@ -0,0 +1,75 @@
<template>
<view class="sw-tabbar">
<view class="sw-tabbar-item" v-for="item in list" :key="item.key" @click="go(item)">
<image class="sw-tabbar-icon" :src="current === item.key ? item.activeIcon : item.icon" mode="aspectFit"></image>
<text class="sw-tabbar-text" :class="{ active: current === item.key }">{{ item.text }}</text>
</view>
</view>
</template>
<script>
export default {
name: 'sw-tabbar',
props: {
current: {
type: String,
default: 'index'
}
},
data() {
return {
list: [
{ key: 'index', text: '首页', path: '/pages/sw-index/sw-index', icon: '/static/shouye.png', activeIcon: '/static/shouye_select.png' },
{ key: 'winRecords', text: '中奖记录', path: '/pages/sw-win-records/sw-win-records', icon: '/static/zhongjiangjilu.png', activeIcon: '/static/zhongjiangjilu_select.png' },
{ key: 'profile', text: '我的', path: '/pages/sw-profile/sw-profile', icon: '/static/wode.png', activeIcon: '/static/wode_select.png' }
]
}
},
methods: {
go(item) {
if (item.key === this.current) return
uni.reLaunch({ url: item.path })
}
}
}
</script>
<style lang="scss" scoped>
.sw-tabbar {
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 998;
height: 120rpx;
display: flex;
background: linear-gradient(to bottom, #FFEBBC, #FFD67E);
box-shadow: 0 -2rpx 12rpx rgba(0, 0, 0, 0.05);
}
.sw-tabbar-item {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 16rpx 0;
box-sizing: border-box;
}
.sw-tabbar-icon {
width: 48rpx;
height: 48rpx;
}
.sw-tabbar-text {
font-size: 22rpx;
color: #5D533D;
margin-top: 4rpx;
line-height: 1.2;
}
.sw-tabbar-text.active {
color: #FD5401;
}
</style>
+138
View File
@@ -74,6 +74,144 @@
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/sw-index/sw-index",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/sw-register/sw-register",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/sw-answer/sw-answer",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/sw-result/sw-result",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/sw-records/sw-records",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/sw-record-detail/sw-record-detail",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/sw-rules/sw-rules",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/sw-privacy/sw-privacy",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/sw-win-records/sw-win-records",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/sw-profile/sw-profile",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/sw-study/sw-study",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/hj-index/hj-index",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/hj-register/hj-register",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/hj-answer/hj-answer",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/hj-result/hj-result",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/hj-records/hj-records",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/hj-record-detail/hj-record-detail",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/hj-rules/hj-rules",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/hj-privacy/hj-privacy",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/hj-study/hj-study",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/hj-win-records/hj-win-records",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/hj-profile/hj-profile",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/hj-web/hj-web",
"style": {
"navigationStyle": "custom"
}
}
],
"tabBar": {
+378
View File
@@ -0,0 +1,378 @@
<template>
<view class="content">
<view class="page-body">
<view class="loading-box" v-if="questions.length === 0 && !loadError">
<u-loading mode="circle" size="40"></u-loading>
<text class="loading-text">加载题目中...</text>
</view>
<view class="loading-box" v-if="loadError">
<text class="error-text">{{ loadError }}</text>
<button class="retry-btn" @tap="fetchQuestions">重新加载</button>
</view>
<template v-if="questions.length > 0">
<image src="https://aliyunoss.hn12301.net/learnlaw/xfhj_dtbj.jpg" mode="scaleToFill" style="width:750rpx;height:1820rpx;"></image>
<view style="position:absolute;top:300rpx;left:0;z-index:0;padding: 30rpx;" >
<view class="quiz-header">
<view class="timer-wrap">
<text class="timer-label">答题时间</text>
<text class="timer">{{ formatTime(usedSeconds) }}</text>
</view>
<text class="answered-count">已答 {{ answeredCount }} / {{ questions.length }}</text>
</view>
<view class="question-item" v-for="(q, qi) in questions" :key="q.question_id">
<view class="q-header">
<text class="q-index">{{ qi + 1 }}</text>
<text class="q-content">{{ formatContent(q.question_content) }}</text>
</view>
<view class="options">
<view
class="option"
v-for="(opt, oi) in q.answerList"
:key="opt.id"
:class="{ selected: answers[q.question_id] === oi }"
@tap="select(q.question_id, oi)"
>
<view class="option-radio" :class="{ checked: answers[q.question_id] === oi }">
<view v-if="answers[q.question_id] === oi" class="radio-dot"></view>
</view>
<text class="option-text">{{ opt.answer_content }}</text>
</view>
</view>
<view class="tips" v-if="answers[q.question_id] !== undefined">
<text class="tips-label">解析</text>
<text class="tips-text">{{ q.tips }}</text>
</view>
</view>
<button class="submit-btn" @tap="submit">提交</button>
</view>
</template>
</view>
</view>
</template>
<script>
export default {
data() {
return {
questions: [],
answers: {},
loadError: '',
startTime: 0,
usedSeconds: 0,
timer: null
}
},
computed: {
answeredCount() {
return Object.keys(this.answers).length
}
},
onLoad() {
this.fetchQuestions()
},
onUnload() {
this.stopTimer()
},
methods: {
fetchQuestions() {
this.loadError = ''
const userId = uni.getStorageSync('userIdHj')
const userPhone = uni.getStorageSync('userPhoneHj')
this.$u.api.queryWenjuanQA({
wenjuan_id: 1007,
user_id: userId,
user_phone: userPhone
}).then(res => {
if (res.code === 0 && res.Data?.wenjuanTmList) {
this.questions = res.Data.wenjuanTmList
this.startTimer()
} else {
this.loadError = res.msg || '数据异常'
}
}).catch(err => {
console.error('获取题目失败', err)
this.loadError = '网络请求失败'
})
},
startTimer() {
this.startTime = Date.now()
this.timer = setInterval(() => {
this.usedSeconds = Math.round((Date.now() - this.startTime) / 10) / 100
}, 50)
},
stopTimer() {
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
},
formatTime(sec) {
const total = Number(sec) || 0
const m = Math.floor(total / 60)
const s = total % 60
return (m < 10 ? '0' : '') + m + ':' + (s < 10 ? '0' : '') + s.toFixed(2)
},
formatContent(content) {
return (content || '').replace(/()/g, '(  )').replace(/\(\)/g, '(  )')
},
select(qId, oi) {
this.$set(this.answers, qId, oi)
},
submit() {
if (Date.now() - this.startTime < 9000) {
uni.showToast({ title: '操作繁忙,请重试', icon: 'none' })
return
}
if (this.answeredCount < this.questions.length) {
uni.showToast({ title: '还有题目未作答', icon: 'none' })
return
}
this.usedSeconds = Math.round((Date.now() - this.startTime) / 10) / 100
const userId = uni.getStorageSync('userIdHj')
const userPhone = uni.getStorageSync('userPhoneHj')
const details = this.questions.map(q => ({
question_id: q.question_id,
user_answer: q.answerList[this.answers[q.question_id]]?.answer_content || ''
}))
this.$u.api.submitQA({
user_id: userId,
user_phone: userPhone,
wenjuan_id: 1007,
use_time: this.usedSeconds,
total_question_num: this.questions.length,
channel: 1,
user_answer_details: details
}).then(res => {
if (res.code === 0) {
this.stopTimer()
uni.setStorageSync('resultDataHj', {
...res.Data,
use_time: this.usedSeconds,
total_question_num: this.questions.length
})
uni.redirectTo({ url: '/pages/hj-result/hj-result' })
} else {
uni.showToast({ title: res.msg || '提交失败', icon: 'none' })
}
}).catch(() => {
uni.showToast({ title: '网络异常', icon: 'none' })
})
}
}
}
</script>
<style lang="scss">
page {
background-color: #65D7F2;
}
.content {
position: relative;
display: flex;
flex-direction: column;
}
.page-body {
flex: 1;
box-sizing: border-box;
display: flex;
flex-direction: column;
overflow: hidden;
}
.quiz-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
padding: 16rpx 24rpx;
background: #71BCFB66;
border-radius: 12rpx;
flex-shrink: 0;
}
.quiz-scroll {
flex: 1;
overflow: hidden;
position: relative;
}
.timer-wrap {
display: flex;
align-items: center;
gap: 10rpx;
}
.timer-label {
font-size: 24rpx;
color: rgba(255, 255, 255, 0.8);
}
.timer {
font-size: 28rpx;
color: #fff;
font-weight: 600;
}
.answered-count {
font-size: 24rpx;
color: rgba(255, 255, 255, 0.85);
}
.question-item {
background: rgba(255, 255, 255, 0.95);
border-radius: 20rpx;
padding: 32rpx 28rpx;
margin-bottom: 24rpx;
}
.q-header {
display: flex;
margin-bottom: 20rpx;
}
.q-index {
width: 44rpx;
height: 44rpx;
line-height: 44rpx;
text-align: center;
background: #FD5401;
color: #fff;
border-radius: 50%;
font-size: 24rpx;
font-weight: 600;
flex-shrink: 0;
margin-right: 16rpx;
margin-top: 4rpx;
}
.q-content {
font-size: 28rpx;
color: #333;
line-height: 1.6;
flex: 1;
}
.options {
display: flex;
flex-direction: column;
gap: 14rpx;
}
.option {
padding: 22rpx 20rpx;
display: flex;
align-items: center;
border: 2rpx solid #eee;
border-radius: 12rpx;
}
.option.selected {
border-color: #FD5401;
background: rgba(253, 84, 1, 0.05);
}
.option-radio {
width: 36rpx;
height: 36rpx;
border-radius: 50%;
border: 3rpx solid #CCC;
display: flex;
align-items: center;
justify-content: center;
margin-right: 16rpx;
flex-shrink: 0;
}
.option-radio.checked {
border-color: #FD5401;
}
.radio-dot {
width: 20rpx;
height: 20rpx;
border-radius: 50%;
background: #FD5401;
}
.option-text {
font-size: 27rpx;
color: #333;
line-height: 1.4;
}
.tips {
background: rgba(255, 247, 237, 0.95);
border-radius: 12rpx;
padding: 20rpx;
margin-top: 16rpx;
border-left: 6rpx solid #FD5401;
}
.tips-label {
font-size: 24rpx;
font-weight: 600;
color: #FD5401;
display: block;
margin-bottom: 6rpx;
}
.tips-text {
font-size: 24rpx;
color: #666;
line-height: 1.5;
}
.submit-btn {
width: 100%;
height: 88rpx;
line-height: 88rpx;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
color: #fff;
font-size: 32rpx;
font-weight: 600;
border: none;
border-radius: 44rpx;
margin: 10rpx 0 40rpx;
box-shadow: 0 4rpx 16rpx rgba(253, 84, 1, 0.3);
}
.loading-box {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.loading-text {
font-size: 28rpx;
color: #fff;
margin-top: 20rpx;
}
.error-text {
font-size: 28rpx;
color: #fff;
text-align: center;
display: block;
}
.retry-btn {
margin-top: 30rpx;
width: 240rpx;
height: 72rpx;
line-height: 72rpx;
background: rgba(255, 255, 255, 0.9);
color: #FD5401;
border: none;
border-radius: 36rpx;
font-size: 28rpx;
}
</style>
+305
View File
@@ -0,0 +1,305 @@
<template>
<view>
<image src="https://aliyunoss.hn12301.net/learnlaw/xfhh_bj.jpg" style="width: 750rpx;" mode="widthFix"></image>
<!-- <image src="https://aliyunoss.hn12301.net/learnlaw/xfhm_ckjpxq.png"
style="width: 250rpx;position: absolute;top: 1210rpx;left: 250rpx;" mode="widthFix"
@click="showPrize = true"></image> -->
<image src="https://aliyunoss.hn12301.net/learnlaw/xfhh_dtcj.png"
style="width: 340rpx;position: absolute;top: 1250rpx;left: 25rpx;" mode="widthFix" @click="goRegister">
</image>
<image src="https://aliyunoss.hn12301.net/learnlaw/xfhh_fzxx.png"
style="width: 340rpx;position: absolute;top: 1250rpx;right: 25rpx;" mode="widthFix" @click="goStudy">
</image>
<view class="side-tab" style="top: 480rpx;" hover-class="side-tab-hover" @click="goRules">活动规则</view>
<view class="back-home" @click="goHome">
<text class="back-home-icon">‹</text>
</view>
<view class="blocked-mask" v-if="blocked">
<text class="blocked-tip">{{ blockTip }}</text>
<text class="blocked-sub">本活动仅支持手机微信访问</text>
</view>
<hj-tabbar current="index"></hj-tabbar>
<view class="prize-mask" v-if="showPrize" @click="showPrize = false"></view>
<view class="prize-popup" v-if="showPrize">
<scroll-view scroll-y class="prize-scroll">
<image src="https://aliyunoss.hn12301.net/learnlaw/xfhm_main_jp.jpg" mode="widthFix" style="width: 100%;"></image>
</scroll-view>
<view class="prize-close" @click="showPrize = false">
<text class="prize-close-text">✕</text>
</view>
</view>
</view>
</template>
<script>
import hjTabbar from '@/components/hj-tabbar/hj-tabbar.vue'
const APP_ID = 'wx71c218bd9ff0e2da'
const SCOPE = 'snsapi_base'
export default {
components: {
hjTabbar
},
data() {
return {
blocked: false,
blockTip: '',
showPrize: false
}
},
onLoad() {
this.initLogin()
},
onShow() {
if (this.blocked) return
const openId = uni.getStorageSync('openIdHj')
const isRegistered = uni.getStorageSync('isRegisteredHj')
const userId = uni.getStorageSync('userIdHj')
if (openId && (!isRegistered || !userId)) {
this.loginWithOpenId(openId)
}
},
methods: {
goHome() {
uni.reLaunch({
url: '/pages/home/home'
})
},
goStudy() {
uni.navigateTo({
url: '/pages/hj-study/hj-study'
})
},
initLogin() {
if (!this.isWechatBrowser()) {
this.block('请在微信中打开')
return
}
if (this.isPcWechat()) {
this.block('请使用手机微信打开')
return
}
let openId = uni.getStorageSync('openIdHj')
if (openId) {
this.loginWithOpenId(openId)
return
}
const code = this.getCodeFromUrl()
if (code) {
this.exchangeOpenId(code)
} else {
this.wechatAuth()
}
},
block(tip) {
this.blocked = true
this.blockTip = tip
},
isWechatBrowser() {
return /MicroMessenger/i.test(navigator.userAgent)
},
isPcWechat() {
return /MicroMessenger/i.test(navigator.userAgent) && /WindowsWechat|MacWechat/i.test(navigator.userAgent)
},
getCodeFromUrl() {
const match = window.location.href.match(/[?&]code=([^&#]+)/)
return match ? match[1] : null
},
cleanUrlCode() {
const cleanUrl = window.location.href.replace(/[?&]code=[^&#]*(&|#|$)/, (m, p1) => p1 === '&' ? '?' : (
p1 === '#' ? '#' : ''))
window.history.replaceState({}, '', cleanUrl)
},
wechatAuth() {
const base = window.location.href.split('#')[0].split('?')[0]
const redirectUri = encodeURIComponent(base + '#/pages/hj-index/hj-index')
const url =
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${APP_ID}&redirect_uri=${redirectUri}&response_type=code&scope=${SCOPE}&state=STATE#wechat_redirect`
window.location.href = url
},
loginWithOpenId(openId) {
this.$u.api.wxOpenidLogin({
wenjuan_id: 1007,
open_id: openId
}).then(loginRes => {
if (!loginRes.Data) {
uni.setStorageSync('isRegisteredHj', false)
return
}
if (loginRes.code === 0 && loginRes.Data?.user_name && loginRes.Data?.user_phone) {
uni.setStorageSync('isRegisteredHj', true)
uni.setStorageSync('userIdHj', loginRes.Data.user_id)
uni.setStorageSync('userNameHj', loginRes.Data.user_name)
uni.setStorageSync('userPhoneHj', loginRes.Data.user_phone)
}
}).catch(err => {
console.error('登录请求失败', err)
})
},
goRegister() {
const isRegistered = uni.getStorageSync('isRegisteredHj')
if (isRegistered) {
uni.navigateTo({
url: '/pages/hj-answer/hj-answer'
})
return
}
uni.navigateTo({
url: '/pages/hj-register/hj-register'
})
},
goRules() {
uni.navigateTo({
url: '/pages/hj-rules/hj-rules'
})
},
exchangeOpenId(code) {
this.$u.api.getWxOpenId(code).then(res => {
if (res.code !== 0 || !res.Data || !res.Data.openid) return
const openId = res.Data.openid
uni.setStorageSync('openIdHj', openId)
this.cleanUrlCode()
return this.$u.api.wxOpenidLogin({
wenjuan_id: 1007,
open_id: openId
})
}).then(loginRes => {
if (loginRes && loginRes.code === 0 && loginRes.Data && loginRes.Data.user_name && loginRes
.Data.user_phone) {
uni.setStorageSync('isRegisteredHj', true)
uni.setStorageSync('userIdHj', loginRes.Data.user_id || loginRes.Data.uesr_id)
uni.setStorageSync('userNameHj', loginRes.Data.user_name)
uni.setStorageSync('userPhoneHj', loginRes.Data.user_phone)
} else if (loginRes && !loginRes.Data) {
uni.setStorageSync('isRegisteredHj', false)
}
}).catch(err => {
console.error('请求失败', err)
})
}
}
}
</script>
<style lang="scss">
page {
background-color: #7CC6EB;
}
.blocked-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 999;
background-color: #7CC6EB;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.blocked-tip {
font-size: 36rpx;
font-weight: 600;
color: #fff;
}
.blocked-sub {
font-size: 26rpx;
color: rgba(255, 255, 255, 0.85);
margin-top: 16rpx;
}
.side-tab {
position: absolute;
right: 0;
width: 160rpx;
height: 60rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 30rpx 0 0 30rpx;
background: linear-gradient(135deg, #FD5401, #FF8A3D);
color: #fff;
font-size: 24rpx;
font-weight: 600;
letter-spacing: 2rpx;
border-left: 6rpx solid rgba(255, 255, 255, 0.65);
box-shadow: 0 6rpx 16rpx rgba(253, 84, 1, 0.35);
}
.side-tab-hover {
opacity: 0.85;
}
.back-home {
position: fixed;
left: 20rpx;
top: 80rpx;
width: 64rpx;
height: 64rpx;
border-radius: 50%;
background: rgba(0, 0, 0, 0.25);
display: flex;
align-items: center;
justify-content: center;
z-index: 998;
}
.back-home-icon {
font-size: 44rpx;
color: #fff;
line-height: 1;
margin-top: -6rpx;
}
.prize-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
z-index: 1000;
}
.prize-popup {
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 620rpx;
z-index: 1001;
display: flex;
flex-direction: column;
align-items: center;
}
.prize-scroll {
width: 620rpx;
max-height: 75vh;
background: #fff;
border-radius: 24rpx;
overflow: hidden;
}
.prize-close {
width: 64rpx;
height: 64rpx;
border-radius: 50%;
border: 2rpx solid rgba(255, 255, 255, 0.9);
display: flex;
align-items: center;
justify-content: center;
margin-top: 30rpx;
}
.prize-close-text {
font-size: 32rpx;
color: #fff;
line-height: 1;
}
</style>
+189
View File
@@ -0,0 +1,189 @@
<template>
<view class="content">
<view class="page-header">
<text class="header-back" @tap="goBack">‹</text>
<text class="header-title">用户隐私协议</text>
</view>
<scroll-view scroll-y class="doc-scroll">
<view class="doc-card">
<view class="doc-title">用户隐私协议</view>
<text class="doc-meta">主办方:湖南一二三零一文化旅游服务有限公司</text>
<text class="doc-meta">生效日期:自发布之日起</text>
<view class="sec">
<text class="sec-title">一、适用范围</text>
<text class="sec-text">本协议适用于“法治护航·美丽湖南”全民学法答题活动(以下简称“本活动”)过程中我们对您个人信息的收集、使用与保护。您勾选同意本协议即表示您已阅读、理解并同意本协议全部内容。</text>
</view>
<view class="sec">
<text class="sec-title">二、我们收集的信息</text>
<text class="sec-text">1. 注册信息:姓名、手机号码,用于活动参与资格确认与实名核验,短信验证码(通过阿里云短信服务发送)用于验证手机归属;</text>
<text class="sec-text">2. 微信授权信息:本活动通过微信网页授权(snsapi_base静默授权)获取您的openid,用于关联您的身份与本活动答题、中奖记录,授权范围不包含您的微信昵称、头像等信息;</text>
<text class="sec-text">3. 答题数据:答题记录、对错结果及用时,用于成绩结算与抽奖资格核验;</text>
<text class="sec-text">4. 中奖信息:参与抽奖产生的中奖记录,用于中奖公示及奖品发放与联系。</text>
</view>
<view class="sec">
<text class="sec-title">三、信息的使用</text>
<text class="sec-text">1. 提供答题、抽奖资格核验及开奖抽奖服务;</text>
<text class="sec-text">2. 验证用户身份及实名信息真实性,保障活动公平,防范刷量、冒领;</text>
<text class="sec-text">3. 完成中奖公示与奖品发放,并在中奖时与您联系;</text>
<text class="sec-text">4. 满足法律法规及主管部门的监管要求。</text>
</view>
<view class="sec">
<text class="sec-title">四、信息的存储与保护</text>
<text class="sec-text">1. 您的个人信息存储于活动服务器,接口数据采用加密方式传输,并采取访问控制等安全措施;</text>
<text class="sec-text">2. 我们不会出售您的个人信息,亦不会向与本活动无关的第三方提供;除法律法规明确要求或司法、行政机关依法要求外,任何共享均经审慎评估;</text>
<text class="sec-text">3. 活动结束后,相关数据将依法律规定予以保留或删除。</text>
</view>
<view class="sec">
<text class="sec-title">五、信息的公示</text>
<text class="sec-text">为保障抽奖活动公开透明,中奖名单等信息将依活动监管要求进行公示,公示内容将对姓名、手机号码等个人信息作脱敏处理。</text>
</view>
<view class="sec">
<text class="sec-title">六、您的权利</text>
<text class="sec-text">您可通过本协议所列联系方式向我们申请查询、更正、删除您的个人信息,或撤回您的同意。撤回同意不影响撤回前基于同意已进行的信息处理,但可能导致您无法继续参与本活动。</text>
</view>
<view class="sec">
<text class="sec-title">七、未成年人保护</text>
<text class="sec-text">本活动面向具备完全民事行为能力的成年人。未满十八周岁的未成年人请勿在本活动中提交个人信息,如需参与应取得监护人同意并在监护人陪同下进行。</text>
</view>
<view class="sec">
<text class="sec-title">八、协议更新</text>
<text class="sec-text">我们可能根据活动安排及法律法规变化适时更新本协议,更新后的协议将在活动页面公示后生效。若您继续参与活动,即表示您接受更新后的协议。</text>
</view>
<view class="sec">
<text class="sec-title">九、联系方式</text>
<text class="sec-text">如您对本协议或本活动个人信息保护事宜有任何疑问、意见或投诉,请通过以下方式联系我们:</text>
<text class="sec-text">主办方:湖南一二三零一文化旅游服务有限公司</text>
<text class="sec-text">联系电话:0731-88912301</text>
</view>
<view style="height: 40rpx;"></view>
</view>
</scroll-view>
<view class="page-footer">
<button class="agree-btn" @tap="agreeAndBack">已阅读并同意</button>
</view>
</view>
</template>
<script>
export default {
methods: {
goBack() {
uni.navigateBack()
},
agreeAndBack() {
const pages = getCurrentPages()
const prev = pages[pages.length - 2]
if (prev && prev.$vm) prev.$vm.agreed = true
uni.navigateBack()
}
}
}
</script>
<style lang="scss">
page {
background-color: #F5F5F5;
}
.content {
position: relative;
display: flex;
flex-direction: column;
height: 100vh;
height: 100dvh;
}
.page-header {
display: flex;
align-items: center;
padding: 20rpx 30rpx;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
flex-shrink: 0;
}
.header-back {
font-size: 48rpx;
color: #fff;
line-height: 1;
margin-right: 16rpx;
padding: 0 10rpx;
}
.header-title {
font-size: 30rpx;
font-weight: 600;
color: #fff;
flex: 1;
}
.doc-scroll {
flex: 1;
overflow: hidden;
padding-bottom: 20rpx;
}
.doc-card {
background: #fff;
margin: 24rpx;
border-radius: 20rpx;
padding: 36rpx 30rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
}
.doc-title {
font-size: 36rpx;
font-weight: 700;
color: #333;
text-align: center;
margin-bottom: 16rpx;
}
.doc-meta {
display: block;
font-size: 22rpx;
color: #999;
text-align: center;
line-height: 1.8;
}
.sec {
margin-top: 30rpx;
}
.sec-title {
display: block;
font-size: 28rpx;
font-weight: 700;
color: #FD5401;
margin-bottom: 10rpx;
}
.sec-text {
display: block;
font-size: 26rpx;
color: #555;
line-height: 1.7;
margin-bottom: 6rpx;
}
.page-footer {
flex-shrink: 0;
padding: 20rpx 30rpx 40rpx;
background: #fff;
border-top: 1rpx solid #f0f0f0;
}
.agree-btn {
width: 100%;
height: 88rpx;
line-height: 88rpx;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
color: #fff;
font-size: 32rpx;
font-weight: 600;
border: none;
border-radius: 44rpx;
box-shadow: 0 4rpx 16rpx rgba(253, 84, 1, 0.3);
}
</style>
+238
View File
@@ -0,0 +1,238 @@
<template>
<view class="content">
<view class="page-bg" :style="{ position: 'absolute', top: 0, left: 0, width: '750rpx', height: bgHeight + 'px', backgroundImage: 'url(https://aliyunoss.hn12301.net/learnlaw/xfhj_dtbj.jpg)', backgroundSize: 'cover', backgroundPosition: 'top center', backgroundRepeat: 'no-repeat', zIndex: 0 }"></view>
<view class="page-body">
<view class="login-box" v-if="!isLoggedIn">
<text class="login-tip">注册后享受更多功能</text>
<button class="login-btn" @tap="goRegister">立即注册</button>
</view>
<template v-if="isLoggedIn">
<view class="user-card">
<view class="user-avatar">
<text class="avatar-text">{{ userName.charAt(0) }}</text>
</view>
<view class="user-info">
<text class="user-name">{{ userName }}</text>
<text class="user-phone">{{ maskedPhone }}</text>
</view>
</view>
<view class="menu-list">
<view class="menu-item" @tap="goMyPrizes">
<view class="menu-icon menu-icon-prize">
<text>🎁</text>
</view>
<text class="menu-text">我的奖品</text>
<text class="menu-arrow">›</text>
</view>
<view class="menu-item" @tap="goAnswerRecords">
<view class="menu-icon menu-icon-record">
<text>📝</text>
</view>
<text class="menu-text">答题记录</text>
<text class="menu-arrow">›</text>
</view>
</view>
</template>
</view>
<hj-tabbar current="profile"></hj-tabbar>
</view>
</template>
<script>
import hjTabbar from '@/components/hj-tabbar/hj-tabbar.vue'
export default {
components: {
hjTabbar
},
data() {
return {
isLoggedIn: false,
userName: '',
userPhone: '',
bgHeight: 0
}
},
computed: {
maskedPhone() {
const p = this.userPhone
if (!p || p.length < 7) return p
return p.slice(0, 3) + '****' + p.slice(-4)
}
},
onLoad() {
const sys = uni.getSystemInfoSync();
this.bgHeight = sys.windowHeight
},
onShow() {
this.checkLogin()
},
methods: {
checkLogin() {
const userId = uni.getStorageSync('userIdHj')
if (userId) {
this.isLoggedIn = true
this.userName = uni.getStorageSync('userNameHj') || ''
this.userPhone = uni.getStorageSync('userPhoneHj') || ''
} else {
this.isLoggedIn = false
}
},
goRegister() {
uni.navigateTo({ url: '/pages/hj-register/hj-register' })
},
goMyPrizes() {
const phone = uni.getStorageSync('userPhoneHj') || ''
window.location.href = 'https://goldnar.hntgov.net/cardholder/index.html#/?phone=' + phone
},
goAnswerRecords() {
uni.navigateTo({ url: '/pages/hj-records/hj-records' })
}
}
}
</script>
<style lang="scss">
page {
background-color: #B3E9F3;
}
.content {
position: relative;
display: flex;
flex-direction: column;
}
.page-body {
position: relative;
z-index: 1;
flex: 1;
padding: 350rpx 30rpx 140rpx;
box-sizing: border-box;
}
.login-box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
}
.login-tip {
font-size: 28rpx;
color: rgba(255,255,255,0.85);
margin-bottom: 30rpx;
}
.login-btn {
width: 400rpx;
height: 80rpx;
line-height: 80rpx;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
color: #fff;
font-size: 30rpx;
font-weight: 600;
border: none;
border-radius: 40rpx;
box-shadow: 0 4rpx 16rpx rgba(253,84,1,0.3);
}
.user-card {
background: rgba(255,255,255,0.95);
border-radius: 20rpx;
padding: 36rpx 30rpx;
display: flex;
align-items: center;
margin-bottom: 24rpx;
box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
}
.user-avatar {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-right: 24rpx;
}
.avatar-text {
font-size: 32rpx;
font-weight: 700;
color: #fff;
}
.user-info {
flex: 1;
min-width: 0;
}
.user-name {
font-size: 30rpx;
font-weight: 600;
color: #333;
display: block;
}
.user-phone {
font-size: 24rpx;
color: #999;
margin-top: 6rpx;
display: block;
}
.menu-list {
background: rgba(255,255,255,0.95);
border-radius: 20rpx;
overflow: hidden;
box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
}
.menu-item {
display: flex;
align-items: center;
padding: 30rpx 28rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.menu-item:last-child {
border-bottom: none;
}
.menu-icon {
width: 52rpx;
height: 52rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-right: 20rpx;
font-size: 28rpx;
}
.menu-icon-prize {
background: #fff7e6;
}
.menu-icon-record {
background: #f6ffed;
}
.menu-text {
flex: 1;
font-size: 28rpx;
color: #333;
font-weight: 500;
}
.menu-arrow {
font-size: 36rpx;
color: #ccc;
flex-shrink: 0;
}
</style>
+225
View File
@@ -0,0 +1,225 @@
<template>
<view class="content">
<view class="page-body">
<view class="loading-box" v-if="detailList.length === 0 && !loadError">
<u-loading mode="circle" size="40"></u-loading>
<text class="loading-text">加载中...</text>
</view>
<view class="loading-box" v-if="loadError">
<text class="error-text">{{ loadError }}</text>
<button class="retry-btn" @tap="fetchDetail">重新加载</button>
</view>
<template v-if="detailList.length > 0">
<view class="detail-item" v-for="(item, i) in detailList" :key="item.id">
<view class="detail-index" :class="item.is_correct ? 'correct' : 'wrong'">
<text class="detail-index-text">{{ i + 1 }}</text>
</view>
<view class="detail-body">
<text class="detail-q">{{ item.tiku_question_content }}</text>
<view class="detail-answer-row">
<text class="detail-label">你的答案:</text>
<text class="detail-value" :class="item.is_correct ? 'text-correct' : 'text-wrong'">{{ item.user_answer }}</text>
</view>
<view class="detail-answer-row" v-if="!item.is_correct">
<text class="detail-label">正确答案:</text>
<text class="detail-value text-correct-answer">{{ item.tiku_correct_answer }}</text>
</view>
<view class="tips" v-if="item.tips">
<text class="tips-label">解析</text>
<text class="tips-text">{{ item.tips }}</text>
</view>
</view>
</view>
</template>
</view>
</view>
</template>
<script>
export default {
data() {
return {
resultId: 0,
detailList: [],
loadError: ''
}
},
onLoad(options) {
this.resultId = options.resultId
this.fetchDetail()
},
methods: {
fetchDetail() {
this.loadError = ''
this.$u.api.getUserHisResultDetail({
resultId: this.resultId,
__hj: true
}).then(res => {
if (res.code === 0 && Array.isArray(res.Data) && res.Data.length) {
this.detailList = res.Data
} else {
this.loadError = res.msg || '数据异常'
}
}).catch(err => {
console.error('获取答题详情失败', err)
this.loadError = '网络请求失败'
})
}
}
}
</script>
<style lang="scss">
page {
background-color: #7CC6EB;
}
.content {
position: relative;
height: 100vh;
height: 100dvh;
}
.page-body {
position: relative;
z-index: 1;
height: 100%;
padding: 40rpx 30rpx;
box-sizing: border-box;
overflow-y: auto;
}
.detail-item {
background: rgba(255,255,255,0.95);
border-radius: 20rpx;
padding: 28rpx;
margin-bottom: 20rpx;
display: flex;
box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
}
.detail-index {
width: 44rpx;
height: 44rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-right: 16rpx;
margin-top: 2rpx;
}
.detail-index.correct {
background: linear-gradient(135deg, #52c41a, #73d13d);
box-shadow: 0 2rpx 8rpx rgba(82,196,26,0.3);
}
.detail-index.wrong {
background: linear-gradient(135deg, #f5222d, #ff4d4f);
box-shadow: 0 2rpx 8rpx rgba(245,34,45,0.3);
}
.detail-index-text {
font-size: 20rpx;
font-weight: 700;
color: #fff;
}
.detail-body {
flex: 1;
min-width: 0;
}
.detail-q {
font-size: 26rpx;
color: #333;
line-height: 1.5;
display: block;
margin-bottom: 10rpx;
}
.detail-answer-row {
display: flex;
align-items: baseline;
margin-top: 4rpx;
}
.detail-label {
font-size: 22rpx;
color: #999;
flex-shrink: 0;
}
.detail-value {
font-size: 24rpx;
font-weight: 500;
}
.text-correct {
color: #52c41a;
}
.text-wrong {
color: #f5222d;
}
.text-correct-answer {
color: #52c41a;
}
.tips {
background: rgba(255, 247, 237, 0.95);
border-radius: 12rpx;
padding: 20rpx;
margin-top: 16rpx;
border-left: 6rpx solid #FD5401;
}
.tips-label {
font-size: 24rpx;
font-weight: 600;
color: #FD5401;
display: block;
margin-bottom: 6rpx;
}
.tips-text {
font-size: 24rpx;
color: #666;
line-height: 1.5;
}
.loading-box {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.loading-text {
font-size: 28rpx;
color: #fff;
margin-top: 20rpx;
}
.error-text {
font-size: 28rpx;
color: #fff;
text-align: center;
display: block;
}
.retry-btn {
margin-top: 30rpx;
width: 240rpx;
height: 72rpx;
line-height: 72rpx;
background: rgba(255, 255, 255, 0.9);
color: #FD5401;
border: none;
border-radius: 36rpx;
font-size: 28rpx;
}
</style>
+192
View File
@@ -0,0 +1,192 @@
<template>
<view class="content">
<view class="page-body">
<view class="loading-box" v-if="records.length === 0 && !loadError">
<u-loading mode="circle" size="40"></u-loading>
<text class="loading-text">加载中...</text>
</view>
<view class="loading-box" v-if="loadError">
<text class="error-text">{{ loadError }}</text>
<button class="retry-btn" @tap="fetchRecords">重新加载</button>
</view>
<template v-if="records.length > 0">
<view class="record-item" v-for="(item, i) in records" :key="item.id" @click="goDetail(item)">
<view class="record-index">
<text class="record-index-text">{{ i + 1 }}</text>
</view>
<view class="record-body">
<view class="record-row">
<text class="record-label">答题时间:</text>
<text class="record-value">{{ item.create_time }}</text>
</view>
<view class="record-row">
<text class="record-label">答对题数:</text>
<text class="record-value">{{ item.correct_question_num }} / {{ item.total_question_num }} 题</text>
</view>
<view class="record-row">
<text class="record-label">答题用时:</text>
<text class="record-value">{{ formatTime(item.use_time) }}</text>
</view>
</view>
</view>
</template>
</view>
</view>
</template>
<script>
export default {
data() {
return {
records: [],
loadError: ''
}
},
onLoad() {
this.fetchRecords()
},
methods: {
fetchRecords() {
this.loadError = ''
const userId = uni.getStorageSync('userIdHj')
if (!userId) {
this.loadError = '暂未登录'
return
}
this.$u.api.getUserHisResultList({
wenjuanId: 1007,
userId: userId
}).then(res => {
if (res.code === 0 && res.Data?.result_list) {
this.records = res.Data.result_list
} else {
this.loadError = res.msg || '数据异常'
}
}).catch(err => {
console.error('获取答题记录失败', err)
this.loadError = '网络请求失败'
})
},
formatTime(sec) {
const m = Math.floor(sec / 60)
const s = sec % 60
return (m < 10 ? '0' : '') + m + ':' + (s < 10 ? '0' : '') + s
},
goDetail(item) {
uni.navigateTo({
url: '/pages/hj-record-detail/hj-record-detail?resultId=' + item.id
})
}
}
}
</script>
<style lang="scss">
page {
background-color: #7CC6EB;
}
.content {
position: relative;
height: 100vh;
height: 100dvh;
}
.page-body {
position: relative;
z-index: 1;
height: 100%;
padding: 40rpx 30rpx;
box-sizing: border-box;
overflow-y: auto;
}
.record-item {
background: rgba(255,255,255,0.95);
border-radius: 20rpx;
padding: 28rpx;
margin-bottom: 20rpx;
display: flex;
box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
}
.record-index {
width: 44rpx;
height: 44rpx;
border-radius: 50%;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-right: 16rpx;
margin-top: 2rpx;
box-shadow: 0 2rpx 8rpx rgba(253,84,1,0.3);
}
.record-index-text {
font-size: 20rpx;
font-weight: 700;
color: #fff;
}
.record-body {
flex: 1;
min-width: 0;
}
.record-row {
display: flex;
align-items: baseline;
margin-top: 6rpx;
}
.record-row:first-child {
margin-top: 0;
}
.record-label {
font-size: 24rpx;
color: #999;
flex-shrink: 0;
}
.record-value {
font-size: 26rpx;
color: #333;
font-weight: 500;
}
.loading-box {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.loading-text {
font-size: 28rpx;
color: #fff;
margin-top: 20rpx;
}
.error-text {
font-size: 28rpx;
color: #fff;
text-align: center;
display: block;
}
.retry-btn {
margin-top: 30rpx;
width: 240rpx;
height: 72rpx;
line-height: 72rpx;
background: rgba(255, 255, 255, 0.9);
color: #FD5401;
border: none;
border-radius: 36rpx;
font-size: 28rpx;
}
</style>
+340
View File
@@ -0,0 +1,340 @@
<template>
<view class="register-page">
<view class="header">
<text class="header-title">注册信息</text>
<text class="header-desc">填写资料即可参与答题抽奖</text>
</view>
<view class="form">
<view class="field">
<text class="label">姓名</text>
<view class="input-wrap">
<text class="input-icon">👤</text>
<input class="input" v-model="userName" placeholder="请输入您的姓名" />
</view>
<text class="name-tip">本次活动实行实名制管理,参与抽奖活动须如实填报本人姓名与手机号码,中奖后根据预留信息发货。</text>
</view>
<view class="field">
<text class="label">手机号</text>
<view class="input-wrap">
<text class="input-icon">📱</text>
<input class="input" v-model="phone" placeholder="请输入手机号" type="number" maxlength="11" />
</view>
</view>
<view class="field">
<text class="label">验证码</text>
<view class="field-row">
<view class="input-wrap code-input-wrap">
<text class="input-icon">✉️</text>
<input class="input" v-model="smsCode" placeholder="请输入验证码" type="number" maxlength="6" />
</view>
<button class="code-btn" @tap="sendCode" :disabled="sending" :class="{ disabled: sending }">
{{ sending ? countdown + 's' : '获取验证码' }}
</button>
</view>
</view>
<view class="agree-row" @tap="agreed = !agreed">
<view class="agree-checkbox" :class="{ checked: agreed }">
<text v-if="agreed" class="agree-check-mark">✓</text>
</view>
<view class="agree-text">
<text>我已阅读并同意</text>
<text class="agree-link" @tap.stop="goPrivacy">《用户隐私协议》</text>
</view>
</view>
<button class="submit-btn" @tap="register" :disabled="submitting" :class="{ disabled: submitting }">
{{ submitting ? '提交中...' : '立即注册' }}
</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
userName: '',
phone: '',
smsCode: '',
sending: false,
countdown: 60,
timer: null,
submitting: false,
agreed: false
}
},
methods: {
goPrivacy() {
uni.navigateTo({ url: '/pages/hj-privacy/hj-privacy' })
},
sendCode() {
if (!/^1\d{10}$/.test(this.phone)) {
uni.showToast({ title: '请输入正确手机号', icon: 'none' })
return
}
this.sending = true
this.$u.api.sendSms(this.phone).then(res => {
if (res.code === 0) {
uni.showToast({ title: '验证码已发送', icon: 'none' })
this.startCountdown()
} else {
uni.showToast({ title: res.msg || '发送失败', icon: 'none' })
this.sending = false
}
}).catch(() => {
uni.showToast({ title: '网络错误', icon: 'none' })
this.sending = false
})
},
startCountdown() {
this.countdown = 60
this.timer = setInterval(() => {
this.countdown--
if (this.countdown <= 0) {
clearInterval(this.timer)
this.timer = null
this.sending = false
}
}, 1000)
},
register() {
if (!this.userName || !this.phone || !this.smsCode) {
uni.showToast({ title: '请填写完整信息', icon: 'none' })
return
}
if (!this.agreed) {
uni.showToast({ title: '请阅读并同意《用户隐私协议》', icon: 'none' })
return
}
this.submitting = true
const openId = uni.getStorageSync('openIdHj')
this.$u.api.userRegist({
wenjuan_id: 1007,
open_id: openId,
user_name: this.userName,
user_phone: this.phone,
sms_code: this.smsCode,
channel: 1
}).then(res => {
if (res.code === 0) {
uni.setStorageSync('isRegisteredHj', true)
const data = res.Data || {}
const userId = data.user_id || data.uesr_id
if (userId) uni.setStorageSync('userIdHj', userId)
if (data.user_name) uni.setStorageSync('userNameHj', data.user_name)
if (data.user_phone) uni.setStorageSync('userPhoneHj', data.user_phone)
this.syncUserInfo(openId)
uni.showToast({ title: '注册成功' })
setTimeout(() => uni.navigateBack(), 1500)
} else {
uni.showToast({ title: res.msg || '注册失败', icon: 'none' })
}
}).catch(() => {
uni.showToast({ title: '网络错误', icon: 'none' })
}).finally(() => {
this.submitting = false
})
},
syncUserInfo(openId) {
this.$u.api.wxOpenidLogin({ wenjuan_id: 1007, open_id: openId }).then(loginRes => {
if (loginRes.code === 0 && loginRes.Data) {
const data = loginRes.Data
if (data.user_id || data.uesr_id) uni.setStorageSync('userIdHj', data.user_id || data.uesr_id)
if (data.user_name) uni.setStorageSync('userNameHj', data.user_name)
if (data.user_phone) uni.setStorageSync('userPhoneHj', data.user_phone)
}
}).catch(err => {
console.error('注册后同步用户信息失败', err)
})
},
},
beforeDestroy() {
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
}
}
</script>
<style>
page {
background: linear-gradient(135deg, #FFF8ED 0%, #FFE9C4 100%);
}
.register-page {
padding: 60rpx 40rpx;
min-height: 100vh;
box-sizing: border-box;
}
.header {
margin-bottom: 50rpx;
text-align: center;
}
.header-title {
font-size: 40rpx;
font-weight: bold;
color: #5D533D;
display: block;
margin-bottom: 12rpx;
}
.header-desc {
font-size: 26rpx;
color: #8B7355;
}
.form {
background: rgba(255, 255, 255, 0.95);
border-radius: 24rpx;
padding: 50rpx 40rpx;
box-shadow: 0 8rpx 40rpx rgba(0, 0, 0, 0.06);
}
.field {
margin-bottom: 36rpx;
}
.label {
font-size: 28rpx;
font-weight: 500;
color: #5D533D;
margin-bottom: 16rpx;
display: block;
padding-left: 8rpx;
}
.input-wrap {
display: flex;
align-items: center;
height: 88rpx;
border: 2rpx solid #F0E4D0;
border-radius: 12rpx;
background: #FEFCF8;
padding: 0 24rpx;
box-sizing: border-box;
}
.input-wrap:focus-within {
border-color: #FD5401;
box-shadow: 0 0 0 4rpx rgba(253, 84, 1, 0.08);
}
.input-icon {
font-size: 32rpx;
margin-right: 16rpx;
flex-shrink: 0;
}
.input {
height: 100%;
font-size: 28rpx;
color: #333;
flex: 1;
border: none;
background: transparent;
outline: none;
width: 100%;
box-sizing: border-box;
}
.name-tip {
display: block;
font-size: 22rpx;
color: #E4393C;
line-height: 1.5;
margin-top: 12rpx;
padding: 12rpx 16rpx;
background: #FFEFE9;
border-radius: 12rpx;
}
.field-row {
display: flex;
align-items: center;
}
.code-input-wrap {
flex: 1;
margin-right: 20rpx;
}
.code-btn {
flex-shrink: 0;
height: 88rpx;
line-height: 88rpx;
padding: 0 28rpx;
font-size: 26rpx;
color: #FD5401;
background: #FFF0E6;
border: none;
border-radius: 12rpx;
font-weight: 500;
}
.code-btn.disabled {
color: #B8A898;
background: #F0E8E0;
}
.submit-btn {
width: 100%;
height: 96rpx;
line-height: 96rpx;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
color: #fff;
font-size: 34rpx;
font-weight: 600;
border: none;
border-radius: 16rpx;
margin-top: 20rpx;
box-shadow: 0 6rpx 20rpx rgba(253, 84, 1, 0.3);
}
.submit-btn.disabled {
opacity: 0.5;
}
.agree-row {
display: flex;
align-items: center;
margin: -16rpx 8rpx 28rpx;
}
.agree-checkbox {
width: 36rpx;
height: 36rpx;
border: 2rpx solid #CCC;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-right: 12rpx;
box-sizing: border-box;
}
.agree-checkbox.checked {
border-color: #FD5401;
background: #FD5401;
}
.agree-check-mark {
font-size: 22rpx;
color: #fff;
font-weight: 700;
line-height: 1;
}
.agree-text {
display: flex;
align-items: center;
font-size: 24rpx;
color: #8B7355;
}
.agree-link {
color: #FD5401;
}
</style>
+236
View File
@@ -0,0 +1,236 @@
<template>
<view class="content">
<image src="https://aliyunoss.hn12301.net/learnlaw/xfhj_dtbj.jpg" mode="scaleToFill" style="width:750rpx;height:1820rpx;position:absolute;top:0;left:0;z-index:0;"></image>
<view class="page-body">
<view class="correct-card">
<text class="correct-label">答对题数</text>
<text class="correct-num">{{ correctCount }} <text class="correct-total">/ {{ detailList.length }}</text></text>
</view>
<view class="detail-section">
<view class="section-header">
<text class="section-title">答题详情</text>
<text class="section-subtitle">共 {{ detailList.length }} 题,{{ correctCount }} 对 {{ wrongCount }} 错</text>
</view>
<view class="detail-item" v-for="(item, i) in detailList" :key="i">
<view class="detail-index" :class="item.is_correct || item.status === 1 ? 'correct' : 'wrong'">
<text class="detail-index-text">{{ i + 1 }}</text>
</view>
<view class="detail-body">
<text class="detail-q">{{ item.tiku_question_content || '题目' + (i+1) }}</text>
<view class="detail-answer-row">
<text class="detail-label">你的答案:</text>
<text class="detail-value" :class="item.is_correct || item.status === 1 ? 'text-correct' : 'text-wrong'">{{ item.user_answer || '未作答' }}</text>
</view>
<view class="detail-answer-row" v-if="!(item.is_correct || item.status === 1)">
<text class="detail-label">正确答案:</text>
<text class="detail-value text-correct-answer">{{ item.tiku_correct_answer || '-' }}</text>
</view>
</view>
</view>
</view>
<button class="back-btn" @tap="goBack">返回首页</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
correctCount: 0,
wrongCount: 0,
detailList: []
}
},
onLoad() {
try {
const data = uni.getStorageSync('resultDataHj') || {}
if (data.resultDetailList && data.resultDetailList.length) {
this.detailList = data.resultDetailList
this.correctCount = data.resultDetailList.filter(r => r.is_correct === true || r.is_correct === 1 || r.status === 1).length
this.wrongCount = data.resultDetailList.length - this.correctCount
}
} catch(e) {
console.error('解析结果数据失败', e)
}
},
methods: {
goBack() {
uni.reLaunch({ url: '/pages/hj-index/hj-index' })
}
}
}
</script>
<style lang="scss">
page {
background-color: #7CC6EB;
}
.content {
position: relative;
height: 100vh;
height: 100dvh;
}
.page-body {
position: relative;
z-index: 1;
height: 100%;
padding: 120rpx 30rpx;
box-sizing: border-box;
}
.correct-card {
background: linear-gradient(135deg, #FD5401, #FF7A3D);
border-radius: 20rpx;
padding: 28rpx 24rpx;
text-align: center;
margin-bottom: 20rpx;
box-shadow: 0 4rpx 20rpx rgba(253, 84, 1, 0.2);
}
.correct-label {
font-size: 24rpx;
color: rgba(255,255,255,0.85);
display: block;
}
.correct-num {
font-size: 72rpx;
font-weight: 800;
color: #FFF;
display: block;
line-height: 1.2;
margin-top: 6rpx;
}
.correct-total {
font-size: 32rpx;
font-weight: 500;
color: rgba(255,255,255,0.8);
}
.detail-section {
background: rgba(255,255,255,0.95);
border-radius: 20rpx;
padding: 28rpx;
margin-bottom: 30rpx;
box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
}
.section-header {
display: flex;
justify-content: space-between;
align-items: baseline;
margin-bottom: 20rpx;
padding-bottom: 16rpx;
border-bottom: 2rpx solid #f5f5f5;
}
.section-title {
font-size: 30rpx;
font-weight: 700;
color: #333;
}
.section-subtitle {
font-size: 24rpx;
color: #bbb;
}
.detail-item {
padding: 20rpx 0;
border-bottom: 1rpx solid #f0f0f0;
display: flex;
}
.detail-item:last-child {
border-bottom: none;
}
.detail-index {
width: 44rpx;
height: 44rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-right: 16rpx;
margin-top: 2rpx;
}
.detail-index.correct {
background: linear-gradient(135deg, #52c41a, #73d13d);
box-shadow: 0 2rpx 8rpx rgba(82,196,26,0.3);
}
.detail-index.wrong {
background: linear-gradient(135deg, #f5222d, #ff4d4f);
box-shadow: 0 2rpx 8rpx rgba(245,34,45,0.3);
}
.detail-index-text {
font-size: 20rpx;
font-weight: 700;
color: #fff;
}
.detail-body {
flex: 1;
min-width: 0;
}
.detail-q {
font-size: 26rpx;
color: #333;
line-height: 1.5;
display: block;
margin-bottom: 10rpx;
}
.detail-answer-row {
display: flex;
align-items: baseline;
margin-top: 4rpx;
}
.detail-label {
font-size: 22rpx;
color: #999;
flex-shrink: 0;
}
.detail-value {
font-size: 24rpx;
font-weight: 500;
}
.text-correct {
color: #52c41a;
}
.text-wrong {
color: #f5222d;
}
.text-correct-answer {
color: #52c41a;
}
.back-btn {
width: 690rpx;
height: 88rpx;
line-height: 88rpx;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
color: #fff;
font-size: 32rpx;
font-weight: 600;
border: none;
border-radius: 44rpx;
box-shadow: 0 4rpx 16rpx rgba(253,84,1,0.3);
}
</style>
+203
View File
@@ -0,0 +1,203 @@
<template>
<view class="content">
<view class="page-header">
<text class="header-back" @tap="goBack">‹</text>
<text class="header-title">活动规则</text>
</view>
<scroll-view scroll-y class="doc-scroll">
<view class="doc-card">
<view class="doc-title">“法润三湘·法治护航美丽湖南”活动规则</view>
<view class="sec">
<text class="sec-title">一、活动主题</text>
<text class="sec-text">法润三湘·法治护航美丽湖南</text>
</view>
<view class="sec">
<text class="sec-title">二、活动时间</text>
<text class="sec-text">1. 线上答题时间:2026年11月11日—12月7日;</text>
<text class="sec-text">2. 公证抽奖时间:共设4轮抽奖,分别于11月16日、11月23日、11月30日、12月7日16:00由长沙市长沙公证处全程监督公证开奖。</text>
</view>
<view class="sec">
<text class="sec-title">三、参与方式</text>
<text class="sec-text">1. 关注【湖南生态环境】或【湖南普法】微信公众号,进入“法润三湘”全民学法答题活动页面,点击对应专场答题互动界面开启普法答题;</text>
<text class="sec-text">2. 答题环节由系统从题库中随机抽取5道题目供参与者作答,涵盖判断题、单项选择题两类题型。参与者完成5道题目作答且答案全部正确的,即可获得当轮抽奖参与资格。答题活动每日面向参与者开放,支持不限答题次数重复参与,每轮答题全部答对即可获取对应当期的抽奖参与机会。</text>
</view>
<view class="sec">
<text class="sec-title">四、奖项设置</text>
<view class="prize-table">
<view class="prize-tr prize-th">
<text class="prize-td">奖品</text>
<text class="prize-td">每轮数量</text>
<text class="prize-td">轮数</text>
<text class="prize-td">总数量</text>
</view>
<view class="prize-tr">
<text class="prize-td">“湘约码”湖南景区年票</text>
<text class="prize-td">60名</text>
<text class="prize-td">4轮</text>
<text class="prize-td">240份</text>
</view>
</view>
</view>
<view class="sec">
<text class="sec-title">五、开奖与中奖公示</text>
<text class="sec-text">1. 每轮开奖由长沙市长沙公证处全程监督公证,保证抽奖公平公正;</text>
<text class="sec-text">2. 每轮中奖名单将同步在【湖南生态环境】、【湖南普法】公众号答题活动页面进行公示,请广大参与者及时查看;</text>
<text class="sec-text">3. 中奖用户请在活动专区提交准确信息(姓名、联系电话),信息填写有误将影响奖品发放。</text>
</view>
<view class="sec">
<text class="sec-title">六、奖品发放说明</text>
<text class="sec-text">此专区活动奖品均为旅游卡电子凭证,请您留意短信,及时查收电子旅游卡。</text>
</view>
<view class="sec">
<text class="sec-title">七、注意事项</text>
<text class="sec-text">1. 本活动面向全社会公众免费参与,严禁使用外挂、脚本等作弊手段参与答题,一经核实取消全部抽奖及中奖资格;</text>
<text class="sec-text">2. 活动咨询电话:0731-88912301(工作时间接受咨询)。</text>
<text class="sec-text footer-note">本活动最终解释权归本次“法润三湘”公益普法活动主办方所有。</text>
</view>
<view style="height: 40rpx;"></view>
</view>
</scroll-view>
</view>
</template>
<script>
export default {
methods: {
goBack() {
uni.navigateBack()
}
}
}
</script>
<style lang="scss">
page {
background-color: #F8F8F8;
}
.content {
position: relative;
display: flex;
flex-direction: column;
height: 100vh;
height: 100dvh;
}
.page-header {
display: flex;
align-items: center;
padding: 20rpx 30rpx;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
flex-shrink: 0;
}
.header-back {
font-size: 48rpx;
color: #fff;
line-height: 1;
margin-right: 16rpx;
padding: 0 10rpx;
}
.header-title {
font-size: 30rpx;
font-weight: 600;
color: #fff;
flex: 1;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.doc-scroll {
flex: 1;
overflow: hidden;
}
.doc-card {
background: #fff;
margin: 24rpx;
border-radius: 20rpx;
padding: 36rpx 30rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
}
.doc-title {
font-size: 34rpx;
font-weight: 700;
color: #333;
text-align: center;
line-height: 1.5;
margin-bottom: 20rpx;
}
.sec {
margin-top: 30rpx;
}
.sec-title {
display: block;
font-size: 28rpx;
font-weight: 700;
color: #FD5401;
margin-bottom: 10rpx;
}
.sec-text {
display: block;
font-size: 26rpx;
color: #555;
line-height: 1.7;
margin-bottom: 6rpx;
}
.footer-note {
margin-top: 16rpx;
color: #999;
font-size: 24rpx;
}
.prize-table {
border: 2rpx solid #F0E4D0;
border-radius: 12rpx;
overflow: hidden;
margin-top: 6rpx;
}
.prize-tr {
display: flex;
border-bottom: 2rpx solid #F0E4D0;
}
.prize-tr:last-child {
border-bottom: none;
}
.prize-th {
background: #FFF7ED;
}
.prize-th .prize-td {
font-weight: 700;
color: #5D533D;
}
.prize-td {
flex: 1;
font-size: 24rpx;
color: #555;
padding: 16rpx 10rpx;
text-align: center;
border-right: 2rpx solid #F0E4D0;
line-height: 1.4;
}
.prize-td:last-child {
border-right: none;
}
.prize-td:nth-child(1) {
flex: 2;
}
</style>
+210
View File
@@ -0,0 +1,210 @@
<template>
<view class="content">
<view class="page-header">
<text class="header-back" @tap="goBack">‹</text>
<text class="header-title">法治学习</text>
</view>
<view class="body">
<view class="group" v-for="(group, gi) in articles" :key="gi">
<view class="group-title">{{ group.name }}</view>
<view class="article-item" v-for="item in group.articles" :key="item.url" @tap="openArticle(item)">
<view class="article-index">
<text class="article-index-text">{{ item.no }}</text>
</view>
<text class="article-title">{{ item.title }}</text>
<text class="article-arrow">›</text>
</view>
</view>
<view class="tip-text">点击法规名称跳转至官方发布页面阅读学习</view>
<view style="height: 40rpx;"></view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
groups: [{
name: '一、生态环境法典及配套规定',
list: [{
title: '中华人民共和国生态环境法典',
url: 'https://www.mee.gov.cn/ywgz/fgbz/fl/202603/t20260313_1146496.shtml'
},
{
title: '最高人民法院关于适用《中华人民共和国生态环境法典》时间效力的若干规定',
url: 'https://www.court.gov.cn/fabu/xiangqing/508001.html',
direct: true
}
]
},
{
name: '二、权威解读与学习资料',
list: [ {
title: '全国人大常委会法工委施春风:何以生态环境法典',
url: 'http://www.npc.gov.cn/c2/c30834/202603/t20260316_453286.html',
direct: true
},
{
title: '沈春耀:编纂生态环境法典 在法治轨道上以美丽中国建设全面推进人与自然和谐共生的现代化',
url: 'http://www.npc.gov.cn/npc/c2/kgfb/202603/t20260320_453349.html',
direct: true
},
{
title: '生态环境部部长黄润秋:加强生态环境法典学习贯彻 在法治轨道上全面推进美丽中国建设',
url: 'https://www.mee.gov.cn/ywdt/hjywnews/202606/t20260618_1159676.shtml'
}
]
}
]
}
},
computed: {
articles() {
let no = 0
return this.groups.map(g => ({
name: g.name,
articles: g.list.map(a => Object.assign({
no: ++no
}, a))
}))
}
},
methods: {
goBack() {
const pages = getCurrentPages()
if (pages.length > 1) {
uni.navigateBack()
} else {
uni.reLaunch({ url: '/pages/hj-index/hj-index' })
}
},
openArticle(item) {
if (item.direct) {
const w = window.open(item.url, '_blank')
if (!w) {
window.location.href = item.url
}
return
}
uni.navigateTo({
url: '/pages/hj-web/hj-web?url=' + encodeURIComponent(item.url) + '&title=' + encodeURIComponent(item.title)
})
}
}
}
</script>
<style lang="scss">
page {
background-color: #F8F8F8;
overflow-x: hidden;
}
.content {
position: relative;
min-height: 100vh;
width: 100%;
max-width: 100vw;
overflow-x: hidden;
box-sizing: border-box;
}
.page-header {
position: sticky;
top: 0;
z-index: 10;
display: flex;
align-items: center;
padding: 20rpx 30rpx;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
}
.header-back {
font-size: 48rpx;
color: #fff;
line-height: 1;
margin-right: 16rpx;
padding: 0 10rpx;
}
.header-title {
font-size: 30rpx;
font-weight: 600;
color: #fff;
flex: 1;
}
.body {
width: 100%;
padding: 24rpx 30rpx;
box-sizing: border-box;
}
.group {
margin-bottom: 24rpx;
box-sizing: border-box;
}
.group-title {
font-size: 28rpx;
font-weight: 700;
color: #FD5401;
padding: 8rpx 4rpx 16rpx;
}
.article-item {
width: 100%;
max-width: 100%;
box-sizing: border-box;
background: #fff;
border-radius: 16rpx;
padding: 26rpx 24rpx;
margin-bottom: 14rpx;
display: flex;
align-items: center;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.04);
}
.article-index {
width: 44rpx;
height: 44rpx;
border-radius: 50%;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-right: 18rpx;
}
.article-index-text {
font-size: 22rpx;
font-weight: 700;
color: #fff;
}
.article-title {
flex: 1;
min-width: 0;
word-break: break-all;
font-size: 27rpx;
color: #333;
line-height: 1.4;
}
.article-arrow {
font-size: 36rpx;
color: #ccc;
flex-shrink: 0;
margin-left: 10rpx;
}
.tip-text {
font-size: 22rpx;
color: #999;
text-align: center;
margin: 6rpx 0 20rpx;
padding: 0 30rpx;
}
</style>
+76
View File
@@ -0,0 +1,76 @@
<template>
<view class="content">
<view class="frame-wrap" :style="{ height: wrapHeight + 'px' }">
<iframe class="frame" :src="url" frameborder="0" :style="frameStyle"></iframe>
</view>
</view>
</template>
<script>
export default {
data() {
return {
url: '',
title: '',
frameWidth: 1200,
screenW: 375,
wrapHeight: 600,
vpSaved: ''
}
},
computed: {
scale() {
return this.screenW / this.frameWidth
},
frameStyle() {
const h = Math.ceil(this.wrapHeight / this.scale)
return 'width:' + this.frameWidth + 'px;height:' + h + 'px;transform:scale(' + this.scale + ');transform-origin:0 0;'
}
},
onLoad(options) {
this.url = decodeURIComponent(options.url || '')
this.title = decodeURIComponent(options.title || '法规原文')
const meta = document.querySelector('meta[name="viewport"]')
if (meta) {
this.vpSaved = meta.getAttribute('content') || ''
meta.setAttribute('content', 'width=device-width,initial-scale=1.0,maximum-scale=3.0,user-scalable=yes')
}
},
onReady() {
const sys = uni.getSystemInfoSync()
this.screenW = sys.windowWidth
this.wrapHeight = sys.windowHeight
},
onUnload() {
const meta = document.querySelector('meta[name="viewport"]')
if (meta && this.vpSaved) {
meta.setAttribute('content', this.vpSaved)
}
}
}
</script>
<style lang="scss">
page {
background-color: #fff;
}
.content {
position: relative;
width: 100%;
max-width: 100vw;
overflow: hidden;
}
.frame-wrap {
position: relative;
width: 100%;
overflow: hidden;
background: #fff;
}
.frame {
display: block;
border: none;
}
</style>
+432
View File
@@ -0,0 +1,432 @@
<template>
<view class="content">
<view class="page-bg" :style="{ position: 'absolute', top: 0, left: 0, width: '750rpx', height: bgHeight + 'px', backgroundImage: 'url(https://aliyunoss.hn12301.net/learnlaw/xfhj_dtbj.jpg)', backgroundSize: 'cover', backgroundPosition: 'top center', backgroundRepeat: 'no-repeat', zIndex: 0 }"></view>
<view class="page-body">
<view class="login-box" v-if="!isLoggedIn">
<text class="login-tip">注册后可查看中奖记录</text>
<button class="login-btn" @tap="goRegister">立即注册</button>
</view>
<template v-if="isLoggedIn">
<view class="empty-box" v-if="!lotteryStarted">
<text class="empty-icon">🎁</text>
<text class="empty-text">暂未开始抽奖</text>
</view>
<template v-else>
<view class="record-list" v-if="list.length > 0">
<view class="record-item" v-for="(item, i) in list" :key="i">
<view class="record-icon">
<text class="iconfont">🎁</text>
</view>
<view class="record-info">
<text class="record-prize">{{ item.title }}</text>
<text class="record-desc">{{ item.is_win_pc_desc }}</text>
<text class="record-status">{{ item.status_desc }}</text>
</view>
<view class="record-right">
<text class="record-time">{{ item.time }}</text>
<view class="btn-row">
<button class="winlist-btn" v-if="isEnded(item)" @tap="showWinList(item)">中奖名单</button>
</view>
</view>
</view>
</view>
<view class="empty-box" v-if="list.length === 0">
<text class="empty-icon">🏆</text>
<text class="empty-text">暂无中奖记录</text>
</view>
</template>
</template>
</view>
<view class="modal-mask" v-if="showWinModal" @tap="closeWinModal"></view>
<view class="modal win-modal" v-if="showWinModal">
<view class="modal-header">
<text class="modal-title">中奖名单</text>
<text class="modal-close" @tap="closeWinModal">✕</text>
</view>
<view class="win-list">
<view class="win-item" v-for="(w, wi) in winList" :key="wi">
<view class="win-level" :class="'win-level-' + w.win_level">
<text>{{ w.win_level_name }}</text>
</view>
<text class="win-name">{{ w.user_name }}</text>
<text class="win-phone">{{ w.user_phone }}</text>
</view>
<view class="win-empty" v-if="winList.length === 0">
<text>暂无中奖名单</text>
</view>
</view>
</view>
<hj-tabbar current="winRecords"></hj-tabbar>
</view>
</template>
<script>
import hjTabbar from '@/components/hj-tabbar/hj-tabbar.vue'
export default {
components: {
hjTabbar
},
data() {
return {
isLoggedIn: false,
lotteryStarted: false,
list: [],
showWinModal: false,
winList: [],
bgHeight: 0
}
},
onLoad() {
const sys = uni.getSystemInfoSync();
this.bgHeight = sys.windowHeight
},
onShow() {
this.checkLogin()
},
methods: {
checkLogin() {
const userId = uni.getStorageSync('userIdHj')
if (userId) {
this.isLoggedIn = true
if (this.lotteryStarted) {
this.fetchList(userId)
}
} else {
this.isLoggedIn = false
}
},
goRegister() {
uni.navigateTo({ url: '/pages/hj-register/hj-register' })
},
fetchList(userId) {
this.$u.api.getChouJiangResult({
user_id: userId,
wenjuan_id: 1007
}).then(res => {
if (res.code === 0) {
const data = res.Data || {}
this.list = data.list || data.records || data || []
if (!Array.isArray(this.list)) this.list = []
} else {
uni.showToast({ title: res.msg || '加载失败', icon: 'none' })
}
}).catch(() => {
uni.showToast({ title: '网络异常', icon: 'none' })
})
},
isEnded(item) {
return String(item.status_desc || '').indexOf('已结束') > -1
},
showWinList(item) {
this.winList = []
this.showWinModal = true
this.$u.api.getWenjuanWinDetailList({
wenjuan_id: 1007,
period: item.index
}).then(res => {
if (res.code === 0) {
this.winList = Array.isArray(res.Data) ? res.Data : []
} else {
uni.showToast({ title: res.msg || '加载失败', icon: 'none' })
}
}).catch(() => {
uni.showToast({ title: '网络异常', icon: 'none' })
})
},
closeWinModal() {
this.showWinModal = false
}
}
}
</script>
<style lang="scss">
page {
background-color: #B3E9F3;
}
.content {
position: relative;
display: flex;
flex-direction: column;
height: 100vh;
height: 100dvh;
overflow: hidden;
}
.page-body {
position: relative;
z-index: 1;
flex: 1;
display: flex;
flex-direction: column;
padding: 350rpx 30rpx 140rpx;
box-sizing: border-box;
overflow: hidden;
}
.login-box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
}
.login-tip {
font-size: 28rpx;
color: rgba(255,255,255,0.85);
margin-bottom: 30rpx;
}
.login-btn {
width: 400rpx;
height: 80rpx;
line-height: 80rpx;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
color: #fff;
font-size: 30rpx;
font-weight: 600;
border: none;
border-radius: 40rpx;
box-shadow: 0 4rpx 16rpx rgba(253,84,1,0.3);
}
.record-list {
flex: 1;
min-height: 0;
overflow-y: auto;
background: rgba(255,255,255,0.95);
border-radius: 20rpx;
box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
}
.record-item {
display: flex;
align-items: center;
padding: 28rpx 24rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.record-item:last-child {
border-bottom: none;
}
.record-icon {
width: 56rpx;
height: 56rpx;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-right: 16rpx;
background: #fff7e6;
border-radius: 50%;
}
.record-icon .iconfont {
font-size: 32rpx;
}
.record-info {
flex: 1;
min-width: 0;
}
.record-prize {
font-size: 28rpx;
color: #333;
font-weight: 500;
display: block;
}
.record-desc {
font-size: 22rpx;
color: #999;
margin-top: 4rpx;
display: block;
}
.record-status {
font-size: 22rpx;
color: #FD5401;
margin-top: 4rpx;
display: block;
}
.record-right {
display: flex;
flex-direction: column;
align-items: stretch;
flex-shrink: 0;
margin-left: 16rpx;
min-width: 260rpx;
}
.record-time {
font-size: 22rpx;
color: #bbb;
margin-bottom: 8rpx;
text-align: right;
width: 100%;
}
.btn-row {
display: flex;
align-items: center;
gap: 12rpx;
width: 100%;
}
.winlist-btn {
flex: 1;
height: 60rpx;
line-height: 60rpx;
background: linear-gradient(135deg, #E0B866, #F0D08A);
color: #fff;
font-size: 24rpx;
font-weight: 600;
border: none;
border-radius: 30rpx;
padding: 0 12rpx;
margin: 0;
letter-spacing: 0;
text-align: center;
}
.empty-box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 80rpx 0;
}
.empty-icon {
font-size: 80rpx;
margin-bottom: 16rpx;
}
.empty-text {
font-size: 26rpx;
color: rgba(255,255,255,0.7);
}
.modal-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0,0,0,0.5);
z-index: 100;
}
.modal {
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 600rpx;
background: #fff;
border-radius: 24rpx;
z-index: 101;
overflow: hidden;
}
.modal-header {
display: flex;
align-items: center;
justify-content: center;
padding: 30rpx 30rpx 20rpx;
position: relative;
}
.modal-title {
font-size: 32rpx;
font-weight: 700;
color: #333;
}
.modal-close {
position: absolute;
right: 30rpx;
top: 30rpx;
font-size: 28rpx;
color: #999;
padding: 8rpx;
}
.win-modal {
max-height: 80vh;
display: flex;
flex-direction: column;
}
.win-list {
flex: 1;
max-height: 60vh;
overflow-y: auto;
padding: 0 30rpx 30rpx;
}
.win-item {
display: flex;
align-items: center;
padding: 22rpx 0;
border-bottom: 1rpx solid #f0f0f0;
}
.win-item:last-child {
border-bottom: none;
}
.win-level {
width: 120rpx;
height: 44rpx;
line-height: 44rpx;
text-align: center;
border-radius: 22rpx;
font-size: 22rpx;
color: #fff;
flex-shrink: 0;
margin-right: 16rpx;
}
.win-level-1 {
background: linear-gradient(135deg, #F8D65E, #D9A400);
}
.win-level-2 {
background: linear-gradient(135deg, #F0C85A, #C9962E);
}
.win-level-3 {
background: linear-gradient(135deg, #D98E4A, #B87333);
}
.win-name {
flex: 1;
font-size: 28rpx;
color: #333;
font-weight: 500;
min-width: 0;
}
.win-phone {
font-size: 24rpx;
color: #999;
flex-shrink: 0;
margin-left: 16rpx;
}
.win-empty {
text-align: center;
font-size: 26rpx;
color: #999;
padding: 60rpx 0;
}
</style>
+19 -3
View File
@@ -6,10 +6,16 @@
<image src="https://aliyunoss.hn12301.net/learnlaw/xfhnsft.png" style="width: 702rpx;" mode="widthFix"></image>
<image src="https://aliyunoss.hn12301.net/learnlaw/xfjxz.png" style="width: 100rpx;position: absolute;top: 20rpx;right: 20rpx;" mode="widthFix"></image>
</view>
<!-- <view class="item">
<image src="https://aliyunoss.hn12301.net/learnlaw/xfhnssthjt.png" style="width: 702rpx;" mode="widthFix"></image>
<image src="https://aliyunoss.hn12301.net/learnlaw/xfjqqd.png" style="width: 100rpx;position: absolute;top: 20rpx;right: 20rpx;" mode="widthFix"></image>
<!-- <view class="item" @click="goSwIndex">
<image src="https://aliyunoss.hn12301.net/learnlaw/xfhnsswzj.png" style="width: 702rpx;" mode="widthFix"></image>
<image src="https://aliyunoss.hn12301.net/learnlaw/xfjxz.png" style="width: 100rpx;position: absolute;top: 20rpx;right: 20rpx;" mode="widthFix"></image>
</view> -->
<view class="item" @click="goHjIndex">
<image src="https://aliyunoss.hn12301.net/learnlaw/hnsthjt.png" style="width: 702rpx;" mode="widthFix"></image>
<image src="https://aliyunoss.hn12301.net/learnlaw/xfjxz.png" style="width: 100rpx;position: absolute;top: 20rpx;right: 20rpx;" mode="widthFix"></image>
</view>
<!--
<view class="item">
<image src="https://aliyunoss.hn12301.net/learnlaw/xfhnsswj.png" style="width: 702rpx;" mode="widthFix"></image>
<image src="https://aliyunoss.hn12301.net/learnlaw/xfjqqd.png" style="width: 100rpx;position: absolute;top: 20rpx;right: 20rpx;" mode="widthFix"></image>
@@ -34,6 +40,16 @@
uni.switchTab({
url: '/pages/index/index'
})
},
goSwIndex() {
uni.navigateTo({
url: '/pages/sw-index/sw-index'
})
},
goHjIndex() {
uni.navigateTo({
url: '/pages/hj-index/hj-index'
})
}
}
}
+42 -13
View File
@@ -11,6 +11,9 @@
style="width: 180rpx;position: absolute;top: 1420rpx;right: 50rpx;" mode="widthFix" @click="goStudy">
</image>
<view class="side-tab" style="top: 480rpx;" hover-class="side-tab-hover" @click="goRules">活动规则</view>
<view class="back-home" @click="goHome">
<text class="back-home-icon">‹</text>
</view>
<!-- <view style="position: absolute;top: 1210rpx;width: 300rpx;left: 225rpx;height: 80rpx;" @click="goRegister"></view> -->
<!-- <view class="side-tab" style="top: 350rpx;" hover-class="side-tab-hover" @click="goRecords">答题记录</view>
@@ -68,31 +71,36 @@
}
},
methods: {
goHome() {
uni.reLaunch({
url: '/pages/home/home'
})
},
goStudy() {
uni.navigateTo({
url: '/pages/study/preview'
})
},
initLogin() {
// if (!this.isWechatBrowser()) {
// this.block('请在微信中打开')
// return
// }
// if (this.isPcWechat()) {
// this.block('请使用手机微信打开')
// return
// }
if (!this.isWechatBrowser()) {
this.block('请在微信中打开')
return
}
if (this.isPcWechat()) {
this.block('请使用手机微信打开')
return
}
let openId = uni.getStorageSync('openIdSft')
if (openId) {
this.loginWithOpenId(openId)
return
}
const code = this.getCodeFromUrl()
// if (code) {
// this.exchangeOpenId(code)
// } else {
// this.wechatAuth()
// }
if (code) {
this.exchangeOpenId(code)
} else {
this.wechatAuth()
}
},
block(tip) {
this.blocked = true
@@ -264,6 +272,27 @@
opacity: 0.85;
}
.back-home {
position: fixed;
left: 20rpx;
top: 80rpx;
width: 64rpx;
height: 64rpx;
border-radius: 50%;
background: rgba(0, 0, 0, 0.25);
display: flex;
align-items: center;
justify-content: center;
z-index: 998;
}
.back-home-icon {
font-size: 44rpx;
color: #fff;
line-height: 1;
margin-top: -6rpx;
}
.prize-mask {
position: fixed;
top: 0;
+378
View File
@@ -0,0 +1,378 @@
<template>
<view class="content">
<view class="page-body">
<view class="loading-box" v-if="questions.length === 0 && !loadError">
<u-loading mode="circle" size="40"></u-loading>
<text class="loading-text">加载题目中...</text>
</view>
<view class="loading-box" v-if="loadError">
<text class="error-text">{{ loadError }}</text>
<button class="retry-btn" @tap="fetchQuestions">重新加载</button>
</view>
<template v-if="questions.length > 0">
<image src="https://aliyunoss.hn12301.net/learnlaw/xfswj_dtbj.jpg" mode="scaleToFill" style="width:750rpx;height:1820rpx;"></image>
<view style="position:absolute;top:200rpx;left:0;z-index:0;padding: 30rpx;" >
<view class="quiz-header">
<view class="timer-wrap">
<text class="timer-label">答题时间</text>
<text class="timer">{{ formatTime(usedSeconds) }}</text>
</view>
<text class="answered-count">已答 {{ answeredCount }} / {{ questions.length }}</text>
</view>
<view class="question-item" v-for="(q, qi) in questions" :key="q.question_id">
<view class="q-header">
<text class="q-index">{{ qi + 1 }}</text>
<text class="q-content">{{ formatContent(q.question_content) }}</text>
</view>
<view class="options">
<view
class="option"
v-for="(opt, oi) in q.answerList"
:key="opt.id"
:class="{ selected: answers[q.question_id] === oi }"
@tap="select(q.question_id, oi)"
>
<view class="option-radio" :class="{ checked: answers[q.question_id] === oi }">
<view v-if="answers[q.question_id] === oi" class="radio-dot"></view>
</view>
<text class="option-text">{{ opt.answer_content }}</text>
</view>
</view>
<view class="tips" v-if="answers[q.question_id] !== undefined">
<text class="tips-label">解析</text>
<text class="tips-text">{{ q.tips }}</text>
</view>
</view>
<button class="submit-btn" @tap="submit">提交</button>
</view>
</template>
</view>
</view>
</template>
<script>
export default {
data() {
return {
questions: [],
answers: {},
loadError: '',
startTime: 0,
usedSeconds: 0,
timer: null
}
},
computed: {
answeredCount() {
return Object.keys(this.answers).length
}
},
onLoad() {
this.fetchQuestions()
},
onUnload() {
this.stopTimer()
},
methods: {
fetchQuestions() {
this.loadError = ''
const userId = uni.getStorageSync('userIdSw')
const userPhone = uni.getStorageSync('userPhoneSw')
this.$u.api.queryWenjuanQA({
wenjuan_id: 1006,
user_id: userId,
user_phone: userPhone
}).then(res => {
if (res.code === 0 && res.Data?.wenjuanTmList) {
this.questions = res.Data.wenjuanTmList
this.startTimer()
} else {
this.loadError = res.msg || '数据异常'
}
}).catch(err => {
console.error('获取题目失败', err)
this.loadError = '网络请求失败'
})
},
startTimer() {
this.startTime = Date.now()
this.timer = setInterval(() => {
this.usedSeconds = Math.round((Date.now() - this.startTime) / 10) / 100
}, 50)
},
stopTimer() {
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
},
formatTime(sec) {
const total = Number(sec) || 0
const m = Math.floor(total / 60)
const s = total % 60
return (m < 10 ? '0' : '') + m + ':' + (s < 10 ? '0' : '') + s.toFixed(2)
},
formatContent(content) {
return (content || '').replace(/()/g, '(  )').replace(/\(\)/g, '(  )')
},
select(qId, oi) {
this.$set(this.answers, qId, oi)
},
submit() {
if (Date.now() - this.startTime < 9000) {
uni.showToast({ title: '操作繁忙,请重试', icon: 'none' })
return
}
if (this.answeredCount < this.questions.length) {
uni.showToast({ title: '还有题目未作答', icon: 'none' })
return
}
this.usedSeconds = Math.round((Date.now() - this.startTime) / 10) / 100
const userId = uni.getStorageSync('userIdSw')
const userPhone = uni.getStorageSync('userPhoneSw')
const details = this.questions.map(q => ({
question_id: q.question_id,
user_answer: q.answerList[this.answers[q.question_id]]?.answer_content || ''
}))
this.$u.api.submitQA({
user_id: userId,
user_phone: userPhone,
wenjuan_id: 1006,
use_time: this.usedSeconds,
total_question_num: this.questions.length,
channel: 1,
user_answer_details: details
}).then(res => {
if (res.code === 0) {
this.stopTimer()
uni.setStorageSync('resultDataSw', {
...res.Data,
use_time: this.usedSeconds,
total_question_num: this.questions.length
})
uni.redirectTo({ url: '/pages/sw-result/sw-result' })
} else {
uni.showToast({ title: res.msg || '提交失败', icon: 'none' })
}
}).catch(() => {
uni.showToast({ title: '网络异常', icon: 'none' })
})
}
}
}
</script>
<style lang="scss">
page {
background-color: #7CC6EB;
}
.content {
position: relative;
display: flex;
flex-direction: column;
}
.page-body {
flex: 1;
box-sizing: border-box;
display: flex;
flex-direction: column;
overflow: hidden;
}
.quiz-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
padding: 16rpx 24rpx;
background: #71BCFB66;
border-radius: 12rpx;
flex-shrink: 0;
}
.quiz-scroll {
flex: 1;
overflow: hidden;
position: relative;
}
.timer-wrap {
display: flex;
align-items: center;
gap: 10rpx;
}
.timer-label {
font-size: 24rpx;
color: rgba(255, 255, 255, 0.8);
}
.timer {
font-size: 28rpx;
color: #fff;
font-weight: 600;
}
.answered-count {
font-size: 24rpx;
color: rgba(255, 255, 255, 0.85);
}
.question-item {
background: rgba(255, 255, 255, 0.95);
border-radius: 20rpx;
padding: 32rpx 28rpx;
margin-bottom: 24rpx;
}
.q-header {
display: flex;
margin-bottom: 20rpx;
}
.q-index {
width: 44rpx;
height: 44rpx;
line-height: 44rpx;
text-align: center;
background: #FD5401;
color: #fff;
border-radius: 50%;
font-size: 24rpx;
font-weight: 600;
flex-shrink: 0;
margin-right: 16rpx;
margin-top: 4rpx;
}
.q-content {
font-size: 28rpx;
color: #333;
line-height: 1.6;
flex: 1;
}
.options {
display: flex;
flex-direction: column;
gap: 14rpx;
}
.option {
padding: 22rpx 20rpx;
display: flex;
align-items: center;
border: 2rpx solid #eee;
border-radius: 12rpx;
}
.option.selected {
border-color: #FD5401;
background: rgba(253, 84, 1, 0.05);
}
.option-radio {
width: 36rpx;
height: 36rpx;
border-radius: 50%;
border: 3rpx solid #CCC;
display: flex;
align-items: center;
justify-content: center;
margin-right: 16rpx;
flex-shrink: 0;
}
.option-radio.checked {
border-color: #FD5401;
}
.radio-dot {
width: 20rpx;
height: 20rpx;
border-radius: 50%;
background: #FD5401;
}
.option-text {
font-size: 27rpx;
color: #333;
line-height: 1.4;
}
.tips {
background: rgba(255, 247, 237, 0.95);
border-radius: 12rpx;
padding: 20rpx;
margin-top: 16rpx;
border-left: 6rpx solid #FD5401;
}
.tips-label {
font-size: 24rpx;
font-weight: 600;
color: #FD5401;
display: block;
margin-bottom: 6rpx;
}
.tips-text {
font-size: 24rpx;
color: #666;
line-height: 1.5;
}
.submit-btn {
width: 100%;
height: 88rpx;
line-height: 88rpx;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
color: #fff;
font-size: 32rpx;
font-weight: 600;
border: none;
border-radius: 44rpx;
margin: 10rpx 0 40rpx;
box-shadow: 0 4rpx 16rpx rgba(253, 84, 1, 0.3);
}
.loading-box {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.loading-text {
font-size: 28rpx;
color: #fff;
margin-top: 20rpx;
}
.error-text {
font-size: 28rpx;
color: #fff;
text-align: center;
display: block;
}
.retry-btn {
margin-top: 30rpx;
width: 240rpx;
height: 72rpx;
line-height: 72rpx;
background: rgba(255, 255, 255, 0.9);
color: #FD5401;
border: none;
border-radius: 36rpx;
font-size: 28rpx;
}
</style>
+305
View File
@@ -0,0 +1,305 @@
<template>
<view>
<image src="https://aliyunoss.hn12301.net/learnlaw/xfswj_bj1.jpg" style="width: 750rpx;" mode="widthFix"></image>
<!-- <image src="https://aliyunoss.hn12301.net/learnlaw/xfhm_ckjpxq.png"
style="width: 250rpx;position: absolute;top: 1210rpx;left: 250rpx;" mode="widthFix"
@click="showPrize = true"></image> -->
<image src="https://aliyunoss.hn12301.net/learnlaw/xfswj_dtcj.png"
style="width: 340rpx;position: absolute;top: 1250rpx;left: 25rpx;" mode="widthFix" @click="goRegister">
</image>
<image src="https://aliyunoss.hn12301.net/learnlaw/xfswj_fzxx.png"
style="width: 340rpx;position: absolute;top: 1250rpx;right: 25rpx;" mode="widthFix" @click="goStudy">
</image>
<view class="side-tab" style="top: 480rpx;" hover-class="side-tab-hover" @click="goRules">活动规则</view>
<view class="back-home" @click="goHome">
<text class="back-home-icon">‹</text>
</view>
<view class="blocked-mask" v-if="blocked">
<text class="blocked-tip">{{ blockTip }}</text>
<text class="blocked-sub">本活动仅支持手机微信访问</text>
</view>
<sw-tabbar current="index"></sw-tabbar>
<view class="prize-mask" v-if="showPrize" @click="showPrize = false"></view>
<view class="prize-popup" v-if="showPrize">
<scroll-view scroll-y class="prize-scroll">
<image src="https://aliyunoss.hn12301.net/learnlaw/xfhm_main_jp.jpg" mode="widthFix" style="width: 100%;"></image>
</scroll-view>
<view class="prize-close" @click="showPrize = false">
<text class="prize-close-text">✕</text>
</view>
</view>
</view>
</template>
<script>
import swTabbar from '@/components/sw-tabbar/sw-tabbar.vue'
const APP_ID = 'wx71c218bd9ff0e2da'
const SCOPE = 'snsapi_base'
export default {
components: {
swTabbar
},
data() {
return {
blocked: false,
blockTip: '',
showPrize: false
}
},
onLoad() {
this.initLogin()
},
onShow() {
if (this.blocked) return
const openId = uni.getStorageSync('openIdSw')
const isRegistered = uni.getStorageSync('isRegisteredSw')
const userId = uni.getStorageSync('userIdSw')
if (openId && (!isRegistered || !userId)) {
this.loginWithOpenId(openId)
}
},
methods: {
goHome() {
uni.reLaunch({
url: '/pages/home/home'
})
},
goStudy() {
uni.navigateTo({
url: '/pages/sw-study/sw-study'
})
},
initLogin() {
if (!this.isWechatBrowser()) {
this.block('请在微信中打开')
return
}
if (this.isPcWechat()) {
this.block('请使用手机微信打开')
return
}
let openId = uni.getStorageSync('openIdSw')
if (openId) {
this.loginWithOpenId(openId)
return
}
const code = this.getCodeFromUrl()
if (code) {
this.exchangeOpenId(code)
} else {
this.wechatAuth()
}
},
block(tip) {
this.blocked = true
this.blockTip = tip
},
isWechatBrowser() {
return /MicroMessenger/i.test(navigator.userAgent)
},
isPcWechat() {
return /MicroMessenger/i.test(navigator.userAgent) && /WindowsWechat|MacWechat/i.test(navigator.userAgent)
},
getCodeFromUrl() {
const match = window.location.href.match(/[?&]code=([^&#]+)/)
return match ? match[1] : null
},
cleanUrlCode() {
const cleanUrl = window.location.href.replace(/[?&]code=[^&#]*(&|#|$)/, (m, p1) => p1 === '&' ? '?' : (
p1 === '#' ? '#' : ''))
window.history.replaceState({}, '', cleanUrl)
},
wechatAuth() {
const base = window.location.href.split('#')[0].split('?')[0]
const redirectUri = encodeURIComponent(base + '#/pages/sw-index/sw-index')
const url =
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${APP_ID}&redirect_uri=${redirectUri}&response_type=code&scope=${SCOPE}&state=STATE#wechat_redirect`
window.location.href = url
},
loginWithOpenId(openId) {
this.$u.api.wxOpenidLogin({
wenjuan_id: 1006,
open_id: openId
}).then(loginRes => {
if (!loginRes.Data) {
uni.setStorageSync('isRegisteredSw', false)
return
}
if (loginRes.code === 0 && loginRes.Data?.user_name && loginRes.Data?.user_phone) {
uni.setStorageSync('isRegisteredSw', true)
uni.setStorageSync('userIdSw', loginRes.Data.user_id)
uni.setStorageSync('userNameSw', loginRes.Data.user_name)
uni.setStorageSync('userPhoneSw', loginRes.Data.user_phone)
}
}).catch(err => {
console.error('登录请求失败', err)
})
},
goRegister() {
const isRegistered = uni.getStorageSync('isRegisteredSw')
if (isRegistered) {
uni.navigateTo({
url: '/pages/sw-answer/sw-answer'
})
return
}
uni.navigateTo({
url: '/pages/sw-register/sw-register'
})
},
goRules() {
uni.navigateTo({
url: '/pages/sw-rules/sw-rules'
})
},
exchangeOpenId(code) {
this.$u.api.getWxOpenId(code).then(res => {
if (res.code !== 0 || !res.Data || !res.Data.openid) return
const openId = res.Data.openid
uni.setStorageSync('openIdSw', openId)
this.cleanUrlCode()
return this.$u.api.wxOpenidLogin({
wenjuan_id: 1006,
open_id: openId
})
}).then(loginRes => {
if (loginRes && loginRes.code === 0 && loginRes.Data && loginRes.Data.user_name && loginRes
.Data.user_phone) {
uni.setStorageSync('isRegisteredSw', true)
uni.setStorageSync('userIdSw', loginRes.Data.user_id || loginRes.Data.uesr_id)
uni.setStorageSync('userNameSw', loginRes.Data.user_name)
uni.setStorageSync('userPhoneSw', loginRes.Data.user_phone)
} else if (loginRes && !loginRes.Data) {
uni.setStorageSync('isRegisteredSw', false)
}
}).catch(err => {
console.error('请求失败', err)
})
}
}
}
</script>
<style lang="scss">
page {
background-color: #7CC6EB;
}
.blocked-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 999;
background-color: #7CC6EB;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.blocked-tip {
font-size: 36rpx;
font-weight: 600;
color: #fff;
}
.blocked-sub {
font-size: 26rpx;
color: rgba(255, 255, 255, 0.85);
margin-top: 16rpx;
}
.side-tab {
position: absolute;
right: 0;
width: 160rpx;
height: 60rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 30rpx 0 0 30rpx;
background: linear-gradient(135deg, #FD5401, #FF8A3D);
color: #fff;
font-size: 24rpx;
font-weight: 600;
letter-spacing: 2rpx;
border-left: 6rpx solid rgba(255, 255, 255, 0.65);
box-shadow: 0 6rpx 16rpx rgba(253, 84, 1, 0.35);
}
.side-tab-hover {
opacity: 0.85;
}
.back-home {
position: fixed;
left: 20rpx;
top: 80rpx;
width: 64rpx;
height: 64rpx;
border-radius: 50%;
background: rgba(0, 0, 0, 0.25);
display: flex;
align-items: center;
justify-content: center;
z-index: 998;
}
.back-home-icon {
font-size: 44rpx;
color: #fff;
line-height: 1;
margin-top: -6rpx;
}
.prize-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
z-index: 1000;
}
.prize-popup {
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 620rpx;
z-index: 1001;
display: flex;
flex-direction: column;
align-items: center;
}
.prize-scroll {
width: 620rpx;
max-height: 75vh;
background: #fff;
border-radius: 24rpx;
overflow: hidden;
}
.prize-close {
width: 64rpx;
height: 64rpx;
border-radius: 50%;
border: 2rpx solid rgba(255, 255, 255, 0.9);
display: flex;
align-items: center;
justify-content: center;
margin-top: 30rpx;
}
.prize-close-text {
font-size: 32rpx;
color: #fff;
line-height: 1;
}
</style>
+189
View File
@@ -0,0 +1,189 @@
<template>
<view class="content">
<view class="page-header">
<text class="header-back" @tap="goBack">‹</text>
<text class="header-title">用户隐私协议</text>
</view>
<scroll-view scroll-y class="doc-scroll">
<view class="doc-card">
<view class="doc-title">用户隐私协议</view>
<text class="doc-meta">主办方:湖南一二三零一文化旅游服务有限公司</text>
<text class="doc-meta">生效日期:自发布之日起</text>
<view class="sec">
<text class="sec-title">一、适用范围</text>
<text class="sec-text">本协议适用于“法润三湘·合规经营诚信纳税”全民学法答题活动税务局专区(以下简称“本活动”)过程中我们对您个人信息的收集、使用与保护。您勾选同意本协议即表示您已阅读、理解并同意本协议全部内容。</text>
</view>
<view class="sec">
<text class="sec-title">二、我们收集的信息</text>
<text class="sec-text">1. 注册信息:姓名、手机号码,用于活动参与资格确认与实名核验,短信验证码(通过阿里云短信服务发送)用于验证手机归属;</text>
<text class="sec-text">2. 微信授权信息:本活动通过微信网页授权(snsapi_base静默授权)获取您的openid,用于关联您的身份与本活动答题、中奖记录,授权范围不包含您的微信昵称、头像等信息;</text>
<text class="sec-text">3. 答题数据:答题记录、对错结果及用时,用于成绩结算与抽奖资格核验;</text>
<text class="sec-text">4. 中奖信息:参与抽奖产生的中奖记录,用于中奖公示及旅游卡电子凭证的短信发放。</text>
</view>
<view class="sec">
<text class="sec-title">三、信息的使用</text>
<text class="sec-text">1. 提供答题、抽奖资格核验及开奖抽奖服务;</text>
<text class="sec-text">2. 验证用户身份及实名信息真实性,保障活动公平,防范刷量、冒领;</text>
<text class="sec-text">3. 通过短信向您发放旅游卡电子凭证,并在中奖时与您联系;</text>
<text class="sec-text">4. 满足法律法规及主管部门的监管要求。</text>
</view>
<view class="sec">
<text class="sec-title">四、信息的存储与保护</text>
<text class="sec-text">1. 您的个人信息存储于活动服务器,接口数据采用加密方式传输,并采取访问控制等安全措施;</text>
<text class="sec-text">2. 我们不会出售您的个人信息,亦不会向与本活动无关的第三方提供;除法律法规明确要求或司法、行政机关依法要求外,任何共享均经审慎评估;</text>
<text class="sec-text">3. 活动结束后,相关数据将依法律规定予以保留或删除。</text>
</view>
<view class="sec">
<text class="sec-title">五、信息的公示</text>
<text class="sec-text">为保障抽奖活动公开透明,中奖名单等信息将依活动监管要求进行公示,公示内容将对姓名、手机号码等个人信息作脱敏处理。</text>
</view>
<view class="sec">
<text class="sec-title">六、您的权利</text>
<text class="sec-text">您可通过本协议所列联系方式向我们申请查询、更正、删除您的个人信息,或撤回您的同意。撤回同意不影响撤回前基于同意已进行的信息处理,但可能导致您无法继续参与本活动。</text>
</view>
<view class="sec">
<text class="sec-title">七、未成年人保护</text>
<text class="sec-text">本活动面向具备完全民事行为能力的成年人。未满十八周岁的未成年人请勿在本活动中提交个人信息,如需参与应取得监护人同意并在监护人陪同下进行。</text>
</view>
<view class="sec">
<text class="sec-title">八、协议更新</text>
<text class="sec-text">我们可能根据活动安排及法律法规变化适时更新本协议,更新后的协议将在活动页面公示后生效。若您继续参与活动,即表示您接受更新后的协议。</text>
</view>
<view class="sec">
<text class="sec-title">九、联系方式</text>
<text class="sec-text">如您对本协议或本活动个人信息保护事宜有任何疑问、意见或投诉,请通过以下方式联系我们:</text>
<text class="sec-text">主办方:湖南一二三零一文化旅游服务有限公司</text>
<text class="sec-text">联系电话:0731-88912301</text>
</view>
<view style="height: 40rpx;"></view>
</view>
</scroll-view>
<view class="page-footer">
<button class="agree-btn" @tap="agreeAndBack">已阅读并同意</button>
</view>
</view>
</template>
<script>
export default {
methods: {
goBack() {
uni.navigateBack()
},
agreeAndBack() {
const pages = getCurrentPages()
const prev = pages[pages.length - 2]
if (prev && prev.$vm) prev.$vm.agreed = true
uni.navigateBack()
}
}
}
</script>
<style lang="scss">
page {
background-color: #F5F5F5;
}
.content {
position: relative;
display: flex;
flex-direction: column;
height: 100vh;
height: 100dvh;
}
.page-header {
display: flex;
align-items: center;
padding: 20rpx 30rpx;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
flex-shrink: 0;
}
.header-back {
font-size: 48rpx;
color: #fff;
line-height: 1;
margin-right: 16rpx;
padding: 0 10rpx;
}
.header-title {
font-size: 30rpx;
font-weight: 600;
color: #fff;
flex: 1;
}
.doc-scroll {
flex: 1;
overflow: hidden;
padding-bottom: 20rpx;
}
.doc-card {
background: #fff;
margin: 24rpx;
border-radius: 20rpx;
padding: 36rpx 30rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
}
.doc-title {
font-size: 36rpx;
font-weight: 700;
color: #333;
text-align: center;
margin-bottom: 16rpx;
}
.doc-meta {
display: block;
font-size: 22rpx;
color: #999;
text-align: center;
line-height: 1.8;
}
.sec {
margin-top: 30rpx;
}
.sec-title {
display: block;
font-size: 28rpx;
font-weight: 700;
color: #FD5401;
margin-bottom: 10rpx;
}
.sec-text {
display: block;
font-size: 26rpx;
color: #555;
line-height: 1.7;
margin-bottom: 6rpx;
}
.page-footer {
flex-shrink: 0;
padding: 20rpx 30rpx 40rpx;
background: #fff;
border-top: 1rpx solid #f0f0f0;
}
.agree-btn {
width: 100%;
height: 88rpx;
line-height: 88rpx;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
color: #fff;
font-size: 32rpx;
font-weight: 600;
border: none;
border-radius: 44rpx;
box-shadow: 0 4rpx 16rpx rgba(253, 84, 1, 0.3);
}
</style>
+223
View File
@@ -0,0 +1,223 @@
<template>
<view class="content">
<view class="page-bg" :style="{ position: 'absolute', top: 0, left: 0, width: '750rpx', height: bgHeight + 'px', backgroundImage: 'url(https://aliyunoss.hn12301.net/learnlaw/xfswj_dtbj.jpg)', backgroundSize: 'cover', backgroundPosition: 'top center', backgroundRepeat: 'no-repeat', zIndex: 0 }"></view>
<view class="page-body">
<view class="login-box" v-if="!isLoggedIn">
<text class="login-tip">注册后享受更多功能</text>
<button class="login-btn" @tap="goRegister">立即注册</button>
</view>
<template v-if="isLoggedIn">
<view class="user-card">
<view class="user-avatar">
<text class="avatar-text">{{ userName.charAt(0) }}</text>
</view>
<view class="user-info">
<text class="user-name">{{ userName }}</text>
<text class="user-phone">{{ maskedPhone }}</text>
</view>
</view>
<view class="menu-list">
<view class="menu-item" @tap="goAnswerRecords">
<view class="menu-icon menu-icon-record">
<text>📝</text>
</view>
<text class="menu-text">答题记录</text>
<text class="menu-arrow">›</text>
</view>
</view>
</template>
</view>
<sw-tabbar current="profile"></sw-tabbar>
</view>
</template>
<script>
import swTabbar from '@/components/sw-tabbar/sw-tabbar.vue'
export default {
components: {
swTabbar
},
data() {
return {
isLoggedIn: false,
userName: '',
userPhone: '',
bgHeight: 0
}
},
computed: {
maskedPhone() {
const p = this.userPhone
if (!p || p.length < 7) return p
return p.slice(0, 3) + '****' + p.slice(-4)
}
},
onLoad() {
const sys = uni.getSystemInfoSync();
this.bgHeight = sys.windowHeight
},
onShow() {
this.checkLogin()
},
methods: {
checkLogin() {
const userId = uni.getStorageSync('userIdSw')
if (userId) {
this.isLoggedIn = true
this.userName = uni.getStorageSync('userNameSw') || ''
this.userPhone = uni.getStorageSync('userPhoneSw') || ''
} else {
this.isLoggedIn = false
}
},
goRegister() {
uni.navigateTo({ url: '/pages/sw-register/sw-register' })
},
goAnswerRecords() {
uni.navigateTo({ url: '/pages/sw-records/sw-records' })
}
}
}
</script>
<style lang="scss">
page {
background-color: #B3E9F3;
}
.content {
position: relative;
display: flex;
flex-direction: column;
}
.page-body {
position: relative;
z-index: 1;
flex: 1;
padding: 260rpx 30rpx 140rpx;
box-sizing: border-box;
}
.login-box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
}
.login-tip {
font-size: 28rpx;
color: rgba(255,255,255,0.85);
margin-bottom: 30rpx;
}
.login-btn {
width: 400rpx;
height: 80rpx;
line-height: 80rpx;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
color: #fff;
font-size: 30rpx;
font-weight: 600;
border: none;
border-radius: 40rpx;
box-shadow: 0 4rpx 16rpx rgba(253,84,1,0.3);
}
.user-card {
background: rgba(255,255,255,0.95);
border-radius: 20rpx;
padding: 36rpx 30rpx;
display: flex;
align-items: center;
margin-bottom: 24rpx;
box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
}
.user-avatar {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-right: 24rpx;
}
.avatar-text {
font-size: 32rpx;
font-weight: 700;
color: #fff;
}
.user-info {
flex: 1;
min-width: 0;
}
.user-name {
font-size: 30rpx;
font-weight: 600;
color: #333;
display: block;
}
.user-phone {
font-size: 24rpx;
color: #999;
margin-top: 6rpx;
display: block;
}
.menu-list {
background: rgba(255,255,255,0.95);
border-radius: 20rpx;
overflow: hidden;
box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
}
.menu-item {
display: flex;
align-items: center;
padding: 30rpx 28rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.menu-item:last-child {
border-bottom: none;
}
.menu-icon {
width: 52rpx;
height: 52rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-right: 20rpx;
font-size: 28rpx;
}
.menu-icon-record {
background: #f6ffed;
}
.menu-text {
flex: 1;
font-size: 28rpx;
color: #333;
font-weight: 500;
}
.menu-arrow {
font-size: 36rpx;
color: #ccc;
flex-shrink: 0;
}
</style>
+225
View File
@@ -0,0 +1,225 @@
<template>
<view class="content">
<view class="page-body">
<view class="loading-box" v-if="detailList.length === 0 && !loadError">
<u-loading mode="circle" size="40"></u-loading>
<text class="loading-text">加载中...</text>
</view>
<view class="loading-box" v-if="loadError">
<text class="error-text">{{ loadError }}</text>
<button class="retry-btn" @tap="fetchDetail">重新加载</button>
</view>
<template v-if="detailList.length > 0">
<view class="detail-item" v-for="(item, i) in detailList" :key="item.id">
<view class="detail-index" :class="item.is_correct ? 'correct' : 'wrong'">
<text class="detail-index-text">{{ i + 1 }}</text>
</view>
<view class="detail-body">
<text class="detail-q">{{ item.tiku_question_content }}</text>
<view class="detail-answer-row">
<text class="detail-label">你的答案:</text>
<text class="detail-value" :class="item.is_correct ? 'text-correct' : 'text-wrong'">{{ item.user_answer }}</text>
</view>
<view class="detail-answer-row" v-if="!item.is_correct">
<text class="detail-label">正确答案:</text>
<text class="detail-value text-correct-answer">{{ item.tiku_correct_answer }}</text>
</view>
<view class="tips" v-if="item.tips">
<text class="tips-label">解析</text>
<text class="tips-text">{{ item.tips }}</text>
</view>
</view>
</view>
</template>
</view>
</view>
</template>
<script>
export default {
data() {
return {
resultId: 0,
detailList: [],
loadError: ''
}
},
onLoad(options) {
this.resultId = options.resultId
this.fetchDetail()
},
methods: {
fetchDetail() {
this.loadError = ''
this.$u.api.getUserHisResultDetail({
resultId: this.resultId,
__sw: true
}).then(res => {
if (res.code === 0 && Array.isArray(res.Data) && res.Data.length) {
this.detailList = res.Data
} else {
this.loadError = res.msg || '数据异常'
}
}).catch(err => {
console.error('获取答题详情失败', err)
this.loadError = '网络请求失败'
})
}
}
}
</script>
<style lang="scss">
page {
background-color: #7CC6EB;
}
.content {
position: relative;
height: 100vh;
height: 100dvh;
}
.page-body {
position: relative;
z-index: 1;
height: 100%;
padding: 40rpx 30rpx;
box-sizing: border-box;
overflow-y: auto;
}
.detail-item {
background: rgba(255,255,255,0.95);
border-radius: 20rpx;
padding: 28rpx;
margin-bottom: 20rpx;
display: flex;
box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
}
.detail-index {
width: 44rpx;
height: 44rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-right: 16rpx;
margin-top: 2rpx;
}
.detail-index.correct {
background: linear-gradient(135deg, #52c41a, #73d13d);
box-shadow: 0 2rpx 8rpx rgba(82,196,26,0.3);
}
.detail-index.wrong {
background: linear-gradient(135deg, #f5222d, #ff4d4f);
box-shadow: 0 2rpx 8rpx rgba(245,34,45,0.3);
}
.detail-index-text {
font-size: 20rpx;
font-weight: 700;
color: #fff;
}
.detail-body {
flex: 1;
min-width: 0;
}
.detail-q {
font-size: 26rpx;
color: #333;
line-height: 1.5;
display: block;
margin-bottom: 10rpx;
}
.detail-answer-row {
display: flex;
align-items: baseline;
margin-top: 4rpx;
}
.detail-label {
font-size: 22rpx;
color: #999;
flex-shrink: 0;
}
.detail-value {
font-size: 24rpx;
font-weight: 500;
}
.text-correct {
color: #52c41a;
}
.text-wrong {
color: #f5222d;
}
.text-correct-answer {
color: #52c41a;
}
.tips {
background: rgba(255, 247, 237, 0.95);
border-radius: 12rpx;
padding: 20rpx;
margin-top: 16rpx;
border-left: 6rpx solid #FD5401;
}
.tips-label {
font-size: 24rpx;
font-weight: 600;
color: #FD5401;
display: block;
margin-bottom: 6rpx;
}
.tips-text {
font-size: 24rpx;
color: #666;
line-height: 1.5;
}
.loading-box {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.loading-text {
font-size: 28rpx;
color: #fff;
margin-top: 20rpx;
}
.error-text {
font-size: 28rpx;
color: #fff;
text-align: center;
display: block;
}
.retry-btn {
margin-top: 30rpx;
width: 240rpx;
height: 72rpx;
line-height: 72rpx;
background: rgba(255, 255, 255, 0.9);
color: #FD5401;
border: none;
border-radius: 36rpx;
font-size: 28rpx;
}
</style>
+192
View File
@@ -0,0 +1,192 @@
<template>
<view class="content">
<view class="page-body">
<view class="loading-box" v-if="records.length === 0 && !loadError">
<u-loading mode="circle" size="40"></u-loading>
<text class="loading-text">加载中...</text>
</view>
<view class="loading-box" v-if="loadError">
<text class="error-text">{{ loadError }}</text>
<button class="retry-btn" @tap="fetchRecords">重新加载</button>
</view>
<template v-if="records.length > 0">
<view class="record-item" v-for="(item, i) in records" :key="item.id" @click="goDetail(item)">
<view class="record-index">
<text class="record-index-text">{{ i + 1 }}</text>
</view>
<view class="record-body">
<view class="record-row">
<text class="record-label">答题时间:</text>
<text class="record-value">{{ item.create_time }}</text>
</view>
<view class="record-row">
<text class="record-label">答对题数:</text>
<text class="record-value">{{ item.correct_question_num }} / {{ item.total_question_num }} 题</text>
</view>
<view class="record-row">
<text class="record-label">答题用时:</text>
<text class="record-value">{{ formatTime(item.use_time) }}</text>
</view>
</view>
</view>
</template>
</view>
</view>
</template>
<script>
export default {
data() {
return {
records: [],
loadError: ''
}
},
onLoad() {
this.fetchRecords()
},
methods: {
fetchRecords() {
this.loadError = ''
const userId = uni.getStorageSync('userIdSw')
if (!userId) {
this.loadError = '暂未登录'
return
}
this.$u.api.getUserHisResultList({
wenjuanId: 1006,
userId: userId
}).then(res => {
if (res.code === 0 && res.Data?.result_list) {
this.records = res.Data.result_list
} else {
this.loadError = res.msg || '数据异常'
}
}).catch(err => {
console.error('获取答题记录失败', err)
this.loadError = '网络请求失败'
})
},
formatTime(sec) {
const m = Math.floor(sec / 60)
const s = sec % 60
return (m < 10 ? '0' : '') + m + ':' + (s < 10 ? '0' : '') + s
},
goDetail(item) {
uni.navigateTo({
url: '/pages/sw-record-detail/sw-record-detail?resultId=' + item.id
})
}
}
}
</script>
<style lang="scss">
page {
background-color: #7CC6EB;
}
.content {
position: relative;
height: 100vh;
height: 100dvh;
}
.page-body {
position: relative;
z-index: 1;
height: 100%;
padding: 40rpx 30rpx;
box-sizing: border-box;
overflow-y: auto;
}
.record-item {
background: rgba(255,255,255,0.95);
border-radius: 20rpx;
padding: 28rpx;
margin-bottom: 20rpx;
display: flex;
box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
}
.record-index {
width: 44rpx;
height: 44rpx;
border-radius: 50%;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-right: 16rpx;
margin-top: 2rpx;
box-shadow: 0 2rpx 8rpx rgba(253,84,1,0.3);
}
.record-index-text {
font-size: 20rpx;
font-weight: 700;
color: #fff;
}
.record-body {
flex: 1;
min-width: 0;
}
.record-row {
display: flex;
align-items: baseline;
margin-top: 6rpx;
}
.record-row:first-child {
margin-top: 0;
}
.record-label {
font-size: 24rpx;
color: #999;
flex-shrink: 0;
}
.record-value {
font-size: 26rpx;
color: #333;
font-weight: 500;
}
.loading-box {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.loading-text {
font-size: 28rpx;
color: #fff;
margin-top: 20rpx;
}
.error-text {
font-size: 28rpx;
color: #fff;
text-align: center;
display: block;
}
.retry-btn {
margin-top: 30rpx;
width: 240rpx;
height: 72rpx;
line-height: 72rpx;
background: rgba(255, 255, 255, 0.9);
color: #FD5401;
border: none;
border-radius: 36rpx;
font-size: 28rpx;
}
</style>
+340
View File
@@ -0,0 +1,340 @@
<template>
<view class="register-page">
<view class="header">
<text class="header-title">注册信息</text>
<text class="header-desc">填写资料即可参与答题抽奖</text>
</view>
<view class="form">
<view class="field">
<text class="label">姓名</text>
<view class="input-wrap">
<text class="input-icon">👤</text>
<input class="input" v-model="userName" placeholder="请输入您的姓名" />
</view>
<text class="name-tip">本次活动实行实名制管理,参与抽奖活动须如实填报本人姓名与手机号码,中奖后根据预留信息发货。</text>
</view>
<view class="field">
<text class="label">手机号</text>
<view class="input-wrap">
<text class="input-icon">📱</text>
<input class="input" v-model="phone" placeholder="请输入手机号" type="number" maxlength="11" />
</view>
</view>
<view class="field">
<text class="label">验证码</text>
<view class="field-row">
<view class="input-wrap code-input-wrap">
<text class="input-icon">✉️</text>
<input class="input" v-model="smsCode" placeholder="请输入验证码" type="number" maxlength="6" />
</view>
<button class="code-btn" @tap="sendCode" :disabled="sending" :class="{ disabled: sending }">
{{ sending ? countdown + 's' : '获取验证码' }}
</button>
</view>
</view>
<view class="agree-row" @tap="agreed = !agreed">
<view class="agree-checkbox" :class="{ checked: agreed }">
<text v-if="agreed" class="agree-check-mark">✓</text>
</view>
<view class="agree-text">
<text>我已阅读并同意</text>
<text class="agree-link" @tap.stop="goPrivacy">《用户隐私协议》</text>
</view>
</view>
<button class="submit-btn" @tap="register" :disabled="submitting" :class="{ disabled: submitting }">
{{ submitting ? '提交中...' : '立即注册' }}
</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
userName: '',
phone: '',
smsCode: '',
sending: false,
countdown: 60,
timer: null,
submitting: false,
agreed: false
}
},
methods: {
goPrivacy() {
uni.navigateTo({ url: '/pages/sw-privacy/sw-privacy' })
},
sendCode() {
if (!/^1\d{10}$/.test(this.phone)) {
uni.showToast({ title: '请输入正确手机号', icon: 'none' })
return
}
this.sending = true
this.$u.api.sendSms(this.phone).then(res => {
if (res.code === 0) {
uni.showToast({ title: '验证码已发送', icon: 'none' })
this.startCountdown()
} else {
uni.showToast({ title: res.msg || '发送失败', icon: 'none' })
this.sending = false
}
}).catch(() => {
uni.showToast({ title: '网络错误', icon: 'none' })
this.sending = false
})
},
startCountdown() {
this.countdown = 60
this.timer = setInterval(() => {
this.countdown--
if (this.countdown <= 0) {
clearInterval(this.timer)
this.timer = null
this.sending = false
}
}, 1000)
},
register() {
if (!this.userName || !this.phone || !this.smsCode) {
uni.showToast({ title: '请填写完整信息', icon: 'none' })
return
}
if (!this.agreed) {
uni.showToast({ title: '请阅读并同意《用户隐私协议》', icon: 'none' })
return
}
this.submitting = true
const openId = uni.getStorageSync('openIdSw')
this.$u.api.userRegist({
wenjuan_id: 1006,
open_id: openId,
user_name: this.userName,
user_phone: this.phone,
sms_code: this.smsCode,
channel: 1
}).then(res => {
if (res.code === 0) {
uni.setStorageSync('isRegisteredSw', true)
const data = res.Data || {}
const userId = data.user_id || data.uesr_id
if (userId) uni.setStorageSync('userIdSw', userId)
if (data.user_name) uni.setStorageSync('userNameSw', data.user_name)
if (data.user_phone) uni.setStorageSync('userPhoneSw', data.user_phone)
this.syncUserInfo(openId)
uni.showToast({ title: '注册成功' })
setTimeout(() => uni.navigateBack(), 1500)
} else {
uni.showToast({ title: res.msg || '注册失败', icon: 'none' })
}
}).catch(() => {
uni.showToast({ title: '网络错误', icon: 'none' })
}).finally(() => {
this.submitting = false
})
},
syncUserInfo(openId) {
this.$u.api.wxOpenidLogin({ wenjuan_id: 1006, open_id: openId }).then(loginRes => {
if (loginRes.code === 0 && loginRes.Data) {
const data = loginRes.Data
if (data.user_id || data.uesr_id) uni.setStorageSync('userIdSw', data.user_id || data.uesr_id)
if (data.user_name) uni.setStorageSync('userNameSw', data.user_name)
if (data.user_phone) uni.setStorageSync('userPhoneSw', data.user_phone)
}
}).catch(err => {
console.error('注册后同步用户信息失败', err)
})
},
},
beforeDestroy() {
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
}
}
</script>
<style>
page {
background: linear-gradient(135deg, #FFF8ED 0%, #FFE9C4 100%);
}
.register-page {
padding: 60rpx 40rpx;
min-height: 100vh;
box-sizing: border-box;
}
.header {
margin-bottom: 50rpx;
text-align: center;
}
.header-title {
font-size: 40rpx;
font-weight: bold;
color: #5D533D;
display: block;
margin-bottom: 12rpx;
}
.header-desc {
font-size: 26rpx;
color: #8B7355;
}
.form {
background: rgba(255, 255, 255, 0.95);
border-radius: 24rpx;
padding: 50rpx 40rpx;
box-shadow: 0 8rpx 40rpx rgba(0, 0, 0, 0.06);
}
.field {
margin-bottom: 36rpx;
}
.label {
font-size: 28rpx;
font-weight: 500;
color: #5D533D;
margin-bottom: 16rpx;
display: block;
padding-left: 8rpx;
}
.input-wrap {
display: flex;
align-items: center;
height: 88rpx;
border: 2rpx solid #F0E4D0;
border-radius: 12rpx;
background: #FEFCF8;
padding: 0 24rpx;
box-sizing: border-box;
}
.input-wrap:focus-within {
border-color: #FD5401;
box-shadow: 0 0 0 4rpx rgba(253, 84, 1, 0.08);
}
.input-icon {
font-size: 32rpx;
margin-right: 16rpx;
flex-shrink: 0;
}
.input {
height: 100%;
font-size: 28rpx;
color: #333;
flex: 1;
border: none;
background: transparent;
outline: none;
width: 100%;
box-sizing: border-box;
}
.name-tip {
display: block;
font-size: 22rpx;
color: #E4393C;
line-height: 1.5;
margin-top: 12rpx;
padding: 12rpx 16rpx;
background: #FFEFE9;
border-radius: 12rpx;
}
.field-row {
display: flex;
align-items: center;
}
.code-input-wrap {
flex: 1;
margin-right: 20rpx;
}
.code-btn {
flex-shrink: 0;
height: 88rpx;
line-height: 88rpx;
padding: 0 28rpx;
font-size: 26rpx;
color: #FD5401;
background: #FFF0E6;
border: none;
border-radius: 12rpx;
font-weight: 500;
}
.code-btn.disabled {
color: #B8A898;
background: #F0E8E0;
}
.submit-btn {
width: 100%;
height: 96rpx;
line-height: 96rpx;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
color: #fff;
font-size: 34rpx;
font-weight: 600;
border: none;
border-radius: 16rpx;
margin-top: 20rpx;
box-shadow: 0 6rpx 20rpx rgba(253, 84, 1, 0.3);
}
.submit-btn.disabled {
opacity: 0.5;
}
.agree-row {
display: flex;
align-items: center;
margin: -16rpx 8rpx 28rpx;
}
.agree-checkbox {
width: 36rpx;
height: 36rpx;
border: 2rpx solid #CCC;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-right: 12rpx;
box-sizing: border-box;
}
.agree-checkbox.checked {
border-color: #FD5401;
background: #FD5401;
}
.agree-check-mark {
font-size: 22rpx;
color: #fff;
font-weight: 700;
line-height: 1;
}
.agree-text {
display: flex;
align-items: center;
font-size: 24rpx;
color: #8B7355;
}
.agree-link {
color: #FD5401;
}
</style>
+236
View File
@@ -0,0 +1,236 @@
<template>
<view class="content">
<image src="https://aliyunoss.hn12301.net/learnlaw/xfswj_dtbj.jpg" mode="scaleToFill" style="width:750rpx;height:1820rpx;position:absolute;top:0;left:0;z-index:0;"></image>
<view class="page-body">
<view class="correct-card">
<text class="correct-label">答对题数</text>
<text class="correct-num">{{ correctCount }} <text class="correct-total">/ {{ detailList.length }}</text></text>
</view>
<view class="detail-section">
<view class="section-header">
<text class="section-title">答题详情</text>
<text class="section-subtitle">共 {{ detailList.length }} 题,{{ correctCount }} 对 {{ wrongCount }} 错</text>
</view>
<view class="detail-item" v-for="(item, i) in detailList" :key="i">
<view class="detail-index" :class="item.is_correct || item.status === 1 ? 'correct' : 'wrong'">
<text class="detail-index-text">{{ i + 1 }}</text>
</view>
<view class="detail-body">
<text class="detail-q">{{ item.tiku_question_content || '题目' + (i+1) }}</text>
<view class="detail-answer-row">
<text class="detail-label">你的答案:</text>
<text class="detail-value" :class="item.is_correct || item.status === 1 ? 'text-correct' : 'text-wrong'">{{ item.user_answer || '未作答' }}</text>
</view>
<view class="detail-answer-row" v-if="!(item.is_correct || item.status === 1)">
<text class="detail-label">正确答案:</text>
<text class="detail-value text-correct-answer">{{ item.tiku_correct_answer || '-' }}</text>
</view>
</view>
</view>
</view>
<button class="back-btn" @tap="goBack">返回首页</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
correctCount: 0,
wrongCount: 0,
detailList: []
}
},
onLoad() {
try {
const data = uni.getStorageSync('resultDataSw') || {}
if (data.resultDetailList && data.resultDetailList.length) {
this.detailList = data.resultDetailList
this.correctCount = data.resultDetailList.filter(r => r.is_correct === true || r.is_correct === 1 || r.status === 1).length
this.wrongCount = data.resultDetailList.length - this.correctCount
}
} catch(e) {
console.error('解析结果数据失败', e)
}
},
methods: {
goBack() {
uni.reLaunch({ url: '/pages/sw-index/sw-index' })
}
}
}
</script>
<style lang="scss">
page {
background-color: #7CC6EB;
}
.content {
position: relative;
height: 100vh;
height: 100dvh;
}
.page-body {
position: relative;
z-index: 1;
height: 100%;
padding: 120rpx 30rpx;
box-sizing: border-box;
}
.correct-card {
background: linear-gradient(135deg, #FD5401, #FF7A3D);
border-radius: 20rpx;
padding: 28rpx 24rpx;
text-align: center;
margin-bottom: 20rpx;
box-shadow: 0 4rpx 20rpx rgba(253, 84, 1, 0.2);
}
.correct-label {
font-size: 24rpx;
color: rgba(255,255,255,0.85);
display: block;
}
.correct-num {
font-size: 72rpx;
font-weight: 800;
color: #FFF;
display: block;
line-height: 1.2;
margin-top: 6rpx;
}
.correct-total {
font-size: 32rpx;
font-weight: 500;
color: rgba(255,255,255,0.8);
}
.detail-section {
background: rgba(255,255,255,0.95);
border-radius: 20rpx;
padding: 28rpx;
margin-bottom: 30rpx;
box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
}
.section-header {
display: flex;
justify-content: space-between;
align-items: baseline;
margin-bottom: 20rpx;
padding-bottom: 16rpx;
border-bottom: 2rpx solid #f5f5f5;
}
.section-title {
font-size: 30rpx;
font-weight: 700;
color: #333;
}
.section-subtitle {
font-size: 24rpx;
color: #bbb;
}
.detail-item {
padding: 20rpx 0;
border-bottom: 1rpx solid #f0f0f0;
display: flex;
}
.detail-item:last-child {
border-bottom: none;
}
.detail-index {
width: 44rpx;
height: 44rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-right: 16rpx;
margin-top: 2rpx;
}
.detail-index.correct {
background: linear-gradient(135deg, #52c41a, #73d13d);
box-shadow: 0 2rpx 8rpx rgba(82,196,26,0.3);
}
.detail-index.wrong {
background: linear-gradient(135deg, #f5222d, #ff4d4f);
box-shadow: 0 2rpx 8rpx rgba(245,34,45,0.3);
}
.detail-index-text {
font-size: 20rpx;
font-weight: 700;
color: #fff;
}
.detail-body {
flex: 1;
min-width: 0;
}
.detail-q {
font-size: 26rpx;
color: #333;
line-height: 1.5;
display: block;
margin-bottom: 10rpx;
}
.detail-answer-row {
display: flex;
align-items: baseline;
margin-top: 4rpx;
}
.detail-label {
font-size: 22rpx;
color: #999;
flex-shrink: 0;
}
.detail-value {
font-size: 24rpx;
font-weight: 500;
}
.text-correct {
color: #52c41a;
}
.text-wrong {
color: #f5222d;
}
.text-correct-answer {
color: #52c41a;
}
.back-btn {
width: 690rpx;
height: 88rpx;
line-height: 88rpx;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
color: #fff;
font-size: 32rpx;
font-weight: 600;
border: none;
border-radius: 44rpx;
box-shadow: 0 4rpx 16rpx rgba(253,84,1,0.3);
}
</style>
+215
View File
@@ -0,0 +1,215 @@
<template>
<view class="content">
<view class="page-header">
<text class="header-back" @tap="goBack">‹</text>
<text class="header-title">活动规则</text>
</view>
<scroll-view scroll-y class="doc-scroll">
<view class="doc-card">
<view class="doc-title">“法润三湘·合规经营诚信纳税”活动规则</view>
<view class="sec">
<text class="sec-title">一、活动主题</text>
<text class="sec-text">法润三湘·合规经营诚信纳税</text>
</view>
<view class="sec">
<text class="sec-title">二、活动时间</text>
<text class="sec-text">1. 线上答题时间:2026年11月10日10:00—11月26日16:00;</text>
<text class="sec-text">2. 公证抽奖时间:共设8轮抽奖,抽奖日期分别为11月16日、19日、23日、26日;每个抽奖日期开展2轮抽取,每周一、四16:00,由长沙市长沙公证处全程监督公证开奖。</text>
</view>
<view class="sec">
<text class="sec-title">三、参与方式</text>
<text class="sec-text">1. 关注【湖南税务服务】或【湖南普法】微信公众号,进入“法润三湘”全民学法答题活动页面,点击对应专场答题互动界面开启普法答题;</text>
<text class="sec-text">2. 答题环节由系统从题库中随机抽取题目组卷供参与者作答,涵盖判断题、单项选择题两类题型。参与者完成全部题目作答且答案全部正确的,即可获得当轮抽奖参与资格。答题活动每日面向参与者开放,支持不限答题次数重复参与,每轮答题全部答对即可获取对应当期的抽奖参与机会。</text>
</view>
<view class="sec">
<text class="sec-title">四、奖项设置</text>
<view class="prize-table">
<view class="prize-tr prize-th">
<text class="prize-td">奖项</text>
<text class="prize-td">奖品</text>
<text class="prize-td">每轮数量</text>
<text class="prize-td">总数量</text>
</view>
<view class="prize-tr">
<text class="prize-td">一等奖</text>
<text class="prize-td">长株潭文旅消费一卡通1张</text>
<text class="prize-td">5名</text>
<text class="prize-td">40份</text>
</view>
<view class="prize-tr">
<text class="prize-td">二等奖</text>
<text class="prize-td">湖南地州市系列旅游卡1张(任选一地州市)</text>
<text class="prize-td">10名</text>
<text class="prize-td">80份</text>
</view>
<view class="prize-tr">
<text class="prize-td">三等奖</text>
<text class="prize-td">湖南景区门票1张(14个地州市合作景区任选其一)</text>
<text class="prize-td">80名</text>
<text class="prize-td">640份</text>
</view>
</view>
</view>
<view class="sec">
<text class="sec-title">五、开奖与中奖公示</text>
<text class="sec-text">1. 每轮开奖由长沙市长沙公证处全程监督公证,保证抽奖公平公正;</text>
<text class="sec-text">2. 每轮中奖名单将同步在活动页面进行公示,请广大参与者及时查看;</text>
<text class="sec-text">3. 中奖用户请在活动专区提交准确信息(姓名、联系电话),信息填写有误将影响奖品发放。</text>
</view>
<view class="sec">
<text class="sec-title">六、奖品发放说明</text>
<text class="sec-text">此专区活动所有奖品均为旅游卡电子凭证,请您留意短信,及时查收电子旅游卡。</text>
</view>
<view class="sec">
<text class="sec-title">七、注意事项</text>
<text class="sec-text">1. 本活动面向全社会公众免费参与,严禁使用外挂、脚本等作弊手段参与答题,一经核实取消全部抽奖及中奖资格;</text>
<text class="sec-text">2. 活动咨询电话:0731-88912301(工作时间接受咨询)。</text>
<text class="sec-text footer-note">本活动最终解释权归本次“法润三湘”公益普法活动主办方所有。</text>
</view>
<view style="height: 40rpx;"></view>
</view>
</scroll-view>
</view>
</template>
<script>
export default {
methods: {
goBack() {
uni.navigateBack()
}
}
}
</script>
<style lang="scss">
page {
background-color: #F8F8F8;
}
.content {
position: relative;
display: flex;
flex-direction: column;
height: 100vh;
height: 100dvh;
}
.page-header {
display: flex;
align-items: center;
padding: 20rpx 30rpx;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
flex-shrink: 0;
}
.header-back {
font-size: 48rpx;
color: #fff;
line-height: 1;
margin-right: 16rpx;
padding: 0 10rpx;
}
.header-title {
font-size: 30rpx;
font-weight: 600;
color: #fff;
flex: 1;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.doc-scroll {
flex: 1;
overflow: hidden;
}
.doc-card {
background: #fff;
margin: 24rpx;
border-radius: 20rpx;
padding: 36rpx 30rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
}
.doc-title {
font-size: 34rpx;
font-weight: 700;
color: #333;
text-align: center;
line-height: 1.5;
margin-bottom: 20rpx;
}
.sec {
margin-top: 30rpx;
}
.sec-title {
display: block;
font-size: 28rpx;
font-weight: 700;
color: #FD5401;
margin-bottom: 10rpx;
}
.sec-text {
display: block;
font-size: 26rpx;
color: #555;
line-height: 1.7;
margin-bottom: 6rpx;
}
.footer-note {
margin-top: 16rpx;
color: #999;
font-size: 24rpx;
}
.prize-table {
border: 2rpx solid #F0E4D0;
border-radius: 12rpx;
overflow: hidden;
margin-top: 6rpx;
}
.prize-tr {
display: flex;
border-bottom: 2rpx solid #F0E4D0;
}
.prize-tr:last-child {
border-bottom: none;
}
.prize-th {
background: #FFF7ED;
}
.prize-th .prize-td {
font-weight: 700;
color: #5D533D;
}
.prize-td {
flex: 1;
font-size: 24rpx;
color: #555;
padding: 16rpx 10rpx;
text-align: center;
border-right: 2rpx solid #F0E4D0;
line-height: 1.4;
}
.prize-td:last-child {
border-right: none;
}
.prize-td:nth-child(2) {
flex: 2;
}
</style>
+245
View File
@@ -0,0 +1,245 @@
<template>
<view class="content">
<view class="page-header">
<text class="header-back" @tap="goBack">‹</text>
<text class="header-title">法治学习</text>
</view>
<view class="body">
<view class="group" v-for="(group, gi) in articles" :key="gi">
<view class="group-title">{{ group.name }}</view>
<view class="article-item" v-for="item in group.articles" :key="item.url" @tap="openArticle(item)">
<view class="article-index">
<text class="article-index-text">{{ item.no }}</text>
</view>
<text class="article-title">{{ item.title }}</text>
<text class="article-arrow">›</text>
</view>
</view>
<view class="tip-text">点击法规名称跳转至官方发布页面阅读学习</view>
<view style="height: 40rpx;"></view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
groups: [{
name: '一、税收征管类(高频)',
list: [{
title: '中华人民共和国税收征收管理法',
url: 'https://fgk.chinatax.gov.cn/zcfgk/c100009/c5195081/content.html'
},
{
title: '中华人民共和国税收征收管理法实施细则',
url: 'https://fgk.chinatax.gov.cn/zcfgk/c100010/c5195082/content.html'
}
]
},
{
name: '二、增值税',
list: [{
title: '中华人民共和国增值税法',
url: 'https://fgk.chinatax.gov.cn/zcfgk/c100009/c5237365/content.html'
},
{
title: '中华人民共和国增值税法实施条例',
url: 'https://fgk.chinatax.gov.cn/zcfgk/c100010/c5246349/content.html'
}
]
},
{
name: '三、所得税',
list: [{
title: '中华人民共和国企业所得税法',
url: 'https://fgk.chinatax.gov.cn/zcfgk/c100009/c5193018/content.html'
},
{
title: '中华人民共和国企业所得税法实施条例',
url: 'https://fgk.chinatax.gov.cn/zcfgk/c100010/c5194417/content.html'
},
{
title: '中华人民共和国个人所得税法',
url: 'https://fgk.chinatax.gov.cn/zcfgk/c100009/c5193028/content.html'
},
{
title: '中华人民共和国个人所得税法实施条例',
url: 'https://fgk.chinatax.gov.cn/zcfgk/c100010/c5194444/content.html'
}
]
},
{
name: '四、财产行为税(小税种)',
list: [{
title: '中华人民共和国印花税法',
url: 'https://fgk.chinatax.gov.cn/zcfgk/c100009/c5193058/content.html'
},
{
title: '中华人民共和国契税法',
url: 'https://fgk.chinatax.gov.cn/zcfgk/c100009/c5193053/content.html'
},
{
title: '中华人民共和国城市维护建设税法',
url: 'https://fgk.chinatax.gov.cn/zcfgk/c100009/c5193055/content.html'
},
{
title: '中华人民共和国资源税法',
url: 'https://fgk.chinatax.gov.cn/zcfgk/c100009/c5193040/content.html'
},
{
title: '中华人民共和国环境保护税法',
url: 'https://fgk.chinatax.gov.cn/zcfgk/c100009/c5193032/content.html'
},
{
title: '中华人民共和国车船税法',
url: 'https://fgk.chinatax.gov.cn/zcfgk/c100009/c5193039/content.html'
}
]
}
]
}
},
computed: {
articles() {
let no = 0
return this.groups.map(g => ({
name: g.name,
articles: g.list.map(a => Object.assign({
no: ++no
}, a))
}))
}
},
methods: {
goBack() {
const pages = getCurrentPages()
if (pages.length > 1) {
uni.navigateBack()
} else {
uni.reLaunch({ url: '/pages/sw-index/sw-index' })
}
},
openArticle(item) {
const w = window.open(item.url, '_blank')
if (!w) {
window.location.href = item.url
}
}
}
}
</script>
<style lang="scss">
page {
background-color: #F8F8F8;
overflow-x: hidden;
}
.content {
position: relative;
min-height: 100vh;
width: 100%;
max-width: 100vw;
overflow-x: hidden;
box-sizing: border-box;
}
.page-header {
position: sticky;
top: 0;
z-index: 10;
display: flex;
align-items: center;
padding: 20rpx 30rpx;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
}
.header-back {
font-size: 48rpx;
color: #fff;
line-height: 1;
margin-right: 16rpx;
padding: 0 10rpx;
}
.header-title {
font-size: 30rpx;
font-weight: 600;
color: #fff;
flex: 1;
}
.body {
width: 100%;
padding: 24rpx 30rpx;
box-sizing: border-box;
}
.group {
margin-bottom: 24rpx;
box-sizing: border-box;
}
.group-title {
font-size: 28rpx;
font-weight: 700;
color: #FD5401;
padding: 8rpx 4rpx 16rpx;
}
.article-item {
width: 100%;
max-width: 100%;
box-sizing: border-box;
background: #fff;
border-radius: 16rpx;
padding: 26rpx 24rpx;
margin-bottom: 14rpx;
display: flex;
align-items: center;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.04);
}
.article-index {
width: 44rpx;
height: 44rpx;
border-radius: 50%;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-right: 18rpx;
}
.article-index-text {
font-size: 22rpx;
font-weight: 700;
color: #fff;
}
.article-title {
flex: 1;
min-width: 0;
word-break: break-all;
font-size: 27rpx;
color: #333;
line-height: 1.4;
}
.article-arrow {
font-size: 36rpx;
color: #ccc;
flex-shrink: 0;
margin-left: 10rpx;
}
.tip-text {
font-size: 22rpx;
color: #999;
text-align: center;
margin: 6rpx 0 20rpx;
padding: 0 30rpx;
}
</style>
+423
View File
@@ -0,0 +1,423 @@
<template>
<view class="content">
<view class="page-bg" :style="{ position: 'absolute', top: 0, left: 0, width: '750rpx', height: bgHeight + 'px', backgroundImage: 'url(https://aliyunoss.hn12301.net/learnlaw/xfswj_dtbj.jpg)', backgroundSize: 'cover', backgroundPosition: 'top center', backgroundRepeat: 'no-repeat', zIndex: 0 }"></view>
<view class="page-body">
<view class="login-box" v-if="!isLoggedIn">
<text class="login-tip">注册后可查看中奖记录</text>
<button class="login-btn" @tap="goRegister">立即注册</button>
</view>
<template v-if="isLoggedIn">
<view class="record-list" v-if="list.length > 0">
<view class="record-item" v-for="(item, i) in list" :key="i">
<view class="record-icon">
<text class="iconfont">🎁</text>
</view>
<view class="record-info">
<text class="record-prize">{{ item.title }}</text>
<text class="record-desc">{{ item.is_win_pc_desc }}</text>
<text class="record-status">{{ item.status_desc }}</text>
</view>
<view class="record-right">
<text class="record-time">{{ item.time }}</text>
<view class="btn-row">
<button class="winlist-btn" v-if="isEnded(item)" @tap="showWinList(item)">中奖名单</button>
</view>
</view>
</view>
</view>
<view class="empty-box" v-if="list.length === 0">
<text class="empty-icon">🏆</text>
<text class="empty-text">暂无中奖记录</text>
</view>
</template>
</view>
<view class="modal-mask" v-if="showWinModal" @tap="closeWinModal"></view>
<view class="modal win-modal" v-if="showWinModal">
<view class="modal-header">
<text class="modal-title">中奖名单</text>
<text class="modal-close" @tap="closeWinModal">✕</text>
</view>
<view class="win-list">
<view class="win-item" v-for="(w, wi) in winList" :key="wi">
<view class="win-level" :class="'win-level-' + w.win_level">
<text>{{ w.win_level_name }}</text>
</view>
<text class="win-name">{{ w.user_name }}</text>
<text class="win-phone">{{ w.user_phone }}</text>
</view>
<view class="win-empty" v-if="winList.length === 0">
<text>暂无中奖名单</text>
</view>
</view>
</view>
<sw-tabbar current="winRecords"></sw-tabbar>
</view>
</template>
<script>
import swTabbar from '@/components/sw-tabbar/sw-tabbar.vue'
export default {
components: {
swTabbar
},
data() {
return {
isLoggedIn: false,
list: [],
showWinModal: false,
winList: [],
bgHeight: 0
}
},
onLoad() {
const sys = uni.getSystemInfoSync();
this.bgHeight = sys.windowHeight
},
onShow() {
this.checkLogin()
},
methods: {
checkLogin() {
const userId = uni.getStorageSync('userIdSw')
if (userId) {
this.isLoggedIn = true
this.fetchList(userId)
} else {
this.isLoggedIn = false
}
},
goRegister() {
uni.navigateTo({ url: '/pages/sw-register/sw-register' })
},
fetchList(userId) {
this.$u.api.getChouJiangResult({
user_id: userId,
wenjuan_id: 1006
}).then(res => {
if (res.code === 0) {
const data = res.Data || {}
this.list = data.list || data.records || data || []
if (!Array.isArray(this.list)) this.list = []
} else {
uni.showToast({ title: res.msg || '加载失败', icon: 'none' })
}
}).catch(() => {
uni.showToast({ title: '网络异常', icon: 'none' })
})
},
isEnded(item) {
return String(item.status_desc || '').indexOf('已结束') > -1
},
showWinList(item) {
this.winList = []
this.showWinModal = true
this.$u.api.getWenjuanWinDetailList({
wenjuan_id: 1006,
period: item.index
}).then(res => {
if (res.code === 0) {
this.winList = Array.isArray(res.Data) ? res.Data : []
} else {
uni.showToast({ title: res.msg || '加载失败', icon: 'none' })
}
}).catch(() => {
uni.showToast({ title: '网络异常', icon: 'none' })
})
},
closeWinModal() {
this.showWinModal = false
}
}
}
</script>
<style lang="scss">
page {
background-color: #B3E9F3;
}
.content {
position: relative;
display: flex;
flex-direction: column;
height: 100vh;
height: 100dvh;
overflow: hidden;
}
.page-body {
position: relative;
z-index: 1;
flex: 1;
display: flex;
flex-direction: column;
padding: 260rpx 30rpx 140rpx;
box-sizing: border-box;
overflow: hidden;
}
.login-box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
}
.login-tip {
font-size: 28rpx;
color: rgba(255,255,255,0.85);
margin-bottom: 30rpx;
}
.login-btn {
width: 400rpx;
height: 80rpx;
line-height: 80rpx;
background: linear-gradient(135deg, #FD5401, #FF7A3D);
color: #fff;
font-size: 30rpx;
font-weight: 600;
border: none;
border-radius: 40rpx;
box-shadow: 0 4rpx 16rpx rgba(253,84,1,0.3);
}
.record-list {
flex: 1;
min-height: 0;
overflow-y: auto;
background: rgba(255,255,255,0.95);
border-radius: 20rpx;
box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
}
.record-item {
display: flex;
align-items: center;
padding: 28rpx 24rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.record-item:last-child {
border-bottom: none;
}
.record-icon {
width: 56rpx;
height: 56rpx;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-right: 16rpx;
background: #fff7e6;
border-radius: 50%;
}
.record-icon .iconfont {
font-size: 32rpx;
}
.record-info {
flex: 1;
min-width: 0;
}
.record-prize {
font-size: 28rpx;
color: #333;
font-weight: 500;
display: block;
}
.record-desc {
font-size: 22rpx;
color: #999;
margin-top: 4rpx;
display: block;
}
.record-status {
font-size: 22rpx;
color: #FD5401;
margin-top: 4rpx;
display: block;
}
.record-right {
display: flex;
flex-direction: column;
align-items: stretch;
flex-shrink: 0;
margin-left: 16rpx;
min-width: 260rpx;
}
.record-time {
font-size: 22rpx;
color: #bbb;
margin-bottom: 8rpx;
text-align: right;
width: 100%;
}
.btn-row {
display: flex;
align-items: center;
gap: 12rpx;
width: 100%;
}
.winlist-btn {
flex: 1;
height: 60rpx;
line-height: 60rpx;
background: linear-gradient(135deg, #E0B866, #F0D08A);
color: #fff;
font-size: 24rpx;
font-weight: 600;
border: none;
border-radius: 30rpx;
padding: 0 12rpx;
margin: 0;
letter-spacing: 0;
text-align: center;
}
.empty-box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 80rpx 0;
}
.empty-icon {
font-size: 80rpx;
margin-bottom: 16rpx;
}
.empty-text {
font-size: 26rpx;
color: rgba(255,255,255,0.7);
}
.modal-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0,0,0,0.5);
z-index: 100;
}
.modal {
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 600rpx;
background: #fff;
border-radius: 24rpx;
z-index: 101;
overflow: hidden;
}
.modal-header {
display: flex;
align-items: center;
justify-content: center;
padding: 30rpx 30rpx 20rpx;
position: relative;
}
.modal-title {
font-size: 32rpx;
font-weight: 700;
color: #333;
}
.modal-close {
position: absolute;
right: 30rpx;
top: 30rpx;
font-size: 28rpx;
color: #999;
padding: 8rpx;
}
.win-modal {
max-height: 80vh;
display: flex;
flex-direction: column;
}
.win-list {
flex: 1;
max-height: 60vh;
overflow-y: auto;
padding: 0 30rpx 30rpx;
}
.win-item {
display: flex;
align-items: center;
padding: 22rpx 0;
border-bottom: 1rpx solid #f0f0f0;
}
.win-item:last-child {
border-bottom: none;
}
.win-level {
width: 120rpx;
height: 44rpx;
line-height: 44rpx;
text-align: center;
border-radius: 22rpx;
font-size: 22rpx;
color: #fff;
flex-shrink: 0;
margin-right: 16rpx;
}
.win-level-1 {
background: linear-gradient(135deg, #F8D65E, #D9A400);
}
.win-level-2 {
background: linear-gradient(135deg, #F0C85A, #C9962E);
}
.win-level-3 {
background: linear-gradient(135deg, #D98E4A, #B87333);
}
.win-name {
flex: 1;
font-size: 28rpx;
color: #333;
font-weight: 500;
min-width: 0;
}
.win-phone {
font-size: 24rpx;
color: #999;
flex-shrink: 0;
margin-left: 16rpx;
}
.win-empty {
text-align: center;
font-size: 26rpx;
color: #999;
padding: 60rpx 0;
}
</style>