Просмотр исходного кода

Merge branch 'main' of http://git.ycjcjy.com/marketing/miniapp into main

Your Name 3 лет назад
Родитель
Сommit
53cb78efb3

+ 2
- 2
config/dev.js Просмотреть файл

@@ -3,8 +3,8 @@ module.exports = {
3 3
     NODE_ENV: '"development"'
4 4
   },
5 5
   defineConstants: {
6
-    // HOST: '"https://xlk.njyz.tech"',
7
-    HOST: '"http://127.0.0.1:8081"',
6
+    HOST: '"https://xlk.njyz.tech"',
7
+    // HOST: '"http://127.0.0.1:8081"',
8 8
     WSS_HOST: '"ws://127.0.0.1:8081"',
9 9
     OSS_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
10 10
     OSS_FAST_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',

+ 57
- 0
src/components/ProjectItemCard/index.jsx Просмотреть файл

@@ -0,0 +1,57 @@
1
+
2
+import Taro from '@tarojs/taro'
3
+import { Image } from '@tarojs/components'
4
+import { getImgURL } from '@/utils/image'
5
+import './style.scss'
6
+
7
+export default (props) => {
8
+  const { Data = {} } = props
9
+
10
+  const goto = (it) => {
11
+    Taro.navigateTo({
12
+      url: `/pages/index/buildingDetail/index?id=${it.buildingId}`
13
+    })
14
+  }
15
+
16
+  return (
17
+    <view className='components ProjectItemCard'>
18
+      <view className='Img' onClick={() => goto(Data)}>
19
+        <Image mode='scaleToFill' src={getImgURL(Data?.buildingListImg?.length ? Data.buildingListImg[0].url : null)} className='centerLabel'></Image>
20
+      </view>
21
+      <view className='Name flex-h' onClick={() => goto(Data)}>
22
+        <view className='flex-item'>
23
+          <text>{Data.buildingName}</text>
24
+        </view>
25
+        <text></text>
26
+        <text>{Data.price || '价格待定'}</text>
27
+      </view>
28
+      <text className='Address' onClick={() => goto(Data)}>{Data.address}</text>
29
+      <view className='Tag' onClick={() => goto(Data)}>
30
+        {
31
+          (Data.buildingTag || []).map(x => x.tagName).slice(0, 6).map((x) => (<text key={x}>{x}</text>))
32
+        }
33
+      </view>
34
+      <view className='Views flex-h' onClick={() => goto(Data)}>
35
+        <view className='flex-item'>
36
+          <text className='iconfont icon-fenxiang'></text>
37
+          <text>{`${Data.shareList?.total || 0} 次分享`}</text>
38
+        </view>
39
+        {
40
+          (Data.uvList?.length || 0) > 0 && (
41
+            <view className='Icons'>
42
+              {
43
+                Data.uvList.map((x) => (
44
+                  <view key={x.uvId}>
45
+                    <Image mode='scaleToFill' src={getImgURL(x.photoOravatar)} className='centerLabel'></Image>
46
+                  </view>
47
+                ))
48
+              }
49
+            </view>
50
+          )
51
+        }
52
+        <text>{`...${Data.uvList?.length || 0}人围观`}</text>
53
+      </view>
54
+      {props.children}
55
+    </view>
56
+  )
57
+}

+ 111
- 0
src/components/ProjectItemCard/style.scss Просмотреть файл

@@ -0,0 +1,111 @@
1
+.components.ProjectItemCard {
2
+  position: relative;
3
+  overflow: hidden;
4
+  margin-top: 34px;
5
+  > .Img {
6
+    width: 100%;
7
+    padding-bottom: 60%;
8
+    position: relative;
9
+    overflow: hidden;
10
+    background: #eee;
11
+    border-radius: 8px;
12
+    > image {
13
+      width: 100%;
14
+      height: 100%;
15
+    }
16
+  }
17
+  > .Name {
18
+    align-items: center;
19
+    margin-top: 30px;
20
+    > .flex-item {
21
+      margin-right: 10px;
22
+      > text {
23
+        display: block;
24
+        white-space: nowrap;
25
+        font-size: 32px;
26
+        font-weight: bold;
27
+        white-space: nowrap;
28
+        overflow: hidden;
29
+        text-overflow: ellipsis;
30
+      }
31
+    }
32
+    > text {
33
+      font-size: 22px;
34
+      font-weight: bold;
35
+      &:last-child {
36
+        color: #ff0000;
37
+      }
38
+    }
39
+  }
40
+  > .Address {
41
+    display: block;
42
+    font-size: 22px;
43
+    color: #666;
44
+    line-height: 1;
45
+    margin-top: 30px;
46
+    white-space: nowrap;
47
+    overflow: hidden;
48
+    text-overflow: ellipsis;
49
+  }
50
+  > .Tag {
51
+    font-size: 0;
52
+    > text {
53
+      display: inline-block;
54
+      vertical-align: middle;
55
+      font-size: 16px;
56
+      color: #333;
57
+      line-height: 28px;
58
+      padding: 0 20px;
59
+      background: rgba(251, 171, 87, 0.3);
60
+      margin-right: 20px;
61
+      margin-top: 20px;
62
+    }
63
+  }
64
+  > .Views {
65
+    align-items: center;
66
+    margin-top: 20px;
67
+    padding-bottom: 30px;
68
+    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
69
+    > .flex-item {
70
+      font-size: 0;
71
+      white-space: nowrap;
72
+      > text {
73
+        display: inline-block;
74
+        vertical-align: middle;
75
+        font-size: 16px;
76
+        line-height: 1;
77
+        &:first-child {
78
+          font-size: 20px;
79
+          color: #666;
80
+          margin-right: 10px;
81
+        }
82
+      }
83
+    }
84
+    > .Icons {
85
+      font-size: 0;
86
+      white-space: nowrap;
87
+      > view {
88
+        display: inline-block;
89
+        vertical-align: middle;
90
+        width: 24px;
91
+        height: 24px;
92
+        position: relative;
93
+        overflow: hidden;
94
+        border-radius: 100%;
95
+        background: #eee;
96
+        margin-left: -10px;
97
+        &:first-child {
98
+          margin-left: 0;
99
+        }
100
+        > image {
101
+          width: 100%;
102
+          height: 100%;
103
+        }
104
+      }
105
+    }
106
+    > text {
107
+      font-size: 16px;
108
+      margin-left: 6px;
109
+    }
110
+  }
111
+}

+ 1
- 1
src/layout/index.js Просмотреть файл

@@ -114,7 +114,7 @@ export default (ChildComponent) => (props) => {
114 114
       }
115 115
       <FirstScreen
116 116
         info={screenInfo}
117
-        visible={screenVisible}
117
+        visible={false}
118 118
         onClick={handleScreen}
119 119
         onClose={toggleShowScreen}
120 120
       />

+ 26
- 10
src/pages/chat/chatDetail/index.jsx Просмотреть файл

@@ -1,11 +1,11 @@
1
-import { useEffect, useRef, useState } from 'react'
1
+import { useEffect, useState } from 'react'
2 2
 import Taro from '@tarojs/taro'
3
-import { ScrollView, Input, Image } from '@tarojs/components'
3
+import { ScrollView, Input, Image, Button } from '@tarojs/components'
4 4
 import withLayout from '@/layout'
5 5
 import { API_QUERY_USERINFO_BYID } from '@/constants/api'
6 6
 import { ROLE_CODE } from '@/constants/user'
7 7
 import { uploadFiles, fetch } from '@/utils/request'
8
-import { queryChatHistory, setMessageReaded } from '@/services/chat'
8
+import { queryChatHistory } from '@/services/chat'
9 9
 import im from '@/utils/im'
10 10
 import { getDateForHumans } from '@/utils/chatDate'
11 11
 import '@/assets/css/iconfont.css'
@@ -84,7 +84,7 @@ export default withLayout((props) => {
84 84
       const { records } = res;
85 85
       Taro.hideLoading()
86 86
 
87
-      const lst = (records||[]).reverse()
87
+      const lst = (records || []).reverse()
88 88
 
89 89
       // 如果聊天对象是有身份的
90 90
       if (receiver.personType !== ROLE_CODE.DRIFT && receiver.personType !== ROLE_CODE.CUSTOMER) {
@@ -115,7 +115,7 @@ export default withLayout((props) => {
115 115
       im.bindReceiver(friend)
116 116
       fetch({ url: `${API_QUERY_USERINFO_BYID}/${friend}`, spin: true }).then((res) => {
117 117
         setReceiver(res)
118
-        getChatHistory({ pageNumber: 1})
118
+        getChatHistory({ pageNumber: 1 })
119 119
       })
120 120
     } else {
121 121
       Taro.showToast({
@@ -123,14 +123,14 @@ export default withLayout((props) => {
123 123
         icon: 'none',
124 124
       })
125 125
     }
126
-  // eslint-disable-next-line react-hooks/exhaustive-deps
126
+    // eslint-disable-next-line react-hooks/exhaustive-deps
127 127
   }, [friend])
128 128
 
129 129
   return (
130 130
     <view className='chatDetail flex-v'>
131 131
       <view className='flex-item'>
132 132
         <view>
133
-          <ScrollView  id='chat-scroll' scrollY enhanced scrollTop={scrollTop}>
133
+          <ScrollView id='chat-scroll' scrollY enhanced scrollTop={scrollTop}>
134 134
             <view className='PageContent'>
135 135
               {
136 136
                 PageList.map((item) => (
@@ -156,6 +156,14 @@ export default withLayout((props) => {
156 156
                                   </view>
157 157
                                 )
158 158
                               }
159
+                              { /* 图片消息 */
160
+                                item.messageType === im.MESSAGETYPE.IMAGE &&
161
+                                <view className='Message Left Img'>
162
+                                  <view>
163
+                                    <Image mode='scaleToFill' src={item.message}></Image>
164
+                                  </view>
165
+                                </view>
166
+                              }
159 167
                               { /* 如果是卡片 */
160 168
                                 item.messageType === im.MESSAGETYPE.CARD && (
161 169
                                   <Card person={receiver} onLeavePhone={leavePhone} />
@@ -173,6 +181,14 @@ export default withLayout((props) => {
173 181
                                   </view>
174 182
                                 )
175 183
                               }
184
+                              { /* 图片消息 */
185
+                                item.messageType === im.MESSAGETYPE.IMAGE &&
186
+                                <view className='Message Right Img'>
187
+                                  <view>
188
+                                    <Image mode='scaleToFill' src={item.message}></Image>
189
+                                  </view>
190
+                                </view>
191
+                              }
176 192
                             </view>
177 193
                             <view className='Icon'>
178 194
                               <Image mode='scaleToFill' src={person.avatarurl}></Image>
@@ -182,8 +198,8 @@ export default withLayout((props) => {
182 198
                       }
183 199
 
184 200
 
185
-                        {/* 系统模板消息(对方消息) */}
186
-                        {/* {
201
+                      {/* 系统模板消息(对方消息) */}
202
+                      {/* {
187 203
                           index === 0 &&
188 204
                         } */}
189 205
 
@@ -201,7 +217,7 @@ export default withLayout((props) => {
201 217
           <Input placeholder='发送消息' value={text} onInput={(e) => setText(e.detail.value)} />
202 218
         </view>
203 219
         <text className='iconfont icon-tianjia' onClick={submitImage}></text>
204
-        <button loading={submitting} className='Send' onClick={submitText}>发送</button>
220
+        <Button loading={submitting} className='Send' onClick={submitText}>发送</Button>
205 221
       </view>
206 222
     </view>
207 223
   )

+ 23
- 6
src/pages/chat/chatDetail/index.scss Просмотреть файл

@@ -72,32 +72,32 @@
72 72
                   position: relative;
73 73
                   overflow: hidden;
74 74
                   padding: 20px 20px 40px;
75
-                  >.Msg {
75
+                  > .Msg {
76 76
                     display: block;
77 77
                     font-size: 32px;
78 78
                     line-height: 44px;
79 79
                     color: #333;
80 80
                   }
81
-                  >.Tips {
81
+                  > .Tips {
82 82
                     color: rgba(0, 0, 0, 0.37);
83 83
                     font-size: 28px;
84 84
                     line-height: 40px;
85 85
                     margin-top: 30px;
86 86
                     display: block;
87
-                    &+view {
87
+                    & + view {
88 88
                       margin-top: 26px;
89 89
                     }
90 90
                   }
91
-                  >view {
91
+                  > view {
92 92
                     font-size: 0;
93 93
                     white-space: nowrap;
94 94
                     margin-top: 20px;
95
-                    >text {
95
+                    > text {
96 96
                       display: inline-block;
97 97
                       vertical-align: middle;
98 98
                       font-size: 28px;
99 99
                       line-height: 40px;
100
-                      color: #02C577;
100
+                      color: #02c577;
101 101
                       margin-left: 20px;
102 102
                       &:first-child {
103 103
                         margin-left: 0;
@@ -122,6 +122,23 @@
122 122
                       color: #333;
123 123
                     }
124 124
                   }
125
+                  &.Left.Img,
126
+                  &.Right.Img {
127
+                    padding: 0;
128
+                    font-size: 0;
129
+                    > view {
130
+                      width: 300px;
131
+                      height: 300px;
132
+                      position: relative;
133
+                      overflow: hidden;
134
+                      display: inline-block;
135
+                      background: rgba(0, 0, 0, 0.03);
136
+                      > image {
137
+                        width: 100%;
138
+                        height: 100%;
139
+                      }
140
+                    }
141
+                  }
125 142
                   > text {
126 143
                     display: inline-block;
127 144
                     color: #fff;

+ 2
- 2
src/pages/index/brandDetail/index.jsx Просмотреть файл

@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react'
2 2
 import withLayout from '@/layout'
3 3
 import Taro from '@tarojs/taro'
4 4
 import { ScrollView, Image } from '@tarojs/components'
5
-import ProjectListItem from '@/components/ProjectListItem/index'
5
+import ProjectItemCard from '@/components/ProjectItemCard/index'
6 6
 import { queryBrandInfo } from '@/services/common';
7 7
 import { getImgURL } from '@/utils/image'
8 8
 import { fetch } from '@/utils/request'
@@ -88,7 +88,7 @@ export default withLayout((props) => {
88 88
             <view className='ProjectList'>
89 89
               {
90 90
                 PageList.map((item, index) => (
91
-                  <ProjectListItem Data={item} key={`ProjectListItem-${index}`}></ProjectListItem>
91
+                  <ProjectItemCard Data={item} key={`ProjectItemCard-${index}`}></ProjectItemCard>
92 92
                 ))
93 93
               }
94 94
             </view>

+ 49
- 0
src/pages/index/mortgageCalculation/components/ShangYe/index.jsx Просмотреть файл

@@ -0,0 +1,49 @@
1
+import { useState, useEffect } from 'react'
2
+import { Input } from '@tarojs/components'
3
+import './index.scss'
4
+
5
+export default function ShangYe () {
6
+
7
+  const [Years, setYears] = useState([])
8
+  const [CurrentYearsName, setCurrentYearsName] = useState('30年')
9
+  const [CurrentYearsId, setCurrentYearsId] = useState(30)
10
+
11
+  useEffect(() => {
12
+    if (!Years.length) {
13
+      let Arr = []
14
+      for (let n = 30; n > 0; n--) {
15
+        Arr.push({ name: `${n}年`, id: n })
16
+      }
17
+      setYears(Arr)
18
+    }
19
+  }, [Years])
20
+
21
+  return (
22
+    <view className='components ShangYe'>
23
+
24
+      <view className='flex-h'>
25
+        <text>计算方式</text>
26
+        <view className='flex-item'>
27
+
28
+        </view>
29
+      </view>
30
+
31
+      <view className='flex-h'>
32
+        <text>商贷金额</text>
33
+        <view className='flex-item'>
34
+          <Input></Input>
35
+        </view>
36
+        <text>万</text>
37
+      </view>
38
+
39
+      <view className='flex-h'>
40
+        <text>商贷年限</text>
41
+        <view className='flex-item'>
42
+          <picker value={0} range-key='name' range={Years}>{CurrentYearsName}</picker>
43
+        </view>
44
+        <text className='iconfont icon-jiantouright'></text>
45
+      </view>
46
+
47
+    </view>
48
+  )
49
+}

+ 4
- 0
src/pages/index/mortgageCalculation/components/ShangYe/index.scss Просмотреть файл

@@ -0,0 +1,4 @@
1
+.components.ShangYe {
2
+  position: relative;
3
+  overflow: hidden;
4
+}

+ 39
- 31
src/pages/index/mortgageCalculation/index.jsx Просмотреть файл

@@ -1,44 +1,52 @@
1
-import React, { useState, useEffect } from 'react'
1
+import { useState, useEffect } from 'react'
2 2
 import withLayout from '@/layout'
3
-import './index.scss'
4 3
 import { ScrollView } from '@tarojs/components'
4
+import ShangYe from './components/ShangYe/index'
5 5
 import '@/assets/css/iconfont.css'
6
+import './index.scss'
6 7
 
7
-export default withLayout((props) => {
8
+export default withLayout(() => {
8 9
 
9
-  // const [PageProps] = useState(props)
10
-  const [PageList, setPageList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', ''])
11
-  const [IsPull, setPull] = useState(false)
12
-  const [PullTimer, setPullTimer] = useState(null)
10
+  const [MenuList] = useState([
11
+    { name: '商业贷款', id: 1 },
12
+    { name: '组合贷款', id: 2 },
13
+    { name: '公积金贷款', id: 3 }
14
+  ])
15
+  const [CurrnetMenuId, setCurrnetMenuId] = useState(1)
13 16
 
14
-  const PageRefresh = () => { // 页面下拉刷新回调
15
-    setPull(true)
16
-  }
17
-
18
-  useEffect(() => { // 下拉刷新触发
19
-    if (IsPull) {
20
-      clearTimeout(PullTimer)
21
-      setPullTimer(setTimeout(() => {
22
-        setPull(false)
23
-      }, 2000))
17
+  const CutMenu = (id) => {
18
+    return () => {
19
+      setCurrnetMenuId(id)
24 20
     }
25
-  }, [IsPull])
21
+  }
26 22
 
27 23
   return (
28
-    <view className='Page mortgageCalculation'>
29
-
30
-      <ScrollView scroll-y={true} refresher-enabled={true} refresher-triggered={IsPull} onrefresherrefresh={PageRefresh} refresher-background='#fff'>
31
-        <view className='PageContent'>
32
-
33
-          房贷计算
34
-
35
-          {/* bottom */}
36
-          <view className='PageBottom'>
37
-            <text>已经到底了~</text>
38
-          </view>
39
-
24
+    <view className='Page mortgageCalculation flex-v'>
25
+
26
+      <view className='MenuList flex-h'>
27
+        {
28
+          MenuList.map((item, index) => (
29
+            <view key={`ListItem${index}`} className='flex-item'>
30
+              <text onClick={CutMenu(item.id)} className={CurrnetMenuId === item.id ? 'active' : ''}>{item.name}</text>
31
+            </view>
32
+          ))
33
+        }
34
+      </view>
35
+
36
+      <view className='flex-item'>
37
+        <view>
38
+          <ScrollView scroll-y>
39
+            <view className='PageContent'>
40
+
41
+              {
42
+                CurrnetMenuId === 1 &&
43
+                <ShangYe></ShangYe>
44
+              }
45
+
46
+            </view>
47
+          </ScrollView>
40 48
         </view>
41
-      </ScrollView>
49
+      </view>
42 50
 
43 51
     </view>
44 52
   )

+ 52
- 6
src/pages/index/mortgageCalculation/index.scss Просмотреть файл

@@ -1,12 +1,58 @@
1 1
 .Page.mortgageCalculation {
2 2
   background: #fff;
3
-  > scroll-view {
4
-    width: 100%;
5
-    height: 100%;
6
-    .PageContent {
7
-      position: relative;
3
+  >.MenuList {
4
+    position: relative;
5
+    overflow: hidden;
6
+    border-bottom: 2px solid rgba(0, 0, 0, 0.08);
7
+    padding: 0 30px;
8
+    >view {
9
+      text-align: center;
10
+      font-size: 0;
11
+      >text {
12
+        display: inline-block;
13
+        font-size: 30px;
14
+        font-weight: bold;
15
+        line-height: 40px;
16
+        padding: 20px 0 30px;
17
+        position: relative;
18
+        &.active {
19
+          color: #193C83;
20
+          &::after {
21
+            content: '';
22
+            width: 30px;
23
+            height: 4px;
24
+            border-radius: 4px;
25
+            background: #193C83;
26
+            display: block;
27
+            position: absolute;
28
+            left: 50%;
29
+            bottom: 4px;
30
+            transform: translateX(-50%);
31
+            -webkit-transform: translateX(-50%);
32
+          }
33
+        }
34
+      }
35
+    }
36
+  }
37
+  >.flex-item {
38
+    position: relative;
39
+    overflow: hidden;
40
+    >view {
41
+      width: 100%;
42
+      position: absolute;
43
+      left: 0;
44
+      top: 0;
45
+      bottom: 0;
8 46
       overflow: hidden;
9
-      min-height: 100vh;
47
+      > scroll-view {
48
+        width: 100%;
49
+        height: 100%;
50
+        .PageContent {
51
+          position: relative;
52
+          overflow: hidden;
53
+          min-height: 100vh;
54
+        }
55
+      }
10 56
     }
11 57
   }
12 58
 }

+ 28
- 23
src/pages/mine/addCustomer/index.jsx Просмотреть файл

@@ -56,12 +56,12 @@ export default withLayout((props) => {
56 56
         url = API_CHANNEL_REPORT
57 57
       }
58 58
       let params = {}
59
-      if(type === 'consultant') {
59
+      if (type === 'consultant') {
60 60
         params = { name: FormData.name, phone: FormData.phone, sex: SexId }
61 61
       } else {
62 62
         params = { ...FormData, sex: SexId, intention: BuildingId, realtyConsultant: CardId }
63 63
       }
64
-      if(type === 'estateAgent') {
64
+      if (type === 'estateAgent') {
65 65
         params.channelCustomerId = PersonId
66 66
         params.channelId = user.userInfo.person.channelId
67 67
         params.buildingId = BuildingId
@@ -144,10 +144,14 @@ export default withLayout((props) => {
144 144
       Taro.showToast({ title: '请填写正确的客户电话', icon: 'none' })
145 145
       return false
146 146
     }
147
-    if (BuildingId === null && type !== 'consultant') {
147
+    if (BuildingId === null) {
148 148
       Taro.showToast({ title: '请选择客户的意向楼盘', icon: 'none' })
149 149
       return false
150 150
     }
151
+    if (CardId === null) {
152
+      Taro.showToast({ title: '请选择内场接待', icon: 'none' })
153
+      return false
154
+    }
151 155
     if (!CanSubmit) {
152 156
       setCanSubmit(true)
153 157
     }
@@ -183,29 +187,30 @@ export default withLayout((props) => {
183 187
             <text className='iconfont icon-jiantoudown'></text>
184 188
           </view>
185 189
 
190
+
191
+          <text>意向楼盘</text>
192
+          <view className='FormLine flex-h'>
193
+            <view className='flex-item'>
194
+              <Picker range-key='name' onChange={PickerChange} value={0} range={BuildingList}>
195
+                <text>{BuildingName || '请选择'}</text>
196
+              </Picker>
197
+            </view>
198
+          </view>
199
+
200
+          <text>内场接待(选填)</text>
201
+          <view className='FormLine flex-h'>
202
+            <view className='flex-item'>
203
+              <Picker range-key='name' onChange={CardPickerChange} value={0} range={CardList}>
204
+                <text>{CardName || '请选择'}</text>
205
+              </Picker>
206
+            </view>
207
+            <Image mode='heightFix' src={defaultSpecialImage}></Image>
208
+            <text>选择</text>
209
+          </view>
210
+
186 211
           {
187 212
             type !== 'consultant' &&
188 213
             <Block>
189
-              <text>意向楼盘</text>
190
-              <view className='FormLine flex-h'>
191
-                <view className='flex-item'>
192
-                  <Picker range-key='name' onChange={PickerChange} value={0} range={BuildingList}>
193
-                    <text>{BuildingName || '请选择'}</text>
194
-                  </Picker>
195
-                </view>
196
-              </view>
197
-
198
-              <text>内场接待(选填)</text>
199
-              <view className='FormLine flex-h'>
200
-                <view className='flex-item'>
201
-                  <Picker range-key='name' onChange={CardPickerChange} value={0} range={CardList}>
202
-                    <text>{CardName || '请选择'}</text>
203
-                  </Picker>
204
-                </view>
205
-                <Image mode='heightFix' src={defaultSpecialImage}></Image>
206
-                <text>选择</text>
207
-              </view>
208
-
209 214
               <text>备注</text>
210 215
               <view className='FormLine flex-h'>
211 216
                 <view className='flex-item'>

+ 33
- 13
src/pages/mine/components/EditUserDetailBasicInfo/index.jsx Просмотреть файл

@@ -1,14 +1,27 @@
1
-import React, { useState, useEffect } from 'react'
1
+import { useState, useEffect } from 'react'
2 2
 import './index.scss'
3
-import Taro from '@tarojs/taro'
4
-import { ScrollView, Image, Input } from '@tarojs/components'
3
+import { ScrollView, Input, Picker } from '@tarojs/components'
5 4
 
6 5
 export default function EditUserDetailBasicInfo (props) {
7
-  const { Data = {}, close = () => {} } = props
6
+  const { Data = {}, close = () => { } } = props
7
+
8
+  const [FormData, setFormData] = useState({ ...Data })
9
+
10
+  const [SexList] = useState([
11
+    {name: '男', id: 1},
12
+    {name: '女', id: 2}
13
+  ])
14
+  const [AgeRange] = useState(['18-25', '26-30', '30-35', '36-45', '46-50', '50-60', '60以上'])
15
+  const [IncomeRange] = useState(['10万以下', '10-15万', '15-20万', '20-30万', '30-50万', '50-75万', '75-100万', '100万以上'])
16
+  const [BuyTimeRange] = useState(['1月以内', '1至3月', '半年以内', '一年以内', '一年以上'])
17
+
18
+  const PickerChange = (e, type) => {
19
+
20
+  }
8 21
 
9 22
   return (
10 23
     <view className='components EditUserDetailBasicInfo'>
11
-      <ScrollView scroll-y={true} refresher-enabled={false} refresher-background='#fff'>
24
+      <ScrollView scroll-y refresher-enabled={false} refresher-background='#fff'>
12 25
         <view className='PageContent'>
13 26
 
14 27
           <text>姓名</text>
@@ -35,7 +48,9 @@ export default function EditUserDetailBasicInfo (props) {
35 48
           <text>性别</text>
36 49
           <view className='FormLine flex-h'>
37 50
             <view className='flex-item'>
38
-              <text>请选择</text>
51
+              <Picker range-key='name' onChange={PickerChange.bind(this, 'sex')} value={0} range={SexList}>
52
+                <text>请选择</text>
53
+              </Picker>
39 54
             </view>
40 55
             <text className='iconfont icon-jiantoudown'></text>
41 56
           </view>
@@ -57,7 +72,9 @@ export default function EditUserDetailBasicInfo (props) {
57 72
           <text>年龄段</text>
58 73
           <view className='FormLine flex-h'>
59 74
             <view className='flex-item'>
60
-              <text>请选择</text>
75
+              <Picker onChange={PickerChange.bind(this, 'age')} value={0} range={AgeRange}>
76
+                <text>请选择</text>
77
+              </Picker>
61 78
             </view>
62 79
             <text className='iconfont icon-jiantoudown'></text>
63 80
           </view>
@@ -72,7 +89,9 @@ export default function EditUserDetailBasicInfo (props) {
72 89
           <text>家庭年收入范围</text>
73 90
           <view className='FormLine flex-h'>
74 91
             <view className='flex-item'>
75
-              <text>请选择</text>
92
+              <Picker onChange={PickerChange.bind(this, 'income')} value={0} range={IncomeRange}>
93
+                <text>请选择</text>
94
+              </Picker>
76 95
             </view>
77 96
             <text className='iconfont icon-jiantoudown'></text>
78 97
           </view>
@@ -101,7 +120,9 @@ export default function EditUserDetailBasicInfo (props) {
101 120
           <text>预计购房时间</text>
102 121
           <view className='FormLine flex-h'>
103 122
             <view className='flex-item'>
104
-              <text>请选择</text>
123
+              <Picker onChange={PickerChange.bind(this, 'time')} value={0} range={BuyTimeRange}>
124
+                <text>请选择</text>
125
+              </Picker>
105 126
             </view>
106 127
             <text className='iconfont icon-jiantoudown'></text>
107 128
           </view>
@@ -109,22 +130,21 @@ export default function EditUserDetailBasicInfo (props) {
109 130
           <text>客户咨询重点</text>
110 131
           <view className='FormLine flex-h'>
111 132
             <view className='flex-item'>
112
-              <Input placeholder='请填写  如:地段、交通、社区配套、户型、价格等'></Input>
133
+              <Input placeholder='请填写  如:地段、交通、社区配套、户型、价格等'></Input>
113 134
             </view>
114 135
           </view>
115 136
 
116 137
           <text>购房动机</text>
117 138
           <view className='FormLine flex-h'>
118 139
             <view className='flex-item'>
119
-              <text>请选择</text>
140
+              <Input placeholder='请填写 如结婚、养老、二孩、改善、学区、投资等'></Input>
120 141
             </view>
121
-            <text className='iconfont icon-jiantoudown'></text>
122 142
           </view>
123 143
 
124 144
           <text>客户抗性分析</text>
125 145
           <view className='FormLine flex-h'>
126 146
             <view className='flex-item'>
127
-              <Input placeholder='请填写  如:地段、交通、社区配套、户型、价格等'></Input>
147
+              <Input placeholder='请填写  如:地段、交通、社区配套、户型、价格等'></Input>
128 148
             </view>
129 149
           </view>
130 150
 

+ 4
- 6
src/pages/mine/mortgageCalc/index.jsx Просмотреть файл

@@ -1,17 +1,15 @@
1
-import React, { useState, useEffect } from 'react'
1
+import { useState, useEffect } from 'react'
2 2
 import withLayout from '@/layout'
3
-import './index.scss'
4 3
 import { ScrollView, Input } from '@tarojs/components'
5 4
 import '@/assets/css/iconfont.css'
5
+import './index.scss'
6 6
 
7
-export default withLayout((props) => {
8
-
9
-  // const [PageProps] = useState(props)
7
+export default withLayout(() => {
10 8
 
11 9
   return (
12 10
     <view className='Page mortgageCalc'>
13 11
 
14
-      <ScrollView scroll-y={true} refresher-enabled={false} refresher-background='#fff'>
12
+      <ScrollView scroll-y>
15 13
         <view className='PageContent'>
16 14
 
17 15
           <text>房产总价/万元</text>

+ 12
- 12
src/routes.js Просмотреть файл

@@ -50,6 +50,12 @@ const routes = [
50 50
   // /********************************
51 51
   //  * 项目相关
52 52
   //  *******************************/
53
+  {
54
+    name: '房贷计算',
55
+    page: 'pages/index/mortgageCalculation/index',
56
+    pkg: 'main',
57
+    type: 'building',
58
+  },
53 59
   {
54 60
     name: '定位',
55 61
     page: 'pages/index/location/index',
@@ -225,12 +231,6 @@ const routes = [
225 231
     pkg: 'main',
226 232
     type: 'building',
227 233
   },
228
-  {
229
-    name: '房贷计算',
230
-    page: 'pages/index/mortgageCalculation/index',
231
-    pkg: 'main',
232
-    type: 'building',
233
-  },
234 234
   {
235 235
     name: '课程详情',
236 236
     page: 'pages/index/courseDetail/index',
@@ -253,6 +253,12 @@ const routes = [
253 253
   },
254 254
 
255 255
   // 我的
256
+  {
257
+    name: '房贷计算器',
258
+    page: 'pages/mine/mortgageCalc/index',
259
+    pkg: 'main',
260
+    type: 'mine',
261
+  },
256 262
   {
257 263
     name: '基本信息',
258 264
     page: 'pages/mine/userInfo/index',
@@ -367,12 +373,6 @@ const routes = [
367 373
     pkg: 'main',
368 374
     type: 'mine',
369 375
   },
370
-  {
371
-    name: '房贷计算器',
372
-    page: 'pages/mine/mortgageCalc/index',
373
-    pkg: 'main',
374
-    type: 'mine',
375
-  },
376 376
   {
377 377
     name: '个人主页',
378 378
     page: 'pages/mine/myHomepage/index',