Skip to content

Commit

Permalink
fix: 🐛 修复搜索接口调整导致的搜索异常
Browse files Browse the repository at this point in the history
  • Loading branch information
adams549659584 committed Aug 27, 2022
1 parent 4f6e707 commit e9a8c74
Show file tree
Hide file tree
Showing 9 changed files with 493 additions and 657 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@

![Instructions.gif](https://s1.ax1x.com/2020/08/19/dQ8R3t.gif)

### v1.7.3

- 修复搜索接口调整导致的搜索异常
- 基金详情新增操作按钮(键盘操作未变:enter 关闭, ← → 切换导航,↑ ↓ 切换基金)

### v1.7.2

- 基金明细加上随机UA
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "utools-fund",
"version": "1.7.2",
"version": "1.7.3",
"description": "自选基金助手",
"main": "main.ts",
"scripts": {
Expand All @@ -17,10 +17,8 @@
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript": "^1.0.1",
"tslib": "^2.3.0",
"typescript": "^4.3.5"
},
"dependencies": {}
}
}
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import commonjs from 'rollup-plugin-commonjs';
import pluginConfig from './plugin.config.js';
import copy from 'rollup-plugin-copy';
import replace from 'rollup-plugin-replace';
import { terser } from 'rollup-plugin-terser';
// import { terser } from 'rollup-plugin-terser';

/**
* 当前环境
Expand Down
2 changes: 1 addition & 1 deletion src/assets/html/fundDetail/fundDetail.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/assets/html/fundDetail/fundDetail.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/features/fundAdd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const fundAdd: TplFeature = {
const searchResult = await get<ISearchFundResult>(`http://fundsuggest.eastmoney.com/FundSearch/api/FundSearchAPI.ashx?m=1&key=${searchWord}`);
if (searchResult) {
if (searchResult.ErrCode === 0) {
cbList = searchResult.Datas.map(fund => {
cbList = searchResult.Datas.filter(x => !!x.FundBaseInfo).map(fund => {
const cb: CallbackListItem = {
title: fund.CODE,
description: fund.NAME,
Expand Down
11 changes: 2 additions & 9 deletions src/features/fundMy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,8 @@ const unregisterShortCut = async () => {
// Mousetrap.unbind(['up', 'down', 'mod+del', 'mod+ins']);
};
const showFundDetail = async (fundEnt: Partial<IFundEnt>) => {
const dbList = FundDBHelper.getAll();
const fundList = dbList.map(db => {
return {
fundcode: db.data.id,
name: db.data.name,
};
});
const fundIndex = fundList.findIndex(x => x.fundcode === fundEnt.id);
const url = `/assets/html/fundDetail/fundDetail.html?fundList=${encodeURIComponent(JSON.stringify(fundList))}&fundIndex=${fundIndex}`;
const url = `/assets/html/fundDetail/fundDetail.html?id=${fundEnt.id}`;
// console.log(`url : `, url);
// const title = `${fundName}(${fundCode})`;
const fundDetailUbWindow = utools.createBrowserWindow(
url,
Expand Down
9 changes: 6 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ import fundMarket from './features/fundMarket';
import fundExport from './features/fundExport';
import fundMy from './features/fundMy';
import fundImport from './features/fundImport';
import FundDBHelper from './Helper/FundDBHelper';

window.utoolsFunc = function () {
console.log(`utoolsFunc : `);
// utools.outPlugin();
window.utoolsCusFn = {
openUrl: (url: string) => utools.shellOpenExternal(url),
fundDBHelper: {
getAll: () => FundDBHelper.getAll(),
},
};

const preload: TemplatePlugin = {
Expand Down
Loading

0 comments on commit e9a8c74

Please sign in to comment.