소스 검색

Merge branch 'dev-majunjie' into dev

ccf 4 년 전
부모
커밋
bf22669f32
4개의 변경된 파일169개의 추가작업 그리고 47개의 파일을 삭제
  1. 32 7
      assets/css/developer/index.scss
  2. 21 12
      pages/frontend/developer/developData.js
  3. 40 0
      pages/frontend/developer/empty.vue
  4. 76 28
      pages/frontend/developer/index.vue

+ 32 - 7
assets/css/developer/index.scss

@@ -392,6 +392,7 @@
     font-weight: 400;
     color: #828c99;
     line-height: 20px;
+    cursor: pointer;
   }
 }
 .developer-reward-show-setting {
@@ -460,14 +461,16 @@
   font-weight: 400;
   color: #0b121a;
   cursor: pointer;
-
+  transition: all 0.3s;
   &:nth-child(2n + 1) {
     border-right: 1px solid #ebeced;
   }
   &:nth-last-child(n + 3) {
     border-bottom: 1px solid #ebeced;
   }
-
+  &.cur {
+    color: #288bff;
+  }
   &:hover {
     color: #288bff;
   }
@@ -482,9 +485,12 @@
 @for $i from 1 through 4 {
   .developer-skill-item {
     .icon#{$i} {
+      transition: all 0.3s;
       background-image: url("~@/assets/img/developer/sk_icno_#{$i}.png");
     }
-    &:hover {
+
+    &:hover,
+    &.cur {
       .icon#{$i} {
         background-image: url("~@/assets/img/developer/sk_icno_#{$i}_hover.png");
       }
@@ -517,7 +523,7 @@
   color: #4b5d73;
 
   cursor: pointer;
-
+  transition: all 0.5s;
   &.cur {
     font-size: 16px;
     font-family: PingFangSC-Medium, PingFang SC;
@@ -534,6 +540,7 @@
   height: 4px;
   background: #308eff;
   border-radius: 3px;
+  transition: all 0.5s;
 }
 
 .developer-tab-main {
@@ -554,12 +561,30 @@
   margin-top: 24px;
   padding-left: 24px;
   padding-right: 24px;
+  
+}
+
+.dynamic-empty {
+  margin-top: 100px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+  p {
+    margin-top: 24px;
+    text-align: center;
+    font-size: 14px;
+    font-family: PingFangSC-Regular, PingFang SC;
+    font-weight: 400;
+    color: #828c99;
+    line-height: 21px;
+  }
 }
 
 .developer-dynamic-item {
   margin-bottom: 41px;
   border-bottom: 1px solid #ebeced;
-  &:nth-last-child(1){
+  &:nth-last-child(1) {
     border-bottom: none;
   }
 }
@@ -602,7 +627,7 @@
   display: inline-block;
   margin-left: 8px;
   // width: 26px;
-  padding:0 6px;
+  padding: 0 6px;
   height: 14px;
   background: #4b5d73;
   border-radius: 9px;
@@ -665,7 +690,6 @@
   width: 90px;
   height: 90px;
   margin-bottom: 10px;
-
 }
 
 .dynamic-link-area {
@@ -706,6 +730,7 @@
   display: flex;
   align-items: center;
   justify-content: center;
+  cursor: pointer;
 
   font-size: 14px;
   font-family: PingFangSC-Regular, PingFang SC;

+ 21 - 12
pages/frontend/developer/developData.js

@@ -8,7 +8,7 @@ export default class DealSeoData {
         this.from = ''
         this.isExist = true
 
-        this.pagesize = 1
+        this.pagesize = 10
     }
 
     async dealData() {
@@ -62,23 +62,23 @@ export default class DealSeoData {
 
     // 获取用户信息
     async _getUserInfo() {
-        // let res = await this.$axios.$post('/uapi/user/info')
+        let res = await this.$axios.$post('/uapi/user/info')
 
-        let res = await this.$axios.$post('/api/user/getInfo')
+        // let res = await this.$axios.$post('/api/user/getInfo')
 
         let userInfo = {}
         if (Number(res.status) === 1) {
-            // let { info, login } = res.data
-            let info = {...res.data}
-            let login = {...res.data}
+            let { info, login } = res.data
+            // let info = {...res.data}
+            // let login = {...res.data}
 
             userInfo['realname_re'] = info.realname_re;
             userInfo['realname_verify_status'] = info.realname_verify_status;
             userInfo['dynamic_rand'] = info.dynamic_rand
-            // userInfo['is_open_mall'] = info.is_open_mall
-            // userInfo['is_open_kill'] = info.is_open_kill
-            // userInfo['is_open_consult'] = info.is_open_consult
-            // userInfo['is_open_kc'] = info.is_open_kc
+            userInfo['is_open_mall'] = info.is_open_mall
+            userInfo['is_open_kill'] = info.is_open_kill
+            userInfo['is_open_consult'] = info.is_open_consult
+            userInfo['is_open_kc'] = info.is_open_kc
 
             userInfo['nickname'] = login.nickname
             userInfo['icon_url'] = login.icon_url
@@ -127,7 +127,7 @@ export default class DealSeoData {
             // 整包
             workPlatInfo['developerProjectNumber'] = info['developerProjectNumber']
             // 沟通
-            workPlatInfo['hireDeveloperProjectNumber'] = info['hireDeveloperProjectNumber']
+            workPlatInfo['recruitDeveloperCount'] = info['recruitDeveloperCount']
 
         } else if (Number(res.status) === 40001) {
             this.isExist = false
@@ -148,7 +148,16 @@ export default class DealSeoData {
 
         if (Number(res.status) === 1) {
             let info = res.data.list
-
+            info = info.map((item) => {
+                let imgList = item.img
+                imgList = imgList.map(item => {
+                    return item.img
+                })
+                return {
+                    ...item,
+                    imgList
+                }
+            })
             dynamicList = [...info]
         } else if (Number(res.status) === 40001) {
             this.isExist = false

+ 40 - 0
pages/frontend/developer/empty.vue

@@ -0,0 +1,40 @@
+<template>
+<div class="el-empty__image" style="width: 200px;">
+    <svg viewBox="0 0 79 86" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+        <defs>
+            <linearGradient id="linearGradient-1-5" x1="38.8503086%" y1="0%" x2="61.1496914%" y2="100%">
+                <stop stop-color="#FCFCFD" offset="0%" />
+                <stop stop-color="#EEEFF3" offset="100%" />
+            </linearGradient>
+            <linearGradient id="linearGradient-2-5" x1="0%" y1="9.5%" x2="100%" y2="90.5%">
+                <stop stop-color="#FCFCFD" offset="0%" />
+                <stop stop-color="#E9EBEF" offset="100%" />
+            </linearGradient>
+            <rect id="path-3-5" x="0" y="0" width="17" height="36" />
+        </defs>
+        <g id="Illustrations" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+            <g id="B-type" transform="translate(-1268.000000, -535.000000)">
+                <g id="Group-2" transform="translate(1268.000000, 535.000000)">
+                    <path id="Oval-Copy-2" d="M39.5,86 C61.3152476,86 79,83.9106622 79,81.3333333 C79,78.7560045 57.3152476,78 35.5,78 C13.6847524,78 0,78.7560045 0,81.3333333 C0,83.9106622 17.6847524,86 39.5,86 Z" fill="#F7F8FC" />
+                    <polygon id="Rectangle-Copy-14" fill="#E5E7E9" transform="translate(27.500000, 51.500000) scale(1, -1) translate(-27.500000, -51.500000) " points="13 58 53 58 42 45 2 45" />
+                    <g id="Group-Copy" transform="translate(34.500000, 31.500000) scale(-1, 1) rotate(-25.000000) translate(-34.500000, -31.500000) translate(7.000000, 10.000000)">
+                        <polygon id="Rectangle-Copy-10" fill="#E5E7E9" transform="translate(11.500000, 5.000000) scale(1, -1) translate(-11.500000, -5.000000) " points="2.84078316e-14 3 18 3 23 7 5 7" />
+                        <polygon id="Rectangle-Copy-11" fill="#EDEEF2" points="-3.69149156e-15 7 38 7 38 43 -3.69149156e-15 43" />
+                        <rect id="Rectangle-Copy-12" fill="url(#linearGradient-1-5)" transform="translate(46.500000, 25.000000) scale(-1, 1) translate(-46.500000, -25.000000) " x="38" y="7" width="17" height="36" />
+                        <polygon id="Rectangle-Copy-13" fill="#F8F9FB" transform="translate(39.500000, 3.500000) scale(-1, 1) translate(-39.500000, -3.500000) " points="24 7 41 7 55 -3.63806207e-12 38 -3.63806207e-12" />
+                    </g>
+                    <rect id="Rectangle-Copy-15" fill="url(#linearGradient-2-5)" x="13" y="45" width="40" height="36" />
+                    <g id="Rectangle-Copy-17" transform="translate(53.000000, 45.000000)">
+                        <mask id="mask-4-5" fill="white">
+                            <use xlink:href="#path-3-5" />
+                        </mask>
+                        <use id="Mask" fill="#E0E3E9" transform="translate(8.500000, 18.000000) scale(-1, 1) translate(-8.500000, -18.000000) " xlink:href="#path-3-5" />
+                        <polygon id="Rectangle-Copy" fill="#D5D7DE" mask="url(#mask-4-5)" transform="translate(12.000000, 9.000000) scale(-1, 1) translate(-12.000000, -9.000000) " points="7 0 24 0 20 18 -1.70530257e-13 16" />
+                    </g>
+                    <polygon id="Rectangle-Copy-18" fill="#F8F9FB" transform="translate(66.000000, 51.500000) scale(-1, 1) translate(-66.000000, -51.500000) " points="62 45 79 45 70 58 53 58" />
+                </g>
+            </g>
+        </g>
+    </svg>
+</div>
+</template>

+ 76 - 28
pages/frontend/developer/index.vue

@@ -153,11 +153,13 @@
             <section class="developer-tab">
                 <div class="developer-tab-title-list">
                     <!-- cur -->
-                    <div v-for="typeItem in typeList" :key="typeItem.typeId" :data-typeid="typeItem.typeId" class="developer-tab-title-item ">
+                    <div v-for="typeItem in typeList" :key="typeItem.typeId" @click="reset(typeItem.typeId)" :data-typeid="typeItem.typeId" :class="tid == typeItem.typeId ? 'cur' : ''" class="developer-tab-title-item">
                         {{ typeItem.name }}
                     </div>
 
-                    <div class="developer-tab-title-line"></div>
+                    <div :style="{
+                transform: 'translateX(' + dynamicTranlate + 'px)'
+              }" class="developer-tab-title-line"></div>
                 </div>
 
                 <div class="developer-tab-main">
@@ -165,7 +167,7 @@
                         PC端圈子发布功能尚未上线,可下载APP体验哦~
                     </p>
 
-                    <ul class="developer-dynamic-list">
+                    <ul class="developer-dynamic-list" v-if="list.length > 0">
                         <li v-for="dynamic in list" :key="dynamic.dynamicId" class="developer-dynamic-item">
                             <div class="dynamic-user">
                                 <div class="dynamic-user-avatar">
@@ -187,9 +189,11 @@
                             <div class="dynamic-type-list dynamic-margin">
                                 <span class="dynamic-type-item">{{ dynamic.type_text }}</span>
                             </div>
-                            <div class="dynamic-img-area dynamic-margin" v-if="dynamic.img.length > 0">
+                            <div class="dynamic-img-area dynamic-margin" v-if="dynamic.img && dynamic.img.length > 0">
                                 <div class="dynamic-img-item" v-for="d_img in dynamic.img" :key="d_img.img">
-                                    <img :src="d_img.img" />
+                                    <!-- <img :src="d_img.img" /> -->
+                                    <el-image style="width:90px;height:90px" fit="cover" :src="d_img.img" :preview-src-list="dynamic.imgList">
+                                    </el-image>
                                 </div>
                             </div>
                             <div class="dynamic-link-area dynamic-margin">
@@ -204,12 +208,17 @@
                             </div>
 
                             <div class="dynamic-control">
-                                <div class="dynamic-control-item">分享</div>
-                                <div class="dynamic-control-item">评论</div>
-                                <div class="dynamic-control-item">赞</div>
+                                <div class="dynamic-control-item" @click="gotoAppTips">分享</div>
+                                <div class="dynamic-control-item" @click="gotoAppTips">评论</div>
+                                <div class="dynamic-control-item" @click="gotoAppTips">赞</div>
                             </div>
                         </li>
                     </ul>
+
+                    <div class="dynamic-empty" v-else>
+                        <Empty></Empty>
+                        <p>暂无动态</p>
+                    </div>
                 </div>
             </section>
             <!-- 推荐tab:start -->
@@ -239,9 +248,9 @@
                         <div class="developer-work-tips">待办</div>
                     </div>
 
-                    <div class="developer-work-item" @click="gotoApp">
+                    <div class="developer-work-item" @click="gotoAppTips">
                         <div class="developer-work-count">
-                            {{ workPlatInfo.hireDeveloperProjectNumber }}
+                            {{ workPlatInfo.recruitDeveloperCount }}
                         </div>
                         <div class="developer-work-tips">沟通</div>
                     </div>
@@ -302,16 +311,16 @@
             <!-- 收入:end -->
 
             <div class="developer-skill block">
-                <div class="developer-skill-item" @click="goto('/workbench/skill/index')">
+                <div class="developer-skill-item" :class="userInfo.is_open_kill == 1 ? 'cur':''" @click="goto('/workbench/skill/index')">
                     <span class="developer-skill-icon icon1"></span>发布技能
                 </div>
-                <div class="developer-skill-item" @click="goto('/workbench/consult/index')">
+                <div class="developer-skill-item" :class="userInfo.is_open_consult == 1 ? 'cur':''" @click="goto('/workbench/consult/index')">
                     <span class="developer-skill-icon icon2"></span>发布咨询
                 </div>
-                <div class="developer-skill-item" @click="goto('/workbench/learn/index')">
+                <div class="developer-skill-item" :class="userInfo.is_open_mall == 1 ? 'cur':''" @click="goto('/workbench/learn/index')">
                     <span class="developer-skill-icon icon3"></span>上传课程
                 </div>
-                <div class="developer-skill-item" @click="goto('/otherpage/works/create')">
+                <div class="developer-skill-item" :class="userInfo.is_open_kc == 1 ? 'cur':''" @click="goto('/otherpage/works/create')">
                     <span class="developer-skill-icon icon4"></span>上传资源
                 </div>
             </div>
@@ -326,8 +335,12 @@ import {
 } from "vuex";
 import qs from "qs";
 import DeveloperSeoData from "./developData";
+import Empty from "./empty";
 export default {
     name: "SeoLearnList",
+    components: {
+        Empty
+    },
     data() {
         return {
             baseUrl: "",
@@ -407,6 +420,20 @@ export default {
         // 是否签约
         isSign() {
             return this.userInfo["realname_re"] == 2 ? true : false;
+        },
+        dynamicTranlate() {
+            let typeList = this.typeList;
+            let total = 730;
+            let block = parseInt(total / typeList.length);
+            let half = parseInt(block / 2);
+            let line = 24 / 2;
+            let curIndex = this.typeList.findIndex(item => {
+                return item.typeId == this.tid;
+            });
+            curIndex = curIndex ? curIndex : 0;
+
+            let result = curIndex * block + half - line;
+            return result;
         }
     },
     async asyncData({
@@ -436,8 +463,8 @@ export default {
         this.list = [...this.dynamicList];
 
         this.$nextTick(() => {
-            this.listenToEnd()
-        })
+            this.listenToEnd();
+        });
     },
     destroy: function () {
         window.onscroll = null;
@@ -446,6 +473,9 @@ export default {
         gotoApp() {
             this.$message("请前往APP完成实名");
         },
+        gotoAppTips() {
+            this.$message("请前往APP查看");
+        },
         goto(url) {
             location.href = url;
         },
@@ -474,19 +504,21 @@ export default {
         listenToEnd() {
             let that = this;
             window.onscroll = function () {
-                var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
-                var windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
-                var scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
+                var scrollTop =
+                    document.documentElement.scrollTop || document.body.scrollTop;
+                var windowHeight =
+                    document.documentElement.clientHeight || document.body.clientHeight;
+                var scrollHeight =
+                    document.documentElement.scrollHeight || document.body.scrollHeight;
 
                 if (scrollHeight - scrollTop - windowHeight < 400) {
-                    console.log(1231)
-                    that.fetchDynamicData()
+                    that.fetchDynamicData();
                 }
-
-            }
+            };
         },
         reset(type_id) {
-            this.page = 1;
+            if (this.pageLoading) return;
+            this.page = 0;
             this.isMore = true;
             this.tid = type_id;
             this.list = [];
@@ -494,22 +526,38 @@ export default {
             this.fetchDynamicData();
         },
         async fetchDynamicData() {
-            if (this.pageLoading || !this.isMore) return
+            if (this.pageLoading || !this.isMore) return;
             this.pageLoading = true;
             let page = this.page + 1;
+            let type_id = this.tid
             let res = await this.$axios.$post("/uapi/dynamic/get_dynamic_detail", {
-                type_id: this.tid,
+                type_id: type_id,
                 page: page,
                 pagesize: this.pageSize
             });
 
             setTimeout(() => {
                 this.pageLoading = false;
-            }, 300)
+            }, 100);
 
             if (Number(res.status) === 1) {
+
+                // if (type_id != this.tid) {
+                //     return
+                // }
                 let info = res.data.list;
-                this.page = page
+                info = info.map((item) => {
+                    let imgList = item.img
+                    imgList = imgList.map(item => {
+                        return item.img
+                    })
+                    return {
+                        ...item,
+                        imgList
+                    }
+                })
+
+                this.page = page;
                 this.list = [...this.list, ...info];
                 this.isMore = info.length < this.pageSize ? false : true;
             } else if (Number(res.status) === 40001) {