Browse Source

feat: 初始化

master
jiannibang 3 years ago
parent
commit
a99973c131
  1. 3
      .gitmodules
  2. 24473
      package-lock.json
  3. 11
      package.json
  4. 8
      src/App.test.js
  5. 14
      src/js/helpers/data-helper.js
  6. 2
      src/pages/Index/Index.js
  7. 1
      src/qmmap
  8. 5
      src/setupTests.js
  9. 12678
      yarn.lock

3
.gitmodules

@ -0,0 +1,3 @@
[submodule "src/qmmap"]
path = src/qmmap
url = https://git.1000my.com/common/base_mobile_map_sdk.git

24473
package-lock.json

File diff suppressed because it is too large

11
package.json

@ -4,18 +4,10 @@
"private": true,
"homepage": "./",
"dependencies": {
"@apollo/client": "^3.3.11",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"antd-mobile": "^2.3.4",
"apollo-cache-inmemory": "^1.6.6",
"apollo-client": "^2.6.10",
"apollo-link-http": "^1.5.17",
"axios": "^0.21.1",
"graphql": "^15.5.0",
"html5-qrcode": "^2.3.0",
"node-sass": "^5.0.0",
"node-sass": "^8.0.0",
"qrcodejs2": "^0.0.2",
"react": "^17.0.1",
"react-dom": "^17.0.1",
@ -30,7 +22,6 @@
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {

8
src/App.test.js

@ -1,8 +0,0 @@
import { render, screen } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});

14
src/js/helpers/data-helper.js

@ -1,12 +1,9 @@
import axios from "axios";
import icons from "./image-helper";
let mallInfos = new Map();
// dev
// export const code = "project-k5chc3vt0vkodjbmhl8rua";
// export const baseUrl = "https://iot-dev.123.1000my.com";
// test
export const code = "project-skcn0gk6yb2xutkcsmjtra";
export const baseUrl = "https://project-iot.test.1000my.com";
export const code = "project-zu-goaidg5nskjiucd_eoa";
export const baseUrl = "https://iot.1000my.com";
export const post = async (url = "", data = {}) => {
const response = await fetch(baseUrl + url, {
method: "POST",
@ -20,7 +17,7 @@ export const post = async (url = "", data = {}) => {
};
const getMallInfo = async ({ memberID }) => {
const { name, groundFloorOrder, scale, offsetToNorth } = {
groundFloorOrder: 1,
groundFloorOrder: 3,
scale: 0.15,
offsetToNorth: 0,
};
@ -35,7 +32,6 @@ const getMallInfo = async ({ memberID }) => {
cloud: "1000my",
offsetToNorth,
};
const floorMap = { 1: true };
let cdnUrl;
try {
@ -193,7 +189,7 @@ const getMallInfo = async ({ memberID }) => {
mall.floors = serverShopInfo.map(({ floor }, floorOrder) => ({
name: floor,
floorOrder,
url: floorMap[floorOrder] ? true : null,
url: true,
}));
const shopInfo = serverShopInfo.map(({ floorOrd: floorOrder, shopList }) => ({

2
src/pages/Index/Index.js

@ -1,5 +1,5 @@
import React, { useState, useEffect, useReducer, useRef } from "react";
import Qmmap from "qmmap";
import Qmmap from "../../qmmap/index";
import { useHistory, useLocation } from "react-router-dom";
import { getMallInfo, post } from "../../js/helpers/data-helper";
import "./Index.scss";

1
src/qmmap

@ -0,0 +1 @@
Subproject commit 8363ebe51f5de2e354f20f8ac1fb3e927dbcfa76

5
src/setupTests.js

@ -1,5 +0,0 @@
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';

12678
yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save