Browse Source

列表渲染

xcx 4 years ago
parent
commit
f4c449c198

+ 11
- 0
src/app.scss View File

69
       text-align: center;
69
       text-align: center;
70
     }
70
     }
71
   }
71
   }
72
+  view.MainItemImg {
73
+    width: 100%;
74
+    position: absolute;
75
+    left: 0;
76
+    top: 0;
77
+    bottom: 0;
78
+    > image {
79
+      width: 100%;
80
+      height: 100%;
81
+    }
82
+  }
72
 }
83
 }

+ 4
- 2
src/components/BannerSwiper/index.vue View File

4
       <block v-for="(item, index) in List" :key="index">
4
       <block v-for="(item, index) in List" :key="index">
5
         <swiper-item>
5
         <swiper-item>
6
           <view class="swiper-item">
6
           <view class="swiper-item">
7
-            <image mode="aspectFill" class="centerLabel" :src="item.image" @tap="LinkTo(item)"></image>
7
+            <view class="MainItemImg">
8
+              <image mode="aspectFill" :src="item.image" @tap="LinkTo(item)"></image>
9
+            </view>
8
           </view>
10
           </view>
9
         </swiper-item>
11
         </swiper-item>
10
       </block>
12
       </block>
30
   methods: {
32
   methods: {
31
     LinkTo (item) {
33
     LinkTo (item) {
32
       if (item.srcId === null) return
34
       if (item.srcId === null) return
33
-      wx.navigateTo({ url: `../../pages/HuiShengHuo/ActivityList/ActivityDetail/index?id=${item.srcId}`})
35
+      wx.navigateTo({ url: `../../pages/HuiShengHuo/ActivityList/ActivityDetail/index?id=${item.srcId}` })
34
     }
36
     }
35
   }
37
   }
36
 }
38
 }

+ 2
- 0
src/components/GetUserIcon/index.vue View File

42
                   success (subRes) {
42
                   success (subRes) {
43
                     _that.EditUserInfo({ name: 'Icon', value: subRes.userInfo.avatarUrl })
43
                     _that.EditUserInfo({ name: 'Icon', value: subRes.userInfo.avatarUrl })
44
                     _that.EditUserInfo({ name: 'Name', value: subRes.userInfo.nickName })
44
                     _that.EditUserInfo({ name: 'Name', value: subRes.userInfo.nickName })
45
+                    _that.$emit('UserInfoChange')
45
                   }
46
                   }
46
                 })
47
                 })
47
               }
48
               }
61
             success (res) {
62
             success (res) {
62
               _that.EditUserInfo({ name: 'Icon', value: res.userInfo.avatarUrl })
63
               _that.EditUserInfo({ name: 'Icon', value: res.userInfo.avatarUrl })
63
               _that.EditUserInfo({ name: 'Name', value: res.userInfo.nickName })
64
               _that.EditUserInfo({ name: 'Name', value: res.userInfo.nickName })
65
+              _that.$emit('UserInfoChange')
64
               _that.Show = false
66
               _that.Show = false
65
             }
67
             }
66
           })
68
           })

+ 3
- 1
src/pages/HuiAiXin/EnergyStory/index.vue View File

18
             </view>
18
             </view>
19
             <view class="Img">
19
             <view class="Img">
20
               <view>
20
               <view>
21
-                <image mode="aspectFill" class="centerLabel" :src="item.thumb"></image>
21
+                <view class="MainItemImg">
22
+                  <image mode="aspectFill" :src="item.thumb"></image>
23
+                </view>
22
               </view>
24
               </view>
23
             </view>
25
             </view>
24
           </navigator>
26
           </navigator>

+ 3
- 1
src/pages/HuiAiXin/StarOwner/index.vue View File

12
         <view class="List" v-if="PageList.length">
12
         <view class="List" v-if="PageList.length">
13
           <navigator v-for="(item, index) in PageList" :key="index" :url="`../../HuiShengHuo/ActivityList/ActivityDetail/index?id=${item.activityId}`" hover-class="other-navigator-hover" class="Item">
13
           <navigator v-for="(item, index) in PageList" :key="index" :url="`../../HuiShengHuo/ActivityList/ActivityDetail/index?id=${item.activityId}`" hover-class="other-navigator-hover" class="Item">
14
             <view class="Img">
14
             <view class="Img">
15
-              <image mode="aspectFill" class="centerLabel" :src="item.thumb"></image>
15
+              <view class="MainItemImg">
16
+                <image mode="aspectFill" :src="item.thumb"></image>
17
+              </view>
16
             </view>
18
             </view>
17
             <text class="Info">{{item.name}}</text>
19
             <text class="Info">{{item.name}}</text>
18
           </navigator>
20
           </navigator>

+ 13
- 4
src/pages/HuiAiXin/index.vue View File

22
             <view class="List">
22
             <view class="List">
23
               <navigator v-for="(item, index) in PageStarList" :key="index" :url="`../HuiShengHuo/ActivityList/ActivityDetail/index?id=${item.activityId}`" hover-class="other-navigator-hover" class="Item">
23
               <navigator v-for="(item, index) in PageStarList" :key="index" :url="`../HuiShengHuo/ActivityList/ActivityDetail/index?id=${item.activityId}`" hover-class="other-navigator-hover" class="Item">
24
                 <view class="Img">
24
                 <view class="Img">
25
-                  <image mode="aspectFill" class="centerLabel" :src="item.thumb"></image>
25
+                  <view class="MainItemImg">
26
+                    <image mode="aspectFill" :src="item.thumb"></image>
27
+                  </view>
26
                 </view>
28
                 </view>
27
                 <text class="Info">{{item.name}}</text>
29
                 <text class="Info">{{item.name}}</text>
28
               </navigator>
30
               </navigator>
49
             </view>
51
             </view>
50
             <view class="Img">
52
             <view class="Img">
51
               <view>
53
               <view>
52
-                <image mode="aspectFill" class="centerLabel" :src="item.thumb"></image>
54
+                <view class="MainItemImg">
55
+                  <image mode="aspectFill" :src="item.thumb"></image>
56
+                </view>
53
               </view>
57
               </view>
54
             </view>
58
             </view>
55
           </navigator>
59
           </navigator>
56
         </view>
60
         </view>
57
       </view>
61
       </view>
58
 
62
 
63
+      <!-- 授权头像获取弹窗 -->
64
+      <GetUserIcon></GetUserIcon>
65
+
59
     </ScrollY>
66
     </ScrollY>
60
   </view>
67
   </view>
61
 </template>
68
 </template>
62
 
69
 
63
 <script>
70
 <script>
71
+import GetUserIcon from '../../components/GetUserIcon/index'
64
 import ScrollY from '../../components/ScrollY/index'
72
 import ScrollY from '../../components/ScrollY/index'
65
 import BannerSwiper from '../../components/BannerSwiper/index'
73
 import BannerSwiper from '../../components/BannerSwiper/index'
66
 import { createNamespacedHelpers } from 'vuex'
74
 import { createNamespacedHelpers } from 'vuex'
86
   },
94
   },
87
   components: {
95
   components: {
88
     ScrollY,
96
     ScrollY,
89
-    BannerSwiper
97
+    BannerSwiper,
98
+    GetUserIcon
90
   },
99
   },
91
   created () {
100
   created () {
92
     this.$authed(() => {
101
     this.$authed(() => {
122
       }).catch(() => {
131
       }).catch(() => {
123
         this.CheckRequestNum(3) // 判断请求接口个数
132
         this.CheckRequestNum(3) // 判断请求接口个数
124
       })
133
       })
125
-      this.GetMingXingYeZhuList({ queryData: { pageNum: 1, pageSize: 10, typeId: 2 } }).then(() => { // 获取明星业主列表
134
+      this.GetMingXingYeZhuList({ queryData: { pageNum: 1, pageSize: 10, typeId: 5 } }).then(() => { // 获取明星业主列表
126
         this.PageStarList = [...this.MingXingYeZhuList]
135
         this.PageStarList = [...this.MingXingYeZhuList]
127
         this.CheckRequestNum(3) // 判断请求接口个数
136
         this.CheckRequestNum(3) // 判断请求接口个数
128
       }).catch(() => {
137
       }).catch(() => {

+ 6
- 1
src/pages/HuiQuanYi/index.vue View File

28
         </view>
28
         </view>
29
       </view>
29
       </view>
30
 
30
 
31
+      <!-- 授权头像获取弹窗 -->
32
+      <GetUserIcon></GetUserIcon>
33
+
31
     </ScrollY>
34
     </ScrollY>
32
   </view>
35
   </view>
33
 </template>
36
 </template>
34
 
37
 
35
 <script>
38
 <script>
39
+import GetUserIcon from '../../components/GetUserIcon/index'
36
 import ScrollY from '../../components/ScrollY/index'
40
 import ScrollY from '../../components/ScrollY/index'
37
 import BannerSwiper from '../../components/BannerSwiper/index'
41
 import BannerSwiper from '../../components/BannerSwiper/index'
38
 import { createNamespacedHelpers } from 'vuex'
42
 import { createNamespacedHelpers } from 'vuex'
56
   },
60
   },
57
   components: {
61
   components: {
58
     ScrollY,
62
     ScrollY,
59
-    BannerSwiper
63
+    BannerSwiper,
64
+    GetUserIcon
60
   },
65
   },
61
   created () {
66
   created () {
62
     this.$authed(() => {
67
     this.$authed(() => {

+ 3
- 1
src/pages/HuiShengHuo/ActivityList/index.vue View File

23
           <view class="List">
23
           <view class="List">
24
             <view class="Item" v-for="(item, index) in PageList" :key="index">
24
             <view class="Item" v-for="(item, index) in PageList" :key="index">
25
               <navigator class="Img" :url="`./ActivityDetail/index?id=${item.activityId}`" hover-class="other-navigator-hover">
25
               <navigator class="Img" :url="`./ActivityDetail/index?id=${item.activityId}`" hover-class="other-navigator-hover">
26
-                <image mode="aspectFill" class="centerLabel" :src="item.thumb"></image>
26
+                <view class="MainItemImg">
27
+                  <image mode="aspectFill" :src="item.thumb"></image>
28
+                </view>
27
               </navigator>
29
               </navigator>
28
               <view class="Info">
30
               <view class="Info">
29
                 <text>{{item.name}}</text>
31
                 <text>{{item.name}}</text>

+ 4
- 2
src/pages/HuiShengHuo/PhotoList/index.vue View File

15
             <view>
15
             <view>
16
               <view v-for="(subItem, subIndex) in item.List" :key="subIndex">
16
               <view v-for="(subItem, subIndex) in item.List" :key="subIndex">
17
                 <view class="Img" @tap="CheckBigImg(subItem.imgUrl)">
17
                 <view class="Img" @tap="CheckBigImg(subItem.imgUrl)">
18
-                  <image mode="aspectFill" class="centerLabel" :src="subItem.imgUrl"></image>
18
+                  <view class="MainItemImg">
19
+                    <image mode="aspectFill" :src="item.imgUrl"></image>
20
+                  </view>
19
                 </view>
21
                 </view>
20
               </view>
22
               </view>
21
             </view>
23
             </view>
96
           if (Arr.length && item.typeId === Arr[Arr.length - 1].Month) {
98
           if (Arr.length && item.typeId === Arr[Arr.length - 1].Month) {
97
             Arr[Arr.length - 1].List.push({ ...item })
99
             Arr[Arr.length - 1].List.push({ ...item })
98
           } else {
100
           } else {
99
-            Arr.push({ Month: item.typeId, List: [{ ...item} ] })
101
+            Arr.push({ Month: item.typeId, List: [{ ...item }] })
100
           }
102
           }
101
         })
103
         })
102
         this.PageList = Arr
104
         this.PageList = Arr

+ 6
- 2
src/pages/HuiShengHuo/index.vue View File

23
               <view class="List">
23
               <view class="List">
24
                 <view v-for="(item, index) in PhotoList" :key="index">
24
                 <view v-for="(item, index) in PhotoList" :key="index">
25
                   <view @tap="CheckBigImg(item.imgUrl)">
25
                   <view @tap="CheckBigImg(item.imgUrl)">
26
-                    <image mode="aspectFill" class="centerLabel" :src="item.imgUrl"></image>
26
+                    <view class="MainItemImg">
27
+                      <image mode="aspectFill" :src="item.imgUrl"></image>
28
+                    </view>
27
                   </view>
29
                   </view>
28
                 </view>
30
                 </view>
29
               </view>
31
               </view>
42
           <view class="List" v-if="ActivityList.length">
44
           <view class="List" v-if="ActivityList.length">
43
             <view class="Item" v-for="(item, index) in ActivityList" :key="index">
45
             <view class="Item" v-for="(item, index) in ActivityList" :key="index">
44
               <navigator class="Img" :url="`./ActivityList/ActivityDetail/index?id=${item.activityId}`" hover-class="other-navigator-hover">
46
               <navigator class="Img" :url="`./ActivityList/ActivityDetail/index?id=${item.activityId}`" hover-class="other-navigator-hover">
45
-                <image mode="aspectFill" class="centerLabel" :src="item.thumb"></image>
47
+                <view class="MainItemImg">
48
+                  <image mode="aspectFill" :src="item.thumb"></image>
49
+                </view>
46
               </navigator>
50
               </navigator>
47
               <view class="Info">
51
               <view class="Info">
48
                 <text>{{item.name}}</text>
52
                 <text>{{item.name}}</text>

+ 3
- 1
src/pages/WoDe/MyActivityList/index.vue View File

23
             </view>
23
             </view>
24
             <view class="Img">
24
             <view class="Img">
25
               <view>
25
               <view>
26
-                <image mode="aspectFill" class="centerLabel" :src="item.thumb"></image>
26
+                <view class="MainItemImg">
27
+                  <image mode="aspectFill" :src="item.thumb"></image>
28
+                </view>
27
               </view>
29
               </view>
28
             </view>
30
             </view>
29
           </navigator>
31
           </navigator>

+ 7
- 4
src/pages/WoDe/index.vue View File

7
       <view class="centerLabel">
7
       <view class="centerLabel">
8
         <view class="flex-h">
8
         <view class="flex-h">
9
           <view class="Icon">
9
           <view class="Icon">
10
-            <image mode="widthFix" v-if="this.UserInfo === null || this.UserInfo.Icon === undefined || this.UserInfo.Icon === null" src="https://cjgw.oss-cn-hangzhou.aliyuncs.com/ygcxxfb/image/morentouxiang.png"></image>
11
-            <image mode="widthFix" v-else :src="this.UserInfo.Icon"></image>
10
+            <image mode="widthFix" :src="IconUrl"></image>
12
           </view>
11
           </view>
13
           <view class="flex-item">
12
           <view class="flex-item">
14
             <navigator url="../SignIn/index" hover-class="other-navigator-hover" class="SiginIn" v-if="UserInfo === null || UserInfo.Phone === undefined || UserInfo.Phone === null">立即登录</navigator>
13
             <navigator url="../SignIn/index" hover-class="other-navigator-hover" class="SiginIn" v-if="UserInfo === null || UserInfo.Phone === undefined || UserInfo.Phone === null">立即登录</navigator>
15
             <text v-else>{{UserInfo.Name}}</text>
14
             <text v-else>{{UserInfo.Name}}</text>
16
-            <text  v-if="!(UserInfo === null || UserInfo.Phone === undefined || UserInfo.Phone === null)">{{UserInfo.Phone}}</text>
15
+            <text v-if="!(UserInfo === null || UserInfo.Phone === undefined || UserInfo.Phone === null)">{{UserInfo.Phone}}</text>
17
           </view>
16
           </view>
18
         </view>
17
         </view>
19
       </view>
18
       </view>
38
     </view>
37
     </view>
39
 
38
 
40
     <!-- 授权头像获取弹窗 -->
39
     <!-- 授权头像获取弹窗 -->
41
-    <GetUserIcon></GetUserIcon>
40
+    <GetUserIcon @UserInfoChange="UserInfoChange"></GetUserIcon>
42
 
41
 
43
   </view>
42
   </view>
44
 </template>
43
 </template>
51
   name: 'WoDe',
50
   name: 'WoDe',
52
   data () {
51
   data () {
53
     return {
52
     return {
53
+      IconUrl: 'https://cjgw.oss-cn-hangzhou.aliyuncs.com/ygcxxfb/image/morentouxiang.png',
54
     }
54
     }
55
   },
55
   },
56
   computed: {
56
   computed: {
74
       'EditUserInfo' // 编辑用户信息
74
       'EditUserInfo' // 编辑用户信息
75
     ]),
75
     ]),
76
     Init () { // 初始化
76
     Init () { // 初始化
77
+    },
78
+    UserInfoChange () {
79
+      this.IconUrl = this.UserInfo.Icon
77
     }
80
     }
78
   }
81
   }
79
 }
82
 }