This commit is contained in:
Mrx
2026-05-25 17:01:59 +08:00
parent af286e77aa
commit 0ed7918949
3 changed files with 73 additions and 58 deletions

View File

@@ -25,7 +25,7 @@ export async function getQueryDetailByOrderId(orderId, requestConfig) {
export async function getQueryList(params = {}, requestConfig) {
const page = params.page != null ? Number(params.page) : 1
const pageSize = params.pageSize != null ? Number(params.pageSize) : 20
const res = await http.get(`/query/list?page=${page}&page_size=${pageSize}`, requestConfig)
const res = await http.get(`/query/list?page=${page}&page_size=${pageSize}&source=miniapp`, requestConfig)
return res.data
}

View File

@@ -1,6 +1,6 @@
<script setup>
import { onLoad } from '@dcloudio/uni-app'
import { computed, onUnmounted, ref } from 'vue'
import { onLoad, onReady } from '@dcloudio/uni-app'
import { computed, nextTick, onUnmounted, ref } from 'vue'
import { getProductByEn, getUserDetail, postAuthSendSmsQuery, postPayPayment, postQueryService, postUploadImage } from '@/api'
import { productHasSmsCode, useInquireForm } from '@/composables/useInquireForm'
import { aesEncrypt, QUERY_PAYLOAD_AES_HEX_KEY } from '@/utils/crypto.js'
@@ -72,11 +72,26 @@ const isIdCardManValid = computed(() => /^\d{17}[\dX]$/i.test(formData.idCardMan
const isIdCardWomanValid = computed(() => /^\d{17}[\dX]$/i.test(formData.idCardWoman || ''))
const isCreditCodeValid = computed(() => /^.{18}$/.test(formData.entCode || ''))
const scrollHeight = ref('')
onLoad((options) => {
feature.value = (options?.feature) || ''
void loadProduct()
})
onReady(() => {
nextTick(() => {
try {
const sysInfo = uni.getSystemInfoSync()
const windowHeight = sysInfo.windowHeight || 667
scrollHeight.value = `${windowHeight}px`
}
catch {
scrollHeight.value = '100vh'
}
})
})
onUnmounted(() => {
if (smsTimer) {
clearInterval(smsTimer)
@@ -509,7 +524,7 @@ async function onConfirmPay() {
<view v-else-if="!productLoadOk" class="state">
产品不存在或已下架
</view>
<scroll-view v-else scroll-y class="scroll page-inner">
<scroll-view v-else scroll-y class="scroll page-inner" :style="{ height: scrollHeight }">
<view class="card-container">
<!-- 顶部产品长图 -->
<view class="inquire-banner">
@@ -742,9 +757,7 @@ async function onConfirmPay() {
}
.scroll {
flex: 1;
height: 0;
min-height: 0;
width: 100%;
box-sizing: border-box;
}

View File

@@ -147,11 +147,17 @@ onShow(() => {
})
function handleUserTap() {
if (isLogin.value) {
uni.showActionSheet({
itemList: ['退出登录'],
if (!isLogin.value) {
uni.navigateTo({ url: '/pages/login' })
}
}
async function handleLogout() {
uni.showModal({
title: '提示',
content: '确定要退出登录吗?',
success(res) {
if (res.tapIndex === 0) {
if (res.confirm) {
clearAuthStorage()
isLogin.value = false
nickname.value = ''
@@ -161,9 +167,6 @@ function handleUserTap() {
}
},
})
return
}
uni.navigateTo({ url: '/pages/login' })
}
/** 微信小程序:用户主动触发才可调 getUserProfile */
@@ -328,7 +331,6 @@ onUnmounted(() => {
<template>
<view class="page-root">
<scroll-view scroll-y class="scrollarea">
<view class="page">
<!-- 区块1: 个人信息栏 -->
@@ -344,7 +346,7 @@ onUnmounted(() => {
<text class="profile-name">{{ isLogin ? nickname : '点击登录' }}</text>
<text class="profile-desc">{{ isLogin ? userDesc : '登录后可同步历史报告与收藏' }}</text>
</view>
<view class="profile-arrow">
<view v-if="!isLogin" class="profile-arrow">
<view class="i-carbon-chevron-right" />
</view>
</view>
@@ -456,6 +458,12 @@ onUnmounted(() => {
</view>
<text class="tool-item-name">关于我们</text>
</view>
<view v-if="isLogin" class="tool-item" @tap="handleLogout">
<view class="tool-item-icon-wrap" style="background: rgba(245,63,63,0.08)">
<view class="tool-item-icon i-carbon-logout" style="color: #f53f3f" />
</view>
<text class="tool-item-name">退出登录</text>
</view>
</view>
</view>
@@ -484,9 +492,8 @@ onUnmounted(() => {
</view>
</view>
<view style="height: 40rpx" />
<view style="height: 24rpx" />
</view>
</scroll-view>
<view v-if="coopModalOpen" class="coop-mask" @tap.self="closeCoopModal">
<view class="coop-dialog" @tap.stop>
@@ -574,16 +581,11 @@ onUnmounted(() => {
display: flex;
flex-direction: column;
background: linear-gradient(180deg, #f0f5ff 0%, #f5f7fa 30%, #f3f5fb 100%);
}
.scrollarea {
flex: 1;
min-height: 0;
height: 0;
overflow: hidden;
}
.page {
padding: 0 24rpx 40rpx;
padding: 0 24rpx 24rpx;
box-sizing: border-box;
}
@@ -592,7 +594,7 @@ onUnmounted(() => {
position: relative;
border-radius: 0 0 32rpx 32rpx;
overflow: hidden;
margin-bottom: 24rpx;
margin-bottom: 16rpx;
}
.profile-bg {
@@ -608,7 +610,7 @@ onUnmounted(() => {
position: relative;
display: flex;
align-items: center;
padding: 48rpx 32rpx 32rpx;
padding: 36rpx 32rpx 24rpx;
gap: 20rpx;
}
@@ -617,8 +619,8 @@ onUnmounted(() => {
}
.avatar-inner {
width: 96rpx;
height: 96rpx;
width: 80rpx;
height: 80rpx;
border-radius: 50%;
background: rgba(255, 255, 255, 0.2);
display: flex;
@@ -628,7 +630,7 @@ onUnmounted(() => {
}
.avatar-icon {
font-size: 44rpx;
font-size: 38rpx;
color: #fff;
}
@@ -661,7 +663,7 @@ onUnmounted(() => {
position: relative;
display: flex;
gap: 24rpx;
padding: 0 32rpx 28rpx;
padding: 0 32rpx 20rpx;
}
.action-btn {
@@ -687,8 +689,8 @@ onUnmounted(() => {
.section {
background: #fff;
border-radius: 24rpx;
padding: 28rpx 24rpx 8rpx;
margin-bottom: 24rpx;
padding: 20rpx 24rpx 4rpx;
margin-bottom: 16rpx;
box-shadow: 0 4rpx 16rpx rgba(15, 35, 52, 0.03);
}
@@ -696,7 +698,7 @@ onUnmounted(() => {
font-size: 26rpx;
font-weight: 600;
color: #1d2129;
margin-bottom: 20rpx;
margin-bottom: 14rpx;
padding-left: 4rpx;
}
@@ -712,12 +714,12 @@ onUnmounted(() => {
display: flex;
flex-direction: column;
align-items: center;
padding: 12rpx 0;
padding: 8rpx 0;
}
.quick-item-btn {
margin: 0;
padding: 12rpx 0;
padding: 8rpx 0;
border: none;
background: transparent;
line-height: normal;
@@ -735,17 +737,17 @@ onUnmounted(() => {
}
.quick-icon-wrap {
width: 80rpx;
height: 80rpx;
border-radius: 24rpx;
width: 68rpx;
height: 68rpx;
border-radius: 20rpx;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 10rpx;
margin-bottom: 8rpx;
}
.quick-icon {
font-size: 36rpx;
font-size: 32rpx;
}
.quick-name {
@@ -766,12 +768,12 @@ onUnmounted(() => {
display: flex;
flex-direction: column;
align-items: center;
padding: 16rpx 0;
padding: 10rpx 0;
}
.tool-item-btn {
margin: 0;
padding: 16rpx 0;
padding: 10rpx 0;
border: none;
background: transparent;
line-height: normal;
@@ -789,17 +791,17 @@ onUnmounted(() => {
}
.tool-item-icon-wrap {
width: 88rpx;
height: 88rpx;
width: 76rpx;
height: 76rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 12rpx;
margin-bottom: 8rpx;
}
.tool-item-icon {
font-size: 40rpx;
font-size: 36rpx;
}
.tool-item-name {