Browse Source

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

Your Name 3 years ago
parent
commit
548ed055f7

+ 10
- 6
src/assets/css/iconfont.css
File diff suppressed because it is too large
View File


BIN
src/assets/css/iconfont.eot View File


+ 1
- 1
src/assets/css/iconfont.js
File diff suppressed because it is too large
View File


+ 7
- 0
src/assets/css/iconfont.json View File

@@ -5,6 +5,13 @@
5 5
   "css_prefix_text": "icon-",
6 6
   "description": "",
7 7
   "glyphs": [
8
+    {
9
+      "icon_id": "6512684",
10
+      "name": "暂无数据",
11
+      "font_class": "nodata",
12
+      "unicode": "e613",
13
+      "unicode_decimal": 58899
14
+    },
8 15
     {
9 16
       "icon_id": "9063194",
10 17
       "name": "消 息",

+ 2
- 0
src/assets/css/iconfont.svg View File

@@ -14,6 +14,8 @@
14 14
     />
15 15
       <missing-glyph />
16 16
       
17
+      <glyph glyph-name="nodata" unicode="&#58899;" d="M148.994 206.72000000000003h19.968a9.984 9.984 0 0 0 0-19.84h-19.968v-20.48a9.984 9.984 0 0 0-9.984-9.728 10.112 10.112 0 0 0-10.368 9.728v20.48h-19.584a9.984 9.984 0 0 0-9.856 9.984 9.856 9.856 0 0 0 9.856 9.856h20.224v20.096a9.984 9.984 0 0 0 19.84 0v-20.096z m1306.624 79.616v19.968a9.6 9.6 0 0 1-2.944 7.04 10.24 10.24 0 0 1-7.04 2.816 9.984 9.984 0 0 1-9.856-9.856v-19.968h-20.096a8.96 8.96 0 0 1-6.912-3.072 9.344 9.344 0 0 1-2.816-6.912 9.984 9.984 0 0 1 9.728-9.984h20.096V246.39999999999998a9.856 9.856 0 0 1 9.856-9.856 9.984 9.984 0 0 1 9.984 9.856v19.968h20.096a9.984 9.984 0 0 1 0 19.968zM736.386-41.855999999999995H238.082a19.328 19.328 0 0 0-13.824 5.888 19.84 19.84 0 0 0 13.824 33.92h89.6a80.128 80.128 0 0 0-10.624 39.68V614.4a80 80 0 0 0 23.168 56.192 79.104 79.104 0 0 0 56.064 23.296h59.264v20.096a79.488 79.488 0 0 0 23.296 56.192 78.464 78.464 0 0 0 56.192 23.424h475.008a79.36 79.36 0 0 0 79.232-79.36v-577.28a78.464 78.464 0 0 0-10.624-39.552h109.44a19.968 19.968 0 0 0 0-39.808H950.786v-19.968a78.464 78.464 0 0 0-10.496-39.68h10.496a19.712 19.712 0 0 0 19.84-19.84 19.968 19.968 0 0 0-19.84-19.968H846.722a39.424 39.424 0 0 0-6.016-48.384 40.32 40.32 0 0 0-28.032-11.776 39.296 39.296 0 0 0-28.032 11.776z m72.448 39.808h62.976a39.68 39.68 0 0 1 39.424 40.448V615.552a38.4 38.4 0 0 1-38.4 38.4H395.01a38.4 38.4 0 0 1-38.4-38.4V38.39999999999998a39.936 39.936 0 0 1 39.424-39.936h300.544l-9.984 10.24a40.064 40.064 0 0 0-10.368 38.4l-18.688 18.688A138.112 138.112 0 0 0 469.89 86.39999999999998a139.648 139.648 0 0 0 6.656 189.312 137.984 137.984 0 0 0 188.928 7.04 139.52 139.52 0 0 0 20.096-188.8l19.072-19.072a39.424 39.424 0 0 0 38.4-10.24z m141.952 99.456h59.776a39.808 39.808 0 0 1 39.68 39.808V713.984a39.68 39.68 0 0 1-39.424 39.808H534.914a39.808 39.808 0 0 1-39.424-39.808v-19.84h375.552a79.104 79.104 0 0 0 79.616-79.744v-516.992zM253.058 828.4159999999999h29.184a14.976 14.976 0 1 0 0-29.824h-29.44v-29.696a14.976 14.976 0 1 0-29.824 0V798.592h-29.312a14.848 14.848 0 0 0-10.624 4.224 14.976 14.976 0 0 0 10.624 25.6h29.568V857.6a14.976 14.976 0 1 0 29.824 0zM20.354-21.888000000000034a19.968 19.968 0 0 0 19.712 19.84h119.04a19.712 19.712 0 0 0 19.712-19.84 19.968 19.968 0 0 0-19.712-19.968H40.066a19.84 19.84 0 0 0-13.824 5.888 19.456 19.456 0 0 0-5.76 14.08z m624.256 128a99.84 99.84 0 0 1 0 140.8 98.816 98.816 0 0 1-140.032 0 99.84 99.84 0 0 1 0-140.8 98.816 98.816 0 0 1 140.032 0z m-208.768 468.48a19.84 19.84 0 0 0 19.712 19.968h217.6a19.968 19.968 0 0 0 0-39.808h-217.6a20.736 20.736 0 0 0-14.08 5.76 20.224 20.224 0 0 0-5.632 14.08z m0-99.328a19.84 19.84 0 0 0 19.712 19.84h317.312a19.968 19.968 0 0 0 0-39.808H455.682a19.712 19.712 0 0 0-19.84 19.968z m0-99.456a19.84 19.84 0 0 0 19.712 19.84h139.008a19.84 19.84 0 0 0 0-39.68H455.81a19.84 19.84 0 0 0-19.968 19.84zM60.034 495.104a59.648 59.648 0 1 0 59.264 59.648 59.392 59.392 0 0 0-59.264-59.648z m0 29.824a29.824 29.824 0 0 1 0 59.648 29.824 29.824 0 0 1 0-59.648z m1227.392 89.6a59.648 59.648 0 1 0 59.264 59.648 59.264 59.264 0 0 0-59.264-59.776z m0 29.824a29.568 29.568 0 0 1 25.6 14.976 30.208 30.208 0 0 1 0 29.824 29.696 29.696 0 1 1-25.6-44.8z"  horiz-adv-x="1485" />
18
+      
17 19
       <glyph glyph-name="xiaoxi" unicode="&#58935;" d="M882.176 67.584l6.656-6.656 134.656-134.656H512c-282.624-0.512-512 204.8-512 457.728s229.376 458.24 512 458.24S1024 636.928 1024 384c0-122.88-53.76-233.984-141.824-316.416z m-208.384 235.52c44.544 0 80.896 36.352 80.896 80.896s-36.352 80.896-80.896 80.896c-44.544 0-80.896-36.352-80.896-80.896s36.352-80.896 80.896-80.896z m-323.584 0c44.544 0 80.896 36.352 80.896 80.896s-36.352 80.896-80.896 80.896-80.384-36.352-80.384-80.896 35.84-80.896 80.384-80.896z"  horiz-adv-x="1024" />
18 20
       
19 21
       <glyph glyph-name="jianjie" unicode="&#58927;" d="M767.723243 457.063784h-512a34.594595 34.594595 0 0 0-36.531892 36.531892 34.594595 34.594595 0 0 0 36.531892 36.531892h512a34.594595 34.594595 0 0 0 36.531892-36.531892 34.594595 34.594595 0 0 0-36.531892-36.531892z m0-219.32973h-512a36.531892 36.531892 0 1 0 0 73.063784h512a36.531892 36.531892 0 1 0 0-73.063784z m0-219.191351h-512a36.531892 36.531892 0 1 0 0 73.063783h512a36.531892 36.531892 0 1 0 0-73.063783z m-512 730.776216h219.744865A34.594595 34.594595 0 0 0 512 712.925405a34.594595 34.594595 0 0 0-36.531892-36.531891H256.276757a34.594595 34.594595 0 0 0-36.531892 36.531891 34.456216 34.456216 0 0 0 36.531892 36.531892zM804.393514 896H219.606486A146.542703 146.542703 0 0 1 73.478919 749.457297v-730.914594A146.542703 146.542703 0 0 1 219.606486-128h584.787028a146.542703 146.542703 0 0 1 146.127567 146.542703V749.457297A146.542703 146.542703 0 0 1 804.393514 896z"  horiz-adv-x="1024" />

BIN
src/assets/css/iconfont.ttf View File


BIN
src/assets/css/iconfont.woff View File


BIN
src/assets/css/iconfont.woff2 View File


+ 9
- 2
src/pages/chat/index.jsx View File

@@ -22,7 +22,7 @@ export default withLayout((props) => {
22 22
       ...params || {},
23 23
     }).then((res) => {
24 24
       Taro.hideLoading()
25
-      const { records } =  res
25
+      const { records } = res
26 26
       setPageList(records || [])
27 27
     }).catch((err) => {
28 28
       console.error(err)
@@ -59,7 +59,7 @@ export default withLayout((props) => {
59 59
       <ScrollView scrollY refresherEnabled refresherTriggered={IsPull} onRefresherrefresh={PageRefresh} refresherBackground='#fff'>
60 60
         <view className='PageContent'>
61 61
           {
62
-            PageList.map((item, index) => (
62
+            PageList.map((item) => (
63 63
               <view className='ListItem flex-h' key={item.friendId} onClick={() => handleChat(item)}>
64 64
                 <view className='Icon'>
65 65
                   <view>
@@ -79,6 +79,13 @@ export default withLayout((props) => {
79 79
               </view>
80 80
             ))
81 81
           }
82
+          {
83
+            PageList.length === 0 &&
84
+            <view className='NoData centerLabel'>
85
+              <text className='iconfont icon-nodata'></text>
86
+              <text>没有更多聊天信息了~</text>
87
+            </view>
88
+          }
82 89
         </view>
83 90
       </ScrollView>
84 91
 

+ 12
- 0
src/pages/chat/index.scss View File

@@ -76,6 +76,18 @@
76 76
           }
77 77
         }
78 78
       }
79
+      >.NoData {
80
+        >text {
81
+          display: block;
82
+          text-align: center;
83
+          font-size: 28px;
84
+          color: #ccc;
85
+          &.iconfont {
86
+            font-size: 160px;
87
+            margin-bottom: 40px;
88
+          }
89
+        }
90
+      }
79 91
     }
80 92
   }
81 93
 }

+ 19
- 7
src/pages/index/buildingDetail/components/News/index.jsx View File

@@ -47,14 +47,26 @@ export default function News (props) {
47 47
 
48 48
       <view className='List flex-h'>
49 49
         {
50
-          NewsList.map((item, index) => (
51
-            <view className='flex-item' key={`ListItem-${index}`} onClick={() => gotoDetail(item)}>
52
-              <view className='Img' style={{display: item.newsImg || item.newsName ? 'block' : 'none'}}>
53
-                <Image mode='aspectFill' src={getImgURL(item.newsImg)} className='centerLabel'></Image>
54
-              </view>
55
-              <text className='Title'>{item.newsName}</text>
50
+          NewsList.length > 0 &&
51
+          <view className='flex-item' onClick={() => gotoDetail(NewsList[0])}>
52
+            <view className='Img' style={{display: NewsList[0].newsImg || NewsList[0].newsName ? 'block' : 'none'}}>
53
+              <Image mode='aspectFill' src={getImgURL(NewsList[0].newsImg)} className='centerLabel'></Image>
56 54
             </view>
57
-          ))
55
+            <text className='Title'>{NewsList[0].newsName}</text>
56
+          </view>
57
+        }
58
+        {
59
+          NewsList.length > 1 &&
60
+          <view className='flex-item' onClick={() => gotoDetail(NewsList[1])}>
61
+            <view className='Img' style={{display: NewsList[1].newsImg || NewsList[1].newsName ? 'block' : 'none'}}>
62
+              <Image mode='aspectFill' src={getImgURL(NewsList[1].newsImg)} className='centerLabel'></Image>
63
+            </view>
64
+            <text className='Title'>{NewsList[1].newsName}</text>
65
+          </view>
66
+        }
67
+        {
68
+          NewsList.length === 1 &&
69
+          <view className='flex-item'></view>
58 70
         }
59 71
       </view>
60 72
 

+ 1
- 1
src/pages/index/encyDetail/index.jsx View File

@@ -40,7 +40,7 @@ export default withLayout((props) => {
40 40
               <view className="Info">
41 41
                 <view>
42 42
                   <text className="Title">
43
-                    {data.title} {data.subtitle}
43
+                    {data.title}
44 44
                   </text>
45 45
                   <view>
46 46
                   <text>阅读:{data.pvNum}</text>

+ 1
- 1
src/pages/index/encyclopediasOfBuyHouse/index.jsx View File

@@ -43,7 +43,7 @@ const EncyItem = (props) => {
43 43
               });
44 44
             }}
45 45
           >
46
-            <text className="Name">{subItem.title}</text>
46
+            <text className="Name">{subItem.subtitle}</text>
47 47
             {subItem.isHot === 1 && (
48 48
               <text className="Tips" style={{ background: "#FF0000" }}>
49 49
                 {/* {subItem.tips} */}

+ 42
- 2
src/pages/mine/myRecommendCode/index.jsx View File

@@ -4,6 +4,8 @@ import withLayout from '@/layout'
4 4
 import '@/assets/css/iconfont.css'
5 5
 import { fetch } from '@/utils/request'
6 6
 import { API_QRCODE } from '@/constants/api'
7
+import { getImgURL } from '@/utils/image'
8
+import Taro from '@tarojs/taro'
7 9
 import './index.scss'
8 10
 
9 11
 export default withLayout((props) => {
@@ -21,10 +23,48 @@ export default withLayout((props) => {
21 23
     })
22 24
   }, [])
23 25
 
26
+  const Save = () => {
27
+    Taro.downloadFile({
28
+      url: QrCodeUrl,
29
+      success: function(res) {
30
+        let tempFilePath = res.tempFilePath
31
+        Taro.saveFile({
32
+          tempFilePath: tempFilePath,
33
+          success: function() {
34
+            Taro.showToast({title: '保存成功', icon: 'none'})
35
+          },
36
+          fail: function() {
37
+            Taro.showToast({title: '保存失败', icon: 'none'})
38
+          }
39
+        })
40
+      }
41
+    })
42
+  }
43
+
44
+  const PreviewImage = () => {
45
+    Taro.previewImage({
46
+      current: QrCodeUrl,
47
+      urls: [QrCodeUrl]
48
+    })
49
+  }
50
+
24 51
   return (
25 52
     <view className='Page myRecommendCode'>
26
-      <Image mode='widthFix' src={QrCodeUrl}></Image>
27
-      <text>扫一扫上面的二维码图案,成为我的客户</text>
53
+      <view className='CodeContent'>
54
+        <view>
55
+          <view className='flex-h'>
56
+            <view className='Icon'>
57
+              <Image mode='scaleToFill' src={getImgURL(person?.userPhoto || person?.avatarurl)}></Image>
58
+            </view>
59
+            <text>{person?.name}</text>
60
+          </view>
61
+          <Image mode='widthFix' src={QrCodeUrl} onClick={PreviewImage}></Image>
62
+          <text>扫一扫上面的二维码图案,成为我的客户</text>
63
+        </view>
64
+      </view>
65
+      <view className='Btn'>
66
+        <text onClick={Save}>保存到手机</text>
67
+      </view>
28 68
     </view>
29 69
   )
30 70
 })

+ 59
- 10
src/pages/mine/myRecommendCode/index.scss View File

@@ -4,16 +4,65 @@
4 4
   height: 100%;
5 5
   position: relative;
6 6
   overflow: hidden;
7
-  >image {
8
-    width: 50%;
9
-    display: block;
10
-    height: auto;
11
-    margin: 100px auto 0;
7
+  >.CodeContent {
8
+    padding: 30px;
9
+    position: relative;
10
+    overflow: hidden;
11
+    >view {
12
+      padding: 30px;
13
+      position: relative;
14
+      overflow: hidden;
15
+      background: #fff;
16
+      border-radius: 16px;
17
+      box-shadow: 0 0 6px 6px rgba(0, 0, 0, 0.03);
18
+      >.flex-h {
19
+        align-items: center;
20
+        >.Icon {
21
+          width: 80px;
22
+          height: 80px;
23
+          border-radius: 6px;
24
+          position: relative;
25
+          overflow: hidden;
26
+          background: #eee;
27
+          >image {
28
+            width: 100%;
29
+            height: 100%;
30
+          }
31
+        }
32
+        >text {
33
+          font-size: 28px;
34
+          margin-left: 40px;
35
+        }
36
+      }
37
+      >image {
38
+        width: 80%;
39
+        height: auto;
40
+        display: block;
41
+        margin: 60px auto 0;
42
+      }
43
+      >text {
44
+        display: block;
45
+        text-align: center;
46
+        font-size: 30px;
47
+        margin-top: 40px;
48
+      }
49
+    }
12 50
   }
13
-  >text {
14
-    display: block;
15
-    text-align: center;
16
-    font-size: 30px;
17
-    margin-top: 40px;
51
+  >.Btn {
52
+    position: relative;
53
+    overflow: hidden;
54
+    margin-top: 60px;
55
+    >text {
56
+      display: block;
57
+      font-size: 28px;
58
+      color: #fff;
59
+      line-height: 80px;
60
+      text-align: center;
61
+      background: #193c83;
62
+      border-radius: 10px;
63
+      width: 50%;
64
+      max-width: 360px;
65
+      margin: 0 auto;
66
+    }
18 67
   }
19 68
 }

+ 1
- 1
src/pages/mine/toBeAgent/index.jsx View File

@@ -17,7 +17,7 @@ export default withLayout(() => {
17 17
     if (Code !== '') {
18 18
       fetch({ url: `${API_REGISTER_AGENT}?channelCode=${Code}`, method: 'put' }).then(() => {
19 19
         Taro.showToast({ title: '绑定成功', icon: 'none', duration: 2000 })
20
-        dispatch({ type: UPDATE_USER_INFO, payload: { personType: 'estate agent' } })
20
+        dispatch({ type: UPDATE_USER_INFO, payload: { personType: 'channel agent' } })
21 21
         setTimeout(() => {
22 22
           Taro.navigateBack({ delta: 1 })
23 23
         }, 1200)

+ 26
- 8
src/pages/mine/userInfo/index.jsx View File

@@ -2,7 +2,7 @@ import { useState, useEffect } from 'react'
2 2
 import Taro from '@tarojs/taro'
3 3
 import { useSelector } from 'react-redux'
4 4
 import withLayout from '@/layout'
5
-import { ScrollView, Input, Image } from '@tarojs/components'
5
+import { ScrollView, Input, Image, Block, Textarea } from '@tarojs/components'
6 6
 import { getImgURL } from '@/utils/image'
7 7
 import { fetch, uploadFiles } from '@/utils/request'
8 8
 import { UPDATE_USER_INFO, ROLE_CODE } from '@/constants/user'
@@ -20,29 +20,35 @@ export default withLayout(() => {
20 20
   const [UserRole, setUserRole] = useState(null) // 1-普通用户 2-经纪人 3-置业顾问 4-驻场管理
21 21
   const [FormData, setFormData] = useState({
22 22
     name: '',
23
-    phone: ''
23
+    phone: '',
24
+    description: ''
24 25
   })
25 26
 
26 27
   useEffect(() => {
27 28
     if (user?.userInfo?.person?.personId) {
28 29
       const person = user.userInfo.person
29
-      setUserRole(person.personType === ROLE_CODE.CUSTOMER || person.personType === ROLE_CODE.DRIFT ? 1 : person.personType === ROLE_CODE.CHANNEL_AGENT ? 2 : person.personType === ROLE_CODE.CONSULTANT ? 3 : 4)
30
+      setUserRole(person.personType === ROLE_CODE.CHANNEL_AGENT ? 2 : person.personType === ROLE_CODE.CONSULTANT ? 3 : person.personType === ROLE_CODE.MARKETING ? 4 : 1)
30 31
     }
31 32
   }, [user])
32 33
 
33 34
   useEffect(() => {
34 35
     setUserInfo(user?.userInfo?.person)
35
-    console.log(user)
36
-    setFormData({ name: user?.userInfo?.person.name, phone: user?.userInfo?.person.phone })
36
+    setFormData({ name: user?.userInfo?.person.name, phone: user?.userInfo?.person.phone, description: user?.userInfo?.person.description })
37 37
   }, [user])
38 38
 
39 39
   const Save = () => {
40
-    fetch({ url: `${API_EDIT_AGENT}?name=${FormData.name}&phone=${FormData.phone}`, method: 'put' }).then(() => {
40
+    let params = ''
41
+    if(UserRole === 3) {
42
+      params = `name=${FormData.name}&phone=${FormData.phone}&description=${FormData.description}`
43
+    } else {
44
+      params = `name=${FormData.name}&phone=${FormData.phone}`
45
+    }
46
+    fetch({ url: `${API_EDIT_AGENT}?${params}`, method: 'put' }).then(() => {
41 47
       Taro.showToast({
42 48
         title: '修改成功',
43 49
         icon: 'none'
44 50
       })
45
-      dispatch({ type: UPDATE_USER_INFO, payload: { name: FormData.name, phone: FormData.phone } })
51
+      dispatch({ type: UPDATE_USER_INFO, payload: { name: FormData.name, phone: FormData.phone, description: FormData.description } })
46 52
       // login({ path: '', scene: '' })
47 53
     })
48 54
   }
@@ -54,7 +60,7 @@ export default withLayout(() => {
54 60
   }
55 61
 
56 62
   const ToUploadImg = () => {
57
-    if(UserRole - 0 === 3) {
63
+    if (UserRole - 0 === 3) {
58 64
       Taro.chooseImage({
59 65
         count: 1,
60 66
         success: function (res) {
@@ -103,6 +109,18 @@ export default withLayout(() => {
103 109
             </view>
104 110
           </view>
105 111
 
112
+          {
113
+            true &&
114
+            <Block>
115
+              <text>简介</text>
116
+              <view className='FormLine flex-h'>
117
+                <view className='flex-item'>
118
+                  <Textarea auto-height placeholder='请输入简介' value={FormData.description} onInput={FormChange.bind(this, 'description')} />
119
+                </view>
120
+              </view>
121
+            </Block>
122
+          }
123
+
106 124
         </view>
107 125
 
108 126
         <view className='Btn'>

+ 5
- 0
src/pages/mine/userInfo/index.scss View File

@@ -45,6 +45,11 @@
45 45
             line-height: 40px;
46 46
             height: 40px;
47 47
           }
48
+          >textarea {
49
+            font-size: 26px;
50
+            display: block;
51
+            width: 100%;
52
+          }
48 53
           >text {
49 54
             display: block;
50 55
             width: 100%;