Your Name před 3 roky
rodič
revize
1058a6365b

+ 1
- 1
config/prod.js Zobrazit soubor

@@ -10,7 +10,7 @@ module.exports = {
10 10
     OSS_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
11 11
     OSS_FAST_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
12 12
     ICON_FONT: '"https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/css/iconfont.ttf"',
13
-    Version: '"V0.0.28-20210808"'
13
+    Version: '"V0.0.30-20210808"'
14 14
   },
15 15
   mini: {},
16 16
   h5: {

+ 1
- 1
project.config.json Zobrazit soubor

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

+ 20
- 26
src/components/Auth/AuthPage/index.jsx Zobrazit soubor

@@ -9,32 +9,26 @@ import './index.scss'
9 9
 export default (props) => {
10 10
 
11 11
   const [loading, setLoading] = useState(false)
12
-  const { updateUserInfo } = useAuth()
12
+  const { updatePhoneNumber } = useAuth()
13 13
   
14
-  const handleGetUserInfo = () => {
15
-    Taro.getUserProfile({
16
-      lang: 'zh_CN',
17
-      desc: '用于完成平台注册',
18
-      success: (res) => {
19
-        const { errMsg, ...data } = res || {}
20
-        if (errMsg === 'getUserProfile:ok') {
21
-          setLoading(true)
22
-          updateUserInfo(data).then(() => {
23
-            setLoading(false)
24
-          }).catch((err) => {
25
-            console.error(err)
26
-            setLoading(false)
27
-          })
28
-        } else {
29
-          console.error(errMsg);
30
-          Taro.showToast({
31
-            title: '授权头像失败',
32
-            icon: 'none',
33
-            duration: 2000
34
-          })
35
-        }
36
-      }
37
-    })
14
+  const handlePhoneNumber = (detail) => {
15
+    const { errMsg, ...data } = detail || {}
16
+    if (errMsg === 'getPhoneNumber:ok') {
17
+      setLoading(true)
18
+      updatePhoneNumber(data).then(() => {
19
+        setLoading(false)
20
+      }).catch((err) => {
21
+        console.error(err)
22
+        setLoading(false)
23
+      })
24
+    } else {
25
+      console.error(errMsg);
26
+      Taro.showToast({
27
+        title: '授权手机失败',
28
+        icon: 'none',
29
+        duration: 2000
30
+      })
31
+    }
38 32
   }
39 33
 
40 34
   return (
@@ -43,7 +37,7 @@ export default (props) => {
43 37
         <Image mode='aspectFit' className='centerLabel' src={require('@/assets/logo.png')} />
44 38
       </View>
45 39
       <View className='LoginBtn'>
46
-        <button loading={loading} onClick={handleGetUserInfo}>微信登录</button>
40
+        <button loading={loading} openType='getPhoneNumber' onGetPhoneNumber={handlePhoneNumber}>微信登录</button>
47 41
       </View>
48 42
       <View className='flex-item'></View>
49 43
       <View className='Bottom'>

+ 1
- 1
src/layout/useAuth.js Zobrazit soubor

@@ -27,7 +27,7 @@ export default function useAuth(person, page) {
27 27
 
28 28
       // 如果需要授权头像
29 29
       if (page.auth.indexOf('page') > -1) {
30
-        if (person.inited && (!person.avatarurl || person.avatarurl.indexOf('default_avatar') > -1)) {
30
+        if (person.inited && !person.phone) {
31 31
           setAuthPage(true)
32 32
         } else {
33 33
           setAuthPage(false)

+ 16
- 16
src/routes.js Zobrazit soubor

@@ -171,7 +171,7 @@ const routes = [
171 171
     page: 'pages/index/activityList/index',
172 172
     pkg: 'main',
173 173
     type: 'activity',
174
-    auth: ['phone', 'avatar'],
174
+    // auth: ['phone', 'avatar'],
175 175
   },
176 176
   {
177 177
     name: '活动详情',
@@ -256,7 +256,7 @@ const routes = [
256 256
     page: 'pages/mine/myRecommendCode/index',
257 257
     pkg: 'main',
258 258
     type: 'mine',
259
-    auth: ['phone'],
259
+    // auth: ['phone'],
260 260
   },
261 261
   {
262 262
     name: '房贷计算器',
@@ -276,14 +276,14 @@ const routes = [
276 276
     page: 'pages/mine/toBeManager/index',
277 277
     pkg: 'main',
278 278
     type: 'mine',
279
-    auth: ['phone'],
279
+    // auth: ['phone'],
280 280
   },
281 281
   {
282 282
     name: '成为经纪人',
283 283
     page: 'pages/mine/toBeAgent/index',
284 284
     pkg: 'main',
285 285
     type: 'mine',
286
-    auth: ['phone'],
286
+    // auth: ['phone'],
287 287
   },
288 288
   {
289 289
     name: '我的分享',
@@ -296,7 +296,7 @@ const routes = [
296 296
     page: 'pages/mine/myCourse/index',
297 297
     pkg: 'main',
298 298
     type: 'curriculum',
299
-    auth: ['phone'],
299
+    // auth: ['phone'],
300 300
   },
301 301
   {
302 302
     name: '我的活动',
@@ -309,14 +309,14 @@ const routes = [
309 309
     page: 'pages/mine/myCustomer/index',
310 310
     pkg: 'main',
311 311
     type: 'mine',
312
-    auth: ['phone'],
312
+    // auth: ['phone'],
313 313
   },
314 314
   {
315 315
     name: '客户详情',
316 316
     page: 'pages/mine/myCustomerDetail/index',
317 317
     pkg: 'main',
318 318
     type: 'mine',
319
-    auth: ['phone'],
319
+    // auth: ['phone'],
320 320
   },
321 321
   {
322 322
     name: '我的收藏',
@@ -329,63 +329,63 @@ const routes = [
329 329
     page: 'pages/channel/partnerChannel/index',
330 330
     pkg: 'subpackages',
331 331
     type: 'mine',
332
-    auth: ['phone'],
332
+    // auth: ['phone'],
333 333
   },
334 334
   {
335 335
     name: '添加客户',
336 336
     page: 'pages/mine/addCustomer/index',
337 337
     pkg: 'main',
338 338
     type: 'mine',
339
-    auth: ['phone'],
339
+    // auth: ['phone'],
340 340
   },
341 341
   {
342 342
     name: '驻场管理',
343 343
     page: 'pages/marketing/residentManager/index',
344 344
     pkg: 'subpackages',
345 345
     type: 'mine',
346
-    auth: ['phone'],
346
+    // auth: ['phone'],
347 347
   },
348 348
   {
349 349
     name: '确认到访',
350 350
     page: 'pages/marketing/sureVisit/index',
351 351
     pkg: 'subpackages',
352 352
     type: 'mine',
353
-    auth: ['phone'],
353
+    // auth: ['phone'],
354 354
   },
355 355
   {
356 356
     name: '变更交易节点',
357 357
     page: 'pages/marketing/changeVisit/index',
358 358
     pkg: 'subpackages',
359 359
     type: 'mine',
360
-    auth: ['phone'],
360
+    // auth: ['phone'],
361 361
   },
362 362
   {
363 363
     name: '盘客工具',
364 364
     page: 'pages/consultant/statCustomer/index',
365 365
     pkg: 'subpackages',
366 366
     type: 'mine',
367
-    auth: ['phone'],
367
+    // auth: ['phone'],
368 368
   },
369 369
   {
370 370
     name: '客户信息',
371 371
     page: 'pages/mine/customerDetail/index',
372 372
     pkg: 'main',
373 373
     type: 'mine',
374
-    auth: ['phone'],
374
+    // auth: ['phone'],
375 375
   },
376 376
   {
377 377
     name: '客户分析',
378 378
     page: 'pages/consultant/customerAnalyse/index',
379 379
     pkg: 'subpackages',
380 380
     type: 'mine',
381
-    auth: ['phone'],
381
+    // auth: ['phone'],
382 382
   },
383 383
   {
384 384
     name: '个人主页',
385 385
     page: 'pages/consultant/myHomepage/index',
386 386
     pkg: 'subpackages',
387 387
     type: 'mine',
388
-    auth: ['phone'],
388
+    // auth: ['phone'],
389 389
   },
390 390
   {
391 391
     name: '意见反馈',