浏览代码

静态页面

XuChengxiang 4 年前
父节点
当前提交
5987534125

+ 1
- 1
src/components/WuYeBaoXiu/index.jsx 查看文件

17
   const [IsEmpty, setIsEmpty] = useState(false)
17
   const [IsEmpty, setIsEmpty] = useState(false)
18
 
18
 
19
   Taro.useDidShow(() => {
19
   Taro.useDidShow(() => {
20
-    GetBanner()
21
   })
20
   })
22
 
21
 
23
   const GetBanner = (done = () => { }) => { // 获取轮播图
22
   const GetBanner = (done = () => { }) => { // 获取轮播图
30
   }
29
   }
31
 
30
 
32
   const Refresh = (e) => { // 下拉刷新
31
   const Refresh = (e) => { // 下拉刷新
32
+    GetBanner()
33
     if (e.length > 0) {
33
     if (e.length > 0) {
34
       setIsEmpty(false)
34
       setIsEmpty(false)
35
       setPageList(e)
35
       setPageList(e)

+ 1
- 1
src/components/WuYeBaoXiuItem/index.jsx 查看文件

22
       </view>
22
       </view>
23
       <view className='Name flex-h'>
23
       <view className='Name flex-h'>
24
         <text className='flex-item' onClick={ItemClick}>{Data.ticketTitle}</text>
24
         <text className='flex-item' onClick={ItemClick}>{Data.ticketTitle}</text>
25
-        <text className='iconfont iconbianji' onClick={() => { Taro.navigateTo({ url: `/pages/WuYe/XiuGaiBaoXiu/index?id=${Data.id}` }) }}></text>
25
+        <text className='iconfont iconbianji' style={{display: Data.status - 0 === 0 ? 'block' : 'none'}} onClick={() => { Taro.navigateTo({ url: `/pages/WuYe/XiuGaiBaoXiu/index?id=${Data.id}` }) }}></text>
26
       </view>
26
       </view>
27
       <view className='Detail flex-h' onClick={ItemClick}>
27
       <view className='Detail flex-h' onClick={ItemClick}>
28
         <view className='Line'><view></view></view>
28
         <view className='Line'><view></view></view>

+ 51
- 14
src/pages/HuoDong/HuoDongDetail/index.jsx 查看文件

1
 import React, { useState, useEffect } from 'react'
1
 import React, { useState, useEffect } from 'react'
2
 import Taro, { Current } from '@tarojs/taro'
2
 import Taro, { Current } from '@tarojs/taro'
3
-import { RichText } from '@tarojs/components'
3
+import { RichText, Input } from '@tarojs/components'
4
 import request, { apis } from '@/utils/request'
4
 import request, { apis } from '@/utils/request'
5
 import { useModel } from '@/store'
5
 import { useModel } from '@/store'
6
 import Page from '@/layouts'
6
 import Page from '@/layouts'
20
   const [CanJoin, setCanJoin] = useState(null)
20
   const [CanJoin, setCanJoin] = useState(null)
21
   const [JoinBtnText, setJoinBtnText] = useState(null)
21
   const [JoinBtnText, setJoinBtnText] = useState(null)
22
   const [JoinBtnStatus, setJoinBtnStatus] = useState(false)
22
   const [JoinBtnStatus, setJoinBtnStatus] = useState(false)
23
+  const [ShowJoinNumPopup, setShowJoinNumPopup] = useState(false)
24
+  const [JoinNum, setJoinNum] = useState(null)
23
   const [ShowGetUserPhoneLayer, setShowGetUserPhoneLayer] = useState(false)
25
   const [ShowGetUserPhoneLayer, setShowGetUserPhoneLayer] = useState(false)
24
   const [CurrnetHuoDongId] = useState(Current.router.params.id) // 当前活动id
26
   const [CurrnetHuoDongId] = useState(Current.router.params.id) // 当前活动id
25
   const [ActivityDetail, setActivityDetail] = useState(null) // 活动详情
27
   const [ActivityDetail, setActivityDetail] = useState(null) // 活动详情
88
     }
90
     }
89
   }
91
   }
90
 
92
 
91
-  const ToJoin = () => { // 去报名
92
-    if (DataLock || ActivityDetail === null || !JoinBtnStatus) return
93
-    setDataLock(true)
94
-    if (JoinBtnText === '去签到') {
95
-      Taro.navigateTo({ url: `/pages/HuoDong/HuoDongSign/index?id=${ActivityDetail.dynamicId}` })
93
+  const ConfirmToJoin = () => {
94
+    if (JoinNum === null || JoinNum - 0 < 1) {
95
+      Taro.showToast({ title: '请填入参加活动人数', icon: 'none' })
96
+      setDataLock(false)
96
     } else {
97
     } else {
97
-      const { personId, phone, nickname, orgId } = user
98
-      const { dynamicId } = ActivityDetail
99
-      if (!phone) { // 未授权手机号,唤起授权手机号弹窗
100
-        setShowGetUserPhoneLayer(true)
101
-        setDataLock(false)
102
-        return false
103
-      }
104
       let Data = {
98
       let Data = {
105
         phone,
99
         phone,
106
         personId,
100
         personId,
107
         dynamicId,
101
         dynamicId,
108
         name: nickname,
102
         name: nickname,
109
         orgId,
103
         orgId,
110
-        attendNum: 1,
104
+        attendNum: JoinNum - 0 || 1,
111
         sharePerson: null,
105
         sharePerson: null,
112
         sharePersonName: null,
106
         sharePersonName: null,
113
         sharePersonType: null
107
         sharePersonType: null
114
       }
108
       }
115
       request({ ...apis.JoinActivity, data: { ...Data } }).then(() => {
109
       request({ ...apis.JoinActivity, data: { ...Data } }).then(() => {
116
         setHasJoin(true)
110
         setHasJoin(true)
111
+        setShowJoinNumPopup(false)
117
         setDataLock(false)
112
         setDataLock(false)
118
       }).catch((res) => {
113
       }).catch((res) => {
119
         Taro.showToast({ title: res, icon: 'none' })
114
         Taro.showToast({ title: res, icon: 'none' })
122
     }
117
     }
123
   }
118
   }
124
 
119
 
120
+  const ToJoin = () => { // 去报名
121
+    if (DataLock || ActivityDetail === null || !JoinBtnStatus) return
122
+    setDataLock(true)
123
+    if (JoinBtnText === '去签到') {
124
+      Taro.navigateTo({ url: `/pages/HuoDong/HuoDongSign/index?id=${ActivityDetail.dynamicId}` })
125
+    } else {
126
+      const { personId, phone, nickname, orgId } = user
127
+      const { dynamicId } = ActivityDetail
128
+      if (!phone) { // 未授权手机号,唤起授权手机号弹窗
129
+        setShowGetUserPhoneLayer(true)
130
+        setDataLock(false)
131
+        return false
132
+      }
133
+      setShowJoinNumPopup(true)
134
+    }
135
+  }
136
+
137
+  const JoinNumChange = (e) => {
138
+    setJoinNum(e.detail.value)
139
+  }
140
+
125
   const showError = err => {
141
   const showError = err => {
126
     Taro.showModal({
142
     Taro.showModal({
127
       title: '错误',
143
       title: '错误',
175
 
191
 
176
           </view>
192
           </view>
177
         }
193
         }
194
+        <view className={ShowJoinNumPopup ? 'JoinNumLayer active' : 'JoinNumLayer'}>
195
+          <view className='centerLabel'>
196
+            <text>温馨提示</text>
197
+            <view className='flex-h Form'>
198
+              <view>
199
+                <text>参数人数:</text>
200
+              </view>
201
+              <view className='flex-item'>
202
+                <Input placeholder='请输入活动参加人数' onInput={JoinNumChange} value={JoinNum}></Input>
203
+              </view>
204
+            </view>
205
+            <view className='flex-h Bottom'>
206
+              <view className='flex-item'>
207
+                <text onClick={() => { setShowJoinNumPopup(false) }}>取消</text>
208
+              </view>
209
+              <view className='flex-item'>
210
+                <text onClick={ConfirmToJoin}>确定</text>
211
+              </view>
212
+            </view>
213
+          </view>
214
+        </view>
178
       </view>
215
       </view>
179
     </Page>
216
     </Page>
180
   )
217
   )

+ 70
- 0
src/pages/HuoDong/HuoDongDetail/index.less 查看文件

123
       }
123
       }
124
     }
124
     }
125
   }
125
   }
126
+  .JoinNumLayer {
127
+    width: 100%;
128
+    position: fixed;
129
+    z-index: 1000;
130
+    left: 0;
131
+    top: 0;
132
+    bottom: 0;
133
+    display: none;
134
+    background: rgba(0, 0, 0, 0.7);
135
+    &.active {
136
+      display: block;
137
+    }
138
+    >view {
139
+      width: 80%;
140
+      background: #fff;
141
+      border-radius: 12px;
142
+      overflow: hidden;
143
+      >text {
144
+        display: block;
145
+        font-size: 28px;
146
+        color: #333;
147
+        line-height: 40px;
148
+        margin-top: 20px;
149
+        text-align: center;
150
+      }
151
+      >.Form {
152
+        align-items: center;
153
+        margin-top: 20px;
154
+        padding: 30px;
155
+        >view {
156
+          &:first-child {
157
+            margin-right: 20px;
158
+            >text {
159
+              font-size: 26px;
160
+              color: #333;
161
+              line-height: 40px;
162
+              text-indent: 30px;
163
+              display: block;
164
+            }
165
+          }
166
+          &.flex-item {
167
+            >input {
168
+              font-size: 26px;
169
+              color: #333;
170
+              line-height: 40px;
171
+              height: 40px;
172
+            }
173
+          }
174
+        }
175
+      }
176
+      >.Bottom {
177
+        align-items: center;
178
+        border-top: 2px solid rgba(0, 0, 0, 0.08);
179
+        margin-top: 20px;
180
+        >view {
181
+          &:first-child {
182
+            border-right: 2px solid rgba(0, 0, 0, 0.08);
183
+          }
184
+          >text {
185
+            width: 100%;
186
+            display: block;
187
+            text-align: center;
188
+            font-size: 26px;
189
+            color: #666;
190
+            line-height: 80px;
191
+          }
192
+        }
193
+      }
194
+    }
195
+  }
126
 }
196
 }

+ 2
- 1
src/pages/WoDe/TuiJianErWeiMa/index.config.js 查看文件

1
 export default {
1
 export default {
2
   navigationStyle: 'custom',
2
   navigationStyle: 'custom',
3
-  navigationBarTextStyle: 'white'
3
+  navigationBarTextStyle: 'white',
4
+  enableShareAppMessage: true
4
 }
5
 }

+ 10
- 1
src/pages/WoDe/TuiJianErWeiMa/index.jsx 查看文件

3
 import CustomHeader from '@/components/CustomHeader/index'
3
 import CustomHeader from '@/components/CustomHeader/index'
4
 import { getQrCodeImage, getCardQrParam } from '@/utils/qrcode'
4
 import { getQrCodeImage, getCardQrParam } from '@/utils/qrcode'
5
 import Page from '@/layouts'
5
 import Page from '@/layouts'
6
+import { getShareObject } from '@/utils/share.js'
6
 import { useModel } from '@/store'
7
 import { useModel } from '@/store'
7
 import '@/assets/css/reset.less'
8
 import '@/assets/css/reset.less'
8
 import '@/assets/css/iconfont.less'
9
 import '@/assets/css/iconfont.less'
13
   const { user } = useModel('user')
14
   const { user } = useModel('user')
14
   const [QrCodeImg, setQrCodeImg] = useState(null)
15
   const [QrCodeImg, setQrCodeImg] = useState(null)
15
 
16
 
17
+  Taro.useShareAppMessage(() => {
18
+    return getShareObject({
19
+      title: '推荐二维码',
20
+      id: user.personId,
21
+      image: QrCodeImg
22
+    }, user)
23
+  })
24
+
16
   useEffect(() => {
25
   useEffect(() => {
17
     if (QrCodeImg === null) {
26
     if (QrCodeImg === null) {
18
       // const page = Taro.Current.router.path
27
       // const page = Taro.Current.router.path
26
       <view className='TuiJianErWeiMa'>
35
       <view className='TuiJianErWeiMa'>
27
         <CustomHeader IsFixed={true} BgColor='none' Title='推荐二维码'></CustomHeader>
36
         <CustomHeader IsFixed={true} BgColor='none' Title='推荐二维码'></CustomHeader>
28
         <image mode='widthFix' src='https://zhiyun-image.oss-cn-shanghai.aliyuncs.com/xiangsong/img2.jpg'></image>
37
         <image mode='widthFix' src='https://zhiyun-image.oss-cn-shanghai.aliyuncs.com/xiangsong/img2.jpg'></image>
29
-        <image mode='widthFix' className='QrCodeImg centerLabel' src={QrCodeImg}></image>
38
+        <image mode='widthFix' className='QrCodeImg' src={QrCodeImg}></image>
30
       </view>
39
       </view>
31
     </Page>
40
     </Page>
32
   )
41
   )

+ 5
- 0
src/pages/WoDe/TuiJianErWeiMa/index.less 查看文件

16
       z-index: 2;
16
       z-index: 2;
17
       width: 50%;
17
       width: 50%;
18
       height: auto;
18
       height: auto;
19
+      display: block;
20
+      left: 50%;
21
+      transform: translateX(-50%);
22
+      -webkit-transform: translateX(-50%);
23
+      bottom: 150px;
19
     }
24
     }
20
   }
25
   }
21
 }
26
 }

+ 27
- 0
src/pages/WuYe/BaoXiuDetail/index.jsx 查看文件

17
   const [DetailInfo, setDetailInfo] = useState(null)
17
   const [DetailInfo, setDetailInfo] = useState(null)
18
   const [PhoneList, setPhoneList] = useState([])
18
   const [PhoneList, setPhoneList] = useState([])
19
   const [ShowPopup, setShowPopup] = useState(false)
19
   const [ShowPopup, setShowPopup] = useState(false)
20
+  const [ShowPingJiaPopup, setShowPingJiaPopup] = useState(false)
21
+  const [StarIndex, setStarIndex] = useState(0)
20
 
22
 
21
   Taro.useShareAppMessage(() => {
23
   Taro.useShareAppMessage(() => {
22
     return getShareObject({
24
     return getShareObject({
39
     })
41
     })
40
   }
42
   }
41
 
43
 
44
+  const SelectStar = (index) => {
45
+    return () => {
46
+      setStarIndex(index)
47
+    }
48
+  }
49
+
42
   return (
50
   return (
43
     <Page>
51
     <Page>
44
       <view className='BaoXiuDetail'>
52
       <view className='BaoXiuDetail'>
101
             }
109
             }
102
           </view>
110
           </view>
103
 
111
 
112
+          {/* 更多操作 */}
113
+          <view className='BottomBtn active'>
114
+            <text onClick={() => { setShowPingJiaPopup(true) }}>评价</text>
115
+          </view>
116
+
104
           {/* 更多操作 */}
117
           {/* 更多操作 */}
105
           <view className='BottomBtn'>
118
           <view className='BottomBtn'>
106
             <text onClick={() => { setShowPopup(true) }}>与物业沟通</text>
119
             <text onClick={() => { setShowPopup(true) }}>与物业沟通</text>
107
           </view>
120
           </view>
108
         </view>
121
         </view>
109
 
122
 
123
+        <SlidePopup Close={() => { setShowPingJiaPopup(false) }} Show={ShowPingJiaPopup}>
124
+          <view className='PinJiaPopup'>
125
+            <text className='Title'>请对此次服务进行评分</text>
126
+            <view className='StarLine'>
127
+              {
128
+                ['', '', '', '', ''].map((item, index) => (
129
+                  <text className={index > StarIndex ? 'iconfont iconxingxing' : 'iconfont iconxingxing active'} key={`Star-${index}`} onClick={SelectStar(index)}></text>
130
+                ))
131
+              }
132
+            </view>
133
+            <text className='Btn'>提交</text>
134
+          </view>
135
+        </SlidePopup>
136
+
110
         <SlidePopup Close={() => { setShowPopup(false) }} Show={ShowPopup}>
137
         <SlidePopup Close={() => { setShowPopup(false) }} Show={ShowPopup}>
111
           <view className='LianXiPopup'>
138
           <view className='LianXiPopup'>
112
             <text>联系物业</text>
139
             <text>联系物业</text>

+ 40
- 0
src/pages/WuYe/BaoXiuDetail/index.less 查看文件

249
       }
249
       }
250
     }
250
     }
251
   }
251
   }
252
+  .PinJiaPopup {
253
+    padding: 0 30px;
254
+    position: relative;
255
+    overflow: hidden;
256
+    >.Title {
257
+      display: block;
258
+      font-size: 26px;
259
+      color: #666;
260
+      line-height: 40px;
261
+    }
262
+    >.StarLine {
263
+      font-size: 0;
264
+      white-space: nowrap;
265
+      text-align: center;
266
+      margin-top: 20px;
267
+      text {
268
+        display: inline-block;
269
+        vertical-align: middle;
270
+        font-size: 40px;
271
+        color: #666;
272
+        margin-left: 20px;
273
+        &:first-child {
274
+          margin-left: 0;
275
+        }
276
+        &.active {
277
+          color: #fcdc1e;
278
+        }
279
+      }
280
+    }
281
+    >.Btn {
282
+      font-size: 28px;
283
+      line-height: 80px;
284
+      display: block;
285
+      text-align: center;
286
+      background: #F35844;
287
+      color: #fff;
288
+      margin-top: 60px;
289
+      border-radius: 80px;
290
+    }
291
+  }
252
 }
292
 }

+ 10
- 1
src/pages/WuYe/ShengHuoGuanJia/components/Card.jsx 查看文件

32
           <LR title='管家姓名'>{data.userName || ''}</LR>
32
           <LR title='管家姓名'>{data.userName || ''}</LR>
33
           <LR title='联系方式'>{data.phone || ''}</LR>
33
           <LR title='联系方式'>{data.phone || ''}</LR>
34
           <LR title='管家说明'>{data.description || ''}</LR>
34
           <LR title='管家说明'>{data.description || ''}</LR>
35
-          <LR title='综合评价'><Stars value={4} editable /></LR>
35
+          <LR title='综合评价'>
36
+            {
37
+              data.averageScore !== null &&
38
+              <Stars value={data.averageScore - 0} editable />
39
+            }
40
+            {
41
+              data.averageScore === null &&
42
+              <text>暂无评分</text>
43
+            }
44
+          </LR>
36
         </view>
45
         </view>
37
       </view>
46
       </view>
38
       <view className='gj-card-footer'>
47
       <view className='gj-card-footer'>

+ 1
- 1
src/pages/WuYe/ShengHuoGuanJia/components/Star.jsx 查看文件

12
     }
12
     }
13
   }
13
   }
14
 
14
 
15
-  return <text className={clsName} style={props.style} onClick={handleClick}>&#9733;</text>
15
+  return <text className='iconfont iconxingxing' style='display: inline-block; vertical-align: middle; font-size: 36rpx; color: #fcdc1e;' onClick={handleClick}></text>
16
 }
16
 }

+ 2
- 0
src/pages/WuYe/ShengHuoGuanJia/components/style.less 查看文件

90
 .gj-star {
90
 .gj-star {
91
   color: #333;
91
   color: #333;
92
   display: inline-block;
92
   display: inline-block;
93
+  font-size: 0;
94
+  white-space: nowrap;
93
 
95
 
94
   &.gj-star-active {
96
   &.gj-star-active {
95
     color: #F35844;
97
     color: #F35844;