Преглед на файлове

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

张延森 преди 3 години
родител
ревизия
97748ba662

+ 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: '"https://www.newhousehold.cn"',
6
+    // HOST: '"https://xlk.njyz.tech"',
7
+    HOST: '"https://www.newhousehold.cn"',
8 8
     // HOST: '"http://127.0.0.1:8567"',
9 9
     WSS_HOST: '"wss://www.newhousehold.cn"',
10 10
     // WSS_HOST: '"wss://xlk.njyz.tech"',

+ 1
- 1
project.config.json Целия файл

@@ -27,7 +27,7 @@
27 27
 			"outputPath": ""
28 28
 		},
29 29
 		"useIsolateContext": true,
30
-		"useCompilerModule": true,
30
+		"useCompilerModule": false,
31 31
 		"userConfirmedUseCompilerModuleSwitch": false
32 32
 	},
33 33
 	"compileType": "miniprogram",

+ 0
- 1
src/pages/index/buildingList/index.jsx Целия файл

@@ -147,7 +147,6 @@ export default withLayout((props) => {
147 147
     for (let key in e) {
148 148
       Data[key] = e[key]
149 149
     }
150
-    console.log(Data)
151 150
     setFilterData({...Data})
152 151
   }
153 152
 

+ 11
- 1
src/pages/index/components/LiveSale/index.jsx Целия файл

@@ -35,6 +35,16 @@ export default function LiveSale (props) {
35 35
     }
36 36
   }
37 37
 
38
+  const toDetail = (item) => {
39
+    return () => {
40
+      if(item.type === 'live') {
41
+        Taro.navigateTo({ url: `/pages/video/liveDetail/index?id=${item.id}&type=${item.type}` })
42
+      } else {
43
+        Taro.navigateTo({ url: `/pages/video/videoDetail/index?id=${item.id}` })
44
+      }
45
+    }
46
+  }
47
+
38 48
   return (
39 49
     <view className='components LiveSale'>
40 50
       <view>
@@ -50,7 +60,7 @@ export default function LiveSale (props) {
50 60
             {
51 61
               PageList.map((item, index) => (
52 62
                 <view className='ListItem' key={`List-${index}`} style={{display: CurrentId === 1 || (CurrentId === 2 && item.kind === 'notice') || (CurrentId === 3 && item.kind === 'live')  || (CurrentId === 4 && item.kind !== 'notice') ? 'inline-block' : 'none'}}>
53
-                  <Image mode='aspectFill' className='centerLabel' onClick={()=>{Taro.navigateTo({ url: `/pages/video/liveDetail/index?id=${item.id}` })}} src={`${getImgURL(item.images)}`} />
63
+                  <Image mode='aspectFill' className='centerLabel' onClick={toDetail(item)} src={`${getImgURL(item.images)}`} />
54 64
                 </view>
55 65
               ))
56 66
             }

+ 1
- 0
src/pages/index/helpToFindHouse/index.jsx Целия файл

@@ -59,6 +59,7 @@ export default withLayout((props) => {
59 59
 
60 60
         params.push({ ...item, key: 'minPrice', result: CurrentDemandId === 2 ? min : min * 10000 })
61 61
         params.push({ ...item, key: 'maxPrice', result: CurrentDemandId === 2 ? max : max * 10000 })
62
+        params.push({ ...item, key: 'price', result: CurrentDemandId === 2 ? price : price * 10000 })
62 63
       } else {
63 64
         if (CurrentDemandId === 1) {
64 65
           if (item.key === 'area') {

+ 2
- 2
src/pages/mine/components/EditUserDetailBasicInfo/index.jsx Целия файл

@@ -1,7 +1,7 @@
1 1
 import { useState, useEffect } from 'react'
2 2
 import { ScrollView, Input, Picker } from '@tarojs/components'
3 3
 import { fetch } from '@/utils/request'
4
-import { API_SAVE_CUSTOMER_INFO } from '@/constants/api'
4
+import { API_RECOMMEND_EDIT } from '@/constants/api'
5 5
 import Taro from '@tarojs/taro'
6 6
 import './index.scss'
7 7
 
@@ -37,7 +37,7 @@ export default function EditUserDetailBasicInfo (props) {
37 37
 
38 38
   const ToSubmit = () => {
39 39
     let params = { ...FormData, customerId: CustomerId }
40
-    let url = Data.customerId ? `${API_SAVE_CUSTOMER_INFO}/${Data.customerId}` : API_SAVE_CUSTOMER_INFO
40
+    let url = Data.customerId ? `${API_RECOMMEND_EDIT}/${Data.customerId}` : API_RECOMMEND_EDIT
41 41
     fetch({ url, method: Data.customerId ? 'put' : 'post', payload: params }).then(() => {
42 42
       Taro.showToast({ title: '修改成功', icon: 'none', duration: 2000 })
43 43
       close()

+ 4
- 2
src/pages/mine/customerDetail/index.jsx Целия файл

@@ -85,7 +85,9 @@ export default withLayout((props) => {
85 85
     if (CustomerId) {
86 86
       UpdateCustomerInfo()
87 87
 
88
-      getCustomerDetail(CustomerId).then((res) => setCustBaseInfo(res || {}))
88
+      getCustomerDetail(CustomerId).then((res) => {
89
+        setCustBaseInfo(res || {})
90
+      })
89 91
     }
90 92
   }, [CustomerId])
91 93
 
@@ -148,7 +150,7 @@ export default withLayout((props) => {
148 150
           {/* 基本信息 */}
149 151
           {
150 152
             CurrentMenuId === 1 &&
151
-            <UserDetailBasicInfo CustomerId={CustomerId} CustomerInfo={CustomerInfo} AddFollow={AddFollow} Update={UpdateCustomerInfo}></UserDetailBasicInfo>
153
+            <UserDetailBasicInfo CustomerId={CustomerId} CustomerInfo={{...CustomerInfo, ...custBaseInfo}} AddFollow={AddFollow} Update={UpdateCustomerInfo}></UserDetailBasicInfo>
152 154
           }
153 155
 
154 156
           {/* 访问记录 */}

+ 7
- 2
src/pages/video/index.jsx Целия файл

@@ -34,11 +34,16 @@ export default withLayout((props) => {
34 34
 
35 35
 
36 36
   const GetLiveList = (params) => {
37
-    if (['all', 'new'].indexOf(CurrnetMenuId) > -1) {
38
-      // 全部与新房用的一个接口
37
+    if (['all'].indexOf(CurrnetMenuId) > -1) {
38
+      // 全部
39 39
       fetch({ url: API_LIVE_LIST, payload: { ...params, cityId: city.id }, spin: true }).then((res) => {
40 40
         setPageList(res.records || [])
41 41
       })
42
+    } else if (['new'].indexOf(CurrnetMenuId) > -1) {
43
+      // 新房
44
+      fetch({ url: API_LIVE_LIST, payload: { ...params, cityId: city.id, newHouse: true }, spin: true }).then((res) => {
45
+        setPageList(res.records || [])
46
+      })
42 47
     } else if (['notice', 'live'].indexOf(CurrnetMenuId) > -1) {
43 48
       // 预告与直播是虽然是同一个接口, 但是返回值字段不一样
44 49
       const process = 'notice' === CurrnetMenuId ? 1 : 2;

+ 77
- 39
src/pages/video/liveDetail/index.jsx Целия файл

@@ -4,6 +4,8 @@ import { savePoint } from '@/services/common'
4 4
 import withLayout from "@/layout";
5 5
 import { Image } from "@tarojs/components";
6 6
 import { queryLiveDetail } from "@/services/item";
7
+import { fetch } from '@/utils/request'
8
+import { API_VIDEO_DETAIL } from '@/constants/api'
7 9
 import useParams from "@/utils/hooks/useParams";
8 10
 import useShare from "@/utils/hooks/useShare";
9 11
 import { getImgURL } from "@/utils/image";
@@ -13,9 +15,10 @@ import "./index.scss";
13 15
 
14 16
 export default withLayout((props) => {
15 17
   const { router, shareContent, trackData, person, page, setNavigationBarTitle } = props;
16
-  const { id } = router.params;
18
+  const { id, type } = router.params;
17 19
 
18 20
   const [data, setData] = useState({})
21
+  const [CanPlay, setCanPlay] = useState(false)
19 22
   // 直播间信息
20 23
   const livingRef = useRef()
21 24
 
@@ -38,16 +41,24 @@ export default withLayout((props) => {
38 41
   );
39 42
 
40 43
   const getData = () => {
41
-    queryLiveDetail(id).then(res => {
42
-      setData(res||{})
43
-      setNavigationBarTitle(res?.name)
44
-      if (res?.liveRoomParam) {
45
-        const { livingid } = JSON.parse(res.liveRoomParam)
46
-        getLivingCode(livingid).then((liveInfo) => {
47
-          livingRef.current = liveInfo
48
-        })
49
-      }
50
-    })
44
+    if(type === 'live') { // 直播
45
+      queryLiveDetail(id).then(res => {
46
+        setData(res||{})
47
+        setNavigationBarTitle(res?.name)
48
+        if (res?.liveRoomParam) {
49
+          const { livingid } = JSON.parse(res.liveRoomParam)
50
+          getLivingCode(livingid).then((liveInfo) => {
51
+            livingRef.current = liveInfo
52
+          })
53
+        }
54
+      })
55
+    } else { // 视频
56
+      fetch({url: `${API_VIDEO_DETAIL}/${id}`, method: 'get'}).then((res) => {
57
+        setData(res||{})
58
+        setNavigationBarTitle(res?.name)
59
+        livingRef.current = res
60
+      })
61
+    }
51 62
   };
52 63
 
53 64
   useEffect(() => {
@@ -61,36 +72,46 @@ export default withLayout((props) => {
61 72
     }
62 73
   }, [trackData, data])
63 74
 
64
-  const handleLive = () => {
65
-    if (!livingRef.current) {
66
-      Taro.showToast({
67
-        title: '查询直播凭证失败, 请退出重试',
68
-        icon: 'none',
69
-      })
70
-      return;
75
+  const ended = () => {
76
+    return () => {
77
+      setCanPlay(false)
71 78
     }
79
+  }
72 80
 
73
-    // https://work.weixin.qq.com/api/doc/90000/90135/93635
74
-    const { livingCode, status } = livingRef.current
75
-
76
-    //
77
-    if (status >= 3) {
78
-      Taro.showToast({
79
-        title: `直播活动已${status === 3 ? '过期' : '取消'}`,
80
-        icon: 'none',
81
+  const handleLive = () => {
82
+    if(type === 'live') {
83
+      if (!livingRef.current) {
84
+        Taro.showToast({
85
+          title: '查询直播凭证失败, 请退出重试',
86
+          icon: 'none',
87
+        })
88
+        return;
89
+      }
90
+  
91
+      // https://work.weixin.qq.com/api/doc/90000/90135/93635
92
+      const { livingCode, status } = livingRef.current
93
+  
94
+      //
95
+      if (status >= 3) {
96
+        Taro.showToast({
97
+          title: `直播活动已${status === 3 ? '过期' : '取消'}`,
98
+          icon: 'none',
99
+        })
100
+        return;
101
+      }
102
+  
103
+      // 如果已经结束的则播放回放
104
+      const replay = status === 2 ? '&replay=1' : ''
105
+  
106
+      // 跳转到直播
107
+      Taro.navigateToMiniProgram({
108
+        // 固定跳转到微信企业直播
109
+        appId: 'wx7424030d69bde86e',
110
+        path: `pages/watch/index?living_code=${encodeURIComponent(livingCode)}${replay}`,
81 111
       })
82
-      return;
112
+    } else {
113
+      setCanPlay(true)
83 114
     }
84
-
85
-    // 如果已经结束的则播放回放
86
-    const replay = status === 2 ? '&replay=1' : ''
87
-
88
-    // 跳转到直播
89
-    Taro.navigateToMiniProgram({
90
-      // 固定跳转到微信企业直播
91
-      appId: 'wx7424030d69bde86e',
92
-      path: `pages/watch/index?living_code=${encodeURIComponent(livingCode)}${replay}`,
93
-    })
94 115
   }
95 116
 
96 117
   useEffect(() => {
@@ -100,13 +121,30 @@ export default withLayout((props) => {
100 121
   }, [id]);
101 122
   //   
102 123
   return <view className="liveDetail">
103
-    {data.liveActivityId && <><Image mode='aspectFill' src={getImgURL(data.detailTypeImg)} className='liveImg'></Image>
124
+    {
125
+      type === 'video' && data.videoUrl && CanPlay &&
126
+      <view className="myVideo">
127
+        <video 
128
+          src={data.videoUrl}
129
+          enable-danmu 
130
+          danmu-btn 
131
+          show-center-play-btn={false}
132
+          show-play-btn
133
+          controls
134
+          autoplay
135
+          onended={ended()}
136
+          picture-in-picture-mode={['push', 'pop']}
137
+          object-fit='contain'
138
+        ></video>
139
+      </view>
140
+    }
141
+    {(data.liveActivityId || data.videoId) && <><Image mode='aspectFill' src={getImgURL(data.detailTypeImg || data.videImg)} className='liveImg'></Image>
104 142
       <view className='liveDetail-menu flex-h'>
105 143
         <view className='flex-item'>
106 144
           <view onClick={() => { Taro.navigateTo({ url: `/pages/index/buildingDetail/index?id=${data.buildingId}` }) }}><text className="iconfont icon-fenxiang"></text><text>查看楼盘</text></view>
107 145
         </view>
108 146
         <view className='flex-item'>
109
-          <view onClick={handleLive}><text className="iconfont icon-camera"></text><text>观看直播</text></view>
147
+          <view onClick={handleLive}><text className="iconfont icon-camera"></text><text>观看{type === 'live' ? '直播' : '视频'}</text></view>
110 148
         </view>
111 149
         <view className='flex-item'>
112 150
           <button openType="share"><text className="iconfont icon-fenxiang"></text><text>分享好友</text></button>

+ 14
- 0
src/pages/video/liveDetail/index.scss Целия файл

@@ -40,4 +40,18 @@
40 40
       }
41 41
     }
42 42
   }
43
+  >.myVideo{
44
+    width: 100vw;
45
+    height: 100vh;
46
+    position: fixed;
47
+    left: 0;
48
+    top: 0;
49
+    bottom: 0;
50
+    display: block;
51
+    z-index: 100;
52
+    >video {
53
+      width: 100%;
54
+      height: 100%;
55
+    }
56
+  }
43 57
 }

+ 18
- 3
src/subpackages/pages/consultant/components/FollowCustomer/index.jsx Целия файл

@@ -26,7 +26,8 @@ export default function FollowCustomer () {
26 26
     { name: '7天未成交', id: 7 },
27 27
     { name: '15天未成交', id: 15 }
28 28
   ])
29
-  const [FormData, setFormData] = useState({name: '', status: 0, day: 1})
29
+  const [TimeMenuId, setTimeMenuId] = useState(1)
30
+  const [FormData, setFormData] = useState({name: '', status: 0, startReportDate: '', endReportDate: ''})
30 31
 
31 32
   useEffect(() => {
32 33
     GetPageList()
@@ -59,9 +60,23 @@ export default function FollowCustomer () {
59 60
     }
60 61
   }
61 62
 
63
+  const DateFormat = (date) => {
64
+      const Year = new Date(date).getFullYear()
65
+      const Month = new Date(date).getMonth() + 1
66
+      const Day = new Date(date).getDate()
67
+      return `${Year}-${Month > 9 ? Month : `0${Month}`}-${Day > 9 ? Day : `0${Day}`}`
68
+  }
69
+
62 70
   const CutTime = (item) => {
63 71
     return () => {
64
-      setFormData({...FormData, day: item.id})
72
+      let params = {}
73
+      if(item.id - 0 !== 1) {
74
+        params = {...FormData, startReportDate: DateFormat(Date.now() - 1000 * 60 * 60 * 24 * (item.id - 0)), endReportDate: DateFormat(Date.now())}
75
+      } else {
76
+        params = {...FormData, startReportDate: '', endReportDate: ''}
77
+      }
78
+      setFormData(params)
79
+      setTimeMenuId(item.id)
65 80
     }
66 81
   }
67 82
 
@@ -120,7 +135,7 @@ export default function FollowCustomer () {
120 135
                 <view key={`TimeItem-${index}`} onClick={CutTime(item)}>
121 136
                   <text>{item.name}</text>
122 137
                   {
123
-                    FormData.day === item.id &&
138
+                    TimeMenuId === item.id &&
124 139
                     <Image mode='widthFix' src={require('@/assets/findHouse-icon1.png')}></Image>
125 140
                   }
126 141
                 </view>

+ 9
- 8
src/subpackages/pages/consultant/customerAnalyse/index.jsx Целия файл

@@ -2,9 +2,8 @@ import { useState, useEffect } from 'react'
2 2
 import withLayout from '@/layout'
3 3
 import '@/assets/css/iconfont.css'
4 4
 import { ScrollView } from '@tarojs/components'
5
-import { useSelector } from 'react-redux'
6 5
 import { fetch } from '@/utils/request'
7
-import { API_SEX_INFO, API_ECHERTS_DAILY } from '@/constants/api'
6
+import { API_SEX_INFO, API_ECHERTS_DAILY, API_ECHERTS_MONTH } from '@/constants/api'
8 7
 import LineChart from './components/LineChart'
9 8
 // import dayjs from 'dayjs'
10 9
 import './index.scss'
@@ -33,13 +32,15 @@ export default withLayout((props) => {
33 32
   const [source, setSource] = useState([])
34 33
 
35 34
   useEffect(() => {
36
-    setChartList([])
37
-    GetSexInfo()
38
-    GetChartInfo()
39
-  }, [CurrentMenuId])
35
+    if (CurrentChartMenuId && CurrentMenuId) {
36
+      setChartList([])
37
+      GetSexInfo()
38
+      GetChartInfo()
39
+    }
40
+  }, [CurrentChartMenuId, CurrentMenuId])
40 41
 
41 42
   useEffect(() => {
42
-    if(!ChartList.length) {
43
+    if (!ChartList.length) {
43 44
       GetChartInfo()
44 45
     } else {
45 46
       // const chart = echarts.init(canvas, null, { width: '100%', height: '100%' })
@@ -61,7 +62,7 @@ export default withLayout((props) => {
61 62
   }
62 63
 
63 64
   const GetChartInfo = () => {
64
-    fetch({ url: `${API_ECHERTS_DAILY}/${CurrentMenuId === 1 ? 'new' : CurrentMenuId === 2 ? 'follow' : 'visite'}`, method: 'get' }).then((res) => {
65
+    fetch({ url: `${CurrentChartMenuId === 1 ? API_ECHERTS_DAILY : API_ECHERTS_MONTH}/${CurrentMenuId === 1 ? 'new' : CurrentMenuId === 2 ? 'follow' : 'visite'}`, method: 'get' }).then((res) => {
65 66
       const Arr = (res || []).reverse()
66 67
       setChartList(Arr.map(x => ({ name: x.day, value: x.customerNum })))
67 68
       setSource(Arr)