From 36fe6f0c1dc3d18bab4c3bf9e213d40171e96b08 Mon Sep 17 00:00:00 2001
From: czm <2192718639@qq.com>
Date: Mon, 18 Apr 2022 13:41:17 +0800
Subject: [PATCH 01/18] 1
---
src/components/searchInput/index.module.scss | 33 ++++
src/components/searchInput/index.tsx | 45 +++++
.../searchList/hightSearchList.config.ts | 3 +
.../searchList/hightSearchList.module.scss | 182 ++++++++++++++++++
src/pages/searchList/hightSearchList.tsx | 98 ++++++++++
src/pages/searchList/index.config.ts | 2 +-
src/pages/searchList/search.config.ts | 3 +
src/pages/searchList/search.module.scss | 72 +++++++
src/pages/searchList/search.tsx | 44 +++++
9 files changed, 481 insertions(+), 1 deletion(-)
create mode 100644 src/components/searchInput/index.module.scss
create mode 100644 src/components/searchInput/index.tsx
create mode 100644 src/pages/searchList/hightSearchList.config.ts
create mode 100644 src/pages/searchList/hightSearchList.module.scss
create mode 100644 src/pages/searchList/hightSearchList.tsx
create mode 100644 src/pages/searchList/search.config.ts
create mode 100644 src/pages/searchList/search.module.scss
create mode 100644 src/pages/searchList/search.tsx
diff --git a/src/components/searchInput/index.module.scss b/src/components/searchInput/index.module.scss
new file mode 100644
index 0000000..c77b507
--- /dev/null
+++ b/src/components/searchInput/index.module.scss
@@ -0,0 +1,33 @@
+
+.searchInput_main{
+ display: flex;
+ align-items: center;
+ min-height: 62px;
+ padding: 10px 0;
+ border-bottom: 1px solid #f3f3f3;
+ .searchInput_title {
+ width: 150px;
+ font-size: 28px;
+ border-right: 1px solid #f3f3f3;
+ color: $color_font_on;
+ margin-right: 20px;
+ padding-left: 20px;
+ &::before{
+ content: "";
+ height: 50px;
+ width: 1px;
+ background-color: #f3f3f3;
+ }
+ }
+ .searchInput_con{
+ flex:1;
+ width: 100%;
+ input{
+ font-size: 26px;
+ }
+ }
+ .icon_more_self{
+ font-size: 28px;
+ color: $color_font_two;
+ }
+}
\ No newline at end of file
diff --git a/src/components/searchInput/index.tsx b/src/components/searchInput/index.tsx
new file mode 100644
index 0000000..2d826fd
--- /dev/null
+++ b/src/components/searchInput/index.tsx
@@ -0,0 +1,45 @@
+import { Input, View } from "@tarojs/components";
+import { memo, useDebugValue, useMemo } from "react";
+import styles from './index.module.scss';
+
+type Params = {
+ showIcon?: false|true,
+ disabled?: false|true,
+ placeholder?: string,
+ title?: string,
+ showTitle?: false|true,
+ showBorder?: false|true,
+ changeOnInput?: (string) => void,
+ clickOnInput?: () => void
+
+}
+
+export default memo((props: Params) => {
+ let {
+ showTitle = true,
+ title = '标题',
+ showIcon = false,
+ disabled = false,
+ placeholder = '请输入',
+ showBorder = true,
+ changeOnInput,
+ clickOnInput
+ } = props
+
+ let stylen = useMemo(() => {
+ if(!showBorder) {
+ return { borderBottom: 0 }
+ }
+ return {}
+ }, [showBorder])
+ console.log('searchInput::')
+ return (
+
+ {showTitle&&{title}}
+
+ clickOnInput?.()} onInput={(e) => changeOnInput?.(e.detail.value)}/>
+
+ {showIcon&&}
+
+ )
+})
\ No newline at end of file
diff --git a/src/pages/searchList/hightSearchList.config.ts b/src/pages/searchList/hightSearchList.config.ts
new file mode 100644
index 0000000..2a9c72b
--- /dev/null
+++ b/src/pages/searchList/hightSearchList.config.ts
@@ -0,0 +1,3 @@
+export default {
+ navigationBarTitleText: '搜索'
+}
diff --git a/src/pages/searchList/hightSearchList.module.scss b/src/pages/searchList/hightSearchList.module.scss
new file mode 100644
index 0000000..fe0e4de
--- /dev/null
+++ b/src/pages/searchList/hightSearchList.module.scss
@@ -0,0 +1,182 @@
+.main{
+ display: flex;
+ flex-direction: column;
+ height: 100vh;
+ background-color: $color_bg_one;
+ .search{
+ padding: 20px;
+ }
+ .filter{
+ .filter_all {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 20px 50px;
+ font-size: $font_size_medium;
+ color: $color_font_three;
+ .text_zh, .text_sc{
+ color: $color_main;
+ display: flex;
+ align-items: center;
+ .sortIcon{
+ display: flex;
+ flex-direction: column;
+ position: relative;
+ .icon_one{
+ font-size: $font_size_medium;
+ position: absolute;
+ margin:auto;
+ top:0;
+ }
+ }
+ }
+ .text_ss{
+ position: relative;
+ .miconfont{
+ font-size: 20px;
+ margin-left: 5px;
+ }
+ &::before{
+ content: '';
+ width: 2px;
+ height: 32px;
+ background-color: #C2C2C2;
+ position: absolute;
+ top: 0;
+ left: -30px;
+ }
+ }
+ }
+ .filter_btn_con{
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ height: 86px;
+
+ }
+ .filter_scroll{
+ flex:1;
+ width: 0;
+ ::-webkit-scrollbar {
+ display:none;
+ width:0;
+ height:0;
+ color:transparent;
+ }
+ }
+ .filter_btn{
+ display: flex;
+ justify-content: space-between;
+ padding: 20px;
+ margin-right: 20px;
+ flex:1;
+ view{
+ font-size: $font_size_medium;
+ background-color: #F0F0F0;
+ border-radius: 24px;
+ min-width: 126px;
+ height: 46.93px;
+ text-align: center;
+ line-height: 46.93px;
+ color: $color_font_three;
+ &:nth-last-child(n+2) {
+ margin-right: 10px;
+ }
+ &:nth-last-child(1) {
+ margin-right: 30px;
+ }
+ }
+ .selected{
+ background-color: #ecf5ff;
+ border: 2px solid #cde5ff;
+ color: $color_main;
+ width: 122px;
+ height: 42.93px;
+ }
+ }
+ .filter_more{
+ font-size: $font_size_medium;
+ color: $color_font_three;
+ padding: 0 30px 0 20px;
+ position: relative;
+ height: 100%;
+ line-height: 86px;
+ &::before{
+ content: '';
+ opacity: 1;
+ width: 30px;
+ height: 100%;
+ position: absolute;
+ left: -15px;
+ background-image: linear-gradient(to right, rgba(248, 248, 248, 0.3), rgba(248, 248, 248, 1) 60% );
+ // z-index: 99;
+ }
+ .miconfont{
+ font-size: 27px;
+ }
+ }
+ }
+ .list{
+ flex:1;
+ display: flex;
+ flex-direction: column;
+ .list_num {
+ font-size: $font_size_min;
+ color:$color_font_two;
+ padding: 10px 38px;
+
+ }
+ .list_num_shadow {
+ box-shadow: 0px 5px 5px #ccc;
+ }
+ .scroll{
+ flex:1;
+ height:0;
+ padding-top: 3px;
+ }
+ .product_list{
+ padding: 38px;
+ display: grid;
+ grid-template-columns: 321px 321px;
+ justify-content: space-between;
+ .product_item{
+ width: 321px;
+ background-color: #fff;
+ border-radius: 20px;
+ margin-bottom: 20px;
+ .product_img{
+ width: 100%;
+ height: 224px;
+ background: #e5ad3a;
+ border-radius: 20px 20px 0px 0px;
+ }
+ }
+ .product_info{
+ padding: 20px;
+ .title{
+ font-size: $font_size;
+ color: $color_font_three;
+ }
+ .tag_list{
+ display: flex;
+ margin-top: 16px;
+ .tag{
+ padding: 3px 10px;
+ background-color: #CDE5FF;
+ font-size: $font_size_min;
+ border-radius: 5px;
+ color: $color_main;
+ &:nth-child(2) {
+ margin-left: 10px;
+ }
+ }
+ }
+ .introduce{
+ font-size: $font_size_medium;
+ color: $color_font_two;
+ margin-top: 16px;
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/pages/searchList/hightSearchList.tsx b/src/pages/searchList/hightSearchList.tsx
new file mode 100644
index 0000000..762ee3a
--- /dev/null
+++ b/src/pages/searchList/hightSearchList.tsx
@@ -0,0 +1,98 @@
+import { ScrollView, Text, View } from "@tarojs/components"
+import classnames from "classnames";
+import Search from '@/components/search'
+import Filter from "@/components/filter";
+import InfiniteScroll from '@/components/infiniteScroll'
+import SortBtn from "@/components/sortBtn";
+import Tabs from "@/components/tabs";
+import styles from './index.module.scss'
+import { useCallback, useState } from "react";
+
+export default () => {
+ const [showFilter, setShowFilter] = useState(false)
+ const [selectList, setSelectList] = useState([
+ {title: '系列', value:1},
+ {title: '系列', value:2},
+ {title: '系列', value:3},
+ {title: '系列', value:4},
+ {title: '系列', value:5},
+ {title: '系列', value:5},
+ {title: '系列', value:5},
+ {title: '系列', value:5},
+ {title: '系列', value:5},
+ ])
+ const [scrollStatus, setScrollStatus] = useState(false)
+ const onscroll = useCallback((e) => {
+ if(e.detail.scrollTop > 20) {
+ setScrollStatus(true)
+ } else {
+ setScrollStatus(false)
+ }
+ },[])
+ return (
+
+
+
+
+
+
+
+ 综合
+
+
+
+ 收藏
+
+
+
+ 高级搜索
+
+
+
+
+
+
+ 系列
+ 幅宽
+ 克重
+ 克重
+ 克重
+ 成分
+
+
+ setShowFilter(true)}>
+ 筛选
+
+
+
+
+
+
+ 搜索结果 (2条记录)
+
+ console.log('123123')}
+ selfOnScroll={(e) => onscroll(e)}
+ >
+
+ {new Array(9).fill(' ').map(item => {
+ return
+
+
+ 0770#21S精棉平纹
+
+ 160cm
+ 110g
+
+ 67.6%棉24%涤纶6.4%氨纶
+
+
+ })}
+
+
+
+
+ setShowFilter(false)}/>
+
+ )
+}
\ No newline at end of file
diff --git a/src/pages/searchList/index.config.ts b/src/pages/searchList/index.config.ts
index 2a9c72b..ad889b7 100644
--- a/src/pages/searchList/index.config.ts
+++ b/src/pages/searchList/index.config.ts
@@ -1,3 +1,3 @@
export default {
- navigationBarTitleText: '搜索'
+ navigationBarTitleText: '高级搜索'
}
diff --git a/src/pages/searchList/search.config.ts b/src/pages/searchList/search.config.ts
new file mode 100644
index 0000000..2a9c72b
--- /dev/null
+++ b/src/pages/searchList/search.config.ts
@@ -0,0 +1,3 @@
+export default {
+ navigationBarTitleText: '搜索'
+}
diff --git a/src/pages/searchList/search.module.scss b/src/pages/searchList/search.module.scss
new file mode 100644
index 0000000..2e4ede6
--- /dev/null
+++ b/src/pages/searchList/search.module.scss
@@ -0,0 +1,72 @@
+.main{
+ .search{
+ display: flex;
+ justify-content: space-between;
+ padding: 20px;
+ padding-bottom: 50px;
+ }
+
+ .hot {
+ padding: 0 20px;
+ .hot_header {
+ width:100%;
+ display: flex;
+ justify-content: space-between;
+ font-size: $font_size_medium;
+ .hot_header_title {
+ font-size: $font_size;
+ color: $color_font_one;
+ font-weight: 700;
+ }
+ .hot_header_up{
+ color: $color_main;
+ }
+ }
+ .list{
+ display: flex;
+ font-size: $font_size_medium;
+ flex-wrap: wrap;
+ padding: 20px 0;
+ .item{
+ margin-right: 20px;
+ margin-bottom: 20px;
+ padding: 10px 20px;
+ background-color: #F0F0F0;
+ color: $color_font_three;
+ border-radius: 50px;
+ }
+ }
+ }
+ .history {
+ padding: 0 20px;
+ .history_header {
+ width:100%;
+ display: flex;
+ justify-content: space-between;
+ font-size: $font_size_medium;
+ .history_header_title {
+ font-size: $font_size;
+ color: $color_font_one;
+ font-weight: 700;
+ }
+ .miconfont{
+ font-size: 30px;
+ color: $color_font_three;
+ }
+ }
+ .list{
+ display: flex;
+ font-size: $font_size_medium;
+ flex-wrap: wrap;
+ padding: 20px 0;
+ .item{
+ margin-right: 20px;
+ margin-bottom: 20px;
+ padding: 10px 20px;
+ background-color: #F0F0F0;
+ color: $color_font_three;
+ border-radius: 50px;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/pages/searchList/search.tsx b/src/pages/searchList/search.tsx
new file mode 100644
index 0000000..2c19f4b
--- /dev/null
+++ b/src/pages/searchList/search.tsx
@@ -0,0 +1,44 @@
+
+import { View } from '@tarojs/components'
+import Search from '@/components/search'
+import { goLink } from '@/common/common';
+import classnames from "classnames";
+import styles from './index.module.scss'
+
+export default () => {
+ return (
+
+
+ goLink('/pages/searchList/index')}/>
+
+
+
+ 热门面料
+ 高级搜索
+
+
+ 9265
+ 全棉双卫衣
+ 全棉双卫衣
+ 全棉双卫衣
+ 全棉双卫衣
+ 26s
+
+
+
+
+ 历史搜索
+
+
+
+ 9265
+ 全棉双卫衣
+ 全棉双卫衣
+ 全棉双卫衣
+ 全棉双卫衣
+ 26s
+
+
+
+ )
+}
From 76ffa9b86cb17e6d35f17bf1a69dee009b42d709 Mon Sep 17 00:00:00 2001
From: czm <2192718639@qq.com>
Date: Mon, 18 Apr 2022 13:52:56 +0800
Subject: [PATCH 02/18] =?UTF-8?q?=E9=AB=98=E7=BA=A7=E6=90=9C=E7=B4=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/app.config.ts | 5 +++--
src/pages/index/index.tsx | 2 +-
src/pages/searchList/hightSearchList.tsx | 3 +--
src/pages/searchList/search.tsx | 4 ++--
.../searchList/{index.config.ts => searchList.config.ts} | 0
.../searchList/{index.module.scss => searchList.module.scss} | 0
src/pages/searchList/{index.tsx => searchList.tsx} | 3 +--
7 files changed, 8 insertions(+), 9 deletions(-)
rename src/pages/searchList/{index.config.ts => searchList.config.ts} (100%)
rename src/pages/searchList/{index.module.scss => searchList.module.scss} (100%)
rename src/pages/searchList/{index.tsx => searchList.tsx} (96%)
diff --git a/src/app.config.ts b/src/app.config.ts
index 4fff5e1..e1da8e2 100644
--- a/src/app.config.ts
+++ b/src/app.config.ts
@@ -1,9 +1,10 @@
export default {
pages: [
'pages/index/index',
- 'pages/search/index',
'pages/user/index',
- 'pages/searchList/index',
+ 'pages/searchList/searchList',
+ 'pages/searchList/hightSearchList',
+ 'pages/searchList/search',
'pages/classList/index',
'pages/details/index',
],
diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx
index 985a864..f147af4 100644
--- a/src/pages/index/index.tsx
+++ b/src/pages/index/index.tsx
@@ -40,7 +40,7 @@ export default () => {
我的收藏
- goLink('/pages/search/index')}/>
+ goLink('/pages/searchList/search')}/>
diff --git a/src/pages/searchList/hightSearchList.tsx b/src/pages/searchList/hightSearchList.tsx
index 762ee3a..8f77271 100644
--- a/src/pages/searchList/hightSearchList.tsx
+++ b/src/pages/searchList/hightSearchList.tsx
@@ -5,7 +5,7 @@ import Filter from "@/components/filter";
import InfiniteScroll from '@/components/infiniteScroll'
import SortBtn from "@/components/sortBtn";
import Tabs from "@/components/tabs";
-import styles from './index.module.scss'
+import styles from './hightSearchList.module.scss'
import { useCallback, useState } from "react";
export default () => {
@@ -65,7 +65,6 @@ export default () => {
-
搜索结果 (2条记录)
diff --git a/src/pages/searchList/search.tsx b/src/pages/searchList/search.tsx
index 2c19f4b..247fa58 100644
--- a/src/pages/searchList/search.tsx
+++ b/src/pages/searchList/search.tsx
@@ -3,13 +3,13 @@ import { View } from '@tarojs/components'
import Search from '@/components/search'
import { goLink } from '@/common/common';
import classnames from "classnames";
-import styles from './index.module.scss'
+import styles from './search.module.scss'
export default () => {
return (
- goLink('/pages/searchList/index')}/>
+ goLink('/pages/searchList/searchList')}/>
diff --git a/src/pages/searchList/index.config.ts b/src/pages/searchList/searchList.config.ts
similarity index 100%
rename from src/pages/searchList/index.config.ts
rename to src/pages/searchList/searchList.config.ts
diff --git a/src/pages/searchList/index.module.scss b/src/pages/searchList/searchList.module.scss
similarity index 100%
rename from src/pages/searchList/index.module.scss
rename to src/pages/searchList/searchList.module.scss
diff --git a/src/pages/searchList/index.tsx b/src/pages/searchList/searchList.tsx
similarity index 96%
rename from src/pages/searchList/index.tsx
rename to src/pages/searchList/searchList.tsx
index 762ee3a..2379d9c 100644
--- a/src/pages/searchList/index.tsx
+++ b/src/pages/searchList/searchList.tsx
@@ -5,7 +5,7 @@ import Filter from "@/components/filter";
import InfiniteScroll from '@/components/infiniteScroll'
import SortBtn from "@/components/sortBtn";
import Tabs from "@/components/tabs";
-import styles from './index.module.scss'
+import styles from './searchList.module.scss'
import { useCallback, useState } from "react";
export default () => {
@@ -65,7 +65,6 @@ export default () => {
-
搜索结果 (2条记录)
From 4a7f7b316f07c8c71e850606c122b72a86b45e58 Mon Sep 17 00:00:00 2001
From: czm <2192718639@qq.com>
Date: Mon, 18 Apr 2022 18:47:22 +0800
Subject: [PATCH 03/18] =?UTF-8?q?=E9=AB=98=E7=BA=A7=E6=90=9C=E7=B4=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/app.tsx | 31 +-
src/common/bluetooth/color/colorDiff.js | 86 ++++
src/common/bluetooth/color/colorSpace.js | 13 +
src/common/bluetooth/color/lab.js | 54 ++
src/common/bluetooth/color/rgb.js | 9 +
src/common/bluetooth/color/xyz.js | 138 +++++
src/common/bluetooth/command.js | 146 ++++++
src/common/bluetooth/utils.js | 70 +++
src/components/bluetooth/LinkBlueTooth.tsx | 90 ++++
src/components/bluetooth/Popup.tsx | 73 +++
.../bluetooth/css/linkBlueTooth.module.scss | 30 ++
.../bluetooth/css/popup.module.scss | 90 ++++
src/components/search/index.module.scss | 3 +-
src/components/searchInput/index.module.scss | 22 +-
src/components/searchInput/index.tsx | 11 +-
src/components/tabs/index.module.scss | 24 +-
src/components/tabs/index.tsx | 9 +-
src/pages/classList/index.module.scss | 15 +-
src/pages/classList/index.tsx | 25 +-
.../components/selectData/index.module.scss | 49 ++
.../components/selectData/index.tsx | 57 +++
.../searchList/hightSearchList.module.scss | 36 +-
src/pages/searchList/hightSearchList.tsx | 57 ++-
src/pages/searchList/searchList.module.scss | 18 +
src/pages/searchList/searchList.tsx | 35 +-
src/use/contextBlueTooth.tsx | 477 ++++++++++++++++++
26 files changed, 1584 insertions(+), 84 deletions(-)
create mode 100644 src/common/bluetooth/color/colorDiff.js
create mode 100644 src/common/bluetooth/color/colorSpace.js
create mode 100644 src/common/bluetooth/color/lab.js
create mode 100644 src/common/bluetooth/color/rgb.js
create mode 100644 src/common/bluetooth/color/xyz.js
create mode 100644 src/common/bluetooth/command.js
create mode 100644 src/common/bluetooth/utils.js
create mode 100644 src/components/bluetooth/LinkBlueTooth.tsx
create mode 100644 src/components/bluetooth/Popup.tsx
create mode 100644 src/components/bluetooth/css/linkBlueTooth.module.scss
create mode 100644 src/components/bluetooth/css/popup.module.scss
create mode 100644 src/pages/searchList/components/selectData/index.module.scss
create mode 100644 src/pages/searchList/components/selectData/index.tsx
create mode 100644 src/use/contextBlueTooth.tsx
diff --git a/src/app.tsx b/src/app.tsx
index c9fd660..dc241a4 100644
--- a/src/app.tsx
+++ b/src/app.tsx
@@ -1,13 +1,26 @@
-import { MovableArea, View } from '@tarojs/components'
+import { Component } from 'react'
+import ContextBlueTooth from "@/use/contextBlueTooth"
+
import './app.scss'
+class App extends Component {
-const App = ({ children }) => {
- return (
- <>
- {children}
- >
- )
-}
+ componentDidMount () {}
-export default App
+ componentDidShow () {}
+
+ componentDidHide () {}
+
+ componentDidCatchError () {}
+
+ // this.props.children 是将要会渲染的页面
+ render () {
+ return (
+
+ {this.props.children}
+
+ )
+ }
+}
+
+export default App
\ No newline at end of file
diff --git a/src/common/bluetooth/color/colorDiff.js b/src/common/bluetooth/color/colorDiff.js
new file mode 100644
index 0000000..73e380d
--- /dev/null
+++ b/src/common/bluetooth/color/colorDiff.js
@@ -0,0 +1,86 @@
+module.exports = function(lab1, lab2){
+
+ var rgb2labArray1 = lab1;
+ var rgb2labArray2 = lab2;
+
+ var l1 = rgb2labArray1[0];
+ var a1 = rgb2labArray1[1];
+ var b1 = rgb2labArray1[2];
+
+ var l2 = rgb2labArray2[0];
+ var a2 = rgb2labArray2[1];
+ var b2 = rgb2labArray2[2];
+
+
+ var avg_lp = (l1 + l2) / 2;
+ var c1 = Math.sqrt(Math.pow(a1, 2) + Math.pow(b1, 2));
+ var c2 = Math.sqrt(Math.pow(a2, 2) + Math.pow(b2, 2));
+ var avg_c = (c1 + c2) / 2;
+ var g = (1- Math.sqrt(Math.pow(avg_c, 7) / (Math.pow(avg_c, 7) + Math.pow(25, 7)))) / 2;
+
+ var a1p = a1 * (1 + g);
+ var a2p = a2 * (1 + g);
+
+ var c1p = Math.sqrt(Math.pow(a1p, 2) + Math.pow(b1, 2));
+ var c2p = Math.sqrt(Math.pow(a2p, 2) + Math.pow(b2, 2));
+
+ var avg_cp = (c1p + c2p) / 2;
+
+ var h1p = rad2deg(Math.atan2(b1, a1p));
+ if(h1p < 0){
+
+ h1p = h1p + 360;
+ }
+
+ var h2p = rad2deg(Math.atan2(b2, a2p));
+ if(h2p < 0){
+
+ h2p = h2p + 360;
+ }
+
+ var avg_hp = Math.abs(h1p - h2p) > 180 ? (h1p + h2p + 360) / 2 : (h1p + h1p) / 2;
+
+ var t = 1 - 0.17 * Math.cos(deg2rad(avg_hp - 30)) + 0.24 * Math.cos(deg2rad(2 * avg_hp)) + 0.32 * Math.cos(deg2rad(3 * avg_hp + 6)) - 0.2 * Math.cos(deg2rad(4 * avg_hp - 63))
+
+ var delta_hp = h2p - h1p;
+ if(Math.abs(delta_hp) > 180){
+ if (h2p <= h1p) {
+ delta_hp += 360;
+ }
+ else {
+ delta_hp -= 360;
+ }
+ }
+
+ var delta_lp = l2 - l1;
+ var delta_cp = c2p - c1p;
+
+ delta_hp = 2 * Math.sqrt(c1p * c2p) * Math.sin(deg2rad(delta_hp) / 2);
+
+ var s_l = 1 + ((0.015 * Math.pow(avg_lp - 50, 2)) / Math.sqrt(20 + Math.pow(avg_lp - 50, 2)));
+ var s_c = 1 + 0.045 * avg_cp
+ var s_h = 1 + 0.015 * avg_cp * t;
+
+ var delta_ro = 30 * Math.exp( - (Math.pow((avg_hp - 275) / 25, 2)));
+ var r_c = 2 * Math.sqrt(Math.pow(avg_cp, 7) / (Math.pow(avg_cp, 7) + Math.pow(25, 7)));
+ var r_t = -r_c * Math.sin(2 * deg2rad(delta_ro));
+
+ var kl = 1, kc =1, kh = 1;
+
+ var delta_e = Math.sqrt(Math.pow(delta_lp / (kl * s_l), 2) + Math.pow(delta_cp / (kc * s_c), 2) + Math.pow(delta_hp / (kh * s_h), 2) + r_t * (delta_cp / (kc * s_c)) * (delta_hp / (kh * s_h)))
+
+ return delta_e
+
+
+ function rad2deg(rad){
+
+ return 360 * rad / (2 * Math.PI);
+ }
+ function deg2rad(deg){
+
+ return (2 * Math.PI * deg) / 360;
+ }
+}
+
+
+
diff --git a/src/common/bluetooth/color/colorSpace.js b/src/common/bluetooth/color/colorSpace.js
new file mode 100644
index 0000000..8d05344
--- /dev/null
+++ b/src/common/bluetooth/color/colorSpace.js
@@ -0,0 +1,13 @@
+
+import LabCom from './lab'
+import XyzCom from './xyz'
+import ColorDiff from './colorDiff'
+
+export const toRgb = (lab) => {
+ let xyz = LabCom.xyz(lab)
+ return XyzCom.rgb(xyz)
+}
+
+export const Ediff = (lab1, lab2) => {
+ return ColorDiff(lab1, lab2)
+}
\ No newline at end of file
diff --git a/src/common/bluetooth/color/lab.js b/src/common/bluetooth/color/lab.js
new file mode 100644
index 0000000..b4c0eab
--- /dev/null
+++ b/src/common/bluetooth/color/lab.js
@@ -0,0 +1,54 @@
+
+var xyz = require('./xyz');
+
+module.exports = {
+ name: 'lab',
+ min: [0,-100,-100],
+ max: [100,100,100],
+ channel: ['lightness', 'a', 'b'],
+ alias: ['LAB', 'cielab'],
+
+ xyz: function(lab) {
+ var l = lab[0],
+ a = lab[1],
+ b = lab[2],
+ x, y, z, y2;
+
+ if (l <= 8) {
+ y = (l * 100) / 903.3;
+ y2 = (7.787 * (y / 100)) + (16 / 116);
+ } else {
+ y = 100 * Math.pow((l + 16) / 116, 3);
+ y2 = Math.pow(y / 100, 1/3);
+ }
+
+ x = x / 95.047 <= 0.008856 ? x = (95.047 * ((a / 500) + y2 - (16 / 116))) / 7.787 : 95.047 * Math.pow((a / 500) + y2, 3);
+
+ z = z / 108.883 <= 0.008859 ? z = (108.883 * (y2 - (b / 200) - (16 / 116))) / 7.787 : 108.883 * Math.pow(y2 - (b / 200), 3);
+
+ return [x, y, z];
+ }
+};
+
+
+//extend xyz
+xyz.lab = function(xyz){
+ var x = xyz[0],
+ y = xyz[1],
+ z = xyz[2],
+ l, a, b;
+
+ x /= 95.047;
+ y /= 100;
+ z /= 108.883;
+
+ x = x > 0.008856 ? Math.pow(x, 1/3) : (7.787 * x) + (16 / 116);
+ y = y > 0.008856 ? Math.pow(y, 1/3) : (7.787 * y) + (16 / 116);
+ z = z > 0.008856 ? Math.pow(z, 1/3) : (7.787 * z) + (16 / 116);
+
+ l = (116 * y) - 16;
+ a = 500 * (x - y);
+ b = 200 * (y - z);
+
+ return [l, a, b];
+};
diff --git a/src/common/bluetooth/color/rgb.js b/src/common/bluetooth/color/rgb.js
new file mode 100644
index 0000000..60ff577
--- /dev/null
+++ b/src/common/bluetooth/color/rgb.js
@@ -0,0 +1,9 @@
+
+
+module.exports = {
+ name: 'rgb',
+ min: [0,0,0],
+ max: [255,255,255],
+ channel: ['red', 'green', 'blue'],
+ alias: ['RGB']
+};
diff --git a/src/common/bluetooth/color/xyz.js b/src/common/bluetooth/color/xyz.js
new file mode 100644
index 0000000..c6e2bee
--- /dev/null
+++ b/src/common/bluetooth/color/xyz.js
@@ -0,0 +1,138 @@
+
+var rgb = require('./rgb');
+
+var xyz = {
+ name: 'xyz',
+ min: [0,0,0],
+ channel: ['X','Y','Z'],
+ alias: ['XYZ', 'ciexyz', 'cie1931']
+};
+
+
+/**
+ * Whitepoint reference values with observer/illuminant
+ *
+ * http://en.wikipedia.org/wiki/Standard_illuminant
+ */
+xyz.whitepoint = {
+ //1931 2°
+ 2: {
+ //incadescent
+ A:[109.85, 100, 35.585],
+ // B:[],
+ C: [98.074, 100, 118.232],
+ D50: [96.422, 100, 82.521],
+ D55: [95.682, 100, 92.149],
+ //daylight
+ D65: [95.045592705167, 100, 108.9057750759878],
+ D75: [94.972, 100, 122.638],
+ //flourescent
+ // F1: [],
+ F2: [99.187, 100, 67.395],
+ // F3: [],
+ // F4: [],
+ // F5: [],
+ // F6:[],
+ F7: [95.044, 100, 108.755],
+ // F8: [],
+ // F9: [],
+ // F10: [],
+ F11: [100.966, 100, 64.370],
+ // F12: [],
+ E: [100,100,100]
+ },
+
+ //1964 10°
+ 10: {
+ //incadescent
+ A:[111.144, 100, 35.200],
+ C: [97.285, 100, 116.145],
+ D50: [96.720, 100, 81.427],
+ D55: [95.799, 100, 90.926],
+ //daylight
+ D65: [94.811, 100, 107.304],
+ D75: [94.416, 100, 120.641],
+ //flourescent
+ F2: [103.280, 100, 69.026],
+ F7: [95.792, 100, 107.687],
+ F11: [103.866, 100, 65.627],
+ E: [100,100,100]
+ }
+};
+
+
+/**
+ * Top values are the whitepoint’s top values, default are D65
+ */
+xyz.max = xyz.whitepoint[2].D65;
+
+
+/**
+ * Transform xyz to rgb
+ *
+ * @param {Array} xyz Array of xyz values
+ *
+ * @return {Array} RGB values
+ */
+xyz.rgb = function (_xyz, white) {
+ //FIXME: make sure we have to divide like this. Probably we have to replace matrix as well then
+ white = white || xyz.whitepoint[2].E;
+
+ var x = _xyz[0] / white[0],
+ y = _xyz[1] / white[1],
+ z = _xyz[2] / white[2],
+ r, g, b;
+
+ // assume sRGB
+ // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
+ r = (x * 3.240969941904521) + (y * -1.537383177570093) + (z * -0.498610760293);
+ g = (x * -0.96924363628087) + (y * 1.87596750150772) + (z * 0.041555057407175);
+ b = (x * 0.055630079696993) + (y * -0.20397695888897) + (z * 1.056971514242878);
+
+ r = r > 0.0031308 ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)
+ : r = (r * 12.92);
+
+ g = g > 0.0031308 ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)
+ : g = (g * 12.92);
+
+ b = b > 0.0031308 ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)
+ : b = (b * 12.92);
+
+ r = Math.min(Math.max(0, r), 1);
+ g = Math.min(Math.max(0, g), 1);
+ b = Math.min(Math.max(0, b), 1);
+
+ return [r * 255, g * 255, b * 255];
+}
+
+
+
+/**
+ * RGB to XYZ
+ *
+ * @param {Array} rgb RGB channels
+ *
+ * @return {Array} XYZ channels
+ */
+rgb.xyz = function(rgb, white) {
+ var r = rgb[0] / 255,
+ g = rgb[1] / 255,
+ b = rgb[2] / 255;
+
+ // assume sRGB
+ r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);
+ g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);
+ b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);
+
+ var x = (r * 0.41239079926595) + (g * 0.35758433938387) + (b * 0.18048078840183);
+ var y = (r * 0.21263900587151) + (g * 0.71516867876775) + (b * 0.072192315360733);
+ var z = (r * 0.019330818715591) + (g * 0.11919477979462) + (b * 0.95053215224966);
+
+ white = white || xyz.whitepoint[2].E;
+
+ return [x * white[0], y * white[1], z * white[2]];
+};
+
+
+
+module.exports = xyz;
diff --git a/src/common/bluetooth/command.js b/src/common/bluetooth/command.js
new file mode 100644
index 0000000..97292d0
--- /dev/null
+++ b/src/common/bluetooth/command.js
@@ -0,0 +1,146 @@
+import { uint32ToUint8Array, uint8ArrayToHex } from "./utils";
+
+export class Command {
+ // 测量序号
+ static measureId = 1;
+
+ // 命令完整响应的长度
+ responseSize = 0;
+ // 命令发送的数据
+ content = new Uint8Array(0);
+ // 命令响应的数据
+ response = new Uint8Array(0);
+ // 等待响应的超时时间
+ timeout = 3000;
+ // 发送的数据是否需要生成和校验值
+ needSign = true;
+
+
+ /**
+ * @param {Uint8Array|ArrayBuffer|number[]} content
+ * @param {number} responseSize
+ * @param {number} timeout
+ * @param {boolean} needSign
+ */
+ constructor(content, responseSize, timeout = 3000, needSign = true) {
+ if (content instanceof Uint8Array) {
+ this.content = content;
+ } else {
+ this.content = new Uint8Array(content);
+ }
+ this.responseSize = responseSize;
+ if (typeof timeout === 'number' && timeout >= 0) {
+ this.timeout = timeout;
+ }
+ this.needSign = needSign;
+ }
+
+ /**
+ * 返回一个 ArrayBuffer 数组, 用于发送
+ * @returns {ArrayBuffer[]}
+ */
+ get data() {
+ if (this.content.length === 0) throw new Error('正文内容不能为空');
+ const data = [];
+ const b = new Uint8Array(this.content.buffer);
+ if (this.needSign) {
+ b[b.length - 1] = Command.getSign(b);
+ }
+ for (let i = 0; i < b.length; i += 20) {
+ data.push(b.slice(i, i + 20).buffer);
+ }
+ return data;
+ }
+
+ /** 是否接收完成 */
+ get isComplete() {
+ return this.response.length >= this.responseSize;
+ }
+
+ /** 是否有效 */
+ get isValid() {
+ return Command.getSign(this.response) === this.response[this.response.length - 1];
+ }
+
+ /**
+ * 填充响应数组
+ * @param {ArrayBuffer} buffer
+ */
+ fillResponse(buffer) {
+ this.response = new Uint8Array([...this.response, ...(new Uint8Array(buffer))]);
+ }
+
+
+ /**
+ * 获取和校验值
+ * @param {ArrayBuffer|Uint8Array} buffer
+ */
+ static getSign(buffer) {
+ const _b = buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer);
+ let sum = 0;
+ _b.slice(0, _b.length - 1).forEach(i => sum += i);
+ return new Uint8Array([sum])[0];
+ }
+
+ // 唤醒命令
+ static WakeUp = new Command([0xf0], 0, 0, false);
+
+ /**
+ * 获取测量命令
+ * @param {number} mode
+ */
+ static measure(mode = 0) {
+ Command.measureId += 1;
+ const measureId = uint32ToUint8Array(Command.measureId);
+ return new Command([0xbb, 1, mode, ...measureId, 0, 0xff, 0], 10, 1500);
+ }
+
+ /**
+ * 获取测量数据 (Lab)
+ * @param {number} mode
+ */
+ static getLab(mode = 0) {
+ return new Command([0xbb, 3, mode, 0, 0, 0, 0, 0, 0xff, 0], 20, 1500);
+ }
+
+ /**
+ * 获取测量数据 (RGB)
+ * @param {number} mode
+ */
+ static getRGB(mode = 0) {
+ return new Command([0xbb, 4, mode, 0, 0, 0, 0, 0, 0xff, 0], 20, 1500);
+ }
+
+ /**
+ * 获取测量的光谱数据
+ * @param {number} mode
+ */
+ static getSpectral(mode = 0) {
+ return new Command([0xbb, 2, 0x10 + mode, 0, 0, 0 ,0 ,0, 0xff, 0], 200, 5000);
+ }
+
+ /**
+ * 白校准
+ * @param {number} check 是否判断校准成功 1 判断 0 不判断
+ */
+ static whiteCalibrate(check = 1) {
+ return new Command([0xbb, 0x11, check, 0, 0, 0, 0, 0, 0xff, 0], 10, 1500);
+ }
+
+
+ /**
+ * 黑校准
+ * @param {number} check 是否判断校准成功
+ */
+ static blackCalibrate(check = 1) {
+ return new Command([0xbb, 0x10, check, 0, 0, 0, 0, 0, 0xff, 0], 10, 1500);
+ }
+
+
+ /** 获取校准状态 */
+ static GetCalibrationInf = new Command([0xbb, 0x1e, 0, 0, 0, 0, 0, 0, 0xff, 0], 20, 1500);
+
+
+
+ static GetDeviceInf = new Command([0xbb, 0x12, 0x01, 0, 0, 0, 0, 0, 0xff, 0], 200, 5000);
+}
\ No newline at end of file
diff --git a/src/common/bluetooth/utils.js b/src/common/bluetooth/utils.js
new file mode 100644
index 0000000..9c4b018
--- /dev/null
+++ b/src/common/bluetooth/utils.js
@@ -0,0 +1,70 @@
+/**
+ * Uint32 转 Uint8 数组
+ * @param {number} n
+ */
+export function uint32ToUint8Array(n) {
+ return new Uint8Array(new Uint32Array([n]).buffer);
+}
+
+/**
+ * Uint8 数组 转 Float32
+ * @param {Uint8Array} raw
+ */
+export function uint8ArrayToFloat32(raw) {
+ return new Float32Array(raw.buffer)[0];
+}
+
+
+/**
+ * Uint8 数组 转 Uint16
+ * @param {Uint8Array} raw
+ */
+export function uint8ArrayToUint16(raw) {
+ return new Uint16Array(raw.buffer)[0];
+}
+
+
+/**
+ * Uint8 数组转 Uint32
+ * @param {Uint8Array} raw
+ * @returns
+ */
+export function uint8ArrayToUnit32(raw) {
+ return new Uint32Array(raw.buffer)[0];
+}
+
+
+/**
+ * 等待指定时长
+ * @param {number} duration
+ */
+export function waitFor(duration) {
+ return new Promise(resolve => {
+ setTimeout(resolve, duration);
+ });
+}
+
+
+/**
+ * uint8 数组转 hex 字符串
+ * @param {Uint8Array} raw
+ */
+export function uint8ArrayToHex(raw) {
+ const s = [];
+ raw.forEach(i => {
+ const b = i.toString(16);
+ s.push(b.length > 1 ? b : `0${b}`);
+ });
+ return s.join(' ');
+}
+
+
+// 二进制转字符串(ascii)
+export function bufferToString(buffer) {
+ let str = "";
+ for (let code of buffer) {
+ if (code === 0) break;
+ str += utf82string(code);
+ }
+ return str;
+}
\ No newline at end of file
diff --git a/src/components/bluetooth/LinkBlueTooth.tsx b/src/components/bluetooth/LinkBlueTooth.tsx
new file mode 100644
index 0000000..66f01a7
--- /dev/null
+++ b/src/components/bluetooth/LinkBlueTooth.tsx
@@ -0,0 +1,90 @@
+import { View } from "@tarojs/components";
+import { memo, useEffect, useMemo, useState } from "react";
+import Taro from "@tarojs/taro";
+import {useBluetooth} from "@/use/contextBlueTooth"
+import SearchInput from "@/components/searchInput";
+import Popup from "@/components/bluetooth/Popup"
+import classnames from "classnames";
+import styles from "./css/linkBlueTooth.module.scss"
+
+export default memo(() => {
+ const {state, init, startScan, connect, disconnect} = useBluetooth()
+
+ useEffect(() => {
+ init()
+ }, [])
+
+ const [linkStatus, setLinkStatus] = useState(1)
+ useEffect(() => {
+ if(!state.available) {
+ setLinkStatus(1)
+ } else if(state.available&&state.connected?.name) {
+ setLinkStatus(3)
+ } else {
+ setLinkStatus(2)
+ }
+ console.log('aaa:::',state.connected)
+ }, [state.available, state.connected])
+
+ const linkName = useMemo(() => {
+ return state.connected?.localName||''
+ }, [state.connected])
+
+ //链接设备
+ const onLinkListen = (item) => {
+ if(!state.connected&&!state.connecting)
+ connect(item)
+ }
+
+ const [popupShow, setPopupShow] = useState(false)
+ //显示设备列表
+ const onFindDevice = () => {
+ if(linkStatus == 1) {
+ Taro.showToast({
+ title:'请打开蓝牙',
+ icon:'none'
+ })
+ } else {
+ setPopupShow(true)
+ onFindEven()
+ }
+
+ }
+ const onFindEven = () => {
+ if(!state.discovering&&!state.connected&&!state.connecting)
+ startScan()
+ }
+
+ //断开链接
+ const onDisconnect = () => {
+ disconnect()
+ setPopupShow(false)
+ }
+
+ return (
+ <>
+
+
+
+
+ {
+ linkStatus == 1&&请开启蓝牙||
+ linkStatus == 2&&未连接设备||
+ linkStatus == 3&&{linkName}
+ }
+
+
+ setPopupShow(false)}
+ onLink={item => onLinkListen(item)}
+ onOff={onDisconnect}
+ onFind={onFindEven}
+ />
+
+ >
+
+ );
+
+})
diff --git a/src/components/bluetooth/Popup.tsx b/src/components/bluetooth/Popup.tsx
new file mode 100644
index 0000000..8a5070a
--- /dev/null
+++ b/src/components/bluetooth/Popup.tsx
@@ -0,0 +1,73 @@
+import { ScrollView, View } from "@tarojs/components"
+import { memo, useEffect, useState } from "react"
+import Loading from "@/components/loading"
+import style from "./css/popup.module.scss"
+
+interface params {
+ state: any,
+ show: Boolean,
+ onClose: (Boolean) => void,
+ onLink: (any) => void,
+ children?: React.ReactNode
+ onOff: () => void,
+ onFind: () => void,
+}
+
+export default memo(({state, show=false, onClose, onLink, onOff, onFind}:params) => {
+ const [popupShow, setPopupShow] = useState(show)
+ useEffect(() => {
+ setPopupShow(show)
+ }, [show])
+ const onCloseListener = () => {
+ onClose(false)
+ }
+
+ return (
+ <>
+ {
+ popupShow&&
+
+ 搜索设备
+
+
+ {
+ (state.devices&&state.devices.length > 0)&&state?.devices.map(item => {
+ return (
+ onLink(item)}>
+ {item.name}
+ {
+ (!state.connecting&&!state.connected)&&链接||
+ (state.connecting&&item.deviceId == state.connecting.deviceId)&&正在链接...||
+ (state.connected&&item.deviceId == state.connected.deviceId)&&链接成功
+ }
+
+ )
+ })||
+
+ {
+ (!state.discovering)&& <>
+ 暂无设备,请按以下条件检查
+ 1.请确保取色仪处于激活状态
+ 2.请确保取色仪没有链接其他设备
+ 3.请打开手机定位
+ >||
+ 设备搜索中
+ }
+
+
+
+ }
+
+
+ {
+ state.connected&&断开链接||
+ (!state.connected&&state.discovering)&&搜索中||
+ 重新搜索
+ }
+
+
+
+ }
+ >
+ )
+})
\ No newline at end of file
diff --git a/src/components/bluetooth/css/linkBlueTooth.module.scss b/src/components/bluetooth/css/linkBlueTooth.module.scss
new file mode 100644
index 0000000..4156811
--- /dev/null
+++ b/src/components/bluetooth/css/linkBlueTooth.module.scss
@@ -0,0 +1,30 @@
+
+.main{
+ .bluetooth_link{
+ display: flex;
+ align-items: center;
+ .link_status{
+ width: 12px;
+ height: 12px;
+ background: #f02409;
+ border-radius: 50%;
+ }
+ .link_statused{
+ background: #07C160;
+ }
+ .link_statused_no{
+ background: #f0ec09;
+ }
+ .link_name{
+ font-size: $font_size;
+ margin-left: 20px;
+
+ }
+ .link_name_no{
+ color: #f02409;
+ }
+ .link_name_no_link{
+ color: #f0ec09;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/components/bluetooth/css/popup.module.scss b/src/components/bluetooth/css/popup.module.scss
new file mode 100644
index 0000000..04eecb7
--- /dev/null
+++ b/src/components/bluetooth/css/popup.module.scss
@@ -0,0 +1,90 @@
+.popup{
+ width: 100vw;
+ height: 100vh;
+ position: absolute;
+ top: 0;
+ left: 0;
+ .mask{
+ width: 100%;
+ height: 100%;
+ background-color: rgba(0,0,0,0.5);
+ position: fixed;
+ top:0;
+ left:0;
+ z-index: 9;
+ }
+ .content{
+ z-index: 99;
+ background-color: #fff;
+ width: 75vw;
+ height: 600px;
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ border-radius: 20px;
+ transform: translateX(-50%) translateY(-50%);
+ display: flex;
+ flex-direction: column;
+ font-size: 28px;
+ .title{
+ text-align: center;
+ margin: 20px;
+ }
+ .list{
+ height: 480px;
+ padding: 0 20px;
+ .scroll{
+ height: 100%;
+ }
+ .item{
+ margin-bottom: 20px;
+ display: flex;
+ justify-content: space-between;
+ border-bottom: 1px dashed #ccc;
+ padding: 15px 0;
+ color: #3b3b3b;
+ @mixin link{
+ font-size: 25px;
+ }
+ .link_success{
+ @include link;
+ color: green;
+ }
+ .link_ing {
+ color: orange;
+ }
+ }
+ .noDevice{
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ color: #a8a8a8;
+ .n_item{
+ width: 100%;
+ text-align: left;
+ margin-top: 20px;
+ padding: 0 30px;
+ box-sizing: border-box;
+ }
+ }
+
+ }
+ .footer{
+ text-align: center;
+ padding: 20px 0;
+ background-color: #f1f1f1;
+ border-radius: 0 0 10px 10px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ }
+ .finding{
+ color: orange;
+ }
+ .footer_off{
+ color: red;
+ }
+ }
+}
diff --git a/src/components/search/index.module.scss b/src/components/search/index.module.scss
index 2121879..46a8c27 100644
--- a/src/components/search/index.module.scss
+++ b/src/components/search/index.module.scss
@@ -20,6 +20,7 @@
border-radius: 50px;
padding: 0 60px;
box-sizing: border-box;
+ z-index:0;
&::-webkit-input-placeholder { /* WebKit browsers */
color: #999;
font-size: 16px;
@@ -55,7 +56,7 @@
position: absolute;
left: 10px;
margin-right: 0;
-
+ z-index: 10;
}
.icon_out{
margin-right: 10px;
diff --git a/src/components/searchInput/index.module.scss b/src/components/searchInput/index.module.scss
index c77b507..c381191 100644
--- a/src/components/searchInput/index.module.scss
+++ b/src/components/searchInput/index.module.scss
@@ -4,20 +4,24 @@
align-items: center;
min-height: 62px;
padding: 10px 0;
- border-bottom: 1px solid #f3f3f3;
+ border-bottom: 1px solid #F0F0F0;
.searchInput_title {
width: 150px;
+ min-height: 50px;
font-size: 28px;
- border-right: 1px solid #f3f3f3;
- color: $color_font_on;
+ border-right: 1px solid #F0F0F0;
+ color: $color_font_two;
margin-right: 20px;
padding-left: 20px;
- &::before{
- content: "";
- height: 50px;
- width: 1px;
- background-color: #f3f3f3;
- }
+ display: flex;
+ align-items: center;
+
+ // &::before{
+ // content: "";
+ // height: 50px;
+ // width: 1px;
+ // background-color: #F0F0F0;
+ // }
}
.searchInput_con{
flex:1;
diff --git a/src/components/searchInput/index.tsx b/src/components/searchInput/index.tsx
index 2d826fd..35d507c 100644
--- a/src/components/searchInput/index.tsx
+++ b/src/components/searchInput/index.tsx
@@ -1,5 +1,5 @@
import { Input, View } from "@tarojs/components";
-import { memo, useDebugValue, useMemo } from "react";
+import { memo, ReactHTMLElement, ReactNode, useDebugValue, useMemo } from "react";
import styles from './index.module.scss';
type Params = {
@@ -10,7 +10,8 @@ type Params = {
showTitle?: false|true,
showBorder?: false|true,
changeOnInput?: (string) => void,
- clickOnInput?: () => void
+ clickOnInput?: () => void,
+ children?: ReactNode
}
@@ -37,9 +38,11 @@ export default memo((props: Params) => {
{showTitle&&{title}}
- clickOnInput?.()} onInput={(e) => changeOnInput?.(e.detail.value)}/>
+ {!props.children&& clickOnInput?.()} onInput={(e) => changeOnInput?.(e.detail.value)}/>
+ ||{props.children}
+ }
- {showIcon&&}
+ {showIcon&&}
)
})
\ No newline at end of file
diff --git a/src/components/tabs/index.module.scss b/src/components/tabs/index.module.scss
index c04b80f..2f0bc2d 100644
--- a/src/components/tabs/index.module.scss
+++ b/src/components/tabs/index.module.scss
@@ -1,20 +1,28 @@
.tabs_main{
display: flex;
+ width: 100%;
.tabs_scroll{
width: 100%;
display: flex;
white-space: nowrap;
- border-bottom: 1px solid $color_font_two;
- border-top: 1px solid $color_font_two;
- height: 102px;
-
+ ::-webkit-scrollbar {
+ display:none;
+ width:0;
+ height:0;
+ color:transparent;
+ }
.tabs_item{
flex:1;
display: inline-block;
- padding: 10px 20px;
- height: 100%;
- box-sizing: border-box;
- position: relative;
+ font-size: 24rpx;
+ background-color: #F0F0F0;
+ border-radius: 24rpx;
+ min-width: 126rpx;
+ height: 46.93rpx;
+ text-align: center;
+ line-height: 46.93rpx;
+ color: #707070;
+ margin-right: 20px;
.tabs_item_con{
height: 100%;
display: flex;
diff --git a/src/components/tabs/index.tsx b/src/components/tabs/index.tsx
index 71a1bc5..3c7492e 100644
--- a/src/components/tabs/index.tsx
+++ b/src/components/tabs/index.tsx
@@ -13,10 +13,12 @@ type Params = {
list?: ListProps[],
defaultValue?: number|string,
children?: ReactNode,
- tabsOnClick?: (ListProps) => void
+ tabsOnClick?: (ListProps) => void,
+ style?:Object,
+
}
-export default memo(({list = [], defaultValue = 0, tabsOnClick}: Params) => {
+export default memo(({list = [], defaultValue = 0, tabsOnClick, style={}}: Params) => {
const [selected, setSelected] = useState(defaultValue)
const [tabId, setTabId] = useState('')
@@ -46,8 +48,7 @@ export default memo(({list = [], defaultValue = 0, tabsOnClick}: Params) => {
list.map((item, index) => {
return (
clickEvent({item,index})}>
- {item.title}
- {(selected == item.value) && }
+ {item.title}
)
})
diff --git a/src/pages/classList/index.module.scss b/src/pages/classList/index.module.scss
index b8028e4..7b62533 100644
--- a/src/pages/classList/index.module.scss
+++ b/src/pages/classList/index.module.scss
@@ -15,6 +15,8 @@
color: $color_font_three;
.text_one{
color: $color_main;
+ display: flex;
+ align-items: center;
}
.text_two{
position: relative;
@@ -33,20 +35,11 @@
}
}
}
- .filter_btn{
+ .filter_btns{
display: flex;
justify-content: space-between;
padding: 20px;
- view{
- font-size: $font_size_medium;
- background-color: #F0F0F0;
- border-radius: 24px;
- width: 126px;
- height: 46.93px;
- text-align: center;
- line-height: 46.93px;
- color: $color_font_three;
- }
+
.selected{
background-color: #ecf5ff;
border: 2px solid #cde5ff;
diff --git a/src/pages/classList/index.tsx b/src/pages/classList/index.tsx
index f9a60b7..bb497cc 100644
--- a/src/pages/classList/index.tsx
+++ b/src/pages/classList/index.tsx
@@ -7,9 +7,22 @@ import Popup from "@/components/popup";
import styles from './index.module.scss'
import { useState } from "react";
import Filter from "./components/filter";
+import Tabs from "@/components/tabs";
+import SortBtn from "@/components/sortBtn";
export default () => {
const [showPopup, setShowPopup] = useState(false)
+ const [selectList, setSelectList] = useState([
+ {title: '系列', value:1},
+ {title: '系列', value:2},
+ {title: '系列', value:3},
+ {title: '系列', value:4},
+ {title: '系列', value:6},
+ {title: '系列', value:7},
+ {title: '系列', value:8},
+ {title: '系列', value:9},
+ {title: '系列', value:10},
+ ])
return (
@@ -17,17 +30,17 @@ export default () => {
- 综合
+
+ 综合
+
+
setShowPopup(true)}>
筛选
-
- 系列
- 幅宽
- 克重
- 成分
+
+
diff --git a/src/pages/searchList/components/selectData/index.module.scss b/src/pages/searchList/components/selectData/index.module.scss
new file mode 100644
index 0000000..2f0bc2d
--- /dev/null
+++ b/src/pages/searchList/components/selectData/index.module.scss
@@ -0,0 +1,49 @@
+.tabs_main{
+ display: flex;
+ width: 100%;
+ .tabs_scroll{
+ width: 100%;
+ display: flex;
+ white-space: nowrap;
+ ::-webkit-scrollbar {
+ display:none;
+ width:0;
+ height:0;
+ color:transparent;
+ }
+ .tabs_item{
+ flex:1;
+ display: inline-block;
+ font-size: 24rpx;
+ background-color: #F0F0F0;
+ border-radius: 24rpx;
+ min-width: 126rpx;
+ height: 46.93rpx;
+ text-align: center;
+ line-height: 46.93rpx;
+ color: #707070;
+ margin-right: 20px;
+ .tabs_item_con{
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: $font_size_medium;
+ }
+ .tabs_index{
+ height: 5px;
+ width: 100%;
+ background-color:$color_main;
+ position:absolute;
+ bottom: 0;
+ left:0;
+ border-radius: 50px;
+ }
+ .tabs_item_select{
+ color: $color_main;
+ }
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/pages/searchList/components/selectData/index.tsx b/src/pages/searchList/components/selectData/index.tsx
new file mode 100644
index 0000000..60db6ee
--- /dev/null
+++ b/src/pages/searchList/components/selectData/index.tsx
@@ -0,0 +1,57 @@
+import { ScrollView, View } from "@tarojs/components";
+import { memo, useState, ReactNode, useEffect } from "react";
+import classnames from "classnames";
+import styles from './index.module.scss'
+
+
+type ListProps = {
+ title: string,
+ value: number
+}
+
+type Params = {
+ list?: ListProps[],
+ defaultValue?: number|string,
+ children?: ReactNode,
+ tabsOnClick?: (ListProps) => void,
+
+}
+
+export default memo(({list = [], defaultValue = 0, tabsOnClick}: Params) => {
+
+ const [tabId, setTabId] = useState('')
+
+ useEffect(() => {
+ const index = list?.findIndex(item => {
+ return item.value == defaultValue
+ })
+ if(index !== -1) {
+ const num = index > 0?( index - 1) : 0
+ setTabId(list[num].value.toString())
+ }
+ }, [])
+
+ const clickEvent = ({item, index}: {item:ListProps, index:number}) => {
+ tabsOnClick?.(item)
+ setTabId(index.toString())
+ }
+ return (
+ <>
+
+
+
+ {
+ list.map((item, index) => {
+ return (
+ clickEvent({item,index})}>
+ {item.title}
+
+ )
+ })
+ }
+
+
+
+ >
+ )
+})
\ No newline at end of file
diff --git a/src/pages/searchList/hightSearchList.module.scss b/src/pages/searchList/hightSearchList.module.scss
index fe0e4de..b40fa10 100644
--- a/src/pages/searchList/hightSearchList.module.scss
+++ b/src/pages/searchList/hightSearchList.module.scss
@@ -5,13 +5,30 @@
background-color: $color_bg_one;
.search{
padding: 20px;
+ .SearchInput{
+ background-color: #fff;
+ padding: 10px 20px;
+ box-sizing: border-box;
+ border-radius: 10px;
+ }
+
+ .bluetooth_color{
+ .color_bock{
+ width: 100px;
+ height: 46px;
+ }
+ .color_bock_no{
+ font-size: $font_size_medium;
+ color: $color_font_three;
+ }
+ }
}
.filter{
.filter_all {
display: flex;
justify-content: space-between;
align-items: center;
- padding: 20px 50px;
+ padding: 20px 130px;
font-size: $font_size_medium;
color: $color_font_three;
.text_zh, .text_sc{
@@ -149,6 +166,23 @@
height: 224px;
background: #e5ad3a;
border-radius: 20px 20px 0px 0px;
+ position: relative;
+ image{
+ width: 100%;
+ height: 100%;
+ border-radius: 20px 20px 0px 0px;
+ }
+ .color_num {
+ background: rgba(0,0,0, 0.5);
+ border-radius: 0px 50px 0px 0px;
+ font-size: $font_size_min;
+ color: #fff;
+ position: absolute;
+ left:0;
+ bottom:0;
+ padding: 5px 20px;
+ box-sizing: border-box;
+ }
}
}
.product_info{
diff --git a/src/pages/searchList/hightSearchList.tsx b/src/pages/searchList/hightSearchList.tsx
index 8f77271..a11ec20 100644
--- a/src/pages/searchList/hightSearchList.tsx
+++ b/src/pages/searchList/hightSearchList.tsx
@@ -1,12 +1,17 @@
-import { ScrollView, Text, View } from "@tarojs/components"
+import { Image, ScrollView, Text, View } from "@tarojs/components"
import classnames from "classnames";
import Search from '@/components/search'
import Filter from "@/components/filter";
import InfiniteScroll from '@/components/infiniteScroll'
import SortBtn from "@/components/sortBtn";
+import SearchInput from "@/components/searchInput";
+import LinkBlueTooth from "@/components/bluetooth/LinkBlueTooth";
+import {useBluetooth} from "@/use/contextBlueTooth"
+import {toRgb} from '@/common/bluetooth/color/colorSpace'
import Tabs from "@/components/tabs";
import styles from './hightSearchList.module.scss'
-import { useCallback, useState } from "react";
+import { useCallback, useEffect, useState } from "react";
+import Taro, { useReady } from "@tarojs/taro";
export default () => {
const [showFilter, setShowFilter] = useState(false)
@@ -29,10 +34,40 @@ export default () => {
setScrollStatus(false)
}
},[])
+
+ const {state, measureAndGetLab} = useBluetooth()
+ const getLab = () => {
+ if(state.connected) {
+ measureAndGetLab()
+ } else {
+ Taro.showToast({
+ title: '请链接设备',
+ icon: 'none'
+ })
+ }
+ }
+
+ const [blueToothColor, setBlueToothColor] = useState('')
+ useEffect(() => {
+ if(state.deviceLab) {
+ console.log('颜色:',state.deviceLab)
+ const rgb = toRgb([state.deviceLab.L, state.deviceLab.a, state.deviceLab.b])
+ setBlueToothColor(`rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`)
+ }
+ }, [state.deviceLab])
return (
-
+
+
+
+ getLab()}>
+ {blueToothColor&&||
+ 请取色
+ }
+
+
+
@@ -44,10 +79,7 @@ export default () => {
收藏
-
- 高级搜索
-
-
+
@@ -76,14 +108,13 @@ export default () => {
{new Array(9).fill(' ').map(item => {
return
-
+
+
+ 25色
+
0770#21S精棉平纹
-
- 160cm
- 110g
-
- 67.6%棉24%涤纶6.4%氨纶
+ 平纹系列
})}
diff --git a/src/pages/searchList/searchList.module.scss b/src/pages/searchList/searchList.module.scss
index fe0e4de..11f55be 100644
--- a/src/pages/searchList/searchList.module.scss
+++ b/src/pages/searchList/searchList.module.scss
@@ -57,6 +57,7 @@
.filter_scroll{
flex:1;
width: 0;
+ padding-left: 20px;
::-webkit-scrollbar {
display:none;
width:0;
@@ -149,6 +150,23 @@
height: 224px;
background: #e5ad3a;
border-radius: 20px 20px 0px 0px;
+ position: relative;
+ image{
+ width: 100%;
+ height: 100%;
+ border-radius: 20px 20px 0px 0px;
+ }
+ .color_num {
+ background: rgba(0,0,0, 0.5);
+ border-radius: 50px 0px 0px 0px;
+ font-size: $font_size_min;
+ color: #fff;
+ position: absolute;
+ right:0;
+ bottom:0;
+ padding: 5px 20px;
+ box-sizing: border-box;
+ }
}
}
.product_info{
diff --git a/src/pages/searchList/searchList.tsx b/src/pages/searchList/searchList.tsx
index 2379d9c..21a5757 100644
--- a/src/pages/searchList/searchList.tsx
+++ b/src/pages/searchList/searchList.tsx
@@ -1,10 +1,12 @@
-import { ScrollView, Text, View } from "@tarojs/components"
+import { Image, ScrollView, Text, View } from "@tarojs/components"
import classnames from "classnames";
import Search from '@/components/search'
import Filter from "@/components/filter";
import InfiniteScroll from '@/components/infiniteScroll'
import SortBtn from "@/components/sortBtn";
+import SelectData from "./components/selectData";
import Tabs from "@/components/tabs";
+import { goLink } from "@/common/common";
import styles from './searchList.module.scss'
import { useCallback, useState } from "react";
@@ -15,11 +17,11 @@ export default () => {
{title: '系列', value:2},
{title: '系列', value:3},
{title: '系列', value:4},
- {title: '系列', value:5},
- {title: '系列', value:5},
- {title: '系列', value:5},
- {title: '系列', value:5},
- {title: '系列', value:5},
+ {title: '系列', value:6},
+ {title: '系列', value:7},
+ {title: '系列', value:8},
+ {title: '系列', value:9},
+ {title: '系列', value:10},
])
const [scrollStatus, setScrollStatus] = useState(false)
const onscroll = useCallback((e) => {
@@ -44,22 +46,16 @@ export default () => {
收藏
-
+ goLink('/pages/searchList/hightSearchList')}>
高级搜索
+
-
-
- 系列
- 幅宽
- 克重
- 克重
- 克重
- 成分
-
-
+
+
+
setShowFilter(true)}>
筛选
@@ -76,7 +72,10 @@ export default () => {
{new Array(9).fill(' ').map(item => {
return
-
+
+
+ 25色
+
0770#21S精棉平纹
diff --git a/src/use/contextBlueTooth.tsx b/src/use/contextBlueTooth.tsx
new file mode 100644
index 0000000..518c5cc
--- /dev/null
+++ b/src/use/contextBlueTooth.tsx
@@ -0,0 +1,477 @@
+import React, {useRef, useState } from "react"
+import Taro from "@tarojs/taro";
+import { Command } from "@/common/bluetooth/command";
+import { uint8ArrayToFloat32, uint8ArrayToHex, waitFor } from "@/common/bluetooth/utils";
+
+
+interface params {
+ init: () => void
+ state: Object,
+ startScan: () => void,
+ measureAndGetLab: () => any,
+ getAdapterState: () => void,
+ connect: (any) => void,
+ disconnect: () => void
+}
+const Context = React.createContext(null)
+
+interface stateStype {
+ listeners: any,
+ discovering: boolean,
+ available: boolean,
+ connected: any,
+ connecting: any,
+ serviceRule: any,
+ serviceId: any,
+ characteristicRule: any,
+ characteristicId: any,
+
+ /** 正在执行的命令 */
+ command: any,
+ responseResolve: any,
+ responseReject: any,
+ responseTimer: any,
+
+ /** 是否显示蓝牙调试信息 */
+ debug: any,
+ //搜索到的设备
+ devices: any,
+ //取色仪主动返回的数据
+ deviceLab: any
+}
+
+let stateObj: stateStype = {
+ /** 事件监听器 */
+ listeners: new Set(),
+ /** 正在扫描设备 */
+ discovering: false,
+ /** 蓝牙是否可用 */
+ available: true,
+ /** 当前连接的设备 */
+ connected: null,
+ /** 正在连接的设备 */
+ connecting: null,
+
+ serviceRule: /^0000FFE0/,
+ serviceId: null,
+ characteristicRule: /^0000FFE1/,
+ characteristicId: null,
+
+ /** 正在执行的命令 */
+ command: null,
+ responseResolve: null,
+ responseReject: null,
+ responseTimer: null,
+
+ /** 是否显示蓝牙调试信息 */
+ debug: true,
+ //搜索到的设备
+ devices: [],
+ //取色仪主动返回的数据
+ deviceLab: null
+}
+
+export default (props) => {
+ let refStatus = useRef(stateObj)
+ let [state, setState] = useState(refStatus.current)
+
+ const changeStatus = (obj:Object): void => {
+ refStatus.current = {...refStatus.current, ...obj}
+ setState({...refStatus.current})
+ }
+
+ const init = async () => {
+ try{
+ await openAdapter();
+ }catch(e) {
+ changeStatus({available:false})
+ }
+
+ // 绑定事件通知
+ Taro.onBluetoothAdapterStateChange(res => {
+ emit({ type: 'stateUpdate', detail: res });
+ });
+ Taro.onBLEConnectionStateChange(res => {
+ emit({ type: res.connected ? 'connected' : 'disconnect', detail: res });
+ });
+ Taro.onBLECharacteristicValueChange(({ value }) => notifySubscriber(value));
+ subscribe(async ev => {
+ if (ev.type === 'stateUpdate') {
+ // 蓝牙状态发生的变化
+ changeStatus({discovering:ev.detail.discovering, available:ev.detail.available})
+ } else if (ev.type === 'disconnect' && refStatus.current.connected && refStatus.current.connected.deviceId === ev.detail.deviceId) {
+ // 断开连接
+ changeStatus({
+ connected:null,
+ serviceId:null,
+ characteristicId:null,
+ deviceLab:null,
+ devices:[]
+ })
+ Taro.showToast({ icon: 'none', title: '蓝牙连接已断开' });
+ } else if (ev.type === 'connected' && refStatus.current.connecting) {
+ // 连接成功
+ changeStatus({connected: refStatus.current.connecting, connecting: null})
+ Taro.showToast({ title: '蓝牙已连接' });
+ } else if (ev.type === 'measure') {
+ //监听取色仪主动推送lab
+ await measureAndGetLab()
+ }
+
+ });
+ }
+
+ /** 打开蓝牙适配器 */
+ const openAdapter = () => {
+ return new Promise((resolve, reject) => {
+ Taro.openBluetoothAdapter({
+ success: resolve,
+ fail: reject
+ });
+ });
+ }
+
+ /**
+ * 推送事件
+ * @param {{type: string; data: any}} event
+ */
+ const emit = (event) => {
+ refStatus.current.listeners.forEach(cb => {
+ cb && cb(event);
+ });
+ }
+
+ const subscribe = (cb) => {
+ if (cb) {
+ changeStatus({
+ listeners: refStatus.current.listeners.add(cb)
+ })
+ }
+ }
+
+ /**
+ * 获取蓝牙适配器状态
+ * @returns {Promise<{discovering: boolean; available: boolean}>}
+ */
+ const getAdapterState = () => {
+ return new Promise((resolve, reject) => {
+ Taro.getBluetoothAdapterState({
+ success: resolve,
+ fail: reject
+ })
+ })
+ }
+
+ /**
+ * 启动设备扫描
+ * @param {(res: { devices: { name: string, deviceId: string, RSSI: number }[] }) => void} cb
+ * @param {number} duration
+ */
+ const startScan = (duration = 30000) => {
+ console.log('开始寻找')
+ changeStatus({devices:[]})
+ Taro.onBluetoothDeviceFound(getDevices);
+ return new Promise((resolve, reject) => {
+ Taro.startBluetoothDevicesDiscovery({
+ allowDuplicatesKey: true,
+ success: resolve,
+ fail: reject
+ });
+
+ if (duration > 0) {
+ setTimeout(() => {
+ Taro.offBluetoothDeviceFound(getDevices);
+ Taro.stopBluetoothDevicesDiscovery();
+ console.log("停止搜索")
+ }, duration);
+ }
+ });
+ }
+
+ //获取搜索到的设备
+ const getDevices = (res) => {
+ res.devices.forEach(device => {
+ // 排除掉已搜索到的设备和名称不合法的设备, 将新发现的设备添加到列表中
+ if (/^CM/.test(device.name) && !refStatus.current.devices.find(i => i.deviceId === device.deviceId)) {
+ changeStatus({devices: [ ...refStatus.current.devices, device ]})
+ }
+ });
+ }
+
+ /**
+ * 连接设备
+ * @param {{ name: string, deviceId: string, RSSI: number }} device
+ */
+ const connect = async (device) => {
+ try {
+ changeStatus({connecting: device})
+ console.log('connecting::', device)
+ await createConnection(device.deviceId);
+ await discoverService(device.deviceId);
+ await discoverCharacteristic(device.deviceId);
+ await notifyCharacteristicValueChange(device.deviceId);
+ } catch (e) {
+ changeStatus({connecting: null})
+ Taro.showToast({ icon: 'none', title: '蓝牙连接失败' });
+ throw e;
+ }
+ }
+
+ /** 断开当前连接的设备 */
+ const disconnect = async () => {
+ if (!refStatus.current.connected && !refStatus.current.connecting) return;
+ if (refStatus.current.connected) {
+ await closeConnection(refStatus.current.connected.deviceId);
+ resetCommand();
+ changeStatus({
+ connected: null,
+ serviceId: null,
+ characteristicId: null,
+ devices: [],
+ deviceLab: null
+ })
+ }
+
+ if (refStatus.current.connecting) {
+ await closeConnection(refStatus.current.connecting.deviceId);
+ changeStatus({connecting:null})
+ }
+ }
+
+ /** 创建 BLE 连接 */
+ function createConnection(deviceId) {
+ return new Promise((resolve, reject) => {
+ Taro.createBLEConnection({
+ deviceId,
+ timeout: 2000,
+ success: resolve,
+ fail: reject
+ });
+ });
+ }
+
+ /** 关闭 BLE 连接 */
+ function closeConnection(deviceId) {
+ return new Promise((resolve, reject) => {
+ Taro.closeBLEConnection({
+ deviceId,
+ success: resolve,
+ fail: reject
+ });
+ });
+ }
+
+ /** 搜索服务 */
+ function discoverService(deviceId) {
+ return new Promise((resolve, reject) => {
+ Taro.getBLEDeviceServices({
+ deviceId,
+ success: ({ services }) => {
+ const service = services.find(i => refStatus.current.serviceRule.test(i.uuid));
+ if (!service) {
+ reject(new Error('服务不可用'));
+ } else {
+ changeStatus({serviceId: service.uuid})
+ resolve(service);
+ }
+ },
+ fail: reject
+ });
+ });
+ }
+
+ /** 搜索特征 */
+ function discoverCharacteristic(deviceId) {
+ return new Promise((resolve, reject) => {
+ Taro.getBLEDeviceCharacteristics({
+ deviceId,
+ serviceId: refStatus.current.serviceId,
+ success: ({ characteristics }) => {
+ const characteristic = characteristics.find(i => refStatus.current.characteristicRule.test(i.uuid));
+ if (!characteristic) {
+ reject(new Error('特征不可用'));
+ } else {
+ changeStatus({characteristicId: characteristic.uuid})
+ resolve(characteristic);
+ }
+ },
+ fail: reject
+ })
+ });
+ }
+
+ /** 启动特征通知 */
+ function notifyCharacteristicValueChange(deviceId, stateParm = true) {
+ return new Promise((resolve, reject) => {
+ Taro.notifyBLECharacteristicValueChange({
+ deviceId,
+ serviceId: refStatus.current.serviceId,
+ characteristicId: refStatus.current.characteristicId,
+ state:stateParm,
+ success: resolve,
+ fail: reject
+ });
+ });
+ }
+
+ /**
+ * 通知订阅器
+ * @param {ArrayBuffer} buffer
+ */
+ function notifySubscriber(buffer) {
+ if (refStatus.current.command) {
+ if (refStatus.current.debug) {
+ console.log(`[BLE RESP] ${uint8ArrayToHex(new Uint8Array(buffer))}`);
+ }
+ refStatus.current.command.fillResponse(buffer);
+ if (refStatus.current.command.isComplete) {
+ if (refStatus.current.command.isValid && refStatus.current.responseResolve) {
+ refStatus.current.responseResolve(refStatus.current.command.response);
+ } else if (!refStatus.current.command.isValid) {
+ refStatus.current.responseReject(new Error('无效数据'));
+ }
+ resetCommand();
+ }
+ } else {
+ const uint8Array = new Uint8Array(buffer);
+ if (uint8Array[0] === 0xbb && uint8Array[1] === 1 && uint8Array[3] === 0) {
+ const ev = { type: 'measure', detail: { mode: uint8Array[2] } };
+ emit(ev);
+ }
+ }
+ }
+
+ /**
+ * 发送命令
+ * @param {Command}} command
+ * @returns {Promise}
+ */
+ function exec(command) {
+ return new Promise(async (resolve, reject) => {
+ if (refStatus.current.command) {
+ reject(new Error('正在执行其他命令'));
+ } else {
+ try {
+ refStatus.current.command = command;
+ const data = command.data;
+ for (let i = 0; i < data.length; i++) {
+ await sendData(data[i]);
+ }
+
+ if (command.responseSize <= 0) {
+ resolve(true);
+ resetCommand();
+ } else {
+ refStatus.current.responseReject = reject;
+ refStatus.current.responseResolve = resolve;
+ refStatus.current.responseTimer = setTimeout(() => {
+ reject(new Error('命令响应超时'));
+ resetCommand();
+ }, command.timeout);
+ }
+ } catch (e) {
+ reject(e);
+ }
+ }
+
+ });
+ }
+
+ /**
+ * 发送命令
+ * @param {ArrayBuffer} buffer
+ */
+ function sendData(buffer) {
+ if (refStatus.current.debug) {
+ console.log(`[BLE SEND] ${uint8ArrayToHex(new Uint8Array(buffer))}`);
+ }
+ return new Promise((resolve, reject) => {
+ console.log('current:::',refStatus.current)
+ Taro.writeBLECharacteristicValue({
+ deviceId: refStatus.current.connected.deviceId,
+ serviceId: refStatus.current.serviceId,
+ characteristicId: refStatus.current.characteristicId,
+ value: buffer,
+ success: resolve,
+ fail: reject
+ })
+ });
+ }
+
+ function resetCommand() {
+ if (refStatus.current.responseTimer) {
+ clearTimeout(refStatus.current.responseTimer);
+ }
+ changeStatus({
+ command: null,
+ responseResolve: null,
+ responseReject: null,
+ responseTimer: null
+ })
+ }
+
+ /**
+ * 测量
+ * @param {number} mode
+ * @returns {Promise}
+ */
+ async function measure (mode = 0) {
+ console.log('current1:::',Command.WakeUp)
+ await exec(Command.WakeUp);
+ console.log('current2:::',Command.WakeUp)
+ await waitFor(50);
+ console.log('current3:::',Command.WakeUp)
+ return await exec(Command.measure(mode));
+ }
+
+ /**
+ * 获取测量的 lab 值
+ * @param {number} mode
+ * @returns {Promise<{ L: number, a: number, b: number }>}
+ */
+ async function getLab(mode = 0) {
+ await exec(Command.WakeUp);
+ await waitFor(50);
+ const data: any = await exec(Command.getLab(mode));
+ return {
+ L: uint8ArrayToFloat32(data.slice(5, 9)),
+ a: uint8ArrayToFloat32(data.slice(9, 13)),
+ b: uint8ArrayToFloat32(data.slice(13, 17)),
+ };
+ }
+
+ /**
+ * 测量并获取 lab 值
+ * @param {number} mode
+ * @returns {Promise<{L: number, a: number, b: number}>}
+ */
+ async function measureAndGetLab(mode = 0) {
+ await measure(mode);
+ await waitFor(50);
+ const lab = await getLab(mode);
+ console.log('lab2::',lab)
+ changeStatus({deviceLab:lab})
+ return lab
+ }
+
+ return
+}
+
+
+export const useBluetooth = () => {
+ const res = React.useContext(Context)
+ if(res) {
+ return {...res}
+ } else {
+ return {}
+ }
+
+}
\ No newline at end of file
From 4a21fa0451f11cd83e85cd86c904a4fc009047c6 Mon Sep 17 00:00:00 2001
From: czm <2192718639@qq.com>
Date: Tue, 19 Apr 2022 13:43:40 +0800
Subject: [PATCH 04/18] =?UTF-8?q?=E9=AB=98=E7=BA=A7=E6=90=9C=E7=B4=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/infiniteScroll/index.module.scss | 1 +
src/components/infiniteScroll/index.tsx | 10 ++++++----
src/components/moveBtn/index.module.scss | 1 +
.../searchList/components/selectData/index.module.scss | 4 +++-
4 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/components/infiniteScroll/index.module.scss b/src/components/infiniteScroll/index.module.scss
index be3ffd3..d72d954 100644
--- a/src/components/infiniteScroll/index.module.scss
+++ b/src/components/infiniteScroll/index.module.scss
@@ -1,6 +1,7 @@
.scroll_main{
height: 100%;
+
.infinite_scroll{
font-size: $font_size_medium;
color: $color_font_two;
diff --git a/src/components/infiniteScroll/index.tsx b/src/components/infiniteScroll/index.tsx
index 1624ad8..aeb35c3 100644
--- a/src/components/infiniteScroll/index.tsx
+++ b/src/components/infiniteScroll/index.tsx
@@ -7,6 +7,7 @@ type Params = {
styleObj?: Object,
selfonScrollToLower?: () => void,
hasMore?: false|true,
+ moreStatus?: false|true,
children?: ReactNode,
lowerThresholdNum?: number,
selfOnScrollToUpper?:() => void
@@ -17,7 +18,7 @@ type Params = {
selfOnRefresherAbort?: () => void
paddingBottom?: number,
refresherTriggered?: true|false,
- refresherEnabled?: true|false
+ refresherEnabled?: true|false,
}
export default memo(({
styleObj,
@@ -33,7 +34,8 @@ export default memo(({
lowerThresholdNum = 5,
paddingBottom = 0,
refresherTriggered = false,
- refresherEnabled = false
+ refresherEnabled = false,
+ moreStatus = true
}: Params) => {
const scrollToLower = () => {
selfonScrollToLower?.()
@@ -77,12 +79,12 @@ export default memo(({
>
{children}
-
+ {moreStatus&&
{
hasMore&&加载中||
没有更多了
}
-
+ }
diff --git a/src/components/moveBtn/index.module.scss b/src/components/moveBtn/index.module.scss
index 9400687..f04d5be 100644
--- a/src/components/moveBtn/index.module.scss
+++ b/src/components/moveBtn/index.module.scss
@@ -12,6 +12,7 @@
display: flex;
justify-content: center;
align-items: center;
+ z-index:999;
.shop_icon{
font-size: 50px;
color: $color_main;
diff --git a/src/pages/searchList/components/selectData/index.module.scss b/src/pages/searchList/components/selectData/index.module.scss
index 2f0bc2d..0d19650 100644
--- a/src/pages/searchList/components/selectData/index.module.scss
+++ b/src/pages/searchList/components/selectData/index.module.scss
@@ -15,7 +15,7 @@
flex:1;
display: inline-block;
font-size: 24rpx;
- background-color: #F0F0F0;
+ background-color: #ecf5ff;
border-radius: 24rpx;
min-width: 126rpx;
height: 46.93rpx;
@@ -23,12 +23,14 @@
line-height: 46.93rpx;
color: #707070;
margin-right: 20px;
+ border: 2px solid #cde5ff;
.tabs_item_con{
height: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: $font_size_medium;
+
}
.tabs_index{
height: 5px;
From 8ebca1e661944139be4fc1e5811bb6165767bf4f Mon Sep 17 00:00:00 2001
From: czm <2192718639@qq.com>
Date: Tue, 19 Apr 2022 18:43:24 +0800
Subject: [PATCH 05/18] =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E8=AE=A2=E5=8D=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/app.config.ts | 2 +-
.../estimatedAmount/index.module.scss | 23 ++
.../components/estimatedAmount/index.tsx | 17 ++
src/pages/order/index.config.ts | 3 +
src/pages/order/index.module.scss | 207 ++++++++++++++++++
src/pages/order/index.tsx | 107 +++++++++
6 files changed, 358 insertions(+), 1 deletion(-)
create mode 100644 src/pages/order/components/estimatedAmount/index.module.scss
create mode 100644 src/pages/order/components/estimatedAmount/index.tsx
create mode 100644 src/pages/order/index.config.ts
create mode 100644 src/pages/order/index.module.scss
create mode 100644 src/pages/order/index.tsx
diff --git a/src/app.config.ts b/src/app.config.ts
index 525469c..1f73284 100644
--- a/src/app.config.ts
+++ b/src/app.config.ts
@@ -87,7 +87,7 @@ export default {
]
},
{
- root: "pages/weightListAdd",
+ root: "pages/order",
pages: [
"index"
]
diff --git a/src/pages/order/components/estimatedAmount/index.module.scss b/src/pages/order/components/estimatedAmount/index.module.scss
new file mode 100644
index 0000000..f12d646
--- /dev/null
+++ b/src/pages/order/components/estimatedAmount/index.module.scss
@@ -0,0 +1,23 @@
+.order_price{
+ font-weight: 700;
+ display: flex;
+ align-items: center;
+ .order_price_text{
+ font-size: $font_size_medium;
+ margin-right: 10px;
+ }
+ .order_price_num{
+ text{
+ &:nth-child(1) {
+ font-size: $font_size_min;
+ }
+ &:nth-child(2) {
+ font-size: $font_size_big;
+ }
+ &:nth-child(3) {
+ font-size: $font_size_medium;
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/src/pages/order/components/estimatedAmount/index.tsx b/src/pages/order/components/estimatedAmount/index.tsx
new file mode 100644
index 0000000..27d63f1
--- /dev/null
+++ b/src/pages/order/components/estimatedAmount/index.tsx
@@ -0,0 +1,17 @@
+import { Text, View } from "@tarojs/components"
+import styles from './index.module.scss'
+type Param = {
+ style?: Object
+}
+export default ({style}:Param) => {
+ return (
+
+ 预估金额
+
+ ¥
+ 6,001
+ .00
+
+
+ )
+}
\ No newline at end of file
diff --git a/src/pages/order/index.config.ts b/src/pages/order/index.config.ts
new file mode 100644
index 0000000..b0cb522
--- /dev/null
+++ b/src/pages/order/index.config.ts
@@ -0,0 +1,3 @@
+export default {
+ navigationBarTitleText: '确认订单'
+}
diff --git a/src/pages/order/index.module.scss b/src/pages/order/index.module.scss
new file mode 100644
index 0000000..84a37bd
--- /dev/null
+++ b/src/pages/order/index.module.scss
@@ -0,0 +1,207 @@
+.order_main{
+ min-height: 100%;
+ background-color:$color_bg_one;
+ padding: 20px;
+ padding-bottom: 190px;
+ box-sizing: border-box;
+ .order_title{
+ display: flex;
+ align-items: center;
+ padding: 20px 30px;
+ box-sizing: border-box;
+ background-color: #fff;
+ height: 116px;
+ border-radius: 20px;
+ text{
+ flex:1;
+ font-size: $font_size;
+ font-weight: 700;
+ }
+ .order_status{
+ background-color: #F0F0F0;
+ width: 148px;
+ height: 55px;
+ color: $color_font_three;
+ text-align: center;
+ line-height: 55px;
+ font-size: $font_size_medium;
+ border-radius: 30px;
+ &:nth-last-child(1) {
+ margin-left: 20px;
+ }
+ }
+ }
+ .order_address{
+ height: 178px;
+ background: #ffffff;
+ border-radius: 20px;
+ display: flex;
+ align-items: center;
+ padding: 30px;
+ box-sizing: border-box;
+ margin-top: 20px;
+ .order_address_icon{
+ font-size: 60px;
+ }
+ .order_address_text{
+ flex: 1;
+ font-size: $font_size;
+ font-weight: 700;
+ margin-left: 30px;
+ }
+ .order_address_more_icon{
+ color: $color_font_three;
+ font-size: $font_size;
+ }
+ }
+ .orders_list_con{
+ margin-top: 20px;
+ background-color: #fff;
+ border-radius: 20px;
+ padding: 20px;
+ }
+ .order_list{
+ &:nth-child(n+2) {
+ margin-top: 30px;
+ }
+ .order_list_title{
+ display: flex;
+ align-items: center;
+ .tag{
+ font-size: $font_size_min;
+ background-color: #CDE5FF;
+ padding: 5px 10px;
+ border-radius: 6px;
+ color: $color_main;
+ }
+ .title{
+ font-weight: 700;
+ font-size: $font_size;
+ margin-left: 20px;
+ flex:1;
+ }
+ .num{
+ color: $color_font_two;
+ font-size: $font_size_min;
+ }
+ }
+ }
+ .order_list_scroll{
+ margin-top: 30px;
+
+ .order_list_item {
+ display: flex;
+ &:nth-child(2) {
+ margin-top: 30px;
+ }
+ .order_list_item_img{
+ width: 126px;
+ height: 126px;
+ border-radius: 20px;
+ background-color: red;
+ }
+ .order_list_item_con{
+ display: flex;
+ width: 100%;
+ flex:1;
+ border-bottom: 1px solid #f0f0f0;
+ height: 150px;
+ padding-top: 20px;
+ box-sizing: border-box;
+ }
+ .order_list_item_des{
+ flex:1;
+ box-sizing: border-box;
+ padding-left: 30px;
+ .order_list_item_title{
+ font-weight: 700;
+ font-size: $font_size;
+ margin-bottom: 15px;
+ }
+ .order_list_item_price{
+ font-size: 26px;
+ color: $color_font_three;
+ }
+ }
+ .order_list_item_count{
+ .count_num{
+ color: $color_main;
+ font-size: $font_size;
+ margin-bottom: 15px;
+ font-weight: 400;
+ text{
+ font-size: $font_size_min;
+ }
+ }
+ .count_price {
+ font-size: $font_size;
+ font-weight: 700;
+ text{
+ font-size: $font_size_min;
+ }
+ }
+ }
+ }
+ }
+ .order_estimated_amount{
+ display: flex;
+ align-items: flex-end;
+ flex-direction: column;
+ padding: 30px 0;
+ .order_price_des{
+ font-size: $font_size_medium;
+ color: $color_font_two;
+ }
+ }
+ .order_desc{
+ display: flex;
+ align-items: center;
+ background-color: #fff;
+ padding: 0 30px;
+ height: 116px;
+ border-radius: 20px;
+ margin-top: 20px;
+ .order_desc_con{
+ flex:1;
+ font-size: $font_size;
+ font-weight: 700;
+ }
+ .order_desc_text{
+ font-size: $font_size_medium;
+ color: $color_font_two;
+ margin-right: 10px;
+ }
+ .miconfont{
+ font-size: 20px;
+ color: $color_font_two;
+ }
+ }
+ .submit_order{
+ display: flex;
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ justify-content: space-between;
+ width: 100%;
+ height: 175px;
+ align-items: center;
+ background-color: #fff;
+ box-shadow: 6px 0px 12px 0px rgba(0,0,0,0.16);
+ padding: 20px 50px;
+ box-sizing: border-box;
+ padding-bottom: constant(safe-area-inset-bottom);
+ padding-bottom: env(safe-area-inset-bottom);
+ .order_btn {
+ width: 250px;
+ height: 90px;
+ opacity: 0.6;
+ background: linear-gradient(38deg,#007aff, #4fa6ff 100%, #68b4ff 100%);
+ border-radius: 46px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ color: #fff;
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/src/pages/order/index.tsx b/src/pages/order/index.tsx
new file mode 100644
index 0000000..7dc2644
--- /dev/null
+++ b/src/pages/order/index.tsx
@@ -0,0 +1,107 @@
+import { Text, View } from "@tarojs/components"
+import classnames from "classnames";
+import EstimatedAmount from "./components/estimatedAmount";
+import styles from './index.module.scss'
+
+ export default () => {
+ return (
+
+
+ 收货方式
+ 物流
+ 上门自提
+
+
+
+ 请选择收货地址及信息
+
+
+
+
+
+ 大货
+ 0770# 21S单面平纹(食毛)
+ 共3种
+
+
+
+
+
+
+ 1# 薄荷绿
+ ¥40/kg
+
+
+ ×1条
+ ¥1,000.5
+
+
+
+
+
+
+
+ 1# 薄荷绿
+ ¥40/kg
+
+
+ ×1条
+ ¥1,000.5
+
+
+
+
+
+
+
+ 大货
+ 0770# 21S单面平纹(食毛)
+ 共3种
+
+
+
+
+
+
+ 1# 薄荷绿
+ ¥40/kg
+
+
+ ×1条
+ ¥1,000.5
+
+
+
+
+
+
+
+ 1# 薄荷绿
+ ¥40/kg
+
+
+ ×1条
+ ¥1,000.5
+
+
+
+
+
+
+
+ (按照25kg/条, 预估金额)
+
+
+
+ 订单备注
+ 点击填写
+
+
+
+
+ 提交订单
+
+
+
+ )
+ }
\ No newline at end of file
From 2731717a7d546264f31961e2639122e584303961 Mon Sep 17 00:00:00 2001
From: czm <2192718639@qq.com>
Date: Wed, 20 Apr 2022 11:05:30 +0800
Subject: [PATCH 06/18] =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E8=AE=A2=E5=8D=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/shopCart/index.tsx | 3 ++-
.../components/estimatedAmount/index.tsx | 22 ++++++++++++++-----
src/pages/order/index.module.scss | 4 ++++
src/pages/order/index.tsx | 10 +++++++--
4 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/src/components/shopCart/index.tsx b/src/components/shopCart/index.tsx
index 8e22413..07ac3a7 100644
--- a/src/components/shopCart/index.tsx
+++ b/src/components/shopCart/index.tsx
@@ -7,6 +7,7 @@ import InfiniteScroll from "@/components/infiniteScroll";
import styles from "./index.module.scss"
import { useEffect, useState } from "react";
import Taro from "@tarojs/taro";
+import { goLink } from "@/common/common";
type param = {
show?: true|false,
@@ -149,7 +150,7 @@ export default ({show = false, onClose}: param) => {
¥200
预估金额
-
+ goLink('/pages/order/index')}>
去结算
diff --git a/src/pages/order/components/estimatedAmount/index.tsx b/src/pages/order/components/estimatedAmount/index.tsx
index 27d63f1..441627b 100644
--- a/src/pages/order/components/estimatedAmount/index.tsx
+++ b/src/pages/order/components/estimatedAmount/index.tsx
@@ -1,16 +1,28 @@
import { Text, View } from "@tarojs/components"
+import { useCallback, useEffect, useMemo } from "react"
import styles from './index.module.scss'
type Param = {
- style?: Object
+ style?: Object,
+ number?: number
}
-export default ({style}:Param) => {
+export default ({style, number = 0}:Param) => {
+ const priceDom = useCallback(() => {
+ let res = number.toFixed(2).split('.')
+ let int_num = parseInt(res[0]).toLocaleString()
+ let decimals_num = res[1]
+ return (
+ <>
+ ¥
+ {int_num}
+ .{decimals_num}
+ >
+ )
+ }, [number])
return (
预估金额
- ¥
- 6,001
- .00
+ {priceDom()}
)
diff --git a/src/pages/order/index.module.scss b/src/pages/order/index.module.scss
index 84a37bd..b8c8cb1 100644
--- a/src/pages/order/index.module.scss
+++ b/src/pages/order/index.module.scss
@@ -202,6 +202,10 @@
align-items: center;
color: #fff;
}
+ .order_number_desc{
+ font-size: $font_size_medium;
+ color: $color_font_two;
+ }
}
}
\ No newline at end of file
diff --git a/src/pages/order/index.tsx b/src/pages/order/index.tsx
index 7dc2644..1e3dea4 100644
--- a/src/pages/order/index.tsx
+++ b/src/pages/order/index.tsx
@@ -1,9 +1,12 @@
import { Text, View } from "@tarojs/components"
import classnames from "classnames";
+import { useEffect, useState } from "react";
import EstimatedAmount from "./components/estimatedAmount";
import styles from './index.module.scss'
export default () => {
+ const [price, setPrice] = useState(123000.33)
+
return (
@@ -88,7 +91,7 @@ import styles from './index.module.scss'
-
+
(按照25kg/条, 预估金额)
@@ -98,7 +101,10 @@ import styles from './index.module.scss'
-
+
+
+ 2种面料,6种颜色,共6条
+
提交订单
From 948bf726223ed13606810d6bbaea9ba5233d3a2c Mon Sep 17 00:00:00 2001
From: czm <2192718639@qq.com>
Date: Wed, 20 Apr 2022 11:26:56 +0800
Subject: [PATCH 07/18] =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E8=AE=A2=E5=8D=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/kindList/index.module.scss | 100 ++++++++++++++++++
src/pages/order/components/kindList/index.tsx | 88 +++++++++++++++
src/pages/order/index.module.scss | 100 +-----------------
src/pages/order/index.tsx | 78 +-------------
4 files changed, 191 insertions(+), 175 deletions(-)
create mode 100644 src/pages/order/components/kindList/index.module.scss
create mode 100644 src/pages/order/components/kindList/index.tsx
diff --git a/src/pages/order/components/kindList/index.module.scss b/src/pages/order/components/kindList/index.module.scss
new file mode 100644
index 0000000..ad8a7b2
--- /dev/null
+++ b/src/pages/order/components/kindList/index.module.scss
@@ -0,0 +1,100 @@
+.orders_list_con{
+ margin-top: 20px;
+ background-color: #fff;
+ border-radius: 20px;
+ padding: 20px;
+ .order_list{
+ &:nth-child(n+2) {
+ margin-top: 30px;
+ }
+ .order_list_title{
+ display: flex;
+ align-items: center;
+ .tag{
+ font-size: $font_size_min;
+ background-color: #CDE5FF;
+ padding: 5px 10px;
+ border-radius: 6px;
+ color: $color_main;
+ }
+ .title{
+ font-weight: 700;
+ font-size: $font_size;
+ margin-left: 20px;
+ flex:1;
+ }
+ .num{
+ color: $color_font_two;
+ font-size: $font_size_min;
+ }
+ }
+ }
+ .order_list_scroll{
+ margin-top: 30px;
+
+ .order_list_item {
+ display: flex;
+ &:nth-child(2) {
+ margin-top: 30px;
+ }
+ .order_list_item_img{
+ width: 126px;
+ height: 126px;
+ border-radius: 20px;
+ background-color: red;
+ }
+ .order_list_item_con{
+ display: flex;
+ width: 100%;
+ flex:1;
+ border-bottom: 1px solid #f0f0f0;
+ height: 150px;
+ padding-top: 20px;
+ box-sizing: border-box;
+ }
+ .order_list_item_des{
+ flex:1;
+ box-sizing: border-box;
+ padding-left: 30px;
+ .order_list_item_title{
+ font-weight: 700;
+ font-size: $font_size;
+ margin-bottom: 15px;
+ }
+ .order_list_item_price{
+ font-size: 26px;
+ color: $color_font_three;
+ }
+ }
+ .order_list_item_count{
+ .count_num{
+ color: $color_main;
+ font-size: $font_size;
+ margin-bottom: 15px;
+ font-weight: 400;
+ text{
+ font-size: $font_size_min;
+ }
+ }
+ .count_price {
+ font-size: $font_size;
+ font-weight: 700;
+ text{
+ font-size: $font_size_min;
+ }
+ }
+ }
+ }
+ }
+
+ .order_estimated_amount{
+ display: flex;
+ align-items: flex-end;
+ flex-direction: column;
+ padding: 30px 0;
+ .order_price_des{
+ font-size: $font_size_medium;
+ color: $color_font_two;
+ }
+ }
+}
diff --git a/src/pages/order/components/kindList/index.tsx b/src/pages/order/components/kindList/index.tsx
new file mode 100644
index 0000000..17d026a
--- /dev/null
+++ b/src/pages/order/components/kindList/index.tsx
@@ -0,0 +1,88 @@
+import { View } from "@tarojs/components"
+import { useState } from "react"
+import EstimatedAmount from "../estimatedAmount"
+import styles from './index.module.scss'
+
+export default () => {
+ const [price, setPrice] = useState(123000.33)
+ return (
+ <>
+
+
+
+ 大货
+ 0770# 21S单面平纹(食毛)
+ 共3种
+
+
+
+
+
+
+ 1# 薄荷绿
+ ¥40/kg
+
+
+ ×1条
+ ¥1,000.5
+
+
+
+
+
+
+
+ 1# 薄荷绿
+ ¥40/kg
+
+
+ ×1条
+ ¥1,000.5
+
+
+
+
+
+
+
+ 大货
+ 0770# 21S单面平纹(食毛)
+ 共3种
+
+
+
+
+
+
+ 1# 薄荷绿
+ ¥40/kg
+
+
+ ×1条
+ ¥1,000.5
+
+
+
+
+
+
+
+ 1# 薄荷绿
+ ¥40/kg
+
+
+ ×1条
+ ¥1,000.5
+
+
+
+
+
+
+
+ (按照25kg/条, 预估金额)
+
+
+ >
+ )
+}
\ No newline at end of file
diff --git a/src/pages/order/index.module.scss b/src/pages/order/index.module.scss
index b8c8cb1..ee30d79 100644
--- a/src/pages/order/index.module.scss
+++ b/src/pages/order/index.module.scss
@@ -54,105 +54,7 @@
font-size: $font_size;
}
}
- .orders_list_con{
- margin-top: 20px;
- background-color: #fff;
- border-radius: 20px;
- padding: 20px;
- }
- .order_list{
- &:nth-child(n+2) {
- margin-top: 30px;
- }
- .order_list_title{
- display: flex;
- align-items: center;
- .tag{
- font-size: $font_size_min;
- background-color: #CDE5FF;
- padding: 5px 10px;
- border-radius: 6px;
- color: $color_main;
- }
- .title{
- font-weight: 700;
- font-size: $font_size;
- margin-left: 20px;
- flex:1;
- }
- .num{
- color: $color_font_two;
- font-size: $font_size_min;
- }
- }
- }
- .order_list_scroll{
- margin-top: 30px;
-
- .order_list_item {
- display: flex;
- &:nth-child(2) {
- margin-top: 30px;
- }
- .order_list_item_img{
- width: 126px;
- height: 126px;
- border-radius: 20px;
- background-color: red;
- }
- .order_list_item_con{
- display: flex;
- width: 100%;
- flex:1;
- border-bottom: 1px solid #f0f0f0;
- height: 150px;
- padding-top: 20px;
- box-sizing: border-box;
- }
- .order_list_item_des{
- flex:1;
- box-sizing: border-box;
- padding-left: 30px;
- .order_list_item_title{
- font-weight: 700;
- font-size: $font_size;
- margin-bottom: 15px;
- }
- .order_list_item_price{
- font-size: 26px;
- color: $color_font_three;
- }
- }
- .order_list_item_count{
- .count_num{
- color: $color_main;
- font-size: $font_size;
- margin-bottom: 15px;
- font-weight: 400;
- text{
- font-size: $font_size_min;
- }
- }
- .count_price {
- font-size: $font_size;
- font-weight: 700;
- text{
- font-size: $font_size_min;
- }
- }
- }
- }
- }
- .order_estimated_amount{
- display: flex;
- align-items: flex-end;
- flex-direction: column;
- padding: 30px 0;
- .order_price_des{
- font-size: $font_size_medium;
- color: $color_font_two;
- }
- }
+
.order_desc{
display: flex;
align-items: center;
diff --git a/src/pages/order/index.tsx b/src/pages/order/index.tsx
index 1e3dea4..8d9b365 100644
--- a/src/pages/order/index.tsx
+++ b/src/pages/order/index.tsx
@@ -2,6 +2,7 @@ import { Text, View } from "@tarojs/components"
import classnames from "classnames";
import { useEffect, useState } from "react";
import EstimatedAmount from "./components/estimatedAmount";
+import KindList from "./components/kindList";
import styles from './index.module.scss'
export default () => {
@@ -19,82 +20,7 @@ import styles from './index.module.scss'
请选择收货地址及信息
-
-
-
- 大货
- 0770# 21S单面平纹(食毛)
- 共3种
-
-
-
-
-
-
- 1# 薄荷绿
- ¥40/kg
-
-
- ×1条
- ¥1,000.5
-
-
-
-
-
-
-
- 1# 薄荷绿
- ¥40/kg
-
-
- ×1条
- ¥1,000.5
-
-
-
-
-
-
-
- 大货
- 0770# 21S单面平纹(食毛)
- 共3种
-
-
-
-
-
-
- 1# 薄荷绿
- ¥40/kg
-
-
- ×1条
- ¥1,000.5
-
-
-
-
-
-
-
- 1# 薄荷绿
- ¥40/kg
-
-
- ×1条
- ¥1,000.5
-
-
-
-
-
-
-
- (按照25kg/条, 预估金额)
-
-
+
订单备注
点击填写
From c2766e2b56a7ae2574e2bbad02bde84e59e12388 Mon Sep 17 00:00:00 2001
From: czm <2192718639@qq.com>
Date: Mon, 9 May 2022 09:57:00 +0800
Subject: [PATCH 08/18] =?UTF-8?q?=E5=90=88=E5=B9=B6dev?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/common/common.ts | 18 +++++-
.../components/addressInfo/index.module.scss | 54 +++++++++++++++++
.../order/components/addressInfo/index.tsx | 32 ++++++++++
.../components/estimatedAmount/index.tsx | 8 ++-
.../components/orderState/index.module.scss | 18 ++++++
.../order/components/orderState/index.tsx | 14 +++++
.../order/components/remark/index.module.scss | 47 +++++++++++++++
src/pages/order/components/remark/index.tsx | 35 +++++++++++
src/pages/order/index.module.scss | 57 ++++++++++--------
src/pages/order/index.tsx | 59 ++++++++++++++-----
src/pages/searchList/search.tsx | 4 +-
src/pages/searchList/searchList.tsx | 1 -
12 files changed, 300 insertions(+), 47 deletions(-)
create mode 100644 src/pages/order/components/addressInfo/index.module.scss
create mode 100644 src/pages/order/components/addressInfo/index.tsx
create mode 100644 src/pages/order/components/orderState/index.module.scss
create mode 100644 src/pages/order/components/orderState/index.tsx
create mode 100644 src/pages/order/components/remark/index.module.scss
create mode 100644 src/pages/order/components/remark/index.tsx
diff --git a/src/common/common.ts b/src/common/common.ts
index a5a7bc8..ef93cee 100644
--- a/src/common/common.ts
+++ b/src/common/common.ts
@@ -23,6 +23,7 @@ export const goLink = (path = '', params = {}, type:false|true = false) => {
}
}
+<<<<<<< HEAD
/**
* 判断对象为空
* @param object
@@ -86,4 +87,19 @@ export const retrieval = (data: any, message: string="请填写完信息", rules
}
resolve(null);
})
- }
\ No newline at end of file
+ }
+=======
+
+// 金额千位分割符
+export const formatKbPrice = (number: string) => {
+ const ret = Array.from(number).reverse().reduce((result: string[],next,i,arr) => {
+ if((i+1)%3 === 0 && (i+1) !== arr.length) {
+ result.push(next,',')
+ return result;
+ }
+ result.push(next);
+ return result;
+ },[])
+ return ret.reverse().join('');
+}
+>>>>>>> 1557571 (确认订单)
diff --git a/src/pages/order/components/addressInfo/index.module.scss b/src/pages/order/components/addressInfo/index.module.scss
new file mode 100644
index 0000000..8273d60
--- /dev/null
+++ b/src/pages/order/components/addressInfo/index.module.scss
@@ -0,0 +1,54 @@
+.order_address{
+ height: 178px;
+ background: #ffffff;
+ border-radius: 20px;
+ display: flex;
+ align-items: center;
+ padding: 30px;
+ box-sizing: border-box;
+ margin-top: 20px;
+ .order_address_icon{
+ font-size: 60px;
+ }
+ .order_address_text_con{
+ flex:1;
+ padding: 0 30px;
+ box-sizing: border-box;
+ .order_address_text_title{
+ font-size: $font_size;
+ font-weight: 700;
+ @include common_ellipsis;
+ }
+ .order_address_text_name{
+ margin-top: 20px;
+ color: $color_font_three;
+ font-size: $font_size_medium;
+ text{
+ &:nth-child(1) {
+ margin-right: 40px;
+ }
+ }
+ }
+ }
+ .order_address_text_no{
+ flex: 1;
+ font-size: $font_size;
+ font-weight: 700;
+ margin-left: 30px;
+ }
+ .order_address_more_icon{
+ color: $color_font_three;
+ font-size: $font_size;
+ }
+
+}
+.order_address_list {
+ height: 900px;
+ .order_address_title{
+ font-size: $font_size;
+ font-weight: 700;
+ width: 100%;
+ text-align: center;
+ padding: 20px 0 30px 0;
+ }
+}
\ No newline at end of file
diff --git a/src/pages/order/components/addressInfo/index.tsx b/src/pages/order/components/addressInfo/index.tsx
new file mode 100644
index 0000000..9bcd9e0
--- /dev/null
+++ b/src/pages/order/components/addressInfo/index.tsx
@@ -0,0 +1,32 @@
+import AddressList from "@/components/AddressList";
+import Popup from "@/components/popup";
+import { Text, View } from "@tarojs/components"
+import classnames from "classnames";
+import { useState } from "react";
+import styles from './index.module.scss'
+
+export default () => {
+ const [showAddressList, setShowAddressList] = useState(false)
+ return (
+
+ setShowAddressList(true)}>
+
+ {/* 请选择收货地址及信息 */}
+
+ **省**市**区**街道****仓库**省**市**区**街道****仓库
+
+ 陈先生
+ 1818877790
+
+
+
+
+ setShowAddressList(false)}>
+
+ 选择收货地址
+ console.log(index, item)}/>
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/src/pages/order/components/estimatedAmount/index.tsx b/src/pages/order/components/estimatedAmount/index.tsx
index 441627b..7e9ae1b 100644
--- a/src/pages/order/components/estimatedAmount/index.tsx
+++ b/src/pages/order/components/estimatedAmount/index.tsx
@@ -1,5 +1,6 @@
import { Text, View } from "@tarojs/components"
import { useCallback, useEffect, useMemo } from "react"
+import {formatKbPrice} from '@/common/common'
import styles from './index.module.scss'
type Param = {
style?: Object,
@@ -8,16 +9,19 @@ type Param = {
export default ({style, number = 0}:Param) => {
const priceDom = useCallback(() => {
let res = number.toFixed(2).split('.')
- let int_num = parseInt(res[0]).toLocaleString()
+ let int_num = parseInt(res[0]) + ''
let decimals_num = res[1]
return (
<>
¥
- {int_num}
+ {formatPrice(int_num)}
.{decimals_num}
>
)
}, [number])
+ const formatPrice = useCallback((number: string) => {
+ return formatKbPrice(number)
+ }, [])
return (
预估金额
diff --git a/src/pages/order/components/orderState/index.module.scss b/src/pages/order/components/orderState/index.module.scss
new file mode 100644
index 0000000..78bda44
--- /dev/null
+++ b/src/pages/order/components/orderState/index.module.scss
@@ -0,0 +1,18 @@
+.order_flow_state{
+ display: flex;
+ align-items: center;
+ padding: 0 30px;
+ height: 116px;
+ background-color: #fff;
+ border-radius: 20px;
+ .order_flow_state_text{
+ color: $color_main;
+ font-size:$font_size;
+ font-weight: 700;
+ }
+ .order_flow_state_desc{
+ color: $color_font_three;
+ font-size: $font_size_medium;
+ margin-left: 50px;
+ }
+}
\ No newline at end of file
diff --git a/src/pages/order/components/orderState/index.tsx b/src/pages/order/components/orderState/index.tsx
new file mode 100644
index 0000000..58fec4d
--- /dev/null
+++ b/src/pages/order/components/orderState/index.tsx
@@ -0,0 +1,14 @@
+import { View } from "@tarojs/components"
+import styles from './index.module.scss'
+
+export default ({
+ state = '',
+ desc = ''
+}) => {
+ return (
+
+ {state}
+ {desc}
+
+ )
+}
\ No newline at end of file
diff --git a/src/pages/order/components/remark/index.module.scss b/src/pages/order/components/remark/index.module.scss
new file mode 100644
index 0000000..9f2b3d0
--- /dev/null
+++ b/src/pages/order/components/remark/index.module.scss
@@ -0,0 +1,47 @@
+.order_popup{
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ padding: 20px 0;
+ .order_popup_title{
+ color: $font_size_big;
+ font-weight: 700;
+ color: #000000;
+ padding-bottom: 20px;
+ }
+ .order_popup_input{
+ width: 100%;
+ padding: 0 25px;
+ box-sizing: border-box;
+ margin-top: 43px;
+ position: relative;
+ .descDataNum{
+ position: absolute;
+ right: 40px;
+ bottom: 10px;
+ height: 39px;
+ font-size: $font_size_medium;
+ color: $color_font_two;
+ }
+ textarea{
+ background-color: $color_bg_one;
+ border-radius: 10px;
+ width: 100%;
+ height: 313px;
+ padding: 20px;
+ padding-bottom: 50px;
+ box-sizing: border-box;
+ font-size: $font_size;
+ }
+ }
+ .order_save_address{
+ height: 82px;
+ background: #007aff;
+ border-radius: 40px;
+ width: 668px;
+ text-align: center;
+ line-height: 82px;
+ color: #fff;
+ margin-top: 60px;
+ }
+}
\ No newline at end of file
diff --git a/src/pages/order/components/remark/index.tsx b/src/pages/order/components/remark/index.tsx
new file mode 100644
index 0000000..05f485b
--- /dev/null
+++ b/src/pages/order/components/remark/index.tsx
@@ -0,0 +1,35 @@
+import Popup from "@/components/popup"
+import { Textarea, View } from "@tarojs/components"
+import { useCallback, useState } from "react"
+import styles from './index.module.scss'
+
+type Param = {
+ onBlur?: (val:any) => void
+ onSave?: (val: string) => void
+}
+export default ({onBlur, onSave}:Param) => {
+ const [descData, setDescData] = useState({
+ number: 0,
+ value: ''
+ })
+
+
+ const getDesc = useCallback((e) => {
+ let value = e.detail.value
+ setDescData({...descData, number:value.length, value})
+ },[])
+
+ const setSave = () => {
+ onSave?.(descData.value)
+ }
+ return (
+
+ 添加备注
+
+
+ {descData.number}/200
+
+ setSave()}>保存
+
+ )
+}
\ No newline at end of file
diff --git a/src/pages/order/index.module.scss b/src/pages/order/index.module.scss
index ee30d79..d6246e0 100644
--- a/src/pages/order/index.module.scss
+++ b/src/pages/order/index.module.scss
@@ -4,6 +4,7 @@
padding: 20px;
padding-bottom: 190px;
box-sizing: border-box;
+
.order_title{
display: flex;
align-items: center;
@@ -12,6 +13,7 @@
background-color: #fff;
height: 116px;
border-radius: 20px;
+ margin-top: 20px;
text{
flex:1;
font-size: $font_size;
@@ -31,35 +33,11 @@
}
}
}
- .order_address{
- height: 178px;
- background: #ffffff;
- border-radius: 20px;
- display: flex;
- align-items: center;
- padding: 30px;
- box-sizing: border-box;
- margin-top: 20px;
- .order_address_icon{
- font-size: 60px;
- }
- .order_address_text{
- flex: 1;
- font-size: $font_size;
- font-weight: 700;
- margin-left: 30px;
- }
- .order_address_more_icon{
- color: $color_font_three;
- font-size: $font_size;
- }
- }
-
.order_desc{
display: flex;
align-items: center;
background-color: #fff;
- padding: 0 30px;
+ padding: 0 20px;
height: 116px;
border-radius: 20px;
margin-top: 20px;
@@ -109,5 +87,32 @@
color: $color_font_two;
}
}
-
+ .order_info{
+ background-color: #fff;
+ margin-top: 20px;
+ border-radius: 20px;
+ padding: 20px;
+ .order_info_title{
+ font-size: $font_size;
+ font-weight: 700;
+ margin-bottom: 20px;
+
+ }
+ .order_num{
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ .order_num_btn{
+ font-size: $font_size_medium;
+ padding: 5px 10px;
+ border: 2px solid #007cf7;
+ border-radius: 10px;
+ color: $color_main;
+ }
+ }
+ text{
+ font-size: $font_size;
+ }
+
+ }
}
\ No newline at end of file
diff --git a/src/pages/order/index.tsx b/src/pages/order/index.tsx
index 8d9b365..bc303c0 100644
--- a/src/pages/order/index.tsx
+++ b/src/pages/order/index.tsx
@@ -1,31 +1,57 @@
-import { Text, View } from "@tarojs/components"
+import Popup from "@/components/popup";
+import SearchInput from "@/components/searchInput";
+import { Text, Textarea, View } from "@tarojs/components"
+import Taro from "@tarojs/taro";
import classnames from "classnames";
-import { useEffect, useState } from "react";
+import { useCallback, useEffect, useState } from "react";
+import AddressInfo from "./components/addressInfo";
import EstimatedAmount from "./components/estimatedAmount";
import KindList from "./components/kindList";
+import OrderState from "./components/orderState";
+import Remark from "./components/remark";
import styles from './index.module.scss'
export default () => {
- const [price, setPrice] = useState(123000.33)
-
- return (
+ const [price, setPrice] = useState(123000.33)
+ const [showDesc, setShowDesc] = useState(false)
+ const clipboardData = () => {
+ Taro.setClipboardData({
+ data: '123123121321',
+ success: function (res) {
+ Taro.showToast({
+ icon: 'none',
+ title: '复制成功'
+ })
+ }
+ })
+ }
+ return (
+
- 收货方式
- 物流
- 上门自提
-
-
-
- 请选择收货地址及信息
-
+ 收货方式
+ 物流
+ 上门自提
+
-
+ setShowDesc(true)}>
订单备注
点击填写
+
+ 订单备注
+
+
+ 13535359535
+ clipboardData()}>复制
+
+
+
+ 2022-4-5 10:11:55
+
+
@@ -33,7 +59,10 @@ import styles from './index.module.scss'
提交订单
+ setShowDesc(false)} >
+ console.log(e)}/>
+
- )
+ )
}
\ No newline at end of file
diff --git a/src/pages/searchList/search.tsx b/src/pages/searchList/search.tsx
index 247fa58..787d428 100644
--- a/src/pages/searchList/search.tsx
+++ b/src/pages/searchList/search.tsx
@@ -9,12 +9,12 @@ export default () => {
return (
- goLink('/pages/searchList/searchList')}/>
+ {}}/>
热门面料
- 高级搜索
+ goLink('/pages/searchList/searchList')}>高级搜索
9265
diff --git a/src/pages/searchList/searchList.tsx b/src/pages/searchList/searchList.tsx
index 21a5757..0a9c481 100644
--- a/src/pages/searchList/searchList.tsx
+++ b/src/pages/searchList/searchList.tsx
@@ -5,7 +5,6 @@ import Filter from "@/components/filter";
import InfiniteScroll from '@/components/infiniteScroll'
import SortBtn from "@/components/sortBtn";
import SelectData from "./components/selectData";
-import Tabs from "@/components/tabs";
import { goLink } from "@/common/common";
import styles from './searchList.module.scss'
import { useCallback, useState } from "react";
From f326656ed7388687bbbe229917d9630140d1362b Mon Sep 17 00:00:00 2001
From: czm <2192718639@qq.com>
Date: Fri, 22 Apr 2022 16:39:39 +0800
Subject: [PATCH 09/18] =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E8=AE=A2=E5=8D=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
package-lock.json | 13 ++
package.json | 1 +
src/pages/index/index.config.ts | 4 +-
src/pages/index/index.tsx | 6 +-
src/use/useHttp.ts | 204 ++++++++++++++++++++++++++++
src/use/useManualPullDownRefresh.ts | 24 ++++
yarn.lock | 5 +
7 files changed, 255 insertions(+), 2 deletions(-)
create mode 100644 src/use/useHttp.ts
create mode 100644 src/use/useManualPullDownRefresh.ts
diff --git a/package-lock.json b/package-lock.json
index a0df40e..5427fab 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -22,6 +22,7 @@
"@babel/core": "^7.8.0",
"@tarojs/mini-runner": "3.3.10",
"@tarojs/webpack-runner": "3.3.10",
+ "@types/qs": "^6.9.7",
"@types/react": "^17.0.2",
"@types/webpack-env": "^1.13.6",
"@typescript-eslint/eslint-plugin": "^4.15.1",
@@ -3981,6 +3982,12 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/@types/qs": {
+ "version": "6.9.7",
+ "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz",
+ "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==",
+ "dev": true
+ },
"node_modules/@types/react": {
"version": "17.0.43",
"resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.43.tgz",
@@ -23717,6 +23724,12 @@
"integrity": "sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ==",
"dev": true
},
+ "@types/qs": {
+ "version": "6.9.7",
+ "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz",
+ "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==",
+ "dev": true
+ },
"@types/react": {
"version": "17.0.43",
"resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.43.tgz",
diff --git a/package.json b/package.json
index 9258dd5..1ee5a32 100644
--- a/package.json
+++ b/package.json
@@ -49,6 +49,7 @@
"@babel/core": "^7.8.0",
"@tarojs/mini-runner": "3.3.10",
"@tarojs/webpack-runner": "3.3.10",
+ "@types/qs": "^6.9.7",
"@types/react": "^17.0.2",
"@types/webpack-env": "^1.13.6",
"@typescript-eslint/eslint-plugin": "^4.15.1",
diff --git a/src/pages/index/index.config.ts b/src/pages/index/index.config.ts
index 0b7f3f1..1f88149 100644
--- a/src/pages/index/index.config.ts
+++ b/src/pages/index/index.config.ts
@@ -1,3 +1,5 @@
export default {
- navigationBarTitleText: '电子商城'
+ navigationBarTitleText: '电子商城',
+ enablePullDownRefresh: true,
+ backgroundTextStyle: 'dark'
}
diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx
index f147af4..e09cb32 100644
--- a/src/pages/index/index.tsx
+++ b/src/pages/index/index.tsx
@@ -8,7 +8,9 @@ import ShopCart from '@/components/shopCart'
import styles from './index.module.scss'
import { goLink } from '@/common/common'
import { useState } from 'react'
-import Taro from '@tarojs/taro'
+import Taro, { usePullDownRefresh } from '@tarojs/taro'
+import useManualPullDownRefresh from '@/use/useManualPullDownRefresh'
+
export default () => {
const tabs_list = [
@@ -32,6 +34,8 @@ export default () => {
]
const [showShopCart, setShowShopCart] = useState(false)
+
+ const res = useManualPullDownRefresh(() => {return '99999'})
return (
setShowShopCart(!showShopCart)}>
diff --git a/src/use/useHttp.ts b/src/use/useHttp.ts
new file mode 100644
index 0000000..8dea036
--- /dev/null
+++ b/src/use/useHttp.ts
@@ -0,0 +1,204 @@
+
+
+import Taro from '@tarojs/taro'
+import { useState } from 'react'
+import qs from 'qs';
+ /**
+ * 返回状态信息,根据 http 状态错
+ * @param {Number} status
+ * @returns
+ */
+ const showStatus = (status) => {
+ let message = ''
+ switch (status) {
+ case 400:
+ message = '请求错误(400)'
+ break
+ case 401:
+ message = '未授权,请重新登录(401)'
+ break
+ case 403:
+ message = '拒绝访问(403)'
+ break
+ case 404:
+ message = '请求出错(404)'
+ break
+ case 408:
+ message = '请求超时(408)'
+ break
+ case 500:
+ message = '服务器错误(500)'
+ break
+ case 501:
+ message = '服务未实现(501)'
+ break
+ case 502:
+ message = '网络错误(502)'
+ break
+ case 503:
+ message = '服务不可用(503)'
+ break
+ case 504:
+ message = '网络超时(504)'
+ break
+ case 505:
+ message = 'HTTP版本不受支持(505)'
+ break
+ default:
+ message = `连接出错(${status})!`
+ }
+ return `${message},请检查网络或联系管理员!`
+ }
+
+
+/**
+ * axios 请求状态封装,返回响应式数据 fetch(), loading, error, code, msg 等常用方法/状态
+ * @param {Object} options 对象
+ * @param {String} options.url 请求的URL
+ * @param {String} options.method 请求的方法
+ * @param {Object} options.data 请求的参数
+ * @returns {Object} 返回fetch(), loading, error, code, msg
+ */
+export const useRequest = (options = {
+ url: '/',
+ method: 'get',
+ type: 'json',
+ data: {},
+ page: 1,
+ pageSize: 24,
+ pagination: false, // 是否分页
+}) => {
+
+ let params:any = {
+ code: null, // 业务码
+ success: null, // 请求是否成功
+ data: {},
+ msg: '',
+ loading: null,
+ error: null,
+ query: {},
+ filter: null,
+ sort: null,
+ total: 0,
+ multiple: true, // 请求多次
+ count: 0, // 第几次请求
+ token: '', // token
+ }
+
+ if(options.pagination) {
+ params.page = options.page
+ params.pageSize = options.pageSize
+ }
+
+ const [state, setState] = useState({...params})
+
+ // // 每页多少条记录
+ // const handleSizeChange = (val) => {
+ // state.size = val
+ // }
+
+ // // 当前
+ // const handleCurrentChange = (val) => {
+ // state.page = val
+ // }
+
+ // /**
+ // * 筛选搜索
+ // * @param {Object} val `{name:'ppx'}` name 为字段名,ppx 为字段内容
+ // */
+ // const handleFilterChange = (val) => {
+ // state.filter = val
+ // }
+
+ // 排序
+
+ /**
+ * 排序字段,排序方式
+ * @param {String} val 排序字段
+ * @param {String} sortOrder `desc` / `asc`
+ */
+ // eslint-disable-next-line
+ const handleSort = (val, orderby = "desc") => {
+ if (val != null) {
+ state.sort = orderby ? {
+ sort_key: `${orderby == 'desc' ? '-' + val : val}`
+ } : null
+ }
+
+ }
+
+ // 请求函数
+ const fetchData = async (sub_options) => {
+ state.loading = true
+
+ state.query = {
+ ...sub_options,
+ ...options.pagination && {
+ page: state.page,
+ size: state.size,
+ },
+ ...state.filter,
+ ...state.sort
+ }
+ try {
+ let token = Taro.getStorageSync('token')
+ const q = {
+ ...options,
+ ...{
+ header: {
+ "Platform": 3,
+ "Authorization": token || state.token,
+ }
+ },
+ ...options.method?.toUpperCase() == 'GET' ? {
+ data: state.query
+ } : {
+ data: options.type?.toUpperCase() == 'FORMDATA' ? qs.stringify(state.query) : state.query
+ }
+ }
+ const result = await Taro.request(q as any)
+ const { statusCode } = result
+ const {
+ code,
+ msg,
+ data
+ } = result.data
+ console.log(code, msg, data, statusCode);
+ if (statusCode === 200) {
+ state.success = (code === 0 ? true : false)
+ state.code = code
+ state.msg = msg
+ state.data = data
+ state.total = data?.list ? data?.total : 0
+ }else{
+ Taro.showToast({
+ title: `错误:${showStatus(statusCode)}`
+ })
+ if (statusCode === 401) {
+ Taro.reLaunch({
+ url: '/pages/login/index'
+ })
+ }
+
+ }
+
+ } catch (e) {
+ console.log('出错', e);
+ state.success = false
+ state.error = true
+ state.msg = e.errMsg
+
+ }
+ state.error = false
+ state.loading = false
+ }
+
+ return {
+ // handleSizeChange,
+ // handleCurrentChange,
+ // handleFilterChange,
+ handleSort,
+ fetchData,
+ }
+
+}
\ No newline at end of file
diff --git a/src/use/useManualPullDownRefresh.ts b/src/use/useManualPullDownRefresh.ts
new file mode 100644
index 0000000..4ff1ff3
--- /dev/null
+++ b/src/use/useManualPullDownRefresh.ts
@@ -0,0 +1,24 @@
+import Taro, { usePullDownRefresh } from "@tarojs/taro"
+import { useCallback, useState } from "react"
+
+type Arg = {[index:string]:any}
+export default (fn?:(val:Arg) => any, arg?:Arg) => {
+ const [data, setData] = useState({})
+
+ usePullDownRefresh(() => {
+ getData()
+ })
+
+ const getData = useCallback(() => {
+ setTimeout(() => {
+ const res = fn?.({...arg})
+ setData((e) => ({...e, res}))
+ Taro.stopPullDownRefresh()
+ }, 1000)
+ }, [])
+
+ return {
+ getData,
+ data
+ }
+}
\ No newline at end of file
diff --git a/yarn.lock b/yarn.lock
index 1759e5f..dda13eb 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1601,6 +1601,11 @@
resolved "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.4.tgz"
integrity sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ==
+"@types/qs@^6.9.7":
+ "integrity" "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw=="
+ "resolved" "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz"
+ "version" "6.9.7"
+
"@types/react@^17.0.2":
version "17.0.43"
resolved "https://registry.npmjs.org/@types/react/-/react-17.0.43.tgz"
From 050f90433cd2fea2322df69759525dff8e103c63 Mon Sep 17 00:00:00 2001
From: czm <2192718639@qq.com>
Date: Fri, 22 Apr 2022 19:12:15 +0800
Subject: [PATCH 10/18] =?UTF-8?q?=E5=B0=81=E8=A3=85=E8=AF=B7=E6=B1=82hook?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/common/constant.js | 27 +++
src/components/infiniteScroll/index.tsx | 2 +-
src/components/shopCart/index.tsx | 4 +-
src/components/sideBar/index.tsx | 16 +-
src/pages/details/index.config.ts | 4 +-
src/pages/details/index.tsx | 23 ++-
src/pages/index/index.tsx | 14 +-
.../searchList/hightSearchList.config.ts | 4 +-
src/pages/searchList/hightSearchList.tsx | 4 +
src/pages/searchList/search.config.ts | 2 +-
src/pages/searchList/searchList.config.ts | 4 +-
src/pages/searchList/searchList.tsx | 4 +
src/use/useHttp.ts | 178 ++++++++++--------
13 files changed, 191 insertions(+), 95 deletions(-)
create mode 100644 src/common/constant.js
diff --git a/src/common/constant.js b/src/common/constant.js
new file mode 100644
index 0000000..b06c5ea
--- /dev/null
+++ b/src/common/constant.js
@@ -0,0 +1,27 @@
+console.log('环境变量2',CURRENT_ENV);
+// export const BASE_URL = CURRENT_ENV.includes('development') ? `https://test.zzfzyc.com/lymarket` : `https://www.zzfzyc.com/lymarket`
+// export const BASE_URL = `http://192.168.0.75:50001/lymarket`
+// export const BASE_URL = `http://192.168.0.89:50001/lymarket`
+// export const BASE_URL = `http://10.0.0.5:50001/lymarket`
+// export const BASE_URL = `http://192.168.0.89:40001/lymarket`
+// export const BASE_URL = `http://192.168.1.165:40001/lymarket` // 王霞
+// export const BASE_URL = `https://test.zzfzyc.com/lymarket` // 测试环境
+export const BASE_URL = `http://192.168.1.30:40001/lymarket` // 发
+// export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境
+// export const BASE_URL = `https://www.zzfzyc.com/lymarket` // 正式环境
+
+
+
+// export const BASE_URL = `http://192.168.1.165:40001/lymarket` // 王霞
+
+// CDN
+// 生成密钥
+export const GET_UPLOAD_SIGN = `/upyun/getsign` // 请求签名 url
+export const UPLOAD_CDN_URL = `https://v0.api.upyun.com/`
+
+// 前缀
+export const IMG_CND_Prefix = "http://test.cdn.zzfzyc.com/"
+
+
+// 上传图片视频
+export const CDN_UPLOAD_IMG = `${UPLOAD_CDN_URL || ''}`;
\ No newline at end of file
diff --git a/src/components/infiniteScroll/index.tsx b/src/components/infiniteScroll/index.tsx
index aeb35c3..5f2f8bc 100644
--- a/src/components/infiniteScroll/index.tsx
+++ b/src/components/infiniteScroll/index.tsx
@@ -75,7 +75,7 @@ export default memo(({
onRefresherRefresh = {() => refresherRefresh()}
onRefresherRestore = {() => refresherRestore()}
onRefresherAbort = {() => refresherAbort()}
- refresherBackground ='#ccc'
+ refresherBackground ='#F8F8F8'
>
{children}
diff --git a/src/components/shopCart/index.tsx b/src/components/shopCart/index.tsx
index 07ac3a7..0915eb6 100644
--- a/src/components/shopCart/index.tsx
+++ b/src/components/shopCart/index.tsx
@@ -112,7 +112,7 @@ export default ({show = false, onClose}: param) => {
{loading&&}
- {!loading&&list.length > 0&& {console.log('触底了')}} paddingBottom={100}>
+ {!loading&&list.length > 0&& {console.log('触底了')}} paddingBottom={100}>
{list.map((item, index) => {
return
@@ -124,7 +124,7 @@ export default ({show = false, onClose}: param) => {
{item.title}
- 0770# 21S单面平纹(食毛)
+ 07703# 21S单面平纹(食毛)
剪板
diff --git a/src/components/sideBar/index.tsx b/src/components/sideBar/index.tsx
index 4330f9d..d33e91b 100644
--- a/src/components/sideBar/index.tsx
+++ b/src/components/sideBar/index.tsx
@@ -16,10 +16,20 @@ type Params = {
children?: ReactNode,
height?: string,
heightItem?: number,
- sideBarOnClick?: (ListProps) => void
+ sideBarOnClick?: (ListProps) => void,
+ refresherTriggered?: true|false,
+ selfOnRefresherRefresh?: () => void
}
-export default memo(({list = [], defaultValue = 0, height='100vh', sideBarOnClick, children, heightItem = 100}: Params) => {
+export default memo(({list = [],
+ defaultValue = 0,
+ height='100vh',
+ sideBarOnClick,
+ children,
+ heightItem = 100,
+ refresherTriggered = false,
+ selfOnRefresherRefresh
+}: Params) => {
let num_half = useRef(0)
@@ -94,7 +104,7 @@ export default memo(({list = [], defaultValue = 0, height='100vh', sideBarOnClic
- onScrolltolower()}>
+ onScrolltolower()} refresherTriggered={refresherTriggered} refresherEnabled={true} selfOnRefresherRefresh={() => selfOnRefresherRefresh?.()}>
{children}
diff --git a/src/pages/details/index.config.ts b/src/pages/details/index.config.ts
index b12380e..f0757fd 100644
--- a/src/pages/details/index.config.ts
+++ b/src/pages/details/index.config.ts
@@ -1,3 +1,5 @@
export default {
- navigationBarTitleText: '详情'
+ navigationBarTitleText: '详情',
+ enablePullDownRefresh: true,
+ backgroundTextStyle: 'dark'
}
diff --git a/src/pages/details/index.tsx b/src/pages/details/index.tsx
index 29ade99..22b9543 100644
--- a/src/pages/details/index.tsx
+++ b/src/pages/details/index.tsx
@@ -1,6 +1,6 @@
-import { Image, RichText, Swiper, SwiperItem, View } from '@tarojs/components'
-import Taro from '@tarojs/taro';
+import { Button, Image, RichText, Swiper, SwiperItem, View } from '@tarojs/components'
+import Taro, { useShareAppMessage } from '@tarojs/taro';
import classnames from "classnames";
import DesSwiper from './components/swiper';
import OrderCount from './components/orderCount';
@@ -8,6 +8,7 @@ import ShopCart from '@/components/shopCart';
import Preview,{colorItem} from './components/preview';
import styles from './index.module.scss'
import { useMemo, useState } from 'react';
+import useManualPullDownRefresh from '@/use/useManualPullDownRefresh';
type item = {title:string, img:string, url:string, id:number}
type params = {
@@ -17,6 +18,9 @@ type params = {
}
export default (props:params) => {
+ //页面下拉刷新
+ const res = useManualPullDownRefresh()
+
const list = [
{
title:'数据',
@@ -80,6 +84,19 @@ export default (props:params) => {
duration: 2000
})
}
+
+ useShareAppMessage(res => {
+ if (res.from === 'button') {
+ // 来自页面内转发按钮
+ console.log(res.target)
+ }
+ return {
+ title: '自定义转发标题',
+ path: '/page/user?id=123'
+ }
+ })
+
+
return (
@@ -91,10 +108,12 @@ export default (props:params) => {
分享
+
changeCollect()}>
收藏
+
diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx
index e09cb32..d5afe5c 100644
--- a/src/pages/index/index.tsx
+++ b/src/pages/index/index.tsx
@@ -35,7 +35,17 @@ export default () => {
const [showShopCart, setShowShopCart] = useState(false)
- const res = useManualPullDownRefresh(() => {return '99999'})
+ //页面下拉刷新
+ const res = useManualPullDownRefresh()
+
+ const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false)
+ const getData = () => {
+ setRefresherTriggeredStatus(true)
+ setTimeout(() => {
+ setRefresherTriggeredStatus(() => false)
+ console.log('12123')
+ }, 1000)
+ }
return (
setShowShopCart(!showShopCart)}>
@@ -48,7 +58,7 @@ export default () => {
-
+ getData()}>
diff --git a/src/pages/searchList/hightSearchList.config.ts b/src/pages/searchList/hightSearchList.config.ts
index 2a9c72b..34c8c61 100644
--- a/src/pages/searchList/hightSearchList.config.ts
+++ b/src/pages/searchList/hightSearchList.config.ts
@@ -1,3 +1,5 @@
export default {
- navigationBarTitleText: '搜索'
+ navigationBarTitleText: '搜索',
+ enablePullDownRefresh: true,
+ backgroundTextStyle: 'dark'
}
diff --git a/src/pages/searchList/hightSearchList.tsx b/src/pages/searchList/hightSearchList.tsx
index a11ec20..34b8614 100644
--- a/src/pages/searchList/hightSearchList.tsx
+++ b/src/pages/searchList/hightSearchList.tsx
@@ -12,6 +12,7 @@ import Tabs from "@/components/tabs";
import styles from './hightSearchList.module.scss'
import { useCallback, useEffect, useState } from "react";
import Taro, { useReady } from "@tarojs/taro";
+import useManualPullDownRefresh from "@/use/useManualPullDownRefresh";
export default () => {
const [showFilter, setShowFilter] = useState(false)
@@ -55,6 +56,9 @@ export default () => {
setBlueToothColor(`rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`)
}
}, [state.deviceLab])
+
+ //页面下拉刷新
+ const res = useManualPullDownRefresh()
return (
diff --git a/src/pages/searchList/search.config.ts b/src/pages/searchList/search.config.ts
index 2a9c72b..6241274 100644
--- a/src/pages/searchList/search.config.ts
+++ b/src/pages/searchList/search.config.ts
@@ -1,3 +1,3 @@
export default {
- navigationBarTitleText: '搜索'
+ navigationBarTitleText: '搜索',
}
diff --git a/src/pages/searchList/searchList.config.ts b/src/pages/searchList/searchList.config.ts
index ad889b7..51b40a0 100644
--- a/src/pages/searchList/searchList.config.ts
+++ b/src/pages/searchList/searchList.config.ts
@@ -1,3 +1,5 @@
export default {
- navigationBarTitleText: '高级搜索'
+ navigationBarTitleText: '高级搜索',
+ enablePullDownRefresh: true,
+ backgroundTextStyle: 'dark'
}
diff --git a/src/pages/searchList/searchList.tsx b/src/pages/searchList/searchList.tsx
index 0a9c481..bfc274a 100644
--- a/src/pages/searchList/searchList.tsx
+++ b/src/pages/searchList/searchList.tsx
@@ -8,6 +8,7 @@ import SelectData from "./components/selectData";
import { goLink } from "@/common/common";
import styles from './searchList.module.scss'
import { useCallback, useState } from "react";
+import useManualPullDownRefresh from "@/use/useManualPullDownRefresh";
export default () => {
const [showFilter, setShowFilter] = useState(false)
@@ -30,6 +31,9 @@ export default () => {
setScrollStatus(false)
}
},[])
+
+ //页面下拉刷新
+ const res = useManualPullDownRefresh()
return (
diff --git a/src/use/useHttp.ts b/src/use/useHttp.ts
index 8dea036..c188d42 100644
--- a/src/use/useHttp.ts
+++ b/src/use/useHttp.ts
@@ -1,54 +1,75 @@
import Taro from '@tarojs/taro'
-import { useState } from 'react'
+import { useRef, useState } from 'react'
import qs from 'qs';
- /**
- * 返回状态信息,根据 http 状态错
- * @param {Number} status
- * @returns
- */
- const showStatus = (status) => {
- let message = ''
- switch (status) {
- case 400:
- message = '请求错误(400)'
- break
- case 401:
- message = '未授权,请重新登录(401)'
- break
- case 403:
- message = '拒绝访问(403)'
- break
- case 404:
- message = '请求出错(404)'
- break
- case 408:
- message = '请求超时(408)'
- break
- case 500:
- message = '服务器错误(500)'
- break
- case 501:
- message = '服务未实现(501)'
- break
- case 502:
- message = '网络错误(502)'
- break
- case 503:
- message = '服务不可用(503)'
- break
- case 504:
- message = '网络超时(504)'
- break
- case 505:
- message = 'HTTP版本不受支持(505)'
- break
- default:
- message = `连接出错(${status})!`
- }
- return `${message},请检查网络或联系管理员!`
+
+
+
+type Params = {
+ code: string|null
+ success: true|false
+ data: any,
+ msg: string,
+ loading: true|false,
+ error: any,
+ query: any,
+ filter: any,
+ sort: any,
+ total: number,
+ multiple: true|false, // 请求多次
+ count: number, // 第几次请求
+ token: string, // token
+ page?: number,
+ pageSize?: number
+}
+
+/**
+ * 返回状态信息,根据 http 状态错
+ * @param {Number} status
+ * @returns
+ */
+const showStatus = (status) => {
+ let message = ''
+ switch (status) {
+ case 400:
+ message = '请求错误(400)'
+ break
+ case 401:
+ message = '未授权,请重新登录(401)'
+ break
+ case 403:
+ message = '拒绝访问(403)'
+ break
+ case 404:
+ message = '请求出错(404)'
+ break
+ case 408:
+ message = '请求超时(408)'
+ break
+ case 500:
+ message = '服务器错误(500)'
+ break
+ case 501:
+ message = '服务未实现(501)'
+ break
+ case 502:
+ message = '网络错误(502)'
+ break
+ case 503:
+ message = '服务不可用(503)'
+ break
+ case 504:
+ message = '网络超时(504)'
+ break
+ case 505:
+ message = 'HTTP版本不受支持(505)'
+ break
+ default:
+ message = `连接出错(${status})!`
}
+ return `${message},请检查网络或联系管理员!`
+}
/**
@@ -69,28 +90,25 @@ export const useRequest = (options = {
pagination: false, // 是否分页
}) => {
- let params:any = {
+
+ let params:Params = {
code: null, // 业务码
- success: null, // 请求是否成功
+ success: false, // 请求是否成功
data: {},
msg: '',
- loading: null,
+ loading: false,
error: null,
query: {},
filter: null,
- sort: null,
+ sort: '',
total: 0,
multiple: true, // 请求多次
count: 0, // 第几次请求
token: '', // token
}
- if(options.pagination) {
- params.page = options.page
- params.pageSize = options.pageSize
- }
-
- const [state, setState] = useState({...params})
+ const stateRef = useRef({...params})
+ const [state, setState] = useState({...stateRef.current})
// // 每页多少条记录
// const handleSizeChange = (val) => {
@@ -120,7 +138,7 @@ export const useRequest = (options = {
// eslint-disable-next-line
const handleSort = (val, orderby = "desc") => {
if (val != null) {
- state.sort = orderby ? {
+ stateRef.current.sort = orderby ? {
sort_key: `${orderby == 'desc' ? '-' + val : val}`
} : null
}
@@ -129,16 +147,16 @@ export const useRequest = (options = {
// 请求函数
const fetchData = async (sub_options) => {
- state.loading = true
-
- state.query = {
+ stateRef.current.loading = true
+ setState((e) => ({...e, loading:true}))
+ stateRef.current.query = {
...sub_options,
...options.pagination && {
- page: state.page,
- size: state.size,
+ page: stateRef.current.page,
+ size: stateRef.current.pageSize,
},
- ...state.filter,
- ...state.sort
+ ...stateRef.current.filter,
+ ...stateRef.current.sort
}
try {
let token = Taro.getStorageSync('token')
@@ -147,13 +165,13 @@ export const useRequest = (options = {
...{
header: {
"Platform": 3,
- "Authorization": token || state.token,
+ "Authorization": token || stateRef.current.token,
}
},
...options.method?.toUpperCase() == 'GET' ? {
- data: state.query
+ data: stateRef.current.query
} : {
- data: options.type?.toUpperCase() == 'FORMDATA' ? qs.stringify(state.query) : state.query
+ data: options.type?.toUpperCase() == 'FORMDATA' ? qs.stringify(stateRef.current.query) : stateRef.current.query
}
}
const result = await Taro.request(q as any)
@@ -165,11 +183,11 @@ export const useRequest = (options = {
} = result.data
console.log(code, msg, data, statusCode);
if (statusCode === 200) {
- state.success = (code === 0 ? true : false)
- state.code = code
- state.msg = msg
- state.data = data
- state.total = data?.list ? data?.total : 0
+ stateRef.current.success = (code === 0 ? true : false)
+ stateRef.current.code = code
+ stateRef.current.msg = msg
+ stateRef.current.data = data
+ stateRef.current.total = data?.list ? data?.total : 0
}else{
Taro.showToast({
title: `错误:${showStatus(statusCode)}`
@@ -183,22 +201,20 @@ export const useRequest = (options = {
}
} catch (e) {
- console.log('出错', e);
- state.success = false
- state.error = true
- state.msg = e.errMsg
+ stateRef.current.success = false
+ stateRef.current.error = true
+ stateRef.current.msg = e.errMsg
}
- state.error = false
- state.loading = false
+ stateRef.current.error = false
+ stateRef.current.loading = false
+ setState(() => stateRef.current)
}
return {
- // handleSizeChange,
- // handleCurrentChange,
- // handleFilterChange,
handleSort,
fetchData,
+ state,
}
}
\ No newline at end of file
From 16ba165fec5d1f488a1e754ad243934cc20980d7 Mon Sep 17 00:00:00 2001
From: czm <2192718639@qq.com>
Date: Sun, 24 Apr 2022 15:34:10 +0800
Subject: [PATCH 11/18] =?UTF-8?q?=E5=88=86=E4=BA=AB=E5=B0=81=E8=A3=85?=
=?UTF-8?q?=E5=AE=8C=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/shopCart/index.tsx | 2 ++
src/pages/details/index.module.scss | 9 +++++++++
src/pages/details/index.tsx | 16 ++++++++++++----
src/pages/index/index.tsx | 6 ++++--
src/pages/search/index.tsx | 1 +
5 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/src/components/shopCart/index.tsx b/src/components/shopCart/index.tsx
index 0915eb6..83f906b 100644
--- a/src/components/shopCart/index.tsx
+++ b/src/components/shopCart/index.tsx
@@ -92,6 +92,8 @@ export default ({show = false, onClose}: param) => {
}
})
}
+
+
return (
diff --git a/src/pages/details/index.module.scss b/src/pages/details/index.module.scss
index 1c1f42a..1b7d4ec 100644
--- a/src/pages/details/index.module.scss
+++ b/src/pages/details/index.module.scss
@@ -28,11 +28,20 @@
font-size: $font_size_min;
text-align: center;
color: $color_font_three;
+ position: relative;
.text{
margin-top: 10px;
font-size: $font_size_medium;
}
}
+ .shareBtn {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ opacity: 0;
+ }
.miconfont{
font-size: 36px;
}
diff --git a/src/pages/details/index.tsx b/src/pages/details/index.tsx
index 22b9543..a55e934 100644
--- a/src/pages/details/index.tsx
+++ b/src/pages/details/index.tsx
@@ -1,14 +1,15 @@
import { Button, Image, RichText, Swiper, SwiperItem, View } from '@tarojs/components'
-import Taro, { useShareAppMessage } from '@tarojs/taro';
+import Taro, { useDidShow, useRouter, useShareAppMessage } from '@tarojs/taro';
import classnames from "classnames";
import DesSwiper from './components/swiper';
import OrderCount from './components/orderCount';
import ShopCart from '@/components/shopCart';
import Preview,{colorItem} from './components/preview';
import styles from './index.module.scss'
-import { useMemo, useState } from 'react';
+import { useEffect, useMemo, useState } from 'react';
import useManualPullDownRefresh from '@/use/useManualPullDownRefresh';
+import { goLink } from '@/common/common';
type item = {title:string, img:string, url:string, id:number}
type params = {
@@ -18,6 +19,11 @@ type params = {
}
export default (props:params) => {
+ const router = useRouter()
+ useEffect(() => {
+ console.log('router::',router)
+ }, [])
+
//页面下拉刷新
const res = useManualPullDownRefresh()
@@ -92,7 +98,8 @@ export default (props:params) => {
}
return {
title: '自定义转发标题',
- path: '/page/user?id=123'
+ path: '/pages/details/index?id=10',
+ imageUrl: list[0].img
}
})
@@ -108,7 +115,8 @@ export default (props:params) => {
分享
-
+
+
changeCollect()}>
diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx
index d5afe5c..e01441b 100644
--- a/src/pages/index/index.tsx
+++ b/src/pages/index/index.tsx
@@ -7,8 +7,8 @@ import MoveBtn from '@/components/moveBtn'
import ShopCart from '@/components/shopCart'
import styles from './index.module.scss'
import { goLink } from '@/common/common'
-import { useState } from 'react'
-import Taro, { usePullDownRefresh } from '@tarojs/taro'
+import { useEffect, useState } from 'react'
+import Taro, { useDidShow, usePullDownRefresh, useRouter } from '@tarojs/taro'
import useManualPullDownRefresh from '@/use/useManualPullDownRefresh'
@@ -47,6 +47,8 @@ export default () => {
}, 1000)
}
+
+
return (
setShowShopCart(!showShopCart)}>
diff --git a/src/pages/search/index.tsx b/src/pages/search/index.tsx
index 2c19f4b..c24f320 100644
--- a/src/pages/search/index.tsx
+++ b/src/pages/search/index.tsx
@@ -4,6 +4,7 @@ import Search from '@/components/search'
import { goLink } from '@/common/common';
import classnames from "classnames";
import styles from './index.module.scss'
+import { useEffect } from 'react';
export default () => {
return (
From 5bae62d34d2c80e4f5ca04805c64fa8695c7b99f Mon Sep 17 00:00:00 2001
From: czm <2192718639@qq.com>
Date: Sun, 24 Apr 2022 19:02:11 +0800
Subject: [PATCH 12/18] =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=B0=81=E8=A3=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
package-lock.json | 201 ++-
package.json | 6 +-
src/app.tsx | 12 +-
src/common/constant.js | 5 +-
src/components/shopCart/index.tsx | 2 +-
src/constants/userInfo.ts | 2 +
src/pages/details/index.module.scss | 9 +-
src/pages/details/index.tsx | 14 +-
src/pages/index/index.tsx | 24 +-
src/reducers/index.ts | 6 +
src/reducers/userInfo.ts | 24 +
src/store/index.ts | 27 +
src/styles/common.scss | 4 +-
src/use/useLogin.tsx | 85 ++
yarn.lock | 2009 +++++++++++++++++++++++++++
15 files changed, 2400 insertions(+), 30 deletions(-)
create mode 100644 src/constants/userInfo.ts
create mode 100644 src/reducers/index.ts
create mode 100644 src/reducers/userInfo.ts
create mode 100644 src/store/index.ts
create mode 100644 src/use/useLogin.tsx
diff --git a/package-lock.json b/package-lock.json
index 5427fab..a1eaf8d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -16,7 +16,11 @@
"big.js": "^6.1.1",
"qs": "^6.10.3",
"react": "^17.0.0",
- "react-dom": "^17.0.0"
+ "react-dom": "^17.0.0",
+ "react-redux": "^8.0.1",
+ "redux": "^4.2.0",
+ "redux-logger": "^3.0.6",
+ "redux-thunk": "^2.4.1"
},
"devDependencies": {
"@babel/core": "^7.8.0",
@@ -3916,6 +3920,15 @@
"@types/node": "*"
}
},
+ "node_modules/@types/hoist-non-react-statics": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz",
+ "integrity": "sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==",
+ "dependencies": {
+ "@types/react": "*",
+ "hoist-non-react-statics": "^3.3.0"
+ }
+ },
"node_modules/@types/json-schema": {
"version": "7.0.11",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz",
@@ -3979,7 +3992,6 @@
"version": "15.7.4",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.4.tgz",
"integrity": "sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ==",
- "dev": true,
"license": "MIT"
},
"node_modules/@types/qs": {
@@ -3992,7 +4004,6 @@
"version": "17.0.43",
"resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.43.tgz",
"integrity": "sha512-8Q+LNpdxf057brvPu1lMtC5Vn7J119xrP1aq4qiaefNioQUYANF/CYeK4NsKorSZyUGJ66g0IM+4bbjwx45o2A==",
- "dev": true,
"license": "MIT",
"dependencies": {
"@types/prop-types": "*",
@@ -4014,9 +4025,13 @@
"version": "0.16.2",
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz",
"integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==",
- "dev": true,
"license": "MIT"
},
+ "node_modules/@types/use-sync-external-store": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.3.tgz",
+ "integrity": "sha512-EwmlvuaxPNej9+T4v5AuBPJa2x2UOJVdjCtDHgcDqitUeOtjnJKJ+apYjVcAoBEMjKW1VVFGZLUb5+qqa09XFA=="
+ },
"node_modules/@types/webpack-env": {
"version": "1.16.3",
"resolved": "https://registry.npmjs.org/@types/webpack-env/-/webpack-env-1.16.3.tgz",
@@ -7514,7 +7529,6 @@
"version": "3.0.11",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.11.tgz",
"integrity": "sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw==",
- "dev": true,
"license": "MIT"
},
"node_modules/cuint": {
@@ -7630,6 +7644,11 @@
"node": ">=0.10"
}
},
+ "node_modules/deep-diff": {
+ "version": "0.3.8",
+ "resolved": "https://registry.npmjs.org/deep-diff/-/deep-diff-0.3.8.tgz",
+ "integrity": "sha1-wB3mPvsO7JeYgB1Ax+Da4ltYLIQ="
+ },
"node_modules/deep-equal": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz",
@@ -10331,6 +10350,14 @@
"minimalistic-crypto-utils": "^1.0.1"
}
},
+ "node_modules/hoist-non-react-statics": {
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
+ "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==",
+ "dependencies": {
+ "react-is": "^16.7.0"
+ }
+ },
"node_modules/hosted-git-info": {
"version": "2.8.9",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
@@ -15766,7 +15793,6 @@
"version": "16.13.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",
- "dev": true,
"license": "MIT"
},
"node_modules/react-reconciler": {
@@ -15786,6 +15812,49 @@
"react": "^17.0.1"
}
},
+ "node_modules/react-redux": {
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.1.tgz",
+ "integrity": "sha512-LMZMsPY4DYdZfLJgd7i79n5Kps5N9XVLCJJeWAaPYTV+Eah2zTuBjTxKtNEbjiyitbq80/eIkm55CYSLqAub3w==",
+ "dependencies": {
+ "@babel/runtime": "^7.12.1",
+ "@types/hoist-non-react-statics": "^3.3.1",
+ "@types/use-sync-external-store": "^0.0.3",
+ "hoist-non-react-statics": "^3.3.2",
+ "react-is": "^18.0.0",
+ "use-sync-external-store": "^1.0.0"
+ },
+ "peerDependencies": {
+ "@types/react": "^16.8 || ^17.0 || ^18.0",
+ "@types/react-dom": "^16.8 || ^17.0 || ^18.0",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0",
+ "react-native": ">=0.59",
+ "redux": "^4"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ },
+ "react-dom": {
+ "optional": true
+ },
+ "react-native": {
+ "optional": true
+ },
+ "redux": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-redux/node_modules/react-is": {
+ "version": "18.0.0",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.0.0.tgz",
+ "integrity": "sha512-yUcBYdBBbo3QiPsgYDcfQcIkGZHfxOaoE6HLSnr1sPzMhdyxusbfKOSUbSd/ocGi32dxcj366PsTj+5oggeKKw=="
+ },
"node_modules/react-refresh": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.9.0.tgz",
@@ -15905,6 +15974,30 @@
"node": ">=4"
}
},
+ "node_modules/redux": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.0.tgz",
+ "integrity": "sha512-oSBmcKKIuIR4ME29/AeNUnl5L+hvBq7OaJWzaptTQJAntaPvxIJqfnjbaEiCzzaIz+XmVILfqAM3Ob0aXLPfjA==",
+ "dependencies": {
+ "@babel/runtime": "^7.9.2"
+ }
+ },
+ "node_modules/redux-logger": {
+ "version": "3.0.6",
+ "resolved": "https://registry.npmjs.org/redux-logger/-/redux-logger-3.0.6.tgz",
+ "integrity": "sha1-91VZZvMJjzyIYExEnPC69XeCdL8=",
+ "dependencies": {
+ "deep-diff": "^0.3.5"
+ }
+ },
+ "node_modules/redux-thunk": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-2.4.1.tgz",
+ "integrity": "sha512-OOYGNY5Jy2TWvTL1KgAlVy6dcx3siPJ1wTq741EPyUKfn6W6nChdICjZwCd0p8AZBs5kWpZlbkXW2nE/zjUa+Q==",
+ "peerDependencies": {
+ "redux": "^4"
+ }
+ },
"node_modules/reflect-metadata": {
"version": "0.1.13",
"resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz",
@@ -19814,6 +19907,14 @@
"node": ">=0.10.0"
}
},
+ "node_modules/use-sync-external-store": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.0.0.tgz",
+ "integrity": "sha512-AFVsxg5GkFg8GDcxnl+Z0lMAz9rE8DGJCc28qnBuQF7lac57B5smLcT37aXpXIIPz75rW4g3eXHPjhHwdGskOw==",
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0-rc"
+ }
+ },
"node_modules/util": {
"version": "0.11.1",
"resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz",
@@ -23667,6 +23768,15 @@
"@types/node": "*"
}
},
+ "@types/hoist-non-react-statics": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz",
+ "integrity": "sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==",
+ "requires": {
+ "@types/react": "*",
+ "hoist-non-react-statics": "^3.3.0"
+ }
+ },
"@types/json-schema": {
"version": "7.0.11",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz",
@@ -23721,8 +23831,7 @@
"@types/prop-types": {
"version": "15.7.4",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.4.tgz",
- "integrity": "sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ==",
- "dev": true
+ "integrity": "sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ=="
},
"@types/qs": {
"version": "6.9.7",
@@ -23734,7 +23843,6 @@
"version": "17.0.43",
"resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.43.tgz",
"integrity": "sha512-8Q+LNpdxf057brvPu1lMtC5Vn7J119xrP1aq4qiaefNioQUYANF/CYeK4NsKorSZyUGJ66g0IM+4bbjwx45o2A==",
- "dev": true,
"requires": {
"@types/prop-types": "*",
"@types/scheduler": "*",
@@ -23753,8 +23861,12 @@
"@types/scheduler": {
"version": "0.16.2",
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz",
- "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==",
- "dev": true
+ "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew=="
+ },
+ "@types/use-sync-external-store": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.3.tgz",
+ "integrity": "sha512-EwmlvuaxPNej9+T4v5AuBPJa2x2UOJVdjCtDHgcDqitUeOtjnJKJ+apYjVcAoBEMjKW1VVFGZLUb5+qqa09XFA=="
},
"@types/webpack-env": {
"version": "1.16.3",
@@ -26304,8 +26416,7 @@
"csstype": {
"version": "3.0.11",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.11.tgz",
- "integrity": "sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw==",
- "dev": true
+ "integrity": "sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw=="
},
"cuint": {
"version": "0.2.2",
@@ -26396,6 +26507,11 @@
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz",
"integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU="
},
+ "deep-diff": {
+ "version": "0.3.8",
+ "resolved": "https://registry.npmjs.org/deep-diff/-/deep-diff-0.3.8.tgz",
+ "integrity": "sha1-wB3mPvsO7JeYgB1Ax+Da4ltYLIQ="
+ },
"deep-equal": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz",
@@ -28387,6 +28503,14 @@
"minimalistic-crypto-utils": "^1.0.1"
}
},
+ "hoist-non-react-statics": {
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
+ "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==",
+ "requires": {
+ "react-is": "^16.7.0"
+ }
+ },
"hosted-git-info": {
"version": "2.8.9",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
@@ -32327,8 +32451,7 @@
"react-is": {
"version": "16.13.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
- "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",
- "dev": true
+ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
},
"react-reconciler": {
"version": "0.26.1",
@@ -32340,6 +32463,26 @@
"scheduler": "^0.20.1"
}
},
+ "react-redux": {
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.1.tgz",
+ "integrity": "sha512-LMZMsPY4DYdZfLJgd7i79n5Kps5N9XVLCJJeWAaPYTV+Eah2zTuBjTxKtNEbjiyitbq80/eIkm55CYSLqAub3w==",
+ "requires": {
+ "@babel/runtime": "^7.12.1",
+ "@types/hoist-non-react-statics": "^3.3.1",
+ "@types/use-sync-external-store": "^0.0.3",
+ "hoist-non-react-statics": "^3.3.2",
+ "react-is": "^18.0.0",
+ "use-sync-external-store": "^1.0.0"
+ },
+ "dependencies": {
+ "react-is": {
+ "version": "18.0.0",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.0.0.tgz",
+ "integrity": "sha512-yUcBYdBBbo3QiPsgYDcfQcIkGZHfxOaoE6HLSnr1sPzMhdyxusbfKOSUbSd/ocGi32dxcj366PsTj+5oggeKKw=="
+ }
+ }
+ },
"react-refresh": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.9.0.tgz",
@@ -32435,6 +32578,28 @@
"strip-indent": "^2.0.0"
}
},
+ "redux": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.0.tgz",
+ "integrity": "sha512-oSBmcKKIuIR4ME29/AeNUnl5L+hvBq7OaJWzaptTQJAntaPvxIJqfnjbaEiCzzaIz+XmVILfqAM3Ob0aXLPfjA==",
+ "requires": {
+ "@babel/runtime": "^7.9.2"
+ }
+ },
+ "redux-logger": {
+ "version": "3.0.6",
+ "resolved": "https://registry.npmjs.org/redux-logger/-/redux-logger-3.0.6.tgz",
+ "integrity": "sha1-91VZZvMJjzyIYExEnPC69XeCdL8=",
+ "requires": {
+ "deep-diff": "^0.3.5"
+ }
+ },
+ "redux-thunk": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-2.4.1.tgz",
+ "integrity": "sha512-OOYGNY5Jy2TWvTL1KgAlVy6dcx3siPJ1wTq741EPyUKfn6W6nChdICjZwCd0p8AZBs5kWpZlbkXW2nE/zjUa+Q==",
+ "requires": {}
+ },
"reflect-metadata": {
"version": "0.1.13",
"resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz",
@@ -35274,6 +35439,12 @@
"integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==",
"dev": true
},
+ "use-sync-external-store": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.0.0.tgz",
+ "integrity": "sha512-AFVsxg5GkFg8GDcxnl+Z0lMAz9rE8DGJCc28qnBuQF7lac57B5smLcT37aXpXIIPz75rW4g3eXHPjhHwdGskOw==",
+ "requires": {}
+ },
"util": {
"version": "0.11.1",
"resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz",
diff --git a/package.json b/package.json
index 1ee5a32..215c2f7 100644
--- a/package.json
+++ b/package.json
@@ -43,7 +43,11 @@
"big.js": "^6.1.1",
"qs": "^6.10.3",
"react": "^17.0.0",
- "react-dom": "^17.0.0"
+ "react-dom": "^17.0.0",
+ "react-redux": "^8.0.1",
+ "redux": "^4.2.0",
+ "redux-logger": "^3.0.6",
+ "redux-thunk": "^2.4.1"
},
"devDependencies": {
"@babel/core": "^7.8.0",
diff --git a/src/app.tsx b/src/app.tsx
index dc241a4..563e573 100644
--- a/src/app.tsx
+++ b/src/app.tsx
@@ -1,8 +1,11 @@
import { Component } from 'react'
import ContextBlueTooth from "@/use/contextBlueTooth"
+import { Provider } from 'react-redux'
+import configStore from './store'
import './app.scss'
+const store = configStore()
class App extends Component {
componentDidMount () {}
@@ -16,9 +19,12 @@ class App extends Component {
// this.props.children 是将要会渲染的页面
render () {
return (
-
- {this.props.children}
-
+
+
+
+ {this.props.children}
+
+
)
}
}
diff --git a/src/common/constant.js b/src/common/constant.js
index b06c5ea..093fb79 100644
--- a/src/common/constant.js
+++ b/src/common/constant.js
@@ -24,4 +24,7 @@ export const IMG_CND_Prefix = "http://test.cdn.zzfzyc.com/"
// 上传图片视频
-export const CDN_UPLOAD_IMG = `${UPLOAD_CDN_URL || ''}`;
\ No newline at end of file
+export const CDN_UPLOAD_IMG = `${UPLOAD_CDN_URL || ''}`;
+
+//appid
+export const WX_APPID = 'wx6c8b9156543480b0'
\ No newline at end of file
diff --git a/src/components/shopCart/index.tsx b/src/components/shopCart/index.tsx
index 83f906b..775b2cd 100644
--- a/src/components/shopCart/index.tsx
+++ b/src/components/shopCart/index.tsx
@@ -93,7 +93,7 @@ export default ({show = false, onClose}: param) => {
})
}
-
+
return (
diff --git a/src/constants/userInfo.ts b/src/constants/userInfo.ts
new file mode 100644
index 0000000..8df3b84
--- /dev/null
+++ b/src/constants/userInfo.ts
@@ -0,0 +1,2 @@
+export const GETUSER = 'GETUSER'
+export const SETUSER = 'SETUSER'
\ No newline at end of file
diff --git a/src/pages/details/index.module.scss b/src/pages/details/index.module.scss
index 1b7d4ec..2ac32b4 100644
--- a/src/pages/details/index.module.scss
+++ b/src/pages/details/index.module.scss
@@ -62,9 +62,16 @@
.con{
display: grid;
grid-template-columns: 260px auto;
- grid-template-rows: 50px 50px;
font-size: $font_size_medium;
color: $color_font_three;
+ .des_text{
+ display: flex;
+ margin-bottom: 16px;
+ text{
+ flex:1;
+ @include common_ellipsis(1);
+ }
+ }
}
}
.product_color{
diff --git a/src/pages/details/index.tsx b/src/pages/details/index.tsx
index a55e934..cadff96 100644
--- a/src/pages/details/index.tsx
+++ b/src/pages/details/index.tsx
@@ -1,5 +1,5 @@
-import { Button, Image, RichText, Swiper, SwiperItem, View } from '@tarojs/components'
+import { Button, Image, RichText, Swiper, SwiperItem, Text, View } from '@tarojs/components'
import Taro, { useDidShow, useRouter, useShareAppMessage } from '@tarojs/taro';
import classnames from "classnames";
import DesSwiper from './components/swiper';
@@ -103,6 +103,10 @@ export default (props:params) => {
}
})
+ useDidShow(() => {
+ Taro.getCurrentPages()
+ })
+
return (
@@ -127,10 +131,10 @@ export default (props:params) => {
详情参数
- 编号:0770
- 幅宽:160cm
- 克重:160g
- 成分:67.6%棉24%涤纶6.4%氨纶%氨纶
+ 编号:0770
+ 幅宽:160cm
+ 克重:160g
+ 成分:67.6%棉24%涤纶6.4%氨纶%氨纶氨纶%氨纶
diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx
index e01441b..d0ffe2c 100644
--- a/src/pages/index/index.tsx
+++ b/src/pages/index/index.tsx
@@ -46,12 +46,32 @@ export default () => {
console.log('12123')
}, 1000)
}
-
-
+ const goto = function (e) {
+ var t = this
+ Taro.navigateTo({
+ url: '/pages/details/index',
+ events: {
+ // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
+ backFromTargetPage: function (backData) {
+ console.log('好啦,可以在这里写你的逻辑了', backData)
+ if (backData.from == 'page2') {
+ // 监听到 page2 返回
+ console.log('好啦,可以在这里写你的逻辑了', backData)
+ t.setData({
+ isBackFromPage2: !0
+ })
+ }
+ }
+ }
+ })
+ }
+
return (
setShowShopCart(!showShopCart)}>
+
+ goto(e)}>aaa
我的收藏
diff --git a/src/reducers/index.ts b/src/reducers/index.ts
new file mode 100644
index 0000000..2af35af
--- /dev/null
+++ b/src/reducers/index.ts
@@ -0,0 +1,6 @@
+import { combineReducers } from 'redux'
+import userInfo from './userInfo'
+
+export default combineReducers({
+ userInfo
+})
\ No newline at end of file
diff --git a/src/reducers/userInfo.ts b/src/reducers/userInfo.ts
new file mode 100644
index 0000000..e2c3f8d
--- /dev/null
+++ b/src/reducers/userInfo.ts
@@ -0,0 +1,24 @@
+
+import { GETUSER, SETUSER } from '../constants/userInfo'
+
+const INIT_USER = {
+ name: '张三',
+ phone: '110',
+ avatarUrl: '',
+ token: '',
+}
+
+export default function counter (state = INIT_USER, action) {
+ switch (action.type) {
+ case GETUSER:
+ return {
+ ...state,
+ }
+ case SETUSER:
+ return {
+ ...state,
+ }
+ default:
+ return state
+ }
+}
\ No newline at end of file
diff --git a/src/store/index.ts b/src/store/index.ts
new file mode 100644
index 0000000..63bf194
--- /dev/null
+++ b/src/store/index.ts
@@ -0,0 +1,27 @@
+import { createStore, applyMiddleware, compose } from 'redux'
+import thunkMiddleware from 'redux-thunk'
+import rootReducer from '@/reducers'
+
+const composeEnhancers =
+ typeof window === 'object' &&
+ (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?
+ (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
+ // Specify extension’s options like name, actionsBlacklist, actionsCreators, serialize...
+ }) : compose
+
+const middlewares = [
+ thunkMiddleware
+]
+
+if (process.env.NODE_ENV === 'development' && process.env.TARO_ENV !== 'quickapp') {
+ middlewares.push(require('redux-logger').createLogger())
+}
+
+const enhancer = composeEnhancers(
+ applyMiddleware(...middlewares),
+)
+
+export default function configStore () {
+ const store = createStore(rootReducer, enhancer)
+ return store
+}
\ No newline at end of file
diff --git a/src/styles/common.scss b/src/styles/common.scss
index 247c736..0000577 100644
--- a/src/styles/common.scss
+++ b/src/styles/common.scss
@@ -19,13 +19,15 @@ $font_size_min: 22px;
//省略号
@mixin common_ellipsis($params:1) {
+
overflow: hidden;
display: -webkit-box;
white-space:normal;
+ text-overflow:ellipsis;
word-break:break-all;
-webkit-box-orient: vertical;
-webkit-line-clamp: $params;
- text-overflow:ellipsis;
+
}
diff --git a/src/use/useLogin.tsx b/src/use/useLogin.tsx
new file mode 100644
index 0000000..554d834
--- /dev/null
+++ b/src/use/useLogin.tsx
@@ -0,0 +1,85 @@
+import { useEffect, useState } from "react"
+import { WX_APPID } from "@/common/constant"
+
+export default () => {
+ const [loginState, setLoginState] = useState({
+ session_key: '',
+ token: '',
+ userInfo: ''
+ })
+
+ useEffect(() => {
+ getToken()
+ }, [])
+
+ const getToken = () => {
+ Taro.login({
+ success: function (res) {
+ if (res.code) {
+ console.log('number::', res.code)
+ Taro.request({
+ url: 'https://dev.zzfzyc.com/lymarket/v1/mall/login',
+ method: 'POST',
+ data: {
+ js_code: res.code,
+ },
+ header: {
+ platform: 6,
+ Appid: WX_APPID
+ },
+ success: (e) => {
+ let {data} = e.data
+ setLoginState({
+ ...loginState,
+ session_key: data.session_key,
+ token: data.token
+ })
+ }
+ })
+ } else {
+ console.log('登录失败!' + res.errMsg)
+ }
+ },
+ fail: function(e) {
+ console.log('e::',e)
+ }
+ })
+ }
+
+ const getUserInfo = () => {
+ Taro.getUserProfile({
+ desc: '用于完善会员资料',
+ success: (res) => {
+ Taro.request({
+ url: 'https://dev.zzfzyc.com/lymarket/v1/mall/user/decrypt',
+ method: 'POST',
+ data: {
+ session_key: loginState.session_key,
+ raw_data: res.rawData,
+ signature: res.signature,
+ encrypted_data: res.encryptedData,
+ iv: res.iv
+ },
+ header: {
+ platform: 6,
+ Authorization: loginState.token,
+ Appid: WX_APPID
+ },
+ success: (e) => {
+ console.log('123123')
+ },
+ fail: (e) => {
+ console.log(e)
+ }
+ })
+ }
+ })
+
+
+ }
+
+ return {
+ getToken,
+ getUserInfo
+ }
+}
\ No newline at end of file
diff --git a/yarn.lock b/yarn.lock
index dda13eb..0ccd5f2 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1058,10 +1058,17 @@
core-js-pure "^3.20.2"
regenerator-runtime "^0.13.4"
+<<<<<<< HEAD
"@babel/runtime@^7.11.2", "@babel/runtime@^7.7.6", "@babel/runtime@^7.7.7", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2":
version "7.17.8"
resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.8.tgz"
integrity sha512-dQpEpK0O9o6lj6oPu0gRDbbnk+4LeHlNcBpspf6Olzt3GIX4P1lWF1gS+pHLDFlaJvbR6q7jCfQ08zA4QJBnmA==
+=======
+"@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.7.6", "@babel/runtime@^7.7.7", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2":
+ "integrity" "sha512-dQpEpK0O9o6lj6oPu0gRDbbnk+4LeHlNcBpspf6Olzt3GIX4P1lWF1gS+pHLDFlaJvbR6q7jCfQ08zA4QJBnmA=="
+ "resolved" "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.8.tgz"
+ "version" "7.17.8"
+>>>>>>> d7b4e57 (登录封装)
dependencies:
regenerator-runtime "^0.13.4"
@@ -1554,6 +1561,14 @@
"@types/minimatch" "*"
"@types/node" "*"
+"@types/hoist-non-react-statics@^3.3.1":
+ "integrity" "sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA=="
+ "resolved" "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz"
+ "version" "3.3.1"
+ dependencies:
+ "@types/react" "*"
+ "hoist-non-react-statics" "^3.3.0"
+
"@types/json-schema@^7.0.5", "@types/json-schema@^7.0.7", "@types/json-schema@^7.0.8":
version "7.0.11"
resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz"
@@ -1606,10 +1621,17 @@
"resolved" "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz"
"version" "6.9.7"
+<<<<<<< HEAD
"@types/react@^17.0.2":
version "17.0.43"
resolved "https://registry.npmjs.org/@types/react/-/react-17.0.43.tgz"
integrity sha512-8Q+LNpdxf057brvPu1lMtC5Vn7J119xrP1aq4qiaefNioQUYANF/CYeK4NsKorSZyUGJ66g0IM+4bbjwx45o2A==
+=======
+"@types/react@*", "@types/react@^16.8 || ^17.0 || ^18.0", "@types/react@^17.0.2":
+ "integrity" "sha512-8Q+LNpdxf057brvPu1lMtC5Vn7J119xrP1aq4qiaefNioQUYANF/CYeK4NsKorSZyUGJ66g0IM+4bbjwx45o2A=="
+ "resolved" "https://registry.npmjs.org/@types/react/-/react-17.0.43.tgz"
+ "version" "17.0.43"
+>>>>>>> d7b4e57 (登录封装)
dependencies:
"@types/prop-types" "*"
"@types/scheduler" "*"
@@ -1627,6 +1649,11 @@
resolved "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz"
integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==
+"@types/use-sync-external-store@^0.0.3":
+ "integrity" "sha512-EwmlvuaxPNej9+T4v5AuBPJa2x2UOJVdjCtDHgcDqitUeOtjnJKJ+apYjVcAoBEMjKW1VVFGZLUb5+qqa09XFA=="
+ "resolved" "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.3.tgz"
+ "version" "0.0.3"
+
"@types/webpack-env@^1.13.6":
version "1.16.3"
resolved "https://registry.npmjs.org/@types/webpack-env/-/webpack-env-1.16.3.tgz"
@@ -3821,10 +3848,106 @@ define-property@^2.0.2:
is-descriptor "^1.0.2"
isobject "^3.0.1"
+<<<<<<< HEAD
del@^4.1.1:
version "4.1.1"
resolved "https://registry.npmjs.org/del/-/del-4.1.1.tgz"
integrity sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ==
+=======
+"decamelize-keys@^1.0.0":
+ "integrity" "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk="
+ "resolved" "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz"
+ "version" "1.1.0"
+ dependencies:
+ "decamelize" "^1.1.0"
+ "map-obj" "^1.0.0"
+
+"decamelize@^1.1.0", "decamelize@^1.2.0":
+ "integrity" "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
+ "resolved" "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz"
+ "version" "1.2.0"
+
+"decode-uri-component@^0.2.0":
+ "integrity" "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU="
+ "resolved" "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz"
+ "version" "0.2.0"
+
+"deep-diff@^0.3.5":
+ "integrity" "sha1-wB3mPvsO7JeYgB1Ax+Da4ltYLIQ="
+ "resolved" "https://registry.npmjs.org/deep-diff/-/deep-diff-0.3.8.tgz"
+ "version" "0.3.8"
+
+"deep-equal@^1.0.1":
+ "integrity" "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g=="
+ "resolved" "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz"
+ "version" "1.1.1"
+ dependencies:
+ "is-arguments" "^1.0.4"
+ "is-date-object" "^1.0.1"
+ "is-regex" "^1.0.4"
+ "object-is" "^1.0.1"
+ "object-keys" "^1.1.1"
+ "regexp.prototype.flags" "^1.2.0"
+
+"deep-is@~0.1.3":
+ "integrity" "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ=="
+ "resolved" "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz"
+ "version" "0.1.4"
+
+"deepmerge@^1.5.2":
+ "integrity" "sha512-95k0GDqvBjZavkuvzx/YqVLv/6YYa17fz6ILMSf7neqQITCPbnfEnQvEgMPNjH4kgobe7+WIL0yJEHku+H3qtQ=="
+ "resolved" "https://registry.npmjs.org/deepmerge/-/deepmerge-1.5.2.tgz"
+ "version" "1.5.2"
+
+"default-gateway@^4.2.0":
+ "integrity" "sha512-h6sMrVB1VMWVrW13mSc6ia/DwYYw5MN6+exNu1OaJeFac5aSAvwM7lZ0NVfTABuSkQelr4h5oebg3KB1XPdjgA=="
+ "resolved" "https://registry.npmjs.org/default-gateway/-/default-gateway-4.2.0.tgz"
+ "version" "4.2.0"
+ dependencies:
+ "execa" "^1.0.0"
+ "ip-regex" "^2.1.0"
+
+"defaults@^1.0.3":
+ "integrity" "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730="
+ "resolved" "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz"
+ "version" "1.0.3"
+ dependencies:
+ "clone" "^1.0.2"
+
+"define-properties@^1.1.2", "define-properties@^1.1.3":
+ "integrity" "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ=="
+ "resolved" "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz"
+ "version" "1.1.3"
+ dependencies:
+ "object-keys" "^1.0.12"
+
+"define-property@^0.2.5":
+ "integrity" "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY="
+ "resolved" "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz"
+ "version" "0.2.5"
+ dependencies:
+ "is-descriptor" "^0.1.0"
+
+"define-property@^1.0.0":
+ "integrity" "sha1-dp66rz9KY6rTr56NMEybvnm/sOY="
+ "resolved" "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz"
+ "version" "1.0.0"
+ dependencies:
+ "is-descriptor" "^1.0.0"
+
+"define-property@^2.0.2":
+ "integrity" "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ=="
+ "resolved" "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz"
+ "version" "2.0.2"
+ dependencies:
+ "is-descriptor" "^1.0.2"
+ "isobject" "^3.0.1"
+
+"del@^4.1.1":
+ "integrity" "sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ=="
+ "resolved" "https://registry.npmjs.org/del/-/del-4.1.1.tgz"
+ "version" "4.1.1"
+>>>>>>> d7b4e57 (登录封装)
dependencies:
"@types/glob" "^7.1.1"
globby "^6.1.0"
@@ -5272,6 +5395,7 @@ history@^5.0.0:
dependencies:
"@babel/runtime" "^7.7.6"
+<<<<<<< HEAD
hmac-drbg@^1.0.1:
version "1.0.1"
resolved "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz"
@@ -5746,6 +5870,513 @@ is-data-descriptor@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz"
integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==
+=======
+"hmac-drbg@^1.0.1":
+ "integrity" "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE="
+ "resolved" "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz"
+ "version" "1.0.1"
+ dependencies:
+ "hash.js" "^1.0.3"
+ "minimalistic-assert" "^1.0.0"
+ "minimalistic-crypto-utils" "^1.0.1"
+
+"hoist-non-react-statics@^3.3.0", "hoist-non-react-statics@^3.3.2":
+ "integrity" "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw=="
+ "resolved" "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz"
+ "version" "3.3.2"
+ dependencies:
+ "react-is" "^16.7.0"
+
+"hosted-git-info@^2.1.4":
+ "integrity" "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw=="
+ "resolved" "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz"
+ "version" "2.8.9"
+
+"hpack.js@^2.1.6":
+ "integrity" "sha1-h3dMCUnlE/QuhFdbPEVoH63ioLI="
+ "resolved" "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz"
+ "version" "2.1.6"
+ dependencies:
+ "inherits" "^2.0.1"
+ "obuf" "^1.0.0"
+ "readable-stream" "^2.0.1"
+ "wbuf" "^1.1.0"
+
+"html-encoding-sniffer@^1.0.2":
+ "integrity" "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw=="
+ "resolved" "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz"
+ "version" "1.0.2"
+ dependencies:
+ "whatwg-encoding" "^1.0.1"
+
+"html-entities@^1.2.1", "html-entities@^1.3.1":
+ "integrity" "sha512-8nxjcBcd8wovbeKx7h3wTji4e6+rhaVuPNpMqwWgnHh+N9ToqsCs6XztWRBPQ+UtzsoMAdKZtUENoVzU/EMtZA=="
+ "resolved" "https://registry.npmjs.org/html-entities/-/html-entities-1.4.0.tgz"
+ "version" "1.4.0"
+
+"html-minifier@^3.2.3":
+ "integrity" "sha512-LKUKwuJDhxNa3uf/LPR/KVjm/l3rBqtYeCOAekvG8F1vItxMUpueGd94i/asDDr8/1u7InxzFA5EeGjhhG5mMA=="
+ "resolved" "https://registry.npmjs.org/html-minifier/-/html-minifier-3.5.21.tgz"
+ "version" "3.5.21"
+ dependencies:
+ "camel-case" "3.0.x"
+ "clean-css" "4.2.x"
+ "commander" "2.17.x"
+ "he" "1.2.x"
+ "param-case" "2.1.x"
+ "relateurl" "0.2.x"
+ "uglify-js" "3.4.x"
+
+"html-minifier@^4.0.0":
+ "integrity" "sha512-aoGxanpFPLg7MkIl/DDFYtb0iWz7jMFGqFhvEDZga6/4QTjneiD8I/NXL1x5aaoCp7FSIT6h/OhykDdPsbtMig=="
+ "resolved" "https://registry.npmjs.org/html-minifier/-/html-minifier-4.0.0.tgz"
+ "version" "4.0.0"
+ dependencies:
+ "camel-case" "^3.0.0"
+ "clean-css" "^4.2.1"
+ "commander" "^2.19.0"
+ "he" "^1.2.0"
+ "param-case" "^2.1.1"
+ "relateurl" "^0.2.7"
+ "uglify-js" "^3.5.1"
+
+"html-tags@^2.0.0":
+ "integrity" "sha1-ELMKOGCF9Dzt41PMj6fLDe7qZos="
+ "resolved" "https://registry.npmjs.org/html-tags/-/html-tags-2.0.0.tgz"
+ "version" "2.0.0"
+
+"html-tags@^3.1.0":
+ "integrity" "sha512-1qYz89hW3lFDEazhjW0yVAV87lw8lVkrJocr72XmBkMKsoSVJCQx3W8BXsC7hO2qAt8BoVjYjtAcZ9perqGnNg=="
+ "resolved" "https://registry.npmjs.org/html-tags/-/html-tags-3.1.0.tgz"
+ "version" "3.1.0"
+
+"html-webpack-include-assets-plugin@1.0.5":
+ "integrity" "sha512-YkkzE+QfYAuEq8/yEnfTcpCeSLyJ8XmB2LlQzY1GV7/ovDxavcCIKSMF4kIMRrWmFMPU8qog/zvBaQ1RJFFw/g=="
+ "resolved" "https://registry.npmjs.org/html-webpack-include-assets-plugin/-/html-webpack-include-assets-plugin-1.0.5.tgz"
+ "version" "1.0.5"
+ dependencies:
+ "glob" "^7.1.3"
+ "minimatch" "^3.0.4"
+ "slash" "^2.0.0"
+
+"html-webpack-plugin@3.2.0":
+ "integrity" "sha1-sBq71yOsqqeze2r0SS69oD2d03s="
+ "resolved" "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz"
+ "version" "3.2.0"
+ dependencies:
+ "html-minifier" "^3.2.3"
+ "loader-utils" "^0.2.16"
+ "lodash" "^4.17.3"
+ "pretty-error" "^2.0.2"
+ "tapable" "^1.0.0"
+ "toposort" "^1.0.0"
+ "util.promisify" "1.0.0"
+
+"htmlparser2@^3.9.2":
+ "integrity" "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ=="
+ "resolved" "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz"
+ "version" "3.10.1"
+ dependencies:
+ "domelementtype" "^1.3.1"
+ "domhandler" "^2.3.0"
+ "domutils" "^1.5.1"
+ "entities" "^1.1.1"
+ "inherits" "^2.0.1"
+ "readable-stream" "^3.1.1"
+
+"htmlparser2@^6.1.0":
+ "integrity" "sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A=="
+ "resolved" "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz"
+ "version" "6.1.0"
+ dependencies:
+ "domelementtype" "^2.0.1"
+ "domhandler" "^4.0.0"
+ "domutils" "^2.5.2"
+ "entities" "^2.0.0"
+
+"http-deceiver@^1.2.7":
+ "integrity" "sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc="
+ "resolved" "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz"
+ "version" "1.2.7"
+
+"http-errors@~1.6.2":
+ "integrity" "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0="
+ "resolved" "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz"
+ "version" "1.6.3"
+ dependencies:
+ "depd" "~1.1.2"
+ "inherits" "2.0.3"
+ "setprototypeof" "1.1.0"
+ "statuses" ">= 1.4.0 < 2"
+
+"http-errors@1.8.1":
+ "integrity" "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g=="
+ "resolved" "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz"
+ "version" "1.8.1"
+ dependencies:
+ "depd" "~1.1.2"
+ "inherits" "2.0.4"
+ "setprototypeof" "1.2.0"
+ "statuses" ">= 1.5.0 < 2"
+ "toidentifier" "1.0.1"
+
+"http-parser-js@>=0.5.1":
+ "integrity" "sha512-vDlkRPDJn93swjcjqMSaGSPABbIarsr1TLAui/gLDXzV5VsJNdXNzMYDyNBLQkjWQCJ1uizu8T2oDMhmGt0PRA=="
+ "resolved" "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.6.tgz"
+ "version" "0.5.6"
+
+"http-proxy-middleware@0.19.1":
+ "integrity" "sha512-yHYTgWMQO8VvwNS22eLLloAkvungsKdKTLO8AJlftYIKNfJr3GK3zK0ZCfzDDGUBttdGc8xFy1mCitvNKQtC3Q=="
+ "resolved" "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz"
+ "version" "0.19.1"
+ dependencies:
+ "http-proxy" "^1.17.0"
+ "is-glob" "^4.0.0"
+ "lodash" "^4.17.11"
+ "micromatch" "^3.1.10"
+
+"http-proxy@^1.17.0":
+ "integrity" "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ=="
+ "resolved" "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz"
+ "version" "1.18.1"
+ dependencies:
+ "eventemitter3" "^4.0.0"
+ "follow-redirects" "^1.0.0"
+ "requires-port" "^1.0.0"
+
+"http-signature@~1.2.0":
+ "integrity" "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE="
+ "resolved" "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz"
+ "version" "1.2.0"
+ dependencies:
+ "assert-plus" "^1.0.0"
+ "jsprim" "^1.2.2"
+ "sshpk" "^1.7.0"
+
+"https-browserify@^1.0.0":
+ "integrity" "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM="
+ "resolved" "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz"
+ "version" "1.0.0"
+
+"iconv-lite@^0.4.24", "iconv-lite@^0.4.4", "iconv-lite@0.4.24":
+ "integrity" "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA=="
+ "resolved" "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz"
+ "version" "0.4.24"
+ dependencies:
+ "safer-buffer" ">= 2.1.2 < 3"
+
+"icss-utils@^4.0.0", "icss-utils@^4.1.1":
+ "integrity" "sha512-4aFq7wvWyMHKgxsH8QQtGpvbASCf+eM3wPRLI6R+MgAnTCZ6STYsRvttLvRWK0Nfif5piF394St3HeJDaljGPA=="
+ "resolved" "https://registry.npmjs.org/icss-utils/-/icss-utils-4.1.1.tgz"
+ "version" "4.1.1"
+ dependencies:
+ "postcss" "^7.0.14"
+
+"ieee754@^1.1.4":
+ "integrity" "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="
+ "resolved" "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz"
+ "version" "1.2.1"
+
+"iferr@^0.1.5":
+ "integrity" "sha1-xg7taebY/bazEEofy8ocGS3FtQE="
+ "resolved" "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz"
+ "version" "0.1.5"
+
+"ignore@^3.3.3", "ignore@^3.3.5":
+ "integrity" "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug=="
+ "resolved" "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz"
+ "version" "3.3.10"
+
+"ignore@^4.0.6":
+ "integrity" "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg=="
+ "resolved" "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz"
+ "version" "4.0.6"
+
+"ignore@^5.1.8":
+ "integrity" "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ=="
+ "resolved" "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz"
+ "version" "5.2.0"
+
+"ignore@^5.2.0":
+ "integrity" "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ=="
+ "resolved" "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz"
+ "version" "5.2.0"
+
+"image-size@~0.5.0":
+ "integrity" "sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w="
+ "resolved" "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz"
+ "version" "0.5.5"
+
+"immutable@^4.0.0":
+ "integrity" "sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw=="
+ "resolved" "https://registry.npmjs.org/immutable/-/immutable-4.0.0.tgz"
+ "version" "4.0.0"
+
+"import-fresh@^2.0.0":
+ "integrity" "sha1-2BNVwVYS04bGH53dOSLUMEgipUY="
+ "resolved" "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz"
+ "version" "2.0.0"
+ dependencies:
+ "caller-path" "^2.0.0"
+ "resolve-from" "^3.0.0"
+
+"import-fresh@^3.0.0", "import-fresh@^3.2.1":
+ "integrity" "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw=="
+ "resolved" "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz"
+ "version" "3.3.0"
+ dependencies:
+ "parent-module" "^1.0.0"
+ "resolve-from" "^4.0.0"
+
+"import-lazy@^3.1.0":
+ "integrity" "sha512-8/gvXvX2JMn0F+CDlSC4l6kOmVaLOO3XLkksI7CI3Ud95KDYJuYur2b9P/PUt/i/pDAMd/DulQsNbbbmRRsDIQ=="
+ "resolved" "https://registry.npmjs.org/import-lazy/-/import-lazy-3.1.0.tgz"
+ "version" "3.1.0"
+
+"import-local@^2.0.0":
+ "integrity" "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ=="
+ "resolved" "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz"
+ "version" "2.0.0"
+ dependencies:
+ "pkg-dir" "^3.0.0"
+ "resolve-cwd" "^2.0.0"
+
+"imurmurhash@^0.1.4":
+ "integrity" "sha1-khi5srkoojixPcT7a21XbyMUU+o="
+ "resolved" "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz"
+ "version" "0.1.4"
+
+"indent-string@^3.0.0":
+ "integrity" "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok="
+ "resolved" "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz"
+ "version" "3.2.0"
+
+"indent-string@^4.0.0":
+ "integrity" "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg=="
+ "resolved" "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz"
+ "version" "4.0.0"
+
+"indexes-of@^1.0.1":
+ "integrity" "sha1-8w9xbI4r00bHtn0985FVZqfAVgc="
+ "resolved" "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz"
+ "version" "1.0.1"
+
+"infer-owner@^1.0.3", "infer-owner@^1.0.4":
+ "integrity" "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A=="
+ "resolved" "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz"
+ "version" "1.0.4"
+
+"inflight@^1.0.4":
+ "integrity" "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk="
+ "resolved" "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz"
+ "version" "1.0.6"
+ dependencies:
+ "once" "^1.3.0"
+ "wrappy" "1"
+
+"inherits@^2.0.0", "inherits@^2.0.1", "inherits@^2.0.3", "inherits@^2.0.4", "inherits@~2.0.1", "inherits@~2.0.3", "inherits@2", "inherits@2.0.4":
+ "integrity" "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
+ "resolved" "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz"
+ "version" "2.0.4"
+
+"inherits@2.0.1":
+ "integrity" "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE="
+ "resolved" "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
+ "version" "2.0.1"
+
+"inherits@2.0.3":
+ "integrity" "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
+ "resolved" "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz"
+ "version" "2.0.3"
+
+"inquirer@^7.0.0":
+ "integrity" "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA=="
+ "resolved" "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz"
+ "version" "7.3.3"
+ dependencies:
+ "ansi-escapes" "^4.2.1"
+ "chalk" "^4.1.0"
+ "cli-cursor" "^3.1.0"
+ "cli-width" "^3.0.0"
+ "external-editor" "^3.0.3"
+ "figures" "^3.0.0"
+ "lodash" "^4.17.19"
+ "mute-stream" "0.0.8"
+ "run-async" "^2.4.0"
+ "rxjs" "^6.6.0"
+ "string-width" "^4.1.0"
+ "strip-ansi" "^6.0.0"
+ "through" "^2.3.6"
+
+"internal-ip@^4.3.0":
+ "integrity" "sha512-S1zBo1D6zcsyuC6PMmY5+55YMILQ9av8lotMx447Bq6SAgo/sDK6y6uUKmuYhW7eacnIhFfsPmCNYdDzsnnDCg=="
+ "resolved" "https://registry.npmjs.org/internal-ip/-/internal-ip-4.3.0.tgz"
+ "version" "4.3.0"
+ dependencies:
+ "default-gateway" "^4.2.0"
+ "ipaddr.js" "^1.9.0"
+
+"internal-slot@^1.0.3":
+ "integrity" "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA=="
+ "resolved" "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz"
+ "version" "1.0.3"
+ dependencies:
+ "get-intrinsic" "^1.1.0"
+ "has" "^1.0.3"
+ "side-channel" "^1.0.4"
+
+"intersection-observer@^0.7.0":
+ "integrity" "sha512-Id0Fij0HsB/vKWGeBe9PxeY45ttRiBmhFyyt/geBdDHBYNctMRTE3dC1U3ujzz3lap+hVXlEcVaB56kZP/eEUg=="
+ "resolved" "https://registry.npmjs.org/intersection-observer/-/intersection-observer-0.7.0.tgz"
+ "version" "0.7.0"
+
+"inversify@5.1.1":
+ "integrity" "sha512-j8grHGDzv1v+8T1sAQ+3boTCntFPfvxLCkNcxB1J8qA0lUN+fAlSyYd+RXKvaPRL4AGyPxViutBEJHNXOyUdFQ=="
+ "resolved" "https://registry.npmjs.org/inversify/-/inversify-5.1.1.tgz"
+ "version" "5.1.1"
+
+"ip-regex@^2.1.0":
+ "integrity" "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk="
+ "resolved" "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz"
+ "version" "2.1.0"
+
+"ip@^1.1.0", "ip@^1.1.5":
+ "integrity" "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo="
+ "resolved" "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz"
+ "version" "1.1.5"
+
+"ipaddr.js@^1.9.0", "ipaddr.js@1.9.1":
+ "integrity" "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
+ "resolved" "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz"
+ "version" "1.9.1"
+
+"is-absolute-url@^3.0.3":
+ "integrity" "sha512-opmNIX7uFnS96NtPmhWQgQx6/NYFgsUXYMllcfzwWKUMwfo8kku1TvE6hkNcH+Q1ts5cMVrsY7j0bxXQDciu9Q=="
+ "resolved" "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-3.0.3.tgz"
+ "version" "3.0.3"
+
+"is-accessor-descriptor@^0.1.6":
+ "integrity" "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY="
+ "resolved" "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz"
+ "version" "0.1.6"
+ dependencies:
+ "kind-of" "^3.0.2"
+
+"is-accessor-descriptor@^1.0.0":
+ "integrity" "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ=="
+ "resolved" "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz"
+ "version" "1.0.0"
+ dependencies:
+ "kind-of" "^6.0.0"
+
+"is-alphabetical@^1.0.0":
+ "integrity" "sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg=="
+ "resolved" "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz"
+ "version" "1.0.4"
+
+"is-alphanumeric@^1.0.0":
+ "integrity" "sha1-Spzvcdr0wAHB2B1j0UDPU/1oifQ="
+ "resolved" "https://registry.npmjs.org/is-alphanumeric/-/is-alphanumeric-1.0.0.tgz"
+ "version" "1.0.0"
+
+"is-alphanumerical@^1.0.0":
+ "integrity" "sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A=="
+ "resolved" "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz"
+ "version" "1.0.4"
+ dependencies:
+ "is-alphabetical" "^1.0.0"
+ "is-decimal" "^1.0.0"
+
+"is-arguments@^1.0.4":
+ "integrity" "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA=="
+ "resolved" "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz"
+ "version" "1.1.1"
+ dependencies:
+ "call-bind" "^1.0.2"
+ "has-tostringtag" "^1.0.0"
+
+"is-arrayish@^0.2.1":
+ "integrity" "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0="
+ "resolved" "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz"
+ "version" "0.2.1"
+
+"is-bigint@^1.0.1":
+ "integrity" "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg=="
+ "resolved" "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz"
+ "version" "1.0.4"
+ dependencies:
+ "has-bigints" "^1.0.1"
+
+"is-binary-path@^1.0.0":
+ "integrity" "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg="
+ "resolved" "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz"
+ "version" "1.0.1"
+ dependencies:
+ "binary-extensions" "^1.0.0"
+
+"is-binary-path@~2.1.0":
+ "integrity" "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw=="
+ "resolved" "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz"
+ "version" "2.1.0"
+ dependencies:
+ "binary-extensions" "^2.0.0"
+
+"is-boolean-object@^1.1.0":
+ "integrity" "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA=="
+ "resolved" "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz"
+ "version" "1.1.2"
+ dependencies:
+ "call-bind" "^1.0.2"
+ "has-tostringtag" "^1.0.0"
+
+"is-buffer@^1.1.4", "is-buffer@^1.1.5", "is-buffer@~1.1.6":
+ "integrity" "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
+ "resolved" "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz"
+ "version" "1.1.6"
+
+"is-callable@^1.1.4", "is-callable@^1.2.4":
+ "integrity" "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w=="
+ "resolved" "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz"
+ "version" "1.2.4"
+
+"is-core-module@^2.2.0", "is-core-module@^2.8.1":
+ "integrity" "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA=="
+ "resolved" "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz"
+ "version" "2.8.1"
+ dependencies:
+ "has" "^1.0.3"
+
+"is-data-descriptor@^0.1.4":
+ "integrity" "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y="
+ "resolved" "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz"
+ "version" "0.1.4"
+ dependencies:
+ "kind-of" "^3.0.2"
+
+"is-data-descriptor@^1.0.0":
+ "integrity" "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ=="
+ "resolved" "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz"
+ "version" "1.0.0"
+ dependencies:
+ "kind-of" "^6.0.0"
+
+"is-date-object@^1.0.1":
+ "integrity" "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ=="
+ "resolved" "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz"
+ "version" "1.0.5"
+ dependencies:
+ "has-tostringtag" "^1.0.0"
+
+"is-decimal@^1.0.0":
+ "integrity" "sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw=="
+ "resolved" "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz"
+ "version" "1.0.4"
+
+"is-descriptor@^0.1.0":
+ "integrity" "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg=="
+ "resolved" "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz"
+ "version" "0.1.6"
+>>>>>>> d7b4e57 (登录封装)
dependencies:
kind-of "^6.0.0"
@@ -7550,6 +8181,7 @@ parse-json@^5.0.0:
integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==
dependencies:
"@babel/code-frame" "^7.0.0"
+<<<<<<< HEAD
error-ex "^1.3.1"
json-parse-even-better-errors "^2.3.0"
lines-and-columns "^1.1.6"
@@ -8365,6 +8997,941 @@ regenerator-transform@^0.14.2:
version "0.14.5"
resolved "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz"
integrity sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==
+=======
+ "error-ex" "^1.3.1"
+ "json-parse-even-better-errors" "^2.3.0"
+ "lines-and-columns" "^1.1.6"
+
+"parse-node-version@^1.0.1":
+ "integrity" "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA=="
+ "resolved" "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz"
+ "version" "1.0.1"
+
+"parse5@5.1.0":
+ "integrity" "sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ=="
+ "resolved" "https://registry.npmjs.org/parse5/-/parse5-5.1.0.tgz"
+ "version" "5.1.0"
+
+"parseurl@~1.3.2", "parseurl@~1.3.3":
+ "integrity" "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="
+ "resolved" "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz"
+ "version" "1.3.3"
+
+"pascalcase@^0.1.1":
+ "integrity" "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ="
+ "resolved" "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz"
+ "version" "0.1.1"
+
+"path-browserify@0.0.1":
+ "integrity" "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ=="
+ "resolved" "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz"
+ "version" "0.0.1"
+
+"path-dirname@^1.0.0":
+ "integrity" "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA="
+ "resolved" "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz"
+ "version" "1.0.2"
+
+"path-exists@^3.0.0":
+ "integrity" "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU="
+ "resolved" "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz"
+ "version" "3.0.0"
+
+"path-exists@^4.0.0":
+ "integrity" "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="
+ "resolved" "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz"
+ "version" "4.0.0"
+
+"path-is-absolute@^1.0.0":
+ "integrity" "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
+ "resolved" "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz"
+ "version" "1.0.1"
+
+"path-is-inside@^1.0.2":
+ "integrity" "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM="
+ "resolved" "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz"
+ "version" "1.0.2"
+
+"path-key@^2.0.0", "path-key@^2.0.1":
+ "integrity" "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A="
+ "resolved" "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz"
+ "version" "2.0.1"
+
+"path-key@^3.1.0":
+ "integrity" "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="
+ "resolved" "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz"
+ "version" "3.1.1"
+
+"path-parse@^1.0.6", "path-parse@^1.0.7":
+ "integrity" "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
+ "resolved" "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz"
+ "version" "1.0.7"
+
+"path-to-regexp@^3.1.0":
+ "integrity" "sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA=="
+ "resolved" "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.2.0.tgz"
+ "version" "3.2.0"
+
+"path-to-regexp@0.1.7":
+ "integrity" "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
+ "resolved" "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz"
+ "version" "0.1.7"
+
+"path-type@^3.0.0":
+ "integrity" "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg=="
+ "resolved" "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz"
+ "version" "3.0.0"
+ dependencies:
+ "pify" "^3.0.0"
+
+"path-type@^4.0.0":
+ "integrity" "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw=="
+ "resolved" "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz"
+ "version" "4.0.0"
+
+"pbkdf2@^3.0.3":
+ "integrity" "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA=="
+ "resolved" "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz"
+ "version" "3.1.2"
+ dependencies:
+ "create-hash" "^1.1.2"
+ "create-hmac" "^1.1.4"
+ "ripemd160" "^2.0.1"
+ "safe-buffer" "^5.0.1"
+ "sha.js" "^2.4.8"
+
+"pend@~1.2.0":
+ "integrity" "sha1-elfrVQpng/kRUzH89GY9XI4AelA="
+ "resolved" "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz"
+ "version" "1.2.0"
+
+"performance-now@^2.1.0":
+ "integrity" "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
+ "resolved" "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz"
+ "version" "2.1.0"
+
+"picocolors@^0.2.1":
+ "integrity" "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA=="
+ "resolved" "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz"
+ "version" "0.2.1"
+
+"picocolors@^1.0.0":
+ "integrity" "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ=="
+ "resolved" "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz"
+ "version" "1.0.0"
+
+"picomatch@^2.0.4", "picomatch@^2.0.7", "picomatch@^2.2.1", "picomatch@^2.3.1":
+ "integrity" "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="
+ "resolved" "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz"
+ "version" "2.3.1"
+
+"pify@^2.0.0":
+ "integrity" "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
+ "resolved" "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz"
+ "version" "2.3.0"
+
+"pify@^2.3.0":
+ "integrity" "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
+ "resolved" "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz"
+ "version" "2.3.0"
+
+"pify@^3.0.0":
+ "integrity" "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY="
+ "resolved" "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz"
+ "version" "3.0.0"
+
+"pify@^4.0.1":
+ "integrity" "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g=="
+ "resolved" "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz"
+ "version" "4.0.1"
+
+"pinkie-promise@^2.0.0":
+ "integrity" "sha1-ITXW36ejWMBprJsXh3YogihFD/o="
+ "resolved" "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz"
+ "version" "2.0.1"
+ dependencies:
+ "pinkie" "^2.0.0"
+
+"pinkie@^2.0.0":
+ "integrity" "sha1-clVrgM+g1IqXToDnckjoDtT3+HA="
+ "resolved" "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz"
+ "version" "2.0.4"
+
+"pirates@^4.0.0":
+ "integrity" "sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ=="
+ "resolved" "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz"
+ "version" "4.0.5"
+
+"pkg-dir@^3.0.0":
+ "integrity" "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw=="
+ "resolved" "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz"
+ "version" "3.0.0"
+ dependencies:
+ "find-up" "^3.0.0"
+
+"pkg-dir@^4.1.0":
+ "integrity" "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ=="
+ "resolved" "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz"
+ "version" "4.2.0"
+ dependencies:
+ "find-up" "^4.0.0"
+
+"pn@^1.1.0":
+ "integrity" "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA=="
+ "resolved" "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz"
+ "version" "1.1.0"
+
+"portfinder@^1.0.26":
+ "integrity" "sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA=="
+ "resolved" "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz"
+ "version" "1.0.28"
+ dependencies:
+ "async" "^2.6.2"
+ "debug" "^3.1.1"
+ "mkdirp" "^0.5.5"
+
+"posix-character-classes@^0.1.0":
+ "integrity" "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs="
+ "resolved" "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz"
+ "version" "0.1.1"
+
+"postcss-html-transform@3.3.10":
+ "integrity" "sha512-WVbSe4CmzI9FoGZUaMQUM4H6LR61jhr1aE4iSf74Iv3g8YAzrfSrQD78WjpiLYOF9XPR9vpVAbY38c8jB+YOxQ=="
+ "resolved" "https://registry.npmjs.org/postcss-html-transform/-/postcss-html-transform-3.3.10.tgz"
+ "version" "3.3.10"
+ dependencies:
+ "postcss" "^6.0.22"
+
+"postcss-html@^0.28.0":
+ "integrity" "sha512-H+ucbGVR+lsZySspOApeQU9yC6Q3t75lwJYa3Im93fKAUt5DScKOSErShC0aC7USdn2jsT1LxubcC5vYu/VJYw=="
+ "resolved" "https://registry.npmjs.org/postcss-html/-/postcss-html-0.28.0.tgz"
+ "version" "0.28.0"
+ dependencies:
+ "htmlparser2" "^3.9.2"
+
+"postcss-import@12.0.1":
+ "integrity" "sha512-3Gti33dmCjyKBgimqGxL3vcV8w9+bsHwO5UrBawp796+jdardbcFl4RP5w/76BwNL7aGzpKstIfF9I+kdE8pTw=="
+ "resolved" "https://registry.npmjs.org/postcss-import/-/postcss-import-12.0.1.tgz"
+ "version" "12.0.1"
+ dependencies:
+ "postcss" "^7.0.1"
+ "postcss-value-parser" "^3.2.3"
+ "read-cache" "^1.0.0"
+ "resolve" "^1.1.7"
+
+"postcss-less@^2.0.0":
+ "integrity" "sha512-pPNsVnpCB13nBMOcl5GVh8JGmB0JGFjqkLUDzKdVpptFFKEe9wFdEzvh2j4lD2AD+7qcrUfw9Ta+oi5+Fw7jjQ=="
+ "resolved" "https://registry.npmjs.org/postcss-less/-/postcss-less-2.0.0.tgz"
+ "version" "2.0.0"
+ dependencies:
+ "postcss" "^5.2.16"
+
+"postcss-loader@4.3.0":
+ "integrity" "sha512-M/dSoIiNDOo8Rk0mUqoj4kpGq91gcxCfb9PoyZVdZ76/AuhxylHDYZblNE8o+EQ9AMSASeMFEKxZf5aU6wlx1Q=="
+ "resolved" "https://registry.npmjs.org/postcss-loader/-/postcss-loader-4.3.0.tgz"
+ "version" "4.3.0"
+ dependencies:
+ "cosmiconfig" "^7.0.0"
+ "klona" "^2.0.4"
+ "loader-utils" "^2.0.0"
+ "schema-utils" "^3.0.0"
+ "semver" "^7.3.4"
+
+"postcss-markdown@^0.28.0":
+ "integrity" "sha512-F0Vc8eHKDKTmensntXpd35LSAoXXtykhPY+IRfn4AnN4m+irav3QawmtSWLhsmbElKna8l1/HObYnbiM/Wok9Q=="
+ "resolved" "https://registry.npmjs.org/postcss-markdown/-/postcss-markdown-0.28.0.tgz"
+ "version" "0.28.0"
+ dependencies:
+ "remark" "^9.0.0"
+ "unist-util-find-all-after" "^1.0.2"
+
+"postcss-media-query-parser@^0.2.3":
+ "integrity" "sha1-J7Ocb02U+Bsac7j3Y1HGCeXO8kQ="
+ "resolved" "https://registry.npmjs.org/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz"
+ "version" "0.2.3"
+
+"postcss-modules-extract-imports@^2.0.0":
+ "integrity" "sha512-LaYLDNS4SG8Q5WAWqIJgdHPJrDDr/Lv775rMBFUbgjTz6j34lUznACHcdRWroPvXANP2Vj7yNK57vp9eFqzLWQ=="
+ "resolved" "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-2.0.0.tgz"
+ "version" "2.0.0"
+ dependencies:
+ "postcss" "^7.0.5"
+
+"postcss-modules-local-by-default@^3.0.2":
+ "integrity" "sha512-e3xDq+LotiGesympRlKNgaJ0PCzoUIdpH0dj47iWAui/kyTgh3CiAr1qP54uodmJhl6p9rN6BoNcdEDVJx9RDw=="
+ "resolved" "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.3.tgz"
+ "version" "3.0.3"
+ dependencies:
+ "icss-utils" "^4.1.1"
+ "postcss" "^7.0.32"
+ "postcss-selector-parser" "^6.0.2"
+ "postcss-value-parser" "^4.1.0"
+
+"postcss-modules-scope@^2.1.1", "postcss-modules-scope@^2.2.0":
+ "integrity" "sha512-YyEgsTMRpNd+HmyC7H/mh3y+MeFWevy7V1evVhJWewmMbjDHIbZbOXICC2y+m1xI1UVfIT1HMW/O04Hxyu9oXQ=="
+ "resolved" "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-2.2.0.tgz"
+ "version" "2.2.0"
+ dependencies:
+ "postcss" "^7.0.6"
+ "postcss-selector-parser" "^6.0.0"
+
+"postcss-modules-values@^3.0.0":
+ "integrity" "sha512-1//E5jCBrZ9DmRX+zCtmQtRSV6PV42Ix7Bzj9GbwJceduuf7IqP8MgeTXuRDHOWj2m0VzZD5+roFWDuU8RQjcg=="
+ "resolved" "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-3.0.0.tgz"
+ "version" "3.0.0"
+ dependencies:
+ "icss-utils" "^4.0.0"
+ "postcss" "^7.0.6"
+
+"postcss-plugin-constparse@3.3.10":
+ "integrity" "sha512-fVwKKX/S8IT0n8CU6f2b2MAUxQ9LHUnOxKGv+Amtt10cB2fIgB02WuXD9XoITEyG2q0TdJ1VESgnUF6/VxqUAw=="
+ "resolved" "https://registry.npmjs.org/postcss-plugin-constparse/-/postcss-plugin-constparse-3.3.10.tgz"
+ "version" "3.3.10"
+ dependencies:
+ "postcss" "^6.0.22"
+
+"postcss-pxtorem@^4.0.1":
+ "integrity" "sha1-nGTQ7+SIVHPMHLAwXG/8PrtFsc0="
+ "resolved" "https://registry.npmjs.org/postcss-pxtorem/-/postcss-pxtorem-4.0.1.tgz"
+ "version" "4.0.1"
+ dependencies:
+ "object-assign" "^4.1.0"
+ "postcss" "^5.2.10"
+
+"postcss-pxtransform@3.3.10":
+ "integrity" "sha512-PBTHjah1CZXMBLYNAqTGj/c4eYoY7MZ0mGBhZwv4c/Lbe6fcTU4sN/dYWotjnvHVcUmxe2wmzQcw6kI5PwlltQ=="
+ "resolved" "https://registry.npmjs.org/postcss-pxtransform/-/postcss-pxtransform-3.3.10.tgz"
+ "version" "3.3.10"
+ dependencies:
+ "postcss" "^6.0.16"
+ "postcss-pxtorem" "^4.0.1"
+
+"postcss-reporter@^5.0.0":
+ "integrity" "sha512-rBkDbaHAu5uywbCR2XE8a25tats3xSOsGNx6mppK6Q9kSFGKc/FyAzfci+fWM2l+K402p1D0pNcfDGxeje5IKg=="
+ "resolved" "https://registry.npmjs.org/postcss-reporter/-/postcss-reporter-5.0.0.tgz"
+ "version" "5.0.0"
+ dependencies:
+ "chalk" "^2.0.1"
+ "lodash" "^4.17.4"
+ "log-symbols" "^2.0.0"
+ "postcss" "^6.0.8"
+
+"postcss-resolve-nested-selector@^0.1.1":
+ "integrity" "sha1-Kcy8fDfe36wwTp//C/FZaz9qDk4="
+ "resolved" "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz"
+ "version" "0.1.1"
+
+"postcss-safe-parser@^3.0.1":
+ "integrity" "sha1-t1Pv9sfArqXoN1++TN6L+QY/8UI="
+ "resolved" "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-3.0.1.tgz"
+ "version" "3.0.1"
+ dependencies:
+ "postcss" "^6.0.6"
+
+"postcss-sass@^0.3.0":
+ "integrity" "sha512-B5z2Kob4xBxFjcufFnhQ2HqJQ2y/Zs/ic5EZbCywCkxKd756Q40cIQ/veRDwSrw1BF6+4wUgmpm0sBASqVi65A=="
+ "resolved" "https://registry.npmjs.org/postcss-sass/-/postcss-sass-0.3.5.tgz"
+ "version" "0.3.5"
+ dependencies:
+ "gonzales-pe" "^4.2.3"
+ "postcss" "^7.0.1"
+
+"postcss-scss@^1.0.2":
+ "integrity" "sha512-4EFYGHcEw+H3E06PT/pQQri06u/1VIIPjeJQaM8skB80vZuXMhp4cSNV5azmdNkontnOID/XYWEvEEELLFB1ww=="
+ "resolved" "https://registry.npmjs.org/postcss-scss/-/postcss-scss-1.0.6.tgz"
+ "version" "1.0.6"
+ dependencies:
+ "postcss" "^6.0.23"
+
+"postcss-selector-parser@^3.1.0":
+ "integrity" "sha512-h7fJ/5uWuRVyOtkO45pnt1Ih40CEleeyCHzipqAZO2e5H20g25Y48uYnFUiShvY4rZWNJ/Bib/KVPmanaCtOhA=="
+ "resolved" "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.2.tgz"
+ "version" "3.1.2"
+ dependencies:
+ "dot-prop" "^5.2.0"
+ "indexes-of" "^1.0.1"
+ "uniq" "^1.0.1"
+
+"postcss-selector-parser@^6.0.0", "postcss-selector-parser@^6.0.2":
+ "integrity" "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w=="
+ "resolved" "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz"
+ "version" "6.0.10"
+ dependencies:
+ "cssesc" "^3.0.0"
+ "util-deprecate" "^1.0.2"
+
+"postcss-syntax@^0.28.0", "postcss-syntax@>=0.28.0":
+ "integrity" "sha512-9W3T1fSE9QWKyW6s84kZapv0BP5uvj7mNBp34kwI93uGWULzZjaKv4xR4phubBD53cRgaM/qnvquVK1KLsl+Kg=="
+ "resolved" "https://registry.npmjs.org/postcss-syntax/-/postcss-syntax-0.28.0.tgz"
+ "version" "0.28.0"
+
+"postcss-url@8.0.0":
+ "integrity" "sha512-E2cbOQ5aii2zNHh8F6fk1cxls7QVFZjLPSrqvmiza8OuXLzIpErij8BDS5Y3STPfJgpIMNCPEr8JlKQWEoozUw=="
+ "resolved" "https://registry.npmjs.org/postcss-url/-/postcss-url-8.0.0.tgz"
+ "version" "8.0.0"
+ dependencies:
+ "mime" "^2.3.1"
+ "minimatch" "^3.0.4"
+ "mkdirp" "^0.5.0"
+ "postcss" "^7.0.2"
+ "xxhashjs" "^0.2.1"
+
+"postcss-value-parser@^3.2.3", "postcss-value-parser@^3.3.0":
+ "integrity" "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ=="
+ "resolved" "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz"
+ "version" "3.3.1"
+
+"postcss-value-parser@^4.0.2":
+ "integrity" "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ=="
+ "resolved" "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz"
+ "version" "4.2.0"
+
+"postcss-value-parser@^4.1.0":
+ "integrity" "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ=="
+ "resolved" "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz"
+ "version" "4.2.0"
+
+"postcss@^5.2.10":
+ "integrity" "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg=="
+ "resolved" "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz"
+ "version" "5.2.18"
+ dependencies:
+ "chalk" "^1.1.3"
+ "js-base64" "^2.1.9"
+ "source-map" "^0.5.6"
+ "supports-color" "^3.2.3"
+
+"postcss@^5.2.16":
+ "integrity" "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg=="
+ "resolved" "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz"
+ "version" "5.2.18"
+ dependencies:
+ "chalk" "^1.1.3"
+ "js-base64" "^2.1.9"
+ "source-map" "^0.5.6"
+ "supports-color" "^3.2.3"
+
+"postcss@^6.0.14":
+ "integrity" "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag=="
+ "resolved" "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz"
+ "version" "6.0.23"
+ dependencies:
+ "chalk" "^2.4.1"
+ "source-map" "^0.6.1"
+ "supports-color" "^5.4.0"
+
+"postcss@^6.0.16", "postcss@^6.0.23", "postcss@>=5.0.0":
+ "integrity" "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag=="
+ "resolved" "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz"
+ "version" "6.0.23"
+ dependencies:
+ "chalk" "^2.4.1"
+ "source-map" "^0.6.1"
+ "supports-color" "^5.4.0"
+
+"postcss@^6.0.22":
+ "integrity" "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag=="
+ "resolved" "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz"
+ "version" "6.0.23"
+ dependencies:
+ "chalk" "^2.4.1"
+ "source-map" "^0.6.1"
+ "supports-color" "^5.4.0"
+
+"postcss@^6.0.6":
+ "integrity" "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag=="
+ "resolved" "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz"
+ "version" "6.0.23"
+ dependencies:
+ "chalk" "^2.4.1"
+ "source-map" "^0.6.1"
+ "supports-color" "^5.4.0"
+
+"postcss@^6.0.8":
+ "integrity" "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag=="
+ "resolved" "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz"
+ "version" "6.0.23"
+ dependencies:
+ "chalk" "^2.4.1"
+ "source-map" "^0.6.1"
+ "supports-color" "^5.4.0"
+
+"postcss@^7.0.0 || ^8.0.1", "postcss@8.3.5":
+ "integrity" "sha512-NxTuJocUhYGsMiMFHDUkmjSKT3EdH4/WbGF6GCi1NDGk+vbcUTun4fpbOqaPtD8IIsztA2ilZm2DhYCuyN58gA=="
+ "resolved" "https://registry.npmjs.org/postcss/-/postcss-8.3.5.tgz"
+ "version" "8.3.5"
+ dependencies:
+ "colorette" "^1.2.2"
+ "nanoid" "^3.1.23"
+ "source-map-js" "^0.6.2"
+
+"postcss@^7.0.1", "postcss@^7.0.14", "postcss@^7.0.2", "postcss@^7.0.23", "postcss@^7.0.26", "postcss@^7.0.32", "postcss@^7.0.5", "postcss@^7.0.6":
+ "integrity" "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA=="
+ "resolved" "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz"
+ "version" "7.0.39"
+ dependencies:
+ "picocolors" "^0.2.1"
+ "source-map" "^0.6.1"
+
+"postcss@^7.0.35":
+ "integrity" "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA=="
+ "resolved" "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz"
+ "version" "7.0.39"
+ dependencies:
+ "picocolors" "^0.2.1"
+ "source-map" "^0.6.1"
+
+"postcss@7.0.21":
+ "integrity" "sha512-uIFtJElxJo29QC753JzhidoAhvp/e/Exezkdhfmt8AymWT6/5B7W1WmponYWkHk2eg6sONyTch0A3nkMPun3SQ=="
+ "resolved" "https://registry.npmjs.org/postcss/-/postcss-7.0.21.tgz"
+ "version" "7.0.21"
+ dependencies:
+ "chalk" "^2.4.2"
+ "source-map" "^0.6.1"
+ "supports-color" "^6.1.0"
+
+"prelude-ls@~1.1.2":
+ "integrity" "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ="
+ "resolved" "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz"
+ "version" "1.1.2"
+
+"prepend-http@^1.0.0":
+ "integrity" "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw="
+ "resolved" "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz"
+ "version" "1.0.4"
+
+"preserve@^0.2.0":
+ "integrity" "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks="
+ "resolved" "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz"
+ "version" "0.2.0"
+
+"pretty-bytes@^5.3.0":
+ "integrity" "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg=="
+ "resolved" "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz"
+ "version" "5.6.0"
+
+"pretty-error@^2.0.2":
+ "integrity" "sha512-EY5oDzmsX5wvuynAByrmY0P0hcp+QpnAKbJng2A2MPjVKXCxrDSUkzghVJ4ZGPIv+JC4gX8fPUWscC0RtjsWGw=="
+ "resolved" "https://registry.npmjs.org/pretty-error/-/pretty-error-2.1.2.tgz"
+ "version" "2.1.2"
+ dependencies:
+ "lodash" "^4.17.20"
+ "renderkid" "^2.0.4"
+
+"process-nextick-args@~2.0.0":
+ "integrity" "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
+ "resolved" "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz"
+ "version" "2.0.1"
+
+"process@^0.11.10":
+ "integrity" "sha1-czIwDoQBYb2j5podHZGn1LwW8YI="
+ "resolved" "https://registry.npmjs.org/process/-/process-0.11.10.tgz"
+ "version" "0.11.10"
+
+"progress@^2.0.0":
+ "integrity" "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA=="
+ "resolved" "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz"
+ "version" "2.0.3"
+
+"promise-inflight@^1.0.1":
+ "integrity" "sha1-mEcocL8igTL8vdhoEputEsPAKeM="
+ "resolved" "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz"
+ "version" "1.0.1"
+
+"prop-types@^15.8.1":
+ "integrity" "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg=="
+ "resolved" "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz"
+ "version" "15.8.1"
+ dependencies:
+ "loose-envify" "^1.4.0"
+ "object-assign" "^4.1.1"
+ "react-is" "^16.13.1"
+
+"proxy-addr@~2.0.7":
+ "integrity" "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg=="
+ "resolved" "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz"
+ "version" "2.0.7"
+ dependencies:
+ "forwarded" "0.2.0"
+ "ipaddr.js" "1.9.1"
+
+"prr@~1.0.1":
+ "integrity" "sha1-0/wRS6BplaRexok/SEzrHXj19HY="
+ "resolved" "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz"
+ "version" "1.0.1"
+
+"psl@^1.1.28":
+ "integrity" "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ=="
+ "resolved" "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz"
+ "version" "1.8.0"
+
+"public-encrypt@^4.0.0":
+ "integrity" "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q=="
+ "resolved" "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz"
+ "version" "4.0.3"
+ dependencies:
+ "bn.js" "^4.1.0"
+ "browserify-rsa" "^4.0.0"
+ "create-hash" "^1.1.0"
+ "parse-asn1" "^5.0.0"
+ "randombytes" "^2.0.1"
+ "safe-buffer" "^5.1.2"
+
+"pump@^2.0.0":
+ "integrity" "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA=="
+ "resolved" "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz"
+ "version" "2.0.1"
+ dependencies:
+ "end-of-stream" "^1.1.0"
+ "once" "^1.3.1"
+
+"pump@^3.0.0":
+ "integrity" "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww=="
+ "resolved" "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz"
+ "version" "3.0.0"
+ dependencies:
+ "end-of-stream" "^1.1.0"
+ "once" "^1.3.1"
+
+"pumpify@^1.3.3":
+ "integrity" "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ=="
+ "resolved" "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz"
+ "version" "1.5.1"
+ dependencies:
+ "duplexify" "^3.6.0"
+ "inherits" "^2.0.3"
+ "pump" "^2.0.0"
+
+"punycode@^1.2.4":
+ "integrity" "sha1-wNWmOycYgArY4esPpSachN1BhF4="
+ "resolved" "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz"
+ "version" "1.4.1"
+
+"punycode@^2.1.0", "punycode@^2.1.1":
+ "integrity" "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
+ "resolved" "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz"
+ "version" "2.1.1"
+
+"punycode@1.3.2":
+ "integrity" "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0="
+ "resolved" "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz"
+ "version" "1.3.2"
+
+"qs@^6.10.3":
+ "integrity" "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ=="
+ "resolved" "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz"
+ "version" "6.10.3"
+ dependencies:
+ "side-channel" "^1.0.4"
+
+"qs@~6.5.2":
+ "integrity" "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA=="
+ "resolved" "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz"
+ "version" "6.5.3"
+
+"qs@6.9.7":
+ "integrity" "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw=="
+ "resolved" "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz"
+ "version" "6.9.7"
+
+"query-string@^4.1.0":
+ "integrity" "sha1-u7aTucqRXCMlFbIosaArYJBD2+s="
+ "resolved" "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz"
+ "version" "4.3.4"
+ dependencies:
+ "object-assign" "^4.1.0"
+ "strict-uri-encode" "^1.0.0"
+
+"query-string@^6.13.8":
+ "integrity" "sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw=="
+ "resolved" "https://registry.npmjs.org/query-string/-/query-string-6.14.1.tgz"
+ "version" "6.14.1"
+ dependencies:
+ "decode-uri-component" "^0.2.0"
+ "filter-obj" "^1.1.0"
+ "split-on-first" "^1.0.0"
+ "strict-uri-encode" "^2.0.0"
+
+"querystring-es3@^0.2.0":
+ "integrity" "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM="
+ "resolved" "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz"
+ "version" "0.2.1"
+
+"querystring@^0.2.0":
+ "integrity" "sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg=="
+ "resolved" "https://registry.npmjs.org/querystring/-/querystring-0.2.1.tgz"
+ "version" "0.2.1"
+
+"querystring@0.2.0":
+ "integrity" "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA="
+ "resolved" "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz"
+ "version" "0.2.0"
+
+"querystringify@^2.1.1":
+ "integrity" "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ=="
+ "resolved" "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz"
+ "version" "2.2.0"
+
+"queue-microtask@^1.2.2":
+ "integrity" "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="
+ "resolved" "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz"
+ "version" "1.2.3"
+
+"quick-lru@^1.0.0":
+ "integrity" "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g="
+ "resolved" "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz"
+ "version" "1.1.0"
+
+"raf@^3.4.1":
+ "integrity" "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA=="
+ "resolved" "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz"
+ "version" "3.4.1"
+ dependencies:
+ "performance-now" "^2.1.0"
+
+"randomatic@^3.0.0":
+ "integrity" "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw=="
+ "resolved" "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz"
+ "version" "3.1.1"
+ dependencies:
+ "is-number" "^4.0.0"
+ "kind-of" "^6.0.0"
+ "math-random" "^1.0.1"
+
+"randombytes@^2.0.0", "randombytes@^2.0.1", "randombytes@^2.0.5", "randombytes@^2.1.0":
+ "integrity" "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ=="
+ "resolved" "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz"
+ "version" "2.1.0"
+ dependencies:
+ "safe-buffer" "^5.1.0"
+
+"randomfill@^1.0.3":
+ "integrity" "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw=="
+ "resolved" "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz"
+ "version" "1.0.4"
+ dependencies:
+ "randombytes" "^2.0.5"
+ "safe-buffer" "^5.1.0"
+
+"range-parser@^1.2.1", "range-parser@~1.2.1":
+ "integrity" "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="
+ "resolved" "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz"
+ "version" "1.2.1"
+
+"raw-body@2.4.3":
+ "integrity" "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g=="
+ "resolved" "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz"
+ "version" "2.4.3"
+ dependencies:
+ "bytes" "3.1.2"
+ "http-errors" "1.8.1"
+ "iconv-lite" "0.4.24"
+ "unpipe" "1.0.0"
+
+"react-dom@^16.8 || ^17.0 || ^18.0", "react-dom@^17.0.0":
+ "integrity" "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA=="
+ "resolved" "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz"
+ "version" "17.0.2"
+ dependencies:
+ "loose-envify" "^1.1.0"
+ "object-assign" "^4.1.1"
+ "scheduler" "^0.20.2"
+
+"react-is@^16.13.1", "react-is@^16.7.0":
+ "integrity" "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
+ "resolved" "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz"
+ "version" "16.13.1"
+
+"react-is@^18.0.0":
+ "integrity" "sha512-yUcBYdBBbo3QiPsgYDcfQcIkGZHfxOaoE6HLSnr1sPzMhdyxusbfKOSUbSd/ocGi32dxcj366PsTj+5oggeKKw=="
+ "resolved" "https://registry.npmjs.org/react-is/-/react-is-18.0.0.tgz"
+ "version" "18.0.0"
+
+"react-reconciler@0.26.1":
+ "integrity" "sha512-6E/CvH9zcDmHjhiNJlP0qJ8+3ufnY2b5RWs774Uy8XKWN0l6qfnlkz0XnDacxqj2rbJdq76w9dlFXjPPOQrmqA=="
+ "resolved" "https://registry.npmjs.org/react-reconciler/-/react-reconciler-0.26.1.tgz"
+ "version" "0.26.1"
+ dependencies:
+ "loose-envify" "^1.1.0"
+ "object-assign" "^4.1.1"
+ "scheduler" "^0.20.1"
+
+"react-redux@^8.0.1":
+ "integrity" "sha512-LMZMsPY4DYdZfLJgd7i79n5Kps5N9XVLCJJeWAaPYTV+Eah2zTuBjTxKtNEbjiyitbq80/eIkm55CYSLqAub3w=="
+ "resolved" "https://registry.npmjs.org/react-redux/-/react-redux-8.0.1.tgz"
+ "version" "8.0.1"
+ dependencies:
+ "@babel/runtime" "^7.12.1"
+ "@types/hoist-non-react-statics" "^3.3.1"
+ "@types/use-sync-external-store" "^0.0.3"
+ "hoist-non-react-statics" "^3.3.2"
+ "react-is" "^18.0.0"
+ "use-sync-external-store" "^1.0.0"
+
+"react-refresh@^0.4.0":
+ "integrity" "sha512-Hwln1VNuGl/6bVwnd0Xdn1e84gT/8T9aYNL+HAKDArLCS7LWjwr7StE30IEYbIkx0Vi3vs+coQxe+SQDbGbbpA=="
+ "resolved" "https://registry.npmjs.org/react-refresh/-/react-refresh-0.4.3.tgz"
+ "version" "0.4.3"
+
+"react-refresh@>=0.8.3 <0.10.0", "react-refresh@0.9.0":
+ "integrity" "sha512-Gvzk7OZpiqKSkxsQvO/mbTN1poglhmAV7gR/DdIrRrSMXraRQQlfikRJOr3Nb9GTMPC5kof948Zy6jJZIFtDvQ=="
+ "resolved" "https://registry.npmjs.org/react-refresh/-/react-refresh-0.9.0.tgz"
+ "version" "0.9.0"
+
+"react@^16.8 || ^17.0 || ^18.0", "react@^16.8.0 || ^17.0.0 || ^18.0.0-rc", "react@^17.0.0", "react@^17.0.1", "react@17.0.2":
+ "integrity" "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA=="
+ "resolved" "https://registry.npmjs.org/react/-/react-17.0.2.tgz"
+ "version" "17.0.2"
+ dependencies:
+ "loose-envify" "^1.1.0"
+ "object-assign" "^4.1.1"
+
+"read-cache@^1.0.0":
+ "integrity" "sha1-5mTvMRYRZsl1HNvo28+GtftY93Q="
+ "resolved" "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz"
+ "version" "1.0.0"
+ dependencies:
+ "pify" "^2.3.0"
+
+"read-pkg-up@^3.0.0":
+ "integrity" "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc="
+ "resolved" "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz"
+ "version" "3.0.0"
+ dependencies:
+ "find-up" "^2.0.0"
+ "read-pkg" "^3.0.0"
+
+"read-pkg@^3.0.0":
+ "integrity" "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k="
+ "resolved" "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz"
+ "version" "3.0.0"
+ dependencies:
+ "load-json-file" "^4.0.0"
+ "normalize-package-data" "^2.3.2"
+ "path-type" "^3.0.0"
+
+"readable-stream@^2.0.0", "readable-stream@^2.0.1", "readable-stream@^2.0.2", "readable-stream@^2.1.5", "readable-stream@^2.2.2", "readable-stream@^2.3.3", "readable-stream@^2.3.6", "readable-stream@~2.3.6", "readable-stream@1 || 2":
+ "integrity" "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw=="
+ "resolved" "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz"
+ "version" "2.3.7"
+ dependencies:
+ "core-util-is" "~1.0.0"
+ "inherits" "~2.0.3"
+ "isarray" "~1.0.0"
+ "process-nextick-args" "~2.0.0"
+ "safe-buffer" "~5.1.1"
+ "string_decoder" "~1.1.1"
+ "util-deprecate" "~1.0.1"
+
+"readable-stream@^3.0.6":
+ "integrity" "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA=="
+ "resolved" "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz"
+ "version" "3.6.0"
+ dependencies:
+ "inherits" "^2.0.3"
+ "string_decoder" "^1.1.1"
+ "util-deprecate" "^1.0.1"
+
+"readable-stream@^3.1.1":
+ "integrity" "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA=="
+ "resolved" "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz"
+ "version" "3.6.0"
+ dependencies:
+ "inherits" "^2.0.3"
+ "string_decoder" "^1.1.1"
+ "util-deprecate" "^1.0.1"
+
+"readable-stream@^3.6.0":
+ "integrity" "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA=="
+ "resolved" "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz"
+ "version" "3.6.0"
+ dependencies:
+ "inherits" "^2.0.3"
+ "string_decoder" "^1.1.1"
+ "util-deprecate" "^1.0.1"
+
+"readdirp@^2.2.1":
+ "integrity" "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ=="
+ "resolved" "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz"
+ "version" "2.2.1"
+ dependencies:
+ "graceful-fs" "^4.1.11"
+ "micromatch" "^3.1.10"
+ "readable-stream" "^2.0.2"
+
+"readdirp@~3.3.0":
+ "integrity" "sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ=="
+ "resolved" "https://registry.npmjs.org/readdirp/-/readdirp-3.3.0.tgz"
+ "version" "3.3.0"
+ dependencies:
+ "picomatch" "^2.0.7"
+
+"readdirp@~3.6.0":
+ "integrity" "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA=="
+ "resolved" "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz"
+ "version" "3.6.0"
+ dependencies:
+ "picomatch" "^2.2.1"
+
+"redent@^2.0.0":
+ "integrity" "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo="
+ "resolved" "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz"
+ "version" "2.0.0"
+ dependencies:
+ "indent-string" "^3.0.0"
+ "strip-indent" "^2.0.0"
+
+"redux-logger@^3.0.6":
+ "integrity" "sha1-91VZZvMJjzyIYExEnPC69XeCdL8="
+ "resolved" "https://registry.npmjs.org/redux-logger/-/redux-logger-3.0.6.tgz"
+ "version" "3.0.6"
+ dependencies:
+ "deep-diff" "^0.3.5"
+
+"redux-thunk@^2.4.1":
+ "integrity" "sha512-OOYGNY5Jy2TWvTL1KgAlVy6dcx3siPJ1wTq741EPyUKfn6W6nChdICjZwCd0p8AZBs5kWpZlbkXW2nE/zjUa+Q=="
+ "resolved" "https://registry.npmjs.org/redux-thunk/-/redux-thunk-2.4.1.tgz"
+ "version" "2.4.1"
+
+"redux@^4", "redux@^4.2.0":
+ "integrity" "sha512-oSBmcKKIuIR4ME29/AeNUnl5L+hvBq7OaJWzaptTQJAntaPvxIJqfnjbaEiCzzaIz+XmVILfqAM3Ob0aXLPfjA=="
+ "resolved" "https://registry.npmjs.org/redux/-/redux-4.2.0.tgz"
+ "version" "4.2.0"
+ dependencies:
+ "@babel/runtime" "^7.9.2"
+
+"reflect-metadata@^0.1.13":
+ "integrity" "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg=="
+ "resolved" "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz"
+ "version" "0.1.13"
+
+"regenerate-unicode-properties@^10.0.1":
+ "integrity" "sha512-vn5DU6yg6h8hP/2OkQo3K7uVILvY4iu0oI4t3HFa81UPkhGJwkRwM10JEc3upjdhHjs/k8GJY1sRBhk5sr69Bw=="
+ "resolved" "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.0.1.tgz"
+ "version" "10.0.1"
+ dependencies:
+ "regenerate" "^1.4.2"
+
+"regenerate@^1.4.2":
+ "integrity" "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A=="
+ "resolved" "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz"
+ "version" "1.4.2"
+
+"regenerator-runtime@^0.11.0", "regenerator-runtime@0.11":
+ "integrity" "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg=="
+ "resolved" "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz"
+ "version" "0.11.1"
+
+"regenerator-runtime@^0.13.4":
+ "integrity" "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA=="
+ "resolved" "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz"
+ "version" "0.13.9"
+
+"regenerator-transform@^0.14.2":
+ "integrity" "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw=="
+ "resolved" "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz"
+ "version" "0.14.5"
+>>>>>>> d7b4e57 (登录封装)
dependencies:
"@babel/runtime" "^7.8.4"
@@ -9882,6 +11449,7 @@ tsconfig-paths@^3.14.1:
integrity sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==
dependencies:
"@types/json5" "^0.0.29"
+<<<<<<< HEAD
json5 "^1.0.1"
minimist "^1.2.6"
strip-bom "^3.0.0"
@@ -10316,6 +11884,447 @@ watchpack@^1.7.4:
dependencies:
graceful-fs "^4.1.2"
neo-async "^2.5.0"
+=======
+ "json5" "^1.0.1"
+ "minimist" "^1.2.6"
+ "strip-bom" "^3.0.0"
+
+"tslib@^1.10.0", "tslib@^1.8.1", "tslib@^1.9.0":
+ "integrity" "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
+ "resolved" "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz"
+ "version" "1.14.1"
+
+"tslib@^2.3.0":
+ "integrity" "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
+ "resolved" "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz"
+ "version" "2.3.1"
+
+"tsutils@^3.21.0":
+ "integrity" "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA=="
+ "resolved" "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz"
+ "version" "3.21.0"
+ dependencies:
+ "tslib" "^1.8.1"
+
+"tty-browserify@0.0.0":
+ "integrity" "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY="
+ "resolved" "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz"
+ "version" "0.0.0"
+
+"tunnel-agent@^0.6.0":
+ "integrity" "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0="
+ "resolved" "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz"
+ "version" "0.6.0"
+ dependencies:
+ "safe-buffer" "^5.0.1"
+
+"tweetnacl@^0.14.3", "tweetnacl@~0.14.0":
+ "integrity" "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
+ "resolved" "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz"
+ "version" "0.14.5"
+
+"type-check@~0.3.2":
+ "integrity" "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I="
+ "resolved" "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz"
+ "version" "0.3.2"
+ dependencies:
+ "prelude-ls" "~1.1.2"
+
+"type-fest@^0.13.1", "type-fest@^0.8.1":
+ "integrity" "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA=="
+ "resolved" "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz"
+ "version" "0.8.1"
+
+"type-fest@^0.21.3":
+ "integrity" "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w=="
+ "resolved" "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz"
+ "version" "0.21.3"
+
+"type-is@~1.6.18":
+ "integrity" "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g=="
+ "resolved" "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz"
+ "version" "1.6.18"
+ dependencies:
+ "media-typer" "0.3.0"
+ "mime-types" "~2.1.24"
+
+"type@^1.0.1":
+ "integrity" "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg=="
+ "resolved" "https://registry.npmjs.org/type/-/type-1.2.0.tgz"
+ "version" "1.2.0"
+
+"type@^2.5.0":
+ "integrity" "sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ=="
+ "resolved" "https://registry.npmjs.org/type/-/type-2.6.0.tgz"
+ "version" "2.6.0"
+
+"typedarray@^0.0.6":
+ "integrity" "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
+ "resolved" "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz"
+ "version" "0.0.6"
+
+"typescript@^4.1.0", "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta":
+ "integrity" "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw=="
+ "resolved" "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz"
+ "version" "4.6.3"
+
+"uglify-js@^3.5.1":
+ "integrity" "sha512-6iCVm2omGJbsu3JWac+p6kUiOpg3wFO2f8lIXjfEb8RrmLjzog1wTPMmwKB7swfzzqxj9YM+sGUM++u1qN4qJg=="
+ "resolved" "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.3.tgz"
+ "version" "3.15.3"
+
+"uglify-js@3.4.x":
+ "integrity" "sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw=="
+ "resolved" "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz"
+ "version" "3.4.10"
+ dependencies:
+ "commander" "~2.19.0"
+ "source-map" "~0.6.1"
+
+"unbox-primitive@^1.0.1":
+ "integrity" "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw=="
+ "resolved" "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz"
+ "version" "1.0.1"
+ dependencies:
+ "function-bind" "^1.1.1"
+ "has-bigints" "^1.0.1"
+ "has-symbols" "^1.0.2"
+ "which-boxed-primitive" "^1.0.2"
+
+"unescape-js@^1.1.1":
+ "integrity" "sha512-42SD8NOQEhdYntEiUQdYq/1V/YHwr1HLwlHuTJB5InVVdOSbgI6xu8jK5q65yIzuFCfczzyDF/7hbGzVbyCw0g=="
+ "resolved" "https://registry.npmjs.org/unescape-js/-/unescape-js-1.1.4.tgz"
+ "version" "1.1.4"
+ dependencies:
+ "string.fromcodepoint" "^0.2.1"
+
+"unherit@^1.0.4":
+ "integrity" "sha512-Ft16BJcnapDKp0+J/rqFC3Rrk6Y/Ng4nzsC028k2jdDII/rdZ7Wd3pPT/6+vIIxRagwRc9K0IUX0Ra4fKvw+WQ=="
+ "resolved" "https://registry.npmjs.org/unherit/-/unherit-1.1.3.tgz"
+ "version" "1.1.3"
+ dependencies:
+ "inherits" "^2.0.0"
+ "xtend" "^4.0.0"
+
+"unicode-canonical-property-names-ecmascript@^2.0.0":
+ "integrity" "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ=="
+ "resolved" "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz"
+ "version" "2.0.0"
+
+"unicode-match-property-ecmascript@^2.0.0":
+ "integrity" "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q=="
+ "resolved" "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz"
+ "version" "2.0.0"
+ dependencies:
+ "unicode-canonical-property-names-ecmascript" "^2.0.0"
+ "unicode-property-aliases-ecmascript" "^2.0.0"
+
+"unicode-match-property-value-ecmascript@^2.0.0":
+ "integrity" "sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw=="
+ "resolved" "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz"
+ "version" "2.0.0"
+
+"unicode-property-aliases-ecmascript@^2.0.0":
+ "integrity" "sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ=="
+ "resolved" "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz"
+ "version" "2.0.0"
+
+"unified@^6.0.0":
+ "integrity" "sha512-1k+KPhlVtqmG99RaTbAv/usu85fcSRu3wY8X+vnsEhIxNP5VbVIDiXnLqyKIG+UMdyTg0ZX9EI6k2AfjJkHPtA=="
+ "resolved" "https://registry.npmjs.org/unified/-/unified-6.2.0.tgz"
+ "version" "6.2.0"
+ dependencies:
+ "bail" "^1.0.0"
+ "extend" "^3.0.0"
+ "is-plain-obj" "^1.1.0"
+ "trough" "^1.0.0"
+ "vfile" "^2.0.0"
+ "x-is-string" "^0.1.0"
+
+"union-value@^1.0.0":
+ "integrity" "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg=="
+ "resolved" "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz"
+ "version" "1.0.1"
+ dependencies:
+ "arr-union" "^3.1.0"
+ "get-value" "^2.0.6"
+ "is-extendable" "^0.1.1"
+ "set-value" "^2.0.1"
+
+"uniq@^1.0.1":
+ "integrity" "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8="
+ "resolved" "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz"
+ "version" "1.0.1"
+
+"unique-filename@^1.1.1":
+ "integrity" "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ=="
+ "resolved" "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz"
+ "version" "1.1.1"
+ dependencies:
+ "unique-slug" "^2.0.0"
+
+"unique-slug@^2.0.0":
+ "integrity" "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w=="
+ "resolved" "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz"
+ "version" "2.0.2"
+ dependencies:
+ "imurmurhash" "^0.1.4"
+
+"unist-util-find-all-after@^1.0.2":
+ "integrity" "sha512-lWgIc3rrTMTlK1Y0hEuL+k+ApzFk78h+lsaa2gHf63Gp5Ww+mt11huDniuaoq1H+XMK2lIIjjPkncxXcDp3QDw=="
+ "resolved" "https://registry.npmjs.org/unist-util-find-all-after/-/unist-util-find-all-after-1.0.5.tgz"
+ "version" "1.0.5"
+ dependencies:
+ "unist-util-is" "^3.0.0"
+
+"unist-util-is@^3.0.0":
+ "integrity" "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A=="
+ "resolved" "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz"
+ "version" "3.0.0"
+
+"unist-util-remove-position@^1.0.0":
+ "integrity" "sha512-tLqd653ArxJIPnKII6LMZwH+mb5q+n/GtXQZo6S6csPRs5zB0u79Yw8ouR3wTw8wxvdJFhpP6Y7jorWdCgLO0A=="
+ "resolved" "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-1.1.4.tgz"
+ "version" "1.1.4"
+ dependencies:
+ "unist-util-visit" "^1.1.0"
+
+"unist-util-stringify-position@^1.0.0", "unist-util-stringify-position@^1.1.1":
+ "integrity" "sha512-pNCVrk64LZv1kElr0N1wPiHEUoXNVFERp+mlTg/s9R5Lwg87f9bM/3sQB99w+N9D/qnM9ar3+AKDBwo/gm/iQQ=="
+ "resolved" "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-1.1.2.tgz"
+ "version" "1.1.2"
+
+"unist-util-visit-parents@^2.0.0":
+ "integrity" "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g=="
+ "resolved" "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz"
+ "version" "2.1.2"
+ dependencies:
+ "unist-util-is" "^3.0.0"
+
+"unist-util-visit@^1.1.0":
+ "integrity" "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw=="
+ "resolved" "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz"
+ "version" "1.4.1"
+ dependencies:
+ "unist-util-visit-parents" "^2.0.0"
+
+"universal-router@^8.3.0":
+ "integrity" "sha512-cBkihRoHvRQAjdUnDE1GGuuw/TPAIi8z2pEsSmUVAWLeZdgjHzzAb1+0VOO6NvBOvySItOTQikzaGlRxRdJBnA=="
+ "resolved" "https://registry.npmjs.org/universal-router/-/universal-router-8.3.0.tgz"
+ "version" "8.3.0"
+ dependencies:
+ "path-to-regexp" "^3.1.0"
+
+"universalify@^0.1.0":
+ "integrity" "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg=="
+ "resolved" "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz"
+ "version" "0.1.2"
+
+"unpipe@~1.0.0", "unpipe@1.0.0":
+ "integrity" "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
+ "resolved" "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz"
+ "version" "1.0.0"
+
+"unset-value@^1.0.0":
+ "integrity" "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk="
+ "resolved" "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz"
+ "version" "1.0.0"
+ dependencies:
+ "has-value" "^0.3.1"
+ "isobject" "^3.0.0"
+
+"upath@^1.1.1":
+ "integrity" "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg=="
+ "resolved" "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz"
+ "version" "1.2.0"
+
+"upper-case@^1.1.1":
+ "integrity" "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg="
+ "resolved" "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz"
+ "version" "1.1.3"
+
+"uri-js@^4.2.2":
+ "integrity" "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg=="
+ "resolved" "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz"
+ "version" "4.4.1"
+ dependencies:
+ "punycode" "^2.1.0"
+
+"urix@^0.1.0":
+ "integrity" "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI="
+ "resolved" "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz"
+ "version" "0.1.0"
+
+"url-loader@^4.1.0":
+ "integrity" "sha512-3BTV812+AVHHOJQO8O5MkWgZ5aosP7GnROJwvzLS9hWDj00lZ6Z0wNak423Lp9PBZN05N+Jk/N5Si8jRAlGyWA=="
+ "resolved" "https://registry.npmjs.org/url-loader/-/url-loader-4.1.1.tgz"
+ "version" "4.1.1"
+ dependencies:
+ "loader-utils" "^2.0.0"
+ "mime-types" "^2.1.27"
+ "schema-utils" "^3.0.0"
+
+"url-parse@^1.4.3", "url-parse@^1.4.7":
+ "integrity" "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ=="
+ "resolved" "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz"
+ "version" "1.5.10"
+ dependencies:
+ "querystringify" "^2.1.1"
+ "requires-port" "^1.0.0"
+
+"url@^0.11.0":
+ "integrity" "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE="
+ "resolved" "https://registry.npmjs.org/url/-/url-0.11.0.tgz"
+ "version" "0.11.0"
+ dependencies:
+ "punycode" "1.3.2"
+ "querystring" "0.2.0"
+
+"use-sync-external-store@^1.0.0":
+ "integrity" "sha512-AFVsxg5GkFg8GDcxnl+Z0lMAz9rE8DGJCc28qnBuQF7lac57B5smLcT37aXpXIIPz75rW4g3eXHPjhHwdGskOw=="
+ "resolved" "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.0.0.tgz"
+ "version" "1.0.0"
+
+"use@^3.1.0":
+ "integrity" "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ=="
+ "resolved" "https://registry.npmjs.org/use/-/use-3.1.1.tgz"
+ "version" "3.1.1"
+
+"util-deprecate@^1.0.1", "util-deprecate@^1.0.2", "util-deprecate@~1.0.1":
+ "integrity" "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
+ "resolved" "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz"
+ "version" "1.0.2"
+
+"util.promisify@1.0.0":
+ "integrity" "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA=="
+ "resolved" "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz"
+ "version" "1.0.0"
+ dependencies:
+ "define-properties" "^1.1.2"
+ "object.getownpropertydescriptors" "^2.0.3"
+
+"util@^0.11.0":
+ "integrity" "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ=="
+ "resolved" "https://registry.npmjs.org/util/-/util-0.11.1.tgz"
+ "version" "0.11.1"
+ dependencies:
+ "inherits" "2.0.3"
+
+"util@0.10.3":
+ "integrity" "sha1-evsa/lCAUkZInj23/g7TeTNqwPk="
+ "resolved" "https://registry.npmjs.org/util/-/util-0.10.3.tgz"
+ "version" "0.10.3"
+ dependencies:
+ "inherits" "2.0.1"
+
+"utila@~0.4":
+ "integrity" "sha1-ihagXURWV6Oupe7MWxKk+lN5dyw="
+ "resolved" "https://registry.npmjs.org/utila/-/utila-0.4.0.tgz"
+ "version" "0.4.0"
+
+"utils-merge@1.0.1":
+ "integrity" "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
+ "resolved" "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz"
+ "version" "1.0.1"
+
+"uuid@^3.3.2", "uuid@^3.4.0":
+ "integrity" "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
+ "resolved" "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz"
+ "version" "3.4.0"
+
+"v8-compile-cache@^2.0.3":
+ "integrity" "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA=="
+ "resolved" "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz"
+ "version" "2.3.0"
+
+"validate-npm-package-license@^3.0.1":
+ "integrity" "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew=="
+ "resolved" "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz"
+ "version" "3.0.4"
+ dependencies:
+ "spdx-correct" "^3.0.0"
+ "spdx-expression-parse" "^3.0.0"
+
+"vary@~1.1.2":
+ "integrity" "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
+ "resolved" "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz"
+ "version" "1.1.2"
+
+"verror@1.10.0":
+ "integrity" "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA="
+ "resolved" "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz"
+ "version" "1.10.0"
+ dependencies:
+ "assert-plus" "^1.0.0"
+ "core-util-is" "1.0.2"
+ "extsprintf" "^1.2.0"
+
+"vfile-location@^2.0.0":
+ "integrity" "sha512-sSFdyCP3G6Ka0CEmN83A2YCMKIieHx0EDaj5IDP4g1pa5ZJ4FJDvpO0WODLxo4LUX4oe52gmSCK7Jw4SBghqxA=="
+ "resolved" "https://registry.npmjs.org/vfile-location/-/vfile-location-2.0.6.tgz"
+ "version" "2.0.6"
+
+"vfile-message@^1.0.0":
+ "integrity" "sha512-1WmsopSGhWt5laNir+633LszXvZ+Z/lxveBf6yhGsqnQIhlhzooZae7zV6YVM1Sdkw68dtAW3ow0pOdPANugvA=="
+ "resolved" "https://registry.npmjs.org/vfile-message/-/vfile-message-1.1.1.tgz"
+ "version" "1.1.1"
+ dependencies:
+ "unist-util-stringify-position" "^1.1.1"
+
+"vfile@^2.0.0":
+ "integrity" "sha512-ASt4mBUHcTpMKD/l5Q+WJXNtshlWxOogYyGYYrg4lt/vuRjC1EFQtlAofL5VmtVNIZJzWYFJjzGWZ0Gw8pzW1w=="
+ "resolved" "https://registry.npmjs.org/vfile/-/vfile-2.3.0.tgz"
+ "version" "2.3.0"
+ dependencies:
+ "is-buffer" "^1.1.4"
+ "replace-ext" "1.0.0"
+ "unist-util-stringify-position" "^1.0.0"
+ "vfile-message" "^1.0.0"
+
+"vm-browserify@^1.0.1":
+ "integrity" "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ=="
+ "resolved" "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz"
+ "version" "1.1.2"
+
+"vm2@^3.8.4":
+ "integrity" "sha512-xwTm7NLh/uOjARRBs8/95H0e8fT3Ukw5D/JJWhxMbhKzNh1Nu981jQKvkep9iKYNxzlVrdzD0mlBGkDKZWprlw=="
+ "resolved" "https://registry.npmjs.org/vm2/-/vm2-3.9.9.tgz"
+ "version" "3.9.9"
+ dependencies:
+ "acorn" "^8.7.0"
+ "acorn-walk" "^8.2.0"
+
+"w3c-hr-time@^1.0.1":
+ "integrity" "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ=="
+ "resolved" "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz"
+ "version" "1.0.2"
+ dependencies:
+ "browser-process-hrtime" "^1.0.0"
+
+"w3c-xmlserializer@^1.1.2":
+ "integrity" "sha512-p10l/ayESzrBMYWRID6xbuCKh2Fp77+sA0doRuGn4tTIMrrZVeqfpKjXHY+oDh3K4nLdPgNwMTVP6Vp4pvqbNg=="
+ "resolved" "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-1.1.2.tgz"
+ "version" "1.1.2"
+ dependencies:
+ "domexception" "^1.0.1"
+ "webidl-conversions" "^4.0.2"
+ "xml-name-validator" "^3.0.0"
+
+"watchpack-chokidar2@^2.0.1":
+ "integrity" "sha512-nCFfBIPKr5Sh61s4LPpy1Wtfi0HE8isJ3d2Yb5/Ppw2P2B/3eVSEBjKfN0fmHJSK14+31KwMKmcrzs2GM4P0Ww=="
+ "resolved" "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.1.tgz"
+ "version" "2.0.1"
+ dependencies:
+ "chokidar" "^2.1.8"
+
+"watchpack@^1.7.4":
+ "integrity" "sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ=="
+ "resolved" "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz"
+ "version" "1.7.5"
+ dependencies:
+ "graceful-fs" "^4.1.2"
+ "neo-async" "^2.5.0"
+>>>>>>> d7b4e57 (登录封装)
optionalDependencies:
chokidar "^3.4.1"
watchpack-chokidar2 "^2.0.1"
From e7a130533d43d36b4d774427d8abc4e7b80484c3 Mon Sep 17 00:00:00 2001
From: czm <2192718639@qq.com>
Date: Mon, 25 Apr 2022 19:02:10 +0800
Subject: [PATCH 13/18] =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=B0=81=E8=A3=85?=
=?UTF-8?q?=E5=AE=8C=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/common/client.js | 17 ++
src/common/fotmat.js | 135 ++++++++++++++++
src/common/system.js | 34 ++++
src/common/uploadImage.js | 150 ++++++++++++++++++
src/common/user.js | 36 +++++
src/common/util.js | 94 +++++++++++
src/components/search/index.tsx | 27 +++-
src/constants/userInfo.ts | 8 +-
.../components/preview/index.module.scss | 2 +-
src/pages/details/index.tsx | 6 +-
src/pages/index/index.module.scss | 3 +
src/pages/index/index.tsx | 24 +--
.../order/components/remark/index.module.scss | 3 +-
src/pages/order/components/remark/index.tsx | 12 +-
src/pages/search/index.tsx | 2 +-
src/reducers/userInfo.ts | 60 +++++--
src/use/useHttp.ts | 8 +-
src/use/useLogin.tsx | 12 +-
src/use/useUserInfo.ts | 41 +++++
19 files changed, 604 insertions(+), 70 deletions(-)
create mode 100644 src/common/client.js
create mode 100644 src/common/fotmat.js
create mode 100644 src/common/system.js
create mode 100644 src/common/uploadImage.js
create mode 100644 src/common/user.js
create mode 100644 src/common/util.js
create mode 100644 src/use/useUserInfo.ts
diff --git a/src/common/client.js b/src/common/client.js
new file mode 100644
index 0000000..0aefa83
--- /dev/null
+++ b/src/common/client.js
@@ -0,0 +1,17 @@
+import Taro from "@tarojs/taro";
+
+
+/**
+ * 设置 客户 本地存储
+ * @param {Object} clientInfo
+ */
+export const setClient = (clientInfo) => {
+ Taro.setStorageSync('client', clientInfo)
+}
+
+/**
+ * 返回 客户 本地存储
+ */
+export const getClient = () => {
+ Taro.getStorageSync('client') || null
+}
diff --git a/src/common/fotmat.js b/src/common/fotmat.js
new file mode 100644
index 0000000..8bef05c
--- /dev/null
+++ b/src/common/fotmat.js
@@ -0,0 +1,135 @@
+/**
+ * 移除井号
+ * @param {String} val code 编码
+ * @returns
+ */
+export const formatRemoveHashTag = (val = "") => {
+ // console.log('移除标签',val,val.endsWith("#"));
+ return val.endsWith("#") ? val.replace("#", "") : val;
+};
+
+
+/**
+ * 格式化编码+名称显示方式
+ * @param {String} code 编码
+ * @param {String} name 名称
+ * @param {*} mode 模式 both:code + 名称 name: 仅显示名称
+ * @returns
+ */
+export const formatHashTag = (code = "", name = "", mode = "both") => {
+ if (mode == 'both') {
+ return `${formatRemoveHashTag(code)}# ${name}`
+ } else if (mode == 'name') {
+ return `${name}`
+ }
+}
+
+const Digit = 10 * 10
+
+/**
+ * 重量 进退位 单位
+ */
+export const weightDigit = 1000
+
+/**
+ * 除以
+ * @param {*} val
+ * @param {*} digit
+ * @returns
+ */
+export const formatPriceDiv = (val, digit = Digit) => {
+ return strip(Number(val / digit)) || 0
+}
+/**
+ * 乘以
+ * @param {*} val
+ * @param {*} digit
+ * @returns
+ */
+export const formatPriceMul = (val, digit = Digit) => {
+ return strip(Number(val * digit)) || 0
+}
+
+/**
+ * 格式化重量单位 (乘以)
+ * @param {Number} val
+ * @returns
+ */
+export const formatWeightMul = (val, digit = weightDigit) => {
+ return strip(Number(val * digit)) || 0
+}
+
+/**
+ * 格式化重量单位 (除以)
+ * @param {*} val
+ */
+export const formatWeightDiv = (val, digit = weightDigit) => {
+ return strip(Number(val / digit)) || 0
+}
+
+export const formatDateTime = (val, fmt = "YYYY-MM-DD HH:mm:ss") => {
+ if (val) {
+ let time = new Date(val)
+ let Y = time.getFullYear()
+ let M = time.getMonth() + 1
+ let d = time.getDate()
+ let h = time.getHours()
+ let m = time.getMinutes()
+ let s = time.getSeconds()
+
+ fmt = fmt.replace('YYYY', Y).replace('MM', M.toString().padStart(2, '0')).replace('DD', d.toString().padStart(2, '0')).replace('HH', h.toString().padStart(2, '0')).replace('mm', m.toString().padStart(2, '0')).replace('ss', s.toString().padStart(2, '0'))
+ // fmt = fmt.replace('MM', M)
+ // fmt = fmt.replace('DD', d)
+ // fmt = fmt.replace('HH', h)
+ // fmt = fmt.replace('mm', m)
+ // fmt = fmt.replace('ss', s)
+
+ return fmt
+ } else {
+ return val
+ }
+
+}
+
+/**
+ * 精度
+ * @param {*} num
+ * @param {*} precision
+ * @returns
+ */
+export const strip = (num, precision = 12) => {
+ return +parseFloat(num.toPrecision(precision));
+}
+
+/**
+ * 转换金额单位
+ * @param {*} num 金额 / 数值
+ * @param {*} digit 转换单位
+ * @returns
+ */
+export const formatMillionYuan = (num, digit = 10000) => {
+ return num / digit > 1 ? { num: toDecimal2(num / digit), million: true } : { num, million: false }
+}
+
+/**
+ * 数值保留两位小数
+ * @param {*} x
+ * @returns
+ */
+export const toDecimal2 = (x) => {
+ var f = parseFloat(x);
+ if (isNaN(f)) {
+ return 0;
+ }
+ f = f + "";
+ let index = f.lastIndexOf('.');
+ if (index >= 0) {
+ let decimal = f.substring(index + 1);
+ if (decimal.length == 1) {
+ f = f.substring(0, index + 1) + decimal + "0";
+ } else {
+ f = f.substring(0, index + 1) + decimal.substring(0, 2);
+ }
+ }
+ return f;
+}
diff --git a/src/common/system.js b/src/common/system.js
new file mode 100644
index 0000000..12e2036
--- /dev/null
+++ b/src/common/system.js
@@ -0,0 +1,34 @@
+import Taro from "@tarojs/taro";
+
+
+/**
+ * 设置 系统 本地存储
+ * @param {Object} systemInfo
+ */
+export const setSystem = (systemInfo) => {
+ Taro.setStorageSync('system', JSON.stringify(systemInfo))
+}
+
+/**
+ * 返回 系统 本地存储
+ */
+export const getSystem = () => {
+ const result = Taro.getStorageSync('system')
+ return result ? JSON.parse(result) : null
+}
+
+/**
+ * 设置 小程序 本地存储
+ * @param {Object} systemInfo
+ */
+export const setAccountInfo = (systemInfo) => {
+ Taro.setStorageSync('accountInfo', JSON.stringify(systemInfo))
+}
+
+/**
+ * 返回 系统 本地存储
+ */
+export const getAccountInfo = () => {
+ const result = Taro.getStorageSync('accountInfo')
+ return result ? JSON.parse(result) : null
+}
diff --git a/src/common/uploadImage.js b/src/common/uploadImage.js
new file mode 100644
index 0000000..6a6cf8a
--- /dev/null
+++ b/src/common/uploadImage.js
@@ -0,0 +1,150 @@
+import Taro from '@tarojs/taro';
+import { GET_UPLOAD_SIGN, CDN_UPLOAD_IMG, UPLOAD_CDN_URL } from './constant'
+
+import { GetSignApi } from '@/api/cdn'
+
+
+const { fetchData: GetSign, success, data: resData, msg, code } = GetSignApi()
+
+
+// 上传图片 获取auth,Policy
+/*
+ scene 场景值,区分上传文件的根路径
+ type 类型值,区分上传业务bucket
+*/
+const getSecret = (scene, type) => {
+ return new Promise(async (resolve, reject) => {
+
+ const SAVE_PATH = `/${scene}/{filemd5}{day}{hour}{min}{sec}{.suffix}`;
+
+
+ let params = {
+ 'method': 'post',
+ 'save_key': SAVE_PATH
+ }
+
+ // 获取签名
+ await GetSign(params)
+ if (success.value) {
+ // console.log('返回签名',resData.value);
+ resolve(resData.value)
+ } else {
+ reject({
+ code: code.value || '9999',
+ msg: msg.value
+ });
+ }
+
+ })
+}
+const getFileType = (name) => {
+ if (!name) return false;
+ var imgType = ["gif", "jpeg", "jpg", "bmp", "png"];
+ var videoType = ["avi", "wmv", "mkv", "mp4", "mov", "rm", "3gp", "flv", "mpg", "rmvb", "quicktime"];
+
+ if (RegExp("\.?(" + imgType.join("|") + ")$", "i").test(name.toLowerCase())) {
+ return 'image';
+ } else if (RegExp("\.(" + videoType.join("|") + ")$", "i").test(name.toLowerCase())) {
+ return 'video';
+ } else {
+ return false;
+ }
+}
+
+const upYunbucket = (type) => {
+ var bucket = ""
+ switch (type) {
+ case "product":
+ bucket = "testzzfzyc"
+ break;
+ }
+ return bucket
+}
+
+
+/**
+ *
+ * @param {*} file 传入文件
+ * @param {String} secene 传入 'product'
+ * @param {String} type 传入 'product'
+ * @returns
+ */
+const uploadCDNImg = (file, secene, type) => {
+ // var file = event.target.files[0];
+ // var filetype = file.type
+ let filetype = file.tempFilePath
+
+ if (!getFileType(filetype)) {
+ Taro.showToast({
+ title: "上传文件类型错误",
+ icon: "none",
+ duration: 3800
+ })
+ return false
+ }
+ return new Promise((resolve, reject, race) => {
+ getSecret(secene, type)
+ .then(result => {
+
+ console.log('bucket', result.bucket);
+ var formdata = {
+ 'authorization': result.authorization,
+ 'policy': result.policy,
+ // "file": file.tempFilePath,
+ }
+
+ const uploadTask = Taro.uploadFile({
+ url: `${UPLOAD_CDN_URL}${result.bucket}`,
+ formData: formdata,
+ filePath: file.tempFilePath,
+ name: 'file',
+ success: res => {
+ resolve(JSON.parse(`${res.data}`))
+ },
+ fail: err => {
+ console.log(err)
+ reject(err)
+ }
+ })
+
+ uploadTask.progress(res => {
+ console.log('上传进度', res.progress);
+ if (res.progress < 100) {
+ Taro.showLoading({
+ title: '上传中...'
+ })
+ } else {
+ Taro.hideLoading()
+ }
+ })
+ })
+ .catch(result => {
+ reject(result)
+ Taro.showToast({
+ title: "获取密钥失败!",
+ icon: "none",
+ duration: 3800
+ })
+ })
+ })
+}
+
+const taroChooseImg = () => {
+ Taro.chooseImage({
+ count: 1,
+ sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
+ sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
+ success: (res) => {
+ console.log('res:', res)
+ Taro.chooseMessageFile({
+ count: 1,
+
+ })
+ },
+ fail: (err) => {
+ console.log('图片选择失败:', err)
+ }
+ })
+}
+
+export default uploadCDNImg
\ No newline at end of file
diff --git a/src/common/user.js b/src/common/user.js
new file mode 100644
index 0000000..aabdbfc
--- /dev/null
+++ b/src/common/user.js
@@ -0,0 +1,36 @@
+import Taro from "@tarojs/taro";
+import { useStore } from "vuex";
+import { computed } from "@vue/runtime-core";
+
+/**
+ *
+ * @param {String} token
+ */
+export const setToken = (token) => {
+ Taro.setStorageSync('token', token)
+}
+/**
+ *
+ * @param {Object} userinfo
+ */
+export const setUserInfo = (userinfo) => {
+ Taro.setStorageSync('userInfo', userinfo)
+}
+
+
+/**
+ * 检查登录
+ */
+export const checkLogin = () => {
+ const store = useStore()
+ const token = computed(() => store.state.token)
+ console.log('checklogin token', token);
+
+ // 本地调试屏蔽
+ if (token == '') {
+ Taro.redirectTo({
+ url: '/pages/login/index',
+ })
+ }
+
+}
\ No newline at end of file
diff --git a/src/common/util.js b/src/common/util.js
new file mode 100644
index 0000000..323856d
--- /dev/null
+++ b/src/common/util.js
@@ -0,0 +1,94 @@
+/**
+ * 防抖
+ * @param {*} fn
+ * @param {*} delay
+ * @returns
+ */
+export const debounce = (fn, delay) => {
+ let timer = null;
+ return (...param) => {
+ if (timer) clearTimeout(timer);
+ timer = setTimeout(() => {
+ fn(...param);
+ }, delay);
+ };
+}
+
+/**
+ * 节流
+ * @param {*} fn
+ * @param {*} delay
+ * @returns
+ */
+export const throttle = (fn, delay) => {
+ let pre = 0;
+ return (...params) => {
+ let now = new Date().getTime();
+ console.log('相差:',now-pre)
+ if (now - pre > delay) {
+ fn(...params);
+ pre = now;
+ }
+ };
+}
+
+
+/**
+ * 批量过滤对象值为空的属性
+ * @param {Object} val 需要过滤的对象
+ * @param {Array} arr 排除过滤的属性
+ * @returns
+ */
+ export const getFilterData = (val = {}, arr = []) => {
+ let res = {}
+ for(let key in val) {
+ if(val[key]!=undefined&&val[key]!=null&&(!arr.includes(key))){
+ if(val[key] instanceof Number){
+ console.log("+++",val[key]);
+ if(!isNaN(val[key])) {
+ res[key] = val[key]
+ }
+ }else{
+ res[key] = val[key]
+ }
+ }
+ }
+ return res
+}
+/**
+ * 对象深拷贝
+ * @param {*} object
+ * @returns
+ */
+ export const copyObject = (object)=>{
+ if(object.constructor==Object){
+ let keys = Object.keys(object);
+ let newObject = {};
+ keys.map(key=>{
+ newObject[key]= copyObject(object[key]);
+ })
+ return newObject;
+ }else if(object.constructor==Array){
+ return object.map(item=>{
+ return copyObject(item);
+ })
+ }else{
+ return object;
+ }
+}
+
+/**
+ *
+ * @param {*} suffix
+ * !w80
+ !w100
+ !w160
+ !w200
+ !w400
+ !w800
+ !wh400
+ !w600
+ */
+ export const screenshot = (url, suffix="!w200")=>{
+ return url+suffix;
+ }
\ No newline at end of file
diff --git a/src/components/search/index.tsx b/src/components/search/index.tsx
index 6f539d9..75b5958 100644
--- a/src/components/search/index.tsx
+++ b/src/components/search/index.tsx
@@ -2,7 +2,8 @@ import { Input, View } from "@tarojs/components";
import styles from "./index.module.scss"
import CloseBtn from "@/components/closeBtn"
import classnames from "classnames";
-import { memo, useEffect, useState } from "react";
+import { debounce } from "@/common/util";
+import { memo, useEffect, useRef, useState } from "react";
type Params = {
clickOnSearch?: (val: string) => void
@@ -14,7 +15,8 @@ type Params = {
style?: Object,
showBtn?: false|true,
btnStyle?: Object,
- btnTitle?: string
+ btnTitle?: string,
+ debounceTime?: number //防抖时间,不设默认wei'ling
}
export default memo(({
@@ -24,17 +26,21 @@ export default memo(({
placeholder = '输入搜索内容',
showIcon = true,
showBtn = false,
- style = {},
btnStyle = {},
placeIcon = 'inner',
- btnTitle = '搜索'
+ btnTitle = '搜索',
+ debounceTime = 0
}:Params) => {
const [inputCon , setInputCon] = useState('')
-
+ const debounceTimeRef = useRef(0)
+
+ useEffect(() => {
+ debounceTimeRef.current = debounceTime
+ }, [debounceTime])
+
const onInputEven = (e) => {
const value = e.detail.value
- setInputCon(value)
- changeOnSearch?.(value)
+ changeData(value)
}
const clearInput = () => {
@@ -42,13 +48,18 @@ export default memo(({
changeOnSearch?.('')
}
+ const changeData = debounce((value) => {
+ setInputCon(value)
+ changeOnSearch?.(value)
+ }, debounceTimeRef.current)
+
const onSearch = () => {
clickOnSearch?.(inputCon)
}
return (
<>
- onSearch()} style={style}>
+ clickOnSearch?.(inputCon)}>
{showIcon&&}
onInputEven(e)}>
diff --git a/src/constants/userInfo.ts b/src/constants/userInfo.ts
index 8df3b84..77585a2 100644
--- a/src/constants/userInfo.ts
+++ b/src/constants/userInfo.ts
@@ -1,2 +1,6 @@
-export const GETUSER = 'GETUSER'
-export const SETUSER = 'SETUSER'
\ No newline at end of file
+export const SET_USERINFO = 'setUserInfo'
+export const SET_TOKEN = 'setToken'
+export const SET_SESSIONKEY = 'setSessionkey'
+export const CLEAR_TOKEN = 'clearToken'
+export const CLEAR_SESSIONKEY = 'clearSessionkey'
+export const CLEAR_USERINFO = 'clearUserInfo'
\ No newline at end of file
diff --git a/src/pages/details/components/preview/index.module.scss b/src/pages/details/components/preview/index.module.scss
index 5b57efc..cab4ce5 100644
--- a/src/pages/details/components/preview/index.module.scss
+++ b/src/pages/details/components/preview/index.module.scss
@@ -30,7 +30,7 @@
margin-top: 10px;
background-color: rgba(0,0,0, 0.5);
padding: 0 10px;
- @include common_ellipsis
+ @include common_ellipsis(1);
}
}
}
\ No newline at end of file
diff --git a/src/pages/details/index.tsx b/src/pages/details/index.tsx
index cadff96..d4a034d 100644
--- a/src/pages/details/index.tsx
+++ b/src/pages/details/index.tsx
@@ -10,6 +10,7 @@ import styles from './index.module.scss'
import { useEffect, useMemo, useState } from 'react';
import useManualPullDownRefresh from '@/use/useManualPullDownRefresh';
import { goLink } from '@/common/common';
+import useUserInfo from '@/use/useUserInfo';
type item = {title:string, img:string, url:string, id:number}
type params = {
@@ -103,10 +104,7 @@ export default (props:params) => {
}
})
- useDidShow(() => {
- Taro.getCurrentPages()
- })
-
+ const {user} = useUserInfo()
return (
diff --git a/src/pages/index/index.module.scss b/src/pages/index/index.module.scss
index 3e1e5c9..b1732f8 100644
--- a/src/pages/index/index.module.scss
+++ b/src/pages/index/index.module.scss
@@ -20,6 +20,9 @@
text-align: center;
line-height: 44px;
}
+ .search_input{
+ width: 300px;
+ }
}
.products{
flex:1;
diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx
index d0ffe2c..aea1ece 100644
--- a/src/pages/index/index.tsx
+++ b/src/pages/index/index.tsx
@@ -10,7 +10,7 @@ import { goLink } from '@/common/common'
import { useEffect, useState } from 'react'
import Taro, { useDidShow, usePullDownRefresh, useRouter } from '@tarojs/taro'
import useManualPullDownRefresh from '@/use/useManualPullDownRefresh'
-
+import useUserInfo from '@/use/useUserInfo'
export default () => {
const tabs_list = [
@@ -47,31 +47,9 @@ export default () => {
}, 1000)
}
- const goto = function (e) {
- var t = this
- Taro.navigateTo({
- url: '/pages/details/index',
- events: {
- // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
- backFromTargetPage: function (backData) {
- console.log('好啦,可以在这里写你的逻辑了', backData)
- if (backData.from == 'page2') {
- // 监听到 page2 返回
- console.log('好啦,可以在这里写你的逻辑了', backData)
- t.setData({
- isBackFromPage2: !0
- })
- }
- }
- }
- })
- }
-
return (
setShowShopCart(!showShopCart)}>
-
- goto(e)}>aaa
我的收藏
diff --git a/src/pages/order/components/remark/index.module.scss b/src/pages/order/components/remark/index.module.scss
index 9f2b3d0..d624050 100644
--- a/src/pages/order/components/remark/index.module.scss
+++ b/src/pages/order/components/remark/index.module.scss
@@ -24,7 +24,7 @@
color: $color_font_two;
}
textarea{
- background-color: $color_bg_one;
+ background-color: #f3f3f3;
border-radius: 10px;
width: 100%;
height: 313px;
@@ -32,6 +32,7 @@
padding-bottom: 50px;
box-sizing: border-box;
font-size: $font_size;
+ border: 2px solid #e6e6e6;
}
}
.order_save_address{
diff --git a/src/pages/order/components/remark/index.tsx b/src/pages/order/components/remark/index.tsx
index 05f485b..404e232 100644
--- a/src/pages/order/components/remark/index.tsx
+++ b/src/pages/order/components/remark/index.tsx
@@ -10,13 +10,13 @@ type Param = {
export default ({onBlur, onSave}:Param) => {
const [descData, setDescData] = useState({
number: 0,
- value: ''
+ value: '',
+ count: 10
})
-
-
const getDesc = useCallback((e) => {
let value = e.detail.value
- setDescData({...descData, number:value.length, value})
+ let res = value.slice(0, descData.count)
+ setDescData({...descData, number:res.length, value: res})
},[])
const setSave = () => {
@@ -26,8 +26,8 @@ export default ({onBlur, onSave}:Param) => {
添加备注
-
- {descData.number}/200
+
+ {descData.number}/{descData.count}
setSave()}>保存
diff --git a/src/pages/search/index.tsx b/src/pages/search/index.tsx
index c24f320..d342443 100644
--- a/src/pages/search/index.tsx
+++ b/src/pages/search/index.tsx
@@ -10,7 +10,7 @@ export default () => {
return (
- goLink('/pages/searchList/index')}/>
+ console.log(e)} placeholder="请输入面料关键词" placeIcon="out" showBtn={true} />
diff --git a/src/reducers/userInfo.ts b/src/reducers/userInfo.ts
index e2c3f8d..5cfd21b 100644
--- a/src/reducers/userInfo.ts
+++ b/src/reducers/userInfo.ts
@@ -1,23 +1,51 @@
-import { GETUSER, SETUSER } from '../constants/userInfo'
+import Taro from '@tarojs/taro'
+import { SET_USERINFO, SET_TOKEN, SET_SESSIONKEY, CLEAR_TOKEN, CLEAR_USERINFO, CLEAR_SESSIONKEY} from '../constants/userInfo'
-const INIT_USER = {
- name: '张三',
- phone: '110',
- avatarUrl: '',
- token: '',
+export type UserParam = {
+ name?:string,
+ phone?:string,
+ avatarUrl?:string,
}
-export default function counter (state = INIT_USER, action) {
- switch (action.type) {
- case GETUSER:
- return {
- ...state,
- }
- case SETUSER:
- return {
- ...state,
- }
+type Action = {
+ type?: string,
+ data?: DataParam
+}
+
+export type DataParam = {
+ token?: string
+ sessionkey?: string,
+ userInfo: UserParam
+}
+
+const INIT_USER = {
+ userInfo: Taro.getStorageSync('userInfo')?JSON.parse(Taro.getStorageSync('userInfo')):null,
+ token: Taro.getStorageSync('token')||'',
+ session_key: Taro.getStorageSync('sessionkey')||'',
+}
+
+export default function counter (state = INIT_USER, action: Action) {
+ const {type, data} = action
+ switch (type) {
+ case SET_USERINFO:
+ Taro.setStorageSync('userInfo',JSON.stringify(data?.userInfo))
+ return {...state,...data}
+ case SET_TOKEN:
+ Taro.setStorageSync('token',JSON.stringify(data?.token))
+ return {...state,...data}
+ case SET_SESSIONKEY:
+ Taro.setStorageSync('sessionkey',JSON.stringify(data?.sessionkey))
+ return {...state,...data}
+ case CLEAR_TOKEN:
+ Taro.removeStorageSync('token')
+ return {...state, token:''}
+ case CLEAR_SESSIONKEY:
+ Taro.removeStorageSync('sessionkey')
+ return {...state, session_key:''}
+ case CLEAR_USERINFO:
+ Taro.removeStorageSync('userInfo')
+ return {...state, userInfo: null}
default:
return state
}
diff --git a/src/use/useHttp.ts b/src/use/useHttp.ts
index c188d42..64af04d 100644
--- a/src/use/useHttp.ts
+++ b/src/use/useHttp.ts
@@ -193,9 +193,10 @@ export const useRequest = (options = {
title: `错误:${showStatus(statusCode)}`
})
if (statusCode === 401) {
- Taro.reLaunch({
- url: '/pages/login/index'
- })
+ //未登录
+ // Taro.reLaunch({
+ // url: '/pages/login/index'
+ // })
}
}
@@ -209,6 +210,7 @@ export const useRequest = (options = {
stateRef.current.error = false
stateRef.current.loading = false
setState(() => stateRef.current)
+ return stateRef.current
}
return {
diff --git a/src/use/useLogin.tsx b/src/use/useLogin.tsx
index 554d834..2541549 100644
--- a/src/use/useLogin.tsx
+++ b/src/use/useLogin.tsx
@@ -1,17 +1,17 @@
import { useEffect, useState } from "react"
import { WX_APPID } from "@/common/constant"
+import useUserInfo from "./useUserInfo"
+
export default () => {
+ const {setToken, setSessionKey, setUserInfo} = useUserInfo()
+
const [loginState, setLoginState] = useState({
session_key: '',
token: '',
userInfo: ''
})
- useEffect(() => {
- getToken()
- }, [])
-
const getToken = () => {
Taro.login({
success: function (res) {
@@ -34,6 +34,8 @@ export default () => {
session_key: data.session_key,
token: data.token
})
+ setToken(data.token)
+ setLoginState(data.session_key)
}
})
} else {
@@ -66,7 +68,7 @@ export default () => {
Appid: WX_APPID
},
success: (e) => {
- console.log('123123')
+ setUserInfo({})
},
fail: (e) => {
console.log(e)
diff --git a/src/use/useUserInfo.ts b/src/use/useUserInfo.ts
new file mode 100644
index 0000000..cdf67ec
--- /dev/null
+++ b/src/use/useUserInfo.ts
@@ -0,0 +1,41 @@
+import { useDispatch, useSelector } from 'react-redux'
+import { CLEAR_SESSIONKEY, SET_USERINFO, SET_TOKEN, SET_SESSIONKEY, CLEAR_USERINFO, CLEAR_TOKEN} from '@/constants/userInfo'
+import {DataParam, UserParam} from '@/reducers/userInfo'
+export default () => {
+ const user = useSelector((state:DataParam) => state.userInfo) as DataParam
+ const dispatch = useDispatch()
+
+ const setToken = (token: string) => {
+ dispatch({type:SET_TOKEN, data:{token}})
+ }
+
+ const setSessionKey = (sessionkey: string) => {
+ dispatch({type:SET_SESSIONKEY, data:{sessionkey}})
+ }
+
+ const setUserInfo = (userInfo: UserParam) => {
+ dispatch({type:SET_USERINFO, data:{userInfo}})
+ }
+
+ const removeUserInfo = () => {
+ dispatch({type:CLEAR_USERINFO})
+ }
+
+ const removeToken = () => {
+ dispatch({type:CLEAR_TOKEN})
+ }
+
+ const removeSessionKey = () => {
+ dispatch({type:CLEAR_SESSIONKEY})
+ }
+
+ return {
+ setToken,
+ setUserInfo,
+ setSessionKey,
+ removeUserInfo,
+ removeToken,
+ removeSessionKey,
+ user, //响应式数据返回
+ }
+}
\ No newline at end of file
From 4c46c6e22d942fa93d5cb3161217c7da0c441602 Mon Sep 17 00:00:00 2001
From: czm <2192718639@qq.com>
Date: Thu, 5 May 2022 18:53:33 +0800
Subject: [PATCH 14/18] =?UTF-8?q?=E5=AF=B9=E6=8E=A5api?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/banner.ts | 12 +++
src/api/material.ts | 35 +++++++
src/common/constant.js | 6 +-
.../{swiper => banner}/index.module.scss | 0
src/components/banner/index.tsx | 51 ++++++++++
src/components/infiniteScroll/index.tsx | 2 +-
src/components/product/index.tsx | 24 ++---
src/components/sideBar/index.tsx | 47 ++++-----
src/components/swiper/index.tsx | 52 ----------
src/pages/details/components/swiper/index.tsx | 9 +-
src/pages/details/index.tsx | 5 +-
src/pages/index/index.tsx | 95 ++++++++++++-------
src/pages/order/components/remark/index.tsx | 9 +-
src/reducers/index.ts | 2 +-
src/reducers/userInfo.ts | 21 ++--
src/use/useHttp.ts | 57 +++--------
16 files changed, 243 insertions(+), 184 deletions(-)
create mode 100644 src/api/banner.ts
create mode 100644 src/api/material.ts
rename src/components/{swiper => banner}/index.module.scss (100%)
create mode 100644 src/components/banner/index.tsx
delete mode 100644 src/components/swiper/index.tsx
diff --git a/src/api/banner.ts b/src/api/banner.ts
new file mode 100644
index 0000000..dc8a8ff
--- /dev/null
+++ b/src/api/banner.ts
@@ -0,0 +1,12 @@
+import { useRequest } from "@/use/useHttp"
+
+/**
+ * 获取轮播图列表
+ * @returns
+ */
+ export const GetBannerList = () => {
+ return useRequest({
+ url: `/v1/mall/carouselBanner/list`,
+ method: "get",
+ })
+}
diff --git a/src/api/material.ts b/src/api/material.ts
new file mode 100644
index 0000000..a1d75ab
--- /dev/null
+++ b/src/api/material.ts
@@ -0,0 +1,35 @@
+import { useRequest } from "@/use/useHttp"
+
+/**
+ * 获取面料分类列表
+ * @returns
+*/
+export const GetCategoryList = () => {
+ return useRequest({
+ url: `/v1/mall/category/list`,
+ method: "get",
+ })
+}
+
+
+/**
+ * 获取面料种类列表
+ * @returns
+*/
+export const GetProductKindListApi = () => {
+ return useRequest({
+ url: `/v1/mall/product/kind/list`,
+ method: "get",
+ })
+}
+
+/**
+ * 获取面料列表
+ * @returns
+*/
+export const GetProductListApi = () => {
+ return useRequest({
+ url: `/v1/mall/product/list`,
+ method: "get",
+ })
+}
\ No newline at end of file
diff --git a/src/common/constant.js b/src/common/constant.js
index 093fb79..77ea9a4 100644
--- a/src/common/constant.js
+++ b/src/common/constant.js
@@ -1,4 +1,3 @@
-console.log('环境变量2',CURRENT_ENV);
// export const BASE_URL = CURRENT_ENV.includes('development') ? `https://test.zzfzyc.com/lymarket` : `https://www.zzfzyc.com/lymarket`
// export const BASE_URL = `http://192.168.0.75:50001/lymarket`
// export const BASE_URL = `http://192.168.0.89:50001/lymarket`
@@ -9,9 +8,6 @@ console.log('环境变量2',CURRENT_ENV);
export const BASE_URL = `http://192.168.1.30:40001/lymarket` // 发
// export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境
// export const BASE_URL = `https://www.zzfzyc.com/lymarket` // 正式环境
-
-
-
// export const BASE_URL = `http://192.168.1.165:40001/lymarket` // 王霞
// CDN
@@ -27,4 +23,4 @@ export const IMG_CND_Prefix = "http://test.cdn.zzfzyc.com/"
export const CDN_UPLOAD_IMG = `${UPLOAD_CDN_URL || ''}`;
//appid
-export const WX_APPID = 'wx6c8b9156543480b0'
\ No newline at end of file
+export const WX_APPID = 'wx68d92d7cbf0b6963'
\ No newline at end of file
diff --git a/src/components/swiper/index.module.scss b/src/components/banner/index.module.scss
similarity index 100%
rename from src/components/swiper/index.module.scss
rename to src/components/banner/index.module.scss
diff --git a/src/components/banner/index.tsx b/src/components/banner/index.tsx
new file mode 100644
index 0000000..92f035a
--- /dev/null
+++ b/src/components/banner/index.tsx
@@ -0,0 +1,51 @@
+import { Image, Swiper, SwiperItem, View } from "@tarojs/components"
+import { goLink } from "@/common/common"
+import {GetBannerList} from "@/api/banner"
+import styles from './index.module.scss'
+import { useEffect, useState } from "react"
+
+type item = {title:string, img:string, url:string, id:number}
+
+type params = {
+ list?: item[]
+ swiperOnClick?: (val: item) => void,
+ style?: Object
+}
+export default (props:params) => {
+ let {swiperOnClick, style = {}} = props
+
+ const [list, setList] = useState([])
+ const {fetchData, state} = GetBannerList()
+
+ useEffect(() => {
+ getData()
+ }, [])
+
+ const getData = async () => {
+ const res = await fetchData()
+ setList(res.data.list)
+ }
+
+ return (
+
+
+ {
+ list.map(item => {
+ return
+ goLink(item.link)}>
+
+
+
+ })
+ }
+
+
+ )
+
+}
\ No newline at end of file
diff --git a/src/components/infiniteScroll/index.tsx b/src/components/infiniteScroll/index.tsx
index 5f2f8bc..4dc2197 100644
--- a/src/components/infiniteScroll/index.tsx
+++ b/src/components/infiniteScroll/index.tsx
@@ -82,7 +82,7 @@ export default memo(({
{moreStatus&&
{
hasMore&&加载中||
- 没有更多了
+ 没有更多数据了
}
}
diff --git a/src/components/product/index.tsx b/src/components/product/index.tsx
index d7d6d3b..ede8ddc 100644
--- a/src/components/product/index.tsx
+++ b/src/components/product/index.tsx
@@ -3,27 +3,27 @@ import Taro from "@tarojs/taro"
import { goLink } from "@/common/common"
import styles from './index.module.scss'
-type params = {
- desStatus?: true|false
+type Params = {
+ desStatus?: true|false,
+ productList?: any[]
}
-export default ({desStatus = true}: params) => {
-
+export default ({desStatus = true, productList = []}:Params) => {
return (
- {new Array(10).fill('').map(item => {
+ {productList.map(item => {
return goLink('/pages/details/index?id=1')}>
-
- 230色
+
+ {item.product_color_count}色
- 0770#21S单面平纹(食毛)
+ {item.code}#{item.name}
- 160cm
- 110g
+ {item.width}
+ {item.weight_density}
- 67.6%棉24%涤纶6.4%氨纶
- {desStatus&&产品描述产品描述产品描述产品描述产品描述}
+ {item.component}
+ {desStatus&&{item.describe}}
})}
diff --git a/src/components/sideBar/index.tsx b/src/components/sideBar/index.tsx
index d33e91b..2729e92 100644
--- a/src/components/sideBar/index.tsx
+++ b/src/components/sideBar/index.tsx
@@ -1,24 +1,23 @@
import { ScrollView, View } from "@tarojs/components"
-import { memo, ReactNode, useRef, useState } from "react"
+import { memo, ReactNode, useEffect, useRef, useState } from "react"
import styles from "./index.module.scss"
import classnames from "classnames";
import Taro, { useReady } from "@tarojs/taro";
import InfiniteScroll from "../infiniteScroll";
-type ListProps = {
- title: string,
- value: number
-}
+
type Params = {
- list?: ListProps[],
+ list?: any[],
defaultValue?: number|string,
children?: ReactNode,
height?: string,
heightItem?: number,
- sideBarOnClick?: (ListProps) => void,
+ sideBarOnClick?: (val:any) => void,
refresherTriggered?: true|false,
selfOnRefresherRefresh?: () => void
+ selfOnScrolltolower?: () => void,
+ hasMore?: true|false
}
export default memo(({list = [],
@@ -28,7 +27,9 @@ export default memo(({list = [],
children,
heightItem = 100,
refresherTriggered = false,
- selfOnRefresherRefresh
+ selfOnRefresherRefresh,
+ selfOnScrolltolower,
+ hasMore = true
}: Params) => {
let num_half = useRef(0)
@@ -36,17 +37,21 @@ export default memo(({list = [],
const [selected, setSelected] = useState(defaultValue)
const [tabId, setTabId] = useState('')
+ useEffect(() => {
+ setSelected(defaultValue)
+ }, [defaultValue])
+
const init = () => {
const index = list?.findIndex(item => {
- return item.value == defaultValue
+ return item.id == defaultValue
})
if(index !== -1) {
computeSelectTab(index)
}
}
- const clickEvent = ({item, index}: {item:ListProps, index:number}) => {
- setSelected(item.value)
+ const clickEvent = ({item, index}: {item, index:number}) => {
+ setSelected(item.id)
sideBarOnClick?.(item)
computeSelectTab(index)
}
@@ -54,9 +59,10 @@ export default memo(({list = [],
const computeSelectTab = (index) => {
if((index + 1) > num_half.current) {
let num = index + 1 - num_half.current
- setTabId(list[num].value.toString())
+ setTabId(list[num].id.toString())
} else {
- setTabId(list[0].value.toString())
+ setTabId(list[0].id.toString())
+
}
}
@@ -75,10 +81,7 @@ export default memo(({list = [],
})
})
- //触底事件
- const onScrolltolower = () => {
- console.log('触底了')
- }
+
return (
<>
@@ -88,14 +91,14 @@ export default memo(({list = [],
list?.map((item, index) => {
return(
clickEvent({item, index})}
- id={`tab_${item.value}`}
- key={item.value}
+ id={`tab_${item.id}`}
+ key={item.id}
style={{height:heightItem+'rpx'}}
>
- {item.title}
+ {item.name}
)
@@ -104,7 +107,7 @@ export default memo(({list = [],
- onScrolltolower()} refresherTriggered={refresherTriggered} refresherEnabled={true} selfOnRefresherRefresh={() => selfOnRefresherRefresh?.()}>
+ selfOnScrolltolower?.()} refresherTriggered={refresherTriggered} refresherEnabled={true} selfOnRefresherRefresh={() => selfOnRefresherRefresh?.()}>
{children}
diff --git a/src/components/swiper/index.tsx b/src/components/swiper/index.tsx
deleted file mode 100644
index af56652..0000000
--- a/src/components/swiper/index.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-import { Image, Swiper, SwiperItem, View } from "@tarojs/components"
-import { goLink } from "@/common/common"
-import Taro from "@tarojs/taro"
-import styles from './index.module.scss'
-
-type item = {title:string, img:string, url:string, id:number}
-
-type params = {
- list?: item[]
- swiperOnClick?: (val: item) => void,
- style?: Object
-}
-export default (props:params) => {
- let {list = [], swiperOnClick, style = {}} = props
- list = [
- {
- title:'数据',
- img:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2F811%2F021315104H2%2F150213104H2-3-1200.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1651817947&t=5467a207f845ddfc7737d55934e6b26d',
- url:'',
- id:1
- },
- {
- title:'数据',
- img:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2F811%2F021315104H2%2F150213104H2-3-1200.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1651817947&t=5467a207f845ddfc7737d55934e6b26d',
- url:'',
- id:2
- }
- ]
-
- return (
-
-
- {
- list.map(item => {
- return
- goLink(`/pages/classList/index?id=${item.id}`)}>
-
-
-
- })
- }
-
-
- )
-
-}
\ No newline at end of file
diff --git a/src/pages/details/components/swiper/index.tsx b/src/pages/details/components/swiper/index.tsx
index c05ed1a..f0788dd 100644
--- a/src/pages/details/components/swiper/index.tsx
+++ b/src/pages/details/components/swiper/index.tsx
@@ -1,15 +1,16 @@
import { Image, Swiper, SwiperItem, View } from "@tarojs/components"
-import { useMemo, useState } from "react"
+import { useMemo, useRef, useState } from "react"
import styles from './index.module.scss'
type item = {title:string, img:string, url:string, id:number}
type params = {
list?: item[]
- }
+}
export default ({list = []}: params) => {
const [pageIndex, setPageIndex] = useState(1)
+ const pageRef = useRef(null)
const pageCount = useMemo(() => {
return list.length
@@ -17,7 +18,9 @@ export default ({list = []}: params) => {
const swiperChange = (e) => {
setPageIndex(e.detail.current + 1)
+ pageRef.current.innerHTML = 2
}
+
return (
@@ -30,7 +33,7 @@ export default ({list = []}: params) => {
})}
- {pageIndex+'/'+pageCount}
+ {pageIndex+'/'+pageCount}
)
}
\ No newline at end of file
diff --git a/src/pages/details/index.tsx b/src/pages/details/index.tsx
index d4a034d..440e62c 100644
--- a/src/pages/details/index.tsx
+++ b/src/pages/details/index.tsx
@@ -11,6 +11,7 @@ import { useEffect, useMemo, useState } from 'react';
import useManualPullDownRefresh from '@/use/useManualPullDownRefresh';
import { goLink } from '@/common/common';
import useUserInfo from '@/use/useUserInfo';
+
type item = {title:string, img:string, url:string, id:number}
type params = {
@@ -48,9 +49,6 @@ export default (props:params) => {
const [showOrderCount, setShowOrderCount] = useState(false)
- // const showCartmemo = useMemo(() => {
- // return showCart
- // },[showCart])
const html = `这里是详情
你好啊啊
@@ -105,6 +103,7 @@ export default (props:params) => {
})
const {user} = useUserInfo()
+
return (
diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx
index aea1ece..000158f 100644
--- a/src/pages/index/index.tsx
+++ b/src/pages/index/index.tsx
@@ -1,5 +1,5 @@
import {View} from '@tarojs/components'
-import Swiper from '@/components/swiper'
+import Banner from '@/components/banner'
import Search from '@/components/search'
import SideBar from '@/components/sideBar'
import Product from '@/components/product'
@@ -7,50 +7,77 @@ import MoveBtn from '@/components/moveBtn'
import ShopCart from '@/components/shopCart'
import styles from './index.module.scss'
import { goLink } from '@/common/common'
-import { useEffect, useState } from 'react'
+import { useEffect, useRef, useState } from 'react'
import Taro, { useDidShow, usePullDownRefresh, useRouter } from '@tarojs/taro'
import useManualPullDownRefresh from '@/use/useManualPullDownRefresh'
-import useUserInfo from '@/use/useUserInfo'
+import {GetProductKindListApi, GetProductListApi} from '@/api/material'
export default () => {
- const tabs_list = [
- {title:'平纹系列', value: 1},
- {title:'平纹系列', value: 2},
- {title:'平纹系列', value: 3},
- {title:'平纹系列', value: 4},
- {title:'平纹系列', value: 5},
- {title:'平纹系列', value: 6},
- {title:'平纹系列', value: 7},
- {title:'平纹系列', value: 8},
- {title:'平纹系列', value: 9},
- {title:'平纹系列', value: 10},
- {title:'平纹系列', value: 11},
- {title:'平纹系列', value: 12},
- {title:'平纹系列', value: 13},
- {title:'平纹系列', value: 14},
- {title:'平纹系列', value: 15},
- {title:'平纹系列', value: 16},
- {title:'平纹系列', value: 17},
- ]
+
+
+ useEffect(() => {
+ categoryList()
+ }, [])
+
+ //获取面料种类
+ const [kindData, setKindData] = useState({list:[], defaultId:0})
+ const {fetchData} = GetProductKindListApi()
+ const categoryList = async () => {
+ const res = await fetchData()
+ setKindData({...kindData, list:res.data.list, defaultId: res.data.list[0].id})
+ filtrate.current.product_kind_id = res.data.list[0].id
+ getProductList()
+ }
+
+ //获取面料列表
+ const [productData, setProductData] = useState({list:[], total:0, hasMore:true})
+ const filtrate = useRef({product_kind_id:0, size: 5,page: 1})
+ const pageNum = useRef(1)
+ const {fetchData: productFetchData, state: productState} = GetProductListApi()
+ const getProductKindId = async (e) => {
+ filtrate.current.size = 5
+ pageNum.current = 1
+ filtrate.current.product_kind_id = e.id
+ getProductList()
+ }
+ const getProductList = async () => {
+ filtrate.current.size = filtrate.current.size * pageNum.current
+ const {data,total} = await productFetchData(filtrate.current)
+ setProductData({...productData,list:data.list,total})
+ }
+
+ //上拉加载数据
+ const getScrolltolower = () => {
+ if(productData.list.length >= productData.total) {
+ setProductData({...productData, hasMore: false})
+ } else {
+ pageNum.current++
+ getProductList()
+ }
+ }
+
const [showShopCart, setShowShopCart] = useState(false)
+ //列表下拉刷新
+ const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false)
+ const getRefresherRefresh = async () => {
+ filtrate.current.size = 5
+ pageNum.current = 1
+ getProductList()
+ }
+ useEffect(() => {
+ setRefresherTriggeredStatus(productState.loading)
+ }, [productState.loading])
+
//页面下拉刷新
const res = useManualPullDownRefresh()
-
- const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false)
- const getData = () => {
- setRefresherTriggeredStatus(true)
- setTimeout(() => {
- setRefresherTriggeredStatus(() => false)
- console.log('12123')
- }, 1000)
- }
+
return (
setShowShopCart(!showShopCart)}>
-
+
我的收藏
@@ -58,8 +85,8 @@ export default () => {
- getData()}>
-
+ getScrolltolower()} sideBarOnClick={(e) => getProductKindId(e)} heightItem={150} refresherTriggered={refresherTriggeredStatus} selfOnRefresherRefresh={() => getRefresherRefresh()}>
+
diff --git a/src/pages/order/components/remark/index.tsx b/src/pages/order/components/remark/index.tsx
index 404e232..67d6bb6 100644
--- a/src/pages/order/components/remark/index.tsx
+++ b/src/pages/order/components/remark/index.tsx
@@ -11,11 +11,14 @@ export default ({onBlur, onSave}:Param) => {
const [descData, setDescData] = useState({
number: 0,
value: '',
- count: 10
+ count: 200
})
const getDesc = useCallback((e) => {
let value = e.detail.value
- let res = value.slice(0, descData.count)
+ let res = value
+ if(value.length > descData.count) {
+ res = value.slice(0, descData.count)
+ }
setDescData({...descData, number:res.length, value: res})
},[])
@@ -26,7 +29,7 @@ export default ({onBlur, onSave}:Param) => {
添加备注
-
+
{descData.number}/{descData.count}
setSave()}>保存
diff --git a/src/reducers/index.ts b/src/reducers/index.ts
index 2af35af..8964c5d 100644
--- a/src/reducers/index.ts
+++ b/src/reducers/index.ts
@@ -2,5 +2,5 @@ import { combineReducers } from 'redux'
import userInfo from './userInfo'
export default combineReducers({
- userInfo
+ userInfo
})
\ No newline at end of file
diff --git a/src/reducers/userInfo.ts b/src/reducers/userInfo.ts
index 5cfd21b..cd46829 100644
--- a/src/reducers/userInfo.ts
+++ b/src/reducers/userInfo.ts
@@ -1,6 +1,13 @@
import Taro from '@tarojs/taro'
-import { SET_USERINFO, SET_TOKEN, SET_SESSIONKEY, CLEAR_TOKEN, CLEAR_USERINFO, CLEAR_SESSIONKEY} from '../constants/userInfo'
+import {
+ SET_USERINFO,
+ SET_TOKEN,
+ SET_SESSIONKEY,
+ CLEAR_TOKEN,
+ CLEAR_USERINFO,
+ CLEAR_SESSIONKEY
+} from '../constants/userInfo'
export type UserParam = {
name?:string,
@@ -8,16 +15,18 @@ export type UserParam = {
avatarUrl?:string,
}
+export type DataParam = {
+ token?: string
+ sessionkey?: string,
+ userInfo: UserParam
+ }
+
type Action = {
type?: string,
data?: DataParam
}
-export type DataParam = {
- token?: string
- sessionkey?: string,
- userInfo: UserParam
-}
+
const INIT_USER = {
userInfo: Taro.getStorageSync('userInfo')?JSON.parse(Taro.getStorageSync('userInfo')):null,
diff --git a/src/use/useHttp.ts b/src/use/useHttp.ts
index 64af04d..1f1b8c8 100644
--- a/src/use/useHttp.ts
+++ b/src/use/useHttp.ts
@@ -2,10 +2,9 @@
import Taro from '@tarojs/taro'
import { useRef, useState } from 'react'
+import {BASE_URL} from '@/common/constant'
import qs from 'qs';
-
-
type Params = {
code: string|null
success: true|false
@@ -24,6 +23,16 @@ type Params = {
pageSize?: number
}
+type option = {
+ url?: string,
+ method?: 'get'|'post'|'put'|'delete',
+ type?: string,
+ data?: any,
+ page?: number,
+ pageSize?: number,
+ pagination?: true|false
+}
+
/**
* 返回状态信息,根据 http 状态错
* @param {Number} status
@@ -80,7 +89,7 @@ const showStatus = (status) => {
* @param {Object} options.data 请求的参数
* @returns {Object} 返回fetch(), loading, error, code, msg
*/
-export const useRequest = (options = {
+export const useRequest = (options:option = {
url: '/',
method: 'get',
type: 'json',
@@ -90,7 +99,7 @@ export const useRequest = (options = {
pagination: false, // 是否分页
}) => {
-
+ options.url = `${BASE_URL}${options.url}`
let params:Params = {
code: null, // 业务码
success: false, // 请求是否成功
@@ -110,43 +119,8 @@ export const useRequest = (options = {
const stateRef = useRef({...params})
const [state, setState] = useState({...stateRef.current})
- // // 每页多少条记录
- // const handleSizeChange = (val) => {
- // state.size = val
- // }
-
- // // 当前
- // const handleCurrentChange = (val) => {
- // state.page = val
- // }
-
- // /**
- // * 筛选搜索
- // * @param {Object} val `{name:'ppx'}` name 为字段名,ppx 为字段内容
- // */
- // const handleFilterChange = (val) => {
- // state.filter = val
- // }
-
- // 排序
-
- /**
- * 排序字段,排序方式
- * @param {String} val 排序字段
- * @param {String} sortOrder `desc` / `asc`
- */
- // eslint-disable-next-line
- const handleSort = (val, orderby = "desc") => {
- if (val != null) {
- stateRef.current.sort = orderby ? {
- sort_key: `${orderby == 'desc' ? '-' + val : val}`
- } : null
- }
-
- }
-
// 请求函数
- const fetchData = async (sub_options) => {
+ const fetchData = async (sub_options?:any) => {
stateRef.current.loading = true
setState((e) => ({...e, loading:true}))
stateRef.current.query = {
@@ -164,7 +138,7 @@ export const useRequest = (options = {
...options,
...{
header: {
- "Platform": 3,
+ "Platform": 6,
"Authorization": token || stateRef.current.token,
}
},
@@ -214,7 +188,6 @@ export const useRequest = (options = {
}
return {
- handleSort,
fetchData,
state,
}
From 883c24b7bea677446ebea60dc498dfe18c5166cd Mon Sep 17 00:00:00 2001
From: czm <2192718639@qq.com>
Date: Fri, 6 May 2022 18:41:30 +0800
Subject: [PATCH 15/18] =?UTF-8?q?=E5=AF=B9=E6=8E=A5api3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/login.ts | 12 +++
src/api/material.ts | 14 ++-
src/api/materialColor.ts | 12 +++
src/api/shopCart.ts | 12 +++
src/components/product/index.tsx | 2 +-
src/components/shopCart/index.tsx | 23 ++--
.../details/components/orderCount/index.tsx | 58 +++++-----
src/pages/details/index.tsx | 82 +++++++-------
src/pages/index/index.tsx | 70 +++++++-----
src/use/useHttp.ts | 15 +--
src/use/useLogin.ts | 102 ++++++++++++++++++
src/use/useLogin.tsx | 87 ---------------
src/use/useUserInfo.ts | 4 +-
src/util/checkLogin.ts | 4 +
14 files changed, 294 insertions(+), 203 deletions(-)
create mode 100644 src/api/login.ts
create mode 100644 src/api/materialColor.ts
create mode 100644 src/api/shopCart.ts
create mode 100644 src/use/useLogin.ts
delete mode 100644 src/use/useLogin.tsx
create mode 100644 src/util/checkLogin.ts
diff --git a/src/api/login.ts b/src/api/login.ts
new file mode 100644
index 0000000..b45eca6
--- /dev/null
+++ b/src/api/login.ts
@@ -0,0 +1,12 @@
+import { useRequest } from "@/use/useHttp"
+
+/**
+ * 登录
+ * @returns
+*/
+export const Login = () => {
+ return useRequest({
+ url: `/v1/mall/login`,
+ method: "post",
+ })
+}
\ No newline at end of file
diff --git a/src/api/material.ts b/src/api/material.ts
index a1d75ab..1b47f30 100644
--- a/src/api/material.ts
+++ b/src/api/material.ts
@@ -32,4 +32,16 @@ export const GetProductListApi = () => {
url: `/v1/mall/product/list`,
method: "get",
})
-}
\ No newline at end of file
+}
+
+/**
+ * 获取面料详情
+ * @returns
+*/
+export const GetProductDetailApi = () => {
+ return useRequest({
+ url: `/v1/mall/product`,
+ method: "get",
+ })
+}
+
diff --git a/src/api/materialColor.ts b/src/api/materialColor.ts
new file mode 100644
index 0000000..589241e
--- /dev/null
+++ b/src/api/materialColor.ts
@@ -0,0 +1,12 @@
+import { useRequest } from "@/use/useHttp"
+
+/**
+ * 获取面料颜色列表
+ * @returns
+*/
+export const GetColorList = () => {
+ return useRequest({
+ url: `/v1/mall/product/color/list`,
+ method: "get",
+ })
+}
diff --git a/src/api/shopCart.ts b/src/api/shopCart.ts
new file mode 100644
index 0000000..8d292bf
--- /dev/null
+++ b/src/api/shopCart.ts
@@ -0,0 +1,12 @@
+import { useRequest } from "@/use/useHttp"
+
+/**
+ * 获取购物车列表
+ * @returns
+*/
+export const GetShoppingCartApi = () => {
+ return useRequest({
+ url: `/v1/mall/shoppingCart/productColor`,
+ method: "get",
+ })
+}
\ No newline at end of file
diff --git a/src/components/product/index.tsx b/src/components/product/index.tsx
index ede8ddc..2f29417 100644
--- a/src/components/product/index.tsx
+++ b/src/components/product/index.tsx
@@ -11,7 +11,7 @@ export default ({desStatus = true, productList = []}:Params) => {
return (
{productList.map(item => {
- return goLink('/pages/details/index?id=1')}>
+ return goLink(`/pages/details/index?id=${item.id}`)}>
{item.product_color_count}色
diff --git a/src/components/shopCart/index.tsx b/src/components/shopCart/index.tsx
index 775b2cd..5dba441 100644
--- a/src/components/shopCart/index.tsx
+++ b/src/components/shopCart/index.tsx
@@ -8,6 +8,7 @@ import styles from "./index.module.scss"
import { useEffect, useState } from "react";
import Taro from "@tarojs/taro";
import { goLink } from "@/common/common";
+import {GetShoppingCartApi} from "@/api/shopCart"
type param = {
show?: true|false,
@@ -20,21 +21,21 @@ export default ({show = false, onClose}: param) => {
setSelectIndex(index)
}
+ //获取数据
const [list, setList] = useState([])
const [loading, setLoading] = useState(false)
+ const {fetchData} = GetShoppingCartApi()
+ const getShoppingCart = async () => {
+ setLoading(true)
+ const {data} = await fetchData()
+ setList(data)
+ setLoading(false)
+ }
+
useEffect(() => {
if(!show) return
- let lists:any[] = []
- for(let i = 0; i < 20; i++) {
- lists = [...lists, {
- title:`${i}#薄荷绿`,
- subtitle: '0770# 21S单面平纹(食毛)',
- tag: '剪板',
- select: i%2?true: false
- }]
- }
- setList([...lists])
+ getShoppingCart()
}, [show])
useEffect(() => {
@@ -137,7 +138,7 @@ export default ({show = false, onClose}: param) => {
})}
}
- {!loading&&list.length > 0&&
+ {!loading&&list.length == 0 &&
暂未选择商品
去选购
}
diff --git a/src/pages/details/components/orderCount/index.tsx b/src/pages/details/components/orderCount/index.tsx
index eb5c0c4..731752f 100644
--- a/src/pages/details/components/orderCount/index.tsx
+++ b/src/pages/details/components/orderCount/index.tsx
@@ -7,41 +7,44 @@ import Counter from "../counter";
import Big from 'big.js'
import classnames from "classnames";
import styles from "./index.module.scss"
-import { memo, useEffect, useState } from "react";
+import { memo, useEffect, useRef, useState } from "react";
+import {GetColorList} from "@/api/materialColor"
+import { useRouter } from "@tarojs/taro";
type param = {
show?: true|false,
- onClose?: () => void
+ onClose?: () => void,
+ title?: string,
+ productId?: number
}
-export default memo(({show = false, onClose}: param) => {
+export default memo(({show = false, onClose, title = '', productId = 0}: param) => {
const selectList = [
- {step:1, digits:2, title:'剪板', unit:'米'},
- {step:1, digits:2, title:'散剪', unit:'米'},
- {step:1, digits:0, title:'大货', unit:'件'}
+ {id: 0, step:1, digits:0, title:'大货', unit:'件', eunit:'kg'},
+ {id: 1, step:1, digits:2, title:'剪板', unit:'米', eunit:'m'},
+ {id: 2, step:1, digits:2, title:'散剪', unit:'米', eunit:'m'},
]
const [selectIndex, setSelectIndex] = useState(0)
const selectProduct = (index:number) => {
setSelectIndex(index)
}
-
+
+ //获取面料颜色列表
+ const {fetchData:colorFetchData} = GetColorList()
const [list, setList] = useState([])
const [loading, setLoading] = useState(false)
-
- console.log('执行执行')
+ const condition = useRef({physical_warehouse:1, sale_mode:selectIndex, product_id:0})
+ const getColorList = async () => {
+ setLoading(() => true)
+ let {data} = await colorFetchData(condition.current)
+ setList([...data.list])
+ setLoading(() => false)
+ }
useEffect(() => {
- if(!show) return
- let lists:any[] = []
- for(let i = 0; i < 20; i++) {
- lists = [...lists, {
- title:`${i}#薄荷绿`,
- subtitle: '0770# 21S单面平纹(食毛)',
- tag: '剪板',
- count:0,
- show: false,
- }]
- }
- setList([...lists])
+ if(show) {
+ condition.current.product_id = productId
+ getColorList()
+ }
}, [show])
useEffect(() => {
@@ -62,7 +65,6 @@ export default memo(({show = false, onClose}: param) => {
setShowPopup(false)
}
-
//计算总数量和总米/件数
const [selectCount, setSelectCount] = useState({
sumCount: 0,
@@ -98,12 +100,17 @@ export default memo(({show = false, onClose}: param) => {
setSearchShow(true)
}
+ const addShopCart = () => {
+
+ }
+
return (
+
closePopup()}>
- 0770# 21S单面平纹(食毛)
+ {title}
下单类型:
@@ -119,9 +126,10 @@ export default memo(({show = false, onClose}: param) => {
setSearchShow(false)}>取消
}
- 颜色分类 (13)
+ 颜色分类 (13) {list.length}
changeSearchShow()}>
+
{list.length > 0&&
@@ -156,7 +164,7 @@ export default memo(({show = false, onClose}: param) => {
当前已选{selectCount.kindCount}种,共{selectCount.sumCount}{selectList[selectIndex].unit}
- 加入购物车
+ addShopCart()}>加入购物车
diff --git a/src/pages/details/index.tsx b/src/pages/details/index.tsx
index 440e62c..670b51a 100644
--- a/src/pages/details/index.tsx
+++ b/src/pages/details/index.tsx
@@ -1,5 +1,5 @@
-import { Button, Image, RichText, Swiper, SwiperItem, Text, View } from '@tarojs/components'
+import { Button, Image, RichText, ScrollView, Swiper, SwiperItem, Text, View } from '@tarojs/components'
import Taro, { useDidShow, useRouter, useShareAppMessage } from '@tarojs/taro';
import classnames from "classnames";
import DesSwiper from './components/swiper';
@@ -8,9 +8,11 @@ import ShopCart from '@/components/shopCart';
import Preview,{colorItem} from './components/preview';
import styles from './index.module.scss'
import { useEffect, useMemo, useState } from 'react';
+import {formatHashTag} from '@/common/fotmat'
import useManualPullDownRefresh from '@/use/useManualPullDownRefresh';
import { goLink } from '@/common/common';
import useUserInfo from '@/use/useUserInfo';
+import {GetProductDetailApi} from '@/api/material'
type item = {title:string, img:string, url:string, id:number}
@@ -22,12 +24,22 @@ type params = {
export default (props:params) => {
const router = useRouter()
- useEffect(() => {
- console.log('router::',router)
- }, [])
- //页面下拉刷新
- const res = useManualPullDownRefresh()
+ //获取数据
+ const [productInfo, setProductInfo] = useState({})
+ const {fetchData} = GetProductDetailApi()
+ useEffect(() => {
+ getProductDetail()
+ }, [])
+ const getProductDetail = async () => {
+ let {data} = await fetchData({id: router.params.id})
+ setProductInfo(data)
+ }
+
+ //面料名称
+ const productName = useMemo(() => {
+ return formatHashTag(productInfo.code, productInfo.name)
+ },[productInfo])
const list = [
{
@@ -46,8 +58,6 @@ export default (props:params) => {
const [showCart, setShowCart] = useState(false)
-
-
const [showOrderCount, setShowOrderCount] = useState(false)
const html = `这里是详情
@@ -55,27 +65,13 @@ export default (props:params) => {
`
- const colorList = [
- {
- title:'#1',
- img:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2F811%2F021315104H2%2F150213104H2-3-1200.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1651817947&t=5467a207f845ddfc7737d55934e6b26d',
- url:'',
- id:1
- },
- {
- title:'#1',
- img:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2F811%2F021315104H2%2F150213104H2-3-1200.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1651817947&t=5467a207f845ddfc7737d55934e6b26d',
- url:'',
- id:1
- },
-
- ]
+
const [colorInfo, setColorInfo] = useState()
const [showPreview, setShowPreview] = useState(false)
const getColorItem = (item) => {
setColorInfo({
- title: item.title,
- img: item.img,
+ title: item.code,
+ img: item.texture_url,
})
setShowPreview(true)
}
@@ -101,8 +97,6 @@ export default (props:params) => {
imageUrl: list[0].img
}
})
-
- const {user} = useUserInfo()
return (
@@ -110,8 +104,8 @@ export default (props:params) => {
- 0770# 21S单面平纹(食毛)
- 面料描述,疯狂描述。。。
+ {productName}
+ {productInfo.describe}
@@ -128,24 +122,24 @@ export default (props:params) => {
详情参数
- 编号:0770
- 幅宽:160cm
- 克重:160g
- 成分:67.6%棉24%涤纶6.4%氨纶%氨纶氨纶%氨纶
+ 编号:{productInfo.code}
+ 幅宽:{productInfo.width}
+ 克重:{productInfo.weight_density}
+ 成分:{productInfo.component}
色号 (10)
-
- {colorList.map(item => {
- return getColorItem(item)}>
-
-
-
- {item.title}
-
- })}
-
+
+ {productInfo?.product_color_list?.map(item => {
+ return getColorItem(item)}>
+
+
+
+ {item.code}
+
+ })}
+
@@ -157,7 +151,7 @@ export default (props:params) => {
setShowOrderCount(true)}>开始下单
- setShowOrderCount(false)}/>
+ setShowOrderCount(false)} title={productName} productId={productInfo.id}/>
setShowCart(false)}/>
setShowPreview(false)}/>
diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx
index 000158f..b3d42dc 100644
--- a/src/pages/index/index.tsx
+++ b/src/pages/index/index.tsx
@@ -5,16 +5,23 @@ import SideBar from '@/components/sideBar'
import Product from '@/components/product'
import MoveBtn from '@/components/moveBtn'
import ShopCart from '@/components/shopCart'
-import styles from './index.module.scss'
import { goLink } from '@/common/common'
+import styles from './index.module.scss'
import { useEffect, useRef, useState } from 'react'
-import Taro, { useDidShow, usePullDownRefresh, useRouter } from '@tarojs/taro'
+import Taro, { Events, useDidShow, usePullDownRefresh, useRouter } from '@tarojs/taro'
import useManualPullDownRefresh from '@/use/useManualPullDownRefresh'
+
import {GetProductKindListApi, GetProductListApi} from '@/api/material'
+import useLogin from '@/use/useLogin'
export default () => {
-
-
+
+ const {checkLogin} = useLogin()
+
+ useDidShow(() => {
+ checkLogin()
+ })
+
useEffect(() => {
categoryList()
}, [])
@@ -25,34 +32,42 @@ export default () => {
const categoryList = async () => {
const res = await fetchData()
setKindData({...kindData, list:res.data.list, defaultId: res.data.list[0].id})
- filtrate.current.product_kind_id = res.data.list[0].id
- getProductList()
+ setFiltrate({...filtrate, product_kind_id:res.data.list[0].id})
}
//获取面料列表
- const [productData, setProductData] = useState({list:[], total:0, hasMore:true})
- const filtrate = useRef({product_kind_id:0, size: 5,page: 1})
+ const [productData, setProductData] = useState({list:[], total:0})
+ const [hasMore, setHasMore] = useState(true)
+ const [filtrate, setFiltrate] = useState({product_kind_id:0, size: 5,page: 1})
const pageNum = useRef(1)
const {fetchData: productFetchData, state: productState} = GetProductListApi()
- const getProductKindId = async (e) => {
- filtrate.current.size = 5
- pageNum.current = 1
- filtrate.current.product_kind_id = e.id
- getProductList()
- }
+ //获取数据方法
const getProductList = async () => {
- filtrate.current.size = filtrate.current.size * pageNum.current
- const {data,total} = await productFetchData(filtrate.current)
+ const {data,total} = await productFetchData(filtrate)
setProductData({...productData,list:data.list,total})
+ setRefresherTriggeredStatus(() => false)
+ }
+ //监听查询条件
+ useEffect(() => {
+ if(filtrate.product_kind_id)
+ getProductList()
+ }, [filtrate])
+
+ //点击面料类型
+ const getProductKindId = async (e) => {
+ pageNum.current = 1
+ setFiltrate({...filtrate, size:5, product_kind_id:e.id})
+ setHasMore(true)
}
//上拉加载数据
const getScrolltolower = () => {
if(productData.list.length >= productData.total) {
- setProductData({...productData, hasMore: false})
+ setHasMore(false)
} else {
pageNum.current++
- getProductList()
+ const newSize = filtrate.size * pageNum.current
+ setFiltrate({...filtrate, size:newSize})
}
}
@@ -62,18 +77,21 @@ export default () => {
//列表下拉刷新
const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false)
const getRefresherRefresh = async () => {
- filtrate.current.size = 5
pageNum.current = 1
- getProductList()
+ setFiltrate({...filtrate, size:5})
+ setHasMore(true)
+ setRefresherTriggeredStatus(true)
}
- useEffect(() => {
- setRefresherTriggeredStatus(productState.loading)
- }, [productState.loading])
+
+
+
//页面下拉刷新
- const res = useManualPullDownRefresh()
+ // const res = useManualPullDownRefresh()
+ usePullDownRefresh(() => {
+ console.log('123')
+ })
-
return (
setShowShopCart(!showShopCart)}>
@@ -85,7 +103,7 @@ export default () => {
- getScrolltolower()} sideBarOnClick={(e) => getProductKindId(e)} heightItem={150} refresherTriggered={refresherTriggeredStatus} selfOnRefresherRefresh={() => getRefresherRefresh()}>
+ getScrolltolower()} sideBarOnClick={(e) => getProductKindId(e)} heightItem={150} refresherTriggered={refresherTriggeredStatus} selfOnRefresherRefresh={() => getRefresherRefresh()}>
diff --git a/src/use/useHttp.ts b/src/use/useHttp.ts
index 1f1b8c8..9999d05 100644
--- a/src/use/useHttp.ts
+++ b/src/use/useHttp.ts
@@ -2,9 +2,11 @@
import Taro from '@tarojs/taro'
import { useRef, useState } from 'react'
-import {BASE_URL} from '@/common/constant'
+import {BASE_URL, WX_APPID} from '@/common/constant'
+import useUserInfo from "./useUserInfo"
import qs from 'qs';
+
type Params = {
code: string|null
success: true|false
@@ -118,7 +120,7 @@ export const useRequest = (options:option = {
const stateRef = useRef({...params})
const [state, setState] = useState({...stateRef.current})
-
+ const {removeToken} = useUserInfo()
// 请求函数
const fetchData = async (sub_options?:any) => {
stateRef.current.loading = true
@@ -139,6 +141,7 @@ export const useRequest = (options:option = {
...{
header: {
"Platform": 6,
+ "Appid": WX_APPID,
"Authorization": token || stateRef.current.token,
}
},
@@ -167,10 +170,10 @@ export const useRequest = (options:option = {
title: `错误:${showStatus(statusCode)}`
})
if (statusCode === 401) {
- //未登录
- // Taro.reLaunch({
- // url: '/pages/login/index'
- // })
+ removeToken()
+ Taro.reLaunch({
+ url: '/pages/index/index'
+ })
}
}
diff --git a/src/use/useLogin.ts b/src/use/useLogin.ts
new file mode 100644
index 0000000..8cf3c09
--- /dev/null
+++ b/src/use/useLogin.ts
@@ -0,0 +1,102 @@
+import { useEffect, useState } from "react"
+import { WX_APPID } from "@/common/constant"
+import useUserInfo from "./useUserInfo"
+import Taro, { useRouter } from "@tarojs/taro"
+import { Login } from "@/api/login"
+
+
+export default () => {
+ const {setToken, setSessionKey, setUserInfo, userInfo} = useUserInfo()
+
+ useEffect(() => {
+ console.log('userInfo::',userInfo.token)
+ }, [userInfo])
+
+ //登录请求
+ const {fetchData} = Login()
+ const loginRequest = async (code) => {
+ const {data, success} = await fetchData({js_code: code})
+ if(success) {
+ setToken(data.token)
+ setSessionKey(data.session_key)
+ } else {
+ Taro.showToast({
+ title:'登录失败',
+ icon:"none"
+ })
+ }
+ }
+
+ //微信登录
+ const wxLogin = () => {
+ Taro.login({
+ success: function async (res) {
+ if (res.code) {
+ loginRequest(res.code)
+ } else {
+ console.log('登录失败!' + res.errMsg)
+ }
+ },
+ fail: function(e) {
+ console.log('登录失败!::',e)
+ }
+ })
+ }
+
+ const router = useRouter()
+ //登录加checkLogin检查
+ const checkLogin = () => {
+ if(!userInfo.token) {
+ wxLogin()
+ if(router.path != '/pages/index/index') {
+ Taro.reLaunch({
+ url: '/pages/index/index'
+ })
+ }
+ } else {
+ Taro.checkSession({
+ fail () {
+ wxLogin()
+ }
+ })
+ }
+
+ }
+
+ //获取用户头像等信息数据
+ const getUserInfo = () => {
+ Taro.getUserProfile({
+ desc: '用于完善会员资料',
+ success: (res) => {
+ Taro.request({
+ url: 'https://dev.zzfzyc.com/lymarket/v1/mall/user/decrypt',
+ method: 'POST',
+ data: {
+ session_key: userInfo.sessionkey,
+ raw_data: res.rawData,
+ signature: res.signature,
+ encrypted_data: res.encryptedData,
+ iv: res.iv
+ },
+ header: {
+ platform: 6,
+ Authorization: userInfo.token,
+ Appid: WX_APPID
+ },
+ success: (e) => {
+ setUserInfo({})
+ },
+ fail: (e) => {
+ console.log(e)
+ }
+ })
+ }
+ })
+ }
+
+ return {
+ checkLogin,
+ wxLogin,
+ getUserInfo
+ }
+}
diff --git a/src/use/useLogin.tsx b/src/use/useLogin.tsx
deleted file mode 100644
index 2541549..0000000
--- a/src/use/useLogin.tsx
+++ /dev/null
@@ -1,87 +0,0 @@
-import { useEffect, useState } from "react"
-import { WX_APPID } from "@/common/constant"
-import useUserInfo from "./useUserInfo"
-
-
-export default () => {
- const {setToken, setSessionKey, setUserInfo} = useUserInfo()
-
- const [loginState, setLoginState] = useState({
- session_key: '',
- token: '',
- userInfo: ''
- })
-
- const getToken = () => {
- Taro.login({
- success: function (res) {
- if (res.code) {
- console.log('number::', res.code)
- Taro.request({
- url: 'https://dev.zzfzyc.com/lymarket/v1/mall/login',
- method: 'POST',
- data: {
- js_code: res.code,
- },
- header: {
- platform: 6,
- Appid: WX_APPID
- },
- success: (e) => {
- let {data} = e.data
- setLoginState({
- ...loginState,
- session_key: data.session_key,
- token: data.token
- })
- setToken(data.token)
- setLoginState(data.session_key)
- }
- })
- } else {
- console.log('登录失败!' + res.errMsg)
- }
- },
- fail: function(e) {
- console.log('e::',e)
- }
- })
- }
-
- const getUserInfo = () => {
- Taro.getUserProfile({
- desc: '用于完善会员资料',
- success: (res) => {
- Taro.request({
- url: 'https://dev.zzfzyc.com/lymarket/v1/mall/user/decrypt',
- method: 'POST',
- data: {
- session_key: loginState.session_key,
- raw_data: res.rawData,
- signature: res.signature,
- encrypted_data: res.encryptedData,
- iv: res.iv
- },
- header: {
- platform: 6,
- Authorization: loginState.token,
- Appid: WX_APPID
- },
- success: (e) => {
- setUserInfo({})
- },
- fail: (e) => {
- console.log(e)
- }
- })
- }
- })
-
-
- }
-
- return {
- getToken,
- getUserInfo
- }
-}
\ No newline at end of file
diff --git a/src/use/useUserInfo.ts b/src/use/useUserInfo.ts
index cdf67ec..4caf5a4 100644
--- a/src/use/useUserInfo.ts
+++ b/src/use/useUserInfo.ts
@@ -2,7 +2,7 @@ import { useDispatch, useSelector } from 'react-redux'
import { CLEAR_SESSIONKEY, SET_USERINFO, SET_TOKEN, SET_SESSIONKEY, CLEAR_USERINFO, CLEAR_TOKEN} from '@/constants/userInfo'
import {DataParam, UserParam} from '@/reducers/userInfo'
export default () => {
- const user = useSelector((state:DataParam) => state.userInfo) as DataParam
+ const userInfo = useSelector((state:DataParam) => state.userInfo) as DataParam
const dispatch = useDispatch()
const setToken = (token: string) => {
@@ -36,6 +36,6 @@ export default () => {
removeUserInfo,
removeToken,
removeSessionKey,
- user, //响应式数据返回
+ userInfo, //响应式数据返回
}
}
\ No newline at end of file
diff --git a/src/util/checkLogin.ts b/src/util/checkLogin.ts
new file mode 100644
index 0000000..cc00e0b
--- /dev/null
+++ b/src/util/checkLogin.ts
@@ -0,0 +1,4 @@
+
+export const checkLogin = () => {
+
+}
\ No newline at end of file
From d03105a7d03715aae8cb57a9ffae923d587cca5a Mon Sep 17 00:00:00 2001
From: czm <2192718639@qq.com>
Date: Sat, 7 May 2022 18:51:13 +0800
Subject: [PATCH 16/18] =?UTF-8?q?=E5=B7=B2=E5=AF=B9=E6=8E=A5=E7=99=BB?=
=?UTF-8?q?=E5=BD=95=E5=92=8C=E4=B8=8B=E5=8D=95=E9=80=89=E6=8B=A9=E5=95=86?=
=?UTF-8?q?=E5=93=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/login.ts | 4 +-
src/api/user.ts | 31 ++++
src/common/constant.js | 3 +-
src/common/util.js | 1 -
src/components/search/index.tsx | 2 +-
.../details/components/counter/index.tsx | 17 +-
.../components/orderCount/index.module.scss | 6 +
.../details/components/orderCount/index.tsx | 86 +++++++---
src/pages/details/index.tsx | 5 +
src/pages/index/index.tsx | 5 +-
src/reducers/userInfo.ts | 18 +-
src/use/useHttp.ts | 20 ++-
src/use/useLogin.ts | 154 ++++++++++--------
src/use/useUserInfo.ts | 2 +-
14 files changed, 228 insertions(+), 126 deletions(-)
create mode 100644 src/api/user.ts
diff --git a/src/api/login.ts b/src/api/login.ts
index b45eca6..a7cb935 100644
--- a/src/api/login.ts
+++ b/src/api/login.ts
@@ -4,9 +4,9 @@ import { useRequest } from "@/use/useHttp"
* 登录
* @returns
*/
-export const Login = () => {
+export const LoginApi = () => {
return useRequest({
url: `/v1/mall/login`,
method: "post",
})
-}
\ No newline at end of file
+}
diff --git a/src/api/user.ts b/src/api/user.ts
new file mode 100644
index 0000000..c97e29e
--- /dev/null
+++ b/src/api/user.ts
@@ -0,0 +1,31 @@
+import { useRequest } from "@/use/useHttp"
+
+/**
+ * 解密用户微信信息
+ */
+ export const GetWxUserInfoApi = () => {
+ return useRequest({
+ url: `/v1/mall/user/decrypt`,
+ method: "post",
+ })
+}
+
+/**
+ * 获取后台返回的用户信息
+ */
+ export const GetSelfUserInfoApi = () => {
+ return useRequest({
+ url: `/v1/mall/user/info`,
+ method: "get",
+ })
+}
+
+/**
+ * 获取后台返回的用户手机号码信息
+ */
+ export const GetPhoneNumberApi = () => {
+ return useRequest({
+ url: `/v1/mall/user/phoneNumber`,
+ method: "post",
+ })
+}
diff --git a/src/common/constant.js b/src/common/constant.js
index 77ea9a4..4ce9f4c 100644
--- a/src/common/constant.js
+++ b/src/common/constant.js
@@ -5,10 +5,11 @@
// export const BASE_URL = `http://192.168.0.89:40001/lymarket`
// export const BASE_URL = `http://192.168.1.165:40001/lymarket` // 王霞
// export const BASE_URL = `https://test.zzfzyc.com/lymarket` // 测试环境
-export const BASE_URL = `http://192.168.1.30:40001/lymarket` // 发
+// export const BASE_URL = `http://192.168.1.30:40001/lymarket` // 发
// export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境
// export const BASE_URL = `https://www.zzfzyc.com/lymarket` // 正式环境
// export const BASE_URL = `http://192.168.1.165:40001/lymarket` // 王霞
+export const BASE_URL = `http://192.168.1.224:50001/lymarket` // 添
// CDN
// 生成密钥
diff --git a/src/common/util.js b/src/common/util.js
index 323856d..14921f7 100644
--- a/src/common/util.js
+++ b/src/common/util.js
@@ -44,7 +44,6 @@ export const throttle = (fn, delay) => {
for(let key in val) {
if(val[key]!=undefined&&val[key]!=null&&(!arr.includes(key))){
if(val[key] instanceof Number){
- console.log("+++",val[key]);
if(!isNaN(val[key])) {
res[key] = val[key]
}
diff --git a/src/components/search/index.tsx b/src/components/search/index.tsx
index 75b5958..0138c7e 100644
--- a/src/components/search/index.tsx
+++ b/src/components/search/index.tsx
@@ -16,7 +16,7 @@ type Params = {
showBtn?: false|true,
btnStyle?: Object,
btnTitle?: string,
- debounceTime?: number //防抖时间,不设默认wei'ling
+ debounceTime?: number //防抖时间,不设默认为零
}
export default memo(({
diff --git a/src/pages/details/components/counter/index.tsx b/src/pages/details/components/counter/index.tsx
index 3640a59..d7f632d 100644
--- a/src/pages/details/components/counter/index.tsx
+++ b/src/pages/details/components/counter/index.tsx
@@ -3,18 +3,19 @@ import { useEffect, useMemo, useRef, useState } from "react"
import Big from 'big.js'
import styles from "./index.module.scss"
type params = {
- minNum?: number,
- maxNum?: number,
- step?: number,
- defaultNum?: number,
+ minNum?: number, //最小值
+ maxNum?: number, //最大值
+ step?: number, //步长
+ defaultNum?: number, //默认值
digits?: number //多少位小数
- onChange?:(val:number) => void,
- onBlue?:(val:number) => void,
- onClickBtn?:(val:number) => void,
+ onChange?:(val:number) => void,
+ onBlue?:(val:number) => void, //失去焦点触发
+ onClickBtn?:(val:number) => void,
unit?: string
}
export default ({minNum = 0, maxNum = 100, step=1, digits = 0, defaultNum = 0, onChange, onBlue, onClickBtn, unit = ''}: params) => {
const [value, setValue] = useState({count:defaultNum})
+
const onPlus = () => {
let {count} = value
let num_res = Big(count).add(step).toNumber()
@@ -27,7 +28,7 @@ export default ({minNum = 0, maxNum = 100, step=1, digits = 0, defaultNum = 0, o
const minus = () => {
let {count} = value
let num_res = Big(count).minus(step).toNumber()
- num_res = num_res <= minNum?minNum:num_res
+ num_res = num_res < minNum?0:num_res
setValue({...value, count:num_res})
onChange?.(parseFloat(num_res))
onClickBtn?.(parseFloat(num_res))
diff --git a/src/pages/details/components/orderCount/index.module.scss b/src/pages/details/components/orderCount/index.module.scss
index 25fef03..8c745e2 100644
--- a/src/pages/details/components/orderCount/index.module.scss
+++ b/src/pages/details/components/orderCount/index.module.scss
@@ -102,6 +102,12 @@
font-size: $font_size;
color: $color_main;
}
+ .priceText{
+ font-size: $font_size_big;
+ Text{
+ font-size: $font_size_min;
+ }
+ }
}
.btn_con{
display: flex;
diff --git a/src/pages/details/components/orderCount/index.tsx b/src/pages/details/components/orderCount/index.tsx
index 731752f..9ebddbf 100644
--- a/src/pages/details/components/orderCount/index.tsx
+++ b/src/pages/details/components/orderCount/index.tsx
@@ -1,4 +1,4 @@
-import {Image, ScrollView, View } from "@tarojs/components"
+import {Image, ScrollView, View, Text } from "@tarojs/components"
import Popup from "@/components/popup"
import LoadingCard from "@/components/loadingCard";
import Search from "@/components/search";
@@ -7,9 +7,12 @@ import Counter from "../counter";
import Big from 'big.js'
import classnames from "classnames";
import styles from "./index.module.scss"
-import { memo, useEffect, useRef, useState } from "react";
+import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
import {GetColorList} from "@/api/materialColor"
import { useRouter } from "@tarojs/taro";
+import UseLogin from "@/use/useLogin"
+import { formatHashTag, formatMillionYuan } from "@/common/fotmat";
+import { getFilterData } from "@/common/util";
type param = {
show?: true|false,
@@ -19,9 +22,9 @@ type param = {
}
export default memo(({show = false, onClose, title = '', productId = 0}: param) => {
const selectList = [
- {id: 0, step:1, digits:0, title:'大货', unit:'件', eunit:'kg'},
- {id: 1, step:1, digits:2, title:'剪板', unit:'米', eunit:'m'},
- {id: 2, step:1, digits:2, title:'散剪', unit:'米', eunit:'m'},
+ {id: 0, step:1, digits:0, maxNum:100000, defaultNum:1, title:'大货', unit:'件', eunit:'kg'},
+ {id: 1, step:1, digits:2, maxNum:9.99, defaultNum:1, title:'剪板', unit:'米', eunit:'m'},
+ {id: 2, step:1, digits:2, minNum:10, maxNum:100000, defaultNum:10, title:'散剪', unit:'米', eunit:'kg'},
]
const [selectIndex, setSelectIndex] = useState(0)
const selectProduct = (index:number) => {
@@ -32,33 +35,31 @@ export default memo(({show = false, onClose, title = '', productId = 0}: param)
const {fetchData:colorFetchData} = GetColorList()
const [list, setList] = useState([])
const [loading, setLoading] = useState(false)
- const condition = useRef({physical_warehouse:1, sale_mode:selectIndex, product_id:0})
+ const condition = useRef({physical_warehouse:1, sale_mode:selectIndex, product_id:0, code_or_name:null})
const getColorList = async () => {
setLoading(() => true)
- let {data} = await colorFetchData(condition.current)
+ console.log('数据:::',getFilterData(condition.current))
+ let {data} = await colorFetchData(getFilterData(condition.current))
setList([...data.list])
setLoading(() => false)
}
-
+ const [showPopup, setShowPopup] = useState(false)
+ //显示获取
useEffect(() => {
if(show) {
condition.current.product_id = productId
getColorList()
- }
+ }
+ setShowPopup(show)
}, [show])
+ //卸载清空
useEffect(() => {
return () => {
setList([])
}
}, [])
- const [showPopup, setShowPopup] = useState(false)
- useEffect(() => {
- setShowPopup(show)
- }, [show])
-
-
//popup关闭
const closePopup = () => {
onClose?.()
@@ -90,8 +91,9 @@ export default memo(({show = false, onClose, title = '', productId = 0}: param)
}
const onAdd = (item) => {
item.show = true
- item.count = item.count == 0?1:item.count
- setList([...list])
+ item.count = selectList[selectIndex].defaultNum
+ console.log('aa:::',item.count)
+ setList((list) => [...list])
}
//搜索显示与隐藏
@@ -100,11 +102,41 @@ export default memo(({show = false, onClose, title = '', productId = 0}: param)
setSearchShow(true)
}
- const addShopCart = () => {
-
+ //添加购物车
+ const {getSelfUserInfo} = UseLogin()
+ const addShopCart = () => {
+ getSelfUserInfo()
+ }
+
+ //显示金额
+ const priceFormat = useCallback((item) => {
+ let price = 0
+ if(selectIndex == 0) {
+ price = formatMillionYuan(item.bulk_price, 100).num
+ } else if(selectIndex == 1) {
+ price = formatMillionYuan(item.length_cut_price, 100).num
+ } else {
+ price = formatMillionYuan(item.weight_cut_price, 100).num
+ }
+ return ¥{Number(price) }{' /' + selectList[selectIndex].eunit}
+ }, [list, selectIndex])
+
+ //重置数据
+ useEffect(() => {
+ const newList = list.map(item => {
+ item.count = 0
+ item.show = false
+ return item
+ })
+ setList([...newList])
+ }, [selectIndex])
+
+ //筛选数据
+ const searchInput = (e) => {
+ condition.current.code_or_name = e
+ getColorList()
}
-
return (
@@ -121,26 +153,26 @@ export default memo(({show = false, onClose, title = '', productId = 0}: param)
{searchShow&&
-
+ searchInput(e)} debounceTime={400}/>
setSearchShow(false)}>取消
}
颜色分类 (13) {list.length}
- changeSearchShow()}>
+ {!searchShow&& changeSearchShow()}>}
- {list.length > 0&&
+ {list.length > 0&&
{list.map(item => {
return
-
+
- {item.title}
- ¥25.5/m
+ {formatHashTag(item.code, item.name)}
+ {priceFormat(item)}
{!item.show&& onAdd(item)}>添加
@@ -152,6 +184,8 @@ export default memo(({show = false, onClose, title = '', productId = 0}: param)
digits={selectList[selectIndex].digits}
onClickBtn={(e) => getInputValue(e, item)}
unit={selectList[selectIndex].unit}
+ minNum={selectList[selectIndex].minNum}
+ maxNum={selectList[selectIndex].maxNum}
/>
}
diff --git a/src/pages/details/index.tsx b/src/pages/details/index.tsx
index 670b51a..b2210cb 100644
--- a/src/pages/details/index.tsx
+++ b/src/pages/details/index.tsx
@@ -13,6 +13,7 @@ import useManualPullDownRefresh from '@/use/useManualPullDownRefresh';
import { goLink } from '@/common/common';
import useUserInfo from '@/use/useUserInfo';
import {GetProductDetailApi} from '@/api/material'
+import useLogin from '@/use/useLogin';
type item = {title:string, img:string, url:string, id:number}
@@ -22,6 +23,10 @@ type params = {
style?: Object
}
export default (props:params) => {
+ const {checkLogin} = useLogin()
+ useDidShow(() => {
+ checkLogin()
+ })
const router = useRouter()
diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx
index b3d42dc..f443e28 100644
--- a/src/pages/index/index.tsx
+++ b/src/pages/index/index.tsx
@@ -18,8 +18,9 @@ export default () => {
const {checkLogin} = useLogin()
- useDidShow(() => {
- checkLogin()
+ useDidShow(async () => {
+ await checkLogin()
+ // categoryList()
})
useEffect(() => {
diff --git a/src/reducers/userInfo.ts b/src/reducers/userInfo.ts
index cd46829..107eab3 100644
--- a/src/reducers/userInfo.ts
+++ b/src/reducers/userInfo.ts
@@ -10,14 +10,20 @@ import {
} from '../constants/userInfo'
export type UserParam = {
- name?:string,
+ nickName?:string,
phone?:string,
avatarUrl?:string,
+ city?: string,
+ country?: string,
+ province?: string,
+ gender?: number,
+ language?: string,
+ timestamp?: number
}
export type DataParam = {
token?: string
- sessionkey?: string,
+ session_key?: string,
userInfo: UserParam
}
@@ -31,7 +37,7 @@ type Action = {
const INIT_USER = {
userInfo: Taro.getStorageSync('userInfo')?JSON.parse(Taro.getStorageSync('userInfo')):null,
token: Taro.getStorageSync('token')||'',
- session_key: Taro.getStorageSync('sessionkey')||'',
+ session_key: Taro.getStorageSync('session_key')||'',
}
export default function counter (state = INIT_USER, action: Action) {
@@ -41,16 +47,16 @@ export default function counter (state = INIT_USER, action: Action) {
Taro.setStorageSync('userInfo',JSON.stringify(data?.userInfo))
return {...state,...data}
case SET_TOKEN:
- Taro.setStorageSync('token',JSON.stringify(data?.token))
+ Taro.setStorageSync('token',data?.token)
return {...state,...data}
case SET_SESSIONKEY:
- Taro.setStorageSync('sessionkey',JSON.stringify(data?.sessionkey))
+ Taro.setStorageSync('session_key',data?.session_key)
return {...state,...data}
case CLEAR_TOKEN:
Taro.removeStorageSync('token')
return {...state, token:''}
case CLEAR_SESSIONKEY:
- Taro.removeStorageSync('sessionkey')
+ Taro.removeStorageSync('session_key')
return {...state, session_key:''}
case CLEAR_USERINFO:
Taro.removeStorageSync('userInfo')
diff --git a/src/use/useHttp.ts b/src/use/useHttp.ts
index 9999d05..feea9e9 100644
--- a/src/use/useHttp.ts
+++ b/src/use/useHttp.ts
@@ -1,6 +1,6 @@
-import Taro from '@tarojs/taro'
+import Taro, { useRouter } from '@tarojs/taro'
import { useRef, useState } from 'react'
import {BASE_URL, WX_APPID} from '@/common/constant'
import useUserInfo from "./useUserInfo"
@@ -120,7 +120,8 @@ export const useRequest = (options:option = {
const stateRef = useRef({...params})
const [state, setState] = useState({...stateRef.current})
- const {removeToken} = useUserInfo()
+ const {removeToken, removeSessionKey} = useUserInfo()
+ const router = useRouter()
// 请求函数
const fetchData = async (sub_options?:any) => {
stateRef.current.loading = true
@@ -166,16 +167,19 @@ export const useRequest = (options:option = {
stateRef.current.data = data
stateRef.current.total = data?.list ? data?.total : 0
}else{
- Taro.showToast({
- title: `错误:${showStatus(statusCode)}`
- })
if (statusCode === 401) {
removeToken()
- Taro.reLaunch({
- url: '/pages/index/index'
+ removeSessionKey()
+ // remove
+ // Taro.reLaunch({
+ // url: router.path +'?' + qs.stringify(router.params)
+ // })
+ } else {
+ Taro.showToast({
+ title: `错误:${showStatus(statusCode)}`,
+ icon: 'none'
})
}
-
}
} catch (e) {
diff --git a/src/use/useLogin.ts b/src/use/useLogin.ts
index 8cf3c09..bced551 100644
--- a/src/use/useLogin.ts
+++ b/src/use/useLogin.ts
@@ -2,8 +2,9 @@ import { useEffect, useState } from "react"
import { WX_APPID } from "@/common/constant"
import useUserInfo from "./useUserInfo"
import Taro, { useRouter } from "@tarojs/taro"
-import { Login } from "@/api/login"
-
+import { LoginApi } from "@/api/login"
+import { GetWxUserInfoApi } from "@/api/user"
+import qs from 'qs';
export default () => {
const {setToken, setSessionKey, setUserInfo, userInfo} = useUserInfo()
@@ -12,91 +13,104 @@ export default () => {
console.log('userInfo::',userInfo.token)
}, [userInfo])
+ const router = useRouter()
//登录请求
- const {fetchData} = Login()
- const loginRequest = async (code) => {
- const {data, success} = await fetchData({js_code: code})
- if(success) {
- setToken(data.token)
- setSessionKey(data.session_key)
- } else {
- Taro.showToast({
- title:'登录失败',
- icon:"none"
- })
- }
- }
-
+ const {fetchData} = LoginApi()
//微信登录
const wxLogin = () => {
- Taro.login({
- success: function async (res) {
- if (res.code) {
- loginRequest(res.code)
- } else {
- console.log('登录失败!' + res.errMsg)
- }
- },
- fail: function(e) {
- console.log('登录失败!::',e)
- }
- })
- }
-
- const router = useRouter()
- //登录加checkLogin检查
- const checkLogin = () => {
- if(!userInfo.token) {
- wxLogin()
- if(router.path != '/pages/index/index') {
- Taro.reLaunch({
- url: '/pages/index/index'
- })
- }
- } else {
- Taro.checkSession({
- fail () {
- wxLogin()
+ return new Promise((reslove, reject) => {
+ Taro.login({
+ success: async (res) => {
+ if (res.code) {
+ const {data, success, msg} = await fetchData({js_code: res.code})
+ if(success) {
+ console.log('token::',data.token)
+ setToken(data.token)
+ setSessionKey(data.session_key)
+ reslove(data)
+ Taro.reLaunch({
+ url: router.path +'?' + qs.stringify(router.params)
+ })
+ } else {
+ Taro.showToast({
+ title:'登录失败',
+ icon:"none"
+ })
+ reject(msg)
+ }
+ } else {
+ console.log('登录失败!' + res.errMsg)
+ reject(res.errMsg)
+ }
+ },
+ fail: function(e) {
+ console.log('登录失败!::',e)
+ reject(e)
}
})
- }
+ })
}
- //获取用户头像等信息数据
- const getUserInfo = () => {
- Taro.getUserProfile({
- desc: '用于完善会员资料',
- success: (res) => {
- Taro.request({
- url: 'https://dev.zzfzyc.com/lymarket/v1/mall/user/decrypt',
- method: 'POST',
- data: {
- session_key: userInfo.sessionkey,
- raw_data: res.rawData,
- signature: res.signature,
- encrypted_data: res.encryptedData,
- iv: res.iv
+
+ //登录加checkLogin检查
+ const checkLogin = () => {
+ return new Promise( async (reslove) => {
+ if(!userInfo.token) {
+ await wxLogin()
+ reslove(true)
+ } else {
+ Taro.checkSession({
+ success: async () => {
+ reslove(true)
},
- header: {
- platform: 6,
- Authorization: userInfo.token,
- Appid: WX_APPID
- },
- success: (e) => {
- setUserInfo({})
- },
- fail: (e) => {
- console.log(e)
+ fail: async () => {
+ await wxLogin()
+ reslove(true)
}
})
}
})
+
+
+ }
+
+ //获取用户头像等信息数据
+ const {fetchData: fetchDataUserInfo} = GetWxUserInfoApi()
+ const getSelfUserInfo = async () => {
+ return new Promise((reslove, reject) => {
+ if(!userInfo.userInfo) {
+ Taro.getUserProfile({
+ desc: '用于完善会员资料',
+ success: async (res) => {
+ if(!userInfo.session_key) {
+ await wxLogin()
+ }
+ const {data} = await fetchDataUserInfo({
+ session_key: userInfo.session_key,
+ raw_data: res.rawData,
+ signature: res.signature,
+ encrypted_data: res.encryptedData,
+ iv: res.iv
+ })
+ setUserInfo({...data})
+ reslove(data)
+ },
+ fail:(e) => {
+ reject(e)
+ }
+ })
+ } else {
+ reslove(true)
+ }
+ })
+
+
}
return {
checkLogin,
wxLogin,
- getUserInfo
+ getSelfUserInfo
}
}
diff --git a/src/use/useUserInfo.ts b/src/use/useUserInfo.ts
index 4caf5a4..690a8ce 100644
--- a/src/use/useUserInfo.ts
+++ b/src/use/useUserInfo.ts
@@ -10,7 +10,7 @@ export default () => {
}
const setSessionKey = (sessionkey: string) => {
- dispatch({type:SET_SESSIONKEY, data:{sessionkey}})
+ dispatch({type:SET_SESSIONKEY, data:{session_key: sessionkey}})
}
const setUserInfo = (userInfo: UserParam) => {
From 2d92dadadcdc27f72c7ebd07ec401f0119982ad2 Mon Sep 17 00:00:00 2001
From: czm <2192718639@qq.com>
Date: Mon, 9 May 2022 10:06:47 +0800
Subject: [PATCH 17/18] =?UTF-8?q?=E5=AF=B9=E6=8E=A5api=5Fbak?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/common/common.ts | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/common/common.ts b/src/common/common.ts
index ef93cee..e2ba671 100644
--- a/src/common/common.ts
+++ b/src/common/common.ts
@@ -23,7 +23,6 @@ export const goLink = (path = '', params = {}, type:false|true = false) => {
}
}
-<<<<<<< HEAD
/**
* 判断对象为空
* @param object
@@ -88,7 +87,6 @@ export const retrieval = (data: any, message: string="请填写完信息", rules
resolve(null);
})
}
-=======
// 金额千位分割符
export const formatKbPrice = (number: string) => {
@@ -102,4 +100,3 @@ export const formatKbPrice = (number: string) => {
},[])
return ret.reverse().join('');
}
->>>>>>> 1557571 (确认订单)
From d5622d5b0a4056ae7b03464fe65765f77bb35cd4 Mon Sep 17 00:00:00 2001
From: czm <2192718639@qq.com>
Date: Mon, 9 May 2022 10:39:58 +0800
Subject: [PATCH 18/18] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/banner/index.tsx | 2 +-
src/components/product/index.tsx | 2 +-
src/pages/index/index.tsx | 8 +++++---
src/use/useLogin.ts | 16 +++++++++++++---
src/util/checkLogin.ts | 4 ----
5 files changed, 20 insertions(+), 12 deletions(-)
delete mode 100644 src/util/checkLogin.ts
diff --git a/src/components/banner/index.tsx b/src/components/banner/index.tsx
index 92f035a..594ebb8 100644
--- a/src/components/banner/index.tsx
+++ b/src/components/banner/index.tsx
@@ -36,7 +36,7 @@ export default (props:params) => {
indicatorDots
autoplay>
{
- list.map(item => {
+ list?.map(item => {
return
goLink(item.link)}>
diff --git a/src/components/product/index.tsx b/src/components/product/index.tsx
index 2f29417..64a951f 100644
--- a/src/components/product/index.tsx
+++ b/src/components/product/index.tsx
@@ -10,7 +10,7 @@ type Params = {
export default ({desStatus = true, productList = []}:Params) => {
return (
- {productList.map(item => {
+ {productList?.map(item => {
return goLink(`/pages/details/index?id=${item.id}`)}>
diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx
index f443e28..9222be9 100644
--- a/src/pages/index/index.tsx
+++ b/src/pages/index/index.tsx
@@ -20,7 +20,6 @@ export default () => {
useDidShow(async () => {
await checkLogin()
- // categoryList()
})
useEffect(() => {
@@ -32,8 +31,11 @@ export default () => {
const {fetchData} = GetProductKindListApi()
const categoryList = async () => {
const res = await fetchData()
- setKindData({...kindData, list:res.data.list, defaultId: res.data.list[0].id})
- setFiltrate({...filtrate, product_kind_id:res.data.list[0].id})
+ if(res.data?.list) {
+ setKindData({...kindData, list:res.data.list, defaultId: res.data.list[0].id})
+ setFiltrate({...filtrate, product_kind_id:res.data.list[0].id})
+ }
+
}
//获取面料列表
diff --git a/src/use/useLogin.ts b/src/use/useLogin.ts
index bced551..386657d 100644
--- a/src/use/useLogin.ts
+++ b/src/use/useLogin.ts
@@ -28,9 +28,19 @@ export default () => {
setToken(data.token)
setSessionKey(data.session_key)
reslove(data)
- Taro.reLaunch({
- url: router.path +'?' + qs.stringify(router.params)
- })
+ let params = router.params
+ delete params.$taroTimestamp
+ console.log('params::',params)
+ if(router.path === '/pages/index/index' || router.path === '/pages/user/index') {
+ Taro.reLaunch({
+ url: router.path +'?' + qs.stringify(params)
+ })
+ } else {
+ Taro.redirectTo({
+ url: router.path +'?' + qs.stringify(params)
+ })
+ }
+
} else {
Taro.showToast({
title:'登录失败',
diff --git a/src/util/checkLogin.ts b/src/util/checkLogin.ts
deleted file mode 100644
index cc00e0b..0000000
--- a/src/util/checkLogin.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-
-export const checkLogin = () => {
-
-}
\ No newline at end of file