zhoujump 2 mesiacov pred
rodič
commit
d79dc6f051

+ 1 - 1
src/router/index.js

@@ -7,7 +7,7 @@ export const constantRoutes = [
   {
     path: '/',
     component: Layout,
-    redirect: '/user/register',
+    redirect: '/login',
     meta: { title: '首页' },
     children: [
       {

+ 74 - 12
src/views/audienceManage/index.vue

@@ -28,7 +28,7 @@ export default Vue.extend({
         show: false,
         page: 0,
         last_page: 1,
-        is_sending: false,
+        is_sending: false
       },
       loading: false,
       searchTimer: null,
@@ -48,8 +48,8 @@ export default Vue.extend({
     this.getInvitationList()
   },
   methods: {
-    getLabelName(key){
-      let name = {
+    getLabelName(key) {
+      const name = {
         address: '地址',
         city: '城市',
         company: '公司名称',
@@ -83,9 +83,9 @@ export default Vue.extend({
         update_time: '更新时间',
         user_id: '用户ID'
       }
-      if(name[key]){
+      if (name[key]) {
         return name[key]
-      }else {
+      } else {
         return key
       }
     },
@@ -183,6 +183,13 @@ export default Vue.extend({
       }).catch(err => {
 
       })
+    },
+    copy(text) {
+      navigator.clipboard.writeText(text).then(() => {
+        this.$message.success('复制成功')
+      }).catch(() => {
+        this.$message.error('复制失败')
+      })
     }
   }
 })
@@ -207,7 +214,7 @@ export default Vue.extend({
         <el-table-column type="expand">
           <template slot-scope="props">
             <el-form class="expand-form" :inline="true" label-position="left">
-              <el-form-item v-for="(item,key) in props.row" :label="getLabelName(key)+':'" :key="key">
+              <el-form-item v-for="(item,key) in props.row" :key="key" :label="getLabelName(key)+':'">
                 <span>{{ item }}</span>
               </el-form-item>
             </el-form>
@@ -268,15 +275,18 @@ export default Vue.extend({
       />
     </div>
     <el-dialog
-      top="10vh"
+      top="5vh"
       custom-class="invitation-dialog"
       :append-to-body="true"
       title="发送邀请函"
       :visible.sync="invitation_data.show"
-      width="60%"
+      width="90%"
       @close="closeDialog()"
     >
       <div class="dialog-body">
+        <div class="title">模板列表</div>
+        <div class="title">邮件编辑器</div>
+        <div class="title">观众信息</div>
         <div class="temp-list">
           <div
             v-for="(temp,index) in invitation_data.data"
@@ -291,12 +301,23 @@ export default Vue.extend({
         <div class="view">
           <div id="editor" />
         </div>
+        <div class="var-list-cont">
+          <div class="var-list">
+            <div class="var-item" v-for="(item,key) in invitation_data.userSetting">
+              <div class="title">{{getLabelName(key)}}</div>
+              <div>{{item || '暂无数据'}}</div>
+              <el-button-group class="button-list">
+                <el-button @click="copy(item)" type="primary" size="mini" icon="el-icon-document-copy">复制</el-button>
+              </el-button-group>
+            </div>
+          </div>
+        </div>
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="closeDialog()">取 消</el-button>
         <el-button :disabled="invitation_data.is_sending" type="primary" @click="sendInvitation()">
           发 送
-          <span v-if="invitation_data.is_sending" class="el-icon-loading"></span>
+          <span v-if="invitation_data.is_sending" class="el-icon-loading" />
         </el-button>
       </span>
     </el-dialog>
@@ -356,15 +377,56 @@ export default Vue.extend({
 <style lang="scss">
 .invitation-dialog{
   .dialog-body{
-    height: 60vh;
+    height: 68vh;
     display: grid;
-    grid-template-columns: 240px 1fr;
-    grid-gap: 12px;
+    grid-template-columns: 240px 1fr 360px;
+    grid-gap: 4px 12px;
     .view{
       width: 100%;
       height: 100%;
     }
+    .var-list-cont{
+      border: 2px solid #eee;
+      border-radius: 10px;
+      width: 100%;
+      height: 100%;
+      position: relative;
+      .var-list{
+        position: absolute;
+        top: 0;
+        left: 0;
+        width: 100%;
+        height: 100%;
+        overflow: hidden;
+        overflow-y: auto;
+        .var-item{
+          position: relative;
+          padding: 2px 6px;
+          border-radius: 6px;
+          border: 2px solid #409EFF00;
+          border-bottom: 2px solid #00000008;
+          .button-list{
+            opacity: 0;
+            position: absolute;
+            right: 3px;
+            top: 3px;
+          }
+          .title{
+            font-weight: bold;
+            font-size: 12px;
+          }
+          &:hover{
+            border: 2px solid #409EFF;
+            .button-list{
+              opacity: 1;
+            }
+          }
+        }
+      }
+    }
     .temp-list{
+      border: 2px solid #eee;
+      border-radius: 10px;
       padding: 6px;
       overflow: hidden;
       overflow-y: auto;

+ 28 - 8
src/views/dashboard/index.vue

@@ -1,27 +1,28 @@
 <template>
   <div class="main-box">
     <div class="scroll-box">
-      <div class="main-card" >
+      <div class="main-card">
         <div class="hello-text">{{ getTimeWord() }},{{ user.nickname }}!</div>
         <div class="card-content">
           <div class="expo-text">
-            <span>距离展会结束还有</span>
+            <span v-if="currentExpo">距离{{ currentExpo.expo_name }}结束还有{{ getEndDay(currentExpo.end_date) }}天</span>
+            <span v-else>没有进行中的展会</span>
           </div>
           <div class="quick-nav">
             <router-link class="nav-item" to="audience">
-              <span class="icon el-icon-user"></span>
+              <span class="icon el-icon-user" />
               <span class="text">观众管理</span>
             </router-link>
             <router-link class="nav-item" to="preRegister">
-              <span class="icon el-icon-tickets"></span>
+              <span class="icon el-icon-tickets" />
               <span class="text">表单管理</span>
             </router-link>
             <router-link class="nav-item" to="exhibitor">
-              <span class="icon el-icon-office-building"></span>
+              <span class="icon el-icon-office-building" />
               <span class="text">展商管理</span>
             </router-link>
             <router-link class="nav-item" to="invitation">
-              <span class="icon el-icon-files"></span>
+              <span class="icon el-icon-files" />
               <span class="text">模板管理</span>
             </router-link>
           </div>
@@ -32,20 +33,39 @@
 </template>
 
 <script>
+import { getExpoList } from '@/api/expo'
 export default {
   name: 'Dashboard',
   data() {
     return {
-
+      currentExpo: {}
     }
   },
   computed: {
     user() { return this.$store.state.user.user }
   },
   mounted() {
-
+    this.init()
   },
   methods: {
+    init() {
+      getExpoList(1, 20).then(res => {
+        const expoList = res.data.data
+        for (const item of expoList) {
+          if (item.status === 0 && this.getEndDay(item.end_date) >= 0) {
+            this.currentExpo = item
+            return
+          }
+        }
+        this.currentExpo = false
+      }).catch(err => {
+
+      })
+    },
+    getEndDay(date) {
+      const endTime = new Date(date)
+      return Math.ceil((endTime.getTime() - new Date().getTime()) / 86400000)
+    },
     getTimeWord() {
       const time = new Date().getHours()
       if (time >= 0 && time < 6) return '凌晨好'

+ 3 - 3
src/views/invitationManage/edit.vue

@@ -37,7 +37,7 @@ export default Vue.extend({
         <tr>
             <td width="100"></td>
             <td align="center" bgcolor="#ffffff" style="font: 24px Arial, sans-serif;color: #84C0F2">
-                {{exhibitorName}}
+                {{expo_name}}
             </td>
             <td  width="100"></td>
         </tr>
@@ -51,7 +51,7 @@ export default Vue.extend({
         <tr>
             <td></td>
             <td align="center" style="font: 18px Arial, sans-serif;color: #FFFFFF">
-                {{startTime}} - {{endTime}}
+                {{start_date}} - {{end_date}}
             </td>
             <td></td>
         </tr>
@@ -70,7 +70,7 @@ export default Vue.extend({
         <tr>
             <td bgcolor="#ffffff"></td>
             <td align="center" bgcolor="#ffffff">
-                400-000-0000 | {{address}}
+                {{contact_phone}} | {{location}}
             </td>
             <td bgcolor="#ffffff"></td>
         </tr>

+ 36 - 2
src/views/login/index.vue

@@ -9,6 +9,7 @@ export default Vue.extend({
       password: '',
       savePassword: false,
       loading: false,
+      isLogin: true,
       env: process.env.NODE_ENV
     }
   },
@@ -63,7 +64,10 @@ export default Vue.extend({
         <div class="title">展会服务系统</div>
       </div>
       <div class="cont-right">
-        <div class="title">登录</div>
+        <div class="title">
+          <div @click="isLogin=true" :class="['item',isLogin?'active':'']">登录</div>
+          <div @click="isLogin=false" :class="['item',isLogin?'':'active']">注册</div>
+        </div>
         <el-input v-model="username" prefix-icon="el-icon-user" placeholder="请输入用户名" class="input" />
         <el-input v-model="password" prefix-icon="el-icon-unlock" placeholder="请输入密码" show-password class="input" />
         <el-checkbox v-model="savePassword">记住密码</el-checkbox>
@@ -116,9 +120,39 @@ export default Vue.extend({
         flex-direction: column;
         grid-gap: 16px;
         .title{
+          height: 36px;
           font-weight: bold;
           margin-bottom: 26px;
-          font-size: 28px;
+          display: flex;
+          align-items: flex-end;
+          gap: 20px;
+          .item{
+            line-height: 1.3;
+            transition-duration: 300ms;
+            font-size: 27px;
+            cursor: pointer;
+            display: flex;
+            flex-direction: column;
+            align-items: center;
+            color: gray;
+            &::after{
+              transition-duration: 300ms;
+              width: 40%;
+              content: '';
+              display: block;
+              height: 4px;
+              border-radius: 2px;
+              background-color: lightgray;
+            }
+            &.active{
+              font-size: 28px;
+              color: black;
+              &::after{
+                width: 80%;
+                background-color: #2563EB;
+              }
+            }
+          }
         }
         .button{
           font-size: 18px;

+ 16 - 12
src/views/user/register.vue

@@ -18,7 +18,7 @@ export default Vue.extend({
         email: '',
         emailCode: '',
         pre_register_key: '',
-        showPasswordDialog: false,
+        showPasswordDialog: false
       },
       emailCounter: 0,
       emailTimer: null,
@@ -52,6 +52,10 @@ export default Vue.extend({
         }).catch(err => {
 
         })
+      } else {
+        this.$router.push({
+          name: 'login'
+        })
       }
     },
     sentSms() {
@@ -175,7 +179,7 @@ export default Vue.extend({
       confirmEmail(this.loginInfo.pre_register_key, this.loginInfo.password, this.loginInfo.password_2).then(res => {
         this.isLogin = true
         this.$message.success('注册成功!请前往登录')
-      }).catch(err=>{
+      }).catch(err => {
 
       })
     }
@@ -226,7 +230,7 @@ export default Vue.extend({
         <div class="form-item">
           <div class="label">密码</div>
           <div class="sms-cont">
-            <el-input show-password v-model="loginInfo.password" placeholder="请输入密码" />
+            <el-input v-model="loginInfo.password" show-password placeholder="请输入密码" />
           </div>
         </div>
       </template>
@@ -317,15 +321,15 @@ export default Vue.extend({
       :visible.sync="loginInfo.showPasswordDialog"
       width="30%"
     >
-    <div class="dialog-body">
-      <div class="label">请设置密码</div>
-      <el-input placeholder="请设置密码" show-password v-model="loginInfo.password"></el-input>
-      <div class="label">请再次输入密码</div>
-      <el-input placeholder="请再次输入密码" show-password v-model="loginInfo.password_2"></el-input>
-    </div>
-    <span slot="footer" class="dialog-footer">
-      <el-button @click="checkPassword()" type="primary">确 定</el-button>
-    </span>
+      <div class="dialog-body">
+        <div class="label">请设置密码</div>
+        <el-input v-model="loginInfo.password" placeholder="请设置密码" show-password />
+        <div class="label">请再次输入密码</div>
+        <el-input v-model="loginInfo.password_2" placeholder="请再次输入密码" show-password />
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="checkPassword()">确 定</el-button>
+      </span>
     </el-dialog>
   </div>
 </template>