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) { export async function getQueryList(params = {}, requestConfig) {
const page = params.page != null ? Number(params.page) : 1 const page = params.page != null ? Number(params.page) : 1
const pageSize = params.pageSize != null ? Number(params.pageSize) : 20 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 return res.data
} }

View File

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

View File

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