瀏覽代碼

静态页面

1002884655 4 年之前
父節點
當前提交
866f7dc159

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

@@ -34,9 +34,13 @@ export default function RenZhengScreen (props) {
34 34
           <text className='Tips'>{user.verifyStatus === 'not_certified' ? '请进行业主信息认证' : user.verifyStatus === 'certification_in_progress' ? '业主认证中,请等待物业审核' : user.verifyStatus === 'certified' ? '业主认证通过' : '业主验证未通过,请重新验证'}</text>
35 35
         }
36 36
         <view>
37
-          {
37
+          {/* {
38 38
             user !== null && user.verifyStatus !== 'certification_in_progress' && user.verifyStatus !== 'certified' &&
39 39
             <text onClick={() => { Taro.navigateTo({ url: `/pages/WoDe/YeZhuRenZheng/index?from=popup` }) }} className='active'>去认证</text>
40
+          } */}
41
+          {
42
+            user !== null &&
43
+            <text onClick={() => { Taro.navigateTo({ url: `/pages/WoDe/YeZhuRenZheng/index?from=popup` }) }} className='active'>去认证</text>
40 44
           }
41 45
           {/* <text onClick={RefreshUserInfo} className={DataLock ? '' : 'active'}>{DataLock ? '正在刷新...' : '刷新人员信息'}</text> */}
42 46
         </view>

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

@@ -143,7 +143,7 @@ export default function HuoDongDetail () {
143 143
   const ToJoin = () => { // 去报名
144 144
     if (DataLock || ActivityDetail === null || (Status - 0 !== 2 && Status - 0 !== 4)) return
145 145
     if (Status - 0 === 4) { // 去签到
146
-      Taro.navigateTo({ url: `/pages/HuoDong/HuoDongSign/index?id=${ActivityDetail.dynamicId}` })
146
+      Taro.navigateTo({ url: `/pages/HuoDong/HuoDongSign/index?id=${ActivityDetail.dynamicId}&from=detail` })
147 147
     } else { // 去报名
148 148
       const { phone } = user
149 149
       if (!phone) { // 未授权手机号,唤起授权手机号弹窗

+ 11
- 2
src/pages/HuoDong/HuoDongSign/index.jsx 查看文件

@@ -14,15 +14,16 @@ export default function HuoDongDetail () {
14 14
   const [HasSign, setHasSign] = useState(false)
15 15
   const [ShowSign, setShowSign] = useState(false)
16 16
   const [CurrnetId, setCurrentId] = useState(useRouter().params.id) // 当前活动id
17
+  const [CurrnetFrom] = useState(useRouter().params.from || null) // 当前活动跳转来源
17 18
   const [CurrnetSceneId] = useState(useRouter().params.scene) // 当前活动id
18 19
   const [ActivityDetail, setActivityDetail] = useState(null) // 活动详情
19 20
   const [JoinInfo, setJoinInfo] = useState(null) // 参加活动详情
20 21
 
21 22
   useEffect(() => {
22
-    if (user && user.verifyStatus === 'certified') {
23
+    if (user && user.verifyStatus === 'certified' && CurrnetFrom !== 'detail') {
23 24
       setShowSign(true)
24 25
     }
25
-  }, [user])
26
+  }, [user, CurrnetFrom])
26 27
 
27 28
   useEffect(() => {
28 29
     if (CurrnetId !== null && CurrnetId !== undefined) {
@@ -95,6 +96,14 @@ export default function HuoDongDetail () {
95 96
             }
96 97
           </view>
97 98
         </view>
99
+        {
100
+          CurrnetFrom === 'detail' &&
101
+          <view className='AlertPopup'>
102
+            <view className='centerLabel'>
103
+              <text>请扫码签到</text>
104
+            </view>
105
+          </view>
106
+        }
98 107
       </view>
99 108
     </Page>
100 109
   )

+ 28
- 0
src/pages/HuoDong/HuoDongSign/index.less 查看文件

@@ -9,6 +9,33 @@
9 9
     z-index: 1;
10 10
   }
11 11
 
12
+  >.AlertPopup {
13
+    width: 100%;
14
+    position: fixed;
15
+    left: 0;
16
+    top: 0;
17
+    bottom: 0;
18
+    background: rgba(0, 0, 0, 0.6);
19
+    overflow: hidden;
20
+    z-index: 100;
21
+
22
+    >view {
23
+      width: 50%;
24
+      padding: 20px 0;
25
+      background: #fff;
26
+      border-radius: 10px;
27
+      overflow: hidden;
28
+
29
+      >text {
30
+        display: block;
31
+        font-size: 26px;
32
+        line-height: 40px;
33
+        text-align: center;
34
+        white-space: nowrap;
35
+      }
36
+    }
37
+  }
38
+
12 39
   >.SignBtn {
13 40
     width: 188px;
14 41
     height: 188px;
@@ -61,6 +88,7 @@
61 88
 
62 89
       >view {
63 90
         background: rgba(243, 88, 68, 1);
91
+
64 92
         >text {
65 93
           color: #fff;
66 94
         }

+ 157
- 7
src/pages/WoDe/GeRenXinXi/index.jsx 查看文件

@@ -1,13 +1,89 @@
1
-import React, { useState } from 'react'
1
+import React, { useState, useEffect } from 'react'
2
+import Taro from '@tarojs/taro'
2 3
 import Page from '@/layouts'
3 4
 import { useModel } from '@/store'
5
+import { Input, Picker } from '@tarojs/components'
6
+import request, { apis } from '@/utils/request'
4 7
 import '@/assets/css/reset.less'
5 8
 import '@/assets/css/iconfont.less'
6 9
 import './index.less'
7 10
 
8 11
 export default function GeRenXinXi (props) {
9 12
 
10
-  const { user } = useModel('user')
13
+  const { user, setUser } = useModel('user')
14
+  const [Name, setName] = useState(null)
15
+  const [Phone, setPhone] = useState(null)
16
+  const [Birthday, setBirthday] = useState(null)
17
+  const [ShowNameEdit, setShowNameEdit] = useState(false)
18
+  const [ShowPhoneEdit, setShowPhoneEdit] = useState(false)
19
+  const [ShowBirthdayEdit, setShowBirthdayEdit] = useState(false)
20
+  const [Sex, setSex] = useState(null)
21
+  const [SexList] = useState([{ id: 1, name: '男' }, { id: 2, name: '女' }])
22
+
23
+  useEffect(() => {
24
+    if (user !== null) {
25
+      setName(user.name || user.nickname)
26
+      setPhone(user.tel || user.phone)
27
+      setBirthday(user.birthday)
28
+      SexList.map((item, index) => {
29
+        if (user.sex - 0 === item.id - 0 ||user.gender - 0 === item.id - 0) {
30
+          setSex(index)
31
+        }
32
+      })
33
+    }
34
+  }, [user])
35
+
36
+  const NameChange = (e) => {
37
+    setName(e.detail.value)
38
+  }
39
+
40
+  const PhoneChange = (e) => {
41
+    setPhone(e.detail.value)
42
+  }
43
+
44
+  const BirthdayChange = (e) => {
45
+    setBirthday(e.detail.value)
46
+  }
47
+
48
+  const SexChange = (e) => {
49
+    request({ ...apis.EditUserInfo, data: { sex: SexList[e.detail.value - 0].id - 0 } }).then(() => {
50
+      Taro.showToast({ title: '修改成功', icon: 'none' })
51
+      setSex(e.detail.value - 0)
52
+      setUser({ ...user, sex: SexList[e.detail.value - 0].id - 0 })
53
+    }).catch((res) => {
54
+      Taro.showToast({ title: res, icon: 'none' })
55
+    })
56
+  }
57
+
58
+  const EditName = () => {
59
+    request({ ...apis.EditUserInfo, data: { name: Name } }).then(() => {
60
+      setShowNameEdit(false)
61
+      Taro.showToast({ title: '修改成功', icon: 'none' })
62
+      setUser({ ...user, name: Name })
63
+    }).catch((res) => {
64
+      Taro.showToast({ title: res, icon: 'none' })
65
+    })
66
+  }
67
+
68
+  const EditPhone = () => {
69
+    request({ ...apis.EditUserInfo, data: { phone: Phone } }).then(() => {
70
+      setShowPhoneEdit(false)
71
+      Taro.showToast({ title: '修改成功', icon: 'none' })
72
+      setUser({ ...user, tel: Phone })
73
+    }).catch((res) => {
74
+      Taro.showToast({ title: res, icon: 'none' })
75
+    })
76
+  }
77
+
78
+  const EditBirthday = () => {
79
+    request({ ...apis.EditUserInfo, data: { birthday: Birthday } }).then(() => {
80
+      setShowBirthdayEdit(false)
81
+      Taro.showToast({ title: '修改成功', icon: 'none' })
82
+      setUser({ ...user, birthday: Birthday })
83
+    }).catch((res) => {
84
+      Taro.showToast({ title: res, icon: 'none' })
85
+    })
86
+  }
11 87
 
12 88
   return (
13 89
     <Page>
@@ -19,19 +95,93 @@ export default function GeRenXinXi (props) {
19 95
               <image mode='aspectFill' src={user !== null ? user.avatarurl : null}></image>
20 96
             </view>
21 97
           </view>
22
-          <view className='flex-h'>
98
+          <view className='flex-h' onClick={() => { setShowNameEdit(true) }}>
23 99
             <text className='flex-item'>姓名</text>
24
-            <text>{user !== null ? user.nickname : null}</text>
100
+            <text>{Name}</text>
25 101
           </view>
26 102
           <view className='flex-h'>
27 103
             <text className='flex-item'>性别</text>
28
-            <text>{user !== null ? user.gender - 0 === 1 ? '男' : user.sex - 0 === 2 ? '女' : null : null}</text>
104
+            {/* <text>{user !== null ? user.gender - 0 === 1 ? '男' : user.gender - 0 === 2 ? '女' : null : null}</text> */}
105
+            <Picker value={Sex} range-key='name' range={SexList} onChange={SexChange}>
106
+              <view className='PickerText'>{Sex === null ? '请选择性别' : SexList[Sex].id - 0 === 1 ? '男' : '女'}</view>
107
+            </Picker>
29 108
           </view>
30
-          <view className='flex-h'>
109
+          <view className='flex-h' onClick={() => { setShowPhoneEdit(true) }}>
31 110
             <text className='flex-item'>联系电话</text>
32
-            <text>{user !== null ? user.phone : null}</text>
111
+            <text>{Phone}</text>
112
+          </view>
113
+          <view className='flex-h' onClick={() => { setShowBirthdayEdit(true) }}>
114
+            <text className='flex-item'>生日</text>
115
+            <text>{Birthday}</text>
33 116
           </view>
34 117
         </view>
118
+
119
+        {
120
+          ShowNameEdit &&
121
+          <view className='Popup'>
122
+            <view className='centerLabel'>
123
+              <view className='Title'>
124
+                <text>修改姓名</text>
125
+              </view>
126
+              <view className='Content'>
127
+                <Input value={Name} onInput={NameChange}></Input>
128
+              </view>
129
+              <view className='Bottom flex-h'>
130
+                <view className='flex-item'>
131
+                  <text onClick={() => { setShowNameEdit(false); setName(user.nickname) }}>取消</text>
132
+                </view>
133
+                <view className='flex-item'>
134
+                  <text onClick={EditName}>确定</text>
135
+                </view>
136
+              </view>
137
+            </view>
138
+          </view>
139
+        }
140
+
141
+        {
142
+          ShowPhoneEdit &&
143
+          <view className='Popup'>
144
+            <view className='centerLabel'>
145
+              <view className='Title'>
146
+                <text>修改手机号</text>
147
+              </view>
148
+              <view className='Content'>
149
+                <Input type='tel' value={Phone} onInput={PhoneChange}></Input>
150
+              </view>
151
+              <view className='Bottom flex-h'>
152
+                <view className='flex-item'>
153
+                  <text onClick={() => { setShowPhoneEdit(false); setPhone(user.phone) }}>取消</text>
154
+                </view>
155
+                <view className='flex-item'>
156
+                  <text onClick={EditPhone}>确定</text>
157
+                </view>
158
+              </view>
159
+            </view>
160
+          </view>
161
+        }
162
+
163
+        {
164
+          ShowBirthdayEdit &&
165
+          <view className='Popup'>
166
+            <view className='centerLabel'>
167
+              <view className='Title'>
168
+                <text>修改生日</text>
169
+              </view>
170
+              <view className='Content'>
171
+                <Input placeholder='例如:2012-02-02' value={Birthday} onInput={BirthdayChange}></Input>
172
+              </view>
173
+              <view className='Bottom flex-h'>
174
+                <view className='flex-item'>
175
+                  <text onClick={() => { setShowBirthdayEdit(false); setBirthday(user.birthday) }}>取消</text>
176
+                </view>
177
+                <view className='flex-item'>
178
+                  <text onClick={EditBirthday}>确定</text>
179
+                </view>
180
+              </view>
181
+            </view>
182
+          </view>
183
+        }
184
+
35 185
         {/* <view className='Form'>
36 186
           <view className='flex-h'>
37 187
             <text className='flex-item'>身份</text>

+ 74
- 0
src/pages/WoDe/GeRenXinXi/index.less 查看文件

@@ -5,6 +5,71 @@
5 5
   background: #f8f8f8;
6 6
   overflow: hidden;
7 7
 
8
+  >.Popup {
9
+    width: 100%;
10
+    position: fixed;
11
+    left: 0;
12
+    top: 0;
13
+    bottom: 0;
14
+    z-index: 100;
15
+    background: rgba(0, 0, 0, 0.6);
16
+
17
+    >view {
18
+      width: 600px;
19
+      background: #fff;
20
+      border-radius: 12px;
21
+
22
+      >.Title {
23
+        >text {
24
+          display: block;
25
+          font-size: 28px;
26
+          line-height: 40px;
27
+          margin-top: 20px;
28
+          text-align: center;
29
+        }
30
+      }
31
+
32
+      >.Content {
33
+        padding: 0 40px;
34
+        position: relative;
35
+        overflow: hidden;
36
+        margin-top: 40px;
37
+
38
+        >input {
39
+          display: block;
40
+          width: 100%;
41
+          text-align: center;
42
+          font-size: 26px;
43
+          line-height: 80px;
44
+          height: 80px;
45
+          border: 2px solid #ccc;
46
+          border-radius: 6px;
47
+          box-sizing: border-box;
48
+        }
49
+      }
50
+
51
+      >.Bottom {
52
+        border-top: 2px solid #eee;
53
+        margin-top: 40px;
54
+
55
+        >view {
56
+          border-left: 2px solid #eee;
57
+
58
+          &:first-child {
59
+            border-left: none;
60
+          }
61
+
62
+          >text {
63
+            display: block;
64
+            text-align: center;
65
+            font-size: 26px;
66
+            line-height: 80px;
67
+          }
68
+        }
69
+      }
70
+    }
71
+  }
72
+
8 73
   >.Form {
9 74
     padding: 0 30px;
10 75
     position: relative;
@@ -15,10 +80,19 @@
15 80
     >.flex-h {
16 81
       align-items: center;
17 82
       border-top: 2px solid rgba(0, 0, 0, 0.08);
83
+
18 84
       &:first-child {
19 85
         border: none;
20 86
       }
21 87
 
88
+      .PickerText {
89
+        font-size: 28px;
90
+        color: #999;
91
+        line-height: 40px;
92
+        min-width: 100px;
93
+        text-align: right;
94
+      }
95
+
22 96
       >text {
23 97
         font-size: 28px;
24 98
         color: #999;

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

@@ -48,7 +48,7 @@ export default function WoDeGongDan () {
48 48
   return (
49 49
     <Page>
50 50
       <view className='WoDeGongDan'>
51
-        <ScrollPageRefresh IsEmpty={IsEmpty} ApiName={`getGuanJiaGongDanList`} ListName={`pagelist`} Refresh={Refresh} Push={Push}>
51
+        <ScrollPageRefresh IsEmpty={IsEmpty} ApiName={`getGuanJiaGongDanList`} ListName={`pagelist`} RequestParams={{ communityId: user.communityId }} Refresh={Refresh} Push={Push}>
52 52
           <view className='Content Activity'>
53 53
             {
54 54
               PageList.map((item, index) => (

+ 2
- 2
src/pages/WoDe/index.jsx 查看文件

@@ -79,8 +79,8 @@ export default function WoDe () {
79 79
                 <image mode='aspectFill' src={user.avatarurl} class='centerLabel'></image>
80 80
               </view>
81 81
               <view className='flex-item' onClick={() => { Taro.navigateTo({ url: '/pages/WoDe/GeRenXinXi/index' }) }}>
82
-                <text>{user.nickname || '暂未授权用户信息'}</text>
83
-                <text>{user.phone ? `${user.phone} ${user.roleId - 0 === 1 ? '户主' : user.roleId - 0 === 2 ? '租客' : user.roleId - 0 === 3 ? '家属' : ''}` : '游客'}</text>
82
+                <text>{user.name || user.nickname || '暂未授权用户信息'}</text>
83
+                <text>{(user.tel || user.phone) ? `${user.tel || user.phone} ${user.roleId - 0 === 1 ? '户主' : user.roleId - 0 === 2 ? '租客' : user.roleId - 0 === 3 ? '家属' : ''}` : '游客'}</text>
84 84
               </view>
85 85
               {
86 86
                 user.havaSigned !== undefined &&

+ 5
- 1
src/utils/api.js 查看文件

@@ -1,6 +1,10 @@
1 1
 const prefix = `${HOST}/api/wx`
2 2
 
3 3
 const $api = {
4
+  EditUserInfo: { // 修改用户信息
5
+    method: 'put',
6
+    url: `${prefix}/editPerson`
7
+  },
4 8
   GetCommentList: { // 获取留言板列表
5 9
     method: 'get',
6 10
     url: `${prefix}/message-board`
@@ -25,7 +29,7 @@ const $api = {
25 29
     method: 'post',
26 30
     url: `${prefix}/accessTicket/:orgId`
27 31
   },
28
-  getGuanJiaGongDanList:{ // 获取管家工单列表
32
+  getGuanJiaGongDanList: { // 获取管家工单列表
29 33
     method: 'get',
30 34
     url: `${prefix}/life/ticket/list`
31 35
   },