Procházet zdrojové kódy

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

周立森 před 5 roky
rodič
revize
da674b8973

+ 4
- 4
config/dev.js Zobrazit soubor

@@ -5,12 +5,12 @@ module.exports = {
5 5
   defineConstants: {
6 6
     // HOST: '"http://47.101.36.130:8085"',//测试
7 7
     // WSS_HOST: '"wss://47.101.36.130:8085"',
8
-    // HOST:  '"https://dev.jinchengjiaye.com"',//测试
9
-    // WSS_HOST: '"wss://dev.jinchengjiaye.com"',
8
+    HOST:  '"https://dev.jinchengjiaye.com"',//测试
9
+    WSS_HOST: '"wss://dev.jinchengjiaye.com"',
10 10
     // HOST: '"https://lt.pawoma.cn"',
11 11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
12
-    HOST: '"http://192.168.0.84:8080"',
13
-    WSS_HOST: '"ws://192.168.0.84:8080"',
12
+    // HOST: '"http://192.168.0.84:8080"',
13
+    // WSS_HOST: '"ws://192.168.0.84:8080"',
14 14
   },
15 15
   weapp: {},
16 16
   h5: {}

+ 1
- 1
project.config.json Zobrazit soubor

@@ -2,7 +2,7 @@
2 2
 	"miniprogramRoot": "dist/",
3 3
 	"projectname": "mini-chengjiao",
4 4
 	"description": "知与行联调",
5
-	"appid": "wxd9ee3a9480a4e544",
5
+	"appid": "wxda1f84b79b3edeb3",
6 6
 	"setting": {
7 7
 		"urlCheck": false,
8 8
 		"es6": false,

+ 30
- 26
src/app.js Zobrazit soubor

@@ -144,12 +144,41 @@ class App extends Component {
144 144
       ]
145 145
     },
146 146
   }
147
+
147 148
   componentDidHide() {
148
-    ready.close()
149
+    // ready.close()
149 150
     // socket.closeSocket()
150 151
   }
151 152
 
152 153
   componentDidShow() {
154
+    const updateManager = wx.getUpdateManager()
155
+    updateManager.onCheckForUpdate(function (res) {
156
+      // 请求完新版本信息的回调
157
+      console.info('新版本是否更新:', res.hasUpdate)
158
+    })
159
+
160
+    updateManager.onUpdateReady(function () {
161
+      wx.showModal({
162
+        title: '更新提示',
163
+        content: '新版本已经准备好,是否重启应用?',
164
+        success(res) {
165
+          if (res.confirm) {
166
+            // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
167
+            updateManager.applyUpdate()
168
+          }
169
+        }
170
+      })
171
+    })
172
+  }
173
+  componentDidMount() {
174
+    console.info('app componentDidMount')
175
+  }
176
+  componentWillMount(params) {
177
+    // console.info('app componentWillMount', params)
178
+    this.initData()
179
+  }
180
+
181
+  initData () {
153 182
     console.info('app componentDidShow')
154 183
     console.info('router1', this.$router.params)
155 184
     console.info('ready status1', ready)
@@ -190,31 +219,6 @@ class App extends Component {
190 219
         })
191 220
       })
192 221
     })
193
-
194
-    const updateManager = wx.getUpdateManager()
195
-    updateManager.onCheckForUpdate(function (res) {
196
-      // 请求完新版本信息的回调
197
-      console.info('新版本是否更新:', res.hasUpdate)
198
-    })
199
-
200
-    updateManager.onUpdateReady(function () {
201
-      wx.showModal({
202
-        title: '更新提示',
203
-        content: '新版本已经准备好,是否重启应用?',
204
-        success(res) {
205
-          if (res.confirm) {
206
-            // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
207
-            updateManager.applyUpdate()
208
-          }
209
-        }
210
-      })
211
-    })
212
-  }
213
-  componentDidMount() {
214
-    console.info('app componentDidMount')
215
-  }
216
-  componentWillMount(params) {
217
-    console.info('app componentWillMount', params)
218 222
   }
219 223
 
220 224
   getRouterParams() {

+ 105
- 121
src/components/charts/Line.js Zobrazit soubor

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

+ 1
- 1
src/pages/activity/detail/assemble.js Zobrazit soubor

@@ -642,7 +642,7 @@ export default class Detail extends Component {
642 642
                         (groupState === GroupInProcess && !isJoin) &&
643 643
                         (<View className="assistance-btn"><FormIdCollector><Button className="assistance-btn" onClick={this.joinGroup}>立即参团</Button></FormIdCollector></View>)
644 644
                       }                      
645
-                      <View className={groupState === GroupInProcess && !isJoin ? "set-btn" : "assistance-btn"}>
645
+                      <View className={groupState === GroupInProcess && !isJoin ? "set-btn" : "assistance-btn"} style="border:none">
646 646
                         <FormIdCollector>
647 647
                           <Button className={groupState === GroupInProcess && !isJoin ? "set-btn" : "assistance-btn"} onClick={this.startMine}>发起我的拼团</Button>
648 648
                         </FormIdCollector>

+ 2
- 1
src/pages/activity/detail/index.js Zobrazit soubor

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

+ 3
- 3
src/pages/activity/detail/poster.js Zobrazit soubor

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

+ 2
- 2
src/pages/card/index.js Zobrazit soubor

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

+ 4
- 4
src/pages/card/poster.js Zobrazit soubor

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

+ 3
- 2
src/pages/news/detail/index.js Zobrazit soubor

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

+ 3
- 3
src/pages/news/detail/poster.js Zobrazit soubor

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

+ 6
- 4
src/pages/person/customerAnalysis/analysis.js Zobrazit soubor

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

+ 2
- 2
src/pages/project/detail/Around/index.js Zobrazit soubor

@@ -15,7 +15,7 @@ export default function Around(props) {
15 15
   // 展示内容数组
16 16
   const dataList = poiDatas.map((item) => {
17 17
     const key = item.key
18
-    const manualData = (detail[`building${key}`] === '' ? [] : detail[`building${key}`].split(','))
18
+    const manualData = (detail[`building${key}`] === '' ? [] : (detail[`building${key}`] || '').split(','))
19 19
     
20 20
     return {
21 21
       ...item,
@@ -28,7 +28,7 @@ export default function Around(props) {
28 28
   const markersList = dataList.map((item) => {
29 29
     const mapJson = JSON.parse(item.data) 
30 30
     return (mapJson || []).map((it) => {
31
-      const [longitude, latitude] = it.location.split(',')
31
+      const [longitude, latitude] = (it.location || '').split(',')
32 32
 
33 33
       return {
34 34
         id: it.id,

+ 22
- 21
src/pages/project/detail/index.js Zobrazit soubor

@@ -48,8 +48,8 @@ export default class Index extends Component {
48 48
     activityList: [],
49 49
     helpList: [],
50 50
     groupList: [],
51
-    statusOpts: ['待', '售罄', '在售'],
52
-    statusBgColors: ['#F6B61D', '#BB9C79', '#CECECE'],
51
+    statusOpts: ['待', '售罄', '在售'],
52
+    statusBgColors: ['#BB9C79', '#CECECE', '#F6B61D'],
53 53
     // circumOpts: [],
54 54
     curTab: 'Transport',
55 55
     recordId: null,
@@ -63,7 +63,6 @@ export default class Index extends Component {
63 63
 
64 64
   componentWillMount() {
65 65
     ready.queue(() => {
66
-    
67 66
       // 分享场景需要先授权手机, 再授权头像
68 67
       const options = wx.getLaunchOptionsSync()
69 68
       if (sceneInShare(options.scene)) {
@@ -80,6 +79,7 @@ export default class Index extends Component {
80 79
 
81 80
       this.initPageData()
82 81
     })
82
+    console.log('---------------after componentWillMount---------------')
83 83
   }
84 84
 
85 85
   componentWillUnmount() {
@@ -245,10 +245,10 @@ export default class Index extends Component {
245 245
     })
246 246
   }
247 247
 
248
-  toViewAlbum (index){
248
+  toViewAlbum(index) {
249 249
     const { buildingId } = this.state
250
-    console.log('1111111',index)
251
-    this.navigateTo(`/pages/project/album/index?id=${buildingId}&current=${index}` )
250
+    console.log('1111111', index)
251
+    this.navigateTo(`/pages/project/album/index?id=${buildingId}&current=${index}`)
252 252
   }
253 253
 
254 254
   onViewFans() {
@@ -297,7 +297,7 @@ export default class Index extends Component {
297 297
         return
298 298
       }
299 299
       const {
300
-        userInfo: { person: { avatarurl, nickname, personId } },
300
+        userInfo: { person: { avatarurl, nickname, personId }, miniApp },
301 301
         projectDetail: { posters, buildingId, poster, price, buildingRestaurant, createDate, buildingName, tel, buildingTag, uvList = {} }
302 302
       } = this.props
303 303
       const { total = 0 } = uvList
@@ -319,7 +319,8 @@ export default class Index extends Component {
319 319
           buildingName: posters[0].posterTitle,//标题
320 320
           createDate: createDate,//时间
321 321
           buildingTag: buildingTag,//标签,
322
-          total: total//围观人数
322
+          total: total, //围观人数
323
+          miniAppName: miniApp.name,
323 324
         }
324 325
         resolve(data)
325 326
       })
@@ -636,21 +637,21 @@ export default class Index extends Component {
636 637
                       console.log(buildingImgUrl, 'buildingImgUrl')
637 638
 
638 639
                       // if (buildingImgUrl != null) {
639
-                      return ( <View key={index + "listimg"}>
640
+                      return (<View key={index + "listimg"}>
640 641
                         {buildingImgUrl != null && (<View
641 642
                           style={{ marginRight: '8px' }}
642
-                          
643
+
643 644
                         >
644 645
 
645 646
                           <View>
646
-                            <Image className='albumimg' src={getThumbnail(buildingImgList[0].url)} onClick={()=>this.toViewAlbum(index)}></Image>
647
+                            <Image className='albumimg' src={getThumbnail(buildingImgList[0].url)} onClick={() => this.toViewAlbum(index)}></Image>
647 648
                             <View style={{ width: '218rpx', display: 'flex', justifyContent: 'center' }} >
648 649
                               <View style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}> {apartmentName}  </View>
649 650
                               <View> ({buildingImgList.length})</View>
650 651
                             </View>
651 652
                           </View>
652 653
                         </View>)}
653
-                        </View>
654
+                      </View>
654 655
                       )
655 656
                       // }
656 657
 
@@ -868,21 +869,21 @@ export default class Index extends Component {
868 869
   }
869 870
   renderActivities() {
870 871
 
871
- 
872
+
872 873
     const { activityList } = this.state
873
-   
874
+
874 875
     return (
875 876
       <Block>
876 877
         {
877 878
           activityList.length > 0 && (
878 879
             <View className="activity" >
879
-           
880
+
880 881
               <View className="section-head">
881
-                 <Text className="section-head__title" style={{margin: '10rpx 0 40rpx 35rpx'}}>热门活动</Text>
882
-                 <View className="section-head__more"  style={{marginRight: '20rpx'}} onClick={this.handleActivityMoreClick}>
883
-                   更多活动<Text className="iconfont icon-more"></Text>
884
-                 </View>
885
-               </View>
882
+                <Text className="section-head__title" style={{ margin: '10rpx 0 40rpx 35rpx' }}>热门活动</Text>
883
+                <View className="section-head__more" style={{ marginRight: '20rpx' }} onClick={this.handleActivityMoreClick}>
884
+                  更多活动<Text className="iconfont icon-more"></Text>
885
+                </View>
886
+              </View>
886 887
               <View
887 888
                 style={{ position: 'relative' }}>
888 889
                 <HelpGroupBanner
@@ -897,7 +898,7 @@ export default class Index extends Component {
897 898
 
898 899
               </View>
899 900
             </View>
900
-      
901
+
901 902
           )
902 903
         }
903 904
       </Block>

+ 3
- 3
src/pages/project/detail/poster.js Zobrazit soubor

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

+ 1
- 1
src/utils/request.js Zobrazit soubor

@@ -94,7 +94,7 @@ export const fetch = async (options) => {
94 94
       icon: 'none'
95 95
     })
96 96
 
97
-    throw new Error(errMessage)
97
+    throw new Error(err)
98 98
   })
99 99
 }
100 100