Commit 594a1396 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' : '') + '" />'
)
document.addEventListener('dblclick', function (e) {
e.preventDefault() // 阻止默认双击事件
})
</script>
<title>RADIX</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="RADIX" />
<meta name="google" content="notranslate" />
<!-- Apple Touch Icons -->
<link rel="apple-touch-icon" sizes="180x180" href="./src/static/app-icon.png" />
<!-- Android Chrome Icons -->
<link rel="icon" type="image/png" sizes="192x192" href="./src/static/app-icon.png" />
<link rel="icon" type="image/png" sizes="512x512" href="./src/static/app-icon.png" />
<!-- Windows Tiles -->
<meta name="msapplication-TileImage" content="./src/static/app-icon.png" />
<meta name="msapplication-TileColor" content="#ffffff" />
<!-- General Icons -->
<link rel="icon" type="image/png" sizes="32x32" href="./src/static/app-icon.png" />
<link rel="icon" type="image/png" sizes="16x16" href="./src/static/app-icon.png" />
<link rel="icon" type="image/x-icon" href="./src/static/app-icon.png" />
<link rel="icon" href="./src/static/app-icon.png" />
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "RADIX",
"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'
import { onMounted } from 'vue'
const store = useCounterStore()
// store.getSystemInfo()
// store.getUserInfo()
const i = 'orientationchange' in window ? 'orientationchange' : 'resize'
const setViewHeight = () => {
const windowVH = window.innerHeight / 100
document.documentElement.style.setProperty('--vh', windowVH + 'px')
}
document.addEventListener('DOMContentLoaded', setViewHeight)
window.addEventListener(i, setViewHeight)
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)
next()
})
router.afterEach(() => {
// setTimeout(() => show(), 50)
})
})
onMounted(() => {
// setTimeout(() => {
// // eslint-disable-next-line no-unused-expressions
// document.body.scrollHeight // 触发页面重新计算高度
// }, 100)
// const viewportWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
// const viewportHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
// console.log('Viewport Width: ' + viewportWidth)
// console.log('Viewport Height: ' + viewportHeight)
// const documentHeight = document.documentElement.scrollHeight || document.body.scrollHeight
// console.log('Document Width: ' + documentWidth)
// function getViewportHeight() {
// const vh = window.innerHeight
// const vhCalc = (window.innerWidth / document.documentElement.clientWidth) * 100
// return (window.innerHeight / vhCalc) * vh
// }
// const viewportHeight = getViewportHeight()
// showToast('document.body.clientHeight ' + document.body.clientHeight)
store.pageHeight = document.body.clientHeight + 'px'
document.body.style.height = document.body.clientHeight + 'px'
// showToast('document.body.clientHeight ' + document.body.style.height)
// console.log('Calculated Viewport height:', viewportHeight)
// console.log('Document Height: ' + documentHeight)
})
onShow(() => {})
onHide(() => {})
// const hide = (callback) => {
// const classList = document.querySelector('uni-page').classList
// classList.add('animation-before', 'animation-leave')
// classListNaNpxove('animation-show')
// setTimeout(() => {
// classListNaNpxove('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(() => {
// classListNaNpxove('animation-before', 'animation-after', 'animation-enter')
// }, 300)
// }, 20)
// }
</script>
<style lang="scss">
html,
body {
height: 100%;
overflow: auto;
-webkit-overflow-scrolling: touch; /* 启用惯性滚动 */
}
.hh2 {
display: -webkit-box;
text-overflow: ellipsis;
overflow: hidden;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
.hh {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
word-break: break-all;
}
.uni-input-input {
color: $color-black;
}
.tabbar {
border-radius: 0.625rem 0.625rem 0px 0px;
// box-shadow: 0px 0px 5px 2px #f4f4f4;
}
body {
background: #fff;
// fill: linear-gradient(191deg, #f3e0eb 0.38%, #f2e7fd 10.66%, #fff 26.2%);
}
::v-deep .uni-toast__icon {
margin: 0.625rem auto 0 !important;
}
::v-deep .van-loading__line:before {
color: #fff !important;
background: #fff !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: #08182b;
color: #fff !important;
font-size: 1rem;
margin-right: 0.625rem;
}
.uni-modal__btn_primary {
width: 8.4375rem;
height: 3.0625rem;
border-radius: 1.5625rem;
background: #ee2560;
font-size: 1rem;
color: #fff !important;
}
}
.up {
color: $color-red !important;
}
.down {
color: $color-green !important;
}
.ping {
color: $uni-text-color;
}
.red {
color: $color-red !important;
}
.green {
color: $color-green !important;
}
.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 function getLotteryApi() {
return request({
url: `${config.baseURL}/index/lottery_prize`,
method: 'get'
})
}
// 抽奖次数
export function getLotteryCountApi() {
return request({
url: `${config.baseURL}/index/lottery_count`,
method: 'get'
})
}
// 抽奖结果
export function getLotteryDrawApi() {
return request({
url: `${config.baseURL}/index/lottery_draw`,
method: 'get'
})
}
// 抽奖历史
export function getLotteryHistoryApi() {
return request({
url: `${config.baseURL}/index/lottery_history`,
method: 'get'
})
}
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 = (timestemp: number, n: string = '-') => {
const date = new Date(timestemp)
const year = date.getFullYear()
const month = date.getMonth() - 1 < 10 ? `0${date.getMonth() - 1}` : date.getMonth() - 1
const day = date.getDate() < 10 ? `0${date.getDate()}` : date.getDate()
const hour = date.getHours() < 10 ? `0${date.getHours()}` : date.getHours()
const minute = date.getMinutes() < 10 ? `0${date.getMinutes()}` : date.getMinutes()
return `${year}${n}${month}${n}${day} ${hour}:${minute}`
}
// function convertBeijingToTokyo(beijingDate) {
// const tokyoTime = new Date(beijingDate.getTime() + 1 * 60 * 60 * 1000)
// return tokyoTime
// }
// export function timestampToDate3(date) {
// convertBeijingToTokyo(new Data)
// }
export function timestampToDate2(timestamp: number) {
const date = new Date(timestamp) // 时间戳转换成Date对象
// console.log(convertBeijingToTokyo(date), 'convertBeijingToTokyo(date)')
// date = convertBeijingToTokyo(date)
const year = date.getFullYear() // 获取年份
let month = date.getMonth() + 1 // 获取月份,需要+1因为月份从0开始
let day = date.getDate() // 获取日
let hours = date.getHours() // 获取小时
let minutes = date.getMinutes() // 获取分钟
let seconds = date.getSeconds() // 获取秒钟
// 格式化月份、日期、小时、分钟和秒
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
}
// 获取指定时区的时间戳;因为目前还无法直接修改date对象的时区,所以使用时间戳方式返回
function getZoneTime(date, zone) {
const offset_GMT = date.getTimezoneOffset()
const current = date.getTime()
const targetDate = new Date(current + offset_GMT * 60 * 1000 + zone * 60 * 60 * 1000)
return targetDate.getTime()
}
export function timestampToDate3(timestamp: number) {
let date = new Date(timestamp) // 时间戳转换成Date对象
// console.log(convertBeijingToTokyo(date), 'convertBeijingToTokyo(date)')
date = new Date(getZoneTime(date, 9))
const year = date.getFullYear() // 获取年份
let month = date.getMonth() + 1 // 获取月份,需要+1因为月份从0开始
let day = date.getDate() // 获取日
let hours = date.getHours() // 获取小时
let minutes = date.getMinutes() // 获取分钟
let seconds = date.getSeconds() // 获取秒钟
// 格式化月份、日期、小时、分钟和秒
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
}
// 全角转半角
export const toHalfWidth = (str: any) => {
return (
str
.replace(/[!-~]/g, function (char) {
return String.fromCharCode(char.charCodeAt(0) - 0xfee0)
})
.replace(/[a-zA-Z0-9]/g, function (char) {
return String.fromCharCode(char.charCodeAt(0) - 0xfee0)
})
// eslint-disable-next-line no-irregular-whitespace
.replace(/ /g, ' ')
) // 处理全角空格
}
// 全角转半角 整数
export const toHalfWidthnumber = (str: number) => {
return Number(
str.toString().replace(/[\uff10-\uff19]/g, function (c) {
return String.fromCharCode(c.charCodeAt(0) - 0xfee0)
})
)
}
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://ws.radixws.com/'
})
}
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" :class="item.max" :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}index2.png`,
selectIcon: `${url}index_select2.png`,
text: text1,
id: 0
},
{
path: '/pages/market/market',
icon: `${url}market2.png`,
selectIcon: `${url}market_select2.png`,
text: text2,
max: 'max',
id: 1
},
{
path: '/pages/jiaoyi/jiaoyi',
icon: `${url}jiaoyi2.png`,
selectIcon: `${url}jiaoyi_select2.png`,
text: text3,
max: 'max',
id: 2
},
{
path: '/pages/record/record',
icon: `${url}record2.png`,
selectIcon: `${url}record_select2.png`,
text: text4,
id: 3
},
{
path: '/pages/user/user',
icon: `${url}user2.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: #fafafa;
display: flex;
justify-content: space-around;
position: fixed;
z-index: 1000;
bottom: 0;
left: 0;
// border-top: 0.03rem solid #1b3224;
// box-shadow: ;
box-shadow: 0 0.53rem 0.85rem 0.13rem #00000060;
border-radius: 0 0 0 0;
.bar {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
}
.card {
width: 3.59rem;
border-radius: 0.63rem;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.max {
padding: 0 !important;
}
.image {
width: 1.88rem;
height: 1.88rem;
padding: 0.22rem;
}
.text {
font-size: 0.65rem;
color: #707070;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
word-break: break-all;
}
}
.active {
.text {
color: $color-primary;
}
}
}
</style>
<template>
<view class="navigator">
<slot name="left"></slot>
<view v-if="porps.isShowBack" class="back" @click="goBack">
<!-- <image src="@/static/arrow-left.png"></image> -->
<van-icon name="arrow-left" color="#222" size="1.25rem" :style="arrowStyle"></van-icon>
</view>
<view class="title" style="display: flex; align-items: center; justify-content: center; width: 70%">
<view class="title hh" :style="style">{{ porps.title }}</view>
<view v-if="porps.isdma !== ''" :style="{ width: '2.8125rem', color: '#222' }">{{ porps.isdma }}</view>
</view>
<slot name="right"></slot>
</view>
</template>
<script lang="ts" setup>
const porps = defineProps({
title: {
type: String,
default: ''
},
isShowBack: {
type: Boolean,
default: true
},
isdma: {
type: String,
default: ''
},
style: {
type: Object,
default: () => {}
},
arrowStyle: {
type: Object,
default: () => {}
}
})
const goBack = () => {
const url = window.location.href
if (url.indexOf('pages') >= 0) {
uni.navigateBack({})
} else {
history.go(-1)
}
}
</script>
<style lang="scss" scoped>
.navigator {
height: 3.13rem;
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: $color-black;
font-weight: 500;
text-align: center;
}
</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="nodataWrap">
<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>
</view>
</template>
<style lang="scss" scoped>
.nodataWrap {
overflow: hidden;
}
.box {
margin: 5rem auto 0;
width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.img {
width: 15.63rem;
height: 15.63rem;
}
.title {
color: #a6a6a6;
font-size: 0.75rem;
margin-top: 1.25rem;
position: relative;
bottom: 1.88rem;
}
}
</style>
<script setup lang="ts">
import { useI18n } from 'vue-i18n'
// import { showToast } from 'vant'
const { t } = useI18n()
// const searchValue = ref('')
// const onSearch = () => {}
// const onCancel = () => showToast('取消')
const goPage = () => {
uni.navigateTo({
url: '/subPackages/search/search'
})
}
</script>
<template>
<div class="search">
<view class="nav-box">
<view class="input_wrap" @click="goPage">
<image src="/static/image/index/search.png" class="search-icon"></image>
<span>{{ t('search.tip3') }}</span>
</view>
</view>
</div>
</template>
<style lang="scss" scoped>
.uni-input-placeholder {
font-size: 0.82rem !important;
}
.search {
overflow: hidden;
}
.nav-box {
top: 0;
left: 0;
// width: 100%;
height: 3.125rem;
display: flex;
justify-content: center;
align-items: center;
z-index: 999;
padding: 0.53rem 0;
margin: 0.53rem 0.94rem;
.input_wrap {
width: 14.375rem;
flex: 1;
height: 2.75rem;
border-radius: 1.25rem;
background: #f9f9f9;
color: #fff;
padding: 0 0.94rem;
font-size: 0.82rem;
display: flex;
align-items: center;
gap: 0.5rem;
.search-icon {
width: 1rem;
height: 1rem;
}
span {
color: #aeaeae;
}
}
.search-img {
margin-left: 0.44rem;
width: 0.875rem;
height: 0.875rem;
}
::v-deep.uni-input-input {
color: #b3b3b3 !important;
font-size: 0.82rem !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": "/japan7/"
}
}
}
{
"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",
"height": "70px",
"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": "RADIX",
"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" :style="{ height: height }"></view>
</template>
<script lang="ts" setup>
import { init, dispose } from 'klinecharts'
import { onMounted, onUnmounted, watch } from 'vue'
const props = defineProps({
value: {
type: Array,
default: () => []
},
height: {
type: String,
default: '154px'
}
})
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'
}
},
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,
// x轴分割文字
tickText: {
color: '#000'
}
},
// y轴
yAxis: {
// x轴分割文字
tickText: {
color: '#000'
}
}
}
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>
<Navigator :title="t('tabbar.record')" :is-show-back="false" />
<scroll-view scroll-y :style="{ height: `calc(${store.pageHeight} - 7.5rem)` }" @scrolltolower="getNews">
<view class="box">
<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)">
<img :src="item.image" alt="" @click.stop="previewImage(item.image)" />
<div class="right">
<view class="record-item-title"> {{ item.title }} </view>
<view class="record-item-time">{{ formatTimestamp(item.updatetime * 1000) }}</view>
</div>
</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, showImagePreview, showLoadingToast } from 'vant'
import { useCounterStore } from '@/store/store'
const store = useCounterStore()
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)
})
}
}
const previewImage = (item) => {
showImagePreview([item])
}
</script>
<style scoped lang="scss">
.box {
// padding-top: 3.5313rem;
.record-list {
// width: 100%;
display: flex;
flex-direction: column;
align-items: center;
margin: 0 0.94rem;
.record-item {
position: relative;
margin-bottom: 0.88rem;
border-bottom: 0.05rem solid #d8d8d8;
padding-bottom: 0.5rem;
display: flex;
gap: 1rem;
width: 100%;
img {
width: 5rem;
border-radius: 0.31rem;
display: block;
}
.right {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.record-item-title {
font-weight: 500;
font-size: 0.8125rem;
color: $color-black;
}
.record-item-time {
font-weight: 500;
font-size: 0.8125rem;
color: #a2a2a2;
margin-top: 0.5rem;
}
}
}
uni-image {
width: 100%;
height: 4.5938rem;
}
}
</style>
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
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