feat: add configurable points rules
This commit is contained in:
@@ -25,6 +25,18 @@
|
|||||||
<editor class="mb-10" v-model="formData.privacy_content" height="500"></editor>
|
<editor class="mb-10" v-model="formData.privacy_content" height="500"></editor>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
|
<el-card class="!border-none mb-4" shadow="never">
|
||||||
|
<template #header>
|
||||||
|
<span class="font-medium">积分规则</span>
|
||||||
|
</template>
|
||||||
|
<el-form :model="formData" label-width="80px">
|
||||||
|
<el-form-item label="规则名称">
|
||||||
|
<el-input v-model="formData.points_rule_title" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<editor class="mb-10" v-model="formData.points_rule_content" height="500"></editor>
|
||||||
|
</el-card>
|
||||||
<footer-btns v-perms="['setting.web.web_setting/setAgreement']">
|
<footer-btns v-perms="['setting.web.web_setting/setAgreement']">
|
||||||
<el-button type="primary" @click="handleProtocolEdit">保存</el-button>
|
<el-button type="primary" @click="handleProtocolEdit">保存</el-button>
|
||||||
</footer-btns>
|
</footer-btns>
|
||||||
@@ -38,12 +50,16 @@ interface formDataObj {
|
|||||||
service_content: string
|
service_content: string
|
||||||
privacy_title: string
|
privacy_title: string
|
||||||
privacy_content: string
|
privacy_content: string
|
||||||
|
points_rule_title: string
|
||||||
|
points_rule_content: string
|
||||||
}
|
}
|
||||||
const formData = ref<formDataObj>({
|
const formData = ref<formDataObj>({
|
||||||
service_title: '',
|
service_title: '',
|
||||||
service_content: '',
|
service_content: '',
|
||||||
privacy_title: '',
|
privacy_title: '',
|
||||||
privacy_content: ''
|
privacy_content: '',
|
||||||
|
points_rule_title: '积分规则',
|
||||||
|
points_rule_content: ''
|
||||||
})
|
})
|
||||||
const protocolGet = async () => {
|
const protocolGet = async () => {
|
||||||
formData.value = await getProtocol()
|
formData.value = await getProtocol()
|
||||||
|
|||||||
@@ -139,10 +139,13 @@ class WebSettingLogic extends BaseLogic
|
|||||||
{
|
{
|
||||||
$serviceContent = clear_file_domain($params['service_content'] ?? '');
|
$serviceContent = clear_file_domain($params['service_content'] ?? '');
|
||||||
$privacyContent = clear_file_domain($params['privacy_content'] ?? '');
|
$privacyContent = clear_file_domain($params['privacy_content'] ?? '');
|
||||||
|
$pointsRuleContent = clear_file_domain($params['points_rule_content'] ?? '');
|
||||||
ConfigService::set('agreement', 'service_title', $params['service_title'] ?? '');
|
ConfigService::set('agreement', 'service_title', $params['service_title'] ?? '');
|
||||||
ConfigService::set('agreement', 'service_content', $serviceContent);
|
ConfigService::set('agreement', 'service_content', $serviceContent);
|
||||||
ConfigService::set('agreement', 'privacy_title', $params['privacy_title'] ?? '');
|
ConfigService::set('agreement', 'privacy_title', $params['privacy_title'] ?? '');
|
||||||
ConfigService::set('agreement', 'privacy_content', $privacyContent);
|
ConfigService::set('agreement', 'privacy_content', $privacyContent);
|
||||||
|
ConfigService::set('agreement', 'points_rule_title', $params['points_rule_title'] ?? '积分规则');
|
||||||
|
ConfigService::set('agreement', 'points_rule_content', $pointsRuleContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -159,10 +162,13 @@ class WebSettingLogic extends BaseLogic
|
|||||||
'service_content' => ConfigService::get('agreement', 'service_content'),
|
'service_content' => ConfigService::get('agreement', 'service_content'),
|
||||||
'privacy_title' => ConfigService::get('agreement', 'privacy_title'),
|
'privacy_title' => ConfigService::get('agreement', 'privacy_title'),
|
||||||
'privacy_content' => ConfigService::get('agreement', 'privacy_content'),
|
'privacy_content' => ConfigService::get('agreement', 'privacy_content'),
|
||||||
|
'points_rule_title' => ConfigService::get('agreement', 'points_rule_title', '积分规则'),
|
||||||
|
'points_rule_content' => ConfigService::get('agreement', 'points_rule_content'),
|
||||||
];
|
];
|
||||||
|
|
||||||
$config['service_content'] = get_file_domain($config['service_content']);
|
$config['service_content'] = get_file_domain($config['service_content']);
|
||||||
$config['privacy_content'] = get_file_domain($config['privacy_content']);
|
$config['privacy_content'] = get_file_domain($config['privacy_content']);
|
||||||
|
$config['points_rule_content'] = get_file_domain($config['points_rule_content']);
|
||||||
|
|
||||||
return $config;
|
return $config;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
//菜单主题类型
|
//菜单主题类型
|
||||||
export enum AgreementEnum {
|
export enum AgreementEnum {
|
||||||
PRIVACY = 'privacy',
|
PRIVACY = 'privacy',
|
||||||
SERVICE = 'service'
|
SERVICE = 'service',
|
||||||
|
POINTS_RULE = 'points_rule'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,7 +124,7 @@
|
|||||||
<text>当前余额 </text>
|
<text>当前余额 </text>
|
||||||
<text class="is-primary">{{ userPointsText }}</text>
|
<text class="is-primary">{{ userPointsText }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="detail-unlock-card__link" @tap="openPoints">
|
<view class="detail-unlock-card__link" @tap="openPointsRule">
|
||||||
<text>积分规则</text>
|
<text>积分规则</text>
|
||||||
<u-icon name="arrow-right" size="24" color="#1468f5" />
|
<u-icon name="arrow-right" size="24" color="#1468f5" />
|
||||||
</view>
|
</view>
|
||||||
@@ -257,6 +257,7 @@ import {
|
|||||||
import { openChat } from '@/api/chat'
|
import { openChat } from '@/api/chat'
|
||||||
import { useAppStore } from '@/stores/app'
|
import { useAppStore } from '@/stores/app'
|
||||||
import { useUserStore } from '@/stores/user'
|
import { useUserStore } from '@/stores/user'
|
||||||
|
import { AgreementEnum } from '@/enums/agreementEnums'
|
||||||
import { getToken } from '@/utils/auth'
|
import { getToken } from '@/utils/auth'
|
||||||
|
|
||||||
const LIUHE_TAGS = ['旧澳六合', '新澳六合']
|
const LIUHE_TAGS = ['旧澳六合', '新澳六合']
|
||||||
@@ -810,9 +811,8 @@ const handleAiAnalysisBtn = () => {
|
|||||||
uni.navigateTo({ url: `/pages/ai_analysis/ai_analysis?type=post&id=${postId.value}&title=${title}` })
|
uni.navigateTo({ url: `/pages/ai_analysis/ai_analysis?type=post&id=${postId.value}&title=${title}` })
|
||||||
}
|
}
|
||||||
|
|
||||||
const openPoints = () => {
|
const openPointsRule = () => {
|
||||||
if (!checkLogin()) return
|
uni.navigateTo({ url: `/pages/agreement/agreement?type=${AgreementEnum.POINTS_RULE}` })
|
||||||
uni.navigateTo({ url: '/packages/pages/points_log/points_log' })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const goUserProfile = (userId: number) => {
|
const goUserProfile = (userId: number) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user