Commit 3d00a528 by lanse

init

parents
module.exports = {
env: {
browser: true,
es2021: true
},
extends: ['plugin:vue/vue3-recommended', 'standard', 'plugin:prettier/recommended'],
parserOptions: {
ecmaVersion: 'latest',
parser: '@typescript-eslint/parser',
sourceType: 'module'
},
plugins: ['vue', '@typescript-eslint'],
rules: {
'vue/multi-word-component-names': 'off',
camelcase: 'off',
'@typescript-eslist/camelcase': 0
},
globals: {
defineProps: 'readonly',
defineEmits: 'readonly',
defineExpose: 'readonly',
withDefaults: 'readonly',
uni: 'readonly'
}
}
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
module.exports = {
// 根据自己项目需要
printWidth: 200, //单行长度
tabWidth: 2, //缩进长度
semi: false, //句末使用分号
singleQuote: true, //使用单引号
endOfLine: 'auto', //自动检测并保留行尾符号(如 \n 或 \r\n)
bracketSpacing: true, // 在对象的大括号之间添加空格 { foo: bar }。
trailingComma: 'none', // 句末逗号
}
<!DOCTYPE html>
<html lang="jp" translate="no">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />'
)
</script>
<title>Squarepoint</title>
<!--preload-links-->
<!--app-context-->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="white" />
<meta name="format-detection" content="telephone=no, email=no" />
<meta name="renderer" content="webkit" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="HandheldFriendly" content="true" />
<meta name="screen-orientation" content="portrait" />
<meta name="x5-orientation" content="portrait" />
<meta name="full-screen" content="yes" />
<meta name="x5-fullscreen" content="true" />
<meta name="browsermode" content="application" />
<meta name="x5-page-mode" content="app" />
<meta name="msapplication-navbutton-color" content="#fff" />
<meta name="msapplication-TileColor" content="#fff" />
<meta name="theme-color" content="#fff" />
<meta name="apple-mobile-web-app-title" content="Squarepoint" />
<meta name="google" content="notranslate" />
<!-- Apple Touch Icons -->
<link rel="apple-touch-icon" sizes="180x180" href="./src/static/icon.png" />
<!-- Android Chrome Icons -->
<link rel="icon" type="image/png" sizes="192x192" href="./src/static/icon.png" />
<link rel="icon" type="image/png" sizes="512x512" href="./src/static/icon.png" />
<!-- Windows Tiles -->
<meta name="msapplication-TileImage" content="./src/static/icon.png" />
<meta name="msapplication-TileColor" content="#ffffff" />
<!-- General Icons -->
<link rel="icon" type="image/png" sizes="32x32" href="./src/static/icon.png" />
<link rel="icon" type="image/png" sizes="16x16" href="./src/static/icon.png" />
<link rel="icon" type="image/x-icon" href="./src/static/icon.png" />
<link rel="icon" href="./src/static/icon.png" />
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
{
"name": "japan",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"dev:app": "uni -p app",
"dev:custom": "uni -p",
"dev:h5": "uni",
"dev:h5:ssr": "uni --ssr",
"dev:mp-alipay": "uni -p mp-alipay",
"dev:mp-baidu": "uni -p mp-baidu",
"dev:mp-kuaishou": "uni -p mp-kuaishou",
"dev:mp-lark": "uni -p mp-lark",
"dev:mp-qq": "uni -p mp-qq",
"dev:mp-toutiao": "uni -p mp-toutiao",
"dev:mp-weixin": "uni -p mp-weixin",
"dev:quickapp-webview": "uni -p quickapp-webview",
"dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei",
"dev:quickapp-webview-union": "uni -p quickapp-webview-union",
"build:app": "uni build -p app",
"build:custom": "uni build -p",
"build:h5": "uni build",
"build:h5:ssr": "uni build --ssr",
"build:mp-alipay": "uni build -p mp-alipay",
"build:mp-baidu": "uni build -p mp-baidu",
"build:mp-kuaishou": "uni build -p mp-kuaishou",
"build:mp-lark": "uni build -p mp-lark",
"build:mp-qq": "uni build -p mp-qq",
"build:mp-toutiao": "uni build -p mp-toutiao",
"build:mp-weixin": "uni build -p mp-weixin",
"build:quickapp-webview": "uni build -p quickapp-webview",
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
"build:quickapp-webview-union": "uni build -p quickapp-webview-union",
"lint": "eslint . --ext .vue,.js,.ts,.jsx,.tsx --fix"
},
"dependencies": {
"@dcloudio/uni-app": "^3.0.0-alpha-3040220220310005",
"@dcloudio/uni-app-plus": "^3.0.0-alpha-3040220220310005",
"@dcloudio/uni-components": "^3.0.0-alpha-3040220220310005",
"@dcloudio/uni-h5": "^3.0.0-alpha-3040220220310005",
"@dcloudio/uni-mp-alipay": "^3.0.0-alpha-3040220220310005",
"@dcloudio/uni-mp-baidu": "^3.0.0-alpha-3040220220310005",
"@dcloudio/uni-mp-kuaishou": "^3.0.0-alpha-3040220220310005",
"@dcloudio/uni-mp-lark": "^3.0.0-alpha-3040220220310005",
"@dcloudio/uni-mp-qq": "^3.0.0-alpha-3040220220310005",
"@dcloudio/uni-mp-toutiao": "^3.0.0-alpha-3040220220310005",
"@dcloudio/uni-mp-weixin": "^3.0.0-alpha-3040220220310005",
"@dcloudio/uni-quickapp-webview": "^3.0.0-alpha-3040220220310005",
"@dcloudio/uni-ui": "^1.4.12",
"@vitejs/plugin-vue": "2.3.3",
"animate.css": "^4.1.1",
"axios": "^1.7.4",
"echarts": "^5.5.1",
"klinecharts": "^9.8.10",
"pinia": "^2.0.12",
"vant": "^4.9.4",
"vue": "^3.2.31",
"vue-i18n": "^9.14.0"
},
"devDependencies": {
"@dcloudio/types": "^2.5.18",
"@dcloudio/uni-automator": "^3.0.0-alpha-3040220220310005",
"@dcloudio/uni-cli-shared": "^3.0.0-alpha-3040220220310005",
"@dcloudio/vite-plugin-uni": "^3.0.0-alpha-3040220220310005",
"@types/node": "^17.0.23",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"autoprefixer": "^10.4.20",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-promise": "^5.2.0",
"eslint-plugin-vue": "^8.5.0",
"postcss": "^8.4.41",
"prettier": "^2.6.1",
"sass": "^1.49.9",
"sass-loader": "13",
"tailwindcss": "^3.4.10",
"typescript": "^4.6.2",
"vite": "^5.4.10",
"vite-plugin-eslint": "^1.3.0"
},
"main": "index.js",
"repository": "http://27.124.4.157:9070/root/japan.git",
"author": "ran <gz@gz.com>"
}
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
'postcss-px-to-viewport-8-plugin': {
unitToConvert: 'px', // 要转化的单位
viewportWidth: 1920, // UI设计稿的宽度
unitPrecision: 6, // 转换后的精度,即小数点位数
propList: ['*'], // 指定转换的css属性的单位,*代表全部css属性的单位都进行转换
viewportUnit: 'vw', // 指定需要转换成的视窗单位,默认vw
fontViewportUnit: 'vw', // 指定字体需要转换成的视窗单位,默认vw
selectorBlackList: ['ignore-'], // 指定不转换为视窗单位的类名,
minPixelValue: 1, // 默认值1,小于或等于1px则不进行转换
mediaQuery: true, // 是否在媒体查询的css代码中也进行转换,默认false
replace: true, // 是否转换后直接更换属性值
// exclude: [/node_modules/], // 设置忽略文件,用正则做目录名匹配
exclude: [],
landscape: false // 是否处理横屏情况
}
}
}
<script setup lang="ts">
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
import { useCounterStore } from '@/store/store'
import { useRouter } from 'vue-router'
const store = useCounterStore()
// store.getSystemInfo()
// store.getUserInfo()
onLaunch(() => {
store.token = uni.getStorageSync('token') || null
store.userId = uni.getStorageSync('userId') || null
store.userInfo = uni.getStorageSync('userInfo') || null
// show()
const router = useRouter()
router.beforeEach((to, from, next) => {
hide(next)
})
router.afterEach(() => {
setTimeout(() => show(), 10)
})
})
onShow(() => {})
onHide(() => {})
const hide = (callback) => {
const classList = document.querySelector('uni-page').classList
classList.add('animation-before', 'animation-leave')
classList.remove('animation-show')
setTimeout(() => {
classList.remove('animation-before', 'animation-leave')
callback && callback()
}, 300)
}
const show = () => {
const classList = document.querySelector('uni-page')?.classList
classList.add('animation-before')
setTimeout(() => {
classList.add('animation-enter', 'animation-after', 'animation-show')
setTimeout(() => {
classList.remove('animation-before', 'animation-after', 'animation-enter')
}, 300)
}, 20)
}
</script>
<style lang="scss">
.uni-input-input {
color: #fff;
}
.tabbar {
border-radius: 0.625rem 0.625rem 0px 0px;
// box-shadow: 0px 0px 5px 2px #f4f4f4;
}
body {
background: linear-gradient(168deg, #08182b 0.74%, #1b5191 99.61%);
// fill: linear-gradient(191deg, #f3e0eb 0.38%, #f2e7fd 10.66%, #fff 26.2%);
}
::v-deep .uni-toast__icon {
margin: 0.625rem auto 0 !important;
}
.uni-modal {
padding: 0 1.25rem 1.25rem 1.25rem;
border-radius: 0.625rem;
.uni-modal__ft:after {
display: none;
}
.uni-modal__btn:after {
display: none;
}
.uni-modal__btn_default {
width: 8.4375rem;
height: 3.0625rem;
border-radius: 1.5625rem;
background: #efefff;
color: #6a69e9 !important;
font-size: 1rem;
margin-right: 0.625rem;
}
.uni-modal__btn_primary {
width: 8.4375rem;
height: 3.0625rem;
border-radius: 1.5625rem;
background: #6a69e9;
font-size: 1rem;
color: #fff !important;
}
}
.up {
color: $uni-text-color-red;
}
.down {
color: $uni-text-color-green;
}
.ping {
color: $uni-text-color;
}
.rotate {
transform: rotate(180deg);
}
.nodata {
font-size: $uni-font-size-lg;
text-align: center;
margin-top: 25.6px;
}
uni-tabbar {
display: none;
}
/* #ifdef H5 */
uni-page {
opacity: 1;
transition: all 0.3s ease;
}
uni-page.animation-before {
/* 在页面上使用 transform 会导致页面内的 fixed 定位渲染为 absolute,需要在动画完成后移除 */
transform: translateY(0.625rem);
opacity: 0;
}
uni-page.animation-leave {
transition: all 0.3s ease;
}
uni-page.animation-enter {
transition: all 0.3s ease;
}
uni-page.animation-show {
opacity: 1;
}
uni-page.animation-after {
/* 在页面上使用 transform 会导致页面内的 fixed 定位渲染为 absolute,需要在动画完成后移除 */
transform: translateY(0);
}
/* #endif */
</style>
export interface BankInfoType {
bank_address: string
bank_card: string
bank_code: string
bank_name: string
shiming_name: string
}
import request from '@/utils/http'
import config from '@/utils/config'
import { BankInfoType } from './indexType'
// 获取银行卡列表
export function getBankListApi() {
return request({
url: `${config.baseURL}/index/withdrawal`,
method: 'get'
})
}
// 添加银行卡
export function addBankApi(data: BankInfoType) {
return request({
url: `${config.baseURL}/index/setUserInfo`,
method: 'post',
data
})
}
// 添加银行卡
export function delBankApi(id: number | string) {
return request({
url: `${config.baseURL}/index/bankcardDelete`,
method: 'get',
params: {
id
}
})
}
import request from '@/utils/http'
import config from '@/utils/config'
import { ChangePasswordParameterType } from './type'
// 修改登录密码
export function updatePasswordApi(data: ChangePasswordParameterType) {
return request({
url: `${config.baseURL}/user/updatePassword`,
method: 'post',
data
})
}
export interface ChangePasswordParameterType {
old_password: string
new_Password: string
repeat_new_password: string
}
import request from '@/utils/http'
import config from '@/utils/config'
import { getTickerKType, idType, buyGupiaoType, getJiaoyiDetailType, shengouType, buyDadanType, buyHongliType, buyGendanType, sellGendanType, rongziType } from './indexType'
// 热门股票
export function getXinguApplyApi() {
return request({
url: `${config.baseURL}/jiaoyi_list/xinguApply`,
method: 'get'
})
}
// 热门股票
export function getHotGupiaoApi() {
return request({
url: `${config.baseURL}/index/popular_product`,
method: 'get'
})
}
export function check_token() {
return request({
url: `${config.baseURL}/index/check_token`,
method: 'get'
})
}
// 股票K线
export function getTickerKApi(params: getTickerKType) {
return request({
url: `${config.baseURL}/product/getTickerK`,
method: 'get',
params
})
}
// 股票详情
export function getGupiaoDetailApi(params: idType) {
return request({
url: `${config.baseURL}/product/getGupiaoDetail`,
method: 'get',
params
})
}
// 收藏股票
export function collectApi(data: idType) {
return request({
url: `${config.baseURL}/index/addZixuan`,
method: 'post',
data
})
}
// 收藏股票详情
export function collectDetailApi(params: idType) {
return request({
url: `${config.baseURL}/index/isZixuan`,
method: 'get',
params
})
}
// 获取手续费
export function getUserMoneyApi() {
return request({
url: `${config.baseURL}/user/getUserMoney`,
method: 'post'
})
}
// 收藏股票
export function buyGupiaoApi(data: buyGupiaoType) {
return request({
url: `${config.baseURL}/index/buyGupiao`,
method: 'post',
data
})
}
// 交易列表
export function getJiaoyiListApi() {
return request({
url: `${config.baseURL}/jiaoyi_list/getList`,
method: 'get'
})
}
// 交易详情
export function getJiaoyiDetailApi(params: getJiaoyiDetailType) {
return request({
url: `${config.baseURL}/index/getOrderDetail`,
method: 'get',
params
})
}
// 賣出股票
export function sellGupiaoApi(data: getJiaoyiDetailType) {
return request({
url: `${config.baseURL}/index/PingCang`,
method: 'post',
data
})
}
// 撤单
export function cancelOrdeApi(data: getJiaoyiDetailType) {
return request({
url: `${config.baseURL}/index/cancel_order`,
method: 'post',
data
})
}
// 新股列表
export function getXinguListApi() {
return request({
url: `${config.baseURL}/index/getXingu`,
method: 'get'
})
}
// 申购股票
export function shengouApi(data: shengouType) {
return request({
url: `${config.baseURL}/index/shengouXingu`,
method: 'post',
data
})
}
// 大單監控
export function getDadanListApi() {
return request({
url: `${config.baseURL}/index/monitoring_list`,
method: 'get'
})
}
// 大單監控
export function getUserMonitoringApi() {
return request({
url: `${config.baseURL}/index/user_monitoring`,
method: 'get'
})
}
// 購買大單
export function buyDadanApi(data: buyDadanType) {
return request({
url: `${config.baseURL}/index/buy_monitoring`,
method: 'post',
data
})
}
// 紅利股票
export function getHongliListApi() {
return request({
url: `${config.baseURL}/index/get_discount_gupiao`,
method: 'get'
})
}
// 購買红利
export function buyHongliApi(data: buyHongliType) {
return request({
url: `${config.baseURL}/index/add_discount_gupiao`,
method: 'post',
data
})
}
// 智慧跟单
export function getGendanListApi() {
return request({
url: `${config.baseURL}/index/follow_list`,
method: 'get'
})
}
// 購買跟單
export function buyGendanApi(data: buyGendanType) {
return request({
url: `${config.baseURL}/index/follow_order`,
method: 'post',
data
})
}
// 智慧跟单記錄
export function getGendanRecordListApi() {
return request({
url: `${config.baseURL}/index/user_follow_record`,
method: 'get'
})
}
// 賣出跟單
export function sellGendanApi(data: sellGendanType) {
return request({
url: `${config.baseURL}/index/sell_follow_record`,
method: 'post',
data
})
}
// 融资状态
export function getRongziApi() {
return request({
url: `${config.baseURL}/index/applicationStatus`,
method: 'get'
})
}
// 申请融资
export function rongziApi(data: rongziType) {
return request({
url: `${config.baseURL}/index/saveCA`,
// url: `${config.baseURL}/CreditApplication/saveCA`,
method: 'post',
data
})
}
export interface getGupiaoType {
code: string
}
export interface getTickerKType {
id: number
kline_type: number
}
export interface idType {
id: string
}
export interface buyGupiaoType {
buytype: number
fangxiang: string
price: number
pro_id: number
shuliang: number
ganggan_ratio: number
}
export interface getJiaoyiDetailType {
id: string
type: string
}
export interface shengouType {
id: string
number: number
price: string
}
export interface buyDadanType {
monitoring_id: string
num: number
}
export interface buyHongliType {
dividend_id: number
num: number
}
export interface buyGendanType {
follow_id: number
money: number
}
export interface sellGendanType {
follow_id: number
}
export interface rongziType {
money: any
name: any
card: any
address: any
phone: any
mail: any
income: any
credit: any
qualifications: any
}
import request from '@/utils/http'
import config from '@/utils/config'
import { loginType, registerType, sendSmsType } from './loginType'
// 登录
export function loginApi(data: loginType) {
return request({
url: `${config.baseURL}/user/login`,
method: 'post',
data
})
}
// 注册
export function registerApi(data: registerType) {
return request({
url: `${config.baseURL}/user/register`,
method: 'post',
data
})
}
// 验证码
export function sendSmsApi(data: sendSmsType) {
return request({
url: `${config.baseURL}/sms/send`,
method: 'post',
data
})
}
export interface loginType {
account: string
password: string
}
export interface registerType {
account: string
password: string
verfiy_code: string
}
export interface sendSmsType {
mobile: string
event: string
}
import request from '@/utils/http'
import config from '@/utils/config'
import { getGupiaoListType } from './marketType'
// 股票列表
export function getGupiaoListApi(params: getGupiaoListType) {
return request({
url: `${config.baseURL}/product/get_stock_list`,
method: 'get',
params
})
}
// 获取收藏股票列表
export function getZixuanlApi() {
return request({
url: `${config.baseURL}/index/getZixuan`,
method: 'get'
})
}
export interface idType {
id: string
}
export interface getGupiaoListType {
page: number
}
import request from '@/utils/http'
import config from '@/utils/config'
// import { userInfoParameterType } from './indexType'
export function getUserMessageApi() {
return request({
url: `${config.baseURL}/index/get_user_message`,
method: 'get'
})
}
export function getUserMessageDetailApi() {
return request({
url: `${config.baseURL}/index/get_user_message_detail`,
method: 'get'
})
}
import request from '@/utils/http'
import config from '@/utils/config'
import { paramsType } from './indexType'
// 获取用户实名状态
export function getOrderDetailApi(params: paramsType) {
return request({
url: `${config.baseURL}/index/getOrderDetail`,
method: 'get',
params
})
}
export interface paramsType {
id: number | string
type: number | string
}
import request from '@/utils/http'
import config from '@/utils/config'
import { RealNameType } from './indexType'
// 获取用户实名状态
export function getRealnameApi() {
return request({
url: `${config.baseURL}/user/getRealname`,
method: 'get'
})
}
export function subRealnameApi(data: RealNameType) {
return request({
url: `${config.baseURL}/user/subRealname`,
method: 'post',
data
})
}
export interface RealNameType {
true_name: string
id_card: string
id_card_img_1: string
id_card_img_2: string
status_msg?: string
status: string | number
}
import request from '@/utils/http'
import config from '@/utils/config'
import { paramsType } from './recordType'
// 获取新闻列表
export function getNewsApi(params: paramsType) {
return request({
url: `${config.baseURL}/index/getNews`,
method: 'get',
params
})
}
// 获取新闻详情
export function getNewDetailApi(id: number | string) {
return request({
url: `${config.baseURL}/index/newsDetail`,
method: 'get',
params: { id }
})
}
export interface recordType {
account: string
password: string
}
export interface paramsType {
page: number
}
export interface newDetailType {
content: string
createtime: number | string
id: number | string
image: string
other_id: number
title: string
updatetime: number
}
import request from '@/utils/http'
import config from '@/utils/config'
import { SearchParameterType } from './indexType'
export function searchStock(data: SearchParameterType) {
return request({
url: `${config.baseURL}/index/Search`,
method: 'post',
data
})
}
export interface SearchParameterType {
code: string | number
}
export interface StockType {
name: string
id: number
price: number | string
shuzidaima: number | string
zhangdiebaifenbi: number | string
zhangdieshu: number | string
}
import request from '@/utils/http'
import config from '@/utils/config'
import { LiuShuiType } from './indexType'
export function getLiuShuiApi(params: LiuShuiType) {
return request({
url: `${config.baseURL}/index/getLiuShui`,
method: 'get',
params
})
}
export interface LiuShuiType {
type: number
page: number
}
export interface JyType {
detailed: string
createtime: string
agent_id: number
id: number
money: number | string
order_sn: string
product_name: string
status: number | string
updatetime: string | null
user_id: number
name: string
gpCode: string | number
gpName: string
}
export interface CzType {
beizhu: ?string
createtime: string
id: number
money: number | string
order_sn: string
remark: string
status: number | string
type: string | number
}
import request from '@/utils/http'
import config from '@/utils/config'
import { PayPasswordType } from './indexType'
export function setPayPasswordApi(data: PayPasswordType) {
return request({
url: `${config.baseURL}/index/setPayPassword`,
method: 'post',
data
})
}
export interface PayPasswordType {
new_pay_password: string
old_pay_password: string
re_pay_password: string
user_id: number
}
import request from '@/utils/http'
import config from '@/utils/config'
import { userInfoParameterType } from './indexType'
export function getUserInfoApi(params: userInfoParameterType) {
return request({
url: `${config.baseURL}/index/getUserInfo`,
method: 'get',
params
})
}
// 获取客服地址
export function getCzhiurlApi() {
return request({
url: `${config.baseURL}/index/getCzhiurl`,
method: 'get'
})
}
// 获取客服地址
export function getWithdrawal(user_id: number | null) {
return request({
url: `${config.baseURL}/index/withdrawal`,
method: 'get',
params: {
user_id
}
})
}
export interface userInfoParameterType {
user_id: number | string
}
import request from '@/utils/http'
import config from '@/utils/config'
import { WithdrawalType } from './indexType'
export function submitWithdrawalApi(data: WithdrawalType) {
return request({
url: `${config.baseURL}/index/submitWithdrawal`,
method: 'post',
data
})
}
export interface WithdrawalType {
bankcard_id: number | string
money: number | string
pass: number | string
user_id: number | string
}
// 前往下一个页面
export function goPage(e: string) {
uni.navigateTo({
url: e
})
}
// 返回下一个页面
export function goBack(delta: number = 1) {
uni.navigateBack({
delta
})
}
// 删除当前页并前往下一个页面
export function reLaunch(e: string) {
uni.reLaunch({
url: e
})
}
// 跳转到tabbar
export function switchTab(e: string) {
uni.switchTab({
url: e
})
}
// 时间戳转换
export const timestempToDate = (timestamp: number, n: string = '-') => {
const date = new Date(timestamp + 3600000 * 9)
const year = date.getUTCFullYear()
const month = date.getUTCMonth() - 1 < 10 ? `0${date.getUTCMonth() - 1}` : date.getUTCMonth() - 1
const day = date.getUTCDate() < 10 ? `0${date.getUTCDate()}` : date.getUTCDate()
const hour = date.getUTCHours() < 10 ? `0${date.getUTCHours()}` : date.getUTCHours()
const minute = date.getUTCMinutes() < 10 ? `0${date.getUTCMinutes()}` : date.getUTCMinutes()
return `${year}${n}${month}${n}${day} ${hour}:${minute}`
}
export function timestampToDate2(timestamp: number) {
const date = new Date(timestamp + 3600000 * 9)
const year = date.getUTCFullYear() // 获取年份
let month = date.getUTCMonth() + 1 // 获取月份,需要+1因为月份从0开始
let day = date.getUTCDate() // 获取日
let hours = date.getUTCHours() // 获取小时
let minutes = date.getUTCMinutes() // 获取分钟
let seconds = date.getUTCSeconds() // 获取秒钟
// 格式化月份、日期、小时、分钟和秒
month = month < 10 ? '0' + month : month
day = day < 10 ? '0' + day : day
hours = hours < 10 ? '0' + hours : hours
minutes = minutes < 10 ? '0' + minutes : minutes
seconds = seconds < 10 ? '0' + seconds : seconds
// 组合成日期时间字符串
return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds
}
// 获取股票颜色
export const getColor = (item: any, type: boolean = false) => {
if (type && item.zhangdiebaifenbi > 0) {
return 'up rotate'
}
return item.zhangdiebaifenbi > 0 ? 'up' : item.zhangdiebaifenbi === 0 ? 'ping' : 'down'
}
// 验证输入框内容是否为空
interface checkType {
key: string
message: string
}
interface dataType {
[key: string]: string | null
}
export function checkInput(checkArr: Array<checkType>, data: dataType) {
for (const i in checkArr) {
if (!data[checkArr[i].key]) {
uni.showToast({
title: checkArr[i].message,
icon: 'none'
})
return false
}
}
return true
}
// 价格转换(加逗号)
export const changeMoney = (money: any) => {
money = Number(money).toFixed(1)
money += ''
const x = money.split('.')
let x1 = x[0]
const x2 = x.length > 1 ? '.' + x[1] : ''
const reg = /(\d+)(\d{3})/
while (reg.test(x1)) {
x1 = x1.replace(reg, '$1' + ',' + '$2')
}
return x1 + x2
}
let socketOpen = false
let id = null
function sendSocketMessage(msg: Object) {
if (socketOpen) {
uni.sendSocketMessage({
data: JSON.stringify(msg),
success(res) {
console.log('发送成功:', res, JSON.stringify(msg))
}
})
}
id = setInterval(function () {
uni.sendSocketMessage({
data: JSON.stringify('heartbeat')
})
}, 10000)
}
function reciveSocketMessage(callback: any) {
console.log(socketOpen)
if (socketOpen) {
uni.onSocketMessage(function (res) {
// console.log('收到服务器内容:' + JSON.parse(JSON.stringify(res)))
if (res.data === 'pong') return
if (res.data === '订阅成功STOCK') return
callback && callback(res.data)
})
}
}
function listenFun(sendMsg: object, callback: any) {
if (!socketOpen) {
uni.connectSocket({
// url: 'wss://wss.zlsgrants.com/'
url: 'https://ws.squarepointwebwss.com/'
// url: 'ws://43.135.14.11:2101/'
})
}
uni.onSocketOpen(function (res) {
console.log('ws已打开')
socketOpen = true
if (socketOpen) {
// if (sendMsg.length > 0) {
console.log('ws已链接')
sendSocketMessage(sendMsg)
// }
reciveSocketMessage(callback)
}
})
}
function listenSend(sendMsg = [], callback: any) {
if (socketOpen) {
if (sendMsg.length > 0) {
console.log('ws已链接')
sendSocketMessage(sendMsg)
}
reciveSocketMessage(callback)
}
}
function closeSocket() {
clearInterval(id)
uni.closeSocket({})
socketOpen = false
uni.onSocketClose(function (res) {
console.log('WebSocket 已关闭!')
socketOpen = false
})
}
export default {
listenFun,
listenSend,
closeSocket
}
<template>
<view class="tabbar">
<view v-for="item in list" :key="item.id" class="bar" @click="switchTab(item)">
<view class="card" :class="{ active: props.id == item.id }">
<image class="image" :src="props.id == item.id ? item.selectIcon : item.icon"></image>
<view class="text">{{ item.text }}</view>
</view>
</view>
</view>
</template>
<script setup lange="ts">
import { computed, ref } from 'vue'
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
const url = '../../static/image/tabbar/'
const props = defineProps({
id: {
type: Number,
default: 0
}
})
const text1 = computed(() => t('tabbar.index'))
const text2 = computed(() => t('tabbar.market'))
const text3 = computed(() => t('tabbar.jiaoyi'))
const text4 = computed(() => t('tabbar.record'))
const text5 = computed(() => t('tabbar.user'))
const list = ref([
{
path: '/pages/index/index',
icon: `${url}index.png`,
selectIcon: `${url}index_select2.png`,
text: text1,
id: 0
},
{
path: '/pages/market/market',
icon: `${url}market.png`,
selectIcon: `${url}market_select2.png`,
text: text2,
id: 1
},
{
path: '/pages/jiaoyi/jiaoyi',
icon: `${url}market.png`,
selectIcon: `${url}market_select2.png`,
text: text3,
id: 2
},
{
path: '/pages/record/record',
icon: `${url}record.png`,
selectIcon: `${url}record_select2.png`,
text: text4,
id: 3
},
{
path: '/pages/user/user',
icon: `${url}user.png`,
selectIcon: `${url}user_select2.png`,
text: text5,
id: 4
}
])
const switchTab = (item) => {
if (item.path) {
uni.switchTab({
url: item.path
})
}
}
</script>
<style scoped lang="scss">
.isIphoneX {
padding-bottom: 2.13rem !important;
}
.tabbar {
width: 100%;
// height: 5.5rem;
height: 4.375rem;
background: #08182b;
display: flex;
justify-content: space-around;
position: fixed;
z-index: 1000;
bottom: 0;
// border-top: 0.03rem solid #1b3224;
.bar {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
}
.card {
width: 3.59rem;
// height: 3.59rem;
border-radius: 0.63rem;
// background-color: #fff;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.image {
width: 1.875rem;
height: 1.875rem;
// margin: 0.38rem auto 0;
}
.text {
font-size: 0.65rem;
color: #a0a5b0;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
word-break: break-all;
font-weight: bold;
}
}
.active {
// background-color: #50aff0;
.text {
color: #fff;
}
}
}
</style>
<template>
<view class="navigator">
<slot name="left"></slot>
<view v-if="porps.isShowBack" class="back" @click="goBack">
<image src="@/static/4.png"></image>
</view>
<view class="title">{{ porps.title }}</view>
<slot name="right"></slot>
</view>
</template>
<script lang="ts" setup>
const porps = defineProps({
title: {
type: String,
default: ''
},
isShowBack: {
type: Boolean,
default: true
}
})
const goBack = () => {
uni.navigateBack({})
}
</script>
<style lang="scss" scoped>
.navigator {
height: 3.13rem;
// background-color: #fff;
position: relative;
display: flex;
justify-content: center;
align-items: center;
}
.back {
position: absolute;
left: 0;
height: 100%;
padding-left: 1.0625rem;
display: flex;
align-items: center;
image {
width: 0.625rem;
height: 1.0547rem;
}
}
.title {
font-size: 0.9375rem;
color: #fff;
}
</style>
<script setup lang="ts">
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
const props = defineProps({
title: {
type: Number,
default: 0
}
})
</script>
<template>
<view class="box">
<image src="/static/nodata.png" class="img" />
<view v-if="!props.title" class="title">{{ t('common.nodata') }}</view>
<view v-else class="title">{{ props.title }}</view>
</view>
</template>
<style lang="scss" scoped>
.box {
margin: 5.9063rem auto 0;
width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.img {
width: 6.875rem;
height: 3.1875rem;
}
.title {
color: #75b9fe;
font-size: 0.75rem;
margin-top: 1.25rem;
}
}
</style>
<script setup lang="ts">
import { ref } from 'vue'
import { useI18n } from 'vue-i18n'
// import { showToast } from 'vant'
const { t } = useI18n()
const searchValue = ref('')
// const onSearch = () => {}
// const onCancel = () => showToast('取消')
const goUser = () => {
uni.switchTab({
url: '/pages/user/user'
})
}
const goPage = () => {
uni.navigateTo({
url: '/subPackages/search/search'
})
}
</script>
<template>
<view class="nav-box">
<image src="/static/image/user/touxiang.png" style="width: 1.7813rem; height: 1.7813rem; margin-right: 0.625rem; border-radius: 1.25rem"></image>
<view class="input_wrap">
<image src="/static/image/searchNavigation/search.png" class="search-img" />
<input v-model="searchValue" cursor-color="#b3b3b3" :placeholder="t('search.tip3')" style="margin-left: 10px" @click="goPage" />
</view>
<image src="/static/image/searchNavigation/set.png" class="set-box" @click="goUser" />
</view>
</template>
<style lang="scss" scoped>
// input::-webkit-input-placeholder {
// /* placeholder颜色 */
// // color: #aab2bd;
// /* placeholder字体大小 */
// font-size: 0.75rem !important;
// }
.uni-input-placeholder {
font-size: 0.75rem !important;
}
.nav-box {
top: 0;
left: 0;
width: 100%;
height: 3.125rem;
display: flex;
justify-content: center;
align-items: center;
z-index: 999;
.input_wrap {
display: flex;
align-items: center;
width: 16.7188rem;
height: 1.8125rem;
border-radius: 1.25rem;
// border: 0.0625rem solid #46abef;
background-color: #08182b;
}
.search-img {
margin-left: 0.44rem;
width: 0.875rem;
height: 0.875rem;
}
::v-deep.uni-input-input {
color: #b3b3b3 !important;
font-size: 0.75rem !important;
}
uni-input {
flex: 1;
}
.set-box {
width: 1.3125rem;
height: 1.1875rem;
margin-left: 0.5938rem;
}
}
</style>
/// <reference types="vite/client" />
declare module '*.vue' {
import { DefineComponent } from 'vue'
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
const component: DefineComponent<{}, {}, any>
export default component
}
import { createI18n } from 'vue-i18n'
import jp from './ja'
import cn from './cn'
import en from './en'
import sp from './sp'
import fr from './fr'
// 引入的不同语言文件
const messages = {
jp,
cn,
en,
sp,
fr
}
// uni.setStorageSync('locale', 'jp')
// console.log(uni.getStorageSync('locale'), 'localelocalelocale')
let locale = 'jp'
if (uni.getStorageSync('locale') === '') {
uni.setStorageSync('locale', 'jp')
} else {
locale = uni.getStorageSync('locale')
}
// 这个类型可以自己配置,毕竟每个人做的都不一样
const i18n: any = createI18n({
legacy: false, // 使用 Composition API 模式,则需要将其设置为false
globalInjection: true, // 全局生效$t
locale: locale, // 默认cn翻译
messages // ES6解构
})
export default i18n
import { createSSRApp } from 'vue'
import App from './App.vue'
// import '@/style/base/normalize/normalize.css'
import '@/style/index.scss'
import i18n from '@/langurage/index'
import NotData from '@/components/notData/index.vue'
import Navigater from '@/components/navigator/navigator.vue'
import { Switch, Dialog, Icon, Button, Field, Search, Loading, Popup, Stepper, Cell, CellGroup, Picker, Image as VanImage, Badge, TextEllipsis } from 'vant'
import 'vant/lib/index.css'
import 'animate.css/animate.min.css'
import './style/tailwind.scss'
import { createPinia } from 'pinia'
const pinia = createPinia()
// uni.setStorageSync('locale', 'jp')
export function createApp() {
const app = createSSRApp(App)
.use(pinia)
.use(i18n)
.use(Icon)
.use(Button)
.use(Field)
.use(Loading)
.use(Search)
.use(Popup)
.use(Stepper)
.use(Cell)
.use(CellGroup)
.use(Picker)
.use(VanImage)
.use(Badge)
.use(TextEllipsis)
.use(Dialog)
.use(Switch)
app.component('NotData', NotData)
app.component('Navigater', Navigater)
return {
app
}
}
{
"name": "",
"appid": "",
"description": "",
"versionName": "1.0.0",
"versionCode": "100",
"transformPx": false,
/* 5+App特有相关 */
"app-plus": {
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
/* 模块配置 */
"modules": {},
/* 应用发布信息 */
"distribute": {
/* android打包配置 */
"android": {
"permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios打包配置 */
"ios": {},
/* SDK配置 */
"sdkConfigs": {}
}
},
/* 快应用特有相关 */
"quickapp": {},
/* 小程序特有相关 */
"mp-weixin": {
"appid": "",
"setting": {
"urlCheck": false
},
"usingComponents": true
},
"mp-alipay": {
"usingComponents": true
},
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao": {
"usingComponents": true
},
"uniStatistics": {
"enable": false
},
"vueVersion": "3",
"h5": {
"template": "index.html",
"router": {
"mode": "hash",
"base": "/japan3/"
}
}
}
{
"pages": [
{
"path": "subPackages/indexLoading/indexLoading",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/index/index",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/market/market",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/jiaoyi/jiaoyi",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/record/record",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/user/user",
"style": {
"navigationStyle": "custom"
}
}
],
"subPackages": [
{
"root": "subPackages/login",
"pages": [
{
"path": "login",
"style": {
"navigationStyle": "custom"
}
}
]
},
{
"root": "subPackages/order",
"pages": [
{
"path": "order",
"style": {
"navigationStyle": "custom"
}
}
]
},
{
"root": "subPackages/message",
"pages": [
{
"path": "message",
"style": {
"navigationStyle": "custom"
}
}
]
},
{
"root": "subPackages/index",
"pages": [
{
"path": "gupiaoDetail/gupiaoDetail",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "ipo/ipo",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "dadan/dadan",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "hongli/hongli",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "gendan/gendan",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "gendan/record",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "rongzi/rongzi",
"style": {
"navigationStyle": "custom"
}
}
]
},
{
"root": "subPackages/jiaoyi",
"pages": [
{
"path": "jiaoyiDetail/jiaoyiDetail",
"style": {
"navigationStyle": "custom"
}
}
]
},
{
"root": "subPackages/bankAccount",
"pages": [
{
"path": "bankAccount",
"style": {
"navigationStyle": "custom"
}
}
]
},
{
"root": "subPackages/bankAccount",
"pages": [
{
"path": "accountLog",
"style": {
"navigationStyle": "custom"
}
}
]
},
{
"root": "subPackages/search",
"pages": [
{
"path": "search",
"style": {
"navigationStyle": "custom"
}
}
]
},
{
"root": "subPackages/webview",
"pages": [
{
"path": "webview",
"style": {
"navigationStyle": "custom"
}
}
]
},
{
"root": "subPackages/withdrawal",
"pages": [
{
"path": "withdrawal",
"style": {
"navigationStyle": "custom"
}
}
]
},
{
"root": "subPackages/real_name",
"pages": [
{
"path": "real_name",
"style": {
"navigationStyle": "custom"
}
}
]
},
{
"root": "subPackages/seting",
"pages": [
{
"path": "seting",
"style": {
"navigationStyle": "custom"
}
}
]
},
{
"root": "subPackages/details",
"pages": [
{
"path": "details",
"style": {
"navigationStyle": "custom"
}
}
]
},
{
"root": "subPackages/recharge",
"pages": [
{
"path": "recharge",
"style": {
"navigationStyle": "custom"
}
}
]
},
{
"root": "subPackages/transactionPassions",
"pages": [
{
"path": "transactionPassions",
"style": {
"navigationStyle": "custom"
}
}
]
},
{
"root": "subPackages/switchLanguage",
"pages": [
{
"path": "switchLanguage",
"style": {
"navigationStyle": "custom"
}
}
]
},
{
"root": "subPackages/confirm",
"pages": [
{
"path": "confirm",
"style": {
"navigationStyle": "custom"
}
}
]
},
{
"root": "subPackages/customerService",
"pages": [
{
"path": "customerService",
"style": {
"navigationStyle": "custom"
}
}
]
},
{
"root": "subPackages/changePassword",
"pages": [
{
"path": "changePassword",
"style": {
"navigationStyle": "custom"
}
}
]
},
{
"root": "subPackages/transactionLog",
"pages": [
{
"path": "transactionLog",
"style": {
"navigationStyle": "custom"
}
}
]
},
{
"root": "subPackages/logout",
"pages": [
{
"path": "logout",
"style": {
"navigationStyle": "custom"
}
}
]
},
{
"root": "subPackages/register",
"pages": [
{
"path": "register",
"style": {
"navigationStyle": "custom"
}
}
]
}
],
"tabBar": {
"color": "rgb(0, 0, 0)",
"backgroundColor": "rgb(255, 255, 255)",
"selectedColor": "rgb(80, 175, 240)",
"borderStyle": "black",
"list": [
{
"pagePath": "pages/index/index",
"iconPath": "static/image/tabbar/index.png",
"selectedIconPath": "static/image/tabbar/index_select.png",
"text": "首页"
},
{
"pagePath": "pages/market/market",
"iconPath": "static/image/tabbar/market.png",
"selectedIconPath": "static/image/tabbar/market_select.png",
"text": "市场"
},
{
"pagePath": "pages/jiaoyi/jiaoyi",
"iconPath": "static/image/tabbar/jiaoyi.png",
"selectedIconPath": "static/image/tabbar/jiaoyi_select.png",
"text": "交易"
},
{
"pagePath": "pages/record/record",
"iconPath": "static/image/tabbar/record_select.png",
"selectedIconPath": "static/image/tabbar/record.png",
"text": "资讯"
},
{
"pagePath": "pages/user/user",
"iconPath": "static/image/tabbar/user.png",
"selectedIconPath": "static/image/tabbar/user_select.png",
"text": "用户"
}
]
},
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "Squarepoint",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
"easycom": {
"autoscan": true,
"custom": {
"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"
}
},
"uniIdRouter": {}
}
<template>
<view id="indexChart" style="width: 100%; height: 154.206px"></view>
</template>
<script lang="ts" setup>
import { init, dispose } from 'klinecharts'
import { onMounted, onUnmounted, watch } from 'vue'
const props = defineProps({
value: {
type: Array,
default: () => []
}
})
let chart: any = null
watch(
() => props.value,
(newData) => {
chart?.applyNewData(newData)
},
{ deep: true }
)
const chartOption = {
// 蜡烛图
candle: {
type: 'candle_solid',
// 蜡烛柱
bar: {
upColor: '#ea3522',
downColor: '#78a386',
noChangeColor: '#888888',
upBorderColor: '#ea3522',
downBorderColor: '#78a386',
noChangeBorderColor: '#888888',
upWickColor: '#ea3522',
downWickColor: '#78a386',
noChangeWickColor: '#888888'
},
// 提示
tooltip: {
showRule: 'none'
}
},
// x轴
xAxis: {
show: true,
// x轴分割文字
tickText: {
color: '#fff'
}
},
// y轴
yAxis: {
// x轴分割文字
tickText: {
color: '#fff'
}
}
}
onMounted(() => {
chart = init('indexChart')
chart.setStyles(chartOption)
})
onUnmounted(() => {
dispose('chart')
})
// const chartOption = {
// // 网格线
// grid: {
// show: true,
// horizontal: {
// show: true,
// size: 1,
// color: '#333',
// style: 'dashed',
// dashedValue: [2, 2]
// },
// vertical: {
// show: true,
// size: 1,
// color: '#333',
// style: 'dashed',
// dashedValue: [2, 2]
// }
// },
// // x轴
// xAxis: {
// show: true,
// size: 'auto',
// // x轴线
// axisLine: {
// show: true,
// color: '#666',
// size: 1
// },
// // x轴分割文字
// tickText: {
// show: true,
// color: '#D9D9D9',
// family: 'Helvetica Neue',
// weight: 'normal',
// size: 12,
// marginStart: 4,
// marginEnd: 4
// },
// // x轴分割线
// tickLine: {
// show: true,
// size: 1,
// length: 3,
// color: '#666'
// }
// },
// // y轴
// yAxis: {
// show: true,
// size: 'auto',
// // 'left' | 'right'
// position: 'right',
// // 'normal' | 'percentage' | 'log'
// type: 'normal',
// inside: false,
// reverse: false,
// // y轴线
// axisLine: {
// show: true,
// color: '#666',
// size: 1
// },
// // x轴分割文字
// tickText: {
// show: true,
// color: '#D9D9D9',
// family: 'Helvetica Neue',
// weight: 'normal',
// size: 12,
// marginStart: 4,
// marginEnd: 4
// },
// // x轴分割线
// tickLine: {
// show: true,
// size: 1,
// length: 3,
// color: '#666'
// }
// },
// // 图表之间的分割线
// separator: {
// size: 1,
// color: '#666',
// fill: true,
// activeBackgroundColor: 'rgba(230, 230, 230, .15)'
// },
// crosshair: {
// show: true,
// // 十字光标水平线及文字
// horizontal: {
// show: true,
// line: {
// show: true,
// style: 'solid',
// size: 1,
// color: '#333'
// }
// },
// vertical: {
// show: true,
// line: {
// show: true,
// style: 'solid',
// size: 1,
// color: '#333'
// }
// }
// }
// }
</script>
<style scoped lang="scss"></style>
<template>
<!-- <view class="bg-[#fff]">
<SearchNavigation />
</view> -->
<Navigator :title="t('tabbar.record')" :is-show-back="false" />
<scroll-view scroll-y :style="{ height: 'calc(100vh - 50px)' }" @scrolltolower="getNews">
<view class="box">
<!-- <image src="../../static/image/record/banner.png" /> -->
<view class="record-list">
<NotData v-if="!recordList.length" />
<view v-for="item in recordList" :key="item.id" class="record-item" @click="onPage(item.id)">
<view class="record-item-title"> {{ item.title }} </view>
<view class="record-item-time">{{ formatTimestamp(item.updatetime * 1000) }}</view>
</view>
</view>
</view>
</scroll-view>
<CustomTabbar :id="3" />
</template>
<script lang="ts" setup>
import CustomTabbar from '@/components/custom-tabbar/custom-tabbar.vue'
import Navigator from '@/components/navigator/navigator.vue'
import { useI18n } from 'vue-i18n'
// import SearchNavigation from '@/components/searchNavigation/searchNavigation.vue'
import { ref } from 'vue'
import { getNewsApi } from '@/api/record/record'
import { onLoad } from '@dcloudio/uni-app'
import type { Ref } from 'vue'
import { closeToast, showLoadingToast } from 'vant'
const { t } = useI18n()
interface recordType {
id: number
image: string
title: string
updateTime: number
}
const onPage = (id: number | string) => {
uni.navigateTo({
url: '/subPackages/details/details?id=' + id
})
}
// 格式化时间
function formatTimestamp(timestamp: number | string) {
const date = new Date(timestamp)
const year = date.getFullYear()
// 月份从0开始,所以我们需要加1
const month = ('0' + (date.getMonth() + 1)).slice(-2)
const day = ('0' + date.getDate()).slice(-2)
const hours = ('0' + date.getHours()).slice(-2)
const minutes = ('0' + date.getMinutes()).slice(-2)
return `${year}/${month}/${day} ${hours}:${minutes}`
}
const recordList: Ref[recordType] = ref([])
onLoad(() => {
page = 1
recordList.value = []
getNews()
})
let page = 1
const getNews = async () => {
showLoadingToast({
message: t('toastText.tip1'),
forbidClick: true,
overlay: true,
loadingType: 'spinner'
})
const res = await getNewsApi({ page })
if (res.code === 1) {
closeToast()
page++
// res.data.data.forEach((element) => {
// recordList.value.push(element)
// })
res.data.data.forEach((item) => {
recordList.value.push(item)
})
}
}
</script>
<style scoped lang="scss">
.box {
margin-top: 0.625rem;
// padding-top: 3.5313rem;
.record-list {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
// margin-top: 0.5625rem;
.record-item {
width: 21.5625rem;
height: 5rem;
background: rgb(8, 24, 43, 0.7);
border-radius: 0.9375rem;
padding: 0.625rem;
position: relative;
margin-bottom: 0.4688rem;
.record-item-title {
font-weight: 500;
font-size: 0.8125rem;
color: #fff;
}
.record-item-time {
font-weight: 500;
font-size: 0.8125rem;
color: #a2a2a2;
position: absolute;
bottom: 0.3125rem;
right: 0.75rem;
}
}
}
uni-image {
width: 100%;
height: 4.5938rem;
}
}
</style>
<svg width="288" height="69" viewBox="0 0 288 69" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_1154_153)">
<path d="M138 15.1001H176.3V53.4001H138V15.1001Z" fill="#9FCBED"/>
<path d="M178.2 13.2V13.1H178.1V0H176.3V13.1H135.9V53.5H0V55.3H135.9V55.4H136V68.5H137.8V55.4H178.2V15H288V13.2H178.2ZM176.2 53.4H138V15.1H176.3V53.4H176.2ZM97.7 37.1H99.5L102.9 42.3H105.4L101.8 36.9C103.6 36.6 104.8 35 104.8 33.1C104.8 30.7 103.1 29.4 100 29.4H95.6V42.3H97.8L97.7 37.1ZM97.7 31.2H99.7C101.2 31.2 101.3 31.2 101.7 31.5C102.2 31.9 102.5 32.4 102.5 33.1C102.5 33.8 102.3 34.3 101.8 34.7C101.3 35.2 101 35.2 99.7 35.2H97.7V31.2ZM54.8 41.8C55.8 42.4 57.3 42.8 58.5 42.8C59.7 42.8 61.2 42.4 62.2 41.8C63.6 41 64.1 39.7 64.1 37.1V29.4H62V37.4C62 39.7 60.8 40.9 58.5 40.9C56.2 40.9 55 39.7 55 37.4V29.4H52.9V37.1C52.9 39.6 53.5 40.9 54.8 41.8ZM123.3 40.5H117.2V36.6H122.1V34.8H117.2V31.2H123.1V29.4H115V42.3H123.2L123.3 40.5ZM77 38.8H82.4L83.9 42.3H86L80.7 29H78.6L73.4 42.2V42.3H75.6L77 38.8ZM79.8 31.5L81.9 37H77.7L79.8 31.5ZM35.1 42.6C36.3 44 37 44.8 38 45.5C38.9 46.1 39.5 46.4 41 47L42.2 45.5H42.1C40.8 45 40.4 44.8 39.6 44.2C38.8 43.7 38.5 43.4 37.7 42.5C41.1 41.6 43.1 39.1 43.1 35.9C43.1 32 40.1 29.2 35.9 29.2C31.7 29.2 28.7 32 28.7 35.9C28.7 37.7 29.4 39.4 30.7 40.7C32.1 41.8 32.9 42.2 35.1 42.6ZM36.1 31C38.9 31 41 33.1 41 35.9C41 38.7 38.9 40.8 36.1 40.8C33.3 40.8 31.2 38.7 31.2 35.9C31.2 33.1 33.3 31 36.1 31ZM258.6 39.3C258.5 39 258.3 38.7 258.2 38.5L251 29.4H248.9V42.3H250.9V32.3C251 32.5 251.2 32.8 251.5 33.2L258.7 42.5H260.6V29.4H258.6V39.3ZM235.4 42.3H237.6V29.4H235.4V42.3ZM14.3 40.5C13.4 40.5 12.6 40.3 11.8 40C11.2 39.8 10.7 39.5 9.8 38.8L8.6 40.6C9.8 41.4 10.2 41.7 10.9 41.9C11.9 42.3 13 42.5 14.2 42.5C17.8 42.5 20.1 40.6 20.1 37.5C20.1 36.2 19.6 35 18.7 34.2C18.1 33.7 17.2 33.1 15.9 32.4C12.3 30.5 11.6 29.8 11.6 28.6C11.6 27.1 12.9 26.2 14.9 26.2C15.6 26.2 16.7 26.4 17.3 26.6C17.9 26.8 18.2 27 19.1 27.5L20.2 25.6C19.2 25 18.8 24.8 18 24.5C17.1 24.2 16.1 24.1 15 24.1C11.5 24.1 9.1 26 9.1 28.9C9.1 30.8 10.2 32.2 12.9 33.6C14.1 34.3 14.9 34.7 15.4 35C15.6 35.1 15.7 35.2 15.8 35.2C16.5 35.6 17 36.1 17.3 36.6C17.5 36.9 17.6 37.3 17.6 37.8C17.6 39.6 16.4 40.5 14.3 40.5ZM269.7 31.2H274.3V42.3H276.4V31.2H281V29.4H269.7V31.2ZM218 29.2C213.8 29.2 210.8 32 210.8 35.9C210.8 39.8 213.8 42.6 218 42.6C222.2 42.6 225.2 39.8 225.2 35.9C225.2 32 222.2 29.2 218 29.2ZM218 40.8C215.2 40.8 213.1 38.7 213.1 35.9C213.1 33.1 215.2 31 218 31C220.8 31 222.9 33.1 222.9 35.9C222.9 38.7 220.8 40.8 218 40.8ZM196.5 24.5H190.9V42.3H193.2V35.6H193.4C194.8 35.7 195.3 35.8 195.9 35.8C199.8 35.8 202.3 33.5 202.3 29.8C202.3 28.1 201.8 26.9 200.9 25.9C199.9 24.9 198.7 24.5 196.5 24.5ZM197.8 33.5C197.2 33.7 196.5 33.8 195.5 33.8C194.9 33.8 194.4 33.8 193.2 33.6V26.4H196.2C197.6 26.4 198.4 26.6 198.9 27.1C199.5 27.7 199.9 28.7 199.9 29.8C199.9 31.6 199.1 33 197.8 33.5Z" fill="black"/>
</g>
<defs>
<clipPath id="clip0_1154_153">
<rect width="288" height="68.5" fill="white"/>
</clipPath>
</defs>
</svg>
<svg width="288" height="69" viewBox="0 0 288 69" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_1154_159)">
<path d="M138 15.1001H176.3V53.4001H138V15.1001Z" fill="#9FCBED"/>
<path d="M178.2 13.2V13.1H178.1V0H176.3V13.1H135.9V53.5H0V55.3H135.9V55.4H136V68.5H137.8V55.4H178.2V15H288V13.2H178.2ZM176.2 53.4H138V15.1H176.3V53.4H176.2ZM97.7 37.1H99.5L102.9 42.3H105.4L101.8 36.9C103.6 36.6 104.8 35 104.8 33.1C104.8 30.7 103.1 29.4 100 29.4H95.6V42.3H97.8L97.7 37.1ZM97.7 31.2H99.7C101.2 31.2 101.3 31.2 101.7 31.5C102.2 31.9 102.5 32.4 102.5 33.1C102.5 33.8 102.3 34.3 101.8 34.7C101.3 35.2 101 35.2 99.7 35.2H97.7V31.2ZM54.8 41.8C55.8 42.4 57.3 42.8 58.5 42.8C59.7 42.8 61.2 42.4 62.2 41.8C63.6 41 64.1 39.7 64.1 37.1V29.4H62V37.4C62 39.7 60.8 40.9 58.5 40.9C56.2 40.9 55 39.7 55 37.4V29.4H52.9V37.1C52.9 39.6 53.5 40.9 54.8 41.8ZM123.3 40.5H117.2V36.6H122.1V34.8H117.2V31.2H123.1V29.4H115V42.3H123.2L123.3 40.5ZM77 38.8H82.4L83.9 42.3H86L80.7 29H78.6L73.4 42.2V42.3H75.6L77 38.8ZM79.8 31.5L81.9 37H77.7L79.8 31.5ZM35.1 42.6C36.3 44 37 44.8 38 45.5C38.9 46.1 39.5 46.4 41 47L42.2 45.5H42.1C40.8 45 40.4 44.8 39.6 44.2C38.8 43.7 38.5 43.4 37.7 42.5C41.1 41.6 43.1 39.1 43.1 35.9C43.1 32 40.1 29.2 35.9 29.2C31.7 29.2 28.7 32 28.7 35.9C28.7 37.7 29.4 39.4 30.7 40.7C32.1 41.8 32.9 42.2 35.1 42.6ZM36.1 31C38.9 31 41 33.1 41 35.9C41 38.7 38.9 40.8 36.1 40.8C33.3 40.8 31.2 38.7 31.2 35.9C31.2 33.1 33.3 31 36.1 31ZM258.6 39.3C258.5 39 258.3 38.7 258.2 38.5L251 29.4H248.9V42.3H250.9V32.3C251 32.5 251.2 32.8 251.5 33.2L258.7 42.5H260.6V29.4H258.6V39.3ZM235.4 42.3H237.6V29.4H235.4V42.3ZM14.3 40.5C13.4 40.5 12.6 40.3 11.8 40C11.2 39.8 10.7 39.5 9.8 38.8L8.6 40.6C9.8 41.4 10.2 41.7 10.9 41.9C11.9 42.3 13 42.5 14.2 42.5C17.8 42.5 20.1 40.6 20.1 37.5C20.1 36.2 19.6 35 18.7 34.2C18.1 33.7 17.2 33.1 15.9 32.4C12.3 30.5 11.6 29.8 11.6 28.6C11.6 27.1 12.9 26.2 14.9 26.2C15.6 26.2 16.7 26.4 17.3 26.6C17.9 26.8 18.2 27 19.1 27.5L20.2 25.6C19.2 25 18.8 24.8 18 24.5C17.1 24.2 16.1 24.1 15 24.1C11.5 24.1 9.1 26 9.1 28.9C9.1 30.8 10.2 32.2 12.9 33.6C14.1 34.3 14.9 34.7 15.4 35C15.6 35.1 15.7 35.2 15.8 35.2C16.5 35.6 17 36.1 17.3 36.6C17.5 36.9 17.6 37.3 17.6 37.8C17.6 39.6 16.4 40.5 14.3 40.5ZM269.7 31.2H274.3V42.3H276.4V31.2H281V29.4H269.7V31.2ZM218 29.2C213.8 29.2 210.8 32 210.8 35.9C210.8 39.8 213.8 42.6 218 42.6C222.2 42.6 225.2 39.8 225.2 35.9C225.2 32 222.2 29.2 218 29.2ZM218 40.8C215.2 40.8 213.1 38.7 213.1 35.9C213.1 33.1 215.2 31 218 31C220.8 31 222.9 33.1 222.9 35.9C222.9 38.7 220.8 40.8 218 40.8ZM196.5 24.5H190.9V42.3H193.2V35.6H193.4C194.8 35.7 195.3 35.8 195.9 35.8C199.8 35.8 202.3 33.5 202.3 29.8C202.3 28.1 201.8 26.9 200.9 25.9C199.9 24.9 198.7 24.5 196.5 24.5ZM197.8 33.5C197.2 33.7 196.5 33.8 195.5 33.8C194.9 33.8 194.4 33.8 193.2 33.6V26.4H196.2C197.6 26.4 198.4 26.6 198.9 27.1C199.5 27.7 199.9 28.7 199.9 29.8C199.9 31.6 199.1 33 197.8 33.5Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0_1154_159">
<rect width="288" height="68.5" fill="white"/>
</clipPath>
</defs>
</svg>
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This source diff could not be displayed because it is too large. You can view the blob instead.
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