Browse Source

Merge branch 'main' of http://git.ycjcjy.com/marketing/miniapp into main

zlisen 3 years ago
parent
commit
577114d2d4

+ 1
- 1
project.config.json View File

@@ -27,7 +27,7 @@
27 27
 			"outputPath": ""
28 28
 		},
29 29
 		"useIsolateContext": true,
30
-		"useCompilerModule": true,
30
+		"useCompilerModule": false,
31 31
 		"userConfirmedUseCompilerModuleSwitch": false
32 32
 	},
33 33
 	"compileType": "miniprogram",

+ 20
- 3
src/pages/mine/myRecommendCode/index.jsx View File

@@ -1,13 +1,30 @@
1
-// import { useState, useEffect } from 'react'
1
+import { useState, useEffect } from 'react'
2
+import { Image } from '@tarojs/components'
2 3
 import withLayout from '@/layout'
3 4
 import '@/assets/css/iconfont.css'
5
+import { fetch } from '@/utils/request'
6
+import { API_QRCODE } from '@/constants/api'
4 7
 import './index.scss'
5 8
 
6
-export default withLayout(() => {
9
+export default withLayout((props) => {
10
+
11
+  const { person, page } = props
12
+  const [QrCodeUrl, setQrCodeUrl] = useState(null)
13
+
14
+  useEffect(() => {
15
+    const payload = {
16
+      scene: `id=${person?.personId}&from=${page.type}_share&recommender=${person?.personId}`,
17
+      page: `pages/mine/myRecommendCode/index`
18
+    }
19
+    fetch({ url: API_QRCODE, payload, method: 'post' }).then((res) => {
20
+      setQrCodeUrl(res)
21
+    })
22
+  }, [])
7 23
 
8 24
   return (
9 25
     <view className='Page myRecommendCode'>
10
-      我的推广码
26
+      <Image mode='widthFix' src={QrCodeUrl}></Image>
27
+      <text>扫一扫上面的二维码图案,成为我的客户</text>
11 28
     </view>
12 29
   )
13 30
 })

+ 12
- 0
src/pages/mine/myRecommendCode/index.scss View File

@@ -4,4 +4,16 @@
4 4
   height: 100%;
5 5
   position: relative;
6 6
   overflow: hidden;
7
+  >image {
8
+    width: 50%;
9
+    display: block;
10
+    height: auto;
11
+    margin: 100px auto 0;
12
+  }
13
+  >text {
14
+    display: block;
15
+    text-align: center;
16
+    font-size: 30px;
17
+    margin-top: 40px;
18
+  }
7 19
 }

+ 1
- 1
src/pages/mine/tabData.js View File

@@ -43,7 +43,7 @@ const MineMenuList = {
43 43
       { name: '添加客户', icon: require('@/assets/mine-icon7.png'), router: '/pages/mine/addCustomer/index?type=consultant' },
44 44
       { name: '成为驻场管理', icon: require('@/assets/mine-icon8.png'), router: '/pages/mine/toBeManager/index' },
45 45
       { name: '我的主页', icon: require('@/assets/mine-icon15.png'), router: '/subpackages/pages/consultant/myHomepage/index' },
46
-      { name: '我的推广码', icon: require('@/assets/mine-icon14.png'), router: '' },
46
+      { name: '我的推广码', icon: require('@/assets/mine-icon14.png'), router: '/pages/mine/myRecommendCode/index' },
47 47
       { name: '客户分析', icon: require('@/assets/mine-icon5.png'), router: '/subpackages/pages/consultant/customerAnalyse/index' },
48 48
       { name: '盘客工具', icon: require('@/assets/mine-icon6.png'), router: '/subpackages/pages/consultant/statCustomer/index' }
49 49
     ],