XuChengxiang 4 lat temu
rodzic
commit
5987534125

+ 1
- 1
src/components/WuYeBaoXiu/index.jsx Wyświetl plik

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

+ 1
- 1
src/components/WuYeBaoXiuItem/index.jsx Wyświetl plik

@@ -22,7 +22,7 @@ export default function WuYeBaoXiuItem (props) {
22 22
       </view>
23 23
       <view className='Name flex-h'>
24 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 26
       </view>
27 27
       <view className='Detail flex-h' onClick={ItemClick}>
28 28
         <view className='Line'><view></view></view>

+ 51
- 14
src/pages/HuoDong/HuoDongDetail/index.jsx Wyświetl plik

@@ -1,6 +1,6 @@
1 1
 import React, { useState, useEffect } from 'react'
2 2
 import Taro, { Current } from '@tarojs/taro'
3
-import { RichText } from '@tarojs/components'
3
+import { RichText, Input } from '@tarojs/components'
4 4
 import request, { apis } from '@/utils/request'
5 5
 import { useModel } from '@/store'
6 6
 import Page from '@/layouts'
@@ -20,6 +20,8 @@ export default function HuoDongDetail () {
20 20
   const [CanJoin, setCanJoin] = useState(null)
21 21
   const [JoinBtnText, setJoinBtnText] = useState(null)
22 22
   const [JoinBtnStatus, setJoinBtnStatus] = useState(false)
23
+  const [ShowJoinNumPopup, setShowJoinNumPopup] = useState(false)
24
+  const [JoinNum, setJoinNum] = useState(null)
23 25
   const [ShowGetUserPhoneLayer, setShowGetUserPhoneLayer] = useState(false)
24 26
   const [CurrnetHuoDongId] = useState(Current.router.params.id) // 当前活动id
25 27
   const [ActivityDetail, setActivityDetail] = useState(null) // 活动详情
@@ -88,32 +90,25 @@ export default function HuoDongDetail () {
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 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 98
       let Data = {
105 99
         phone,
106 100
         personId,
107 101
         dynamicId,
108 102
         name: nickname,
109 103
         orgId,
110
-        attendNum: 1,
104
+        attendNum: JoinNum - 0 || 1,
111 105
         sharePerson: null,
112 106
         sharePersonName: null,
113 107
         sharePersonType: null
114 108
       }
115 109
       request({ ...apis.JoinActivity, data: { ...Data } }).then(() => {
116 110
         setHasJoin(true)
111
+        setShowJoinNumPopup(false)
117 112
         setDataLock(false)
118 113
       }).catch((res) => {
119 114
         Taro.showToast({ title: res, icon: 'none' })
@@ -122,6 +117,27 @@ export default function HuoDongDetail () {
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 141
   const showError = err => {
126 142
     Taro.showModal({
127 143
       title: '错误',
@@ -175,6 +191,27 @@ export default function HuoDongDetail () {
175 191
 
176 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 215
       </view>
179 216
     </Page>
180 217
   )

+ 70
- 0
src/pages/HuoDong/HuoDongDetail/index.less Wyświetl plik

@@ -123,4 +123,74 @@
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 Wyświetl plik

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

+ 10
- 1
src/pages/WoDe/TuiJianErWeiMa/index.jsx Wyświetl plik

@@ -3,6 +3,7 @@ import Taro from '@tarojs/taro'
3 3
 import CustomHeader from '@/components/CustomHeader/index'
4 4
 import { getQrCodeImage, getCardQrParam } from '@/utils/qrcode'
5 5
 import Page from '@/layouts'
6
+import { getShareObject } from '@/utils/share.js'
6 7
 import { useModel } from '@/store'
7 8
 import '@/assets/css/reset.less'
8 9
 import '@/assets/css/iconfont.less'
@@ -13,6 +14,14 @@ export default function TuiJianErWeiMa () {
13 14
   const { user } = useModel('user')
14 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 25
   useEffect(() => {
17 26
     if (QrCodeImg === null) {
18 27
       // const page = Taro.Current.router.path
@@ -26,7 +35,7 @@ export default function TuiJianErWeiMa () {
26 35
       <view className='TuiJianErWeiMa'>
27 36
         <CustomHeader IsFixed={true} BgColor='none' Title='推荐二维码'></CustomHeader>
28 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 39
       </view>
31 40
     </Page>
32 41
   )

+ 5
- 0
src/pages/WoDe/TuiJianErWeiMa/index.less Wyświetl plik

@@ -16,6 +16,11 @@
16 16
       z-index: 2;
17 17
       width: 50%;
18 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 Wyświetl plik

@@ -17,6 +17,8 @@ export default function BaoXiuDetail () {
17 17
   const [DetailInfo, setDetailInfo] = useState(null)
18 18
   const [PhoneList, setPhoneList] = useState([])
19 19
   const [ShowPopup, setShowPopup] = useState(false)
20
+  const [ShowPingJiaPopup, setShowPingJiaPopup] = useState(false)
21
+  const [StarIndex, setStarIndex] = useState(0)
20 22
 
21 23
   Taro.useShareAppMessage(() => {
22 24
     return getShareObject({
@@ -39,6 +41,12 @@ export default function BaoXiuDetail () {
39 41
     })
40 42
   }
41 43
 
44
+  const SelectStar = (index) => {
45
+    return () => {
46
+      setStarIndex(index)
47
+    }
48
+  }
49
+
42 50
   return (
43 51
     <Page>
44 52
       <view className='BaoXiuDetail'>
@@ -101,12 +109,31 @@ export default function BaoXiuDetail () {
101 109
             }
102 110
           </view>
103 111
 
112
+          {/* 更多操作 */}
113
+          <view className='BottomBtn active'>
114
+            <text onClick={() => { setShowPingJiaPopup(true) }}>评价</text>
115
+          </view>
116
+
104 117
           {/* 更多操作 */}
105 118
           <view className='BottomBtn'>
106 119
             <text onClick={() => { setShowPopup(true) }}>与物业沟通</text>
107 120
           </view>
108 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 137
         <SlidePopup Close={() => { setShowPopup(false) }} Show={ShowPopup}>
111 138
           <view className='LianXiPopup'>
112 139
             <text>联系物业</text>

+ 40
- 0
src/pages/WuYe/BaoXiuDetail/index.less Wyświetl plik

@@ -249,4 +249,44 @@
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 Wyświetl plik

@@ -32,7 +32,16 @@ export default props => {
32 32
           <LR title='管家姓名'>{data.userName || ''}</LR>
33 33
           <LR title='联系方式'>{data.phone || ''}</LR>
34 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 45
         </view>
37 46
       </view>
38 47
       <view className='gj-card-footer'>

+ 1
- 1
src/pages/WuYe/ShengHuoGuanJia/components/Star.jsx Wyświetl plik

@@ -12,5 +12,5 @@ export default props => {
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 Wyświetl plik

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