Baozhangchao преди 3 години
родител
ревизия
0eae5949f4

+ 3
- 2
config/dev.js Целия файл

4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
     // HOST: '"https://xlk.njyz.tech"',
6
     // HOST: '"https://xlk.njyz.tech"',
7
-    HOST: '"https://www.newhousehold.cn"',
8
-    // HOST: '"http://127.0.0.1:8567"',
7
+    // HOST: '"https://www.newhousehold.cn"',
8
+    HOST: '"http://192.168.89.147:8081"',
9
+
9
     WSS_HOST: '"wss://www.newhousehold.cn"',
10
     WSS_HOST: '"wss://www.newhousehold.cn"',
10
     // WSS_HOST: '"wss://xlk.njyz.tech"',
11
     // WSS_HOST: '"wss://xlk.njyz.tech"',
11
     OSS_PATH: '"https://xlk-assets.oss-cn-shanghai.aliyuncs.com/"',
12
     OSS_PATH: '"https://xlk-assets.oss-cn-shanghai.aliyuncs.com/"',

+ 2
- 2
config/prod.js Целия файл

3
     NODE_ENV: '"production"'
3
     NODE_ENV: '"production"'
4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
-    HOST: '"https://www.newhousehold.cn"', //正式
6
+    // HOST: '"http://192.168.89.147:8081"', //正式
7
     WSS_HOST: '"wss://www.newhousehold.cn"',
7
     WSS_HOST: '"wss://www.newhousehold.cn"',
8
-    // HOST: '"https://xlk.njyz.tech"', //正式
8
+    HOST: '"https://xlk.njyz.tech"',
9
     // WSS_HOST: '"wss://xlk.njyz.tech"',
9
     // WSS_HOST: '"wss://xlk.njyz.tech"',
10
     OSS_PATH: '"https://xlk-assets.oss-cn-shanghai.aliyuncs.com/"',
10
     OSS_PATH: '"https://xlk-assets.oss-cn-shanghai.aliyuncs.com/"',
11
     OSS_FAST_PATH: '"https://xlk-assets.oss-cn-shanghai.aliyuncs.com/"',
11
     OSS_FAST_PATH: '"https://xlk-assets.oss-cn-shanghai.aliyuncs.com/"',

+ 1
- 1
project.config.json Целия файл

2
 	"miniprogramRoot": "dist/",
2
 	"miniprogramRoot": "dist/",
3
 	"projectname": "miniapp",
3
 	"projectname": "miniapp",
4
 	"description": "",
4
 	"description": "",
5
-	"appid": "wxc96058d57e77f373",
5
+	"appid": "wxe44244d1a5ea3364",
6
 	"setting": {
6
 	"setting": {
7
 		"urlCheck": false,
7
 		"urlCheck": false,
8
 		"es6": false,
8
 		"es6": false,

+ 3
- 0
src/app.config.js Целия файл

45
   permission: {
45
   permission: {
46
     "scope.userLocation": {
46
     "scope.userLocation": {
47
       desc: "你的位置信息将用于显示当前区域信息"
47
       desc: "你的位置信息将用于显示当前区域信息"
48
+    },
49
+    "scope.userInfo": {
50
+      desc: "你的信息将用于页面展示"
48
     }
51
     }
49
   },
52
   },
50
 }
53
 }

+ 2
- 1
src/components/Auth/AuthAvatar.jsx Целия файл

13
 
13
 
14
   const handleUserProfile = (detail) => {
14
   const handleUserProfile = (detail) => {
15
     const { errMsg, ...data } = detail || {}
15
     const { errMsg, ...data } = detail || {}
16
-    if (errMsg === 'getUserProfile:ok') {
16
+
17
+    if (errMsg === 'getUserProfile:ok' || errMsg === 'getUserInfo:ok') {
17
       setLoading(true)
18
       setLoading(true)
18
       updateUserInfo(data).then(() => {
19
       updateUserInfo(data).then(() => {
19
         setLoading(false)
20
         setLoading(false)

+ 9
- 3
src/components/Auth/AuthBox.jsx Целия файл

7
   const { loading, title, openType, onGetUserInfo, onGetPhoneNumber, onCancel = (x => x) } = props
7
   const { loading, title, openType, onGetUserInfo, onGetPhoneNumber, onCancel = (x => x) } = props
8
 
8
 
9
   const handleGetUserInfo = () => {
9
   const handleGetUserInfo = () => {
10
-    Taro.getUserProfile({
11
-      lang: 'zh_CN',
10
+    const getUserInfo = Taro.canIUse('getUserProfile') ? Taro.getUserProfile : Taro.getUserInfo
11
+    getUserInfo({
12
       desc: '用于完善个人资料',
12
       desc: '用于完善个人资料',
13
+      lang: 'zh_CN',
13
       success: (res) => {
14
       success: (res) => {
15
+        console.log('授权成功', res);
14
         onGetUserInfo(res)
16
         onGetUserInfo(res)
15
-      }
17
+      },
18
+      fali: (res) => {
19
+        console.log('授权错误', res);
20
+      },
16
     })
21
     })
17
   }
22
   }
18
 
23
 
36
             <Button
41
             <Button
37
               className='auth-btn'
42
               className='auth-btn'
38
               type='default'
43
               type='default'
44
+              openType='getUserInfo'
39
               onClick={handleGetUserInfo}
45
               onClick={handleGetUserInfo}
40
               loading={loading}
46
               loading={loading}
41
             >确定</Button>
47
             >确定</Button>

+ 1
- 1
src/components/Auth/AuthPage/index.jsx Целия файл

15
 
15
 
16
   const [loading, setLoading] = useState(false)
16
   const [loading, setLoading] = useState(false)
17
   const { updatePhoneNumber } = useAuth(consultant, router, page)
17
   const { updatePhoneNumber } = useAuth(consultant, router, page)
18
-  
18
+
19
   const handlePhoneNumber = (e) => {
19
   const handlePhoneNumber = (e) => {
20
     const { errMsg, ...data } = e?.detail || {}
20
     const { errMsg, ...data } = e?.detail || {}
21
     // debugger
21
     // debugger

+ 2
- 2
src/components/Auth/AuthPhone.jsx Целия файл

11
     router,
11
     router,
12
     page,
12
     page,
13
     onCancel = (x => x),
13
     onCancel = (x => x),
14
-    onSuccess = () => {},
15
-    onError = () => {},
14
+    onSuccess = () => { },
15
+    onError = () => { },
16
   } = props;
16
   } = props;
17
 
17
 
18
   const [loading, setLoading] = useState(false)
18
   const [loading, setLoading] = useState(false)

+ 5
- 5
src/layout/index.js Целия файл

57
   useEffect(() => {
57
   useEffect(() => {
58
     if (isSinglePage) return;
58
     if (isSinglePage) return;
59
 
59
 
60
-    reportCustomer(person, consultant, false).catch(() => {})
60
+    reportCustomer(person, consultant, false).catch(() => { })
61
   }, [person, consultant, isSinglePage])
61
   }, [person, consultant, isSinglePage])
62
 
62
 
63
   // 请求埋点设置
63
   // 请求埋点设置
67
     if (id) {
67
     if (id) {
68
       setShareContent({})
68
       setShareContent({})
69
     }
69
     }
70
-  } ,[id, page.type, isSinglePage])
70
+  }, [id, page.type, isSinglePage])
71
 
71
 
72
   // 埋点数据
72
   // 埋点数据
73
   useEffect(() => {
73
   useEffect(() => {
91
 
91
 
92
   useEffect(() => {
92
   useEffect(() => {
93
     setLoading((!person || !person.personId) || (scene && !qrInited))
93
     setLoading((!person || !person.personId) || (scene && !qrInited))
94
-  // eslint-disable-next-line react-hooks/exhaustive-deps
94
+    // eslint-disable-next-line react-hooks/exhaustive-deps
95
   }, [person, scene, qrInited])
95
   }, [person, scene, qrInited])
96
 
96
 
97
   return (
97
   return (
98
     <>
98
     <>
99
       {/* 菊花转 */}
99
       {/* 菊花转 */}
100
-      <Overlay visible={loading} style={{background: '#fff'}}>
100
+      <Overlay visible={loading} style={{ background: '#fff' }}>
101
         <Loading />
101
         <Loading />
102
       </Overlay>
102
       </Overlay>
103
 
103
 
116
       </Overlay>
116
       </Overlay>
117
 
117
 
118
       {/* 授权头像-全屏 */}
118
       {/* 授权头像-全屏 */}
119
-      { authPage && !isSinglePage && <AuthPage consultant={consultant} router={router} page={page} /> }
119
+      {authPage && !isSinglePage && <AuthPage consultant={consultant} router={router} page={page} />}
120
 
120
 
121
       {/* 显示分享朋友圈 */}
121
       {/* 显示分享朋友圈 */}
122
       <ShareToCircle visible={shareTimelineVisible && !isSinglePage} onClose={() => setShareTimelineVisible(false)} />
122
       <ShareToCircle visible={shareTimelineVisible && !isSinglePage} onClose={() => setShareTimelineVisible(false)} />