瀏覽代碼

poster h5

xujing 5 年之前
父節點
當前提交
9bb7f938ac

+ 3
- 2
src/pages/activity/detail/poster.js 查看文件

1
 import Taro, { Component } from '@tarojs/taro';
1
 import Taro, { Component } from '@tarojs/taro';
2
 import { TaroCanvasDrawer } from '@/components/taro-plugin-canvas';
2
 import { TaroCanvasDrawer } from '@/components/taro-plugin-canvas';
3
 import dayjs from 'dayjs'
3
 import dayjs from 'dayjs'
4
+import { getDownloadURL } from '@/utils/tools'
4
 import './poster.scss'
5
 import './poster.scss'
5
 /**
6
 /**
6
  * 文档参考
7
  * 文档参考
76
       {
77
       {
77
         x: 30,
78
         x: 30,
78
         y: 890,
79
         y: 890,
79
-        text: data.posterDescription||'活动描述',
80
+        text: data.posterDescription || '活动描述',
80
         fontSize: 28,
81
         fontSize: 28,
81
         color: '#999',
82
         color: '#999',
82
         baseLine: 'middle',
83
         baseLine: 'middle',
147
         zIndex: 999
148
         zIndex: 999
148
       },
149
       },
149
       {
150
       {
150
-        url: data.avatarurl || require('@/assets/default-avatar.png'),
151
+        url: getDownloadURL(data.avatarurl, 'avatar') || require('@/assets/default-avatar.png'),
151
         width: 130,
152
         width: 130,
152
         height: 130,
153
         height: 130,
153
         y: 630,
154
         y: 630,

+ 2
- 1
src/pages/news/detail/poster.js 查看文件

1
 import Taro, { Component } from '@tarojs/taro';
1
 import Taro, { Component } from '@tarojs/taro';
2
 import { TaroCanvasDrawer } from '@/components/taro-plugin-canvas';
2
 import { TaroCanvasDrawer } from '@/components/taro-plugin-canvas';
3
+import { getDownloadURL } from '@/utils/tools'
3
 import dayjs from 'dayjs'
4
 import dayjs from 'dayjs'
4
 import './poster.scss'
5
 import './poster.scss'
5
 /**
6
 /**
147
         zIndex: 999
148
         zIndex: 999
148
       },
149
       },
149
       {
150
       {
150
-        url: data.avatarurl || require('@/assets/default-avatar.png'),
151
+        url: getDownloadURL(data.avatarurl, 'avatar')  || require('@/assets/default-avatar.png'),
151
         width: 130,
152
         width: 130,
152
         height: 130,
153
         height: 130,
153
         y: 630,
154
         y: 630,

+ 12
- 11
src/pages/policy/detail/makePoster.js 查看文件

1
 import Taro, { Component } from '@tarojs/taro';
1
 import Taro, { Component } from '@tarojs/taro';
2
 import { TaroCanvasDrawer } from '@/components/taro-plugin-canvas';
2
 import { TaroCanvasDrawer } from '@/components/taro-plugin-canvas';
3
+import { getDownloadURL } from '@/utils/tools'
3
 import dayjs from 'dayjs'
4
 import dayjs from 'dayjs'
4
 /**
5
 /**
5
  * 文档参考
6
  * 文档参考
33
     const { basicConfig } = this.state
34
     const { basicConfig } = this.state
34
     const texts = [
35
     const texts = [
35
       {
36
       {
36
-        x:170,
37
+        x: 170,
37
         y: 780,
38
         y: 780,
38
-        text: data.nickname+' 邀您阅读'||'',
39
+        text: data.nickname + ' 邀您阅读' || '',
39
         fontSize: 28,
40
         fontSize: 28,
40
         color: '#666',
41
         color: '#666',
41
         baseLine: 'middle',
42
         baseLine: 'middle',
45
         zIndex: 999
46
         zIndex: 999
46
       },
47
       },
47
       {
48
       {
48
-        x:480,
49
+        x: 480,
49
         y: 780,
50
         y: 780,
50
         text: dayjs(data.createDate).format('YYYY-MM-DD') || '',
51
         text: dayjs(data.createDate).format('YYYY-MM-DD') || '',
51
         fontSize: 25,
52
         fontSize: 25,
57
         zIndex: 999
58
         zIndex: 999
58
       },
59
       },
59
       {
60
       {
60
-        x:110,
61
+        x: 110,
61
         y: 880,
62
         y: 880,
62
         text: data.title,
63
         text: data.title,
63
         fontSize: 32,
64
         fontSize: 32,
68
         zIndex: 999
69
         zIndex: 999
69
       },
70
       },
70
       {
71
       {
71
-        x:240,
72
+        x: 240,
72
         y: 1000,
73
         y: 1000,
73
         text: '长按识别小程序码',
74
         text: '长按识别小程序码',
74
         fontSize: 26,
75
         fontSize: 26,
78
         width: 200,
79
         width: 200,
79
       },
80
       },
80
       {
81
       {
81
-        x:240,
82
+        x: 240,
82
         y: 1055,
83
         y: 1055,
83
         text: '进入',
84
         text: '进入',
84
         fontSize: 26,
85
         fontSize: 26,
88
         width: 50,
89
         width: 50,
89
       },
90
       },
90
       {
91
       {
91
-        x:300,
92
+        x: 300,
92
         y: 1055,
93
         y: 1055,
93
         text: '橙蕉',
94
         text: '橙蕉',
94
         fontSize: 28,
95
         fontSize: 28,
98
         width: 120,
99
         width: 120,
99
       },
100
       },
100
       {
101
       {
101
-        x:440,
102
+        x: 440,
102
         y: 1055,
103
         y: 1055,
103
         text: '阅读全文',
104
         text: '阅读全文',
104
         fontSize: 26,
105
         fontSize: 26,
124
         x: 50
125
         x: 50
125
       },
126
       },
126
       {
127
       {
127
-        url: data.avatarurl || require('@/assets/default-avatar.png'),
128
+        url: getDownloadURL(data.avatarurl, 'avatar') || require('@/assets/default-avatar.png'),
128
         width: 130,
129
         width: 130,
129
         height: 130,
130
         height: 130,
130
         y: 680,
131
         y: 680,
131
         x: 20,
132
         x: 20,
132
-        borderRadius:130
133
+        borderRadius: 130
133
       }
134
       }
134
     ]
135
     ]
135
     const config = Object.assign(basicConfig, { images, texts })
136
     const config = Object.assign(basicConfig, { images, texts })
159
       Taro.showToast({ icon: 'none', title: errMsg || '出现错误' });
160
       Taro.showToast({ icon: 'none', title: errMsg || '出现错误' });
160
       console.log(errMsg);
161
       console.log(errMsg);
161
     }
162
     }
162
-    
163
+
163
     this.props.toggleMakePosterModal(false)
164
     this.props.toggleMakePosterModal(false)
164
 
165
 
165
     // 预览
166
     // 预览

+ 10
- 9
src/pages/project/detail/poster.js 查看文件

1
 import Taro, { Component } from '@tarojs/taro';
1
 import Taro, { Component } from '@tarojs/taro';
2
 import { TaroCanvasDrawer } from '@/components/taro-plugin-canvas';
2
 import { TaroCanvasDrawer } from '@/components/taro-plugin-canvas';
3
+import { getDownloadURL } from '@/utils/tools'
3
 import dayjs from 'dayjs'
4
 import dayjs from 'dayjs'
4
 import './poster.scss'
5
 import './poster.scss'
5
 /**
6
 /**
46
         color: '#000',
47
         color: '#000',
47
         baseLine: 'middle',
48
         baseLine: 'middle',
48
         lineHeight: 48,
49
         lineHeight: 48,
49
-        overFlow:'hidden',
50
+        overFlow: 'hidden',
50
         width: 240,
51
         width: 240,
51
         zIndex: 999
52
         zIndex: 999
52
       },
53
       },
85
         // textAlign: 'center',
86
         // textAlign: 'center',
86
         width: 560,
87
         width: 560,
87
         zIndex: 999
88
         zIndex: 999
88
-      },{
89
+      }, {
89
         x: 30,
90
         x: 30,
90
         y: 746,
91
         y: 746,
91
-        text: data.price ? '约'+data.price+'元/m²' : '待定',
92
+        text: data.price ? '约' + data.price + '元/m²' : '待定',
92
         fontSize: 36,
93
         fontSize: 36,
93
         color: '#FF2744',
94
         color: '#FF2744',
94
         baseLine: 'middle',
95
         baseLine: 'middle',
174
         zIndex: 999
175
         zIndex: 999
175
       },
176
       },
176
       {
177
       {
177
-        url: data.avatarurl || require('@/assets/default-avatar.png'),
178
+        url: getDownloadURL(data.avatarurl, 'avatar') || require('@/assets/default-avatar.png'),
178
         width: 120,
179
         width: 120,
179
         height: 120,
180
         height: 120,
180
         y: 452,
181
         y: 452,
271
         {
272
         {
272
           this.state.canvasStatus && (
273
           this.state.canvasStatus && (
273
             <View style="10rpx 0px 30rpx #dcdcdc">
274
             <View style="10rpx 0px 30rpx #dcdcdc">
274
-            <TaroCanvasDrawer
275
-              config={this.state.config}
276
-              onCreateSuccess={this.onCreateSuccess}
277
-              onCreateFail={this.onCreateFail}
278
-            />
275
+              <TaroCanvasDrawer
276
+                config={this.state.config}
277
+                onCreateSuccess={this.onCreateSuccess}
278
+                onCreateFail={this.onCreateFail}
279
+              />
279
             </View>
280
             </View>
280
           )
281
           )
281
         }
282
         }

+ 5
- 3
src/pages/project/h5Page.js 查看文件

91
         console.log(phone, "phone#########")
91
         console.log(phone, "phone#########")
92
         // 头像手机号都有
92
         // 头像手机号都有
93
         if (phone) {
93
         if (phone) {
94
-          this.reportClient()
94
+          this.reportClientFn()
95
           this.success()
95
           this.success()
96
           this.setState({
96
           this.setState({
97
             phoneVisible: false,
97
             phoneVisible: false,
307
         ruleToast('signup-agent')
307
         ruleToast('signup-agent')
308
         setTimeout(() => {
308
         setTimeout(() => {
309
           this.success()
309
           this.success()
310
-          this.reportClient()
310
+          this.reportClientFn()
311
           this.setState({
311
           this.setState({
312
             phoneVisible: false,
312
             phoneVisible: false,
313
             webViewVisible: true,
313
             webViewVisible: true,
318
   }
318
   }
319
 
319
 
320
   // 报备客户
320
   // 报备客户
321
-  reportClient() {
321
+  reportClientFn() {
322
     const { codeParams } = this.state
322
     const { codeParams } = this.state
323
     const consultant = this.$router.params.consultant || codeParams.consultant || ""
323
     const consultant = this.$router.params.consultant || codeParams.consultant || ""
324
     const { userInfo: { person: { phone, tel, personId, userId, personType } } } = this.props
324
     const { userInfo: { person: { phone, tel, personId, userId, personType } } } = this.props
325
     const isConsultant = personType == ROLE_CODE['CONSULTANT']
325
     const isConsultant = personType == ROLE_CODE['CONSULTANT']
326
+    console.log(this.$router, "this.$routerthis报备客户哈哈哈哈")
327
+    console.log(this.props.userInfo.person, "person报备客户哈哈哈哈")
326
 
328
 
327
     if (isConsultant && consultant != userId) {
329
     if (isConsultant && consultant != userId) {
328
       const realPhone = phone || tel
330
       const realPhone = phone || tel