Commit 5edfc23a by lanse

update

parent a990a4b4
...@@ -2,10 +2,11 @@ import request from '@/utils/http' ...@@ -2,10 +2,11 @@ import request from '@/utils/http'
import config from '@/utils/config' import config from '@/utils/config'
// import { userInfoParameterType } from './indexType' // import { userInfoParameterType } from './indexType'
export function getUserMessageApi() { export function getUserMessageApi(params) {
return request({ return request({
url: `${config.baseURL}/index/get_user_message`, url: `${config.baseURL}/index/get_user_message`,
method: 'get' method: 'get',
params
}) })
} }
export function getUserMessageDetailApi() { export function getUserMessageDetailApi() {
......
...@@ -10,7 +10,7 @@ const messages = { ...@@ -10,7 +10,7 @@ const messages = {
sousuolishi: '検索履歴', sousuolishi: '検索履歴',
tip1: 'データなし', tip1: 'データなし',
tip2: '読み込み中...', tip2: '読み込み中...',
tip3: '銘柄コードを検索' tip3: '銘柄コードを検索'
}, },
real_name: { real_name: {
realName: 'ご本人確認', realName: 'ご本人確認',
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<div class="title">{{ item?.name }}</div> <div class="title">{{ item?.name }}</div>
<div class="daima">{{ item?.shuzidaima }}</div> <div class="daima">{{ item?.shuzidaima }}</div>
<div class="date"> <div class="date">
<span>{{ t('ipo.shijian') }}</span> <span>{{ t('jiaoyi.chouqianri') }}</span>
<span>{{ item.chouqiandate }}</span> <span>{{ item.chouqiandate }}</span>
</div> </div>
</div> </div>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<view class="button" @click="login">{{ t('login.button_text') }}</view> <view class="button" @click="login">{{ t('login.button_text') }}</view>
<view class="text" @click="goPage('/subPackages/register/register')">{{ t('login.register') }}</view> <view class="text" @click="goPage('/subPackages/register/register')">{{ t('login.register') }}</view>
<view class="button circle_button" @click="goPage('/subPackages/register/register')">{{ t('register.tip4') }}</view> <view class="button circle_button" @click="goPage('/subPackages/register/register')">{{ t('register.tip4') }}</view>
<view class="text" @click="openKefu()">{{ t('login.kefu') }}</view> <!-- <view class="text" @click="openKefu()">{{ t('login.kefu') }}</view> -->
</view> </view>
</view> </view>
</view> </view>
...@@ -53,9 +53,9 @@ const getCzhiurlFn = async () => { ...@@ -53,9 +53,9 @@ const getCzhiurlFn = async () => {
} }
} }
const openKefu = () => { // const openKefu = () => {
window.open(kefu_url.value) // window.open(kefu_url.value)
} // }
const checkArr = [ const checkArr = [
{ key: 'account', message: t('login.account_error') }, { key: 'account', message: t('login.account_error') },
......
...@@ -4,20 +4,35 @@ import { ref } from 'vue' ...@@ -4,20 +4,35 @@ import { ref } from 'vue'
import { getUserMessageApi, getUserMessageDetailApi } from '@/api/message' import { getUserMessageApi, getUserMessageDetailApi } from '@/api/message'
import { onShow } from '@dcloudio/uni-app' import { onShow } from '@dcloudio/uni-app'
import { timestampToDate2 } from '@/common/common' import { timestampToDate2 } from '@/common/common'
import { useCounterStore } from '@/store/store'
const store = useCounterStore()
const { t } = useI18n() const { t } = useI18n()
const UserMessageList = ref([]) const UserMessageList = ref([])
const messgaeInfo = ref({})
onShow(() => { onShow(() => {
getUserMessage() getUserMessage()
getUserMessageDetail() getUserMessageDetail()
}) })
const getUserMessage = async () => { const params = ref({
const res = await getUserMessageApi() page: 1
})
const getUserMessage = async (type?) => {
if (type === 'plus') {
if (params.value.page < messgaeInfo.value.last_page) {
params.value.page += 1
} else {
return
}
}
const res = await getUserMessageApi(params.value)
if (res.code === 1) { if (res.code === 1) {
UserMessageList.value = res.data.data messgaeInfo.value = res.data
if (params.value.page === 1) {
UserMessageList.value = res.data.data
} else {
UserMessageList.value = [...UserMessageList.value, ...res.data.data]
}
} }
} }
const getUserMessageDetail = async () => { const getUserMessageDetail = async () => {
...@@ -27,7 +42,7 @@ const getUserMessageDetail = async () => { ...@@ -27,7 +42,7 @@ const getUserMessageDetail = async () => {
<template> <template>
<Navigater :title="t('message.xiaoxi')" /> <Navigater :title="t('message.xiaoxi')" />
<view> <view>
<scroll-view scroll-y :style="{ height: `calc(${store.pageHeight} - 3.125rem)` }"> <scroll-view scroll-y class="container" @scrolltolower="getUserMessage('plus')">
<view v-for="(item, index) in UserMessageList" :key="index"> <view v-for="(item, index) in UserMessageList" :key="index">
<view class="createtime">{{ timestampToDate2(item.createtime) }}</view> <view class="createtime">{{ timestampToDate2(item.createtime) }}</view>
<view class="content">{{ item.content }}</view> <view class="content">{{ item.content }}</view>
...@@ -37,6 +52,10 @@ const getUserMessageDetail = async () => { ...@@ -37,6 +52,10 @@ const getUserMessageDetail = async () => {
</view> </view>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.container {
height: calc(var(--vh) * 100 - 3.13rem);
padding-bottom: 1rem;
}
.content { .content {
color: #fff; color: #fff;
background-color: rgba(10, 31, 54, 0.8); background-color: rgba(10, 31, 54, 0.8);
...@@ -49,6 +68,6 @@ const getUserMessageDetail = async () => { ...@@ -49,6 +68,6 @@ const getUserMessageDetail = async () => {
font-size: $uni-font-size-1; font-size: $uni-font-size-1;
color: #747474; color: #747474;
text-align: center; text-align: center;
margin-top: 0.625rem; padding-top: 0.625rem;
} }
</style> </style>
...@@ -42,10 +42,12 @@ const tabList: Ref[TabType] = ref([ ...@@ -42,10 +42,12 @@ const tabList: Ref[TabType] = ref([
const checkTab = (value: number) => { const checkTab = (value: number) => {
tabValue.value = value tabValue.value = value
tlPage.value = 1 jyPage.value = 1
tlData.value = [] jyData.value = []
czPage.value = 1 czPage.value = 1
czData.value = [] czData.value = []
tlPage.value = 1
tlData.value = []
getLiuShuiFn() getLiuShuiFn()
} }
...@@ -55,14 +57,24 @@ onMounted(() => { ...@@ -55,14 +57,24 @@ onMounted(() => {
const jyData: Ref[JyType] = ref([]) const jyData: Ref[JyType] = ref([])
const jyPage = ref(1) const jyPage = ref(1)
const jyLastPage = ref(1)
const czData: Ref[CzType] = ref([]) const czData: Ref[CzType] = ref([])
const czPage = ref(1) const czPage = ref(1)
const czLastPage = ref(1)
const tlData: Ref[CzType] = ref([]) const tlData: Ref[CzType] = ref([])
const tlPage = ref(1) const tlPage = ref(1)
const tlLastPage = ref(1)
const getLiuShuiFn = async () => { const getLiuShuiFn = async () => {
if (tabValue.value === 1 && czPage.value > czLastPage.value) {
return
} else if (tabValue.value === 2 && tlPage.value > tlLastPage.value) {
return
} else if (tabValue.value === 3 && jyPage.value > jyLastPage.value) {
return
}
showLoadingToast({ showLoadingToast({
message: t('search.tip2'), message: t('search.tip2'),
forbidClick: true, mask: true,
loadingType: 'spinner' loadingType: 'spinner'
}) })
isLoading.value = true isLoading.value = true
...@@ -79,9 +91,11 @@ const getLiuShuiFn = async () => { ...@@ -79,9 +91,11 @@ const getLiuShuiFn = async () => {
break break
} }
const res = await getLiuShuiApi({ type: tabValue.value, page }) const res = await getLiuShuiApi({ type: tabValue.value, page })
closeToast()
if (res.code === 1) { if (res.code === 1) {
if (tabValue.value === 3) { if (tabValue.value === 3) {
if (res.data.data.length) { jyLastPage.value = res.data.last_page
if (jyPage.value <= jyLastPage.value) {
jyPage.value++ jyPage.value++
} }
res.data.data.forEach((element) => { res.data.data.forEach((element) => {
...@@ -97,29 +111,28 @@ const getLiuShuiFn = async () => { ...@@ -97,29 +111,28 @@ const getLiuShuiFn = async () => {
jyData.value.push(element) jyData.value.push(element)
}) })
console.log(jyData.value)
} }
if (tabValue.value === 1) { if (tabValue.value === 1) {
czLastPage.value = res.data.last_page
if (czPage.value <= czLastPage.value) {
czPage.value++
}
res.data.data.forEach((element) => { res.data.data.forEach((element) => {
if (res.data.data.length) {
czPage.value++
}
czData.value.push(element) czData.value.push(element)
}) })
console.log(czData.value)
} }
if (tabValue.value === 2) { if (tabValue.value === 2) {
tlLastPage.value = res.data.last_page
if (tlPage.value <= tlLastPage.value) {
tlPage.value++
}
res.data.data.forEach((element) => { res.data.data.forEach((element) => {
if (res.data.data.length) {
tlPage.value++
}
tlData.value.push(element) tlData.value.push(element)
}) })
} }
} }
closeToast()
isLoading.value = false isLoading.value = false
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment