zs 9 months ago
parent
commit
d8cdb6cd3d

+ 175 - 0
src/components/custom/custom-search.vue

@@ -0,0 +1,175 @@
+<template>
+  <div class="c-search">
+    <div class="searchList" v-for="(item, index) in searchFields" :key="index">
+      <div class="twoSeacher" v-if="item.type == 'plate'">
+        <div class="twoLeft">
+          <span>{{ item.title }}</span>
+        </div>
+        <div v-if="!item.show" class="twoRight">
+          <div class="label" :class="[tags.is_active ? 'show' : '']" v-for="(tags, indexs) in plateList.slice(0, 6)" :key="indexs" @click="toSelect(tags, 'plate')">
+            {{ tags.title }}
+          </div>
+        </div>
+        <div v-else class="twoRight">
+          <div class="label" :class="[tags.is_active ? 'show' : '']" v-for="(tags, indexs) in plateList" :key="indexs" @click="toSelect(tags, 'plate')">
+            {{ tags.title }}
+          </div>
+        </div>
+        <div class="button">
+          <span v-if="!item.show" @click="item.show = true">
+            <el-icon><ArrowDown /></el-icon>
+          </span>
+          <span v-else @click="item.show = false">
+            <el-icon><ArrowUp /></el-icon>
+          </span>
+        </div>
+      </div>
+      <div class="twoSeacher" v-if="item.type == 'field'">
+        <div class="twoLeft">
+          <span>{{ item.title }}</span>
+        </div>
+        <div v-if="!twoShow" class="twoRight">
+          <div class="label" :class="[item.is_active ? 'show' : '']" v-for="(item, index) in typeList.slice(0, 10)" :key="index" @click="toSelect(item, 'field')">
+            {{ item.label }}
+          </div>
+        </div>
+        <div v-else class="twoRight">
+          <div class="label" :class="[item.is_active ? 'show' : '']" v-for="(item, index) in typeList" :key="index" @click="toSelect(item, 'field')">
+            {{ item.label }}
+          </div>
+        </div>
+        <div class="button">
+          <span v-if="!twoShow" @click="twoShow = true">
+            <el-icon><ArrowDown /></el-icon>
+          </span>
+          <span v-else @click="twoShow = false">
+            <el-icon><ArrowUp /></el-icon>
+          </span>
+        </div>
+      </div>
+      <div class="twoSeacher" v-else-if="item.type == 'city'">
+        <div class="twoLeft">
+          <span>{{ item.title }}</span>
+        </div>
+        <div class="twoRight">
+          <div class="label" :class="[tags.is_active ? 'show' : '']" v-for="(tags, indexs) in cityList" :key="indexs" @click="toSelect(tags, 'city')">
+            {{ tags.name }}
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="twoIpunt">
+      <el-input class="input" v-for="(item, index) in fields" :key="index" clearable size="large" v-model="searchForm[item.model]" :placeholder="getField('placeholder', item)" />
+      <el-button class="button" size="large" type="primary" @click="toSearchInfo">检索</el-button>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import { get } from 'lodash-es'
+const props = defineProps({
+  searchFields: { type: Array, default: () => [] },
+  fields: { type: Array, default: () => [] },
+  plateList: { type: Array, default: () => [] },
+  cityList: { type: Array, default: () => [] },
+  typeList: { type: Array, default: () => [] }
+})
+const searchForm = ref({})
+
+const emits = defineEmits(['toSelect', 'toDel', 'toSearchInfo'])
+
+const toSelect = (data, type) => {
+  emits('toSelect', data, type)
+}
+const toDel = (data, type) => {
+  emits('toDel', data, type)
+}
+const toSearchInfo = () => {
+  emits('toSearchInfo', searchForm.value)
+}
+const getField = (item, data) => {
+  let res = get(data, item, null)
+  if (item === 'type') res = res === null ? `text` : res
+  if (item === 'placeholder') res = res === null ? `请输入${data.label}` : res
+  if (item === `selectplaceholder`) res = res === null ? `请选择${data.label}` : res
+  if (item === 'required') res = res === null ? false : res
+  if (item === `error`) res = res === null ? `${data.label}错误` : res
+  return res
+}
+</script>
+<style scoped lang="scss">
+.c-search {
+  .twoSeacher {
+    background-color: #fff;
+    display: flex;
+    justify-content: center;
+    align-items: stretch;
+    position: relative;
+    border: solid 1px #e5e5e5;
+    border-bottom: 0;
+    font-size: $global-font-size-18;
+    color: #666;
+    min-height: 60px;
+    overflow: hidden;
+    .twoLeft {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      flex-shrink: 0;
+      width: 110px;
+      text-align: center;
+      color: #000;
+      font-weight: bold;
+      background-color: #fafafa;
+    }
+    .twoRight {
+      display: flex;
+      flex-wrap: wrap;
+      align-items: center;
+      padding: 12px;
+      flex: 1;
+      border-left: solid 1px #e5e5e5;
+      background-color: #fff;
+      .label {
+        margin-right: 3px;
+        color: #313131;
+        padding: 8px 10px;
+        border-radius: 3px;
+        background-color: #fff;
+        border: solid 1px transparent;
+        cursor: pointer;
+      }
+      .show {
+        color: #0a58c2;
+        border: solid 1px #006dd2;
+      }
+
+      .label:hover {
+        color: $global-color-107;
+      }
+    }
+    .button {
+      display: flex;
+      align-items: center;
+      margin: 0 5px 0 0;
+    }
+  }
+  .searchList:last-child {
+    .twoSeacher {
+      border-bottom: 1;
+    }
+  }
+  .twoIpunt {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    margin: 10px 0 0 0;
+    .input {
+      margin: 0 5px 0 0;
+    }
+    .button {
+      margin: 0 0 0 5px;
+    }
+  }
+}
+</style>

+ 3 - 3
src/views/detail/company.vue

@@ -233,15 +233,15 @@ const sizeChange = (limits) => {
 // 筛选条件
 const toSearchFind = async () => {
   if (industry.value && industry.value.length > 0) {
-    searchForm.value.industryList = industry.value.map((i) => {
+    searchForm.value.industry = industry.value.map((i) => {
       return i.title
     })
   } else if (pattern.value && pattern.value.length > 0) {
-    searchForm.value.patternList = pattern.value.map((i) => {
+    searchForm.value.pattern = pattern.value.map((i) => {
       return i.label
     })
   } else if (city.value && city.value.length > 0) {
-    searchForm.value.cityList = city.value.map((i) => {
+    searchForm.value.area = city.value.map((i) => {
       return i.name
     })
   } else searchForm.value = {}

+ 3 - 3
src/views/detail/expert.vue

@@ -219,15 +219,15 @@ const sizeChange = (limits) => {
 // 筛选条件
 const toSearchFind = async () => {
   if (industry.value && industry.value.length > 0) {
-    searchForm.value.industryList = industry.value.map((i) => {
+    searchForm.value.industry = industry.value.map((i) => {
       return i.title
     })
   } else if (field.value && field.value.length > 0) {
-    searchForm.value.fieldList = field.value.map((i) => {
+    searchForm.value.field = field.value.map((i) => {
       return i.label
     })
   } else if (city.value && city.value.length > 0) {
-    searchForm.value.cityList = city.value.map((i) => {
+    searchForm.value.area = city.value.map((i) => {
       return i.name
     })
   } else searchForm.value = {}

+ 21 - 16
src/views/login/index.vue

@@ -2,21 +2,18 @@
   <div id="index">
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
-        <custom-layout :is_foot="false">
-          <el-col :span="24" class="one">
-            <div v-if="status === '0'" class="one_1">
-              <register></register>
-            </div>
-            <div v-else class="one_2">
-              <login></login>
-            </div>
-          </el-col>
-        </custom-layout>
+        <!-- <custom-layout :is_foot="false"> -->
+        <el-col :span="24" class="one">
+          <div v-if="status === '0'" class="one_1">
+            <register></register>
+          </div>
+          <div v-else class="one_2">
+            <login></login>
+          </div>
+        </el-col>
+        <!-- </custom-layout> -->
       </el-col>
     </el-row>
-    <el-dialog v-model="dialog" title="使用协议">
-      <div v-html="configInfo.agreement"></div>
-    </el-dialog>
   </div>
 </template>
 <script setup>
@@ -24,9 +21,11 @@
 import { DictDataStore } from '@/store/api/system/dictData'
 import { DesignStore } from '@/store/api/platform/design'
 import { RoleStore } from '@/store/api/system/role'
+import { SectorStore } from '@/store/api/platform/sector'
 const dictDataStore = DictDataStore()
 const designStore = DesignStore()
 const roleStore = RoleStore()
+const sectorStore = SectorStore()
 const $checkRes = inject('$checkRes')
 // 组件
 import login from './parts/login.vue'
@@ -34,13 +33,13 @@ import register from './parts/register.vue'
 // 加载中
 const loading = ref(false)
 const route = useRoute()
-const dialog = ref(false)
 const configInfo = ref({})
 const status = ref('0')
 // 字典
 const typeList = ref([])
 const genderList = ref([])
 const roleList = ref([])
+const plateList = ref([])
 // 请求
 onMounted(async () => {
   loading.value = true
@@ -67,6 +66,9 @@ const searchOther = async () => {
   // 基础设置
   result = await designStore.query({})
   if ($checkRes(result)) configInfo.value = result.data[0] || {}
+  // 板块
+  result = await sectorStore.query({ is_use: '0' })
+  if ($checkRes(result)) plateList.value = result.data
 }
 watch(
   route,
@@ -79,8 +81,10 @@ watch(
     immediate: true //初始化立即执行
   }
 )
+
 provide('configInfo', configInfo)
 // 字典
+provide('plateList', plateList)
 provide('typeList', typeList)
 provide('genderList', genderList)
 provide('roleList', roleList)
@@ -91,7 +95,8 @@ provide('roleList', roleList)
     background-image: url(/images/bg_login.jpg);
     background-position: center center;
     background-repeat: no-repeat;
-    min-height: calc(100vh - 14vh);
+    min-height: calc(100vh);
+    // min-height: calc(100vh - 14vh);
     width: 100%;
     background-size: cover;
     display: flex;
@@ -103,7 +108,7 @@ provide('roleList', roleList)
       background-color: $global-color-fff;
       padding: 10px;
       border-radius: 20px;
-      margin: 50px 200px 50px 0;
+      margin: 5px 200px 0 0;
     }
     .one_2 {
       width: 450px;

+ 116 - 56
src/views/login/parts/login.vue

@@ -3,67 +3,102 @@
     <div class="one">登录</div>
     <div class="two">
       <el-col :span="24" class="tab">
-        <el-col
-          :span="9"
-          class="title"
-          @click="toTab(0)"
-          :class="[activeName == '0' ? 'tab0' : 'tab1']"
-          >用户名密码登录</el-col
-        >
-        <el-col
-          :span="9"
-          class="title"
-          @click="toTab(1)"
-          :class="[activeName == '1' ? 'tab0' : 'tab1']"
-          >短信快捷登录</el-col
-        >
+        <el-col :span="9" class="title" @click="toTab(0)" :class="[activeName == '0' ? 'tab0' : 'tab1']">用户名密码登录</el-col>
+        <el-col :span="9" class="title" @click="toTab(1)" :class="[activeName == '1' ? 'tab0' : 'tab1']">短信快捷登录</el-col>
       </el-col>
-      <el-form
-        ref="ruleFormRef"
-        :model="form"
-        :rules="rules"
-        label-width="100px"
-        class="form"
-        label-position="left"
-      >
-        <el-col :span="24" class="content">
-          <el-form-item label="账号" prop="account">
-            <el-input clearable v-model="form.account" placeholder="请输入账号">
-              <template #prefix>
-                <el-icon>
-                  <User />
-                </el-icon>
-              </template>
-            </el-input>
-          </el-form-item>
-          <el-form-item label="密码" prop="password">
-            <el-input
-              v-model="form.password"
-              type="password"
-              show-password
-              placeholder="请输入登录密码"
-            >
-              <template #prefix>
-                <el-icon>
-                  <Unlock />
-                </el-icon>
-              </template>
-            </el-input>
-          </el-form-item>
-          <el-col :span="24" class="remark">
-            <span>忘记密码?</span>
+      <div v-if="activeName == '0'">
+        <el-form ref="ruleFormRef" :model="form" :rules="rules" label-width="70px" class="form" label-position="left">
+          <el-col :span="24" class="content">
+            <el-form-item label="账号" prop="account">
+              <el-input size="large" clearable v-model="form.account" placeholder="请输入账号">
+                <template #prefix>
+                  <el-icon>
+                    <User />
+                  </el-icon>
+                </template>
+              </el-input>
+            </el-form-item>
+            <el-form-item label="密码" prop="password">
+              <el-input size="large" v-model="form.password" type="password" show-password placeholder="请输入登录密码">
+                <template #prefix>
+                  <el-icon>
+                    <Unlock />
+                  </el-icon>
+                </template>
+              </el-input>
+            </el-form-item>
+            <el-col :span="24" class="remark">
+              <span>忘记密码?</span>
+            </el-col>
+            <el-col :span="24" class="button">
+              <el-button type="primary" @click="submitForm(ruleFormRef)">登录</el-button>
+            </el-col>
+            <el-col :span="24" class="text">
+              <span>没有账号</span>
+              <span @click="toRegister">立即注册</span>
+            </el-col>
+            <div class="checks_box">
+              <el-checkbox v-model="isAgree" size="large" class="checks_inpt" />
+              <div class="checks_text">
+                <span>我已阅读并同意</span>
+                <span @click="toAgree"> 服务条款、隐私政策</span>
+              </div>
+            </div>
           </el-col>
-          <el-col :span="24" class="button">
-            <el-button type="primary" @click="submitForm(ruleFormRef)">登录</el-button>
+        </el-form>
+      </div>
+      <div v-else>
+        <el-form ref="ruleFormRef" :model="form" :rules="rules" label-width="70px" class="form" label-position="left">
+          <el-col :span="24" class="content">
+            <el-form-item label="手机号" prop="phone">
+              <el-input size="large" clearable v-model="form.phone" placeholder="请输入手机号">
+                <template #prefix>
+                  <el-icon>
+                    <Iphone />
+                  </el-icon>
+                </template>
+              </el-input>
+            </el-form-item>
+            <el-form-item label="验证码" prop="checkCode">
+              <el-input size="large" class="check-code-box" v-model.number="form.checkCode" placeholder="请输入验证码">
+                <template #prefix>
+                  <el-icon>
+                    <Message />
+                  </el-icon>
+                </template>
+                <template v-slot:append>
+                  <el-button :disabled="codeCd" @click="handleCaptcha('form')"
+                    >获取验证码
+                    <span v-if="codeCd">({{ long }})</span>
+                  </el-button>
+                </template>
+              </el-input>
+            </el-form-item>
+            <el-col :span="24" class="remark">
+              <span>忘记密码?</span>
+            </el-col>
+            <el-col :span="24" class="button">
+              <el-button type="primary" @click="submitForm(ruleFormRef)">登录</el-button>
+            </el-col>
+            <el-col :span="24" class="text">
+              <span>没有账号</span>
+              <span @click="toRegister">立即注册</span>
+            </el-col>
+            <div class="checks_box">
+              <el-checkbox v-model="isAgree" size="large" class="checks_inpt" />
+              <div class="checks_text">
+                <span>我已阅读并同意</span>
+                <span @click="toAgree"> 服务条款、隐私政策</span>
+              </div>
+            </div>
           </el-col>
-          <el-col :span="24" class="text">
-            <span>没有账号</span>
-            <span @click="toRegister">立即注册</span>
-          </el-col>
-        </el-col>
-      </el-form>
+        </el-form>
+      </div>
     </div>
   </div>
+  <el-dialog v-model="dialog" title="使用协议">
+    <div v-html="configInfo.agreement"></div>
+  </el-dialog>
 </template>
 <script setup>
 // 基础
@@ -74,6 +109,12 @@ const loginStore = LoginStore()
 // 路由
 const router = useRouter()
 const activeName = ref(0)
+
+const configInfo = inject('configInfo')
+
+// 用户协议
+const isAgree = ref(false)
+const dialog = ref(false)
 // 加载中
 const form = ref({})
 const ruleFormRef = ref()
@@ -111,6 +152,10 @@ const submitForm = async (formEl) => {
 const toRegister = () => {
   router.push({ path: '/login', query: { status: '0' } })
 }
+// 查看隐私协议
+const toAgree = () => {
+  dialog.value = !dialog.value
+}
 </script>
 <style scoped lang="scss">
 .register {
@@ -152,6 +197,7 @@ const toRegister = () => {
     .content {
       padding: 20px;
       .remark {
+        cursor: default;
         text-align: right;
         margin: 10px 0;
         color: #9a9a9a;
@@ -183,6 +229,20 @@ const toRegister = () => {
           cursor: default; /* 将鼠标样式更改为箭头 */
         }
       }
+      .checks_box {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        .checks_inpt {
+          margin: 0 5px 0 0;
+        }
+        .checks_text {
+          cursor: default;
+          span:last-child {
+            color: #2374ff;
+          }
+        }
+      }
     }
   }
 }

+ 41 - 21
src/views/login/parts/register.vue

@@ -16,11 +16,11 @@
         </el-form-item>
         <el-form-item label="板块选择" prop="plate">
           <el-checkbox-group v-model="form.plate">
-            <el-checkbox v-for="(item, index) in plateList" :key="index" :value="item.value" name="type">{{ item.label }}</el-checkbox>
+            <el-checkbox v-for="(item, index) in plateList" :key="index" :value="item.title" name="type">{{ item.title }}</el-checkbox>
           </el-checkbox-group>
         </el-form-item>
         <el-form-item label="姓名" prop="nick_name">
-          <el-input clearable v-model="form.nick_name" placeholder="请输入姓名/单位名称">
+          <el-input size="large" clearable v-model="form.nick_name" placeholder="请输入姓名/单位名称">
             <template #prefix>
               <el-icon>
                 <Avatar />
@@ -29,7 +29,7 @@
           </el-input>
         </el-form-item>
         <el-form-item label="手机号" prop="phone">
-          <el-input clearable v-model="form.phone" placeholder="请输入手机号">
+          <el-input size="large" clearable v-model="form.phone" placeholder="请输入手机号">
             <template #prefix>
               <el-icon>
                 <Iphone />
@@ -38,7 +38,7 @@
           </el-input>
         </el-form-item>
         <el-form-item label="验证码" prop="checkCode">
-          <el-input class="check-code-box" v-model.number="form.checkCode" placeholder="请输入验证码">
+          <el-input size="large" class="check-code-box" v-model.number="form.checkCode" placeholder="请输入验证码">
             <template #prefix>
               <el-icon>
                 <Message />
@@ -53,7 +53,7 @@
           </el-input>
         </el-form-item>
         <el-form-item label="密码" prop="password">
-          <el-input v-model="form.password" type="password" show-password placeholder="请输入登录密码">
+          <el-input size="large" v-model="form.password" type="password" show-password placeholder="请输入登录密码">
             <template #prefix>
               <el-icon>
                 <Unlock />
@@ -68,9 +68,19 @@
           <span>已有账号</span>
           <span @click="toLogin">去登录</span>
         </el-col>
+        <div class="checks_box">
+          <el-checkbox v-model="isAgree" size="large" class="checks_inpt" />
+          <div class="checks_text">
+            <span>我已阅读并同意</span>
+            <span @click="toAgree"> 服务条款、隐私政策</span>
+          </div>
+        </div>
       </el-form>
     </div>
   </div>
+  <el-dialog v-model="dialog" title="使用协议">
+    <div v-html="configInfo.agreement"></div>
+  </el-dialog>
 </template>
 <script setup>
 import { cloneDeep } from 'lodash-es'
@@ -83,23 +93,14 @@ const form = ref({ role: ['User'] })
 // 表单验证
 const ruleFormRef = ref()
 const roleList = inject('roleList')
+
+const plateList = inject('plateList')
+const configInfo = inject('configInfo')
+
 // 用户协议
-const isAgree = ref(true)
-const plateList = ref([
-  { label: '汽车电子及新型汽车零部件', value: '0' },
-  { label: '精细化工及天然气化工', value: '1' },
-  { label: '农产品加工及绿色食品', value: '2' },
-  { label: '光电子及智能传感器', value: '3' },
-  { label: '车规级芯片及功率半导体器件', value: '4' },
-  { label: '新能源及动力电池', value: '5' },
-  { label: '生物基新材料', value: '6' },
-  { label: '人工智能及智能机器人', value: '7' },
-  { label: '碳纤维及复合材料', value: '8' },
-  { label: '遥感卫星及航天航空技术', value: '9' },
-  { label: '精密仪器及先进装备', value: '10' },
-  { label: '生物医药及先进医疗器械', value: '11' },
-  { label: '生物制造', value: '12' }
-])
+const isAgree = ref(false)
+const dialog = ref(false)
+
 const validatePhoneNumber = (rule, value, callback) => {
   const reg = /^1[3-9]\d{9}$/
   if (!value) {
@@ -136,6 +137,7 @@ const submitForm = async (formEl) => {
       const user = await store.query({ account: data.nick_name })
       if (user.total === 0) {
         data.account = data.nick_name
+        if (data.plate && data.plate.length > 0) data.industry = data.plate[0]
         data.gender = '0'
         delete data.refpassword
         delete data.checkCode
@@ -165,6 +167,10 @@ const submitForm = async (formEl) => {
 const toLogin = () => {
   router.push({ path: '/login', query: { status: '1' } })
 }
+// 查看隐私协议
+const toAgree = () => {
+  dialog.value = !dialog.value
+}
 </script>
 <style scoped lang="scss">
 .register {
@@ -203,6 +209,20 @@ const toLogin = () => {
         cursor: default; /* 将鼠标样式更改为箭头 */
       }
     }
+    .checks_box {
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      .checks_inpt {
+        margin: 0 5px 0 0;
+      }
+      .checks_text {
+        cursor: default;
+        span:last-child {
+          color: #2374ff;
+        }
+      }
+    }
   }
 }
 </style>

+ 7 - 7
src/views/nine/index.vue

@@ -311,27 +311,27 @@ const sizeChange = (limits) => {
 // 筛选条件
 const toSearchFind = async () => {
   if (industry.value && industry.value.length > 0) {
-    searchForm.value.industryList = industry.value.map((i) => {
+    searchForm.value.industry = industry.value.map((i) => {
       return i.title
     })
   } else if (field.value && field.value.length > 0) {
-    searchForm.value.fieldList = field.value.map((i) => {
+    searchForm.value.field = field.value.map((i) => {
       return i.label
     })
   } else if (mature.value && mature.value.length > 0) {
-    searchForm.value.matureList = mature.value.map((i) => {
+    searchForm.value.mature = mature.value.map((i) => {
       return i.value
     })
   } else if (sell.value && sell.value.length > 0) {
-    searchForm.value.sellList = sell.value.map((i) => {
+    searchForm.value.sell = sell.value.map((i) => {
       return i.value
     })
   } else if (money.value && money.value.length > 0) {
-    searchForm.value.moneyList = money.value.map((i) => {
-      return i.value
+    searchForm.value.money = money.value.map((i) => {
+      return i.label
     })
   } else if (city.value && city.value.length > 0) {
-    searchForm.value.cityList = city.value.map((i) => {
+    searchForm.value.area = city.value.map((i) => {
       return i.name
     })
   } else searchForm.value = {}

+ 3 - 3
src/views/seven/index.vue

@@ -209,15 +209,15 @@ const sizeChange = (limits) => {
 // 筛选条件
 const toSearchFind = async () => {
   if (industry.value && industry.value.length > 0) {
-    searchForm.value.industryList = industry.value.map((i) => {
+    searchForm.value.industry = industry.value.map((i) => {
       return i.title
     })
   } else if (field.value && field.value.length > 0) {
-    searchForm.value.fieldList = field.value.map((i) => {
+    searchForm.value.field = field.value.map((i) => {
       return i.label
     })
   } else if (city.value && city.value.length > 0) {
-    searchForm.value.cityList = city.value.map((i) => {
+    searchForm.value.area = city.value.map((i) => {
       return i.name
     })
   } else searchForm.value = {}