diff --git a/app.py b/app.py
index 7235276..83e653c 100644
--- a/app.py
+++ b/app.py
@@ -3,13 +3,11 @@ from flask import Flask, render_template, request, redirect, url_for, jsonify, s
from datetime import datetime
import os
import logging
-import requests
from config import COMPANY_INFO, DATA_DIR, LOG_DIR
from languages import LANGUAGES, TRANSLATIONS, DEFAULT_LANGUAGE
-from futu import *
import pandas as pd
-app = Flask(__name__, template_folder='pages')
+app = Flask(__name__, template_folder='templates')
app.secret_key = os.urandom(24) # 设置会话密钥
# 配置日志
@@ -164,123 +162,27 @@ def serve_download_file(filename):
# 实时市场数据API端点
@app.route('/api/market-data')
def market_data():
- # try:
- # quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
-
- # market_data_list = []
- # ret_sub, err_message = quote_ctx.subscribe(['HK.00700'], [SubType.QUOTE], subscribe_push=False)
- # # 先订阅 K 线类型。订阅成功后 OpenD 将持续收到服务器的推送,False 代表暂时不需要推送给脚本
- # if ret_sub == RET_OK: # 订阅成功
- # ret, data = quote_ctx.get_stock_quote(['HK.00700']) # 获取订阅股票报价的实时数据
- # if ret == RET_OK:
- # # market_data_list.append({
- # # 'symbol': data['name'], # 使用中文名称
- # # 'price': float(data['last_price']),
- # # 'change': float(data['last_price']),
- # # 'change_percent': 0
- # # })
- # pass
- # else:
- # print('error:', data)
- # else:
- # print('subscription failed', err_message)
- # quote_ctx.close() # 关闭当条连接,OpenD 会在1分钟后自动取消相应股票相应类型的订阅
-
- # return jsonify({
- # 'status': 'success',
- # 'data': market_data_list,
- # 'timestamp': datetime.now().isoformat()
- # })
+ import random
+ base_prices = {'上证指数': 3000, '深证成指': 10000, '中国平安': 50, '五粮液': 200}
- # except ImportError:
- # pass
- try:
- # 尝试使用akshare获取真实市场数据
- import akshare as ak
- import pandas as pd
+ market_data = []
+ for symbol, base_price in base_prices.items():
+ change_percent = random.uniform(-0.01, 0.01)
+ current_price = round(base_price * (1 + change_percent), 2)
+ change_value = round(current_price - base_price, 2)
- # 获取指数实时数据
- index_data = ak.stock_zh_index_spot()
- index_codes = ['sh000001', 'sz399001'] # 上证指数和深证成指
- index_df = index_data[index_data['code'].isin(index_codes)]
-
- # 获取股票实时数据
- stock_data = ak.stock_zh_a_spot()
- stock_codes = ['sh601318', 'sz000858'] # 中国平安和五粮液
- stock_df = stock_data[stock_data['code'].isin(stock_codes)]
-
- # 合并数据
- combined_data = pd.concat([index_df, stock_df], ignore_index=True)
-
- market_data_list = []
- for index, row in combined_data.iterrows():
- # 处理价格字段(指数使用latest,股票使用price)
- price = row['latest'] if 'latest' in row else row['price']
- change = row['change']
- change_percent = row['change_percent']
-
- market_data_list.append({
- 'symbol': row['name'], # 使用中文名称
- 'price': float(price),
- 'change': float(change),
- 'change_percent': float(change_percent)
- })
-
- return jsonify({
- 'status': 'success',
- 'data': market_data_list,
- 'timestamp': datetime.now().isoformat()
+ market_data.append({
+ 'symbol': symbol,
+ 'price': current_price,
+ 'change': change_value,
+ 'change_percent': round(change_percent * 100, 2)
})
+
+ return jsonify({
+ 'status': 'success',
+ 'data': market_data,
+ 'timestamp': datetime.now().isoformat()
+ })
- except ImportError:
- # akshare未安装,使用模拟数据
- logging.error("akshare未安装,使用模拟数据")
- import random
- base_prices = {'上证指数': 3000, '深证成指': 10000, '中国平安': 50, '五粮液': 200}
-
- market_data = []
- for symbol, base_price in base_prices.items():
- change_percent = random.uniform(-0.01, 0.01)
- current_price = round(base_price * (1 + change_percent), 2)
- change_value = round(current_price - base_price, 2)
-
- market_data.append({
- 'symbol': symbol,
- 'price': current_price,
- 'change': change_value,
- 'change_percent': round(change_percent * 100, 2)
- })
-
- return jsonify({
- 'status': 'success',
- 'data': market_data,
- 'timestamp': datetime.now().isoformat()
- })
-
- except Exception as e:
- logging.error(f"获取市场数据时发生错误: {str(e)}")
- # 出错时使用模拟数据
- import random
- base_prices = {'上证指数': 3000, '深证成指': 10000, '中国平安': 50, '五粮液': 200}
-
- market_data = []
- for symbol, base_price in base_prices.items():
- change_percent = random.uniform(-0.01, 0.01)
- current_price = round(base_price * (1 + change_percent), 2)
- change_value = round(current_price - base_price, 2)
-
- market_data.append({
- 'symbol': symbol,
- 'price': current_price,
- 'change': change_value,
- 'change_percent': round(change_percent * 100, 2)
- })
-
- return jsonify({
- 'status': 'success',
- 'data': market_data,
- 'timestamp': datetime.now().isoformat()
- })
-
if __name__ == '__main__':
serve(app, host='0.0.0.0', port=778)
diff --git a/languages/__init__.py b/languages/__init__.py
index 761d9e6..725d964 100644
--- a/languages/__init__.py
+++ b/languages/__init__.py
@@ -15,8 +15,11 @@ TRANSLATIONS = {
'zh-CN': {
'home': '首页',
'about': '关于',
+ 'online':'在线交易',
+ 'quick_links':'快速链接',
'services': '服务',
'contact': '联系',
+ 'contact_description':'富泽国际,竭诚为您服务!',
'language': '语言',
'all_rights_reserved': '保留所有权利',
'privacy_policy': '隐私政策',
@@ -80,13 +83,13 @@ TRANSLATIONS = {
'why_choose_us': '为什么选择我们',
'features_subtitle': '专业、安全、便捷的投资体验',
'global_markets': '全球市场',
- 'global_markets_desc': '港股、美股、A股、加密货币等多市场交易',
+ 'global_markets_desc': '专注港股、美股',
'secure_trading': '安全交易',
'secure_trading_desc': '银行级安全防护,资金隔离保障',
'smart_investing': '智能投资',
'smart_investing_desc': 'AI投顾、智能选股、量化策略',
'low_fees': '低手续费',
- 'low_fees_desc': '零佣金交易,透明收费标准',
+ 'low_fees_desc': '多佣金方案,透明收费标准',
'trading_tools': '专业交易工具',
'trading_tools_subtitle': '丰富的分析工具,助力投资决策',
'realtime_charts': '实时图表',
@@ -169,7 +172,7 @@ TRANSLATIONS = {
'minimum_fee': '最低收费',
'additional_fees': '其他费用',
'commission_note': '以上费率仅供参考,实际费用可能因市场情况而变化。详细费用请参考最新费率表。',
- 'stocks': '股票、ETF和权证',
+ 'stocks': '股票',
'options': '期权',
'futures': '期货',
'funds': '基金',
@@ -178,6 +181,8 @@ TRANSLATIONS = {
'zh-TW': {
'home': '首頁',
'about': '關於',
+ 'online':'在線交易',
+ 'quick_links':'快速鏈接',
'services': '服務',
'contact': '聯繫',
'language': '語言',
@@ -327,15 +332,17 @@ TRANSLATIONS = {
'minimum_fee': '最低收極狐費',
'additional_fees': '其他費用',
'commission_note': '以上費率僅供參考,實際費用可能因市場情況而變化。詳細費用請參考最新費率表。',
- 'stocks': '股票、ETF和權證',
+ 'stocks': '股票',
'options': '期權',
'futures': '期貨',
'funds': '基金',
- 'other_products': '其他產品'
+ 'other_products': '其他產品',
},
'en': {
'home': 'Home',
'about': 'About',
+ 'online': 'Online',
+ 'quick_links':'Quick Links',
'services': 'Services',
'contact': 'Contact',
'language': 'Language',
@@ -490,7 +497,7 @@ TRANSLATIONS = {
'minimum_fee': 'Minimum Fee',
'additional_fees': 'Additional Fees',
'commission_note': 'The above rates are for reference only. Actual fees may vary depending on market conditions. Please refer to the latest fee schedule for detailed fees.',
- 'stocks': 'Stocks,ETFs & Warrants',
+ 'stocks': 'Stocks',
'options': 'Options',
'futures': 'Futures',
'funds': 'Funds',
diff --git a/logo_hk.jpg b/logo_hk.jpg
new file mode 100644
index 0000000..5373ec7
Binary files /dev/null and b/logo_hk.jpg differ
diff --git a/logo_hk.psd b/logo_hk.psd
new file mode 100644
index 0000000..3650d2b
Binary files /dev/null and b/logo_hk.psd differ
diff --git a/pages/help.html b/pages/help.html
deleted file mode 100644
index 4f549f0..0000000
--- a/pages/help.html
+++ /dev/null
@@ -1,87 +0,0 @@
-{% extends "base.html" %}
-
-{% block title %}{{ t('help') if t('help') else '帮助' }}{% endblock %}
-
-{% block content %}
- {{ t('help_description') if t('help_description') else '获取使用指南和常见问题解答' }} {{ t('faq_subtitle') if t('faq_subtitle') else '找到您需要的答案' }} {{ t('faq1_answer') if t('faq1_answer') else '访问注册页面,填写基本信息并完成身份验证即可创建账户。' }} {{ t('faq2_answer') if t('faq2_answer') else '在下载页面选择适合您设备的版本,点击下载按钮即可获取安装文件。' }} {{ t('faq3_answer') if t('faq3_answer') else '交易费用根据您的套餐类型和交易量计算,具体标准请参考收费页面。' }} {{ t('faq4_answer') if t('faq4_answer') else '您可以通过联系页面提交问题,或直接拨打客服电话获取帮助。' }} {{ t('faq5_answer') if t('faq5_answer') else '我们支持银行转账、信用卡、支付宝和微信支付等多种支付方式。' }} {{ t('faq6_answer') if t('faq6_answer') else '登录账户后,在交易记录页面可以查看所有的历史交易明细。' }} {{ t('support_description') if t('support_description') else '如果您的问题未在常见问题中找到答案,请联系我们的支持团队' }} {{ t('email_support_desc') if t('email_support_desc') else '发送邮件至 Sec.Info@fuzsec.com,我们将在24小时内回复' }}
- {{ t('phone_support_desc') if t('phone_support_desc') else '拨打客服热线 +852 35856298,工作日9:00-18:00' }}
- {{ t('live_chat_desc') if t('live_chat_desc') else '通过网站右下角的聊天窗口与客服实时沟通' }}{{ t('help') if t('help') else '帮助中心' }}
- {{ t('frequently_asked_questions') if t('frequently_asked_questions') else '常见问题' }}
- {{ t('faq1_question') if t('faq1_question') else '如何注册账户?' }}
- {{ t('faq2_question') if t('faq2_question') else '如何下载客户端?' }}
- {{ t('faq3_question') if t('faq3_question') else '交易费用如何计算?' }}
- {{ t('faq4_question') if t('faq4_question') else '如何联系客服?' }}
- {{ t('faq5_question') if t('faq5_question') else '支持哪些支付方式?' }}
- {{ t('faq6_question') if t('faq6_question') else '如何查看交易记录?' }}
- {{ t('contact_support') if t('contact_support') else '联系支持' }}
- {{ t('email_support') if t('email_support') else '邮件支持' }}
- {{ t('phone_support') if t('phone_support') else '电话支持' }}
- {{ t('live_chat') if t('live_chat') else '在线聊天' }}
-