Explorar el Código

Merge branch 'dev-majunjie' into dev

ccf hace 4 años
padre
commit
f3a65218a0

+ 105 - 0
components/account_change/accountChangePanel.vue

@@ -0,0 +1,105 @@
+<template>
+    <div class="account-change-panel-container">
+        <div class="account-change-title">选择您的角色</div>
+        <div class="account-change-main">
+            <div class="account-change-item">
+                <div class="account-change-img">
+                    <img src="https://iph.href.lu/100x100?fg=666666&bg=cccccc" />
+                </div>
+                <div class="account-change-tips">
+                    我是需求方
+                </div>
+                <div class="account-change-cur"></div>
+            </div>
+
+            <div class="account-change-item">
+                <div class="account-change-img">
+                    <img src="https://iph.href.lu/100x100?fg=666666&bg=cccccc" />
+                </div>
+                <div class="account-change-tips">
+                    我是开发者
+                </div>
+                <div class="account-change-cur"></div>
+            </div>
+        </div>
+        <div class="account-change-submit">确认选择</div>
+    </div>
+</template>
+
+<script>
+export default {
+
+}
+</script>
+
+
+<style lang="scss">
+.account-change-panel-container{
+    width: 880px;
+    height: 600px;
+    background: #FFFFFF;
+    border-radius: 8px;
+}
+.account-change-title{
+    margin-top: 40px;
+    margin-bottom: 50px;
+    text-align: center;
+    font-size: 28px;
+    font-family: PingFangSC-Medium, PingFang SC;
+    font-weight: 500;
+    color: #0B121A;
+    line-height: 40px
+}
+.account-change-main{
+    margin-left:58px;
+    margin-right: 58px;
+    overflow: hidden;
+    display: flex;
+    justify-content:space-between;
+}
+
+.account-change-item{
+    width: 360px;
+    height: 300px;
+    background: #FFFFFF;
+    border-radius: 16px;
+    border: 2px dotted #CED3D9;
+}
+
+.account-change-img{
+    margin:60px auto 0;
+    width:90px;
+    height:90px;
+    border-radius:100%;
+    overflow: hidden;
+    img{
+        width:90px;
+        height:90px;
+        border-radius:100%;
+    }
+}
+
+.account-change-tips{
+    margin-top: 24px;
+    font-size: 24px;
+    font-family: PingFangSC-Medium, PingFang SC;
+    font-weight: 500;
+    color: #0B121A;
+    line-height: 33px
+    text-align: center
+}
+
+.account-change-submit{
+    margin:58px auto 0 ;
+    width: 140px;
+    height: 48px;
+    border-radius: 24px;
+    border: 1px solid #4A5D74;
+    line-height: 48px;
+    text-align: center;
+
+    font-size: 18px;
+    font-weight: 500;
+    color: #4B5D73
+}
+</style>

+ 115 - 39
components/header.vue

@@ -170,23 +170,6 @@
             </el-dropdown-item>
           </el-dropdown-menu>
         </el-dropdown>
-      </div>
-      <div class="header-right">
-         <!-- 搜索 -->
-        <div style="margin-right:14px;">
-          <div style="position: relative;">
-            <input
-              class="input"
-              autocomplete="off"
-              placeholder="搜索您感兴趣的内容"
-              v-model="keywork"
-              @keyup.enter="clickInputEnter"
-            />
-            <i class="el-icon-search" @click="clickInputEnter"></i>
-          </div>
-          <div class="dropdown" style="display:none;"></div>
-          <div class="dropdown" style="display:none;"></div>
-        </div>
 
         <!-- 更多 -->
         <el-dropdown class="more-dropdown" placement="bottom-start" style="padding: 0 14px;">
@@ -219,8 +202,36 @@
           </el-dropdown-menu>
         </el-dropdown>
 
+
+        <!-- 搜索 -->
+        <div style="margin-left:40px;">
+          <div style="position: relative;">
+            <input
+              class="input"
+              autocomplete="off"
+              placeholder="搜索您感兴趣的内容"
+              v-model="keywork"
+              @keyup.enter="clickInputEnter"
+            />
+            <i class="el-icon-search" @click="clickInputEnter"></i>
+            <span class="input-line"></span>
+          </div>
+          <div class="dropdown" style="display:none;"></div>
+          <div class="dropdown" style="display:none;"></div>
+        </div>
+
+      </div>
+      <div class="header-right">
+         
+        <div v-if="isPersonalAccount || !myInfo.nickname" class="nav-button nav-button-type1">
+          发布需求
+        </div>
+        <div v-if="isCompanyAccount || !myInfo.nickname" class="nav-button nav-button-type2">
+          开发者入驻
+        </div>
+
         <template v-if="myInfo.nickname">
-          <el-dropdown class="nav-dropdown" style="padding:0 14px;">
+          <el-dropdown v-if="false" class="nav-dropdown" style="padding:0 14px;">
             <el-button type="text" @click="cnzz('导航栏目','工作台','')"  class="dashboard-title">
               <!-- <i class="el-icon-tickets"></i>工作台 -->
               <a class="workstation" :href="baseUrl + '/wo/work_todo'">
@@ -251,7 +262,7 @@
               </el-dropdown-item>
             </el-dropdown-menu> -->
           </el-dropdown>
-          <el-dropdown class="nav-dropdown" style="padding:0 14px;margin-right: 14px;">
+          <el-dropdown v-if="false" class="nav-dropdown" style="padding:0 14px;margin-right: 14px;">
             <el-button type="text" @click="cnzz('导航栏目','消息','')" class="message-box-title">
               <!-- <i class="el-icon-message"></i> -->
               消息
@@ -318,6 +329,14 @@
               </el-dropdown-item>
             </el-dropdown-menu>
           </el-dropdown>
+
+          <a
+            class="account-change"
+            style="margin-left: 20px;margin-right:40px"
+            :href="baseUrl + '/index/app'"
+            >切换身份</a
+          >
+
           <el-popover
             class="nav-popover"
             placement="bottom"
@@ -413,18 +432,21 @@
         <div v-else>
           <a
             class="account-ctrl"
-            style="margin-left: 14px;"
+            style="margin-left: 20px;"
             @click="cnzz('导航栏目','APP下载','')"
             :href="baseUrl + '/index/app'"
             >APP下载</a
           >
-          <a class="account-ctrl" @click="cnzz('导航栏目','登录','')" style="margin-left: 26px;margin-right:26px;" :href="loginUrl">登录</a>
           <a
             class="account-ctrl"
+             style="margin-left: 20px;margin-right:20px;"
+            
             @click="cnzz('导航栏目','注册','')"
             :href="baseUrl + '/user/register'"
             >注册</a
           >
+          <a class="account-ctrl" @click="cnzz('导航栏目','登录','')" style="margin-right:40px;" :href="loginUrl">登录</a>
+          
         </div>
       </div>
     </div>
@@ -469,6 +491,15 @@ export default {
         endDate: userinfo.vip_end_date
       };
     },
+
+    isPersonalAccount(){
+      let userinfo = this.$store.state.userinfo;
+      return userinfo.home_page_type == 2
+    },
+    isCompanyAccount(){
+      let userinfo = this.$store.state.userinfo;
+      return userinfo.home_page_type == 1
+    },
     myInfo() {
       return this.$store.state.userinfo;
     },
@@ -835,7 +866,7 @@ export default {
 .list {
   display: flex;
   justify-content: space-between;
-  width: 1200px;
+  width: 1440px;
 }
 .header-left {
   display: flex;
@@ -850,11 +881,11 @@ export default {
   display: flex;
   height: 83px;
   align-items: center;
-  font-size: 15px;
+  font-size: 14px;
   color: #515151;
   /* padding: 0 15px; */
   box-sizing: border-box;
-  padding: 0 14px;
+  padding: 0 20px;
 }
 .nav-item.logo {
   margin-right: 24px;
@@ -892,29 +923,46 @@ export default {
 }
 
 .logo {
-  width: 140px;
+  width: 126px;
   height: auto;
 }
 
 .input {
-  width: 234px;
-  height: 40px;
-  border-radius: 20px;
-  background: #f6f6f6;
-  padding: 0 40px;
-  border: 1px solid #ebebeb;
-  font-size: 13px;
+  width: 218px;
+  height: 34px;
+  background: #F7F8FA;
+  border-radius: 4px;
+  padding: 0 45px 0 16px;
+  /* border: 1px solid #ebebeb; */
+  font-size: 14px;
+  &::placeholder {
+      color: #828C99;
+  }
+  &:-ms-input-placeholder{
+    color:#828C99
+  }
 }
 .more-dropdown {
-  padding: 0 14px;
+  padding:0 20px;
+  
 }
 .el-icon-search {
   position: absolute;
-  top: 12px;
-  right: 20px;
+  top: 50%;
+  transform:translateY(-50%);
+  right: 11px;
   color: grey;
   cursor: pointer;
 }
+.input-line{
+  position: absolute;
+  top: 50%;
+  transform:translateY(-50%);
+  right: 39px;
+  width: 1px;
+  height: 12px;
+  border: 1px solid #EBECED;
+}
 
 .el-icon-credit {
   background: url("~@/assets/img/header/creditIconMine.png") no-repeat;
@@ -1116,8 +1164,13 @@ span.other-icon {
 }
 
 .account-ctrl {
-  color: #606266;
-  font-size: 15px;
+  color: #0B121A;
+  font-size: 14px;
+}
+.account-change{
+  color: #308EFF;
+  font-size: 14px;
+  
 }
 
 #proginn-header a {
@@ -1135,8 +1188,8 @@ span.other-icon {
 
 .message-box-title,
 .dashboard-title {
-  color: #515151;
-  font-size: 15px;
+  color: #0B121A;
+  font-size: 14px;
   font-weight: normal;
 }
 
@@ -1152,4 +1205,27 @@ span.other-icon {
 #proginn-header.transparent .nickname {
   color: white;
 }
+
+.nav-button{
+  width: 94px;
+  height: 30px;
+  line-height: 30px;
+  text-align: center;
+  font-size: 14px;
+  font-weight: 400;
+  color: #FFFFFF;
+  cursor: pointer;
+  font-family: PingFangSC-Regular, PingFang SC;
+}
+.nav-button-type1{
+  background: #308EFF;
+  border-radius: 2px;
+  margin-right:14px;
+}
+.nav-button-type2{
+  
+  background: #FF7640;
+  border-radius: 2px;
+  margin-right:20px;
+}
 </style>

+ 351 - 0
pages/frontend/account/change.vue

@@ -0,0 +1,351 @@
+<template>
+<div :class="mobile ? 'mobileMain' : ''" :style="{marginTop: mainMarginTop, marginBottom: mobile ? '0px' : '30px !important'}">
+
+    <div class="account-change-panel-container" v-if="!mobile">
+        <div class="account-change-title">选择您的角色</div>
+        <div class="account-change-main">
+            <div class="account-change-item">
+                <div class="account-change-img">
+                    <img src="https://iph.href.lu/100x100?fg=666666&bg=cccccc" />
+                </div>
+                <div class="account-change-tips">
+                    我是需求方
+                </div>
+                <div class="account-change-cur"></div>
+            </div>
+
+            <div class="account-change-item">
+                <div class="account-change-img">
+                    <img src="https://iph.href.lu/100x100?fg=666666&bg=cccccc" />
+                </div>
+                <div class="account-change-tips">
+                    我是开发者
+                </div>
+                <div class="account-change-cur"></div>
+            </div>
+        </div>
+        <div class="account-change-submit">确认选择</div>
+    </div>
+</div>
+</template>
+
+<script>
+import {
+    mapState
+} from "vuex"
+import DealSeoList from "@/components/learn/dealSeoList"
+import qs from "qs"
+
+export default {
+    name: 'SeoLearnList',
+    data() {
+        return {
+            baseUrl: '',
+            // firstLoad: true,
+            isWeixinApp: true,
+            categoryExpanded: true, // 更多按钮不要,默认为展开状态
+            showCategoryDrawer: false,
+            currentDrawerCategoryId: 0,
+            currentDrawerCategoryIndex: 0
+        }
+    },
+    head() {
+        const {
+            title = "",
+                keyword = "",
+                description = "",
+                h1 = "",
+                canonical = "",
+                metaLocation
+        } = this.head || {}
+        let obj = {
+            title: title,
+            meta: [{
+                name: "keywords",
+                content: keyword
+            }, {
+                name: "description",
+                content: description
+            }, {
+                name: "h1",
+                content: h1
+            }],
+            link: [{
+                rel: "canonical",
+                href: canonical
+            }]
+        }
+        if (metaLocation) {
+            obj.meta.push({
+                name: "location",
+                content: metaLocation
+            })
+        }
+        return obj
+    },
+    computed: {
+        ...mapState(["deviceType"]),
+        showWxHeader() {
+            return !this.deviceType.app && !this.isWeixinApp &&
+                (this.deviceType.android || this.deviceType.ios)
+        },
+        mainMarginTop() {
+            if (this.mobile && this.showWxHeader) {
+                return '64px !important'
+            } else if (this.mobile) {
+                return '0px !important'
+            } else {
+                return '20px !important'
+            }
+        }
+    },
+    async asyncData({
+        ...params
+    }) {
+        let dealDataObj = new DealSeoList(params)
+        let ans = await dealDataObj.dealData()
+
+        return {
+            ...ans
+        }
+    },
+    mounted() {
+        this.baseUrl = this.$store.state.domainConfig.siteUrl
+        this.isWeixinApp = navigator.userAgent.indexOf("miniProgram") > -1
+    },
+    methods: {
+        /** 分页获取技能列表数据 */
+        _getLearnList() {
+            const self = this
+            const data = {
+                type: 1,
+                page: this.pagination.page,
+                page_size: this.pagination.pagesize,
+                cate_id: this.pagination.selectedCateIdTwo,
+                status: 2,
+                owner_type: 1,
+                root_type: this.root_type
+            }
+
+            this.pagination.loading = true
+            this.pagination.noMore = false
+
+            this.$axios.$post('/api/sale/saleList', data).then(res => {
+                if (Number(res.status) === 1) {
+                    let learnList = res.data.list || []
+                    learnList.forEach((item) => {
+                        let imageList = item.image.split(',')
+                        item.coverImage = imageList[0] || ''
+                        imageList.splice(0, 1)
+                        item.imageList = imageList
+                    })
+
+                    if (self.mobile) {
+                        self.learnList = self.learnList.concat(learnList)
+                    } else {
+                        self.learnList = learnList
+                    }
+
+                    self.pagination.total = res.data.total
+                    self.pagination.pagesize = res.data.page_size || 9
+                    if (self.pagination.page * self.pagination.pagesize >= self.pagination.total) {
+                        console.log('noMore true', self.pagination)
+                        self.pagination.noMore = true
+                    } else {
+                        console.log('noMore false', self.pagination)
+                        self.pagination.noMore = false
+                    }
+                }
+            }).then(() => {
+                self.pagination.loading = false
+            })
+        },
+        /** 点击展开、收起 */
+        handleClickExpandCategory() {
+            this.categoryExpanded = !this.categoryExpanded
+        },
+        /** 点击一级分类时 */
+        handleClickCategoryOne(id) {
+            if (id === 0) {
+                // 点击全部时,移除筛选分类
+                this.pagination.selectedCateIdOne = id
+                this.pagination.selectedCateIdTwo = ''
+                this.currentDrawerCategoryId = ''
+                this.pagination.page = 1
+                this.learnList = []
+                window.scroll(0, 0)
+
+                this._getLearnList()
+                return
+            }
+            if (this.pagination.selectedCateIdOne !== id) {
+                this.pagination.selectedCateIdOne = id
+            }
+        },
+        /** 点击二级分类时:移动端 */
+        handleClickCategoryTwo(id) {
+            if (this.pagination.selectedCateIdTwo === id) {
+                this.pagination.selectedCateIdTwo = ''
+                this.currentDrawerCategoryId = ''
+            } else {
+                this.pagination.selectedCateIdTwo = id
+                this.currentDrawerCategoryId = id
+            }
+            this.pagination.page = 1
+            this.learnList = []
+            window.scroll(0, 0)
+
+            this._getLearnList()
+        },
+        /** 分页页码改变时 */
+        handlePageChange(val) {
+            let query = {
+                page: val
+            }
+            if (this.root_type && Number(this.root_type) > 0) {
+                query.root_type = this.root_type
+            }
+            window.location.href = `${window.location.origin}${window.location.pathname}?${qs.stringify(query)}`
+        },
+        /** mobile 加载更多 */
+        handleLoadMoreSkill() {
+            if (this.pagination.loading) {
+                return
+            }
+
+            this.pagination.page++
+            this._getLearnList()
+        },
+        /** 点击筛选时 */
+        handleShowCategoryDrawer() {
+            this.showCategoryDrawer = true
+        },
+        /**
+         * 点击 mobile 分类 drawer 一级分类
+         */
+        handleClickDrawerCategoryOne(id) {
+            if (id === 0) {
+                this.showCategoryDrawer = false
+                return
+            }
+            if (id !== this.currentDrawerCategoryIndex) {
+                this.currentDrawerCategoryIndex = id
+            }
+        },
+        /**
+         * 点击 mobile 分类 drawer 二级分类
+         */
+        handleClickDrawerCategoryTwo(id) {
+            if (this.currentDrawerCategoryId === id) {
+                this.pagination.selectedCateIdTwo = ''
+            } else {
+                this.pagination.selectedCateIdTwo = id
+            }
+            this.currentDrawerCategoryId = id
+            this.showCategoryDrawer = false
+            this.pagination.page = 1
+            this.learnList = []
+            window.scroll(0, 0)
+
+            this._getLearnList()
+        },
+        /**
+         * 点击 mobile 的一项技能时
+         */
+        handleClickSkillItem(saleId) {
+            if (this.deviceType.android || this.deviceType.ios) {
+                // 端跳转
+                let jumpUrl = `${this.baseUrl}/l/${saleId}`
+                location.href = `proginn://webview?url=${jumpUrl}`
+            } else {
+                // web 跳转
+                location.href = `/l/${saleId}`
+            }
+        },
+        /**
+         * 点击成为讲师
+         */
+        handleClickAdd() {
+            location.href = '/workbench/skill/index'
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+// @import "@/assets/css/learn/list.scss";
+</style>
+<style lang="scss">
+
+.account-change-panel-container{
+    width: 880px;
+    height: 600px;
+    background: #FFFFFF;
+    border-radius: 8px;
+    overflow: hidden;
+}
+.account-change-title{
+    margin-top: 40px;
+    margin-bottom: 50px;
+    text-align: center;
+    font-size: 28px;
+    font-family: PingFangSC-Medium, PingFang SC;
+    font-weight: 500;
+    color: #0B121A;
+    line-height: 40px
+}
+.account-change-main{
+    margin-left:58px;
+    margin-right: 58px;
+    overflow: hidden;
+    display: flex;
+    justify-content:space-between;
+}
+
+.account-change-item{
+    width: 360px;
+    height: 300px;
+    background: #FFFFFF;
+    border-radius: 16px;
+    border: 2px dotted #CED3D9;
+    cursor: pointer;
+}
+
+.account-change-img{
+    margin:60px auto 0;
+    width:90px;
+    height:90px;
+    border-radius:100%;
+    overflow: hidden;
+    img{
+        width:90px;
+        height:90px;
+        border-radius:100%;
+    }
+}
+
+.account-change-tips{
+    margin-top: 24px;
+    font-size: 24px;
+    font-family: PingFangSC-Medium, PingFang SC;
+    font-weight: 500;
+    color: #0B121A;
+    line-height: 33px;
+    text-align: center
+}
+
+.account-change-submit{
+    margin:58px auto 0 ;
+    width: 140px;
+    height: 48px;
+    border-radius: 24px;
+    border: 1px solid #4A5D74;
+    line-height: 48px;
+    text-align: center;
+
+    font-size: 18px;
+    font-weight: 500;
+    color: #4B5D73;
+    cursor: pointer;
+}
+</style>

+ 11 - 1
plugins/seoRouter.js

@@ -162,7 +162,17 @@ const extendRoutes = (routes, resolve) => {
         path: '/frontend/dynamic/info/:id?',
         component: resolve(__dirname, '../pages/frontend/dynamic/info.vue')
       }
-    ]
+    ],
+
+
+    // 切换身份
+    ...[
+      {
+        name: 'AccountChange',
+        path: '/frontend/accountchange',
+        component: resolve(__dirname, '../pages/frontend/account/change.vue')
+      }
+    ],
   );
 
   /**