Просмотр исходного кода

未做话题设置,不可发布;

huan-jie 4 лет назад
Родитель
Сommit
682b6a3051
1 измененных файлов с 21 добавлено и 0 удалено
  1. 21 0
      pages/frontend/consult/create.vue

+ 21 - 0
pages/frontend/consult/create.vue

@@ -476,6 +476,14 @@ export default {
                 // time_json: JSON.stringify(timeJson)
                 // time_json: JSON.stringify(timeJson)
             }
             }
 
 
+            if (!this._validateIsShetting()) {
+                this.$message({
+                    dangerouslyUseHTMLString: true,
+                    message: '<a href="/workbench/consult" style="color: #308eff;text-decoration: underline;" target="_blank">请先在咨询服务管理页面完成"话题设置"</a>'
+                });
+                return
+            }
+
             if (actType === 'pcreate') {
             if (actType === 'pcreate') {
                 this.pcreateIsLoading = true
                 this.pcreateIsLoading = true
             } else {
             } else {
@@ -609,6 +617,19 @@ export default {
 
 
             return true
             return true
         },
         },
+        /** 判断用户是否做过话题设置 */
+        async _validateIsShetting () {
+            const res = await this.$axios.$post("/api/sale/getConsultUserInfo")
+            let isShetting = true
+
+            if (Number(res.status) === 1) {
+                if (!res.data.img) {
+                    isShetting = false
+                }
+            }
+
+            return isShetting
+        },
         /** 技能描述内容改变时 */
         /** 技能描述内容改变时 */
         handleChange (val) {
         handleChange (val) {
             this.content = val
             this.content = val