mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-12-28 02:16:02 +08:00
【smart-app更新】1、版本更新记录;2、复杂表单‘3、引入tabs组件
This commit is contained in:
79
smart-app/src/pages/support/change-log/change-log-detail.vue
Normal file
79
smart-app/src/pages/support/change-log/change-log-detail.vue
Normal file
@@ -0,0 +1,79 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="title">
|
||||
<uni-title type="h1" align="center" :title="detail.title"></uni-title>
|
||||
<uni-title type="h4" align="center" color="#999999" :title="detail.subTitle"></uni-title>
|
||||
</view>
|
||||
<view class="content">
|
||||
<rich-text :nodes="detail.content" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject, reactive } from 'vue';
|
||||
import { changeLogApi } from '/@/api/support/change-log-api';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
const smartEnumPlugin = inject('smartEnumPlugin');
|
||||
|
||||
const detail = reactive({
|
||||
title: '',
|
||||
subTitle: '',
|
||||
content: '',
|
||||
});
|
||||
|
||||
async function getDetail(changeLogId) {
|
||||
try {
|
||||
uni.showLoading({ title: '加载中' });
|
||||
let res = await changeLogApi.getDetail(changeLogId);
|
||||
detail.title = res.data.version + '版本' + smartEnumPlugin.getDescByValue('CHANGE_LOG_TYPE_ENUM', res.data.type);
|
||||
detail.content =
|
||||
'<pre style="' +
|
||||
'line-height: 18px;\n' +
|
||||
'font-size: 14px;\n' +
|
||||
'white-space: pre-wrap;\n' +
|
||||
' white-space: -moz-pre-wrap;\n' +
|
||||
' white-space: -pre-wrap;\n' +
|
||||
' white-space: -o-pre-wrap;\n' +
|
||||
' word-wrap: break-word;">' +
|
||||
res.data.content +
|
||||
'</pre>';
|
||||
let subTitleArray = [];
|
||||
if (res.data.publishAuthor) {
|
||||
subTitleArray.push(res.data.publishAuthor);
|
||||
}
|
||||
if (res.data.publicDate) {
|
||||
subTitleArray.push(res.data.publicDate);
|
||||
}
|
||||
detail.subTitle = subTitleArray.join(' | ');
|
||||
} catch (e) {
|
||||
smartSentry.captureError(e);
|
||||
} finally {
|
||||
uni.hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
onLoad((option) => {
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
});
|
||||
getDetail(option.changeLogId);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
height: 100vh;
|
||||
padding: 20rpx;
|
||||
|
||||
.content {
|
||||
border-top: #cccccc 1px solid;
|
||||
margin-top: 50rpx;
|
||||
padding: 50rpx 16rpx 50rpx 16rpx;
|
||||
line-height: 30px;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -25,23 +25,20 @@
|
||||
<view class="list-container">
|
||||
<view class="list-item" @click="gotoDetail(item.changeLogId)" v-for="item in listData" :key="item.changeLogId">
|
||||
<view class="list-item-row">
|
||||
<view class="list-item-content bolder">{{ item.version }}</view>
|
||||
<view class="list-item-content bolder"
|
||||
>{{ item.version }}版本{{ $smartEnumPlugin.getDescByValue('CHANGE_LOG_TYPE_ENUM', item.type) }}</view
|
||||
>
|
||||
<uni-tag
|
||||
:text="$smartEnumPlugin.getDescByValue('CHANGE_LOG_TYPE_ENUM', item.type)"
|
||||
:type="$smartEnumPlugin.getObjectByValue('CHANGE_LOG_TYPE_ENUM', item.type).type"
|
||||
/>
|
||||
</view>
|
||||
<view class="list-item-row">
|
||||
<view class="list-item-label">发布日期:{{ item.publicDate }} - {{ item.publishAuthor }}</view>
|
||||
</view>
|
||||
<view class="list-item-row">
|
||||
<view class="list-item-label">{{ item.content }}</view>
|
||||
<view class="list-item-label">发布日期:{{ item.publicDate }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</mescroll-body>
|
||||
|
||||
<uni-fab ref="fab" :pattern="fabPattern" horizontal="right" @fabClick="gotoAdd" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -121,7 +118,7 @@
|
||||
// --------------------------- 详情 ---------------------------------
|
||||
|
||||
function gotoDetail(id) {
|
||||
uni.navigateTo({ url: '/pages/enterprise/enterprise-detail?enterpriseId=' + id });
|
||||
uni.navigateTo({ url: '/pages/support/change-log/change-log-detail?changeLogId=' + id });
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -172,9 +169,10 @@
|
||||
font-size: 30rpx;
|
||||
font-weight: 400;
|
||||
text-align: left;
|
||||
color: $uni-text-color-grey;
|
||||
}
|
||||
.bolder {
|
||||
font-weight: 600 !important;
|
||||
font-weight: 500 !important;
|
||||
font-size: 34rpx !important;
|
||||
}
|
||||
.list-item-content {
|
||||
|
||||
Reference in New Issue
Block a user