Browse Source

登录提示优化

lihuilin/feature-20251024095243-我的
ZhangYong 4 weeks ago
parent
commit
e0e17a258e
  1. 5
      pages/deepExploration/MainForceActions.vue
  2. 852
      pages/deepExploration/deepExploration.vue
  3. 5
      pages/deepExploration/stockSelectDetail.vue
  4. 16
      utils/http.js

5
pages/deepExploration/MainForceActions.vue

@ -1,4 +1,5 @@
<template> <template>
<LoginPrompt ref="loginPrompt"></LoginPrompt>
<view class="main"> <view class="main">
<!-- 顶部状态栏占位 --> <!-- 顶部状态栏占位 -->
<view class="top" :style="{height:iSMT+'px'}"></view> <view class="top" :style="{height:iSMT+'px'}"></view>
@ -89,6 +90,9 @@
import { import {
useDeepExplorationStore useDeepExplorationStore
} from '@/stores/modules/deepExploration' } from '@/stores/modules/deepExploration'
import {
getUserInfo
} from "@/api/member"
const deepExplorationStore = useDeepExplorationStore() const deepExplorationStore = useDeepExplorationStore()
@ -546,6 +550,7 @@
// onReady // onReady
onMounted(async () => { onMounted(async () => {
iSMT.value = uni.getSystemInfoSync().statusBarHeight iSMT.value = uni.getSystemInfoSync().statusBarHeight
getUserInfo()
await getServerData() // await getServerData() //
await handleModels() await handleModels()

852
pages/deepExploration/deepExploration.vue

@ -1,147 +1,110 @@
<template> <template>
<view class="main">
<!-- 顶部状态栏占位 -->
<view class="top" :style="{ height: iSMT + 'px' }"></view>
<!-- 标题图标部分 -->
<deepExploration_header
></deepExploration_header>
<view class="search">
<input
v-model="stockName"
class="searchInput"
type="text"
placeholder="请输入股票名称、股票代码"
placeholder-style="color: #A6A6A6; font-size: 22rpx;"
/>
<image
@click="searchStock"
class="seachIcon"
src="/static/deepExploration-images/search.png"
mode="aspectFill"
></image>
</view>
<!-- 四大功能模块 -->
<view class="select">
<view class="selectItem" @click="toMain('主力追踪')">
<image
class="img"
src="/static/deepExploration-images/icon3.png"
mode="aspectFill"
></image>
<view class="txt">主力追踪</view>
</view>
<view class="selectItem" @click="toMain('主力雷达')">
<image
class="img"
src="/static/deepExploration-images/icon2.png"
mode="aspectFill"
></image>
<view class="txt">主力雷达</view>
</view>
<view class="selectItem" @click="toMain('主力解码')">
<image
class="img"
src="/static/deepExploration-images/icon1.png"
mode="aspectFill"
></image>
<view class="txt">主力解码</view>
</view>
<view class="selectItem" @click="toMain('主力资金流')">
<image
class="img"
src="/static/deepExploration-images/icon4.png"
mode="aspectFill"
></image>
<view class="txt">主力资金流</view>
</view>
</view>
<!-- 灰色间隔 -->
<view class="gap"></view>
<!-- 选股策略 -->
<view class="stockSelection">
<view class="stockSelection_top">
<view class="txt">
<text>选股策略</text>
</view>
<view class="viewAll" @click="viewAll">
<text>查看全部</text>
</view>
</view>
<view class="stockSelection_content">
<view class="selectionItem">
<view class="header">
<view class="left">
<image
src="/static/deepExploration-images/plus.png"
mode="aspectFill"
></image>
<text>抄底卖顶</text>
</view>
<view class="right">
<image
src="/static/deepExploration-images/Americle.png"
mode="aspectFill"
></image>
<text>美股</text>
</view>
</view>
<view class="content">
<view class="contentTitle">
<view class="contentTitle_name">股票名称</view>
<view class="contentTitle_close">最新收盘价</view>
<view class="contentTitle_price">选股价格</view>
</view>
<view class="contentItem">
<view class="row" v-for="(item, index) in stockData" :key="index">
<view class="nameItem">{{ item.tscode }}</view>
<view class="closeItem">{{ item.close }}</view>
<view class="priceItem">{{ item.preClose }}</view>
</view>
</view>
</view>
</view>
</view>
<view class="stockSelection_content">
<view class="selectionItem">
<view class="header">
<view class="left">
<image
src="/static/deepExploration-images/plus.png"
mode="aspectFill"
></image>
<text>波段行情</text>
</view>
<view class="right">
<image
src="/static/deepExploration-images/Americle.png"
mode="aspectFill"
></image>
<text>美股</text>
</view>
</view>
<view class="content">
<view class="contentTitle">
<view class="contentTitle_name">股票名称</view>
<view class="contentTitle_close">最新收盘价</view>
<view class="contentTitle_price">选股价格</view>
</view>
<view class="contentItem">
<view class="row" v-for="(item, index) in stockDataByName" :key="index">
<view class="nameItem">{{ item.tscode }}</view>
<view class="closeItem">{{ item.close }}</view>
<view class="priceItem">{{ item.preClose }}</view>
</view>
</view>
</view>
</view>
</view>
</view>
<footerBar class="static-footer" :type="type"></footerBar>
</view>
<LoginPrompt ref="loginPrompt"></LoginPrompt>
<view class="main">
<!-- 顶部状态栏占位 -->
<view class="top" :style="{ height: iSMT + 'px' }"></view>
<!-- 标题图标部分 -->
<deepExploration_header></deepExploration_header>
<view class="search">
<input v-model="stockName" class="searchInput" type="text" placeholder="请输入股票名称、股票代码"
placeholder-style="color: #A6A6A6; font-size: 22rpx;" />
<image @click="searchStock" class="seachIcon" src="/static/deepExploration-images/search.png"
mode="aspectFill"></image>
</view>
<!-- 四大功能模块 -->
<view class="select">
<view class="selectItem" @click="toMain('主力追踪')">
<image class="img" src="/static/deepExploration-images/icon3.png" mode="aspectFill"></image>
<view class="txt">主力追踪</view>
</view>
<view class="selectItem" @click="toMain('主力雷达')">
<image class="img" src="/static/deepExploration-images/icon2.png" mode="aspectFill"></image>
<view class="txt">主力雷达</view>
</view>
<view class="selectItem" @click="toMain('主力解码')">
<image class="img" src="/static/deepExploration-images/icon1.png" mode="aspectFill"></image>
<view class="txt">主力解码</view>
</view>
<view class="selectItem" @click="toMain('主力资金流')">
<image class="img" src="/static/deepExploration-images/icon4.png" mode="aspectFill"></image>
<view class="txt">主力资金流</view>
</view>
</view>
<!-- 灰色间隔 -->
<view class="gap"></view>
<!-- 选股策略 -->
<view class="stockSelection">
<view class="stockSelection_top">
<view class="txt">
<text>选股策略</text>
</view>
<view class="viewAll" @click="viewAll">
<text>查看全部</text>
</view>
</view>
<view class="stockSelection_content">
<view class="selectionItem">
<view class="header">
<view class="left">
<image src="/static/deepExploration-images/plus.png" mode="aspectFill"></image>
<text>抄底卖顶</text>
</view>
<view class="right">
<image src="/static/deepExploration-images/Americle.png" mode="aspectFill"></image>
<text>美股</text>
</view>
</view>
<view class="content">
<view class="contentTitle">
<view class="contentTitle_name">股票名称</view>
<view class="contentTitle_close">最新收盘价</view>
<view class="contentTitle_price">选股价格</view>
</view>
<view class="contentItem">
<view class="row" v-for="(item, index) in stockData" :key="index">
<view class="nameItem">{{ item.tscode }}</view>
<view class="closeItem">{{ item.close }}</view>
<view class="priceItem">{{ item.preClose }}</view>
</view>
</view>
</view>
</view>
</view>
<view class="stockSelection_content">
<view class="selectionItem">
<view class="header">
<view class="left">
<image src="/static/deepExploration-images/plus.png" mode="aspectFill"></image>
<text>波段行情</text>
</view>
<view class="right">
<image src="/static/deepExploration-images/Americle.png" mode="aspectFill"></image>
<text>美股</text>
</view>
</view>
<view class="content">
<view class="contentTitle">
<view class="contentTitle_name">股票名称</view>
<view class="contentTitle_close">最新收盘价</view>
<view class="contentTitle_price">选股价格</view>
</view>
<view class="contentItem">
<view class="row" v-for="(item, index) in stockDataByName" :key="index">
<view class="nameItem">{{ item.tscode }}</view>
<view class="closeItem">{{ item.close }}</view>
<view class="priceItem">{{ item.preClose }}</view>
</view>
</view>
</view>
</view>
</view>
</view>
<footerBar class="static-footer" :type="type"></footerBar>
</view>
</template> </template>
<script setup> <script setup>
@ -151,40 +114,59 @@
} from 'vue' } from 'vue'
import footerBar from '@/components/footerBar.vue' import footerBar from '@/components/footerBar.vue'
import deepExploration_header from '@/components/deepExploration_header.vue' import deepExploration_header from '@/components/deepExploration_header.vue'
import { stocSelectApi, stocSelectByNameApi } from '@/api/deepExploration/deepExploration.js'
const type = ref("deepExploration");
const iSMT = ref(0);
//
const toMain = (val) => {
if (val == "主力追踪") {
uni.navigateTo({
url: "/pages/deepExploration/MainForceActions?index=1",
});
} else if (val == "主力雷达") {
uni.navigateTo({
url: "/pages/deepExploration/MainForceActions?index=2",
});
} else if (val == "主力解码") {
uni.navigateTo({
url: "/pages/deepExploration/MainForceActions?index=3",
});
} else if (val == "主力资金流") {
uni.navigateTo({
url: "/pages/deepExploration/MainForceActions?index=4",
});
}
};
const stockName = ref("");
//
const searchStock = () => {
console.log("搜索参数:", stockName.value);
uni.navigateTo({
url: `/pages/deepExploration/MainForceActions?stockName=${stockName.value}`,
});
};
import {
stocSelectApi,
stocSelectByNameApi
} from '@/api/deepExploration/deepExploration.js'
import {
useUserStore
} from '@/stores/modules/userInfo.js'
import {
getUserInfo
} from "@/api/member"
const userInfo = ref({})
const type = ref("deepExploration");
const iSMT = ref(0);
//
const toMain = (val) => {
if (val == "主力追踪") {
uni.navigateTo({
url: "/pages/deepExploration/MainForceActions?index=1",
});
} else if (val == "主力雷达") {
uni.navigateTo({
url: "/pages/deepExploration/MainForceActions?index=2",
});
} else if (val == "主力解码") {
uni.navigateTo({
url: "/pages/deepExploration/MainForceActions?index=3",
});
} else if (val == "主力资金流") {
uni.navigateTo({
url: "/pages/deepExploration/MainForceActions?index=4",
});
}
};
const stockName = ref("");
//
const searchStock = () => {
console.log("搜索参数:", stockName.value);
console.log(userInfo.value.isVisitor);
if (userInfo.value.isVisitor) {
uni.showToast({
title: '请登录',
icon: 'none'
})
return
}
uni.navigateTo({
url: `/pages/deepExploration/MainForceActions?stockName=${stockName.value}`,
});
};
// //
const viewAll = () => { const viewAll = () => {
@ -199,7 +181,10 @@ const searchStock = () => {
// //
const loadStockSelection = async () => { const loadStockSelection = async () => {
try { try {
const res = await stocSelectApi({ language: 'cn', size: 3 })
const res = await stocSelectApi({
language: 'cn',
size: 3
})
// console.log(':', typeof res === 'object' ? JSON.stringify(res) : res) // console.log(':', typeof res === 'object' ? JSON.stringify(res) : res)
const raw = res?.data const raw = res?.data
const listCandidates = [ const listCandidates = [
@ -232,14 +217,19 @@ const searchStock = () => {
} }
} catch (e) { } catch (e) {
console.error('选股策略接口调用失败', e) console.error('选股策略接口调用失败', e)
uni.showToast({ title: '选股策略加载失败', icon: 'none' })
uni.showToast({
title: '选股策略加载失败',
icon: 'none'
})
} }
} }
// //
const loadStockSelectionByName = async () => { const loadStockSelectionByName = async () => {
try { try {
const res = await stocSelectByNameApi({ name: '安徽' })
const res = await stocSelectByNameApi({
name: '安徽'
})
const raw = res?.data const raw = res?.data
const dataObj = raw?.data || raw const dataObj = raw?.data || raw
let list = [] let list = []
@ -268,7 +258,10 @@ const searchStock = () => {
} }
} catch (e) { } catch (e) {
console.error('按名称(安徽)接口调用失败', e) console.error('按名称(安徽)接口调用失败', e)
uni.showToast({ title: '安徽板块加载失败', icon: 'none' })
uni.showToast({
title: '安徽板块加载失败',
icon: 'none'
})
} }
} }
@ -276,257 +269,260 @@ const searchStock = () => {
// //
iSMT.value = uni.getSystemInfoSync().statusBarHeight; iSMT.value = uni.getSystemInfoSync().statusBarHeight;
// //
getUserInfo()
loadStockSelection() loadStockSelection()
loadStockSelectionByName() // loadStockSelectionByName() //
userInfo.value = useUserStore().userInfo
console.log('用户信息', userInfo.value);
}) })
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.main {
width: 100%;
min-height: 100vh; //
height: auto; //
overflow-y: auto; //
background-color: #fff;
padding-bottom: 120rpx; //
.search {
position: relative;
display: flex;
align-items: center;
background-color: #f3f3f3;
width: calc(100% - 60rpx);
height: 80rpx;
border-radius: 50rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
padding: 0 40rpx;
margin: 15rpx 30rpx 0 30rpx;
.seachIcon {
position: absolute;
right: 50rpx;
width: 32rpx;
height: 32rpx;
}
.searchInput {
color: #111;
}
}
.select {
display: flex;
padding: 60rpx 10rpx 30rpx 30rpx;
gap: 70rpx;
align-items: center;
justify-content: center;
.selectItem {
.img {
width: 80rpx;
height: 80rpx;
display: block;
margin: 0 auto;
}
.txt {
color: #6a6a6a;
font-family: "PingFang SC";
font-size: 11px;
font-style: normal;
font-weight: 400;
line-height: 14.5px;
margin-top: 13rpx;
white-space: nowrap;
}
}
}
.gap {
width: 100%;
height: 15rpx;
background-color: #f3f3f3;
}
.stockSelection {
width: 100%;
padding: 32rpx 15rpx;
.stockSelection_top {
display: flex;
justify-content: space-between;
.txt {
color: #000000;
font-family: "PingFang SC";
font-size: 38rpx;
font-style: normal;
font-weight: 400;
line-height: 50rpx;
}
.viewAll {
background-color: #000000;
border-radius: 10rpx;
padding: 6rpx 20rpx;
color: #ffffff;
font-family: "PingFang SC";
font-size: 10rpx;
font-style: normal;
font-weight: 100;
line-height: 29rpx;
height: 40rpx;
}
}
.stockSelection_content {
.selectionItem {
background-color: #f3f3f3;
padding: 30rpx 15rpx 17rpx 30rpx;
border-radius: 30rpx;
margin-top: 30rpx;
.header {
display: flex;
justify-content: space-between;
align-items: center;
.left {
display: flex;
justify-content: space-between;
align-items: center;
image {
display: flex;
justify-content: center;
align-items: center;
width: 15rpx;
height: 15rpx;
}
text {
margin-left: 15rpx;
color: #000000;
font-family: "PingFang SC";
font-size: 28rpx;
font-style: normal;
font-weight: 400;
line-height: 18.5px;
}
}
.right {
display: flex;
justify-content: space-between;
align-items: center;
border-radius: 15rpx;
background-color: #ffffff;
padding: 6rpx 20rpx;
image {
display: flex;
justify-content: center;
align-items: center;
width: 40rpx;
height: 26.5rpx;
}
text {
margin-left: 10rpx;
color: #6a6a6a;
font-family: "PingFang SC";
font-size: 18rpx;
font-style: normal;
font-weight: 400;
line-height: 24rpx;
}
}
}
.content {
.contentTitle {
display: flex;
color: #6a6a6a;
font-family: "PingFang SC";
font-size: 11px;
font-style: normal;
font-weight: 400;
line-height: 14.5px;
margin-top: 24rpx;
margin-bottom: 20rpx;
.contentTitle_name {
width: 100rpx;
}
.contentTitle_close {
width: 130rpx;
margin-left: 260rpx;
}
.contentTitle_price {
width: 120rpx;
margin-left: 60rpx;
}
}
.contentItem {
.row {
display: flex;
box-shadow: 0 -2rpx 5rpx rgba(0, 0, 0, 0.05);
padding: 10rpx 0;
margin-bottom: 10rpx;
.nameItem {
width: 260rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #000000;
font-family: "PingFang SC";
font-size: 13px;
font-style: normal;
font-weight: 400;
line-height: 17.5px;
}
.closeItem {
width: 120rpx;
margin-left: 100rpx;
color: #25ba5d;
font-family: "PingFang SC";
font-size: 13px;
font-style: normal;
font-weight: 400;
line-height: 17.5px;
}
.priceItem {
width: 120rpx;
margin-left: 73rpx;
color: #25ba5d;
font-family: "PingFang SC";
font-size: 13px;
font-style: normal;
font-weight: 400;
line-height: 17.5px;
}
}
}
}
}
}
}
.static-footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
}
}
* {
box-sizing: border-box;
}
.main {
width: 100%;
min-height: 100vh; //
height: auto; //
overflow-y: auto; //
background-color: #fff;
padding-bottom: 120rpx; //
.search {
position: relative;
display: flex;
align-items: center;
background-color: #f3f3f3;
width: calc(100% - 60rpx);
height: 80rpx;
border-radius: 50rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
padding: 0 40rpx;
margin: 15rpx 30rpx 0 30rpx;
.seachIcon {
position: absolute;
right: 50rpx;
width: 32rpx;
height: 32rpx;
}
.searchInput {
color: #111;
}
}
.select {
display: flex;
padding: 60rpx 10rpx 30rpx 30rpx;
gap: 70rpx;
align-items: center;
justify-content: center;
.selectItem {
.img {
width: 80rpx;
height: 80rpx;
display: block;
margin: 0 auto;
}
.txt {
color: #6a6a6a;
font-family: "PingFang SC";
font-size: 11px;
font-style: normal;
font-weight: 400;
line-height: 14.5px;
margin-top: 13rpx;
white-space: nowrap;
}
}
}
.gap {
width: 100%;
height: 15rpx;
background-color: #f3f3f3;
}
.stockSelection {
width: 100%;
padding: 32rpx 15rpx;
.stockSelection_top {
display: flex;
justify-content: space-between;
.txt {
color: #000000;
font-family: "PingFang SC";
font-size: 38rpx;
font-style: normal;
font-weight: 400;
line-height: 50rpx;
}
.viewAll {
background-color: #000000;
border-radius: 10rpx;
padding: 6rpx 20rpx;
color: #ffffff;
font-family: "PingFang SC";
font-size: 10rpx;
font-style: normal;
font-weight: 100;
line-height: 29rpx;
height: 40rpx;
}
}
.stockSelection_content {
.selectionItem {
background-color: #f3f3f3;
padding: 30rpx 15rpx 17rpx 30rpx;
border-radius: 30rpx;
margin-top: 30rpx;
.header {
display: flex;
justify-content: space-between;
align-items: center;
.left {
display: flex;
justify-content: space-between;
align-items: center;
image {
display: flex;
justify-content: center;
align-items: center;
width: 15rpx;
height: 15rpx;
}
text {
margin-left: 15rpx;
color: #000000;
font-family: "PingFang SC";
font-size: 28rpx;
font-style: normal;
font-weight: 400;
line-height: 18.5px;
}
}
.right {
display: flex;
justify-content: space-between;
align-items: center;
border-radius: 15rpx;
background-color: #ffffff;
padding: 6rpx 20rpx;
image {
display: flex;
justify-content: center;
align-items: center;
width: 40rpx;
height: 26.5rpx;
}
text {
margin-left: 10rpx;
color: #6a6a6a;
font-family: "PingFang SC";
font-size: 18rpx;
font-style: normal;
font-weight: 400;
line-height: 24rpx;
}
}
}
.content {
.contentTitle {
display: flex;
color: #6a6a6a;
font-family: "PingFang SC";
font-size: 11px;
font-style: normal;
font-weight: 400;
line-height: 14.5px;
margin-top: 24rpx;
margin-bottom: 20rpx;
.contentTitle_name {
width: 100rpx;
}
.contentTitle_close {
width: 130rpx;
margin-left: 260rpx;
}
.contentTitle_price {
width: 120rpx;
margin-left: 60rpx;
}
}
.contentItem {
.row {
display: flex;
box-shadow: 0 -2rpx 5rpx rgba(0, 0, 0, 0.05);
padding: 10rpx 0;
margin-bottom: 10rpx;
.nameItem {
width: 260rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #000000;
font-family: "PingFang SC";
font-size: 13px;
font-style: normal;
font-weight: 400;
line-height: 17.5px;
}
.closeItem {
width: 120rpx;
margin-left: 100rpx;
color: #25ba5d;
font-family: "PingFang SC";
font-size: 13px;
font-style: normal;
font-weight: 400;
line-height: 17.5px;
}
.priceItem {
width: 120rpx;
margin-left: 73rpx;
color: #25ba5d;
font-family: "PingFang SC";
font-size: 13px;
font-style: normal;
font-weight: 400;
line-height: 17.5px;
}
}
}
}
}
}
}
.static-footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
}
}
* {
box-sizing: border-box;
}
</style> </style>

5
pages/deepExploration/stockSelectDetail.vue

@ -1,4 +1,5 @@
<template> <template>
<LoginPrompt ref="loginPrompt"></LoginPrompt>
<view class="main"> <view class="main">
<view class="table"> <view class="table">
<view class="tableHeader"> <view class="tableHeader">
@ -53,6 +54,9 @@
import { useUserStore } from '@/stores/modules/userInfo.js' import { useUserStore } from '@/stores/modules/userInfo.js'
import { useDeviceStore } from '@/stores/modules/deviceInfo.js' import { useDeviceStore } from '@/stores/modules/deviceInfo.js'
import { LoginApi } from '@/api/start/login.js' import { LoginApi } from '@/api/start/login.js'
import {
getUserInfo
} from "@/api/member"
const tabsData = ref(['全部', '抄底卖顶', '波段行情', '价值投资', '资金及仓位管理', ]) const tabsData = ref(['全部', '抄底卖顶', '波段行情', '价值投资', '资金及仓位管理', ])
const activeTab = ref('全部') const activeTab = ref('全部')
@ -223,6 +227,7 @@
onMounted(() => { onMounted(() => {
loadStrategy() loadStrategy()
getUserInfo()
}) })
</script> </script>

16
utils/http.js

@ -75,10 +75,10 @@ export const http = (options) => {
loginStore.setLoginInfo("false") loginStore.setLoginInfo("false")
console.log("2loginStore.loginInfo", loginStore.loginInfo); console.log("2loginStore.loginInfo", loginStore.loginInfo);
uni.showToast({
title: '请先登录',
icon: 'none'
})
// uni.showToast({
// title: '请先登录',
// icon: 'none'
// })
} }
resolve(result.data) resolve(result.data)
} else if (result.statusCode === 401) { } else if (result.statusCode === 401) {
@ -91,10 +91,10 @@ export const http = (options) => {
}) })
reject(result) reject(result)
} else { } else {
uni.showToast({
title: (result.data).msg || '请求失败',
icon: 'none'
})
// uni.showToast({
// title: (result.data).msg || '请求失败',
// icon: 'none'
// })
reject(result) reject(result)
} }
}, },

Loading…
Cancel
Save