Commit 5edfc23a by lanse

update

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