1002884655 4 年 前
コミット
968d786682
共有6 個のファイルを変更した44 個の追加29 個の削除を含む
  1. 1
    0
      src/constants/api.js
  2. 19
    7
      src/pages/dichan/index.js
  3. 0
    2
      src/pages/dichan/index.scss
  4. 19
    17
      src/pages/league/index.js
  5. 5
    1
      src/services/shop.js
  6. 0
    2
      src/utils/login.js

+ 1
- 0
src/constants/api.js ファイルの表示

@@ -241,3 +241,4 @@ export const API_TEMPLATE_TYPE = resolvePath('template/of/')
241 241
 export const API_STORE_LIST = resolvePath('shop')
242 242
 export const API_STORE_TYPE_LIST = resolvePath('shop-type')
243 243
 export const API_STORE_DETAIL = resolvePath('shop')
244
+export const API_STORE_BANNER = resolvePath('shop-banner')

+ 19
- 7
src/pages/dichan/index.js ファイルの表示

@@ -6,7 +6,7 @@ import ready from '@/utils/ready'
6 6
 import { connect } from '@tarojs/redux'
7 7
 
8 8
 @connect(
9
-  state => ({ ...state.userInfo })
9
+  state => ({ ...state.user, ...state.city })
10 10
 )
11 11
 export default class Index extends Component {
12 12
   config = {
@@ -15,11 +15,14 @@ export default class Index extends Component {
15 15
   state = {
16 16
     PageList: [{}, {}, {}, {}, {}],
17 17
     filterOpt: {},
18
-    pageIndex: 1
18
+    pageIndex: 1,
19
+    Org: null
19 20
   }
20 21
   componentWillMount () {
21 22
     ready.queue(async () => {
22
-      console.log(userInfo, `-----------------------11111111111111111111111`)
23
+      this.setState({
24
+        Org: this.props.userInfo.person.org || null
25
+      })
23 26
       const { records: list } = await this.loadList(1, 10)
24 27
       this.setState({
25 28
         PageList: list
@@ -43,12 +46,21 @@ export default class Index extends Component {
43 46
 
44 47
         {/* 顶部背景图 */}
45 48
         <View className='TopContainer'>
46
-          <Image mode='widthFix' className='Bg' src={require('@/assets/img/topbg1.jpg')} />
49
+          {
50
+            Org !== null ?
51
+              <Image mode='widthFix' className='Bg' src={Org.thumb} />
52
+              :
53
+              <Image mode='widthFix' className='Bg' src={require('@/assets/img/topbg1.jpg')} />
54
+          }
47 55
           <View className='Text'>
48 56
             <View>
49
-              <View><Text>“同理心”</Text>是雅居乐待人处事的第一原则,我们尊重每个人的需求和期望。</View>
57
+              {/* <View><Text>“同理心”</Text>是雅居乐待人处事的第一原则,我们尊重每个人的需求和期望。</View>
50 58
               <View>不论是地产发展、物业服务,亦或其它产业,我们都本着将心比心的态度,务求从细微处了解每个人的需求,一点一滴改善生活的每 个细节。</View>
51
-              <View>我们相信,这份坚持将为员工、客户和投资者带来永续的回报价值,成就更多自由自在、高枕无忧的快乐人生。</View>
59
+              <View>我们相信,这份坚持将为员工、客户和投资者带来永续的回报价值,成就更多自由自在、高枕无忧的快乐人生。</View> */}
60
+              {
61
+                Org !== null &&
62
+                <RichText nodes={Org.orgDesc}></RichText>
63
+              }
52 64
             </View>
53 65
           </View>
54 66
         </View>
@@ -65,7 +77,7 @@ export default class Index extends Component {
65 77
               PageList.map((item, index) => (
66 78
                 <Navigator key={`List-${index}`} className='flex-h ListItem' url={`/pages/project/detail/index?id=${item.buildingId}`}>
67 79
                   <View className='Img'>
68
-                    <Image mode='widthFix' className='centerLabel' src={item.buildingListImg !==null && item.buildingListImg.length ? item.buildingListImg[0].url : 'https://njcj.oss-cn-shanghai.aliyuncs.com/miniapp/images/default.jpg'} />
80
+                    <Image mode='widthFix' className='centerLabel' src={item.buildingListImg !== null && item.buildingListImg.length ? item.buildingListImg[0].url : 'https://njcj.oss-cn-shanghai.aliyuncs.com/miniapp/images/default.jpg'} />
69 81
                   </View>
70 82
                   <View className='flex-item'>
71 83
                     <Image mode='widthFix' className='Logo' src={require('@/assets/img/logo.png')} />

+ 0
- 2
src/pages/dichan/index.scss ファイルの表示

@@ -9,10 +9,8 @@
9 9
   min-height: 100vh;
10 10
   > .TopContainer {
11 11
     width: 100%;
12
-    padding-bottom: 140%;
13 12
     position: relative;
14 13
     overflow: visible;
15
-    height: 0;
16 14
     > .Bg {
17 15
       width: 100%;
18 16
       display: block;

+ 19
- 17
src/pages/league/index.js ファイルの表示

@@ -1,7 +1,7 @@
1 1
 import { View } from '@tarojs/components'
2 2
 import { Component } from '@tarojs/taro'
3 3
 import './index.scss'
4
-import { GetShopList, GetShopTypeList } from '@/services/shop'
4
+import { GetShopList, GetShopTypeList, GetShopBanner } from '@/services/shop'
5 5
 import ready from '@/utils/ready'
6 6
 import ShopItem from './item'
7 7
 import { connect } from '@tarojs/redux'
@@ -17,13 +17,7 @@ export default class Index extends Component {
17 17
   }
18 18
   state = {
19 19
     TestImg: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1604566584132&di=33926cb8407ae341fa1d8cc0d322d392&imgtype=0&src=http%3A%2F%2Fattach.bbs.miui.com%2Fforum%2F201305%2F30%2F220025pxfkhykvkgkvuktq.jpg',
20
-    BannerData: [
21
-      { id: 1, img: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1604485078843&di=e50cb70de152bb6b83f7b1d712b509c8&imgtype=0&src=http%3A%2F%2Fattachments.gfan.com%2Fforum%2F201503%2F19%2F211608ztcq7higicydxhsy.jpg' },
22
-      { id: 2, img: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1604486077351&di=a5320b0e8f2dd45ccdee71f7e1a541d5&imgtype=0&src=http%3A%2F%2Fbenyouhuifile.it168.com%2Fforum%2F201304%2F06%2F11435052yrezzae1bua8ee.jpg' },
23
-      { id: 3, img: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1604486077351&di=ba0b2021b0dce8807b75bcd81cd44d32&imgtype=0&src=http%3A%2F%2Fbenyouhuifile.it168.com%2Fforum%2Fday_100429%2F1004291840008539c8ac02cd5c.jpg' },
24
-      { id: 4, img: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1604486077351&di=014ef8ce837f8762c1e982f093286f42&imgtype=0&src=http%3A%2F%2Fattach.bbs.miui.com%2Fforum%2F201306%2F23%2F110328s72xxse7lfis9fnd.jpg' },
25
-      { id: 5, img: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1604486077349&di=861dfd8adb91ede1c5f6de5abb59638b&imgtype=0&src=http%3A%2F%2Fattach.bbs.miui.com%2Fforum%2F201205%2F15%2F152011zser9o5oa9ee9xx6.jpg' }
26
-    ],
20
+    BannerData: [],
27 21
     isEmpty: false,
28 22
     SearchName: '',
29 23
     StoreList: [],
@@ -40,6 +34,11 @@ export default class Index extends Component {
40 34
       this.setState({
41 35
         CityData: city
42 36
       }, () => {
37
+        GetShopBanner({ pageNum: 1, pageSize: 10 }).then((res) => {
38
+          this.setState({
39
+            BannerData: res.records || []
40
+          })
41
+        })
43 42
         GetShopTypeList({ pageNum: 1, pageSize: 10 }).then((res) => {
44 43
           let Arr = res.records || []
45 44
           let aArr = []
@@ -160,15 +159,18 @@ export default class Index extends Component {
160 159
             <View className='Banner'>
161 160
               <View>
162 161
                 <View>
163
-                  <Swiper className='Swiper' indicatorColor='rgba(0,0,0,0.4)' indicatorActiveColor='#fff' circular indicatorDots autoplay>
164
-                    {
165
-                      BannerData.map((item, index) => (
166
-                        <SwiperItem key={`Swiper-${index}`}>
167
-                          <Image mode='widthFix' className='centerLabel' src={item.img} />
168
-                        </SwiperItem>
169
-                      ))
170
-                    }
171
-                  </Swiper>
162
+                  {
163
+                    BannerData.length &&
164
+                    <Swiper className='Swiper' indicatorColor='rgba(0,0,0,0.4)' indicatorActiveColor='#fff' circular indicatorDots autoplay>
165
+                      {
166
+                        BannerData.map((item, index) => (
167
+                          <SwiperItem key={`Swiper-${index}`}>
168
+                            <Image mode='widthFix' className='centerLabel' src={item.thumb} />
169
+                          </SwiperItem>
170
+                        ))
171
+                      }
172
+                    </Swiper>
173
+                  }
172 174
                 </View>
173 175
               </View>
174 176
             </View>

+ 5
- 1
src/services/shop.js ファイルの表示

@@ -2,7 +2,8 @@ import { fetch } from "@/utils/request";
2 2
 import {
3 3
   API_STORE_LIST,
4 4
   API_STORE_TYPE_LIST,
5
-  API_STORE_DETAIL
5
+  API_STORE_DETAIL,
6
+  API_STORE_BANNER
6 7
 } from "@/constants/api";
7 8
 
8 9
 /**
@@ -19,3 +20,6 @@ export const GetShopTypeList = payload =>
19 20
 export const GetShopDetail = payload =>
20 21
   fetch({ url: `${API_STORE_DETAIL}/${payload.id}`, method: 'get' });
21 22
 
23
+export const GetShopBanner = payload =>
24
+  fetch({ url: API_STORE_BANNER, payload, method: "GET" });
25
+

+ 0
- 2
src/utils/login.js ファイルの表示

@@ -38,8 +38,6 @@ export default function (payload, callback) {
38 38
         dispatch({ type: USER_INFO, payload: { extraInfo, person, miniApp } })
39 39
         const { city: { curCity } } = getState()
40 40
 
41
-        console.log(curCity, "curCity")
42
-
43 41
         if (!curCity || Object.keys(curCity).length == 0) {
44 42
           if (city) {
45 43
             dispatchCitySelected(city)(dispatch)