学习很差啦 2022-10-28 14:56:51 +08:00
commit 031aa0f173
4 changed files with 29 additions and 12 deletions

View File

@ -28,3 +28,16 @@ export function getArticleDetail(type) {
});
}
/**
* 获取文章详情
* @param type
*/
export function getArticleDetailByType(type) {
return http.request({
url: `/other/article/type/${type}`,
method: Method.GET,
});
}

View File

@ -1,18 +1,18 @@
<template>
<div class="wrapper">
<u-parse :show-with-animation="true" :lazy-load="true" :selectable="true" :html="res.content"></u-parse>
<u-parse :show-with-animation="true" :lazy-load="true" :selectable="true" :html="res.content" v-if="res"></u-parse>
</div>
</template>
<script>
import { getArticleDetail } from "@/api/article";
import { getArticleDetailByType } from "@/api/article";
export default {
data() {
return {
res: "",
way: {
user: {
title: "用户协议",
title: "服务协议",
type: "USER_AGREEMENT",
},
privacy: {
@ -40,9 +40,10 @@ export default {
methods: {
init(option) {
getArticleDetail(this.way[option.type].type).then((res) => {
getArticleDetailByType(this.way[option.type].type).then((res) => {
if (res.data.success) {
this.res = res.data.result;
console.log(res)
}
});
},

View File

@ -20,10 +20,10 @@
<u-cell-item title="检查更新" @click="checkUpdate"></u-cell-item>
<!-- #endif -->
<u-cell-item title="证照信息" @click="navigateTo('/pages/mine/help/tips?type=message')"></u-cell-item>
<u-cell-item title="服务协议" @click="navigateTo('/pages/mine/help/tips?type=user')"></u-cell-item>
<u-cell-item title="隐私协议" @click="navigateTo('/pages/mine/help/tips?type=privacy')"></u-cell-item>
<u-cell-item title="关于我们" :border-bottom="false" @click="navigateTo('/pages/mine/help/tips?type=about')"></u-cell-item>
<u-cell-item title="证照信息" @click="navigateTo('/pages/mine/help/tips?type=LICENSE_INFORMATION')"></u-cell-item>
<u-cell-item title="服务协议" @click="navigateTo('/pages/mine/help/tips?type=USER_AGREEMENT')"></u-cell-item>
<u-cell-item title="隐私协议" @click="navigateTo('/pages/mine/help/tips?type=PRIVACY_POLICY')"></u-cell-item>
<u-cell-item title="关于我们" :border-bottom="false" @click="navigateTo('/pages/mine/help/tips?type=ABOUT')"></u-cell-item>
</u-cell-group>

View File

@ -15,8 +15,9 @@
word-break: break-all;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: pre-wrap;">{{item.title}}
white-space: pre-wrap;">
<view style="color:black;font-size:30rpx;font-weight:500;">{{item.title}}</view>
<view>{{item.content}}</view>
<view style="width:400rpx;padding: 10rpx 0;">{{item.createTime}}</view>
</view>
</template>
@ -39,7 +40,9 @@
text-overflow: ellipsis;
word-wrap: break-word;
white-space: pre-wrap;">{{item.title}}
white-space: pre-wrap;">
<view style="color:black;font-size:30rpx;font-weight:500;">{{item.title}}</view>
<view>{{item.content}}</view>
<view style="width:400rpx;padding: 10rpx 0;">{{item.createTime}}</view>
</view>
</template>