2025-10-24
金融修改
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<view class="finance-container">
|
||||
<u-navbar :is-back="false" title="金融理财" :background="{ background: 'transparent' }" title-color="#FFFFFF"></u-navbar>
|
||||
<u-navbar :is-back="false" title="金融理财" :border-bottom="false" :background="{ background: 'transparent' }"
|
||||
title-color="#FFFFFF"></u-navbar>
|
||||
<!-- 可滚动的内容区域 -->
|
||||
<view class="content-container" :style="'height:'+height+'px'">
|
||||
<view class="searchFilter" id="searchFilterId">
|
||||
@@ -11,19 +12,18 @@
|
||||
</view>
|
||||
|
||||
<view class="product-list" :style="'height:'+scrollHeight+'px'">
|
||||
<scroll-view scroll-y="true" style="height: 100%;" v-if="productList.length!=0" @scrolltolower="loadData">
|
||||
<view class="product-item" v-for="item in productList" :key="item.id">
|
||||
<scroll-view scroll-y="true" style="height: 100%;" v-if="productList.length!=0"
|
||||
@scrolltolower="loadData">
|
||||
<view class="product-item" v-for="item in productList" :key="item.id"
|
||||
@click="handleproduction(item)">
|
||||
<view class="product-name">
|
||||
{{item.name}}
|
||||
{{item.productName}}
|
||||
</view>
|
||||
<view class="product-rate">
|
||||
利率:{{item.rate}}%
|
||||
利率:{{item.expectedReturnRate}}%
|
||||
</view>
|
||||
<view class="product-intro">
|
||||
产品简介:{{item.introduction}}
|
||||
</view>
|
||||
<view class="product-detail-link" @click="handleproduction(item)">
|
||||
查看详情
|
||||
公司:{{item.company}}
|
||||
</view>
|
||||
</view>
|
||||
<u-loadmore color="#666" :status="status" />
|
||||
@@ -53,10 +53,10 @@
|
||||
uni.getSystemInfo({
|
||||
success(res) {
|
||||
let screenHeight = res.screenHeight
|
||||
uni.createSelectorQuery().in(instance?.proxy).select("#tabbarId").boundingClientRect((data: any) => {
|
||||
uni.createSelectorQuery().in(instance?.proxy).select("#tabbarId").boundingClientRect((data : any) => {
|
||||
height.value = screenHeight - data.height
|
||||
}).exec()
|
||||
uni.createSelectorQuery().in(instance?.proxy).select("#searchFilterId").boundingClientRect((data: any) => {
|
||||
uni.createSelectorQuery().in(instance?.proxy).select("#searchFilterId").boundingClientRect((data : any) => {
|
||||
scrollHeight.value = height.value - data.height
|
||||
}).exec()
|
||||
}
|
||||
@@ -76,62 +76,31 @@
|
||||
// 加载数据
|
||||
const loadData = () => {
|
||||
if (status.value == 'nomore') return
|
||||
|
||||
|
||||
financeAPI.getList(params.value).then(res => {
|
||||
console.log('API返回数据:', res)
|
||||
|
||||
if (res.data && res.data.list) {
|
||||
// 检查数据结构并映射字段
|
||||
const mappedList = res.data.list.map((item: any, index: number) => ({
|
||||
id: item.id || index,
|
||||
name: item.productName || item.name || '未知产品',
|
||||
rate: item.interestRate || item.rate || '0',
|
||||
introduction: item.desc || item.introduction || item.productDesc || '暂无简介'
|
||||
}))
|
||||
|
||||
productList.value = productList.value.concat(mappedList)
|
||||
console.log('当前产品列表:', productList.value)
|
||||
productList.value = productList.value.concat(res.data.list)
|
||||
}
|
||||
|
||||
status.value = 'nomore'
|
||||
uni.stopPullDownRefresh()
|
||||
}).catch(err => {
|
||||
console.error('API调用失败:', err)
|
||||
status.value = 'nomore'
|
||||
uni.stopPullDownRefresh()
|
||||
})
|
||||
}
|
||||
|
||||
// 查看详情 - 传递完整产品数据
|
||||
const handleproduction = (item: any) => {
|
||||
console.log('点击查看详情,产品数据:', item)
|
||||
|
||||
// 确保数据包含必要的字段
|
||||
const productData = {
|
||||
name: item.name || '未知产品',
|
||||
rate: item.rate || '0',
|
||||
introduction: item.introduction || '暂无简介'
|
||||
}
|
||||
|
||||
console.log('准备传递的产品数据:', productData)
|
||||
|
||||
// 将产品数据转换为JSON字符串传递
|
||||
const encodedData = encodeURIComponent(JSON.stringify(productData))
|
||||
console.log('编码后的数据:', encodedData)
|
||||
|
||||
const handleproduction = (item : any) => {
|
||||
uni.navigateTo({
|
||||
url: `/pages/finance/production?productData=${encodedData}`
|
||||
url: `/pages/finance/production?id=${item.id}`
|
||||
})
|
||||
}
|
||||
|
||||
// 查询
|
||||
const handleSearch = () => {
|
||||
params.value = {
|
||||
page: 1,
|
||||
size: defaultSize,
|
||||
keyword: params.value.keyword
|
||||
}
|
||||
params.value.page = 1
|
||||
productList.value = []
|
||||
status.value = 'loadmore'
|
||||
loadData()
|
||||
}
|
||||
|
||||
@@ -199,12 +168,12 @@
|
||||
|
||||
// 移除产品简介显示 */
|
||||
.product-intro {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
line-height: 1.5;
|
||||
margin-bottom: 20rpx;
|
||||
display: block; // 确保显示
|
||||
}
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
line-height: 1.5;
|
||||
margin-bottom: 20rpx;
|
||||
display: block; // 确保显示
|
||||
}
|
||||
|
||||
.product-detail-link {
|
||||
font-size: 24rpx;
|
||||
|
||||
Reference in New Issue
Block a user