Bläddra i källkod

1、咨询服务创建部分;2、反馈细节修改;

huan-jie 4 år sedan
förälder
incheckning
6adeab7731

+ 36 - 18
assets/css/consult/create.scss

@@ -20,7 +20,7 @@
     }
     .form-wrapper {
         position: relative;
-        width: 640px;
+        width: 768px;
         margin-top: 30px;
         .field-name {
             height: 20px;
@@ -30,19 +30,30 @@
             font-weight: 500;
             color: #19222e;
         }
-        .consult-field {
+        .title-field {
             position: relative;
-            .consult-title-input {
+            .title-input {
                 width: 100%;
                 margin-top: 5px;
             }
         }
+        .content-field {
+            position: relative;
+            margin-top: 20px;
+            .content-editor {
+                margin-top: 5px;
+                .ql-show {
+                    border: 1px solid #d7dfe8;
+                }
+            }
+        }
         .price-field {
             position: relative;
             display: flex;
+            margin-top: 20px;
             .price-wrapper {
                 position: relative;
-                width: 300px;
+                width: 374px;
                 .price-input {
                     width: 100%;
                     // height: 44px;
@@ -60,27 +71,35 @@
                 }
             }
             .cate-wrapper {
-                width: 300px;
-                margin-left: 40px;
+                width: 374px;
+                margin-left: 20px;
                 .cate-cascader {
                     margin-top: 5px;
                     width: 100%;
                 }
             }
         }
-        .content-field {
-            position: relative;
+        .week-field {
+            margin-top: 32px;
+            display: flex;
+            align-items: center;
+            .week-field-name {
+                font-size: 14px;
+                font-family: PingFangSC, PingFangSC-Medium;
+                font-weight: 500;
+                color: #19222e;
+            }
+        }
+        .time-field {
             margin-top: 20px;
-            .content-editor {
+            .time-picker {
                 margin-top: 5px;
-                .ql-show {
-                    border: 1px solid #d7dfe8;
-                }
             }
         }
         .image-field {
             position: relative;
-            .skill-image-uploader {
+            margin-top: 20px;
+            .consult-image-uploader {
                 margin-top: 12px;
             }
             .upload-tips {
@@ -97,7 +116,7 @@
     }
     .example-wrapper {
         position: relative;
-        width: 640px;
+        width: 768px;
         margin-top: 20px;
         padding: 20px;
         background: #f6f8f9;
@@ -141,11 +160,10 @@
         }
     }
     .actions-wrapper {
-        width: 640px;
-        margin-top: 20px;
+        width: 768px;
+        margin-top: 32px;
         display: flex;
         align-items: center;
-        justify-content: space-between;
         .prev-btn {
             // width: 128px;
             // height: 42px;
@@ -169,7 +187,7 @@
             font-weight: 500;
             color: #308eff;
         }
-        .next-btn {
+        .create-btn {
             width: 128px;
             height: 44px;
             background: #308eff;

+ 8 - 5
assets/css/skill/list.scss

@@ -106,10 +106,10 @@
             margin-top: 16px;
             .category-two-content {
                 position: relative;
-                width: 750px;
+                width: 830px;
                 height: auto;
-                padding: 10px 20px 20px;
-                margin-left: 80px;
+                padding: 5px 20px 10px;
+                // margin-left: 80px;
                 background: #f7f7f7;
                 border-radius: 8px;
                 display: flex;
@@ -117,7 +117,7 @@
                 .category-two-item {
                     height: 30px;
                     line-height: 30px;
-                    margin-top: 10px;
+                    margin-top: 5px;
                     padding: 0 15px;
                     color: #555555;
                     border-radius: 4px;
@@ -156,7 +156,7 @@
                 box-shadow: 0px 6px 16px 0px rgba(6,10,28,0.06); 
                 display: flex;
                 flex-direction: column;
-                cursor: pointer;
+                // cursor: pointer;
                 &:nth-of-type(3n) {
                     margin-right: 0;
                 }
@@ -204,6 +204,9 @@
                     white-space: normal;
                     -webkit-box-orient: vertical;
                     -webkit-line-clamp: 2;
+                    &:hover {
+                        color: #308eff;
+                    }
                 }
                 .price-wrapper {
                     width: 100%;

+ 5 - 1
components/multi-uploader.vue

@@ -3,7 +3,7 @@
     <el-upload
       action="/upload_image"
       list-type="picture-card"
-      :limit="9"
+      :limit="limit"
       accept=".jpg,.jpeg,.png,.gif,.JPG,.PNG,.JPEG,.GIF"
       ref="multiUploader"
       with-credentials
@@ -32,6 +32,10 @@ export default {
     showTips: {
       type: Boolean,
       default: true
+    },
+    limit: {
+      type: Number,
+      default: 9
     }
   },
   model: {

+ 16 - 11
pages/cert/type/_id.vue

@@ -31,20 +31,20 @@
         <div class="verify-title">申请认证流程及条件</div>
         <div class="condition-item" :class="conditions[0] && conditions[0].is_completed ? 'condition-item-completed' : ''">
           <div class="condition-point"></div>
-          <div class="condition-text">01: 签约程序员客栈</div>
           <div v-if="conditions[0] && conditions[0].is_completed" class="action">已签约</div>
+          <div class="condition-text">签约程序员客栈</div>
           <!-- <a v-else :href="`${baseUrl}/sign/new`" class="action active">去签约</a> -->
         </div>
         <div class="condition-item" :class="conditions[1] && conditions[1].is_completed ? 'condition-item-completed' : ''">
           <div class="condition-point"></div>
-          <div class="condition-text">02: 客栈评分不低于4.3</div>
           <div v-if="conditions[1] && conditions[1].is_completed" class="action">已达标</div>
+          <div class="condition-text">客栈评分不低于4.3</div>
           <!-- <a v-else :href="`${baseUrl}/sign/new`" class="action active">去签约</a> -->
         </div>
         <div class="condition-item" :class="conditions[2] && conditions[2].is_completed ? 'condition-item-completed' : ''">
           <div class="condition-point"></div>
-          <div class="condition-text">03: 在程序员客栈平台完成不低于3个项目,且累计提现超过3万</div>
           <div v-if="conditions[2] && conditions[2].is_completed" class="action">已达标</div>
+          <div class="condition-text">在程序员客栈平台完成不低于3个项目,且累计提现超过3万</div>
           <!-- <a v-else :href="`${baseUrl}/sign/new`" class="action active">去签约</a> -->
         </div>
         <div class="verify-tips" v-if="!f2f3ConditionsCompelete">提示:由于您未在以上条件未达标,您还可以通过提交过往知名互联网公司职级证明,申请人工审核认证</div>
@@ -54,20 +54,20 @@
         <div class="verify-title">申请认证流程及条件</div>
         <div class="condition-item" :class="conditions[0] && conditions[0].is_completed ? 'condition-item-completed' : ''">
           <div class="condition-point"></div>
-          <div class="condition-text">01: 签约程序员客栈</div>
           <div v-if="conditions[0] && conditions[0].is_completed" class="action">已签约</div>
+          <div class="condition-text">签约程序员客栈</div>
           <!-- <a v-else :href="`${baseUrl}/sign/new`" class="action active">去签约</a> -->
         </div>
         <div class="condition-item" :class="conditions[1] && conditions[1].is_completed ? 'condition-item-completed' : ''">
           <div class="condition-point"></div>
-          <div class="condition-text">02: 客栈评分不低于4.5</div>
           <div v-if="conditions[1] && conditions[1].is_completed" class="action">已达标</div>
+          <div class="condition-text">客栈评分不低于4.5</div>
           <!-- <a v-else :href="`${baseUrl}/sign/new`" class="action active">去签约</a> -->
         </div>
         <div class="condition-item" :class="conditions[2] && conditions[2].is_completed ? 'condition-item-completed' : ''">
           <div class="condition-point"></div>
-          <div class="condition-text">03: 在程序员客栈平台完成不低于10个项目,且累计提现超过10万</div>
           <div v-if="conditions[2] && conditions[2].is_completed" class="action">已达标</div>
+          <div class="condition-text">在程序员客栈平台完成不低于10个项目,且累计提现超过10万</div>
           <!-- <a v-else :href="`${baseUrl}/sign/new`" class="action active">去签约</a> -->
         </div>
         <div class="verify-tips" v-if="!f2f3ConditionsCompelete">提示:由于您未在以上条件未达标,您还可以通过提交过往知名互联网公司职级证明,申请人工审核认证</div>
@@ -637,15 +637,19 @@ export default {
   color: #222222;
 }
 .f2-verify-wrapper .condition-item {
-  height: 40px;
-  line-height: 40px;
+  /* height: 40px;
+  line-height: 40px; */
+  min-height: 40px;
+  line-height: 30px;
   font-size: 15px;
   display: flex;
-  align-items: center;
+  /* align-items: center; */
 }
 .f2-verify-wrapper .condition-item .condition-point {
+  flex-shrink: 0;
   width: 10px;
   height: 10px;
+  margin-top: 10px;
   background: #d8d8d8;
   border-radius: 50%;
   margin-right: 12px;
@@ -655,13 +659,14 @@ export default {
 }
 .f2-verify-wrapper .condition-item .condition-text {
   color: #222222;
-  margin-right: 26px;
-  /* width: 250px; */
+  /* margin-right: 26px;
+  width: 250px; */
 }
 .f2-verify-wrapper .condition-item .action {
   color: rgba(39,187,111,1);
   font-family: PingFangSC, PingFangSC-Semibold;
   font-weight: 600;
+  margin-right: 12px;
 }
 .f2-verify-wrapper .condition-item .action.active {
   color: #409eff;

+ 174 - 8
pages/frontend/consult/create.vue

@@ -2,13 +2,103 @@
     <div class="create-consult-wrapper">
         <div class="create-consult-title">创建话题</div>
         <div class="form-wrapper">
-            <div class="consult-field">
+            <!-- 标题 -->
+            <div class="title-field">
                 <div class="field-name">话题标题</div>
                 <el-input
-                    class="consult-title-input"
+                    class="title-input"
                     v-model="title"
                     placeholder="请输入话题"></el-input>
             </div>
+            <!-- 描述 -->
+            <div class="content-field">
+                <div class="field-name">话题描述</div>
+                <div class="content-editor">
+                    <editor
+                        :hideImage="false"
+                        :content="content"
+                        @change="handleChange"
+                        placeholder="请输入话题描述"></editor>
+                </div>
+            </div>
+            <!-- 价格、分类 -->
+            <div class="price-field">
+                <div class="price-wrapper">
+                    <div class="field-name">话题价格</div>
+                    <el-input
+                        class="price-input"
+                        type="number"
+                        placeholder="请输入价格"
+                        v-model="price"></el-input>
+                    <span>元</span>
+                </div>
+                <div class="cate-wrapper">
+                    <div class="field-name">话题类别</div>
+                    <el-cascader
+                        class="cate-cascader"
+                        v-model="selectedConsultCate"
+                        :options="consultCate"
+                        :props="{ expandTrigger: 'hover' }"
+                        placeholder="请选择类别"></el-cascader>
+                </div>
+            </div>
+            <!-- 咨询时间 -->
+            <div class="week-field">
+                <div class="week-field-name">咨询时间:</div>
+                <el-checkbox-group class="week-checkbox" v-model="week">
+                    <el-checkbox-button label="monday">周一</el-checkbox-button>
+                    <el-checkbox-button label="tuesday">周二</el-checkbox-button>
+                    <el-checkbox-button label="wednesday">周三</el-checkbox-button>
+                    <el-checkbox-button label="thursday">周四</el-checkbox-button>
+                    <el-checkbox-button label="friday">周五</el-checkbox-button>
+                    <el-checkbox-button label="saturday">周六</el-checkbox-button>
+                    <el-checkbox-button label="sunday">周日</el-checkbox-button>
+                </el-checkbox-group>
+            </div>
+            <!-- 开放时间 -->
+            <div class="time-field">
+                <div class="field-name">开放时间</div>
+                <el-time-picker
+                    class="time-picker"
+                    is-range
+                    :editable="false"
+                    value-format="HH:mm"
+                    v-model="time"
+                    range-separator="至"
+                    start-placeholder="开始时间"
+                    end-placeholder="结束时间"
+                    placeholder="选择时间范围"
+                    :picker-options="{
+                        selectableRange: '18:30:00 - 20:30:00',
+                        format: 'HH:mm'
+                    }">
+                </el-time-picker>
+            </div>
+            <!-- 图片 -->
+            <div class="image-field">
+                <div class="field-name">话题介绍图</div>
+                <multi-uploader
+                    class="consult-image-uploader"
+                    :showTips="false"
+                    :limit="1"
+                    v-model="imageList"></multi-uploader>
+                <div class="upload-tips">请上传话题介绍图,至多一张
+                    建议比例16:9(如:1920*1080、800*450)支持J(E)PG、PNG、GIF格式,小于5MB
+                </div>
+            </div>
+            <!-- 按钮 -->
+            <div class="actions-wrapper">
+                <el-button
+                    class="create-btn"
+                    :loading="publishIsLoading"
+                    :disabled="pcreateIsLoading"
+                    @click="handleCreate">提交审核</el-button>
+                <el-button
+                    class="pcreate-btn"
+                    :loading="pcreateIsLoading"
+                    :disabled="publishIsLoading"
+                    @click="handlePcreate">存草稿</el-button>
+            </div>
         </div>
     </div>
 </template>
@@ -32,6 +122,14 @@ export default {
             title: '', // 标题
             selectedConsultCate: [], // 选中的技能分类
             consultCate: [], // 技能分类数据源
+            content: '', // 话题描述
+            defaultContent: '', // 默认的话题描述
+            price: '', // 价格
+            week: [], // 接受咨询的星期几
+            time: [], // 接受咨询的时间范围
+            imageList: [], // 用户上传的图片
+            publishIsLoading: false,
+            pcreateIsLoading: false
         }
     },
     mounted () {
@@ -43,16 +141,16 @@ export default {
         }
     },
     methods: {
-        /** 获取技能分类 */
+        /** 获取咨询分类 */
         _getConsultCate () {
-            this.$axios.$post('/api/sale/cateListYes', { type: 3 }).then(res => {
+            this.$axios.$post('/api/sale/cateListYes', { type: 3, point: 1 }).then(res => {
                 if (res.status === 1) {
                     let consultCate = res.data || []
                     this.consultCate = consultCate.map(item => {
                         let children = item.child_list.map(child => {
                             return {
-                            value: child.category_id,
-                            label: child.name
+                                value: child.category_id,
+                                label: child.name
                             }
                         })
                         return {
@@ -66,7 +164,7 @@ export default {
                 console.log('get consult cate error: ', err)
             })
         },
-        /** 获取技能培训详情 */
+        /** 获取咨询服务详情 */
         _getConsultDetail () {
             const self = this
 
@@ -83,6 +181,74 @@ export default {
             //     }
             // })
         },
+        /** 创建、编辑咨询服务 */
+        _publishConsultData (actionType) {
+
+        },
+        /** 验证提交的数据 */
+        _validateConsultData () {
+            if (this.title === '') {
+                this.$message.error('请输入话题标题')
+                return false
+            }
+            if (this.title.length < 5) {
+                this.$message.error('话题标题不可少于5字符')
+                return false
+            }
+            if (this.title.length > 50) {
+                this.$message.error('话题标题不可超过50字符,请删减')
+                return false
+            }
+            if (this.content.length < 50) {
+                this.$message.error('话题描述不可少于50字符')
+                return false
+            }
+            if (this.content.length > 5000) {
+                this.$message.error('话题描述不可超过5000字符,请删减')
+                return false
+            }
+            if (this.price < 1 || this.price > 100000) {
+                this.$message.error('请输入1-100000元的整数价格')
+                return false
+            }
+            if (String(this.price).indexOf('.') > -1) {
+                if (parseInt(this.price) != Number(this.price)) {
+                    this.$message.error('价格只能为整数')
+                    return false
+                }
+            }
+            if (this.selectedConsultCate.length !== 2 ||
+                (!this.selectedConsultCate[0] || !this.selectedConsultCate[1])) {
+                this.$message.error('请选择话题类别')
+                return false
+            }
+            if (this.week.length === 0) {
+                this.$message.error('请选择咨询时间')
+                return false
+            }
+            if (this.time.length === 0) {
+                this.$message.error('请选择开放时间')
+                return false
+            }
+
+            return true
+        },
+        /** 技能描述内容改变时 */
+        handleChange (val) {
+            this.content = val
+        },
+        /** 点击提交审核时 */
+        handleCreate () {
+            if (this._validateConsultData()) {
+                this._publishConsultData(this.sale_id ? 'update' : 'create')
+            }
+        },
+        /** 点击存草稿时 */
+        handlePcreate () {
+            if (this._validateConsultData()) {
+                this._publishConsultData('pcreate')
+            }
+        },
     }
 }
 </script>
@@ -116,7 +282,7 @@ input[type="number"]{
     }
 }
 // 图片上传器样式
-.skill-image-uploader {
+.consult-image-uploader {
     .el-upload-list__item {
         width: 300px !important;
         height: 168.75px !important;

+ 2 - 2
pages/frontend/skill/create.vue

@@ -63,7 +63,7 @@
                         v-model="imageList"></multi-uploader>
                     <div class="upload-tips">建议上传多张能证明技能价值的图片
                         第一张默认为封面
-                        建议比例16:9(如:1920*1080、800*450)支持JPG、PNG、GIF格式,小于5MB
+                        建议比例16:9(如:1920*1080、800*450)支持J(E)PG、PNG、GIF格式,小于5MB
                     </div>
                 </div>
             </div>
@@ -172,7 +172,7 @@ export default {
     methods: {
         /** 获取技能分类 */
         _getSkillCate () {
-            this.$axios.$post('/api/sale/cateListYes', { type: 2 }).then(res => {
+            this.$axios.$post('/api/sale/cateListYes', { type: 2, point: 1 }).then(res => {
                 if (res.status === 1) {
                     let skillCate = res.data || []
                     this.skillCate = skillCate.map(item => {

+ 3 - 3
pages/frontend/skill/detail/_id.vue

@@ -51,15 +51,15 @@
                 <div class="contact-wrapper">
                     <div class="contact-item">
                         <img src="@/assets/img/skill/phone-icon@2x.png" alt="">
-                        <div class="contact-text">{{ skillDetail.user.tel || '' }}</div>
+                        <div class="contact-text">{{ skillDetail.user.tel || '未留存' }}</div>
                     </div>
                     <div class="contact-item">
                         <img src="@/assets/img/skill/wechat-icon@2x.png" alt="">
-                        <div class="contact-text">{{ skillDetail.user.weixin || '' }}</div>
+                        <div class="contact-text">{{ skillDetail.user.weixin || '未留存' }}</div>
                     </div>
                     <div class="contact-item">
                         <img src="@/assets/img/skill/email-icon@2x.png" alt="">
-                        <div class="contact-text">{{ skillDetail.user.email || '' }}</div>
+                        <div class="contact-text">{{ skillDetail.user.email || '未留存' }}</div>
                     </div>
                 </div>
             </el-dialog>

+ 13 - 12
pages/frontend/skill/list.vue

@@ -16,9 +16,9 @@
                         class="category-one-wrapper"
                         :class="categoryExpanded ? 'expand' : ''">
                         <!-- 更多 -->
-                        <div
+                        <!-- <div
                             class="category-more"
-                            @click="handleClickExpandCategory">{{ categoryExpanded ? '收起' : '更多' }}</div>
+                            @click="handleClickExpandCategory">{{ categoryExpanded ? '收起' : '更多' }}</div> -->
                         <!-- 全部 -->
                         <a
                             href="/frontend/skill/list"
@@ -51,22 +51,23 @@
             </div>
             <div class="skill-content">
                 <div class="skill-list-wrapper">
-                    <a
+                    <div
                         class="skill-item"
                         v-for="item in skillList"
-                        :key="item.sale_id"
-                        :href="`/frontend/skill/detail/${item.sale_id}`">
-                        <img class="cover" :src="item.coverImage" alt="skillCover,cover">
-                        <div class="owner-wrapper">
+                        :key="item.sale_id">
+                        <a :href="`/frontend/skill/detail/${item.sale_id}`">
+                            <img class="cover" :src="item.coverImage" alt="skillCover,cover">
+                        </a>
+                        <a class="owner-wrapper" :href="`/wo/${item.user.uid}/skill`">
                             <img class="avatar" :src="item.user.icon_url" alt="avatar">
                             <div class="nickname">{{ item.user.nickname }}</div>
-                        </div>
-                        <div class="title">{{ item.title }}</div>
+                        </a>
+                        <a class="title" :href="`/frontend/skill/detail/${item.sale_id}`">{{ item.title }}</a>
                         <div class="price-wrapper">
                             <div class="price-text">¥{{ item.price }}</div>
-                            <div class="buy-num">({{ item.buy_num }})</div>
+                            <div class="buy-num">已购买次数({{ item.buy_num }})</div>
                         </div>
-                    </a>
+                    </div>
                 </div>
                 <div class="pagination-wrapper" v-if="pagination.total > pagination.pagesize">
                     <el-pagination
@@ -180,7 +181,7 @@ export default {
             baseUrl: '',
             // firstLoad: true,
             isWeixinApp: true,
-            categoryExpanded: false,
+            categoryExpanded: true, // 更多按钮不要,默认为展开状态
             showCategoryDrawer: false,
             currentDrawerCategoryId: 0,
             currentDrawerCategoryIndex: 0

+ 4 - 2
pages/work_down/index.vue

@@ -64,7 +64,9 @@
                     v-for="works in worksList"
                     :key="`works-item-${works.wid}`">
                     <div class="works-detail-wrapper">
-                        <img v-if="works.image" class="works-image" :src="works.image" alt="works-image">
+                        <a :href="`${baseUrl}/w/${works.wid}`">
+                            <img v-if="works.image" class="works-image" :src="works.image" alt="works-image">
+                        </a>
                         <div class="works-detail" :style="{'width': works.image ? '630px' : '770px'}">
                             <a class="works-name" :href="`${baseUrl}/w/${works.wid}`">{{ works.name }}</a>
                             <div class="works-description">{{ works.description }}</div>
@@ -81,7 +83,7 @@
                             </div>
                         </div>
                     </div>
-                    <a class="works-user-wrapper" :href="`${baseUrl}/wo/${works.uid}`">
+                    <a class="works-user-wrapper" :href="`${baseUrl}/wo/${works.uid}/works`">
                         <img class="user-avatar" :src="works.icon_url" alt="avatar">
                         <div class="username">{{ works.nickname }}</div>
                         <div class="company">{{ works.company }} {{ works.kill_title || '' }}</div>