登录封装
This commit is contained in:
parent
16ba165fec
commit
5bae62d34d
201
package-lock.json
generated
201
package-lock.json
generated
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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,8 +19,11 @@ class App extends Component {
|
||||
// this.props.children 是将要会渲染的页面
|
||||
render () {
|
||||
return (
|
||||
|
||||
<ContextBlueTooth>
|
||||
<Provider store={store}>
|
||||
{this.props.children}
|
||||
</Provider>
|
||||
</ContextBlueTooth>
|
||||
)
|
||||
}
|
||||
|
@ -25,3 +25,6 @@ export const IMG_CND_Prefix = "http://test.cdn.zzfzyc.com/"
|
||||
|
||||
// 上传图片视频
|
||||
export const CDN_UPLOAD_IMG = `${UPLOAD_CDN_URL || ''}`;
|
||||
|
||||
//appid
|
||||
export const WX_APPID = 'wx6c8b9156543480b0'
|
2
src/constants/userInfo.ts
Normal file
2
src/constants/userInfo.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export const GETUSER = 'GETUSER'
|
||||
export const SETUSER = 'SETUSER'
|
@ -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{
|
||||
|
@ -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 (
|
||||
<View className={styles.main}>
|
||||
@ -127,10 +131,10 @@ export default (props:params) => {
|
||||
<View className={styles.des_data}>
|
||||
<View className={styles.title}>详情参数</View>
|
||||
<View className={styles.con}>
|
||||
<View>编号:0770</View>
|
||||
<View>幅宽:160cm</View>
|
||||
<View>克重:160g</View>
|
||||
<View>成分:67.6%棉24%涤纶6.4%氨纶%氨纶</View>
|
||||
<View className={styles.des_text}>编号:<Text>0770</Text></View>
|
||||
<View className={styles.des_text}>幅宽:<Text>160cm</Text></View>
|
||||
<View className={styles.des_text}>克重:<Text>160g</Text></View>
|
||||
<View className={styles.des_text}>成分:<Text>67.6%棉24%涤纶6.4%氨纶%氨纶氨纶%氨纶</Text></View>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.product_color}>
|
||||
|
@ -47,11 +47,31 @@ 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 (
|
||||
<MoveBtn onClick={() => setShowShopCart(!showShopCart)}>
|
||||
|
||||
<View className={styles.main}>
|
||||
<View onClick={(e) => goto(e)}>aaa</View>
|
||||
<Swiper/>
|
||||
<View className={styles.search}>
|
||||
<View className={styles.search_collect}>我的收藏</View>
|
||||
|
6
src/reducers/index.ts
Normal file
6
src/reducers/index.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { combineReducers } from 'redux'
|
||||
import userInfo from './userInfo'
|
||||
|
||||
export default combineReducers({
|
||||
userInfo
|
||||
})
|
24
src/reducers/userInfo.ts
Normal file
24
src/reducers/userInfo.ts
Normal file
@ -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
|
||||
}
|
||||
}
|
27
src/store/index.ts
Normal file
27
src/store/index.ts
Normal file
@ -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
|
||||
}
|
@ -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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
85
src/use/useLogin.tsx
Normal file
85
src/use/useLogin.tsx
Normal file
@ -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
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user