|
@@ -14,6 +14,7 @@ import { computed, ref } from 'vue';
|
|
|
|
|
|
|
|
|
|
|
|
|
const questDetail = ref<QuestionDetailRes>()
|
|
const questDetail = ref<QuestionDetailRes>()
|
|
|
|
|
+const showRawJsonPopup = ref(false)
|
|
|
|
|
|
|
|
const statusText = computed(() => {
|
|
const statusText = computed(() => {
|
|
|
const status = questDetail.value?.status
|
|
const status = questDetail.value?.status
|
|
@@ -30,6 +31,11 @@ const personListText = computed(() => {
|
|
|
.filter(Boolean)
|
|
.filter(Boolean)
|
|
|
.join('、')
|
|
.join('、')
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
|
|
+const detailRawJson = computed(() => {
|
|
|
|
|
+ if (!questDetail.value) return '{}'
|
|
|
|
|
+ return JSON.stringify(questDetail.value, null, 2)
|
|
|
|
|
+})
|
|
|
onLoad(async (option) => {
|
|
onLoad(async (option) => {
|
|
|
if (option && option.id) {
|
|
if (option && option.id) {
|
|
|
const { id } = option;
|
|
const { id } = option;
|
|
@@ -41,6 +47,9 @@ onLoad(async (option) => {
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
|
<view class="p-[20px]">
|
|
<view class="p-[20px]">
|
|
|
|
|
+ <view class="mb-[8px]">
|
|
|
|
|
+ <van-button size="small" plain type="primary" @click="showRawJsonPopup = true">查看接口原始JSON</van-button>
|
|
|
|
|
+ </view>
|
|
|
<view class="form-item">
|
|
<view class="form-item">
|
|
|
<view class="label">类型:</view>
|
|
<view class="label">类型:</view>
|
|
|
<view class="flex value">
|
|
<view class="flex value">
|
|
@@ -51,10 +60,10 @@ onLoad(async (option) => {
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<!-- 问题标题 -->
|
|
<!-- 问题标题 -->
|
|
|
- <!-- <view class="form-item">
|
|
|
|
|
|
|
+ <view class="form-item">
|
|
|
<view class="label">标题:</view>
|
|
<view class="label">标题:</view>
|
|
|
<view class="value">{{ questDetail?.questionTitle }}</view>
|
|
<view class="value">{{ questDetail?.questionTitle }}</view>
|
|
|
- </view> -->
|
|
|
|
|
|
|
+ </view>
|
|
|
<!-- 问题内容 -->
|
|
<!-- 问题内容 -->
|
|
|
<view class="form-item">
|
|
<view class="form-item">
|
|
|
<view class="label">内容:</view>
|
|
<view class="label">内容:</view>
|
|
@@ -91,6 +100,20 @@ onLoad(async (option) => {
|
|
|
<view class="value" v-if="questDetail?.questionAnswer">{{ questDetail?.questionAnswer }}</view>
|
|
<view class="value" v-if="questDetail?.questionAnswer">{{ questDetail?.questionAnswer }}</view>
|
|
|
<view class="value text-[#e3e3e3]" v-else>暂无</view>
|
|
<view class="value text-[#e3e3e3]" v-else>暂无</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+
|
|
|
|
|
+ <van-popup
|
|
|
|
|
+ v-model:show="showRawJsonPopup"
|
|
|
|
|
+ round
|
|
|
|
|
+ position="bottom"
|
|
|
|
|
+ :style="{ height: '75%' }"
|
|
|
|
|
+ >
|
|
|
|
|
+ <view class="json-popup">
|
|
|
|
|
+ <view class="json-title">详情接口完整JSON</view>
|
|
|
|
|
+ <scroll-view scroll-y class="json-scroll">
|
|
|
|
|
+ <text class="json-text">{{ detailRawJson }}</text>
|
|
|
|
|
+ </scroll-view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </van-popup>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -107,4 +130,32 @@ onLoad(async (option) => {
|
|
|
word-break: break-all;
|
|
word-break: break-all;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+.json-popup {
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ padding: 12px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.json-title {
|
|
|
|
|
+ font-size: 16px;
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.json-scroll {
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ background: #f7f8fa;
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ padding: 12px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.json-text {
|
|
|
|
|
+ white-space: pre-wrap;
|
|
|
|
|
+ word-break: break-all;
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ line-height: 20px;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|