Commit 3823a5fd by Lin

feat(reception): 新增接待中心功能和组件重构

- 在接待中心中添加 findCheckResultByBatchId 和 getShortUrl API 函数
- 重构客户列表和接待复盘列表为独立组件 ListCustomer 和 ListReception
- 引入 CustomEmpty 组件以优化空状态展示
- 更新 receptionDetail 组件以动态显示质检明细和话术标签
- 优化接待中心的滚动视图和交互逻辑,提升用户体验
1 parent 5d233055
...@@ -90,6 +90,21 @@ export async function findVisitsInfo(params: UTSJSONObject): Promise<any> { ...@@ -90,6 +90,21 @@ export async function findVisitsInfo(params: UTSJSONObject): Promise<any> {
} }
return await http.fetch("dj.api.smartcarlife.customervisits.findVisitsInfo", data, true, "dj") return await http.fetch("dj.api.smartcarlife.customervisits.findVisitsInfo", data, true, "dj")
} }
export async function findCheckResultByBatchId(params: UTSJSONObject): Promise<any> {
const data: UTSJSONObject = {
projectName: 'pad',
...params
}
return await http.fetch("dj.pad.api.reception.findCheckResultByBatchId", data, true, "dj")
}
export async function getShortUrl(params: UTSJSONObject): Promise<any> {
const data: UTSJSONObject = {
projectName: 'boutique',
...params
}
return await http.fetch("dj.api.car.boutique.inspection.batch.file.short.url", data, true, "dj")
}
// /** // /**
// * 查询对话内容 // * 查询对话内容
// */ // */
......
...@@ -33,8 +33,9 @@ ...@@ -33,8 +33,9 @@
type PresetTypesMap = { type PresetTypesMap = {
base: EmptyTypeConfig base: EmptyTypeConfig
home: EmptyTypeConfig home: EmptyTypeConfig
common: EmptyTypeConfig
contract: EmptyTypeConfig contract: EmptyTypeConfig
function:EmptyTypeConfig function: EmptyTypeConfig
} }
const TYPE_ICON_BASE_PATH: string = '/static/empty/' const TYPE_ICON_BASE_PATH: string = '/static/empty/'
...@@ -49,10 +50,10 @@ ...@@ -49,10 +50,10 @@
icon: 'icon-home-empty.png', icon: 'icon-home-empty.png',
title: '暂无数据' title: '暂无数据'
}, },
common: { common: {
icon: 'icon-common-empty.png', icon: 'icon-common-empty.png',
title: '暂无数据' title: '暂无数据'
}, },
contract: { contract: {
icon: 'icon-contract-empty.png', icon: 'icon-contract-empty.png',
title: '请先选择合同,签约个人信息自动带出' title: '请先选择合同,签约个人信息自动带出'
......
<template>
<view class="detail-info-container">
<view class="detail-info-item">
<view class="item-title">
<image class="detail-info-item-img" src="@/assets/images/reception/icon-pen.png" mode="aspectFit" />
<text class="detail-info-item-text">话术标签</text>
</view>
<view class="item-content">
<view
class="speech-tag-item"
:class="idx % 3 == 2 ? 'speech-tag-item-row-end' : ''"
v-for="(tag, idx) in speechTagList"
:key="idx"
>
<text class="speech-tag-text">{{ tag }}</text>
</view>
</view>
</view>
<view class="detail-info-item">
<view class="item-title">
<image class="detail-info-item-img" src="@/assets/images/reception/icon-title-tag.png" mode="aspectFit" />
<text class="detail-info-item-text">质检明细</text>
</view>
<view class="item-content item-content-quality-table">
<view class="quality-table-wrap">
<view class="quality-table-header">
<view class="quality-th quality-th-col1">
<text class="quality-th-text">一级分类</text>
</view>
<view class="quality-th quality-th-col2">
<text class="quality-th-text">质检得分</text>
</view>
<view class="quality-th quality-th-col3">
<text class="quality-th-text">命中文本</text>
</view>
</view>
<view class="quality-table-body">
<view
class="quality-table-row"
v-for="(row, rIdx) in qualityDetailList"
:key="rIdx"
>
<view class="quality-td quality-td-col1">
<text class="quality-td-text">{{ row.category }}</text>
</view>
<view class="quality-td quality-td-col2">
<text class="quality-td-text">{{ row.score }}</text>
</view>
<view class="quality-td quality-td-col3">
<text class="quality-td-text">{{ row.matchedText }}</text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup lang="uts">
import { computed } from "vue";
const props = defineProps<{
qualityRows?: UTSJSONObject[]
}>();
const speechTagList: string[] = [
"场景塑造-优秀",
"逼单技巧-薄弱",
"场景塑造-优秀",
"场景塑造-优秀",
"场景塑造-优秀",
"场景塑造-薄弱",
"场景塑造-优秀",
"场景塑造-优秀",
];
type QualityDetailRow = {
category: string;
score: string;
matchedText: string;
};
function dimTagGroupName(dim: UTSJSONObject | null): string {
if (dim == null) {
return "";
}
const v = dim["tagGroupName"] as string | null;
return v != null ? v : "";
}
function dimFormatScore(dim: UTSJSONObject | null): string {
if (dim == null) {
return "";
}
const format = dim["formatScore"] as string | null;
if (format != null && format != "") {
return format;
}
const score = dim["score"];
const sumScore = dim["sumScore"];
if (score != null && sumScore != null) {
return `${score}/${sumScore}`;
}
return "";
}
function parseStringArray(rawValue: any | null): string[] {
const out: string[] = [];
if (rawValue == null) {
return out;
}
if (rawValue instanceof Array) {
const arr = rawValue as any[];
let i = 0;
while (i < arr.length) {
const item = arr[i];
if (item != null) {
const s = `${item}`.trim();
if (s != "") {
out.push(s);
}
}
i++;
}
return out;
}
const text = `${rawValue}`.trim();
if (text == "" || text == "[]") {
return out;
}
if (text.substring(0, 1) == "[" && text.substring(text.length - 1, text.length) == "]") {
try {
const parsed = JSON.parse(text) as any;
if (parsed != null && parsed instanceof Array) {
const arr = parsed as any[];
let i = 0;
while (i < arr.length) {
const item = arr[i];
if (item != null) {
const s = `${item}`.trim();
if (s != "") {
out.push(s);
}
}
i++;
}
return out;
}
} catch (e) {
if (`${e}` == "") {
// 占位分支:显式消费异常对象,规避 UTS 未使用告警
}
}
}
out.push(text);
return out;
}
const qualityDetailList = computed((): QualityDetailRow[] => {
const sourceRows = props.qualityRows != null ? props.qualityRows : [];
const out: QualityDetailRow[] = [];
let i = 0;
while (i < sourceRows.length) {
const row = sourceRows[i];
const hitTextList = parseStringArray(row["hitText"]);
out.push({
category: dimTagGroupName(row),
score: dimFormatScore(row),
matchedText: hitTextList.length > 0 ? hitTextList.join(";") : "--"
});
i++;
}
return out;
});
</script>
<style>
.detail-info-container {
display: flex;
flex-direction: column;
width: 100%;
height: auto;
box-sizing: border-box;
padding: 14px 14px;
border-radius: 16.1px;
opacity: 1;
background: #ffffff;
}
.detail-info-item {
display: flex;
flex-direction: column;
}
.item-title {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
height: 20px;
}
.detail-info-item-img {
width: 18px;
height: 18px;
flex-shrink: 0;
}
.detail-info-item-text {
margin-left: 6px;
color: #333333;
font-size: 16px;
font-weight: 500;
line-height: 20px;
}
.item-content {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-content: flex-start;
width: 100%;
min-width: 0;
margin-top: 12px;
}
.speech-tag-item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
flex-grow: 0;
flex-shrink: 0;
flex-basis: 31%;
width: 31%;
min-width: 0;
box-sizing: border-box;
margin-right: 3.5%;
margin-bottom: 8px;
padding: 6px 6px;
border-radius: 8px;
opacity: 1;
background: #edf3ff;
}
.speech-tag-item-row-end {
margin-right: 0;
}
.speech-tag-text {
color: #4673ff;
font-size: 14px;
font-weight: 400;
text-align: center;
}
.item-content-quality-table {
flex-direction: column;
flex-wrap: nowrap;
}
.quality-table-wrap {
display: flex;
flex-direction: column;
width: 100%;
min-width: 0;
border-radius: 8px;
overflow: hidden;
border-width: 1px;
border-style: solid;
border-color: #e8ecf2;
}
.quality-table-header {
display: flex;
flex-direction: row;
flex-shrink: 0;
width: 100%;
min-width: 0;
background-color: #edf3ff;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #dce6ff;
}
.quality-th {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
min-width: 0;
box-sizing: border-box;
padding-top: 20rpx;
padding-bottom: 20rpx;
padding-left: 24rpx;
padding-right: 24rpx;
border-right-width: 1px;
border-right-style: solid;
border-right-color: #dce6ff;
}
.quality-th-col1 {
flex-grow: 1;
flex-shrink: 1;
flex-basis: 0;
}
.quality-th-col2 {
flex-grow: 0;
flex-shrink: 0;
flex-basis: 176rpx;
}
.quality-th-col3 {
flex-grow: 2;
flex-shrink: 1;
flex-basis: 0;
border-right-width: 0;
}
.quality-th-text {
color: #333333;
font-size: 13px;
font-weight: 700;
text-align: center;
line-height: 18px;
}
.quality-table-body {
display: flex;
flex-direction: column;
flex-shrink: 0;
width: 100%;
min-width: 0;
background-color: #f7f8fa;
}
.quality-table-row {
display: flex;
flex-direction: row;
width: 100%;
min-width: 0;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #ebecef;
}
.quality-td {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
min-width: 0;
box-sizing: border-box;
padding-top: 20rpx;
padding-bottom: 20rpx;
padding-left: 24rpx;
padding-right: 24rpx;
background-color: #f7f8fa;
border-right-width: 1px;
border-right-style: solid;
border-right-color: #ebecef;
}
.quality-td-col1 {
flex-grow: 1;
flex-shrink: 1;
flex-basis: 0;
}
.quality-td-col2 {
flex-grow: 0;
flex-shrink: 0;
flex-basis: 176rpx;
}
.quality-td-col3 {
flex-grow: 2;
flex-shrink: 1;
flex-basis: 0;
border-right-width: 0;
align-items: flex-start;
justify-content: flex-start;
}
.quality-td-text {
color: #333333;
font-size: 13px;
font-weight: 400;
line-height: 18px;
text-align: center;
}
.quality-td-col3 .quality-td-text {
text-align: left;
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -45,9 +45,11 @@ ...@@ -45,9 +45,11 @@
<view class="form-detail-goods-head"> <view class="form-detail-goods-head">
<text class="form-detail-goods-title">商品套餐</text> <text class="form-detail-goods-title">商品套餐</text>
</view> </view>
<view v-if="goodsRowPairs.length == 0" class="goods-empty-wrap"> <CustomEmpty
<text class="goods-empty-text">暂无商品套餐</text> v-if="goodsRowPairs.length == 0"
</view> type="base"
title="暂无商品套餐"
/>
<view <view
v-else v-else
v-for="(row, goodsRowIndex) in goodsRowPairs" v-for="(row, goodsRowIndex) in goodsRowPairs"
...@@ -859,17 +861,6 @@ function handleClose(): void { ...@@ -859,17 +861,6 @@ function handleClose(): void {
color: #1e293b; color: #1e293b;
} }
.goods-empty-wrap {
width: 100%;
padding: 16px 0 8px;
box-sizing: border-box;
}
.goods-empty-text {
font-size: 14px;
color: #94a3b8;
}
/* 每行 list-item 内横向两张卡 */ /* 每行 list-item 内横向两张卡 */
.goods-row-2 { .goods-row-2 {
display: flex; display: flex;
......
...@@ -210,7 +210,7 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void { ...@@ -210,7 +210,7 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void {
background-color: rgba(255, 255, 255, 0.7); background-color: rgba(255, 255, 255, 0.7);
border: 1px solid rgba(255, 255, 255, 0.4); border: 1px solid rgba(255, 255, 255, 0.4);
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07); box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
border-radius: 32px; border-radius: 16px;
flex-direction: column; flex-direction: column;
} }
......
<template>
<!-- 接待复盘记录列表:与接待接口字段对齐,数据由父级拉取后传入 -->
<view class="reception-record-list">
<view
v-for="(item, idx) in receptionRecordList"
:key="getStr(item, 'batchId') != '' ? getStr(item, 'batchId') + '-' + idx : 'recv-' + idx"
class="list-card glass-card"
@click="onCardClick(item)"
>
<view class="card-header-row">
<view class="card-title-box">
<text class="card-name">{{ getStr(item, 'customerName') }}</text>
<text class="card-car">{{ getStr(item, 'carBrand') }}</text>
</view>
<view class="card-status-box">
<view class="status-badge bg-slate-100">
<text class="status-text text-slate-400">{{ getReviewFlagText(item) }}</text>
</view>
<view
v-if="shouldShowOrderFinishBadge(item)"
:class="orderFinishFlagIsSuccess(item) ? 'status-badge bg-green-50' : 'status-badge bg-red-50'"
>
<text :class="orderFinishFlagIsSuccess(item) ? 'status-text text-green-400' : 'status-text text-red-400'">{{ getOrderFinishResultLabel(item) }}</text>
</view>
</view>
</view>
<view class="card-info-list">
<view class="info-row"><text class="info-label">客户电话</text><text class="info-value">{{ formatPhone(getStr(item, 'phoneNumber')) }}</text></view>
<view class="info-row"><text class="info-label">销售姓名</text><text class="info-value">{{ getReceptionSalesDisplay(item) }}</text></view>
<view class="info-row"><text class="info-label">接待时长</text><text class="info-value">{{ formatReceptionDuration(item) }}</text></view>
<view class="info-row"><text class="info-label">开始接待</text><text class="info-value">{{ formatTimestamp(getTs(item, 'receptionStartTime')) }}</text></view>
<view class="info-row info-row-last"><text class="info-label">结束接待</text><text class="info-value">{{ formatTimestamp(getTs(item, 'receptionEndTime')) }}</text></view>
</view>
</view>
</view>
</template>
<script setup lang="uts">
defineProps<{
/** 接待记录列表(由父级拉取并传入) */
receptionRecordList: UTSJSONObject[]
}>()
const emit = defineEmits<{
/** 点击卡片:父级根据 filterTabIndex 等处理详情或 toast */
'reception-click': [item: UTSJSONObject]
}>()
function getStr(data: UTSJSONObject, key: string): string {
const v = data[key]
if (v == null) {
return ''
}
return `${v}`
}
function getTs(data: UTSJSONObject, key: string): number | null {
const v = data[key]
if (v == null) {
return null
}
if (typeof v == 'number') {
return v
}
const n = parseFloat(`${v}`)
return isNaN(n) ? null : n
}
function getReviewFlagText(data: UTSJSONObject): string {
const v = data['reviewFlag']
if (v == null) {
return '未复盘'
}
if (typeof v == 'number') {
return v == 0 ? '已复盘' : '未复盘'
}
const n = parseFloat(`${v}`)
if (isNaN(n)) {
return '未复盘'
}
return n == 0 ? '已复盘' : '未复盘'
}
/** orderFinishFlag:false/0 为战败,true/非 0 为成功;未知则不展示角标(兼容接口 0/1) */
function getOrderFinishFlagOutcome(item: UTSJSONObject): number {
const v = item['orderFinishFlag']
if (v == null) {
return -1
}
if (typeof v == 'boolean') {
return v == true ? 1 : 0
}
if (typeof v == 'number') {
return v == 0 ? 0 : 1
}
const s = `${v}`.trim().toLowerCase()
if (s == 'false' || s == '0') {
return 0
}
if (s == 'true' || s == '1') {
return 1
}
return -1
}
function shouldShowOrderFinishBadge(item: UTSJSONObject): boolean {
return getOrderFinishFlagOutcome(item) >= 0
}
function orderFinishFlagIsSuccess(item: UTSJSONObject): boolean {
return getOrderFinishFlagOutcome(item) == 1
}
function getOrderFinishResultLabel(item: UTSJSONObject): string {
const o = getOrderFinishFlagOutcome(item)
if (o == 1) {
return '成功'
}
if (o == 0) {
return '战败'
}
return ''
}
function getReceptionSalesDisplay(item: UTSJSONObject): string {
const sales = getStr(item, 'salesName')
if (sales != '') {
return sales
}
return getStr(item, 'staffName')
}
function formatPhone(phone: string): string {
if (phone == null || phone == '') {
return ''
}
const s = phone.replace(/\s/g, '')
if (s.length >= 11) {
return s.substring(0, 3) + ' ' + s.substring(3, 7) + ' ' + s.substring(7, 11)
}
return phone
}
function formatTimestamp(ts: number | null): string {
if (ts == null || ts <= 0) {
return ''
}
const d = new Date(ts)
const y = d.getFullYear()
const m = (d.getMonth() + 1).toString().padStart(2, '0')
const day = d.getDate().toString().padStart(2, '0')
const h = d.getHours().toString().padStart(2, '0')
const min = d.getMinutes().toString().padStart(2, '0')
const sec = d.getSeconds().toString().padStart(2, '0')
return `${y}.${m}.${day} ${h}:${min}:${sec}`
}
function formatReceptionDuration(item: UTSJSONObject): string {
let startMs = getTs(item, 'receptionStartTime')
if (startMs == null || startMs <= 0) {
startMs = getTs(item, 'startTime')
}
let endMs = getTs(item, 'receptionEndTime')
if (endMs == null || endMs <= 0) {
endMs = getTs(item, 'endTime')
}
if (startMs == null || endMs == null || startMs <= 0 || endMs <= 0) {
return ''
}
const diffSec = Math.floor((endMs - startMs) / 1000)
if (diffSec < 0) {
return ''
}
const min = Math.floor(diffSec / 60)
const sec = diffSec % 60
return `${min}分${sec}秒`
}
function onCardClick(item: UTSJSONObject): void {
emit('reception-click', item)
}
</script>
<style scoped lang="scss">
.reception-record-list {
flex-direction: column;
width: 100%;
}
.glass-card {
background-color: rgba(255, 255, 255, 0.7);
border: 1px solid rgba(255, 255, 255, 0.4);
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
border-radius: 32px;
flex-direction: column;
}
.list-card {
padding: 20px;
border-radius: 24px;
margin-bottom: 16px;
}
.card-header-row {
flex-direction: row;
justify-content: space-between;
margin-bottom: 16px;
}
.card-title-box {
flex-direction: column;
}
.card-name {
font-size: 18px;
font-weight: bold;
color: #1e293b;
}
.card-car {
font-size: 14px;
font-weight: bold;
color: #0055ff;
margin-top: 4px;
}
.card-status-box {
flex-direction: row;
align-items: flex-start;
}
.status-badge {
padding-top: 2px;
padding-bottom: 2px;
padding-left: 6px;
padding-right: 6px;
border-radius: 4px;
margin-left: 4px;
justify-content: center;
align-items: center;
flex-direction: row;
}
.bg-slate-100 {
background-color: #f1f5f9;
}
.bg-red-50 {
background-color: #fef2f2;
}
.bg-green-50 {
background-color: #f0fdf4;
}
.status-text {
font-size: 10px;
}
.text-slate-400 {
color: #94a3b8;
}
.text-red-400 {
color: #f87171;
}
.text-green-400 {
color: #4ade80;
}
.card-info-list {
flex-direction: column;
}
.info-row {
flex-direction: row;
justify-content: space-between;
margin-bottom: 10px;
}
.info-row-last {
margin-bottom: 0;
}
.info-label {
font-size: 12px;
color: #64748b;
}
.info-value {
font-size: 12px;
color: #334155;
}
</style>
import { get } from "@/utils/common.uts";
export function toTrimmedString(raw: any | null): string {
if (raw == null) {
return "";
}
return `${raw}`.trim();
}
export function parseNumberValue(raw: any | null): number | null {
if (raw == null) {
return null;
}
if (typeof raw == "number") {
return raw as number;
}
const s = toTrimmedString(raw);
if (s == "") {
return null;
}
const n = parseFloat(s);
return isNaN(n) ? null : n;
}
export function parseIntValue(raw: any | null): number | null {
if (raw == null) {
return null;
}
if (typeof raw == "number") {
return raw as number;
}
const s = toTrimmedString(raw);
if (s == "") {
return null;
}
const n = parseInt(s);
return isNaN(n) ? null : n;
}
export function isSuccessCode(codeRaw: any | null): boolean {
const code = toTrimmedString(codeRaw);
return code == "" || code == "0";
}
export function formatPhoneDisplay(phone: string): string {
if (phone == null || phone == "") {
return "";
}
const s = phone.replace(/\s/g, "");
if (s.length >= 11) {
return s.substring(0, 3) + " " + s.substring(3, 7) + " " + s.substring(7, 11);
}
return phone;
}
export function getOrderFinishFlagOutcomeForItem(item: UTSJSONObject | null | undefined): number {
if (item == null) {
return -1;
}
const v = get(item, "orderFinishFlag");
if (v == null) {
return -1;
}
if (typeof v == "boolean") {
return v == true ? 1 : 0;
}
if (typeof v == "number") {
return v == 0 ? 0 : 1;
}
const s = `${v}`.trim().toLowerCase();
if (s == "false" || s == "0") {
return 0;
}
if (s == "true" || s == "1") {
return 1;
}
return -1;
}
export function formatReceptionScore(item: UTSJSONObject | null | undefined): string {
if (item == null) {
return "-";
}
const scoreRaw = get(item, "score");
if (scoreRaw == null) {
return "-";
}
const score = parseFloat(`${scoreRaw}`.trim());
if (isNaN(score)) {
return "-";
}
const outcome = getOrderFinishFlagOutcomeForItem(item);
if (outcome < 0) {
return "-";
}
const orderFinishFlag = outcome == 1;
if (score >= 85 && orderFinishFlag) {
return "A+";
}
if (score >= 60 && score < 85 && orderFinishFlag) {
return "A";
}
if (score < 60 && orderFinishFlag) {
return "B";
}
if (score >= 85 && !orderFinishFlag) {
return "B+";
}
if (score >= 60 && score < 85 && !orderFinishFlag) {
return "B";
}
if (score < 60 && !orderFinishFlag) {
return "C";
}
return "-";
}
export function formatShareDate(ts: number | null): string {
if (ts == null || ts <= 0) {
return "--";
}
const d = new Date(ts);
const to2 = (n: number): string => (n < 10 ? `0${n}` : `${n}`);
const y = d.getFullYear();
const m = to2(d.getMonth() + 1);
const day = to2(d.getDate());
const h = to2(d.getHours());
const min = to2(d.getMinutes());
const sec = to2(d.getSeconds());
return `${y}年${m}月${day}日 ${h}:${min}:${sec}`;
}
export function formatShareDurationText(directText: string, start: number | null, end: number | null): string {
const direct = toTrimmedString(directText);
if (direct != "") {
return direct;
}
if (start == null || end == null || start <= 0 || end <= 0) {
return "--";
}
const diffSec = Math.floor((end - start) / 1000);
if (diffSec < 0) {
return "--";
}
const min = Math.floor(diffSec / 60);
const sec = diffSec % 60;
return `${min}分${sec}秒`;
}
export function formatReceptionStatusTextByRaw(raw: any | null): string {
const statusNum = parseIntValue(raw);
if (statusNum == 1) {
return "成交";
}
if (statusNum == 2) {
return "战败";
}
return "未知";
}
function parseShortUrlFromData(raw: any | null): string {
if (raw == null) {
return "";
}
if (typeof raw == "string") {
return raw.trim();
}
const obj = raw as UTSJSONObject;
const keyList = ["shortUrl", "shortURL", "url", "link", "batchFileShortUrl", "fileShortUrl", "shortLink"];
let i = 0;
while (i < keyList.length) {
const v = obj[keyList[i]];
if (v != null) {
const s = `${v}`.trim();
if (s != "") {
return s;
}
}
i++;
}
return "";
}
export function parseShortUrlFromResponse(res: any): string {
if (res == null) {
return "";
}
const direct = parseShortUrlFromData(res);
if (direct != "") {
return direct;
}
const body = res as UTSJSONObject;
if (!isSuccessCode(body["code"])) {
return "";
}
return parseShortUrlFromData(body["data"]);
}
export function pickQualityRowsFromResponse(res: any): UTSJSONObject[] {
if (res == null) {
return [];
}
if (res instanceof Array) {
return res as UTSJSONObject[];
}
const body = res as UTSJSONObject;
const data = body["data"];
if (data != null && data instanceof Array) {
return data as UTSJSONObject[];
}
if (data != null) {
const dataObj = data as UTSJSONObject;
const list = dataObj["list"];
if (list != null && list instanceof Array) {
return list as UTSJSONObject[];
}
}
const list = body["list"];
if (list != null && list instanceof Array) {
return list as UTSJSONObject[];
}
return [];
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!