✨ 关于我们:接入 100%
parent
6a19833044
commit
1bd12a1a3b
|
@ -1,31 +1,37 @@
|
|||
<!-- 文章展示 -->
|
||||
<template>
|
||||
<s-layout class="set-wrap" :title="state.title" :bgStyle="{ color: '#FFF' }">
|
||||
<view class="ss-p-30"><mp-html class="richtext" :content="state.content"></mp-html></view>
|
||||
<view class="ss-p-30">
|
||||
<mp-html class="richtext" :content="state.content" />
|
||||
</view>
|
||||
</s-layout>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { reactive } from 'vue';
|
||||
import sheep from '@/sheep';
|
||||
import ArticleApi from '@/sheep/api/promotion/article';
|
||||
|
||||
const state = reactive({
|
||||
title: '',
|
||||
content: '',
|
||||
});
|
||||
|
||||
async function getRichTextContent(id) {
|
||||
const { error, data } = await sheep.$api.data.richtext(id);
|
||||
if (error === 0) {
|
||||
state.content = data.content;
|
||||
if (state.title === '') {
|
||||
state.title = data.title;
|
||||
uni.setNavigationBarTitle({
|
||||
title: state.title,
|
||||
});
|
||||
}
|
||||
async function getRichTextContent(id, title) {
|
||||
const { code, data } = await ArticleApi.getArticle(id, title);
|
||||
if (code !== 0) {
|
||||
return;
|
||||
}
|
||||
state.content = data.content;
|
||||
// 标题不一致时,修改标题
|
||||
if (state.title !== data.title) {
|
||||
state.title = data.title;
|
||||
uni.setNavigationBarTitle({
|
||||
title: state.title,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
if (options.title) {
|
||||
state.title = options.title;
|
||||
|
@ -33,8 +39,9 @@
|
|||
title: state.title,
|
||||
});
|
||||
}
|
||||
getRichTextContent(options.id);
|
||||
getRichTextContent(options.id, options.title);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
:border="false"
|
||||
class="list-border"
|
||||
/>
|
||||
<!-- TODO 芋艿:统一的配置界面 -->
|
||||
<uni-list-item
|
||||
title="关于我们"
|
||||
showArrow
|
||||
|
@ -36,8 +35,7 @@
|
|||
class="list-border"
|
||||
@tap="
|
||||
sheep.$router.go('/pages/public/richtext', {
|
||||
id: appInfo.about_us.id,
|
||||
title: appInfo.about_us.title,
|
||||
title: '关于我们'
|
||||
})
|
||||
"
|
||||
/>
|
||||
|
@ -62,24 +60,22 @@
|
|||
class="tcp-text"
|
||||
@tap="
|
||||
sheep.$router.go('/pages/public/richtext', {
|
||||
id: appInfo.user_protocol.id,
|
||||
title: appInfo.user_protocol.title,
|
||||
title: '用户协议'
|
||||
})
|
||||
"
|
||||
>
|
||||
《{{ appInfo.user_protocol.title }}》
|
||||
《用户协议》
|
||||
</view>
|
||||
<view class="agreement-text">与</view>
|
||||
<view
|
||||
class="tcp-text"
|
||||
@tap="
|
||||
sheep.$router.go('/pages/public/richtext', {
|
||||
id: appInfo.privacy_protocol.id,
|
||||
title: appInfo.privacy_protocol.title,
|
||||
title: '隐私协议'
|
||||
})
|
||||
"
|
||||
>
|
||||
《{{ appInfo.privacy_protocol.title }}》
|
||||
《隐私协议》
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -2,24 +2,9 @@ import request from '@/sheep/request';
|
|||
import request2 from '@/sheep/request2';
|
||||
|
||||
export default {
|
||||
area: () =>
|
||||
request2({
|
||||
url: 'system/area/tree',
|
||||
method: 'GET',
|
||||
}),
|
||||
// area: () =>
|
||||
// request({
|
||||
// url: 'data/area',
|
||||
// method: 'GET',
|
||||
// }),
|
||||
faq: () =>
|
||||
request({
|
||||
url: 'data/faq',
|
||||
method: 'GET',
|
||||
}),
|
||||
richtext: (id) =>
|
||||
request({
|
||||
url: 'data/richtext/' + id,
|
||||
method: 'GET',
|
||||
}),
|
||||
};
|
||||
|
|
|
@ -2,11 +2,11 @@ import request from '@/sheep/request';
|
|||
|
||||
export default {
|
||||
// 获得文章详情
|
||||
getArticle: (id) => {
|
||||
getArticle: (id, title) => {
|
||||
return request({
|
||||
url: '/app-api/promotion/article/get',
|
||||
method: 'GET',
|
||||
params: { id }
|
||||
params: { id, title }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,18 +81,12 @@
|
|||
/>
|
||||
<view class="agreement-text ss-flex ss-col-center ss-m-l-8">
|
||||
我已阅读并遵守
|
||||
<view
|
||||
class="tcp-text"
|
||||
@tap.stop="onProtocol(appInfo.user_protocol.id, appInfo.user_protocol.title)"
|
||||
>
|
||||
《{{ appInfo.user_protocol.title }}》
|
||||
<view class="tcp-text" @tap.stop="onProtocol('用户协议')">
|
||||
《用户协议》
|
||||
</view>
|
||||
<view class="agreement-text">与</view>
|
||||
<view
|
||||
class="tcp-text"
|
||||
@tap.stop="onProtocol(appInfo.privacy_protocol.id, appInfo.privacy_protocol.title)"
|
||||
>
|
||||
《{{ appInfo.privacy_protocol.title }}》
|
||||
<view class="tcp-text" @tap.stop="onProtocol('隐私协议')">
|
||||
《隐私协议》
|
||||
</view>
|
||||
</view>
|
||||
</label>
|
||||
|
@ -130,11 +124,10 @@
|
|||
state.protocol = !state.protocol;
|
||||
}
|
||||
|
||||
// 查看协议 TODO 芋艿:协议
|
||||
function onProtocol(id, title) {
|
||||
// 查看协议
|
||||
function onProtocol(title) {
|
||||
closeAuthModal();
|
||||
sheep.$router.go('/pages/public/richtext', {
|
||||
id,
|
||||
title,
|
||||
});
|
||||
}
|
||||
|
|
|
@ -14,17 +14,13 @@ const app = defineStore({
|
|||
name: '', // 商城名称
|
||||
logo: '', // logo
|
||||
version: '', // 版本号
|
||||
cdnurl: '', // 云存储域名
|
||||
filesystem: '', // 云存储平台
|
||||
user_protocol: {}, // 用户协议
|
||||
privacy_protocol: {}, // 隐私协议
|
||||
about_us: {}, // 关于我们
|
||||
copyright: '', // 版权信息 I
|
||||
copytime: '', // 版权信息 II
|
||||
|
||||
cdnurl: '', // 云存储域名
|
||||
filesystem: '', // 云存储平台
|
||||
},
|
||||
platform: {
|
||||
payment: [], // 支持的支付方式
|
||||
recharge_payment: [], // 支持的充值支付方式
|
||||
share: {
|
||||
methods: [], // 支持的分享方式
|
||||
forwardInfo: {}, // 默认转发信息
|
||||
|
|
Loading…
Reference in New Issue