Browse Source

helpgrouplist

许静 5 years ago
parent
commit
b7c1e85a23

BIN
dist.rar View File


+ 70
- 219
src/components/Poster/index.js View File

@@ -1,161 +1,44 @@
1 1
 import Taro, { Component } from '@tarojs/taro';
2
+import { ScrollView, View } from '@tarojs/components';
2 3
 import { TaroCanvasDrawer } from '@components/taro-plugin-canvas';
3
-import dayjs from 'dayjs'
4
-import './index.scss'
5
-import {getCanvasConfig} from './util'
6
-/**
7
- * 文档参考
8
- * http://taro-ext.jd.com/plugin/view/5d23051670a0f46a87c9785b
9
- */
10
-export default class Index extends Component {
11
-  static options = {
12
-    addGlobalClass: true
13
-  }
14
-  static defaultProps = {
15
-    data: {}
16
-  }
4
+import {} from './util';
5
+import './style.scss';
6
+
7
+export default class Poster extends Component {
17 8
   state = {
18
-    // 绘制的图片
19
-    shareImage: null,
20
-    canvasStatus: false,
21
-    config: null,
22
-    visible: false,
23
-    basicConfig: {
24
-      width: 640,
25
-      height: 1136,
26
-      backgroundColor: '#ffffff',
27
-      debug: false
28
-    }
9
+    images: [],
10
+    current: undefined,
29 11
   }
30
-  componentWillMount() {
31
-    // this.initConfig()
32
-    getCanvasConfig()
33
-    Taro.showLoading({
34
-      title: '生成中...',
35
-      icon: 'none'
12
+
13
+  onScroll = (e) => {
14
+    console.log('---onScroll-->', e)
15
+  }
16
+  
17
+  onPreview = (e) => {
18
+    e.stopPropagation()
19
+    e.preventDefault()
20
+    Taro.previewImage({
21
+      current: this.state.current,
22
+      urls: this.state.images
36 23
     })
37 24
   }
38
-  initConfig() {
39
-    const { data } = this.props
40
-    const { basicConfig } = this.state
41
-    const texts = [
42
-      {
43
-        x: 30,
44
-        y: 820,
45
-        text: data.buildingName,
46
-        fontSize: 36,
47
-        color: 'black',
48
-        baseLine: 'middle',
49
-        lineNum: 2,
50
-        lineHeight: 48,
51
-        // textAlign: 'center',
52
-        width: 560,
53
-        zIndex: 999
54
-      }, {
55
-        x: 30,
56
-        y: 890,
57
-        text: data.price,
58
-        fontSize: 36,
59
-        color: 'red',
60
-        baseLine: 'middle',
61
-        lineNum: 2,
62
-        lineHeight: 48,
63
-        // textAlign: 'center',
64
-        width: 560,
65
-        zIndex: 999
66
-      },
67
-      {
68
-        x: 30,
69
-        y: 1010,
70
-        text: '长按识别小程序码',
71
-        fontSize: 26,
72
-        color: '#999',
73
-        baseLine: 'middle',
74
-        lineHeight: 48,
75
-        width: 200,
76
-        zIndex: 11
77
-      },
78
-      {
79
-        x: 30,
80
-        y: 1065,
81
-        text: '进入',
82
-        fontSize: 26,
83
-        color: '#999',
84
-        baseLine: 'middle',
85
-        lineHeight: 48,
86
-        width: 50,
87
-        zIndex: 11
88
-      },
89
-      {
90
-        x: 100,
91
-        y: 1065,
92
-        text: '橙蕉',
93
-        fontSize: 28,
94
-        color: 'black',
95
-        baseLine: 'middle',
96
-        lineHeight: 48,
97
-        width: 120,
98
-        zIndex: 11
99
-      },
100
-      {
101
-        x: 240,
102
-        y: 1065,
103
-        text: '报名活动',
104
-        fontSize: 26,
105
-        color: '#999',
106
-        baseLine: 'middle',
107
-        lineHeight: 48,
108
-        width: 150,
109
-        zIndex: 11
110
-      },
111
-    ]
112
-    const images = [
113
-      {
114
-        url: data.poster,
115
-        width: 640,
116
-        height: 670,
117
-        y: 0,
118
-        x: 0
119
-      },
120
-      {
121
-        url: data.qrcode,
122
-        width: 160,
123
-        height: 160,
124
-        y: 950,
125
-        x: 450,
126
-        zIndex: 999
127
-      },
128
-      {
129
-        url: data.avatarurl || require('@assets/default-avatar.png'),
130
-        width: 130,
131
-        height: 130,
132
-        y: 630,
133
-        x: 20,
134
-        borderRadius: 130,
135
-        zIndex: 999
136
-      }
137
-    ]
138 25
 
139
-    const blocks = [
140
-      {
141
-        x: 0,
142
-        y: 936,
143
-        width: 640,
144
-        height: 200,
145
-        backgroundColor: 'rgba(248,248,248,1)',
146
-        zIndex: 1
147
-      }
148
-    ]
149
-    const config = Object.assign(basicConfig, { images, blocks, texts })
150
-    this.setState({
151
-      config,
152
-      canvasStatus: true
153
-    })
26
+  onCancel = () => {
27
+    if (typeof this.props.onCancel === 'function') {
28
+      this.props.onCancel()
29
+    }
30
+  }
31
+
32
+  saveToAlbum = () => {
33
+
154 34
   }
155 35
 
156
-  onCreateSuccess = (result) => {
36
+  onCreateSuccess = (inx) => (result) => {
37
+    if (inx + 1 === this.props.tpls.length) {
38
+      Taro.hideLoading();
39
+    }
40
+
157 41
     const { tempFilePath, errMsg } = result;
158
-    Taro.hideLoading();
159 42
     if (errMsg === 'canvasToTempFilePath:ok') {
160 43
       this.setState({
161 44
         shareImage: tempFilePath,
@@ -164,88 +47,56 @@ export default class Index extends Component {
164 47
         visible: true
165 48
       });
166 49
     } else {
167
-      this.setState({
168
-        canvasStatus: false,
169
-        config: null
170
-      });
171
-      Taro.showToast({ icon: 'none', title: errMsg || '出现错误' });
172 50
       console.log(errMsg);
173
-      this.hidePoster()
174 51
     }
175
-  }
176
-
177
-  onPreview(e) {
178
-    e.stopPropagation()
179
-    e.preventDefault()
180
-    Taro.previewImage({
181
-      current: this.state.shareImage,
182
-      urls: [this.state.shareImage]
183
-    })
184
-  }
185
-
186
-  onCreateFail = (error) => {
187
-    console.log(error);
188
-  }
189 52
 
190
-  hidePoster(e) {
191
-    Taro.hideLoading();
192
-    this.props.toggle(false)
193 53
   }
194 54
 
195
-  // 保存图片至本地
196
-  saveToAlbum = (e) => {
197
-    e.stopPropagation()
198
-    e.preventDefault()
55
+  onCreateFail = (inx) => (err) => {
56
+    if (inx + 1 === this.props.tpls.length) {
57
+      Taro.hideLoading();
58
+    }
199 59
 
200
-    Taro.authorize({ scope: "scope.writePhotosAlbum" }).then(res => {
201
-      console.log('auth:', res)
202
-      Taro.saveImageToPhotosAlbum({
203
-        filePath: this.state.shareImage,
204
-      }).then(res => {
205
-        Taro.showToast({
206
-          title: '保存图片成功',
207
-          icon: 'success',
208
-          duration: 2000,
209
-        });
210
-      })
211
-    }).catch(err => {
212
-      console.log('err:', err)
213
-      Taro.showToast({
214
-        title: '未开启相册权限',
215
-        icon: 'none'
216
-      })
217
-    })
60
+    console.err(err);
218 61
   }
219 62
 
220 63
   render() {
64
+    const {
65
+      images,
66
+      configs
67
+    } = this.state
68
+
221 69
     return (
222
-      <Block>
223
-        {
224
-          this.state.canvasStatus && (
225
-            <TaroCanvasDrawer
226
-              config={this.state.config}
227
-              onCreateSuccess={this.onCreateSuccess}
228
-              onCreateFail={this.onCreateFail}
229
-            />
230
-          )
231
-        }
70
+      <View className="poster">
71
+        <View className="con">
72
+          <View className="con-head">
73
+            <Text>保存后分享图片</Text>
74
+            <Text className="iconfont icon-buoumaotubiao20" onClick={this.onCancel}></Text>
75
+          </View>
76
+          <View className="con-body">
77
+            {
78
+              images.map((img, inx) => {
79
+                <ScrollView scrollX scrollWithAnimation onScroll={this.onScroll} style="width: 100%" key={`img-${inx}`}>
80
+                  <Image className="result-img" mode="aspectFit" lazy-load src={img} onClick={this.onPreview}></Image>
81
+                </ScrollView>
82
+              })
83
+            }
84
+          </View>
85
+          <Button className="save-btn" onClick={this.saveToAlbum}>保存海报</Button>
86
+        </View>
232 87
         {
233
-          this.state.visible && (
234
-            <View className="poster">
235
-              <View className="con">
236
-                <View className="con-head">
237
-                  <Text>保存后分享图片</Text>
238
-                  <Text className="iconfont icon-buoumaotubiao20" onClick={this.hidePoster}></Text>
239
-                </View>
240
-                <View className="con-body">
241
-                  <Image className="result-img" mode="aspectFit" lazy-load src={this.state.shareImage} onClick={this.onPreview}></Image>
242
-                </View>
243
-                <Button className="save-btn" onClick={this.saveToAlbum}>保存海报</Button>
244
-              </View>
245
-            </View>
88
+          configs && configs.length &&
89
+          (
90
+            configs.map((conf, inx) => {
91
+              <TaroCanvasDrawer
92
+                config={conf}
93
+                onCreateSuccess={this.onCreateSuccess(inx)}
94
+                onCreateFail={this.onCreateFail(inx)}
95
+              />
96
+            })
246 97
           )
247 98
         }
248
-      </Block>
249
-    )
99
+      </View>
100
+    );
250 101
   }
251
-}
102
+}

+ 62
- 0
src/components/Poster/style.scss View File

@@ -0,0 +1,62 @@
1
+.poster {
2
+  position: fixed;
3
+  width: 100vw;
4
+  height: 100vh;
5
+  background: rgba(0, 0, 0, 0.6);
6
+  z-index: 999;
7
+  justify-content: space-around;
8
+  display: flex;
9
+  align-items: center;
10
+  flex-direction: column;
11
+  animation: fadeBottomIn 1s ease both;
12
+
13
+  .con {
14
+    position: absolute;
15
+    bottom: 0;
16
+    width: 100%;
17
+    padding: 0 60px;
18
+    background: white;
19
+    margin: 0 auto;
20
+    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
21
+    border-top-left-radius: 20px;
22
+    border-top-right-radius: 20px;
23
+
24
+    &-head {
25
+      display: flex;
26
+      justify-content: space-between;
27
+      align-items: center;
28
+      padding: 20px 0;
29
+      font-size: 32px;
30
+      font-weight: bold;
31
+
32
+      .iconfont {
33
+        font-size: 40px;
34
+        color: #545454;
35
+        font-weight: normal;
36
+      }
37
+    }
38
+
39
+    &-body {
40
+      width: 100%;
41
+      // background: #EAEAEA;
42
+      border-radius: 10px;
43
+      padding: 40px 0;
44
+
45
+      .result-img {
46
+        height: 60vh;
47
+        display: block;
48
+        margin: 0 auto;
49
+      }
50
+    }
51
+  }
52
+
53
+  .save-btn {
54
+    margin: 0 auto;
55
+    color: white;
56
+    border: none;
57
+    font-size: 36px;
58
+    background: linear-gradient(90deg, rgba(255, 199, 12, 1) 0%, rgba(255, 65, 65, 1) 100%);
59
+    border-radius: 12px;
60
+    margin: 20px 0;
61
+  }
62
+}

+ 24
- 24
src/components/achievePhone/index.js View File

@@ -2,23 +2,22 @@ import Taro, { Component } from '@tarojs/taro'
2 2
 import getUserPhone from '@utils/getUserPhone'
3 3
 import './index.scss'
4 4
 
5
+const grantIcon = require('@assets/helpgroup/shouquan.png')
6
+const logoImg = require('@assets/index/logo.png')
7
+const bgImg = require('@assets/helpgroup/bg.png')
8
+
5 9
 export default class Index extends Component {
6 10
 
7
-  state = {
8
-    // maskVisible: false,
9
-  }
11
+  state = {}
10 12
 
11 13
   componentDidMount() {
12
-    // this.setState({
13
-    //   maskVisible: true
14
-    // })
15
-    if (this.props.user.phone) {
14
+    const { user = {}} = this.props
15
+    if (user.phone && typeof this.props.onSuccess === 'function') {
16 16
       this.props.onSuccess();
17 17
     }
18 18
 
19 19
   }
20 20
   getPhoneNumber(e) {
21
-    console.log(e, "eeeeeeeeeeeee")
22 21
     getUserPhone(e, (phoneNumber) => {
23 22
       if (!phoneNumber) {
24 23
         Taro.showToast({
@@ -26,53 +25,53 @@ export default class Index extends Component {
26 25
           icon: 'none'
27 26
         })
28 27
         return
29
-      } else {
30
-        this.props.onSuccess();
31
-
28
+      } else {        
29
+        if (typeof this.props.onSuccess === 'function') {
30
+          this.props.onSuccess();
31
+        }
32 32
       }
33 33
     })
34 34
   }
35
+
35 36
   renderMaskBanner() {
36
-    const { maskBanner } = this.state
37 37
     return (
38 38
       <View>
39
-        <Image src={require('@assets/helpgroup/bg.png')} className='bg_img'></Image>
39
+        <Image src={bgImg} className='bg_img'></Image>
40 40
         <View className="phone-page">
41
-
42 41
           <View className="content">
43
-            <Image src={require('@assets/index/logo.png')} className='logo_img'></Image>
42
+            <Image src={logoImg} className='logo_img'></Image>
44 43
             <View className="text">
45 44
               授权手机后,可享受以下功能
46 45
           </View>
47 46
             <View className="flex">
48 47
               <View className="item">
49
-                <Image className="shouquan" src={require('@assets/helpgroup/shouquan.png')} ></Image>在线咨询
48
+                <Image className="shouquan" src={grantIcon} ></Image>在线咨询
50 49
             </View>
51 50
               <View className="item">
52
-                <Image className="shouquan" src={require('@assets/helpgroup/shouquan.png')} ></Image>收藏分享楼盘
51
+                <Image className="shouquan" src={grantIcon} ></Image>收藏分享楼盘
53 52
             </View>
54 53
             </View>
55 54
             <View className="flex">
56 55
               <View className="item">
57
-                <Image className="shouquan" src={require('@assets/helpgroup/shouquan.png')} ></Image>专属顾问
56
+                <Image className="shouquan" src={grantIcon} ></Image>专属顾问
58 57
             </View>
59 58
               <View className="item">
60
-                <Image className="shouquan" src={require('@assets/helpgroup/shouquan.png')} ></Image>参与助力活动            </View>
59
+                <Image className="shouquan" src={grantIcon} ></Image>参与助力活动            </View>
61 60
             </View>
62 61
             <View className="flex">
63 62
               <View className="item">
64
-                <Image className="shouquan" src={require('@assets/helpgroup/shouquan.png')} ></Image>推荐客户
63
+                <Image className="shouquan" src={grantIcon} ></Image>推荐客户
65 64
             </View>
66 65
               <View className="item">
67
-                <Image className="shouquan" src={require('@assets/helpgroup/shouquan.png')} ></Image>参与拼团活动
66
+                <Image className="shouquan" src={grantIcon} ></Image>参与拼团活动
68 67
             </View>
69 68
             </View>
70 69
             <View className="flex">
71 70
               <View className="item">
72
-                <Image className="shouquan" src={require('@assets/helpgroup/shouquan.png')} ></Image>获取积分好礼
71
+                <Image className="shouquan" src={grantIcon} ></Image>获取积分好礼
73 72
             </View>
74 73
               <View className="item">
75
-                <Image className="shouquan" src={require('@assets/helpgroup/shouquan.png')} ></Image>更多精彩权益
74
+                <Image className="shouquan" src={grantIcon} ></Image>更多精彩权益
76 75
             </View>
77 76
             </View>
78 77
             <Button className="btn" open-type="getPhoneNumber" lang="zh_CN" onGetphonenumber={this.getPhoneNumber}>授权手机</Button>
@@ -82,10 +81,11 @@ export default class Index extends Component {
82 81
     )
83 82
   }
84 83
   render() {
84
+    const { user = {}} = this.props
85 85
 
86 86
     return (
87 87
       <Block>
88
-        {!this.props.user.phone && this.renderMaskBanner()}
88
+        {!user.phone && this.renderMaskBanner()}
89 89
       </Block>
90 90
     )
91 91
   }

+ 59
- 41
src/pages/activity/detail/assistance.js View File

@@ -2,6 +2,7 @@ import Taro, { Component } from '@tarojs/taro';
2 2
 import './index.scss'
3 3
 import Notice from '@components/Notice'
4 4
 import BackHomeBtn from '@components/BackHomeBtn'
5
+import AchievePhone from '@components/achievePhone'
5 6
 import Poster from './poster'
6 7
 import dayjs from 'dayjs'
7 8
 // import WxParse from '@components/wxParse/wxParse'
@@ -71,13 +72,10 @@ export default class Detail extends Component {
71 72
   }
72 73
 
73 74
   componentWillUnmount() {
74
-    // const { recordId } = this.state
75
-    // recordId && updatePoint(recordId)
76
-
77 75
     this.clearTicker()
78 76
   }
79 77
 
80
-  initPageData() {
78
+  initPageData = () => {
81 79
     if (!this.state.detail.helpActivityId) {
82 80
       const router = Taro.getStorageSync('router')
83 81
       const id = this.$router.params.id || router.query.id
@@ -97,7 +95,7 @@ export default class Detail extends Component {
97 95
   }
98 96
 
99 97
   // 调起授权电话
100
-  toggleGrantPhone() {
98
+  toggleGrantPhone = () => {
101 99
     const { userInfo: { person: { phone } } } = this.props
102 100
     if (!phone) {
103 101
       this.setState({ grantPhoneVisible: true })
@@ -108,7 +106,7 @@ export default class Detail extends Component {
108 106
   }
109 107
 
110 108
   // 调起授权头像
111
-  toggleGrantAvatar() {
109
+  toggleGrantAvatar = () => {
112 110
     const { userInfo: { person: { avatarurl } } } = this.props
113 111
     if (!avatarurl) {
114 112
       this.setState({ grantAvatarVisible: true })
@@ -118,15 +116,16 @@ export default class Detail extends Component {
118 116
     return true
119 117
   }
120 118
 
121
-  toggleActionVisible() {
119
+  toggleActionVisible = () => {
122 120
     this.setState({
123 121
       actionSheetVisible: !this.state.actionSheetVisible
124 122
     })
125 123
   }
126 124
 
127
-  togglePosterVisible() {
125
+  togglePosterVisible = () => {
128 126
     this.setState({
129
-      posterVisible: !this.state.posterVisible
127
+      posterVisible: !this.state.posterVisible,
128
+      actionSheetVisible: false
130 129
     })
131 130
   }
132 131
 
@@ -162,7 +161,7 @@ export default class Detail extends Component {
162 161
     })
163 162
   }
164 163
 
165
-  formateLeftTime() {
164
+  formateLeftTime = () => {
166 165
     const nd = 1000 * 24 * 60 * 60;
167 166
     const nh = 1000 * 60 * 60;
168 167
     const nm = 1000 * 60;
@@ -177,11 +176,11 @@ export default class Detail extends Component {
177 176
   }
178 177
 
179 178
   loadDetail() {
180
-    const { id } = this.state
179
+    const { id, initiateId } = this.state
181 180
     const { userInfo } = this.props
182 181
 
183 182
     Taro.showLoading()
184
-    getHelpDetail(id).then(res => {
183
+    getHelpDetail(id, initiateId).then(res => {
185 184
       this.clearTicker()
186 185
 
187 186
       const initiateDetail = res.helpInitiateRecord || {}
@@ -195,7 +194,7 @@ export default class Detail extends Component {
195 194
         posters: res.postList || [],
196 195
         helpList: res.helpRecordList || [],
197 196
         loaded: true,
198
-        isStarter: !initiateDetail.person_id || userInfo.person.personId === initiateDetail.personId,
197
+        isStarter: !initiateDetail.personId || userInfo.person.personId === initiateDetail.personId,
199 198
       })
200 199
       
201 200
       this.updateLeftTime(res.helpActivity.startDate, res.helpActivity.endDate)
@@ -226,13 +225,17 @@ export default class Detail extends Component {
226 225
       `recommender=${personId}`
227 226
     ]
228 227
     if (initiateDetail.helpRecordInitiateId) {
229
-      queryParams.push(`initiateId=${helpRecordInitiateId}`)
228
+      queryParams.push(`initiateId=${initiateDetail.helpRecordInitiateId}`)
230 229
     }
231 230
 
232
-    return [
231
+    const res = [
233 232
       'pages/activity/detail/assistance',
234 233
       queryParams.join('&'),
235 234
     ]
235
+
236
+    console.log('--page-params->', res)
237
+
238
+    return res
236 239
   }
237 240
 
238 241
   onShareAppMessage = () => {
@@ -259,7 +262,7 @@ export default class Detail extends Component {
259 262
   }
260 263
 
261 264
   // 助力好友
262
-  handleHelp() {
265
+  handleHelp = () => {
263 266
     if (this.state.submitting) return
264 267
 
265 268
     Taro.showLoading()
@@ -275,23 +278,32 @@ export default class Detail extends Component {
275 278
         phone: person.tel || person.phone,
276 279
         avatarurl: person.avatarurl,
277 280
         helpRecordInitiateId: initiateDetail.helpRecordInitiateId,
278
-      }).then(() => {
281
+      }).then((res) => {
279 282
         Taro.hideLoading()
280
-        this.setState({ submitting: false })
283
+        const helpList = this.state.helpList || []
284
+        helpList.push(res.helpRecord)
285
+
286
+        this.setState({
287
+          submitting: false,
288
+          helpList,
289
+          initiateDetail: res.helpInitiateRecord,
290
+          helpState: res.helpInitiateRecord.status === undefined ? HelpInProcess : res.helpInitiateRecord.status,
291
+        })
292
+
293
+        Taro.showToast({
294
+          title: '助力成功',
295
+          icon: 'success'
296
+        })
281 297
       }).catch(err => {
282 298
         console.log('err:', err)
283 299
         Taro.hideLoading()
284 300
         this.setState({ submitting: false })
285
-        Taro.showToast({
286
-          title: '助力失败',
287
-          icon: 'none'
288
-        })
289 301
       })
290 302
     })
291 303
   }
292 304
 
293 305
   // 发起我的助力
294
-  startMine() {
306
+  startMine = () => {
295 307
     // 必须授权头像
296 308
     if (this.toggleGrantAvatar()) {
297 309
       const detail = this.state.detail
@@ -306,7 +318,12 @@ export default class Detail extends Component {
306 318
           phone: person.tel || person.phone,
307 319
           avatarurl: person.avatarurl,
308 320
         }).then(res => {
309
-          this.setState({ initiateDetail: res }, resolve)
321
+          this.setState({
322
+            initiateDetail: res,
323
+            helpList: [],
324
+            isStarter: true,
325
+            helpState: HelpInProcess,
326
+          }, resolve)
310 327
         }).catch(err => {
311 328
           console.log('err:', err)
312 329
           Taro.showToast({
@@ -322,7 +339,7 @@ export default class Detail extends Component {
322 339
   }
323 340
 
324 341
   // 请求好友助力
325
-  askForHelp() {
342
+  askForHelp = () => {
326 343
     // 必须授权头像
327 344
     if (this.toggleGrantAvatar()) {
328 345
       const initiateDetail = this.state.initiateDetail
@@ -402,6 +419,8 @@ export default class Detail extends Component {
402 419
 
403 420
   render() {
404 421
     const {
422
+      initiateId,
423
+      initiateDetail,
405 424
       detail,
406 425
       loaded,
407 426
       actState,
@@ -411,17 +430,21 @@ export default class Detail extends Component {
411 430
       helpList,
412 431
       helpState,
413 432
       actionSheetVisible,
414
-      grantAvatarVisible,
415 433
       grantPhoneVisible,
416 434
     } = this.state
417 435
 
418 436
     const { userInfo } = this.props
419
-    const avatar = this.state.initiateId ? this.state.initiateDetail.avatarurl : userInfo.person.avatarurl
437
+    const avatar = initiateId ? initiateDetail.avatarurl : userInfo.person.avatarurl
420 438
 
421 439
     return (
422 440
       <Block>
423 441
         {/* 生成海报 */}
424 442
         {posterVisible && (<Poster data={posterData} toggle={this.togglePosterStatus}></Poster>)}
443
+        
444
+        {
445
+          grantPhoneVisible &&
446
+          <AchievePhone user={this.props.userInfo.person} onSuccess={this.initPageData}></AchievePhone>
447
+        }
425 448
 
426 449
         {
427 450
           loaded && (
@@ -447,7 +470,12 @@ export default class Detail extends Component {
447 470
                   {
448 471
                     helpState === HelpSuccess &&
449 472
                     (
450
-                      <Text>TODO: 助力成功</Text>
473
+                      <Block>
474
+                        <Text>TODO: 助力成功</Text>
475
+                        {
476
+                          isStarter && (<Text>核销码 {initiateDetail.verification}</Text>)
477
+                        }                        
478
+                      </Block>
451 479
                     )
452 480
                   }
453 481
                   {
@@ -461,7 +489,7 @@ export default class Detail extends Component {
461 489
                   <View className="assistance-text">{`${detail.enlistNum || 0}/${detail.personNum}`}</View>
462 490
                   <View className='tools-main'>
463 491
                     {
464
-                      times(helpList.length).map((it, inx) => {
492
+                      helpList.map((it, inx) => {
465 493
                         return (
466 494
                           <View className='tools-item' key={`help-${inx}`}>
467 495
                             <Image src={it.avatarurl} className='tools-item-img'></Image>
@@ -508,24 +536,14 @@ export default class Detail extends Component {
508 536
                 <Image src={detail.activityInstructions}style="width:100%"></Image>
509 537
               </ScrollView>
510 538
 
511
-              {
512
-                grantPhoneVisible &&
513
-                <View onSuccess={this.initPageData}>TODO: 授权电话</View>
514
-              }
515
-
516
-              {
517
-                grantAvatarVisible &&
518
-                <View onSuccess={() => {}}>TODO: 授权头像</View>
519
-              }
520
-
521 539
               <action-sheet hidden={!actionSheetVisible} bindchange={this.toggleActionVisible}>
522 540
                 <action-sheet-item open-type="share">
523
-                  <Button open-type="share" className='share__friend'>分享给好友</Button>
541
+                  <Button open-type="share" className='share__friend' onClick={this.toggleActionVisible}>分享给好友</Button>
524 542
                 </action-sheet-item>
525 543
                 <action-sheet-item>
526 544
                   <Button className='creat__img' onClick={this.togglePosterVisible}>发送朋友圈</Button>
527 545
                 </action-sheet-item>
528
-                <action-sheet-cancel>取消</action-sheet-cancel>
546
+                <action-sheet-cancel onClick={this.toggleActionVisible}>取消</action-sheet-cancel>
529 547
               </action-sheet>
530 548
             
531 549
               <BackHomeBtn></BackHomeBtn>              

+ 1
- 1
src/pages/activity/item/index.js View File

@@ -30,7 +30,7 @@ export default class Item extends Component {
30 30
 
31 31
           <View className="left">
32 32
             <View className="time">参与截止时间:{`${dayjs(data.endDate).format('YYYY年MM月DD日 hh:mm:ss')}`}</View>
33
-            <View className={data.activityStatus == 0 ? "btn jionin " : data.activityStatus == 1 ? "btn nostart" : data.activityStatus == 2 ? "btn jioned" : "btn"}>{data.activityStatus == 0 ? "立即参与" : data.activityStatus == 1 ? "未开始" : data.activityStatus == 2 ? "已参与" : "已结束"}</View>
33
+            <View className={data.activityStatus == 0 ? "btn jionin " : data.activityStatus == 1 ? "btn nostart" : data.activityStatus == 2 ? "btn jioned" : "btn"}>{data.activityStatus == 0 ? "立即参与" : data.activityStatus == 1 ? "未开始" : data.activityStatus == 2 ? "已结束" : "已参与"}</View>
34 34
           </View>
35 35
         </View>
36 36
       </View >

+ 1
- 1
src/services/activity.js View File

@@ -82,6 +82,6 @@ export const cancelFavorActivity = id => fetch({ url: `${API_ACTIVITY_FAVOR}/${i
82 82
  */
83 83
 export const getActNewList = payload => fetch({ url: API_ACTNEW_LIST, payload })
84 84
 
85
-export const getHelpDetail = id => fetch({ url: `${API_HELP_DETAIL}/${id}`, method:'GET' })
85
+export const getHelpDetail = (id, initiateId) => fetch({ url: `${API_HELP_DETAIL}/${id}${ initiateId ? '?initiateId=' + initiateId : ''}`, method:'GET' })
86 86
 export const createHelpActivity = payload => fetch({ url: API_HELP_CREATE, method:'POST', payload })
87 87
 export const giveFriendHelp = payload => fetch({ url: API_HELP_FRIEND, method:'POST', payload })