Bläddra i källkod

接口请求完善

1002884655 4 år sedan
förälder
incheckning
59a0773735

+ 1
- 0
src/app.config.js Visa fil

@@ -23,6 +23,7 @@ export default {
23 23
     'pages/WoDe/index', // 我的
24 24
     'pages/WoDe/Feedback/index', // 我的-反馈
25 25
     'pages/WoDe/MyActivityList/index', // 我的-活动列表
26
+    'pages/WoDe/MyRecommed/index', // 我的-我的推荐
26 27
 
27 28
     'pages/SignIn/index' // 登录页
28 29
 

+ 5
- 0
src/pages/HuiQuanYi/index.vue Visa fil

@@ -9,6 +9,11 @@
9 9
         </view>
10 10
       </view>
11 11
 
12
+      <!-- 一荐倾心计划 -->
13
+      <navigator url="./Recommed/index" hover-class="other-navigator-hover" class="YiJianQingXin">
14
+        <image mode="widthFix" src="https://cjgw.oss-cn-hangzhou.aliyuncs.com/ygcxxfb/image/yijianqingxin.png"></image>
15
+      </navigator>
16
+
12 17
       <!-- 业主资讯 -->
13 18
       <view class="NewsList">
14 19
         <view class="flex-h">

+ 6
- 0
src/pages/HuiQuanYi/page.scss Visa fil

@@ -16,6 +16,12 @@
16 16
       background: #ccc;
17 17
     }
18 18
   }
19
+  .YiJianQingXin {
20
+    margin-top: 20px;
21
+    > image {
22
+      width: 100%;
23
+    }
24
+  }
19 25
   .NewsList {
20 26
     padding: 20px 0;
21 27
     background: #fff;

+ 2
- 2
src/pages/HuiShengHuo/PhotoList/index.vue Visa fil

@@ -16,7 +16,7 @@
16 16
               <view v-for="(subItem, subIndex) in item.List" :key="subIndex">
17 17
                 <view class="Img" @tap="CheckBigImg(subItem.imgUrl)">
18 18
                   <view class="MainItemImg">
19
-                    <image mode="aspectFill" :src="item.imgUrl"></image>
19
+                    <image mode="aspectFill" :src="subItem.imgUrl"></image>
20 20
                   </view>
21 21
                 </view>
22 22
               </view>
@@ -28,7 +28,7 @@
28 28
     </ScrollY>
29 29
 
30 30
     <view class="BigImg" v-if="ShowBigImg" @tap="ShowBigImg = false">
31
-      <image mode="aspectFit" class="centerLabel" :src="BigImgUrl"></image>
31
+      <image mode="aspectFit" :src="BigImgUrl"></image>
32 32
     </view>
33 33
   </view>
34 34
 </template>

+ 5
- 1
src/pages/HuiShengHuo/PhotoList/page.scss Visa fil

@@ -2,7 +2,7 @@
2 2
   width: 100%;
3 3
   height: 100%;
4 4
   background: #fff;
5
-  >.BigImg {
5
+  > .BigImg {
6 6
     width: 100%;
7 7
     position: absolute;
8 8
     left: 0;
@@ -11,6 +11,10 @@
11 11
     z-index: 100;
12 12
     background: rgba(0, 0, 0, 0.7);
13 13
     overflow: hidden;
14
+    > image {
15
+      width: 100%;
16
+      height: 100%;
17
+    }
14 18
   }
15 19
   .PhotoList {
16 20
     > .flex-h {

+ 1
- 1
src/pages/HuiShengHuo/index.vue Visa fil

@@ -65,7 +65,7 @@
65 65
       </ScrollY>
66 66
 
67 67
       <view class="BigImg" v-if="ShowBigImg" @tap="ShowBigImg = false">
68
-        <image mode="aspectFit" class="centerLabel" :src="BigImgUrl"></image>
68
+        <image mode="aspectFit" :src="BigImgUrl"></image>
69 69
       </view>
70 70
     </view>
71 71
   </BasicLayout>

+ 4
- 0
src/pages/HuiShengHuo/page.scss Visa fil

@@ -11,6 +11,10 @@
11 11
     z-index: 100;
12 12
     background: rgba(0, 0, 0, 0.7);
13 13
     overflow: hidden;
14
+    > image {
15
+      width: 100%;
16
+      height: 100%;
17
+    }
14 18
   }
15 19
   .Banner {
16 20
     width: 100%;

+ 3
- 0
src/pages/WoDe/MyRecommed/index.config.js Visa fil

@@ -0,0 +1,3 @@
1
+export default {
2
+  navigationBarTitleText: '我的推荐'
3
+}

+ 114
- 0
src/pages/WoDe/MyRecommed/index.vue Visa fil

@@ -0,0 +1,114 @@
1
+<template>
2
+  <view class="page MyRecommed">
3
+    <ScrollY :IsRefreshing="IsRefreshing" @Refresh="Refresh" @ScrollBottom="ScrollBottom">
4
+      <view class="Container">
5
+
6
+        <!-- 标题 -->
7
+        <view class="Title">
8
+          <image mode="heightFix" src="https://cjgw.oss-cn-hangzhou.aliyuncs.com/ygcxxfb/image/wodetuijian.png"></image>
9
+        </view>
10
+
11
+        <view class="NoData" v-show="NoData">
12
+          <image mode="widthFix" src="https://cjgw.oss-cn-hangzhou.aliyuncs.com/ygcxxfb/image/nodata.png"></image>
13
+          <text>暂无内容</text>
14
+        </view>
15
+
16
+        <!-- 列表 -->
17
+        <view class="List" v-if="PageList.length">
18
+          <navigator v-for="(item, index) in PageList" :key="index" :url="`../../HuiShengHuo/ActivityList/ActivityDetail/index?id=${item.activityId}`" hover-class="other-navigator-hover" class="Item flex-h">
19
+            <view class="flex-item">
20
+              <text>{{item.name}}</text>
21
+              <text>已报名{{item.enrollNum}}人</text>
22
+              <text v-if="new Date(item.enrollEnd).getTime() <= Date.now()">已结束</text>
23
+            </view>
24
+            <view class="Img">
25
+              <view>
26
+                <view class="MainItemImg">
27
+                  <image mode="aspectFill" :src="item.thumb"></image>
28
+                </view>
29
+              </view>
30
+            </view>
31
+          </navigator>
32
+        </view>
33
+
34
+      </view>
35
+    </ScrollY>
36
+  </view>
37
+</template>
38
+
39
+<script>
40
+import ScrollY from '../../../components/ScrollY/index'
41
+import { createNamespacedHelpers } from 'vuex'
42
+const { mapState: mapUserState, mapActions: mapUserActions } = createNamespacedHelpers('user')
43
+export default {
44
+  name: 'MyRecommed',
45
+  data () {
46
+    return {
47
+      NoData: false,
48
+      PageData: {
49
+        pageNum: 1,
50
+        pageSize: 15
51
+      },
52
+      PageList: [],
53
+      HasNextPage: true,
54
+      IsRefreshing: false,
55
+      DataLock: false
56
+    }
57
+  },
58
+  computed: {
59
+    ...mapUserState({
60
+      UserInfo: x => x.UserInfo // 用户信息
61
+    })
62
+  },
63
+  components: {
64
+    ScrollY
65
+  },
66
+  created () {
67
+    this.Init() // 初始化
68
+  },
69
+  methods: {
70
+    ...mapUserActions([
71
+      'GetRecommedList' // 获取推荐的客户列表
72
+    ]),
73
+    Init () { // 初始化
74
+      this.PageData.pageNum = 1
75
+      this.HasNextPage = true
76
+      this.PageList = [] // 清空推荐的客户列表
77
+      this.ToGetPageList() // 获取列表
78
+    },
79
+    ToGetPageList () { // 获取列表
80
+      this.GetRecommedList({
81
+        urlData: { personId: this.UserInfo.PersonId },
82
+        queryData: { ...this.PageData }
83
+      }).then((res) => { // 获取推荐的客户列表
84
+        this.PageList = [...res.data.data]
85
+        this.NoData = !this.PageList.length
86
+        this.HasNextPage = res.data.data.current < res.data.data.pages
87
+        this.DataLock = false
88
+        this.IsRefreshing = false
89
+      }).catch(() => {
90
+        this.DataLock = false
91
+        this.IsRefreshing = false
92
+      })
93
+    },
94
+    ScrollBottom () { // 上拉加载
95
+      if (this.DataLock || !this.HasNextPage) return
96
+      this.DataLock = true
97
+      this.PageData.pageNum += 1
98
+      this.ToGetPageList() // 获取列表
99
+    },
100
+    Refresh (e) { // 页面下拉刷新
101
+      if (this.DataLock) return
102
+      this.DataLock = true
103
+      this.IsRefreshing = true
104
+      setTimeout(() => {
105
+        this.Init() // 获取列表
106
+      }, 1000)
107
+    }
108
+  }
109
+}
110
+</script>
111
+
112
+<style lang="scss">
113
+@import "page.scss";
114
+</style>

+ 75
- 0
src/pages/WoDe/MyRecommed/page.scss Visa fil

@@ -0,0 +1,75 @@
1
+.page.MyRecommed {
2
+  width: 100%;
3
+  height: 100%;
4
+  background: #fff;
5
+  .Container {
6
+    > .Title {
7
+      margin-top: 40px;
8
+      > image {
9
+        height: 50px;
10
+        margin-left: 20px;
11
+      }
12
+    }
13
+    > .List {
14
+      padding-left: 20px;
15
+      > .Item {
16
+        padding: 40px 0;
17
+        border-bottom: 2px solid #f5f5f5;
18
+        overflow: visible;
19
+        > .flex-item {
20
+          margin-right: 20px;
21
+          overflow: visible;
22
+          > text {
23
+            display: block;
24
+            font-size: 28px;
25
+            line-height: 40px;
26
+            overflow: hidden;
27
+            margin-top: 6px;
28
+            &:nth-child(1) {
29
+              text-overflow: ellipsis;
30
+              display: -webkit-box;
31
+              -webkit-box-orient: vertical;
32
+              -webkit-line-clamp: 2;
33
+              margin-top: 0;
34
+            }
35
+            &:nth-child(2) {
36
+              color: #666;
37
+              font-size: 24px;
38
+              white-space: nowrap;
39
+              text-overflow: ellipsis;
40
+            }
41
+            &:nth-child(3) {
42
+              display: inline-block;
43
+              color: #000;
44
+              font-size: 24px;
45
+              line-height: 52px;
46
+              padding: 0 20px;
47
+              border-radius: 52px;
48
+              background: #ccc;
49
+              box-shadow: 0 10px 20px 5px rgba(0, 0, 0, 0.1);
50
+              &.active {
51
+                background: #fe4e45;
52
+                color: #fff;
53
+                box-shadow: 0 10px 20px 5px rgba(254, 78, 69, 0.3);
54
+              }
55
+            }
56
+          }
57
+        }
58
+        > .Img {
59
+          width: 34%;
60
+          margin-right: 20px;
61
+          position: relative;
62
+          overflow: hidden;
63
+          border-radius: 12px;
64
+          > view {
65
+            width: 100%;
66
+            padding-bottom: 70%;
67
+            background: #ccc;
68
+            position: relative;
69
+            overflow: hidden;
70
+          }
71
+        }
72
+      }
73
+    }
74
+  }
75
+}

+ 8
- 1
src/pages/WoDe/index.vue Visa fil

@@ -22,11 +22,18 @@
22 22
     <view class="TabList">
23 23
       <navigator url="./MyActivityList/index" hover-class="other-navigator-hover" class="flex-h">
24 24
         <view>
25
-          <image mode="heightFix" src="https://cjgw.oss-cn-hangzhou.aliyuncs.com/ygcxxfb/image/wodeicon1.png"></image>
25
+          <image mode="heightFix" src="https://cjgw.oss-cn-hangzhou.aliyuncs.com/ygcxxfb/image/iconhuodong.png"></image>
26 26
         </view>
27 27
         <text class="flex-item">我的报名</text>
28 28
         <text class="iconfont iconjiantouright"></text>
29 29
       </navigator>
30
+      <navigator url="./MyRecommed/index" hover-class="other-navigator-hover" class="flex-h">
31
+        <view>
32
+          <image mode="heightFix" src="https://cjgw.oss-cn-hangzhou.aliyuncs.com/ygcxxfb/image/wodeicon1.png"></image>
33
+        </view>
34
+        <text class="flex-item">我的推荐</text>
35
+        <text class="iconfont iconjiantouright"></text>
36
+      </navigator>
30 37
       <!-- <navigator url="./Feedback/index" hover-class="other-navigator-hover" class="flex-h">
31 38
         <view>
32 39
           <image mode="heightFix" src="https://cjgw.oss-cn-hangzhou.aliyuncs.com/ygcxxfb/image/wodeicon2.png"></image>

+ 15
- 0
src/store/user/index.js Visa fil

@@ -17,6 +17,21 @@ export default {
17 17
     }
18 18
   },
19 19
   actions: {
20
+    GetRecommedList (context, payload) { // 获取推荐的客户列表
21
+      return new Promise((resolve, reject) => {
22
+        ToolClass.WxRequest({
23
+          url: Api.GetRecommedList.url,
24
+          method: Api.GetRecommedList.method,
25
+          ...payload,
26
+          success (res) {
27
+            resolve(res)
28
+          },
29
+          error (res) {
30
+            reject(res)
31
+          }
32
+        })
33
+      })
34
+    },
20 35
     GetUserActivityList (context, payload) { // 获取我的活动列表
21 36
       return new Promise((resolve, reject) => {
22 37
         ToolClass.WxRequest({

+ 4
- 0
src/util/Api/index.js Visa fil

@@ -2,6 +2,10 @@
2 2
 const prefix = process.env.NODE_ENV === 'production' ? '' : ''
3 3
 
4 4
 const Api = {
5
+  GetRecommedList: { // 获取推荐的客户列表
6
+    method: 'get',
7
+    url: `${prefix}/person/:personId/recommender`
8
+  },
5 9
   PostRecommed: { // 推荐客户
6 10
     method: 'post',
7 11
     url: `${prefix}/recommender`