Browse Source

feat: 应用市场

qiji
nili 6 months ago
parent
commit
02553ad920
  1. 12
      build/asset-manifest.json
  2. 2
      build/index.html
  3. 1
      build/static/css/main.407c2891.css.map
  4. 4
      build/static/css/main.807a88f4.css
  5. 1
      build/static/css/main.807a88f4.css.map
  6. 3
      build/static/js/main.359cfb57.js
  7. 1
      build/static/js/main.359cfb57.js.map
  8. 3
      build/static/js/main.b66aa672.js
  9. 10
      build/static/js/main.b66aa672.js.LICENSE.txt
  10. 1
      build/static/js/main.b66aa672.js.map
  11. 7
      package-lock.json
  12. 2
      src/App.tsx
  13. 7
      src/api/generated/.openapi-generator/FILES
  14. 200
      src/api/generated/api/open-controller-api.ts
  15. 117
      src/api/generated/model/app-basic-info.ts
  16. 36
      src/api/generated/model/day-rate.ts
  17. 7
      src/api/generated/model/index.ts
  18. 6
      src/api/generated/model/login-req.ts
  19. 96
      src/api/generated/model/market-bo.ts
  20. 42
      src/api/generated/model/matrix-evil-app.ts
  21. 45
      src/api/generated/model/rapp-basic-info.ts
  22. 45
      src/api/generated/model/rlist-matrix-evil-app.ts
  23. 45
      src/api/generated/model/rmarket-bo.ts
  24. 223
      src/page/MarketPage.tsx
  25. 30
      src/utils/numberUtils.tsx

12
build/asset-manifest.json

@ -1,15 +1,15 @@
{
"files": {
"main.css": "/static/css/main.407c2891.css",
"main.js": "/static/js/main.359cfb57.js",
"main.css": "/static/css/main.807a88f4.css",
"main.js": "/static/js/main.b66aa672.js",
"static/js/453.1d641cba.chunk.js": "/static/js/453.1d641cba.chunk.js",
"index.html": "/index.html",
"main.407c2891.css.map": "/static/css/main.407c2891.css.map",
"main.359cfb57.js.map": "/static/js/main.359cfb57.js.map",
"main.807a88f4.css.map": "/static/css/main.807a88f4.css.map",
"main.b66aa672.js.map": "/static/js/main.b66aa672.js.map",
"453.1d641cba.chunk.js.map": "/static/js/453.1d641cba.chunk.js.map"
},
"entrypoints": [
"static/css/main.407c2891.css",
"static/js/main.359cfb57.js"
"static/css/main.807a88f4.css",
"static/js/main.b66aa672.js"
]
}

2
build/index.html

@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><script src="https://g.alicdn.com/jssdk/u-link/index.min.js"></script><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>奇迹畅玩</title><script defer="defer" src="/static/js/main.359cfb57.js"></script><link href="/static/css/main.407c2891.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><script src="https://g.alicdn.com/jssdk/u-link/index.min.js"></script><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>奇迹畅玩</title><script defer="defer" src="/static/js/main.b66aa672.js"></script><link href="/static/css/main.807a88f4.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

1
build/static/css/main.407c2891.css.map

File diff suppressed because one or more lines are too long

4
build/static/css/main.407c2891.css → build/static/css/main.807a88f4.css

File diff suppressed because one or more lines are too long

1
build/static/css/main.807a88f4.css.map

File diff suppressed because one or more lines are too long

3
build/static/js/main.359cfb57.js

File diff suppressed because one or more lines are too long

1
build/static/js/main.359cfb57.js.map

File diff suppressed because one or more lines are too long

3
build/static/js/main.b66aa672.js

File diff suppressed because one or more lines are too long

10
build/static/js/main.359cfb57.js.LICENSE.txt → build/static/js/main.b66aa672.js.LICENSE.txt

@ -14,6 +14,16 @@
* LICENSE file in the root directory of this source tree.
*/
/**
* @license React
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* @license React
* react-jsx-runtime.production.min.js

1
build/static/js/main.b66aa672.js.map

File diff suppressed because one or more lines are too long

7
package-lock.json

@ -17,6 +17,7 @@
"@types/node": "^16.18.97",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"ahooks": "^3.8.0",
"antd-mobile": "^5.36.0",
"antd-mobile-icons": "^0.3.0",
"axios": "^1.6.8",
@ -4789,9 +4790,9 @@
}
},
"node_modules/ahooks": {
"version": "3.7.11",
"resolved": "https://registry.npmjs.org/ahooks/-/ahooks-3.7.11.tgz",
"integrity": "sha512-BfSq7HJ9wk/7a2vX7WbLdwzHyQHmbNe21ipX1PfIzssXIzQfAl79WVJ9GjZaqNl4PFPsJusj/Xjg2OF+gIgGaQ==",
"version": "3.8.0",
"resolved": "https://registry.npmjs.org/ahooks/-/ahooks-3.8.0.tgz",
"integrity": "sha512-M01m+mxLRNNeJ/PCT3Fom26UyreTj6oMqJBetUrJnK4VNI5j6eMA543Xxo53OBXn6XibA2FXKcCCgrT6YCTtKQ==",
"dependencies": {
"@babel/runtime": "^7.21.0",
"dayjs": "^1.9.1",

2
src/App.tsx

@ -7,12 +7,14 @@ import {
} from "react-router-dom";
import RegisterPage from "./page/RegisterPage";
import MarketPage from "./page/MarketPage";
function App() {
return (
<Router>
<Routes>
<Route path="/register/:inviteCode" element={<RegisterPage />} />
<Route path="/market/:appCode" element={<MarketPage />} />
<Route path="*" element={<Navigate to="/home" replace />} />
{/* <Route
path="/download/:inviteCode"

7
src/api/generated/.openapi-generator/FILES

@ -7,9 +7,16 @@ common.ts
configuration.ts
git_push.sh
index.ts
model/app-basic-info.ts
model/day-rate.ts
model/index.ts
model/invite-info.ts
model/login-req.ts
model/market-bo.ts
model/matrix-evil-app.ts
model/rapp-basic-info.ts
model/rinvite-info.ts
model/rlist-matrix-evil-app.ts
model/rmarket-bo.ts
model/rstring.ts
model/rvoid.ts

200
src/api/generated/api/open-controller-api.ts

@ -24,8 +24,14 @@ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ope
// @ts-ignore
import { LoginReq } from '../model';
// @ts-ignore
import { RAppBasicInfo } from '../model';
// @ts-ignore
import { RInviteInfo } from '../model';
// @ts-ignore
import { RListMatrixEvilApp } from '../model';
// @ts-ignore
import { RMarketBo } from '../model';
// @ts-ignore
import { RString } from '../model';
// @ts-ignore
import { RVoid } from '../model';
@ -62,6 +68,71 @@ export const OpenControllerApiAxiosParamCreator = function (configuration?: Conf
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} appCode
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAppDetail: async (appCode: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'appCode' is not null or undefined
assertParamExists('getAppDetail', 'appCode', appCode)
const localVarPath = `/api/citrus/open/getAppDetail`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (appCode !== undefined) {
localVarQueryParameter['appCode'] = appCode;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getEvilApp: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/citrus/open/evilApp`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
@ -176,6 +247,42 @@ export const OpenControllerApiAxiosParamCreator = function (configuration?: Conf
options: localVarRequestOptions,
};
},
/**
*
* @param {string} appCode
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
marketData: async (appCode: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'appCode' is not null or undefined
assertParamExists('marketData', 'appCode', appCode)
const localVarPath = `/api/citrus/open/marketData`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (appCode !== undefined) {
localVarQueryParameter['appCode'] = appCode;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} mobile
@ -241,6 +348,29 @@ export const OpenControllerApiFp = function(configuration?: Configuration) {
const localVarOperationServerBasePath = operationServerMap['OpenControllerApi.getApp']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @param {string} appCode
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getAppDetail(appCode: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RAppBasicInfo>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getAppDetail(appCode, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['OpenControllerApi.getAppDetail']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getEvilApp(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RListMatrixEvilApp>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getEvilApp(options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['OpenControllerApi.getEvilApp']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @param {LoginReq} loginReq
@ -277,6 +407,18 @@ export const OpenControllerApiFp = function(configuration?: Configuration) {
const localVarOperationServerBasePath = operationServerMap['OpenControllerApi.loginByToken']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @param {string} appCode
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async marketData(appCode: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RMarketBo>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.marketData(appCode, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['OpenControllerApi.marketData']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @param {string} mobile
@ -309,6 +451,23 @@ export const OpenControllerApiFactory = function (configuration?: Configuration,
getApp(inviteCode: string, options?: any): AxiosPromise<RInviteInfo> {
return localVarFp.getApp(inviteCode, options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} appCode
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAppDetail(appCode: string, options?: any): AxiosPromise<RAppBasicInfo> {
return localVarFp.getAppDetail(appCode, options).then((request) => request(axios, basePath));
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getEvilApp(options?: any): AxiosPromise<RListMatrixEvilApp> {
return localVarFp.getEvilApp(options).then((request) => request(axios, basePath));
},
/**
*
* @param {LoginReq} loginReq
@ -336,6 +495,15 @@ export const OpenControllerApiFactory = function (configuration?: Configuration,
loginByToken(loginReq: LoginReq, options?: any): AxiosPromise<RString> {
return localVarFp.loginByToken(loginReq, options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} appCode
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
marketData(appCode: string, options?: any): AxiosPromise<RMarketBo> {
return localVarFp.marketData(appCode, options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} mobile
@ -367,6 +535,27 @@ export class OpenControllerApi extends BaseAPI {
return OpenControllerApiFp(this.configuration).getApp(inviteCode, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {string} appCode
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof OpenControllerApi
*/
public getAppDetail(appCode: string, options?: RawAxiosRequestConfig) {
return OpenControllerApiFp(this.configuration).getAppDetail(appCode, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof OpenControllerApi
*/
public getEvilApp(options?: RawAxiosRequestConfig) {
return OpenControllerApiFp(this.configuration).getEvilApp(options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {LoginReq} loginReq
@ -400,6 +589,17 @@ export class OpenControllerApi extends BaseAPI {
return OpenControllerApiFp(this.configuration).loginByToken(loginReq, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {string} appCode
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof OpenControllerApi
*/
public marketData(appCode: string, options?: RawAxiosRequestConfig) {
return OpenControllerApiFp(this.configuration).marketData(appCode, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {string} mobile

117
src/api/generated/model/app-basic-info.ts

@ -0,0 +1,117 @@
/* tslint:disable */
/* eslint-disable */
/**
* matrix后台
*
*
* The version of the OpenAPI document: v1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
// May contain unused imports in some cases
// @ts-ignore
import { DayRate } from './day-rate';
/**
*
* @export
* @interface AppBasicInfo
*/
export interface AppBasicInfo {
/**
*
* @type {number}
* @memberof AppBasicInfo
*/
'maxIncomeEachVideo'?: number;
/**
*
* @type {Array<DayRate>}
* @memberof AppBasicInfo
*/
'dayRates'?: Array<DayRate>;
/**
*
* @type {number}
* @memberof AppBasicInfo
*/
'defaultRate'?: number;
/**
*
* @type {Array<number>}
* @memberof AppBasicInfo
*/
'moneyLadder'?: Array<number>;
/**
*
* @type {number}
* @memberof AppBasicInfo
*/
'noAuditMoney'?: number;
/**
*
* @type {string}
* @memberof AppBasicInfo
*/
'qqUrl'?: string;
/**
*
* @type {number}
* @memberof AppBasicInfo
*/
'dayLimit'?: number;
/**
*
* @type {boolean}
* @memberof AppBasicInfo
*/
'enablePangolin'?: boolean;
/**
*
* @type {number}
* @memberof AppBasicInfo
*/
'pangolinDailyLimit'?: number;
/**
*
* @type {number}
* @memberof AppBasicInfo
*/
'tencentDailyLimit'?: number;
/**
*
* @type {string}
* @memberof AppBasicInfo
*/
'name'?: string;
/**
*
* @type {string}
* @memberof AppBasicInfo
*/
'code'?: string;
/**
*
* @type {string}
* @memberof AppBasicInfo
*/
'img'?: string;
/**
*
* @type {string}
* @memberof AppBasicInfo
*/
'url'?: string;
/**
*
* @type {number}
* @memberof AppBasicInfo
*/
'version'?: number;
}

36
src/api/generated/model/day-rate.ts

@ -0,0 +1,36 @@
/* tslint:disable */
/* eslint-disable */
/**
* matrix后台
*
*
* The version of the OpenAPI document: v1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface DayRate
*/
export interface DayRate {
/**
*
* @type {number}
* @memberof DayRate
*/
'day'?: number;
/**
*
* @type {number}
* @memberof DayRate
*/
'rate'?: number;
}

7
src/api/generated/model/index.ts

@ -1,5 +1,12 @@
export * from './app-basic-info';
export * from './day-rate';
export * from './invite-info';
export * from './login-req';
export * from './market-bo';
export * from './matrix-evil-app';
export * from './rapp-basic-info';
export * from './rinvite-info';
export * from './rlist-matrix-evil-app';
export * from './rmarket-bo';
export * from './rstring';
export * from './rvoid';

6
src/api/generated/model/login-req.ts

@ -50,5 +50,11 @@ export interface LoginReq {
* @memberof LoginReq
*/
'token'?: string;
/**
*
* @type {string}
* @memberof LoginReq
*/
'inviteCode'?: string;
}

96
src/api/generated/model/market-bo.ts

@ -0,0 +1,96 @@
/* tslint:disable */
/* eslint-disable */
/**
* matrix后台
*
*
* The version of the OpenAPI document: v1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface MarketBo
*/
export interface MarketBo {
/**
*
* @type {string}
* @memberof MarketBo
*/
'name'?: string;
/**
*
* @type {string}
* @memberof MarketBo
*/
'code'?: string;
/**
*
* @type {string}
* @memberof MarketBo
*/
'img'?: string;
/**
*
* @type {string}
* @memberof MarketBo
*/
'url'?: string;
/**
*
* @type {string}
* @memberof MarketBo
*/
'fileSize'?: string;
/**
*
* @type {number}
* @memberof MarketBo
*/
'version'?: number;
/**
*
* @type {Array<string>}
* @memberof MarketBo
*/
'images'?: Array<string>;
/**
*
* @type {string}
* @memberof MarketBo
*/
'packageName'?: string;
/**
*
* @type {string}
* @memberof MarketBo
*/
'author'?: string;
/**
*
* @type {number}
* @memberof MarketBo
*/
'downloadTimes'?: number;
/**
*
* @type {string}
* @memberof MarketBo
*/
'desc'?: string;
/**
*
* @type {number}
* @memberof MarketBo
*/
'updatedAt'?: number;
}

42
src/api/generated/model/matrix-evil-app.ts

@ -0,0 +1,42 @@
/* tslint:disable */
/* eslint-disable */
/**
* matrix后台
*
*
* The version of the OpenAPI document: v1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface MatrixEvilApp
*/
export interface MatrixEvilApp {
/**
*
* @type {number}
* @memberof MatrixEvilApp
*/
'id'?: number;
/**
*
* @type {string}
* @memberof MatrixEvilApp
*/
'name'?: string;
/**
*
* @type {string}
* @memberof MatrixEvilApp
*/
'packageName'?: string;
}

45
src/api/generated/model/rapp-basic-info.ts

@ -0,0 +1,45 @@
/* tslint:disable */
/* eslint-disable */
/**
* matrix后台
*
*
* The version of the OpenAPI document: v1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
// May contain unused imports in some cases
// @ts-ignore
import { AppBasicInfo } from './app-basic-info';
/**
*
* @export
* @interface RAppBasicInfo
*/
export interface RAppBasicInfo {
/**
*
* @type {number}
* @memberof RAppBasicInfo
*/
'code'?: number;
/**
*
* @type {string}
* @memberof RAppBasicInfo
*/
'message'?: string;
/**
*
* @type {AppBasicInfo}
* @memberof RAppBasicInfo
*/
'data'?: AppBasicInfo;
}

45
src/api/generated/model/rlist-matrix-evil-app.ts

@ -0,0 +1,45 @@
/* tslint:disable */
/* eslint-disable */
/**
* matrix后台
*
*
* The version of the OpenAPI document: v1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
// May contain unused imports in some cases
// @ts-ignore
import { MatrixEvilApp } from './matrix-evil-app';
/**
*
* @export
* @interface RListMatrixEvilApp
*/
export interface RListMatrixEvilApp {
/**
*
* @type {number}
* @memberof RListMatrixEvilApp
*/
'code'?: number;
/**
*
* @type {string}
* @memberof RListMatrixEvilApp
*/
'message'?: string;
/**
*
* @type {Array<MatrixEvilApp>}
* @memberof RListMatrixEvilApp
*/
'data'?: Array<MatrixEvilApp>;
}

45
src/api/generated/model/rmarket-bo.ts

@ -0,0 +1,45 @@
/* tslint:disable */
/* eslint-disable */
/**
* matrix后台
*
*
* The version of the OpenAPI document: v1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
// May contain unused imports in some cases
// @ts-ignore
import { MarketBo } from './market-bo';
/**
*
* @export
* @interface RMarketBo
*/
export interface RMarketBo {
/**
*
* @type {number}
* @memberof RMarketBo
*/
'code'?: number;
/**
*
* @type {string}
* @memberof RMarketBo
*/
'message'?: string;
/**
*
* @type {MarketBo}
* @memberof RMarketBo
*/
'data'?: MarketBo;
}

223
src/page/MarketPage.tsx

@ -0,0 +1,223 @@
// MarketPage.js
import { Button, Tabs } from "antd-mobile";
import React, { useEffect, useState } from "react";
import { useParams } from "react-router-dom";
import { api } from "../api";
import { MarketBo } from "../api/generated/model/market-bo";
import { formatTimestamp, formatVersion } from "../utils/numberUtils";
const MarketPage = () => {
const [info, setInfo] = React.useState<MarketBo>();
const { appCode } = useParams();
useEffect(() => {
const getApp = async () => {
if (!appCode) {
return;
}
const res = await api.marketData(appCode);
setInfo(res.data.data);
};
getApp();
}, [appCode]);
const topButtonStyle = {
padding: "0 15",
background: "#F0322F",
border: "none",
color: "#fff",
fontSize: 16,
fontWeight: "bold",
height: 48,
};
const blueTag = {
border: "1px solid #00bfff",
margin: "auto 5px 5px 5px",
fontSize: 14,
color: "#00bfff",
borderRadius: 5,
padding: "2px 8px",
};
const latestVersion = () => {
let arr = [];
for (let i = 0; i <= 5; i++) {
arr.push((info?.version || 1000) - i);
}
return arr;
};
return (
<div style={{ paddingLeft: 40, paddingRight: 40 }}>
<div
style={{
position: "fixed",
overflow: "scroll",
top: 0,
left: 0,
right: 0,
height: 48,
background: "#F0322F",
zIndex: 1,
}}
>
<Button style={{ ...topButtonStyle, marginLeft: 50 }}></Button>
<Button style={topButtonStyle}>{info?.name}</Button>
<Button style={topButtonStyle}>{info?.name}</Button>
<Button style={topButtonStyle}>{info?.name}</Button>
<Button style={topButtonStyle}>{info?.name}</Button>
</div>
<div
style={{
marginTop: 48,
marginBottom: 6,
display: "flex",
color: "#666",
fontSize: 14,
whiteSpace: "pre-wrap",
}}
>
<p style={{ fontWeight: "bold" }}></p>
<p> </p>
<p style={{ color: "#5a5a5a" }}>
{"> " + info?.name} {formatVersion(info?.version)}
</p>
</div>
<div
style={{
marginBottom: 20,
color: "#3a3b3c",
fontWeight: "bold",
fontSize: 22,
display: "flex",
alignItems: "center",
borderBottom: "1px #e7e7e7 solid",
}}
>
{info?.name}{" "}
<p
style={{
marginLeft: 10,
fontSize: 18,
color: "#888",
fontWeight: "normal",
}}
>
{formatVersion(info?.version)}
</p>
</div>
<div style={{ marginTop: 20 }}>
<div
style={{
float: "left",
display: "flex",
flexDirection: "column",
alignItems: "center",
width: 186,
marginRight: 15,
}}
>
<img
style={{ width: 150, borderRadius: 18, margin: "0, auto" }}
src={info?.img}
alt=""
/>
<Button
onClick={() => {
window.open(info?.url || "", "_blank");
setInfo({
...info,
downloadTimes: (info?.downloadTimes || 0) + 1,
});
}}
style={{
marginTop: 47,
background: "#fe6265",
height: 34,
width: 120,
borderRadius: 5,
marginLeft: "auto",
marginRight: "auto",
color: "#333",
fontSize: 12,
}}
>
({info?.downloadTimes})
</Button>
</div>
<div style={{ fontSize: 14, color: "#303030" }}>
<p>{formatVersion(info?.version)}</p>
<p></p>
<p>{info?.author}</p>
<p>{info?.packageName}</p>
<p>{formatTimestamp(info?.updatedAt)}</p>
<p>{info?.fileSize}</p>
<p>
<Button style={blueTag}></Button>
<Button style={blueTag}></Button>
<Button style={blueTag}></Button>
<Button style={blueTag}></Button>
<Button style={blueTag}></Button>
</p>
</div>
</div>
<Tabs style={{ marginTop: 20 }} defaultActiveKey="1">
<Tabs.Tab title="游戏介绍" key="1">
<p
style={{
whiteSpace: "break-spaces",
color: "#656565",
fontSize: 14,
lineHeight: "26px",
}}
>
{info?.desc}
</p>
</Tabs.Tab>
<Tabs.Tab title="游戏截图" key="2">
<div>
{info?.images?.map((x) => (
<img style={{ width: 150, marginRight: 12 }} src={x} alt="" />
))}
</div>
</Tabs.Tab>
<Tabs.Tab title="相关版本" key="3">
<div
style={{
display: "flex",
lineHeight: "26px",
width: "60%",
justifyContent: "space-evenly",
}}
>
{latestVersion().map((x: number) => (
<a href={info?.url}>{formatVersion(x)}</a>
))}
</div>
</Tabs.Tab>
</Tabs>
<div style={{ marginBottom: 20 }}>
<h1></h1>
<Button style={blueTag}></Button>
<Button style={blueTag}></Button>
<Button style={blueTag}></Button>
<Button style={blueTag}></Button>
<Button style={blueTag}></Button>
<Button style={blueTag}>3D</Button>
<Button style={blueTag}></Button>
<Button style={blueTag}></Button>
<Button style={blueTag}></Button>
<Button style={blueTag}></Button>
<Button style={blueTag}>Q版</Button>
<Button style={blueTag}></Button>
<Button style={blueTag}></Button>
</div>
</div>
);
};
export default MarketPage;

30
src/utils/numberUtils.tsx

@ -11,3 +11,33 @@ export const cent2Yuan = (v: number | undefined) => {
}
return parseFloat((v / 100).toFixed(2));
};
export const formatVersion = (v: number | undefined) => {
if (!v) {
return "v0.0.1";
}
let str = v.toString();
let result = "";
for (let i = 0; i < str.length; i++) {
result += str[i];
if (i < str.length - 1) {
result += ".";
}
}
return "v" + result;
};
export const formatTimestamp = (timestamp: number | undefined) => {
if (!timestamp) {
return "";
}
const date = new Date(timestamp);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0");
const day = String(date.getDate()).padStart(2, "0");
const hours = String(date.getHours()).padStart(2, "0");
const minutes = String(date.getMinutes()).padStart(2, "0");
const seconds = String(date.getSeconds()).padStart(2, "0");
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
};

Loading…
Cancel
Save