瀏覽代碼

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

张延森 3 年之前
父節點
當前提交
97748ba662

+ 2
- 2
config/dev.js 查看文件

3
     NODE_ENV: '"development"'
3
     NODE_ENV: '"development"'
4
   },
4
   },
5
   defineConstants: {
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
     // HOST: '"http://127.0.0.1:8567"',
8
     // HOST: '"http://127.0.0.1:8567"',
9
     WSS_HOST: '"wss://www.newhousehold.cn"',
9
     WSS_HOST: '"wss://www.newhousehold.cn"',
10
     // WSS_HOST: '"wss://xlk.njyz.tech"',
10
     // WSS_HOST: '"wss://xlk.njyz.tech"',

+ 1
- 1
project.config.json 查看文件

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

+ 0
- 1
src/pages/index/buildingList/index.jsx 查看文件

147
     for (let key in e) {
147
     for (let key in e) {
148
       Data[key] = e[key]
148
       Data[key] = e[key]
149
     }
149
     }
150
-    console.log(Data)
151
     setFilterData({...Data})
150
     setFilterData({...Data})
152
   }
151
   }
153
 
152
 

+ 11
- 1
src/pages/index/components/LiveSale/index.jsx 查看文件

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
   return (
48
   return (
39
     <view className='components LiveSale'>
49
     <view className='components LiveSale'>
40
       <view>
50
       <view>
50
             {
60
             {
51
               PageList.map((item, index) => (
61
               PageList.map((item, index) => (
52
                 <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'}}>
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
                 </view>
64
                 </view>
55
               ))
65
               ))
56
             }
66
             }

+ 1
- 0
src/pages/index/helpToFindHouse/index.jsx 查看文件

59
 
59
 
60
         params.push({ ...item, key: 'minPrice', result: CurrentDemandId === 2 ? min : min * 10000 })
60
         params.push({ ...item, key: 'minPrice', result: CurrentDemandId === 2 ? min : min * 10000 })
61
         params.push({ ...item, key: 'maxPrice', result: CurrentDemandId === 2 ? max : max * 10000 })
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
       } else {
63
       } else {
63
         if (CurrentDemandId === 1) {
64
         if (CurrentDemandId === 1) {
64
           if (item.key === 'area') {
65
           if (item.key === 'area') {

+ 2
- 2
src/pages/mine/components/EditUserDetailBasicInfo/index.jsx 查看文件

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

+ 4
- 2
src/pages/mine/customerDetail/index.jsx 查看文件

85
     if (CustomerId) {
85
     if (CustomerId) {
86
       UpdateCustomerInfo()
86
       UpdateCustomerInfo()
87
 
87
 
88
-      getCustomerDetail(CustomerId).then((res) => setCustBaseInfo(res || {}))
88
+      getCustomerDetail(CustomerId).then((res) => {
89
+        setCustBaseInfo(res || {})
90
+      })
89
     }
91
     }
90
   }, [CustomerId])
92
   }, [CustomerId])
91
 
93
 
148
           {/* 基本信息 */}
150
           {/* 基本信息 */}
149
           {
151
           {
150
             CurrentMenuId === 1 &&
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
 
34
 
35
 
35
 
36
   const GetLiveList = (params) => {
36
   const GetLiveList = (params) => {
37
-    if (['all', 'new'].indexOf(CurrnetMenuId) > -1) {
38
-      // 全部与新房用的一个接口
37
+    if (['all'].indexOf(CurrnetMenuId) > -1) {
38
+      // 全部
39
       fetch({ url: API_LIVE_LIST, payload: { ...params, cityId: city.id }, spin: true }).then((res) => {
39
       fetch({ url: API_LIVE_LIST, payload: { ...params, cityId: city.id }, spin: true }).then((res) => {
40
         setPageList(res.records || [])
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
     } else if (['notice', 'live'].indexOf(CurrnetMenuId) > -1) {
47
     } else if (['notice', 'live'].indexOf(CurrnetMenuId) > -1) {
43
       // 预告与直播是虽然是同一个接口, 但是返回值字段不一样
48
       // 预告与直播是虽然是同一个接口, 但是返回值字段不一样
44
       const process = 'notice' === CurrnetMenuId ? 1 : 2;
49
       const process = 'notice' === CurrnetMenuId ? 1 : 2;

+ 77
- 39
src/pages/video/liveDetail/index.jsx 查看文件

4
 import withLayout from "@/layout";
4
 import withLayout from "@/layout";
5
 import { Image } from "@tarojs/components";
5
 import { Image } from "@tarojs/components";
6
 import { queryLiveDetail } from "@/services/item";
6
 import { queryLiveDetail } from "@/services/item";
7
+import { fetch } from '@/utils/request'
8
+import { API_VIDEO_DETAIL } from '@/constants/api'
7
 import useParams from "@/utils/hooks/useParams";
9
 import useParams from "@/utils/hooks/useParams";
8
 import useShare from "@/utils/hooks/useShare";
10
 import useShare from "@/utils/hooks/useShare";
9
 import { getImgURL } from "@/utils/image";
11
 import { getImgURL } from "@/utils/image";
13
 
15
 
14
 export default withLayout((props) => {
16
 export default withLayout((props) => {
15
   const { router, shareContent, trackData, person, page, setNavigationBarTitle } = props;
17
   const { router, shareContent, trackData, person, page, setNavigationBarTitle } = props;
16
-  const { id } = router.params;
18
+  const { id, type } = router.params;
17
 
19
 
18
   const [data, setData] = useState({})
20
   const [data, setData] = useState({})
21
+  const [CanPlay, setCanPlay] = useState(false)
19
   // 直播间信息
22
   // 直播间信息
20
   const livingRef = useRef()
23
   const livingRef = useRef()
21
 
24
 
38
   );
41
   );
39
 
42
 
40
   const getData = () => {
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
   useEffect(() => {
64
   useEffect(() => {
61
     }
72
     }
62
   }, [trackData, data])
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
   useEffect(() => {
117
   useEffect(() => {
100
   }, [id]);
121
   }, [id]);
101
   //   
122
   //   
102
   return <view className="liveDetail">
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
       <view className='liveDetail-menu flex-h'>
142
       <view className='liveDetail-menu flex-h'>
105
         <view className='flex-item'>
143
         <view className='flex-item'>
106
           <view onClick={() => { Taro.navigateTo({ url: `/pages/index/buildingDetail/index?id=${data.buildingId}` }) }}><text className="iconfont icon-fenxiang"></text><text>查看楼盘</text></view>
144
           <view onClick={() => { Taro.navigateTo({ url: `/pages/index/buildingDetail/index?id=${data.buildingId}` }) }}><text className="iconfont icon-fenxiang"></text><text>查看楼盘</text></view>
107
         </view>
145
         </view>
108
         <view className='flex-item'>
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
         </view>
148
         </view>
111
         <view className='flex-item'>
149
         <view className='flex-item'>
112
           <button openType="share"><text className="iconfont icon-fenxiang"></text><text>分享好友</text></button>
150
           <button openType="share"><text className="iconfont icon-fenxiang"></text><text>分享好友</text></button>

+ 14
- 0
src/pages/video/liveDetail/index.scss 查看文件

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
     { name: '7天未成交', id: 7 },
26
     { name: '7天未成交', id: 7 },
27
     { name: '15天未成交', id: 15 }
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
   useEffect(() => {
32
   useEffect(() => {
32
     GetPageList()
33
     GetPageList()
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
   const CutTime = (item) => {
70
   const CutTime = (item) => {
63
     return () => {
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
                 <view key={`TimeItem-${index}`} onClick={CutTime(item)}>
135
                 <view key={`TimeItem-${index}`} onClick={CutTime(item)}>
121
                   <text>{item.name}</text>
136
                   <text>{item.name}</text>
122
                   {
137
                   {
123
-                    FormData.day === item.id &&
138
+                    TimeMenuId === item.id &&
124
                     <Image mode='widthFix' src={require('@/assets/findHouse-icon1.png')}></Image>
139
                     <Image mode='widthFix' src={require('@/assets/findHouse-icon1.png')}></Image>
125
                   }
140
                   }
126
                 </view>
141
                 </view>

+ 9
- 8
src/subpackages/pages/consultant/customerAnalyse/index.jsx 查看文件

2
 import withLayout from '@/layout'
2
 import withLayout from '@/layout'
3
 import '@/assets/css/iconfont.css'
3
 import '@/assets/css/iconfont.css'
4
 import { ScrollView } from '@tarojs/components'
4
 import { ScrollView } from '@tarojs/components'
5
-import { useSelector } from 'react-redux'
6
 import { fetch } from '@/utils/request'
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
 import LineChart from './components/LineChart'
7
 import LineChart from './components/LineChart'
9
 // import dayjs from 'dayjs'
8
 // import dayjs from 'dayjs'
10
 import './index.scss'
9
 import './index.scss'
33
   const [source, setSource] = useState([])
32
   const [source, setSource] = useState([])
34
 
33
 
35
   useEffect(() => {
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
   useEffect(() => {
42
   useEffect(() => {
42
-    if(!ChartList.length) {
43
+    if (!ChartList.length) {
43
       GetChartInfo()
44
       GetChartInfo()
44
     } else {
45
     } else {
45
       // const chart = echarts.init(canvas, null, { width: '100%', height: '100%' })
46
       // const chart = echarts.init(canvas, null, { width: '100%', height: '100%' })
61
   }
62
   }
62
 
63
 
63
   const GetChartInfo = () => {
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
       const Arr = (res || []).reverse()
66
       const Arr = (res || []).reverse()
66
       setChartList(Arr.map(x => ({ name: x.day, value: x.customerNum })))
67
       setChartList(Arr.map(x => ({ name: x.day, value: x.customerNum })))
67
       setSource(Arr)
68
       setSource(Arr)