张延森 пре 5 година
родитељ
комит
8394784576

+ 2
- 2
config/dev.js Прегледај датотеку

@@ -9,8 +9,8 @@ module.exports = {
9 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.172:8080"',
13
-    WSS_HOST: '"wss://192.168.0.172: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: {}

+ 19
- 0
src/components/Visible.js Прегледај датотеку

@@ -0,0 +1,19 @@
1
+import { connect } from '@tarojs/redux'
2
+import { Block } from '@tarojs/components'
3
+
4
+function checkDefault(props) {
5
+  return true
6
+}
7
+
8
+function Visible(props) {
9
+  const checkFn = props.check || checkDefault
10
+  const canShow = checkFn(props)
11
+
12
+  if (canShow) {
13
+    return <Block>{props.children}</Block>
14
+  }
15
+
16
+  return null
17
+}
18
+
19
+export default connect(s => s.user)(Visible)

+ 4
- 2
src/components/authorize/index.scss Прегледај датотеку

@@ -1,3 +1,5 @@
1
+@import "@styles/theme.scss";
2
+
1 3
 .auth-page{
2 4
   position: relative;
3 5
   width: 100%;
@@ -24,13 +26,13 @@
24 26
     width: 80%;
25 27
     left: 10%;
26 28
     height:90px;
27
-    background: #FF4740;
28 29
     border-radius: 10px;
29 30
     top:40%;
30
-    color: #fff;
31 31
     font-size:32px;
32 32
     font-weight: 500;
33 33
     line-height: 90px;
34
+    color: white;
35
+    background-color: $primary-color;
34 36
   }
35 37
   .adver-btn{
36 38
     position: absolute;

+ 6
- 1
src/constants/api.js Прегледај датотеку

@@ -92,7 +92,6 @@ export const API_BURIED_POINT = resolvePath('taPersonVisitRecord')
92 92
 // activity
93 93
 export const API_ACTIVITY_LIST = resolvePath('buildingDynamiceList')
94 94
 
95
-
96 95
 // save activity
97 96
 export const API_ACTIVITY_SAVE = resolvePath('save/buildingDynamiceList')
98 97
 
@@ -135,3 +134,9 @@ export const API_AGENT_CHANNEL = resolvePath('customer/recommend/becomeChannel')
135 134
 export const API_AGENT_CURRENT = resolvePath('user/current')
136 135
 
137 136
 export const API_EDIT_AGENT = resolvePath('editPerson')
137
+
138
+// 活动列表-新
139
+export const API_ACTNEW_LIST = resolvePath('activity/list')
140
+
141
+// 助力
142
+export const API_HELP_DETAIL = resolvePath('helpActivity')

+ 2
- 1
src/pages/activity/detail/assemble.js Прегледај датотеку

@@ -7,6 +7,7 @@ import dayjs from 'dayjs'
7 7
 import WxParse from '@components/wxParse/wxParse'
8 8
 import getUserPhone from '@utils/getUserPhone'
9 9
 import ready from '@utils/ready'
10
+import { getDownloadURL } from '@utils/tools'
10 11
 import {
11 12
   addActivityShareNum,
12 13
   signupActivity,
@@ -190,7 +191,7 @@ export default class Detail extends Component {
190 191
         "page": 'pages/activity/detail/index',
191 192
       }
192 193
       debugger
193
-      const _avatarurl = avatarurl.replace('https://wx.qlogo.cn/', 'https://d.pawoma.cn/qlogo/');
194
+      const _avatarurl = getDownloadURL(avatarurl, 'avatar');
194 195
       getMiniQrcode(payload).then(qrcode => {
195 196
         let data = {
196 197
           qrcode,//小程序二维码

+ 196
- 191
src/pages/activity/detail/assistance.js Прегледај датотеку

@@ -4,15 +4,17 @@ import Notice from '@components/Notice'
4 4
 import BackHomeBtn from '@components/BackHomeBtn'
5 5
 import Poster from './poster'
6 6
 import dayjs from 'dayjs'
7
-import WxParse from '@components/wxParse/wxParse'
7
+// import WxParse from '@components/wxParse/wxParse'
8 8
 import getUserPhone from '@utils/getUserPhone'
9 9
 import ready from '@utils/ready'
10
+import { getDownloadURL } from '@utils/tools'
10 11
 import {
11
-  addActivityShareNum,
12
+  // addActivityShareNum,
12 13
   signupActivity,
13 14
   favorActivity,
14 15
   cancelFavorActivity,
15
-  queryActivityDetail
16
+  queryActivityDetail,
17
+  getHelpDetail,
16 18
 } from '@services/activity'
17 19
 import {
18 20
   getMiniQrcode,
@@ -21,6 +23,14 @@ import {
21 23
 } from '@services/common'
22 24
 import { connect } from '@tarojs/redux'
23 25
 
26
+const times = n => n > 0 ? '*'.repeat(n-1).split('*') : []
27
+
28
+const BeforeStart = 0;
29
+const InProcess = 1;
30
+const Finished = 2;
31
+
32
+const defaultAvatar = require('@assets/agent/banner.png')
33
+
24 34
 @connect(state => state.user)
25 35
 export default class Detail extends Component {
26 36
   config = {
@@ -28,138 +38,183 @@ export default class Detail extends Component {
28 38
   }
29 39
 
30 40
   state = {
31
-    id: null,
41
+    id: null, // 活动ID
42
+    initiateId: undefined,  // 发起活动
32 43
     loaded: false,
33
-    detail: {},
34
-    recordId: null,
35
-    isSaved: false,
36
-    isSign: false,
37
-    posterShow: false,
38
-    posterData: {},
39
-    posterVisible: false,
40
-    selector: ['1', '2', '3'],
41
-    selectorChecked: '1',
42
-    canChoose: 'none',
43
-    inputName: ''
44
+    detail: {}, // 活动详情
45
+    initiateDetail: {}, // 发起详情
46
+    helpList: [], // 助力人员列表
47
+    shares: [], // 分享设置
48
+    posters: [],  // 海报设置
49
+    leftTime: 0,  // 剩余时间
50
+    ltTicker: undefined,  // 剩余时间计时器
51
+    actState: BeforeStart,  // 活动状态
52
+    isStarter: false, // 是否发起人
44 53
   }
45 54
 
46 55
   componentWillMount() {
47 56
     ready.queue(() => {
48 57
       const router = Taro.getStorageSync('router')
49
-      const id = this.$router.params.id || router.query.id || '2fe920719b8b0db50011441462e647ad'
50
-      this.setState({ id }, () => {
58
+      const id = this.$router.params.id || router.query.id
59
+      const initiateId = this.$router.params.initiateId || router.query.initiateId
60
+
61
+      this.setState({ id, initiateId }, () => {
51 62
         this.loadDetail()
52 63
       })
64
+
65
+      const { userInfo: { person: { phone, avatarurl } } } = this.props
66
+      if (!phone) {
67
+        // todo 授权电话
68
+      }
69
+
70
+      if (!avatarurl) {
71
+        // todo 授权头像
72
+      }
53 73
     })
54 74
   }
75
+
55 76
   componentWillUnmount() {
56 77
     const { recordId } = this.state
57 78
     recordId && updatePoint(recordId)
79
+
80
+    this.clearTicker()
81
+  }
82
+
83
+  clearTicker() {
84
+    if (this.state.ltTicker) {
85
+      clearInterval(this.state.ltTicker)
86
+      this.setState({ ltTicker: undefined })
87
+    }
88
+  }
89
+
90
+  updateLeftTime(startDate, endDate) {
91
+    const st = dayjs(startDate).valueOf()
92
+    const ed = dayjs(endDate).valueOf()
93
+
94
+    this.setState({
95
+      ltTicker: setInterval(() => {
96
+        const nw = dayjs().valueOf()
97
+
98
+        if (st > nw) {
99
+          // 活动未开始
100
+          this.setState({
101
+            leftTime: st - nw,
102
+            actState: BeforeStart,
103
+          })
104
+        } else if (ed > nw) {
105
+          // 活动未结束
106
+          this.setState({
107
+            leftTime: ed - nw,
108
+            actState: InProcess,
109
+          })
110
+        } else {
111
+          // 活动已结束
112
+          this.clearTicker()
113
+          this.setState({
114
+            leftTime: 0,
115
+            actState: Finished,
116
+          })
117
+        }
118
+      }, 1000)
119
+    })
120
+  }
121
+
122
+  formateLeftTime() {
123
+    const nd = 1000 * 24 * 60 * 60;
124
+    const nh = 1000 * 60 * 60;
125
+    const nm = 1000 * 60;
126
+    const ns = 1000;
127
+
128
+    const day = Math.floor(this.state.leftTime / nd);
129
+    const hour = Math.floor(this.state.leftTime % nd / nh);
130
+    const min = Math.floor(this.state.leftTime % nd % nh / nm);
131
+    const sec = Math.floor(this.state.leftTime % nd % nh % nm / ns);
132
+
133
+    return `${day}天${hour}小时${min}分${sec}秒`
58 134
   }
59 135
 
60 136
   loadDetail() {
61 137
     const { id } = this.state
62 138
     Taro.showLoading()
63
-    queryActivityDetail(id).then(res => {
139
+    getHelpDetail(id).then(res => {
140
+      this.clearTicker()
141
+
64 142
       Taro.hideLoading()
65 143
       const { isSaved, isSign } = res
144
+
145
+      // 活动状态分两种
146
+      // 一种是活动本身是否在进行中
147
+      // 一种是, 某个人发起的助力,是否在进行中
148
+      // 发起的助力活动状态, 1 代表进行中, 0 代表成功, 2 代表失败
149
+
66 150
       this.setState({
67
-        detail: res,
68
-        isSaved,
69
-        isSign,
70
-        loaded: true
151
+        detail: res.helpActivity,
152
+        initiateDetail: res.helpInitiateRecord || {},
153
+        shares: res.shareContentList || [],
154
+        posters: res.postList || [],
155
+        helpList: res.helpRecordList || [],
156
+        loaded: true,
71 157
       }, () => {
72
-        const { detail } = this.state
73
-        if (detail.posters[0].posterImg) {
74
-          this.setState({
75
-            posterShow: true
76
-          })
77
-        }
158
+        // const { detail } = this.state
159
+        // if (detail.posters[0].posterImg) {
160
+        //   this.setState({
161
+        //     posterShow: true
162
+        //   })
163
+        // }
164
+        this.updateLeftTime(res.helpActivity.startDate, res.helpActivity.endDate)
78 165
       })
79
-      WxParse.wxParse('article', 'html', res.desc, this.$scope, 0)
166
+      // WxParse.wxParse('article', 'html', res.desc, this.$scope, 0)
80 167
 
81 168
       savePoint({
82 169
         event: 'detail',
83
-        eventType: 'activity',
84
-        propertyName: '活动详情',
170
+        eventType: 'help',
171
+        propertyName: '助力详情',
85 172
         buildingId: res.buildingId,
86
-        targetId: res.dynamicId,
173
+        targetId: res.helpActivityId,
87 174
         data: '{}'
88 175
       }).then(res1 => {
89 176
         this.setState({
90 177
           recordId: res1.recordId
91 178
         })
92
-        console.log('活动详情')
93 179
       })
94 180
     })
95 181
   }
182
+
96 183
   onShareAppMessage = () => {
97
-    const { detail: { shareContents, title, dynamicId, url } } = this.state
184
+    const { detail } = this.state
98 185
     const { userInfo: { person: { personId } } } = this.props
99 186
 
100
-    addActivityShareNum(dynamicId)
187
+    // addActivityShareNum(detail.helpActivityId)
101 188
 
102 189
     savePoint({
103 190
       event: 'share',
104
-      eventType: 'activity',
105
-      propertyName: '活动详情分享',
191
+      eventType: 'help',
192
+      propertyName: '助力详情分享',
106 193
       data: '{}'
107 194
     }).then(res => {
108
-      console.log('活动详情分享')
195
+
109 196
     })
110 197
     return {
111 198
       title: shareContents[0].shareContentTitle,
112
-      path: `/pages/activity/detail/index?id=${dynamicId}&from=dynamic_share&recommender=${personId}`,//分享地址
113
-      imageUrl: shareContents[0].shareContentImg
199
+      path: `pages/activity/detail/assistance?id=${detail.helpActivityId}&from=help_share&recommender=${personId}`,//分享地址
200
+      // imageUrl: shareContents[0].shareContentImg
114 201
     }
115 202
   }
116 203
 
117
-  handleSignup() {
118
-    const { detail: { buildingId, dynamicId }, isSign } = this.state
119
-    const { userInfo: { person: { phone, name, nickname } } } = this.props
204
+  handleHelp() {
205
+    if (this.state.loaded) return
120 206
 
121
-    if (isSign) {
122
-      Taro.showToast({
123
-        icon: 'none',
124
-        title: '你已报名成功'
125
-      })
126
-      return
127
-    }
207
+    Taro.showLoading()
208
+    this.setState({ loaded: true }, () => {
209
+      Taro.hideLoading()
210
+      this.setState({ loaded: false })
128 211
 
129
-    this.setState({
130
-      canChoose: 'block'
212
+      // 助力好友
213
+      // todo
131 214
     })
132 215
   }
133 216
 
134 217
   handleFavor() {
135
-    const { detail: { dynamicId }, isSaved } = this.state
136
-    if (isSaved) {
137
-      cancelFavorActivity(dynamicId).then(res => {
138
-        Taro.showToast({
139
-          title: '已取消收藏'
140
-        })
141
-        this.setState({
142
-          isSaved: false
143
-        })
144
-      })
145
-    } else {
146
-      favorActivity(dynamicId).then(res => {
147
-        Taro.showToast({
148
-          title: '收藏成功'
149
-        })
150
-        this.setState({
151
-          isSaved: true
152
-        })
153
-      })
154
-    }
155
-    savePoint({
156
-      event: 'save',
157
-      eventType: 'activity',
158
-      propertyName: '活动详情收藏',
159
-      data: '{}'
160
-    }).then(res => {
161
-      console.log('活动详情收藏')
162
-    })
163 218
   }
164 219
 
165 220
   handleGetPhone(e) {
@@ -174,6 +229,7 @@ export default class Detail extends Component {
174 229
       }
175 230
     })
176 231
   }
232
+
177 233
   getPosterData = () => {
178 234
     return new Promise(resolve => {
179 235
       const { posterData } = this.state
@@ -190,7 +246,7 @@ export default class Detail extends Component {
190 246
         "page": 'pages/activity/detail/index',
191 247
       }
192 248
       debugger
193
-      const _avatarurl = avatarurl.replace('https://wx.qlogo.cn/', 'https://d.pawoma.cn/qlogo/');
249
+      const _avatarurl = getDownloadURL(avatarurl, 'avatar');
194 250
       getMiniQrcode(payload).then(qrcode => {
195 251
         let data = {
196 252
           qrcode,//小程序二维码
@@ -204,6 +260,7 @@ export default class Detail extends Component {
204 260
       })
205 261
     })
206 262
   }
263
+
207 264
   // 开始生成海报
208 265
   togglePosterStatus = (flag) => {
209 266
     if (flag) {
@@ -213,7 +270,7 @@ export default class Detail extends Component {
213 270
           posterData
214 271
         })
215 272
       })
216
-      // App.zhuge.track('生成活动详情海报')
273
+      // App.zhuge.track('生成助力详情海报')
217 274
     } else {
218 275
       this.setState({
219 276
         posterVisible: !!flag
@@ -221,11 +278,11 @@ export default class Detail extends Component {
221 278
     }
222 279
     savePoint({
223 280
       event: 'poster',
224
-      eventType: 'activity',
225
-      propertyName: '生成活动详情海报',
281
+      eventType: 'help',
282
+      propertyName: '生成助力详情海报',
226 283
       data: '{}'
227 284
     }).then(res => {
228
-      console.log('生成活动详情海报')
285
+      console.log('生成助力详情海报')
229 286
     })
230 287
   }
231 288
 
@@ -250,7 +307,6 @@ export default class Detail extends Component {
250 307
   }
251 308
 
252 309
   comfire = e => {
253
-
254 310
     const { detail: { buildingId, dynamicId }, isSign, selectorChecked, inputName } = this.state
255 311
     const { userInfo: { person: { phone, name, nickname, tel } } } = this.props
256 312
 
@@ -282,11 +338,11 @@ export default class Detail extends Component {
282 338
 
283 339
     savePoint({
284 340
       event: 'enlist',
285
-      eventType: 'activity',
286
-      propertyName: '活动详情报名',
341
+      eventType: 'help',
342
+      propertyName: '助力详情报名',
287 343
       data: '{}'
288 344
     }).then(res => {
289
-      console.log('活动详情报名 ')
345
+      console.log('助力详情报名 ')
290 346
     })
291 347
   }
292 348
 
@@ -297,8 +353,12 @@ export default class Detail extends Component {
297 353
   }
298 354
 
299 355
   render() {
300
-    const { detail, loaded, isSaved, isSign, posterVisible, posterData, posterShow } = this.state
301
-    const { userInfo: { person: { phone } } } = this.props
356
+    const { detail, loaded, actState, posterVisible, posterData, isStarter, helpList } = this.state
357
+    const { userInfo: { person: { phone, avatarurl } } } = this.props
358
+
359
+    const avatar = this.state.initiateId ? this.state.initiateDetail.avatarurl : avatarurl
360
+    const initiateInProcess = initiateDetail.status === 1;
361
+
302 362
     return (
303 363
       <Block>
304 364
         {/* 生成海报 */}
@@ -309,10 +369,10 @@ export default class Detail extends Component {
309 369
             <View>
310 370
               <Notice></Notice>
311 371
               <View className="detail-banner">
312
-                <Image mode="widthFix" src={detail.imgUrl} className="detail-banner__img"></Image>
372
+                <Image mode="widthFix" src={detail.img} className="detail-banner__img"></Image>
313 373
                 <View className="rest-time">
314
-                  <Text className="row-label">活动剩余时间:</Text>
315
-                  <Text className="row-content">{dayjs(detail.enlistEnd).format('YYYY-MM-DD hh:mm:ss')}</Text>
374
+                  <Text className="row-label">{actState === BeforeStart ? '距活动开始:' : (actState === InProcess ? '活动剩余时间:' : '活动已结束')} </Text>
375
+                  <Text className="row-content">{actState != Finished ? this.formateLeftTime() : ''}</Text>
316 376
                 </View>
317 377
               </View>
318 378
               <ScrollView
@@ -320,116 +380,61 @@ export default class Detail extends Component {
320 380
                 className="detail-wrap">
321 381
                 <View className="detail">
322 382
                   <View class="detail-title">{detail.title}</View>
323
-                  <Image src={require('@assets/agent/banner.png')} className="my__img"></Image>
324
-                  <View className="assistance-text">邀请N位好友即可赢取大奖</View>
325
-                  <View className="assistance-text">0/N</View>
383
+                  <Image src={avatar} className="my__img"></Image>
384
+                  <View className="assistance-text">邀请{detail.personNum}位好友即可赢取大奖</View>
385
+                  <View className="assistance-text">{`${detail.enlistNum || 0}/${detail.personNum}`}</View>
326 386
                   <View className='tools-main'>
327
-                    <View className='tools-item'>
328
-                      <Image src={require('@assets/agent/banner.png')} className='tools-item-img'></Image>
329
-                      <Text className='tools-item-txt'>等待助力</Text>
330
-                    </View>
331
-                    <View className='tools-item'>
332
-                      <Image src={require('@assets/agent/banner.png')} className='tools-item-img'></Image>
333
-                      <Text className='tools-item-txt'>等待助力</Text>
334
-                    </View>
335
-                    <View className='tools-item'>
336
-                      <Image src={require('@assets/agent/banner.png')} className='tools-item-img'></Image>
337
-                      <Text className='tools-item-txt'>等待助力</Text>
338
-                    </View>
339
-                    <View className='tools-item'>
340
-                      <Image src={require('@assets/agent/banner.png')} className='tools-item-img'></Image>
341
-                      <Text className='tools-item-txt'>等待助力</Text>
342
-                    </View>
343
-                    <View className='tools-item'>
344
-                      <Image src={require('@assets/agent/banner.png')} className='tools-item-img'></Image>
345
-                      <Text className='tools-item-txt'>等待助力</Text>
346
-                    </View>
347
-                    <View className='tools-item'>
348
-                      <Image src={require('@assets/agent/banner.png')} className='tools-item-img'></Image>
349
-                      <Text className='tools-item-txt'>等待助力</Text>
350
-                    </View>
351
-                    <View className='tools-item'>
352
-                      <Image src={require('@assets/agent/banner.png')} className='tools-item-img'></Image>
353
-                      <Text className='tools-item-txt'>等待助力</Text>
354
-                    </View>
355
-                    <View className='tools-item'>
356
-                      <Image src={require('@assets/agent/banner.png')} className='tools-item-img'></Image>
357
-                      <Text className='tools-item-txt'>等待助力</Text>
358
-                    </View>
359
-                    <View className='tools-item'>
360
-                      <Image src={require('@assets/agent/banner.png')} className='tools-item-img'></Image>
361
-                      <Text className='tools-item-txt'>等待助力</Text>
362
-                    </View>
363
-                    <View className='tools-item'>
364
-                      <Image src={require('@assets/agent/banner.png')} className='tools-item-img'></Image>
365
-                      <Text className='tools-item-txt'>等待助力</Text>
366
-                    </View>
387
+                    {
388
+                      times(helpList.length).map((it, inx) => {
389
+                        return (
390
+                          <View className='tools-item' key={`help-${inx}`}>
391
+                            <Image src={it.avatarurl} className='tools-item-img'></Image>
392
+                            <Text className='tools-item-txt'>{it.name}</Text>
393
+                          </View>
394
+                        )
395
+                      })
396
+                    }
397
+                    {
398
+                      times(detail.personNum - helpList.length).map((_, inx) => {
399
+                        return (
400
+                          <View className='tools-item' key={`un-${inx}`}>
401
+                            <Image src={defaultAvatar} className='tools-item-img'></Image>
402
+                            <Text className='tools-item-txt'>等待助力</Text>
403
+                          </View>
404
+                        )
405
+                      })
406
+                    }
367 407
                   </View>
368 408
                 </View>
369
-                <Button className={true ? "assistance-btn" : "nostart-btn"}>{true ? "邀请好友助力" : "未开始"}</Button>
409
+                <View>
410
+                  {
411
+                    actState === BeforeStart &&
412
+                    (<Button className="nostart-btn">未开始</Button>)
413
+                  }
414
+                  {
415
+                    actState === InProcess && !isStarter &&
416
+                    (
417
+                      <Block>
418
+                        ()
419
+                        <Button className="assistance-btn" onClick={this.handleHelp}>立即助力好友</Button>
420
+                        <Button className="assistance-btn">发起我的助力</Button>
421
+                      </Block>
422
+                    )
423
+                  }
424
+                  <Button disabled={actState != InProcess} className={true ? "assistance-btn" : "nostart-btn"}>{actState === BeforeStart ? '未开始:' : (actState === InProcess ? '邀请好友助力:' : '活动已结束')}</Button>
425
+                </View>
370 426
                 <View className="assistance-text">活动说明</View>
371
-                <Image src={require('@assets/agent/banner.png')}style="width:100%"></Image>
427
+                <Image src={detail.activityInstructions}style="width:100%"></Image>
372 428
               </ScrollView>
373
-
374 429
             
375 430
               <View className="chat-entrance" onClick={this.handleMoreClick}>
376 431
                 <Text className="iconfont icon-chat"></Text>
377 432
               </View>
378 433
               <BackHomeBtn></BackHomeBtn>
379
-
380
-              {/* <View className="bot-nav flex">
381
-                {
382
-                  posterShow && (
383
-                    <Button className='btn poster-btn' onClick={() => { this.togglePosterStatus(true) }}>
384
-                      <Image mode="widthFix" src={require('@assets/tupian_3@3x.png')} className="btn-icon"></Image>
385
-                      <Text className="txt">海报</Text>
386
-                    </Button>
387
-                  )
388
-                }
389
-                <Button className="btn share-btn" open-type="share">
390
-                  <Image mode="widthFix" src={require('@assets/fasong@3x.png')} className="btn-icon"></Image>
391
-                  <Text className="txt">分享</Text>
392
-                </Button>
393
-
394
-                <Button className="btn" onClick={this.handleFavor}>
395
-                  <Text className={`iconfont ${isSaved ? 'icon-shoucang selected' : 'icon-shoucang1'}`}></Text>
396
-                  <Text className="txt">收藏</Text>
397
-                </Button>
398
-                {
399
-                  detail.enlisted >= detail.enlistNum ? (<Button disabled='true' className='submit-btn hasSigned'>报名人数已满</Button>) : (phone ? (
400
-                    <Button disabled={isSign} className={`submit-btn ${isSign ? 'hasSigned' : ''}`} onClick={this.handleSignup}>{isSign ? '已报名' : '立即报名'}</Button>
401
-                  ) : (
402
-                      <Button disabled={isSign} className='submit-btn' open-type="getPhoneNumber" onGetphonenumber={this.handleGetPhone}>{isSign ? '已报名' : '立即报名'}</Button>
403
-                    ))
404
-                }
405
-                {/* {phone ? (
406
-                  <Button disabled={isSign} className={`submit-btn ${isSign ? 'hasSigned' : ''}`} onClick={this.handleSignup}>{isSign ? '已报名' : '立即报名'}</Button>
407
-                ) : (
408
-                    <Button disabled={isSign} className='submit-btn' open-type="getPhoneNumber" onGetphonenumber={this.handleGetPhone}>{isSign ? '已报名' : '立即报名'}</Button>
409
-                  )} 
410
-              </View> */}
411
-
412
-              {/* <View className='page-body' style={{ display: this.state.canChoose }}>
413
-                <View className="mask" onClick={this.hideModal}></View>
414
-                <View className='page-section'>
415
-                  <Text className="page-section__title">报名信息</Text>
416
-                  <View className='page-content'>
417
-                    <Input className='inputName' onInput={this.onInputText.bind(this)} type='text' placeholder='请输入姓名' />
418
-                    <Picker mode='selector' range={this.state.selector} onChange={this.onChange}>
419
-                      <View className='picker'>
420
-                        <Text>参加人数</Text>
421
-                        <Text className='content'>{this.state.selectorChecked}</Text>
422
-                        <Text>人</Text>
423
-                      </View>
424
-                    </Picker>
425
-                    <View onClick={this.comfire} className='comfire'>确认</View>
426
-                  </View>
427
-                </View>
428
-              </View> */}
429 434
             </View>
430 435
           )
431 436
         }
432 437
       </Block>
433 438
     )
434 439
   }
435
-}
440
+}

+ 2
- 1
src/pages/activity/detail/index.js Прегледај датотеку

@@ -7,6 +7,7 @@ import dayjs from 'dayjs'
7 7
 import WxParse from '@components/wxParse/wxParse'
8 8
 import getUserPhone from '@utils/getUserPhone'
9 9
 import ready from '@utils/ready'
10
+import { getDownloadURL } from '@utils/tools'
10 11
 import {
11 12
   addActivityShareNum,
12 13
   signupActivity,
@@ -190,7 +191,7 @@ export default class Detail extends Component {
190 191
         "page": 'pages/activity/detail/index',
191 192
       }
192 193
       debugger
193
-      const _avatarurl = avatarurl.replace('https://wx.qlogo.cn/', 'https://d.pawoma.cn/qlogo/');
194
+      const _avatarurl = getDownloadURL(avatarurl, 'avatar');
194 195
       getMiniQrcode(payload).then(qrcode => {
195 196
         let data = {
196 197
           qrcode,//小程序二维码

+ 19
- 18
src/pages/activity/index.js Прегледај датотеку

@@ -1,7 +1,7 @@
1 1
 import Taro, { Component } from '@tarojs/taro';
2 2
 import ListView from '@components/ListView'
3 3
 import './index.scss'
4
-import { queryActivityList } from '@services/activity'
4
+import { queryActivityList, getActNewList } from '@services/activity'
5 5
 import ActivityItem from './item'
6 6
 import { savePoint, updatePoint } from '@services/common'
7 7
 import { connect } from '@tarojs/redux'
@@ -44,7 +44,6 @@ export default class Index extends Component {
44 44
   loadList(pageNumber) {
45 45
     const { curCity: { id: cityId } } = this.props
46 46
     const payload = { pageSize: 10, pageNumber }
47
-    console.log(payload)
48 47
     
49 48
     const { params: { buildingId, from } } = this.$router
50 49
     if (cityId) {
@@ -58,26 +57,28 @@ export default class Index extends Component {
58 57
     if (buildingId) {
59 58
       payload.buildingId = buildingId
60 59
     }
61
-    return queryActivityList(payload)
60
+    // return queryActivityList(payload)
61
+    return getActNewList(payload)
62 62
   }
63 63
 
64 64
   handleItemClick(item) {
65
-    console.log(item,"data")
66
-    if(item.title==111){
67
-      Taro.navigateTo({
68
-        url: '/pages/activity/detail/assistance?id=' + item.dynamicId
69
-      })
70
-    }else if(item.title=='通融通融'){
71
-      Taro.navigateTo({
72
-        url: '/pages/activity/detail/assemble?id=' + item.dynamicId
73
-      })
74
-    }
75
-    else{
76
-      Taro.navigateTo({
77
-        url: '/pages/activity/detail/index?id=' + item.dynamicId
78
-      })
65
+    switch (item.type) {
66
+      case 'help':
67
+        Taro.navigateTo({
68
+          url: '/pages/activity/detail/assistance?id=' + item.id
69
+        })
70
+        return
71
+      case 'group':
72
+        Taro.navigateTo({
73
+          url: '/pages/activity/detail/assemble?id=' + item.id
74
+        })
75
+        return
76
+      default:
77
+        Taro.navigateTo({
78
+          url: '/pages/activity/detail/index?id=' + item.id
79
+        })
80
+        return
79 81
     }
80
-  
81 82
   }
82 83
 
83 84
   onPullDownRefresh = async (rest) => {

+ 1
- 1
src/pages/activity/item/index.js Прегледај датотеку

@@ -15,7 +15,7 @@ export default class Item extends Component {
15 15
     const { data, style } = this.props
16 16
     return (
17 17
       <View className="item" style={style} onClick={this.handleClick.bind(this, data)}>
18
-        <Image className="pic" mode="aspectFill" src={data.imgUrl}></Image>
18
+        <Image className="pic" mode="aspectFill" src={data.mainImg}></Image>
19 19
         <View className="box">
20 20
 
21 21
           <View className="title">{data.title}</View>

+ 1
- 1
src/pages/auth/index.js Прегледај датотеку

@@ -71,7 +71,7 @@ export default class Index extends Component {
71 71
           <View>申请获取以下权限</View>
72 72
           <Text>获得你的公开信息(昵称,头像等)</Text>
73 73
         </View>
74
-        <Button className='bottom' type='primary' open-type="getUserInfo" lang="zh_CN" onGetUserInfo={this.getUserInfo}>授权登录</Button>
74
+        <Button className='bottom' open-type="getUserInfo" lang="zh_CN" onGetUserInfo={this.getUserInfo}>授权登录</Button>
75 75
       </View>
76 76
     )
77 77
   }

+ 2
- 0
src/pages/auth/index.scss Прегледај датотеку

@@ -32,6 +32,8 @@
32 32
   border-radius: 80px;
33 33
   margin: 70px 225px;
34 34
   font-size: 30px;
35
+  color: white;
36
+  background-color: $primary-color;
35 37
 }
36 38
 
37 39
 .line {

+ 2
- 1
src/pages/news/detail/index.js Прегледај датотеку

@@ -7,6 +7,7 @@ import WxParse from '@components/wxParse/wxParse'
7 7
 import BackHomeBtn from '@components/BackHomeBtn'
8 8
 import Notice from '@components/Notice'
9 9
 import { getMiniQrcode, savePoint, updatePoint } from '@services/common'
10
+import { getDownloadURL } from '@utils/tools'
10 11
 import {
11 12
   addNewsUv,
12 13
   favorNews,
@@ -160,7 +161,7 @@ export default class NewsDetail extends Component {
160 161
         "scene": `id=${newsId}&from=news_share&recommender=${personId}`,
161 162
         "page": 'pages/news/detail/index',
162 163
       }
163
-      const _avatarurl = avatarurl.replace('https://wx.qlogo.cn/', 'https://d.pawoma.cn/qlogo/');
164
+      const _avatarurl = getDownloadURL(avatarurl, 'avatar');
164 165
       getMiniQrcode(payload).then(qrcode => {
165 166
         let data = {
166 167
           qrcode,//小程序二维码

+ 4
- 2
src/pages/person/authorize/index.scss Прегледај датотеку

@@ -1,3 +1,5 @@
1
+@import "@styles/theme.scss";
2
+
1 3
 .auth-page{
2 4
   position: relative;
3 5
   width: 100%;
@@ -24,13 +26,13 @@
24 26
     width: 80%;
25 27
     left: 10%;
26 28
     height:90px;
27
-    background: #FF4740;
28 29
     border-radius: 10px;
29 30
     top:40%;
30
-    color: #fff;
31 31
     font-size:32px;
32 32
     font-weight: 500;
33 33
     line-height: 90px;
34
+    color: white;
35
+    background-color: $primary-color;
34 36
   }
35 37
   .adver-btn{
36 38
     position: absolute;

+ 2
- 2
src/pages/project/detail/index.js Прегледај датотеку

@@ -19,7 +19,7 @@ import dayjs from 'dayjs'
19 19
 import 'dayjs/locale/zh-cn' // 按需加载
20 20
 import ready from '@utils/ready'
21 21
 import Notice from '@components/Notice'
22
-
22
+import { getDownloadURL } from '@utils/tools'
23 23
 import { connect } from '@tarojs/redux'
24 24
 import { dispatchProjectDetail } from '@actions/project'
25 25
 import getUserPhone from '@utils/getUserPhone'
@@ -277,7 +277,7 @@ export default class Index extends Component {
277 277
         "scene": `id=${buildingId}&from=building_share&recommender=${personId}`,
278 278
         "page": 'pages/project/detail/index',
279 279
       }
280
-      const _avatarurl = avatarurl.replace('https://wx.qlogo.cn/', 'https://d.pawoma.cn/qlogo/');
280
+      const _avatarurl = getDownloadURL(avatarurl, 'avatar');
281 281
 
282 282
       getMiniQrcode(payload).then(qrcode => {
283 283
         let data = {

+ 12
- 2
src/services/activity.js Прегледај датотеку

@@ -6,7 +6,9 @@ import {
6 6
   API_ACTIVITY_FAVOR,
7 7
   API_ACTIVITY_SAVE,
8 8
   API_ACTIVITY_UV,
9
-  API_ACTIVITY_SHARE
9
+  API_ACTIVITY_SHARE,
10
+  API_ACTNEW_LIST,
11
+  API_HELP_DETAIL,
10 12
 } from '@constants/api'
11 13
 
12 14
 /**
@@ -58,4 +60,12 @@ export const favorActivity = id => fetch({ url: `${API_ACTIVITY_FAVOR}/${id}`, m
58 60
  * 取消活动收藏
59 61
  * @param {*} payload 
60 62
  */
61
-export const cancelFavorActivity = id => fetch({ url: `${API_ACTIVITY_FAVOR}/${id}`, method:'DELETE' })
63
+export const cancelFavorActivity = id => fetch({ url: `${API_ACTIVITY_FAVOR}/${id}`, method:'DELETE' })
64
+
65
+/**
66
+ * 获取活动列表
67
+ * @param {*} payload 
68
+ */
69
+export const getActNewList = payload => fetch({ url: API_ACTNEW_LIST, payload })
70
+
71
+export const getHelpDetail = id => fetch({ url: `${API_HELP_DETAIL}/${id}`, method:'GET' })

+ 16
- 5
src/utils/tools.js Прегледај датотеку

@@ -1,5 +1,16 @@
1 1
 import Taro from '@tarojs/taro';
2 2
 
3
+export function getDownloadURL(url, type) {
4
+  switch (type) {
5
+    case 'avatar':
6
+      return url.replace('https://wx.qlogo.cn/', 'https://lt.pawoma.cn/qlogo/');
7
+    case 'alioss':
8
+      return url.replace('https://estateagents.oss-cn-shanghai.aliyuncs.com/', 'https://lt.pawoma.cn/alioss/');
9
+    default:
10
+      return url;
11
+  }
12
+}
13
+
3 14
 /**
4 15
  * @description 获取当前页url
5 16
  */
@@ -48,8 +59,8 @@ export const makeProjectPoster = (res) => {
48 59
 
49 60
     const { poster, qrcode, nickname, avatarurl, canvasName } = res
50 61
     const ctx = Taro.createCanvasContext(canvasName);
51
-    const _avatarurl = avatarurl.replace('https://wx.qlogo.cn/', 'https://d.pawoma.cn/qlogo/');
52
-    const _poster = poster.replace('https://estateagents.oss-cn-shanghai.aliyuncs.com/', 'https://d.pawoma.cn/alioss/');
62
+    const _avatarurl = getDownloadURL(avatarurl, 'avatar');
63
+    const _poster = getDownloadURL(poster, 'alioss');
53 64
 
54 65
     Promise.all([
55 66
       Taro.downloadFile({ url: _poster }),
@@ -159,8 +170,8 @@ export const makeCardPoster = (data) => {
159 170
   return new Promise(resolve => {
160 171
     const { bgImg, qrcodeImg, name, nickname, avatarurl, company, post, canvasName } = data
161 172
     const ctx = Taro.createCanvasContext(canvasName);
162
-    const _qrcodeImg = qrcodeImg.replace('https://estateagents.oss-cn-shanghai.aliyuncs.com/', 'https://d.pawoma.cn/alioss/');
163
-    const _avatarurl = avatarurl.replace('https://wx.qlogo.cn/', 'https://d.pawoma.cn/qlogo/');
173
+    const _qrcodeImg = getDownloadURL(qrcodeImg, 'alioss');
174
+    const _avatarurl = getDownloadURL(avatarurl, 'avatar');
164 175
 
165 176
     Promise.all([
166 177
       Taro.downloadFile({ url: _avatarurl }),
@@ -275,7 +286,7 @@ export const makeCardShareImg = (data) => {
275 286
 
276 287
     const { bgImg, post, name, phoneImg, phone, picture, addrImg, company, canvasName } = data
277 288
     const ctx = Taro.createCanvasContext(canvasName);
278
-    const _picture = picture.replace('https://estateagents.oss-cn-shanghai.aliyuncs.com/', 'https://d.pawoma.cn/alioss/');
289
+    const _picture = getDownloadURL(picture, 'alioss');
279 290
     Promise.all([
280 291
       Taro.downloadFile({ url: _picture })
281 292
     ]).then(list => {

+ 11032
- 0
yarn.lock
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку