许静 преди 5 години
родител
ревизия
3d6b412116

+ 58
- 1
src/components/BackHomeBtn/index.js Целия файл

@@ -8,15 +8,72 @@ export default class Index extends Component {
8 8
   static defaultProps = {
9 9
     style: {}
10 10
   }
11
+  state ={
12
+    buttonTop: 0,
13
+    buttonLeft: 0,
14
+    windowHeight: '',
15
+    windowWidth: ''
16
+  }
17
+  componentDidShow(){
18
+    Taro.getSystemInfo({
19
+      success: function (res) {
20
+        console.log(res,"9999999999999")
21
+        realWindowWidth = res.windowWidth
22
+        realWindowHeight = res.windowHeight
23
+      }
24
+    })
25
+  
26
+  }
11 27
 
12 28
   handleClick() {
13 29
     Taro.switchTab({
14 30
       url: `/pages/project/index`
15 31
     })
16 32
   }
33
+  buttonStart=(e)=> {
34
+    console.log(e,"eeeeeeeeeeeee")
35
+    startPoint = e.touches[0]
36
+  }
37
+  buttonMove=(e)=> {
38
+    console.log(e,"888888888888888")
39
+    var endPoint = e.touches[e.touches.length - 1]
40
+    var translateX = endPoint.clientX - startPoint.clientX
41
+    var translateY = endPoint.clientY - startPoint.clientY
42
+    startPoint = endPoint
43
+    var buttonTop = this.state.buttonTop + translateY
44
+    var buttonLeft = this.state.buttonLeft + translateX
45
+    //判断是移动否超出屏幕
46
+    if (buttonLeft+50 >= this.state.windowWidth){
47
+      buttonLeft = this.state.windowWidth-50;
48
+    }
49
+    if (buttonLeft<=0){
50
+      buttonLeft=0;
51
+    }
52
+    if (buttonTop<=0){
53
+      buttonTop=0
54
+    }
55
+    if (buttonTop + 50 >= this.state.windowHeight){
56
+      buttonTop = this.state.windowHeight-50;
57
+    }
58
+    this.setState({
59
+      buttonTop: buttonTop,
60
+      buttonLeft: buttonLeft
61
+    })
62
+  }
63
+  buttonEnd=(e)=> {
64
+
65
+  }
66
+
17 67
   render() {
18 68
     return (
19
-      <View className="back-home" style={this.props.style} onClick={this.handleClick} >
69
+      // <View className="back-home" style={this.props.style} onClick={this.handleClick}  >
70
+      //   <Image src={require('@assets/homeicon.png')} className='home-img'></Image>
71
+      //   <Text className="text">首页</Text>
72
+      // </View>
73
+      <View className="back-home"
74
+       style={this.props.style} 
75
+       style='top:{this.state.buttonTop}px;left:{this.state.buttonLeft}px'
76
+       onClick={this.handleClick} ontouchmove={this.buttonMove} ontouchstart={this.buttonStart} ontouchend={this.buttonEnd} >
20 77
         {/* <Text className="iconfont icon-shouyeshouye"></Text> */}
21 78
         <Image src={require('@assets/homeicon.png')} className='home-img'></Image>
22 79
         <Text className="text">首页</Text>

+ 1
- 1
src/pages/activity/assembleItem/index.js Целия файл

@@ -70,7 +70,7 @@ export default class Item extends Component {
70 70
     const { data, style } = this.props
71 71
     return (
72 72
       <View className="item" style={style} onClick={this.handleClick.bind(this, data)}>
73
-        <Image className="pic" src={data.mainImg} ></Image>
73
+        <Image className="pic" mode="aspectFill" src={data.mainImg} ></Image>
74 74
         <View className="title">{data.activityName}</View>
75 75
         {(!data.verificationCode && data.status == 1) &&
76 76
           <View className="time">参与截止时间: 

+ 1
- 1
src/pages/activity/assistanceItem/index.js Целия файл

@@ -69,7 +69,7 @@ export default class Item extends Component {
69 69
     const { data, style } = this.props
70 70
     return (
71 71
       <View className="item" style={style} onClick={this.handleClick.bind(this, data)}>
72
-        <Image className="pic" src={data.img} ></Image>
72
+        <Image className="pic" mode="aspectFill" src={data.img} ></Image>
73 73
         <View className="title">{data.title}</View>
74 74
         {(!data.verification && data.status == 1) &&
75 75
           <View className="time">参与截止时间:

+ 2
- 0
src/pages/activity/detail/index.js Целия файл

@@ -354,6 +354,8 @@ export default class Detail extends Component {
354 354
                     <import src='../../../components/wxParse/wxParse.wxml' />
355 355
                     <template is='wxParse' data='{{wxParseData:article.nodes}}' />
356 356
                   </View>
357
+                  <View style="color:#999;font-size:15px;margin:0 auto 90px auto;text-align:center">已经到底了~</View>
358
+
357 359
                 </View>
358 360
               </ScrollView>
359 361
 

+ 1
- 1
src/pages/activity/detail/index.scss Целия файл

@@ -190,7 +190,7 @@
190 190
   }
191 191
 
192 192
   &-con {
193
-    margin-bottom: 100px;
193
+    margin-bottom: 60px;
194 194
     &__title {
195 195
       font-size: 32px;
196 196
       font-weight: bold;

+ 1
- 1
src/pages/activity/item/index.js Целия файл

@@ -16,7 +16,7 @@ export default class Item extends Component {
16 16
     const { data, style } = this.props
17 17
     return (
18 18
       <View className="item" style={style} onClick={this.handleClick.bind(this, data)}>
19
-        <Image className="pic" mode="aspectFill" src={getThumbnail(data.mainImg || data.imgUrl)}></Image>
19
+         <Image className="pic" mode="aspectFill" src={getThumbnail(data.mainImg || data.imgUrl)}></Image>
20 20
         <View className="box">
21 21
           <View className="title">{data.title}</View>
22 22
           {

+ 1
- 1
src/pages/news/detail/index.js Целия файл

@@ -221,7 +221,7 @@ export default class NewsDetail extends Component {
221 221
 
222 222
                   <View>{dayjs(detail.createDate).format('YYYY-MM-DD')}</View>
223 223
                 </View>
224
-                <Image mode="widthFix" style={{ width: '100%', marginTop: '20px' }} src={getThumbnail(detail.newsImg)}></Image>
224
+                {/* <Image mode="widthFix" style={{ width: '100%', marginTop: '20px' }} src={getThumbnail(detail.newsImg)}></Image> */}
225 225
                 <View className="detail-con">
226 226
                   <import src='../../../components/wxParse/wxParse.wxml' />
227 227
                   <template is='wxParse' data='{{wxParseData:article.nodes}}' />

+ 2
- 2
src/pages/policy/detail/index.js Целия файл

@@ -13,7 +13,7 @@ import { connect } from '@tarojs/redux'
13 13
 @connect(state => state.user)
14 14
 export default class PolicyDetail extends Component {
15 15
   config = {
16
-    navigationBarTitleText: ''
16
+    navigationBarTitleText: '购房百科详情'
17 17
   }
18 18
 
19 19
   state = {
@@ -82,7 +82,7 @@ export default class PolicyDetail extends Component {
82 82
                   <View class="detail-title">{detail.title}</View>
83 83
                   <View className="detail-stat">
84 84
                     <View>{dayjs(detail.createDate).format('YYYY-MM-DD')}</View>
85
-                    <View><Text className="iconfont icon-eye"></Text>{detail.publishUser || 0}</View>
85
+                    <View><Text className="iconfont icon-eye"></Text>{detail.pvNum || 0}</View>
86 86
                     {/* <View><Text className="iconfont icon-fenxiang1"></Text>{detail.shareNum || 0}</View> */}
87 87
                   </View>
88 88
                   <Image mode="widthFix" style={{ width: '100%', marginTop: '20px' }} src={detail.policyImg}></Image>

+ 1
- 1
src/pages/policy/index.js Целия файл

@@ -11,7 +11,7 @@ let pageIndex = 1
11 11
 export default class Index extends Component {
12 12
 
13 13
   config = {
14
-    navigationBarTitleText: ''
14
+    navigationBarTitleText: '购房百科列表'
15 15
   }
16 16
 
17 17
   state = {

+ 1
- 0
src/pages/policy/item/index.js Целия файл

@@ -3,6 +3,7 @@ import dayjs from 'dayjs'
3 3
 import './item.scss'
4 4
 
5 5
 export default class PolicyItem extends Component {
6
+
6 7
   static defaultProps = {
7 8
     data: []
8 9
   }

+ 7
- 6
src/pages/project/detail/index.js Целия файл

@@ -2,6 +2,7 @@ import Taro, { Component } from '@tarojs/taro';
2 2
 
3 3
 import './index.scss'
4 4
 import Banner from '../banner'
5
+import HelpGroupBanner from '../swiper'
5 6
 import Poster from './poster'
6 7
 import ActivityItem from '../../activity/item'
7 8
 import BackHomeBtn from '@components/BackHomeBtn'
@@ -719,12 +720,12 @@ export default class Index extends Component {
719 720
           <View className="activity">
720 721
             <View className="title">助力活动</View>
721 722
             <View style={{ position: 'relative' }}>
722
-              <Banner
723
+              <HelpGroupBanner
723 724
                 style={{ height: '130px' }}
724 725
                 indicatorDots={false}
725 726
                 list={helpList}
726 727
                 onClick={this.handleHelpClick}>
727
-              </Banner>
728
+              </HelpGroupBanner>
728 729
             </View>
729 730
           </View>
730 731
         }
@@ -751,12 +752,12 @@ export default class Index extends Component {
751 752
             <View className="title">拼团活动</View>
752 753
             <View
753 754
               style={{ position: 'relative' }}>
754
-              <Banner
755
+              <HelpGroupBanner
755 756
                 style={{ height: '130px' }}
756 757
                 indicatorDots={false}
757 758
                 list={groupList}
758 759
                 onClick={this.handleGroupClick}>
759
-              </Banner>
760
+              </HelpGroupBanner>
760 761
             </View>
761 762
           </View>
762 763
         }
@@ -830,7 +831,7 @@ export default class Index extends Component {
830 831
                   {
831 832
                     activityList.map(item => (
832 833
                       <View className="news-item" key={item.dynamicId} onClick={this.handActivityItemClick.bind(this, item.dynamicId)}>
833
-                        <Image src={getThumbnail(item.imgUrl)} className="news-item__pic"></Image>
834
+                        <Image mode="aspectFill" src={getThumbnail(item.imgUrl)} className="news-item__pic"></Image>
834 835
                         <View className="news-item__title">{item.title}</View>
835 836
                       </View>
836 837
                     ))
@@ -861,7 +862,7 @@ export default class Index extends Component {
861 862
                   {
862 863
                     newsList.map(item => (
863 864
                       <View className="news-item" key={item.newsId} onClick={this.handNewsItemClick.bind(this, item.newsId)}>
864
-                        <Image src={getThumbnail(item.newsImg)} className="news-item__pic"></Image>
865
+                        <Image src={getThumbnail(item.newsImg)} mode="aspectFill" className="news-item__pic"></Image>
865 866
                         <View className="news-item__title">{item.newsName}</View>
866 867
                       </View>
867 868
                     ))

+ 3
- 2
src/pages/project/index.js Целия файл

@@ -2,6 +2,7 @@ import Taro, { Component } from '@tarojs/taro';
2 2
 import './index.scss'
3 3
 import ProjectItem from './item'
4 4
 import Banner from './banner'
5
+import HelpGroupBanner from './swiper'
5 6
 import ActivityItem from '../activity/item'
6 7
 
7 8
 
@@ -475,7 +476,7 @@ export default class Index extends Component {
475 476
               position: 'relative', padding: '20px 20px 0 20px'
476 477
             }}>
477 478
 
478
-            <Banner
479
+            <HelpGroupBanner
479 480
               style={{
480 481
                 borderRadius: '6px',
481 482
                 height: '88px'
@@ -483,7 +484,7 @@ export default class Index extends Component {
483 484
               indicatorDots={false}
484 485
               list={helpGroupList}
485 486
               onClick={this.handleHelpGroupClick}>
486
-            </Banner>
487
+            </HelpGroupBanner>
487 488
           </View>
488 489
         }
489 490
 

+ 1
- 1
src/pages/project/item/index.js Целия файл

@@ -25,7 +25,7 @@ export default class Index extends Component {
25 25
     return (
26 26
       <View className='item' onClick={onClick.bind(this, data)}>
27 27
         <View className='item__top'>
28
-          <Image className='item__img' src={getThumbnail(imgSrc)}></Image>
28
+          <Image className='item__img' mode="aspectFill" src={getThumbnail(imgSrc)}></Image>
29 29
           {data.marketStatus &&
30 30
             <View className={data.marketStatus == '在售' ? 'item__status sale' : data.marketStatus == '售罄' ? 'item__status soldout' : 'item__status waitsale'}>{data.marketStatus}</View>}
31 31
           <View className='item__right'>

+ 50
- 0
src/pages/project/swiper/index.js Целия файл

@@ -0,0 +1,50 @@
1
+import Taro, { Component } from '@tarojs/taro'
2
+import { View, Swiper, SwiperItem, Image } from '@tarojs/components'
3
+// import { cdn } from '@constants/api'
4
+import './index.scss'
5
+import emptyImg  from '@assets/empty.png'
6
+import { getThumbnail} from '@utils/tools'
7
+
8
+export default class SwiperBanner extends Component {
9
+  static defaultProps = {
10
+    list: [],
11
+    indicatorDots: true,
12
+    style: {
13
+      height: '200px'
14
+    },
15
+    onClick: function () { }
16
+  }
17
+
18
+  onBannerClick(item) {
19
+    this.props.onClick(item)
20
+  }
21
+  render() {
22
+    const { list, style, indicatorDots, current } = this.props
23
+    return (
24
+      <View className='home-banner' style={style}>
25
+        <Swiper
26
+          className='home-banner__swiper'
27
+          circular
28
+          autoplay
29
+          indicatorDots={indicatorDots}
30
+          indicatorActiveColor='rgb(256,256,256)'
31
+        >
32
+          {list.map((item, index) => (
33
+            <SwiperItem
34
+              key={index}
35
+              onClick={this.onBannerClick.bind(this, item)}
36
+              className='home-banner__swiper-item'
37
+            >
38
+              <Image
39
+                mode="aspectFill"
40
+                style={style}
41
+                className='home-banner__swiper-item-img'
42
+                src={getThumbnail(item.image || item.url ||item.img||emptyImg)}
43
+              />
44
+            </SwiperItem>
45
+          ))}
46
+        </Swiper>
47
+      </View> 
48
+    )
49
+  }
50
+}

+ 23
- 0
src/pages/project/swiper/index.scss Целия файл

@@ -0,0 +1,23 @@
1
+@import "@styles/theme.scss";
2
+.home-banner {
3
+  width: 100%;
4
+  overflow: hidden;
5
+  height: 250px;
6
+}
7
+
8
+.home-banner__swiper {
9
+  // NOTE RN 的 Swiper 需要有高度,否则会报错
10
+  height: 100%;
11
+  &-item {
12
+    display: flex;
13
+    flex-direction: row;
14
+    justify-content: center;
15
+
16
+    &-img {
17
+      width: 100%;
18
+      height: 100%!important;
19
+      overflow: hidden;
20
+      border-radius: 0;
21
+    }
22
+  }
23
+}

+ 2
- 2
src/pages/shop/index.js Целия файл

@@ -264,7 +264,7 @@ export default class Shop extends Component {
264 264
             {
265 265
               goodsList.map(item => (
266 266
                 <View className="item" key={item.goodsId} onClick={this.onViewDetail.bind(this, item)}>
267
-                  <Image className="item__img" src={item.imgUrl} />
267
+                  <Image className="item__img" mode="aspectFill" src={item.imgUrl} />
268 268
                   <View className="item__title">{item.goodsName}</View>
269 269
                   <View className="item__des">
270 270
                     <View>
@@ -290,7 +290,7 @@ export default class Shop extends Component {
290 290
                     {
291 291
                       goodsList.map(item => (
292 292
                         <View className="item" key={item.goodsId} onClick={this.onViewDetail.bind(this, item)}>
293
-                          <Image className="item__img" src={item.imgUrl} />
293
+                          <Image className="item__img" mode="aspectFill" src={item.imgUrl} />
294 294
                           <View className="item__title">{item.goodsName}</View>
295 295
                           <View className="item__des">
296 296
                             <View>

+ 3
- 0
src/pages/shop/index.scss Целия файл

@@ -11,6 +11,9 @@
11 11
 .at-tabs__header{
12 12
   text-align: left;
13 13
 }
14
+.at-tabs__header::-webkit-scrollbar {
15
+  display:none;
16
+}
14 17
 // .bg {
15 18
 //   width: 100%;
16 19
 // }

+ 1
- 1
src/pages/shop/record/index.js Целия файл

@@ -71,7 +71,7 @@ export default class Index extends Component {
71 71
 									<View className="title-state">{item.status==0?"未领取":"已领取"}</View>
72 72
 								</View>
73 73
 								<View className="bottom">
74
-									<Image className="botttom_img" mode="aspectFit" src={item.image} />
74
+									<Image className="botttom_img" mode="aspectFill" src={item.image} />
75 75
 									<View className="bottom-right">
76 76
 										<View className="bottom-right-top">
77 77
 											<View className="product-name">{item.targetName}</View>