1002884655 hace 3 años
padre
commit
2faca339cd
Se han modificado 3 ficheros con 8 adiciones y 8 borrados
  1. 2
    2
      config/dev.js
  2. 4
    4
      src/components/ProjectListItem/index.jsx
  3. 2
    2
      src/pages/mine/myShare/index.jsx

+ 2
- 2
config/dev.js Ver fichero

@@ -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: '"wss://xlk.njyz.tech"',
9 9
     OSS_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
10 10
     OSS_FAST_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',

+ 4
- 4
src/components/ProjectListItem/index.jsx Ver fichero

@@ -12,9 +12,9 @@ export default function ProjectListItem (props) {
12 12
     <view className='components ProjectListItem flex-h' onClick={() => { Taro.navigateTo({ url: `/pages/index/buildingDetail/index?id=${Data.buildingId}` }) }}>
13 13
       <view className='Img'>
14 14
         <view>
15
-          <Image mode='aspectFill' className='centerLabel' src={getImgURL(Data.buildingListImg?.length ? Data.buildingListImg[0].url : null)} />
15
+          <Image mode='aspectFill' className='centerLabel' src={getImgURL((Data?.buildingListImg || []).length ? Data.buildingListImg[0].url : null)} />
16 16
           {
17
-            Data.panoramaList.length > 0 &&
17
+            (Data?.panoramaList || []).length > 0 &&
18 18
             <Image mode='heightFix' className='Tips Vr' src={require('@/assets/index-icon18.png')} />
19 19
           }
20 20
           {
@@ -44,14 +44,14 @@ export default function ProjectListItem (props) {
44 44
           <text>{Data.shareNum || 299 + Math.floor(Math.random() * 10)}次分享</text>
45 45
           <view className='Users'>
46 46
             {
47
-              (uvList.records || []).slice(0, 3).map((item, index) => (
47
+              (uvList?.records || []).slice(0, 3).map((item, index) => (
48 48
                 <view key={`uv-${index}`}>
49 49
                   <Image mode='aspectFill' className='centerLabel' src={item.photoOravatar} />
50 50
                 </view>
51 51
               ))
52 52
             }
53 53
           </view>
54
-          <text>{uvList.records.length > 0 ? '...' : ''}{Data.pvNum || 299 + Math.floor(Math.random() * 10)}人围观</text>
54
+          <text>{(uvList?.records || []).length > 0 ? '...' : ''}{Data.pvNum || 299 + Math.floor(Math.random() * 10)}人围观</text>
55 55
         </view>
56 56
       </view>
57 57
     </view>

+ 2
- 2
src/pages/mine/myShare/index.jsx Ver fichero

@@ -5,8 +5,8 @@ import '@/assets/css/iconfont.css'
5 5
 import { useSelector } from 'react-redux'
6 6
 import { fetch } from '@/utils/request'
7 7
 import { API_SHARE_LIST } from '@/constants/api'
8
+import ProjectListItem from '@/components/ProjectListItem/index'
8 9
 import './index.scss'
9
-import MyShareListItem from '../components/MyShareListItem/index'
10 10
 
11 11
 export default withLayout(() => {
12 12
 
@@ -66,7 +66,7 @@ export default withLayout(() => {
66 66
           <view className='List'>
67 67
             {
68 68
               PageList.map((item, index) => (
69
-                <MyShareListItem Data={item} key={`MyShareListItem-${index}`}></MyShareListItem>
69
+                <ProjectListItem Data={item} key={`ProjectListItem-${index}`}></ProjectListItem>
70 70
               ))
71 71
             }
72 72
           </view>