Pārlūkot izejas kodu

Merge branch 'v3.5.1' of http://git.ycjcjy.com/zhiyuxing/miniapp-v3 into v3.5.1

# Conflicts:
#	src/components/charts/Line.js
许静 5 gadus atpakaļ
vecāks
revīzija
83bb255c11

+ 124
- 121
src/components/charts/Line.js Parādīt failu

2
 import echarts from '../ec-canvas/echarts'
2
 import echarts from '../ec-canvas/echarts'
3
 import './style.scss'
3
 import './style.scss'
4
 
4
 
5
-function initChart(callback, options) {
5
+function initChart(options, callback) {
6
   return function (canvas, width, height) {
6
   return function (canvas, width, height) {
7
     const chart = echarts.init(canvas, null, {
7
     const chart = echarts.init(canvas, null, {
8
       width: width,
8
       width: width,
9
       height: height
9
       height: height
10
     });
10
     });
11
     canvas.setChart(chart);
11
     canvas.setChart(chart);
12
-    chart.setOption(options);
12
+    chart.setOption(options);    
13
     callback && callback(chart);
13
     callback && callback(chart);
14
     return chart;
14
     return chart;
15
   }
15
   }
16
 }
16
 }
17
 
17
 
18
+function createLineOptions(source = []) {
19
+  const colorWithOpacity = op => `rgba(187,156,121, ${op})`
20
+
21
+  const defaultOpt = {
22
+    color: [colorWithOpacity(1)],
23
+    xAxis: {
24
+      type: 'category',
25
+      boundaryGap: false,
26
+      axisLabel: {
27
+        textStyle: {
28
+          color: '#666'
29
+        }
30
+      }
31
+
32
+    },
33
+    yAxis: {
34
+      type: 'value',
35
+      axisLabel: {
36
+        textStyle: {
37
+          color: '#666'
38
+        }
39
+      }
40
+    },
41
+    grid: {
42
+      left: '10%',
43
+      right: '8%',
44
+      bottom: '12%',
45
+      top: '10%',
46
+    },
47
+    series: [],
48
+  }
49
+
50
+  // 数据展示只展示 5 个
51
+  const endValue = source.length - 1 > 0 ? source.length - 1 : 0
52
+  const startValue = endValue - 5 > 0 ? endValue - 5 : 0
53
+
54
+  return {
55
+    ...defaultOpt,
56
+    dataset: { source },
57
+    dataZoom: [{
58
+      type: 'slider',
59
+      startValue, endValue,
60
+      show: true,
61
+      xAxisIndex: [0],
62
+      handleSize: 10,//滑动条的 左右2个滑动条的大小  
63
+      height: 20,//组件高度  
64
+      left: 30, //左边的距离  
65
+      right: 30,//右边的距离  
66
+      bottom: 0,//下边的距离  
67
+      handleColor: 'rgba(0,0,0,0.1)',//h滑动图标的颜色  
68
+      realtime : true,
69
+      handleStyle: {
70
+        borderColor: "#999",
71
+        borderWidth: "1",
72
+        shadowBlur: 2,
73
+        background: "rgba(0,0,0,0.1)",
74
+        shadowColor: "rgba(0,0,0,0.1)",
75
+      },
76
+      backgroundColor: 'rgba(0,0,0,0.1)',//两边未选中的滑动条区域的颜色  
77
+      showDataShadow: false,//是否显示数据阴影 默认auto  
78
+      showDetail: false,
79
+
80
+    }],
81
+    series: [{
82
+      type: 'line',
83
+      dimensions: ['name', 'value'],
84
+      symbolSize: 6,
85
+      smooth: true,
86
+      label: {
87
+        show: true,
88
+        formatter: '{@value}人'
89
+      },
90
+      lineStyle: {
91
+        shadowColor: colorWithOpacity(0.5),
92
+        shadowBlur: 5,
93
+        shadowOffsetY: 7
94
+      },
95
+      areaStyle: {
96
+        color: {
97
+          type: 'linear',
98
+          x: 0,
99
+          y: 0,
100
+          x2: 0,
101
+          y2: 1,
102
+          colorStops: [{
103
+            offset: 0, color: colorWithOpacity(0.2) // 0% 处的颜色
104
+          }, {
105
+            offset: 1, color: colorWithOpacity(0) // 100% 处的颜色
106
+          }],
107
+          global: false,
108
+        }
109
+      },
110
+    }],
111
+  }
112
+}
113
+
18
 /**
114
 /**
19
  * 传入 source 的格式为 [{ name: xxx, value: xxx }, {}]
115
  * 传入 source 的格式为 [{ name: xxx, value: xxx }, {}]
20
  */
116
  */
25
     }
121
     }
26
   }
122
   }
27
 
123
 
28
-  // this.echart
29
-  echart = null
124
+  // this.ecComponent
125
+  chart = null;
30
   ecComponent = null
126
   ecComponent = null
31
 
127
 
32
   state = {
128
   state = {
33
     ec: { lazyLoad: true },
129
     ec: { lazyLoad: true },
130
+    isDisposed: false,
34
   }
131
   }
35
 
132
 
36
-  // 禁止 props 变更时渲染
37
-  shouldComponentUpdate(nextProps) {
38
-    console.log('--nextProps--->', nextProps)
39
-
40
-    this.refreshChart(nextProps.source)
41
-
42
-    return false
133
+  componentDidShow() {
134
+    this.setState({ isDisposed: false })
43
   }
135
   }
44
 
136
 
45
-  handleEcComponent(ref) {
46
-    this.ecComponent = ref
137
+  componentDidHide() {
138
+    this.setState({ isDisposed: true })
47
   }
139
   }
48
 
140
 
49
-  handleChart(chart) {
50
-    this.echart = chart
141
+  componentDidMount() {
142
+    this.ecComponent = this.$scope.selectComponent(`#${this.props.lid}`)
143
+    this.init(this.props)
51
   }
144
   }
52
 
145
 
53
-  createOptions(source = []) {
54
-    const colorWithOpacity = op => `rgba(187,156,121, ${op})`
55
-
56
-    const defaultOpt = {
57
-      color: [colorWithOpacity(1)],
58
-      xAxis: {
59
-        type: 'category',
60
-        boundaryGap: false,
61
-        axisLabel: {
62
-          textStyle: {
63
-            color: '#666'
64
-          }
65
-        }
146
+  componentWillReceiveProps(nextProps) {
147
+    // 简单优化, 不显示的组件不更新
148
+    // 但是有个 bug 。如果此时有 props 更新, 会导致页面绘制的数据错误
149
+    if (this.state.isDisposed) return
66
 
150
 
67
-      },
68
-      yAxis: {
69
-        type: 'value',
70
-        axisLabel: {
71
-          textStyle: {
72
-            color: '#666'
73
-          }
74
-        }
75
-      },
76
-      grid: {
77
-        left: '10%',
78
-        right: '9%',
79
-        bottom: '13%',
80
-        top: '11%',
81
-      },
82
-      series: [],
83
-    }
84
-
85
-    // 数据展示只展示 5 个
86
-    const endValue = source.length - 1 > 0 ? source.length - 1 : 0
87
-    const startValue = endValue - 5 > 0 ? endValue - 5 : 0
88
-
89
-    return {
90
-      ...defaultOpt,
91
-      dataset: { source },
92
-      dataZoom: [{
93
-        type: 'slider',
94
-        startValue, endValue,
95
-        show: true,
96
-        xAxisIndex: [0],
97
-        handleSize: 10,//滑动条的 左右2个滑动条的大小 
98
-        height: 24,//组件高度  
99
-        left: 10, //左边的距离  
100
-        right: 10,//右边的距离  
101
-        bottom: 0,//下边的距离  
102
-        handleColor: 'rgba(0,0,0,0.1)',//h滑动图标的颜色  
103
-        realtime : true,
104
-        handleStyle: {
105
-          borderColor: "#999",
106
-          borderWidth: "1",
107
-          shadowBlur: 2,
108
-          background: "rgba(0,0,0,0.1)",
109
-          shadowColor: "rgba(0,0,0,0.1)",
110
-        },
111
-        backgroundColor: 'rgba(0,0,0,0.1)',//两边未选中的滑动条区域的颜色  
112
-        showDataShadow: false,//是否显示数据阴影 默认auto  
113
-        showDetail: false,
114
-
115
-      }],
116
-      series: [{
117
-        type: 'line',
118
-        dimensions: ['name', 'value'],
119
-        symbolSize: 6,
120
-        smooth: true,
121
-        label: {
122
-          show: true,
123
-          formatter: '{@value}人'
124
-        },
125
-        lineStyle: {
126
-          shadowColor: colorWithOpacity(0.5),
127
-          shadowBlur: 5,
128
-          shadowOffsetY: 7,
129
-        },
130
-        areaStyle: {
131
-          color: {
132
-            type: 'linear',
133
-            x: 0,
134
-            y: 0,
135
-            x2: 0,
136
-            y2: 1,
137
-            colorStops: [{
138
-              offset: 0, color: colorWithOpacity(0.2) // 0% 处的颜色
139
-            }, {
140
-              offset: 1, color: colorWithOpacity(0) // 100% 处的颜色
141
-            }],
142
-            global: false,
143
-          }
144
-        },
145
-      }],
151
+    // 简单的性能优化, 只有数据改变了才重新绘图
152
+    if (JSON.stringify(nextProps.source) != JSON.stringify(this.props.source)) {
153
+      this.init(nextProps)
146
     }
154
     }
147
   }
155
   }
148
 
156
 
149
-  refreshChart(source) {
150
-    const options = this.createOptions(source)
151
-
152
-    if (!this.echart) {
153
-      if (this.ecComponent) {
154
-        const initFunc = initChart(this.handleChart.bind(this), options)
155
-        this.ecComponent.init(initFunc)
156
-      } else {
157
-        console.warn('echart componet not ready')
157
+  init = (props) => {
158
+    const tk = setTimeout(() => {
159
+      if (this.ecComponent && props.source && props.source.length) {
160
+        const options = createLineOptions(props.source)
161
+        this.ecComponent.init(initChart(options, chart => (this.chart = chart)))
158
       }
162
       }
159
-    } else {
160
-      this.echart.setOption(options)
161
-    }
163
+
164
+      clearTimeout(tk)
165
+    }, 500)
162
   }
166
   }
163
 
167
 
164
   render() {
168
   render() {
165
-    // this.refreshChart(this.props.source)
166
     return (
169
     return (
167
       <View style="width:100vw;height:480rpx;position: relative;">
170
       <View style="width:100vw;height:480rpx;position: relative;">
168
         <View className="map-container">
171
         <View className="map-container">
169
-          <ec-canvas ref={this.handleEcComponent} ec={this.state.ec}></ec-canvas>
172
+          <ec-canvas id={this.props.lid} ec={this.state.ec}></ec-canvas>
170
         </View>
173
         </View>
171
       </View>
174
       </View>
172
     )
175
     )

+ 2
- 1
src/pages/activity/detail/index.js Parādīt failu

190
         return
190
         return
191
       }
191
       }
192
 
192
 
193
-      const { userInfo: { person } } = this.props
193
+      const { userInfo: { person, miniApp } } = this.props
194
       const { avatarurl, nickname, personId } = person
194
       const { avatarurl, nickname, personId } = person
195
       const { detail: { dynamicId, posters, createDate } } = this.state
195
       const { detail: { dynamicId, posters, createDate } } = this.state
196
       const payload = {
196
       const payload = {
208
           title: posters[0].posterTitle,//海报标题
208
           title: posters[0].posterTitle,//海报标题
209
           posterDescription: posters[0].posterDescription,//海报标题
209
           posterDescription: posters[0].posterDescription,//海报标题
210
           createDate: createDate,//时间
210
           createDate: createDate,//时间
211
+          miniAppName: miniApp.name, // 小程序名称
211
         }
212
         }
212
         resolve(data)
213
         resolve(data)
213
       })
214
       })

+ 3
- 3
src/pages/activity/detail/poster.js Parādīt failu

110
       {
110
       {
111
         x: 100,
111
         x: 100,
112
         y: 1065,
112
         y: 1065,
113
-        text: '橙蕉',
113
+        text: data.miniAppName,
114
         fontSize: 34,
114
         fontSize: 34,
115
         color: 'red',
115
         color: 'red',
116
         baseLine: 'middle',
116
         baseLine: 'middle',
117
         lineHeight: 48,
117
         lineHeight: 48,
118
-        width: 120,
118
+        width: (data.miniAppName || '').length * 30 + 60,
119
         zIndex: 11
119
         zIndex: 11
120
       },
120
       },
121
       {
121
       {
122
-        x: 190,
122
+        x: (data.miniAppName || '').length * 30 + 130,
123
         y: 1065,
123
         y: 1065,
124
         text: '热门活动',
124
         text: '热门活动',
125
         fontSize: 26,
125
         fontSize: 26,

+ 2
- 2
src/pages/card/index.js Parādīt failu

293
         resolve(posterData)
293
         resolve(posterData)
294
         return
294
         return
295
       }
295
       }
296
-      const { userInfo: { person }, projectDetail: { buildingId }, cardInfo } = this.props
296
+      const { userInfo: { person, miniApp }, projectDetail: { buildingId }, cardInfo } = this.props
297
       const { id } = cardInfo
297
       const { id } = cardInfo
298
       const { personId } = person
298
       const { personId } = person
299
       const payload = {
299
       const payload = {
301
         "page": 'pages/card/index',
301
         "page": 'pages/card/index',
302
       }
302
       }
303
       getMiniQrcode(payload).then(qrcode => {
303
       getMiniQrcode(payload).then(qrcode => {
304
-        let data = Object.assign({ qrcode }, cardInfo)
304
+        let data = Object.assign({ qrcode, miniAppName: miniApp.name }, cardInfo)
305
         resolve(data)
305
         resolve(data)
306
       })
306
       })
307
     })
307
     })

+ 4
- 4
src/pages/card/poster.js Parādīt failu

118
       {
118
       {
119
         x: 170,
119
         x: 170,
120
         y: 755,
120
         y: 755,
121
-        text: '橙蕉',
121
+        text: data.miniAppName,
122
         fontSize: 34,
122
         fontSize: 34,
123
         color: 'red',
123
         color: 'red',
124
         baseLine: 'middle',
124
         baseLine: 'middle',
125
         lineHeight: 48,
125
         lineHeight: 48,
126
-        width: 120,
126
+        width: (data.miniAppName || '').length * 30 + 60,
127
         zIndex: 100
127
         zIndex: 100
128
       },
128
       },
129
       {
129
       {
130
-        x: 260,
130
+        x: (data.miniAppName || '').length * 30 + 200,
131
         y: 755,
131
         y: 755,
132
         text: '查看主页',
132
         text: '查看主页',
133
         fontSize: 26,
133
         fontSize: 26,
140
       {
140
       {
141
         x: 320,
141
         x: 320,
142
         y: 1075,
142
         y: 1075,
143
-        text: '橙蕉',
143
+        text: data.miniAppName,
144
         fontSize: 32,
144
         fontSize: 32,
145
         color: '#b5b3b3',
145
         color: '#b5b3b3',
146
         baseLine: 'middle',
146
         baseLine: 'middle',

+ 3
- 2
src/pages/news/detail/index.js Parādīt failu

154
         resolve(posterData)
154
         resolve(posterData)
155
         return
155
         return
156
       }
156
       }
157
-      const { userInfo: { person } } = this.props
157
+      const { userInfo: { person, miniApp } } = this.props
158
       const { avatarurl, nickname, personId } = person
158
       const { avatarurl, nickname, personId } = person
159
       const { newsId, detail: { posters, newsName, createDate } } = this.state
159
       const { newsId, detail: { posters, newsName, createDate } } = this.state
160
       const payload = {
160
       const payload = {
171
           title: posters[0].posterTitle,//资讯海报标题
171
           title: posters[0].posterTitle,//资讯海报标题
172
           posterDescription: posters[0].posterDescription,//资讯海报描述
172
           posterDescription: posters[0].posterDescription,//资讯海报描述
173
           createDate: createDate,//资讯时间
173
           createDate: createDate,//资讯时间
174
-          poster: posters[0].posterImg
174
+          poster: posters[0].posterImg,
175
+          miniAppName: miniApp.name,
175
         }
176
         }
176
         resolve(data)
177
         resolve(data)
177
       })
178
       })

+ 3
- 3
src/pages/news/detail/poster.js Parādīt failu

110
       {
110
       {
111
         x: 100,
111
         x: 100,
112
         y: 1065,
112
         y: 1065,
113
-        text: '橙蕉',
113
+        text: data.miniAppName,
114
         fontSize: 34,
114
         fontSize: 34,
115
         color: 'red',
115
         color: 'red',
116
         baseLine: 'middle',
116
         baseLine: 'middle',
117
         lineHeight: 48,
117
         lineHeight: 48,
118
-        width: 120,
118
+        width: (data.miniAppName || '').length * 30 + 60,
119
         zIndex: 11
119
         zIndex: 11
120
       },
120
       },
121
       {
121
       {
122
-        x: 190,
122
+        x: (data.miniAppName || '').length * 30 + 130,
123
         y: 1065,
123
         y: 1065,
124
         text: '查看资讯',
124
         text: '查看资讯',
125
         fontSize: 26,
125
         fontSize: 26,

+ 6
- 4
src/pages/person/customerAnalysis/analysis.js Parādīt failu

12
 import LineChart from "../../../components/charts/Line";
12
 import LineChart from "../../../components/charts/Line";
13
 const nothing = require('@assets/person/nothing.png')
13
 const nothing = require('@assets/person/nothing.png')
14
 
14
 
15
+const rand = n => Math.random().toString(36).substr(2, n)
15
 
16
 
16
 @connect(({ user, city }) => ({ user, city }))
17
 @connect(({ user, city }) => ({ user, city }))
17
 export default class analysis extends Taro.Component {
18
 export default class analysis extends Taro.Component {
28
     chartInfo: [],
29
     chartInfo: [],
29
     chartInfo2: [],
30
     chartInfo2: [],
30
     chartInfo3: [],
31
     chartInfo3: [],
32
+    lineIds: [ rand(7), rand(7), rand(7) ],
31
   }
33
   }
32
 
34
 
33
   componentWillUnmount() {
35
   componentWillUnmount() {
160
 
162
 
161
     const tabList = [{ title: '新增客户' }, { title: '跟进客户' }, { title: '到访客户' }]
163
     const tabList = [{ title: '新增客户' }, { title: '跟进客户' }, { title: '到访客户' }]
162
     const dailyMonth = ['日', '月']
164
     const dailyMonth = ['日', '月']
163
-    const { sexInfo, chartInfo, chartInfo2, chartInfo3, checkedWhich, current } = this.state
165
+    const { sexInfo, chartInfo, chartInfo2, chartInfo3, checkedWhich, current, lineIds } = this.state
164
 
166
 
165
     return (
167
     return (
166
       <View>
168
       <View>
179
               </View>
181
               </View>
180
               {
182
               {
181
                 chartInfo.length &&
183
                 chartInfo.length &&
182
-                <LineChart source={chartInfo} />
184
+                <LineChart source={chartInfo} lid={lineIds[0]} />
183
               }
185
               }
184
               {
186
               {
185
                 !chartInfo.length &&
187
                 !chartInfo.length &&
218
                 </View>
220
                 </View>
219
               </View>
221
               </View>
220
               {chartInfo2.length &&
222
               {chartInfo2.length &&
221
-                <LineChart source={chartInfo2} />
223
+                <LineChart source={chartInfo2} lid={lineIds[1]}/>
222
               }
224
               }
223
               {
225
               {
224
                 !chartInfo2.length &&
226
                 !chartInfo2.length &&
258
               </View>
260
               </View>
259
               {
261
               {
260
                 chartInfo3.length &&
262
                 chartInfo3.length &&
261
-                <LineChart source={chartInfo3} />
263
+                <LineChart source={chartInfo3} lid={lineIds[2]} />
262
               }
264
               }
263
               {
265
               {
264
                 !chartInfo3.length &&
266
                 !chartInfo3.length &&

+ 3
- 2
src/pages/project/detail/index.js Parādīt failu

297
         return
297
         return
298
       }
298
       }
299
       const {
299
       const {
300
-        userInfo: { person: { avatarurl, nickname, personId } },
300
+        userInfo: { person: { avatarurl, nickname, personId }, miniApp },
301
         projectDetail: { posters, buildingId, poster, price, buildingRestaurant, createDate, buildingName, tel, buildingTag, uvList = {} }
301
         projectDetail: { posters, buildingId, poster, price, buildingRestaurant, createDate, buildingName, tel, buildingTag, uvList = {} }
302
       } = this.props
302
       } = this.props
303
       const { total = 0 } = uvList
303
       const { total = 0 } = uvList
319
           buildingName: posters[0].posterTitle,//标题
319
           buildingName: posters[0].posterTitle,//标题
320
           createDate: createDate,//时间
320
           createDate: createDate,//时间
321
           buildingTag: buildingTag,//标签,
321
           buildingTag: buildingTag,//标签,
322
-          total: total//围观人数
322
+          total: total, //围观人数
323
+          miniAppName: miniApp.name,
323
         }
324
         }
324
         resolve(data)
325
         resolve(data)
325
       })
326
       })

+ 3
- 3
src/pages/project/detail/poster.js Parādīt failu

101
       {
101
       {
102
         x: 100,
102
         x: 100,
103
         y: 1070,
103
         y: 1070,
104
-        text: '橙蕉',
104
+        text: data.miniAppName,
105
         fontSize: 34,
105
         fontSize: 34,
106
         color: 'red',
106
         color: 'red',
107
         baseLine: 'middle',
107
         baseLine: 'middle',
108
         lineHeight: 48,
108
         lineHeight: 48,
109
-        width: 120,
109
+        width: (data.miniAppName || '').length * 30 + 60,
110
         zIndex: 11
110
         zIndex: 11
111
       },
111
       },
112
       {
112
       {
113
-        x: 190,
113
+        x: (data.miniAppName || '').length * 30 + 130,
114
         y: 1070,
114
         y: 1070,
115
         text: '项目详情',
115
         text: '项目详情',
116
         fontSize: 26,
116
         fontSize: 26,

+ 21
- 21
src/pages/shop/index.js Parādīt failu

3
 import { AtTabs, AtTabsPane } from 'taro-ui'
3
 import { AtTabs, AtTabsPane } from 'taro-ui'
4
 import "taro-ui/dist/style/components/tabs.scss"
4
 import "taro-ui/dist/style/components/tabs.scss"
5
 import './index.scss'
5
 import './index.scss'
6
-import {getThumbnail } from '@utils/tools'
6
+import { getThumbnail } from '@utils/tools'
7
 // import Search from '@components/search'
7
 // import Search from '@components/search'
8
 import Banner from './banner'
8
 import Banner from './banner'
9
 import ready from '@utils/ready'
9
 import ready from '@utils/ready'
37
     goodsList: [],
37
     goodsList: [],
38
     user: {},
38
     user: {},
39
     current: 0,
39
     current: 0,
40
-    points:0
40
+    points: 0
41
   }
41
   }
42
 
42
 
43
-  componentDidShow() {
43
+  componentDidShow () {
44
 
44
 
45
     Taro.showLoading()
45
     Taro.showLoading()
46
     ready.queue(() => {
46
     ready.queue(() => {
53
     Taro.hideLoading()
53
     Taro.hideLoading()
54
   }
54
   }
55
 
55
 
56
-  loadBannerList() {
56
+  loadBannerList () {
57
     const payload = {
57
     const payload = {
58
       showPosition: 'mall',
58
       showPosition: 'mall',
59
       cityId: this.props.curCity.id
59
       cityId: this.props.curCity.id
65
     })
65
     })
66
   }
66
   }
67
 
67
 
68
-  loadList() {
68
+  loadList () {
69
 
69
 
70
 
70
 
71
     Taro.showLoading()
71
     Taro.showLoading()
88
     })
88
     })
89
   }
89
   }
90
 
90
 
91
-  loadGoodsBuilding() {
91
+  loadGoodsBuilding () {
92
     const payload = {
92
     const payload = {
93
 
93
 
94
       cityId: this.props.curCity.id
94
       cityId: this.props.curCity.id
115
     })
115
     })
116
   }
116
   }
117
 
117
 
118
-  handleClick(value) {
118
+  handleClick (value) {
119
 
119
 
120
     this.setState({
120
     this.setState({
121
       current: value
121
       current: value
136
 
136
 
137
   }
137
   }
138
 
138
 
139
-  onViewDetail(item) {
139
+  onViewDetail (item) {
140
     Taro.navigateTo({
140
     Taro.navigateTo({
141
       url: `/pages/shop/detail/index?id=${item.goodsId}`
141
       url: `/pages/shop/detail/index?id=${item.goodsId}`
142
     })
142
     })
143
   }
143
   }
144
 
144
 
145
-  goPointRecords() {
145
+  goPointRecords () {
146
     const { person: { points } } = this.props.userInfo
146
     const { person: { points } } = this.props.userInfo
147
     Taro.navigateTo({
147
     Taro.navigateTo({
148
       url: `/pages/shop/integralDetail/index?points=` + points
148
       url: `/pages/shop/integralDetail/index?points=` + points
149
     })
149
     })
150
   }
150
   }
151
 
151
 
152
-  goPointRule() {
152
+  goPointRule () {
153
     Taro.navigateTo({
153
     Taro.navigateTo({
154
       url: `/pages/shop/rule/index`
154
       url: `/pages/shop/rule/index`
155
     })
155
     })
156
   }
156
   }
157
 
157
 
158
-  handleLocationClick() {
158
+  handleLocationClick () {
159
     Taro.navigateTo({
159
     Taro.navigateTo({
160
       url: `/pages/city/index`
160
       url: `/pages/city/index`
161
     })
161
     })
162
   }
162
   }
163
 
163
 
164
-  doSign() {
164
+  doSign () {
165
     const { user: { id, havaSigned } } = this.state
165
     const { user: { id, havaSigned } } = this.state
166
     if (havaSigned) {
166
     if (havaSigned) {
167
       return
167
       return
183
     })
183
     })
184
   }
184
   }
185
 
185
 
186
-  loadUserInfo() {
186
+  loadUserInfo () {
187
     // debugger
187
     // debugger
188
     queryUserInfo().then(user => {
188
     queryUserInfo().then(user => {
189
       console.log(user, "user")
189
       console.log(user, "user")
196
     })
196
     })
197
   }
197
   }
198
 
198
 
199
-  renderLogin() {
199
+  renderLogin () {
200
     return <Authorize></Authorize>
200
     return <Authorize></Authorize>
201
   }
201
   }
202
   handleBannerClick = (item) => {
202
   handleBannerClick = (item) => {
203
     console.log(this, "this")
203
     console.log(this, "this")
204
     this.redirectTo(item)
204
     this.redirectTo(item)
205
   }
205
   }
206
-  redirectTo({ targetId, contentType, buildingId } = {}) {
206
+  redirectTo ({ targetId, contentType, buildingId } = {}) {
207
     switch (contentType) {
207
     switch (contentType) {
208
       // 项目
208
       // 项目
209
       case 'project':
209
       case 'project':
248
     }
248
     }
249
   }
249
   }
250
 
250
 
251
-  renderGoods() {
251
+  renderGoods () {
252
     const { goods: { records = [] } } = this.props
252
     const { goods: { records = [] } } = this.props
253
     const { goodsList, goodsBuilding, current } = this.state
253
     const { goodsList, goodsBuilding, current } = this.state
254
 
254
 
261
             {
261
             {
262
               goodsList.length &&
262
               goodsList.length &&
263
               goodsList.map(item => (
263
               goodsList.map(item => (
264
-                
264
+
265
                 <View className="item" key={item.goodsId} onClick={this.onViewDetail.bind(this, item)}>
265
                 <View className="item" key={item.goodsId} onClick={this.onViewDetail.bind(this, item)}>
266
-                  {console.log(item,'--item---')}
266
+                  {console.log(item, '--item---')}
267
                   <Image className="item__img" mode="aspectFill" src={item.imgUrl} />
267
                   <Image className="item__img" mode="aspectFill" src={item.imgUrl} />
268
                   <View className="item__title">{item.goodsName}</View>
268
                   <View className="item__title">{item.goodsName}</View>
269
                   <View className="item__des">
269
                   <View className="item__des">
288
         {
288
         {
289
           goodsBuilding && goodsBuilding.length >= 2 &&
289
           goodsBuilding && goodsBuilding.length >= 2 &&
290
           <View className="list__wrap">
290
           <View className="list__wrap">
291
-            <View className="hot_title" style={{marginBottom:'0'}}>热门商品</View>
291
+            <View className="hot_title" style={{ marginBottom: '0' }}>热门商品</View>
292
             <AtTabs scroll tabDirection='horizontal' current={current} tabList={goodsBuilding} onClick={this.handleClick.bind(this)}>
292
             <AtTabs scroll tabDirection='horizontal' current={current} tabList={goodsBuilding} onClick={this.handleClick.bind(this)}>
293
 
293
 
294
               {goodsBuilding.map((l_item, index) => (
294
               {goodsBuilding.map((l_item, index) => (
330
     )
330
     )
331
   }
331
   }
332
 
332
 
333
-  renderDetail() {
333
+  renderDetail () {
334
     const { user, points } = this.state
334
     const { user, points } = this.state
335
     const { userInfo: { person }, curCity } = this.props
335
     const { userInfo: { person }, curCity } = this.props
336
     const { bannerList = [] } = this.state
336
     const { bannerList = [] } = this.state
389
     );
389
     );
390
   }
390
   }
391
 
391
 
392
-  render() {
392
+  render () {
393
     const { person: { phone, tel } } = this.props.userInfo
393
     const { person: { phone, tel } } = this.props.userInfo
394
 
394
 
395
     return (
395
     return (