guhongwei 4 年 前
コミット
becaa4f2a2

BIN
src/assets/user.jpg


+ 13 - 55
src/components/HelloWorld.vue

@@ -4,43 +4,21 @@
     <p>
       For a guide and recipes on how to configure / customize this project,<br />
       check out the
-      <a href="https://cli.vuejs.org" target="_blank" rel="noopener"
-        >vue-cli documentation</a
-      >.
+      <a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
     </p>
     <h3>Installed CLI Plugins</h3>
     <ul>
       <li>
-        <a
-          href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel"
-          target="_blank"
-          rel="noopener"
-          >babel</a
-        >
+        <a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a>
       </li>
       <li>
-        <a
-          href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router"
-          target="_blank"
-          rel="noopener"
-          >router</a
-        >
+        <a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router" target="_blank" rel="noopener">router</a>
       </li>
       <li>
-        <a
-          href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-vuex"
-          target="_blank"
-          rel="noopener"
-          >vuex</a
-        >
+        <a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-vuex" target="_blank" rel="noopener">vuex</a>
       </li>
       <li>
-        <a
-          href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint"
-          target="_blank"
-          rel="noopener"
-          >eslint</a
-        >
+        <a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a>
       </li>
     </ul>
     <h3>Essential Links</h3>
@@ -49,19 +27,13 @@
         <a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a>
       </li>
       <li>
-        <a href="https://forum.vuejs.org" target="_blank" rel="noopener"
-          >Forum</a
-        >
+        <a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a>
       </li>
       <li>
-        <a href="https://chat.vuejs.org" target="_blank" rel="noopener"
-          >Community Chat</a
-        >
+        <a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a>
       </li>
       <li>
-        <a href="https://twitter.com/vuejs" target="_blank" rel="noopener"
-          >Twitter</a
-        >
+        <a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a>
       </li>
       <li>
         <a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a>
@@ -70,33 +42,19 @@
     <h3>Ecosystem</h3>
     <ul>
       <li>
-        <a href="https://router.vuejs.org" target="_blank" rel="noopener"
-          >vue-router</a
-        >
+        <a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a>
       </li>
       <li>
         <a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a>
       </li>
       <li>
-        <a
-          href="https://github.com/vuejs/vue-devtools#vue-devtools"
-          target="_blank"
-          rel="noopener"
-          >vue-devtools</a
-        >
+        <a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a>
       </li>
       <li>
-        <a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener"
-          >vue-loader</a
-        >
+        <a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a>
       </li>
       <li>
-        <a
-          href="https://github.com/vuejs/awesome-vue"
-          target="_blank"
-          rel="noopener"
-          >awesome-vue</a
-        >
+        <a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a>
       </li>
     </ul>
   </div>
@@ -104,7 +62,7 @@
 
 <script>
 export default {
-  name: "HelloWorld",
+  name: 'HelloWorld',
   props: {
     msg: String,
   },

+ 1 - 1
src/router/index.js

@@ -88,7 +88,7 @@ const research = [
     component: () => import('../views/research/remember.vue'),
   },
 ];
-// 用户中心
+// 管理员
 const userCenter = [
   {
     path: '/userCenter/index',

+ 1 - 4
src/views/education/detail/videos.vue

@@ -60,10 +60,7 @@ export default {
     },
     // 整理视频
     getVideo(data) {
-      if (data.length > 0) {
-        var url = data.map((item) => item.url)[0];
-        if (url) return url;
-      }
+      if (data && data.length > 0) return data[0].url;
     },
   },
   mounted() {

+ 3 - 2
src/views/education/videos.vue

@@ -3,7 +3,7 @@
     <el-row>
       <el-col :span="24" class="main">
         <el-col :span="24" class="top">
-          <top topType="2" :leftArrow="false"></top>
+          <top topType="1" @search="search"></top>
         </el-col>
         <el-col :span="24" class="info" :style="{ height: clientHeight + 'px' }">
           <video-index :list="list"></video-index>
@@ -51,7 +51,8 @@ export default {
   },
   methods: {
     ...MiniVideo(['query']),
-    async search({ skip = 0, limit = this.limit, ...info } = {}) {
+    async search({ skip = 0, limit = this.limit, searchName, ...info } = {}) {
+      if (searchName) info.title = searchName;
       let res = await this.query({ skip, limit, ...info });
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);

+ 47 - 1
src/views/userCenter/index.vue

@@ -6,7 +6,24 @@
           <top topType="2" :leftArrow="false"></top>
         </el-col>
         <el-col :span="24" class="info" :style="{ height: clientHeight + 'px' }">
-          <!-- <el-col :span="24" class="one"> 个人中心 </el-col> -->
+          <el-col :span="24" class="one">
+            <el-col :span="5" class="image">
+              <el-image :src="icon"></el-image>
+            </el-col>
+            <el-col :span="19" class="info">
+              <el-col :span="24" class="name textOver">
+                {{ '管理员' }}
+              </el-col>
+              <el-col :span="24" class="other">
+                <el-col :span="24" class="other_info textOver">
+                  电话:<span>{{ '17319450324' }}</span>
+                </el-col>
+                <el-col :span="24" class="other_info textOver">
+                  地址:<span>{{ '吉林省长春市' }}</span>
+                </el-col>
+              </el-col>
+            </el-col>
+          </el-col>
           <el-col :span="24" class="two">
             <admin-btn></admin-btn>
           </el-col>
@@ -30,6 +47,7 @@ export default {
   data: function () {
     return {
       clientHeight: '',
+      icon: require('@a/user.jpg'),
     };
   },
   async created() {
@@ -70,6 +88,34 @@ export default {
     .one {
       background-color: #fff;
       margin: 0 0 10px 0;
+      padding: 10px;
+      .image {
+        text-align: center;
+        .el-image {
+          width: 60px;
+          height: 60px;
+          border-radius: 90px;
+        }
+      }
+      .info {
+        background-color: #fff;
+        padding: 0 10px;
+        .name {
+          font-size: 16px;
+          font-weight: bold;
+          margin: 0 0 5px 0;
+        }
+        .other {
+          .other_info {
+            font-size: 14px;
+            color: #666;
+            margin: 0 0 2px 0;
+            span {
+              color: #000;
+            }
+          }
+        }
+      }
     }
     .two {
       background-color: #fff;

+ 76 - 0
src/views/userCenter/parts/admin copy.vue

@@ -0,0 +1,76 @@
+<template>
+  <div id="admin">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="one">
+          <el-col :span="24" class="text"> 科普教育 </el-col>
+          <el-col :span="24" class="btn">
+            <van-cell title="科普微视频" @click="btn('/education/videos')" is-link />
+            <van-cell title="科学辟谣" @click="btn('/education/refute')" is-link />
+            <van-cell title="专家观点" @click="btn('/education/expert')" is-link />
+          </el-col>
+        </el-col>
+        <el-col :span="24" class="one">
+          <el-col :span="24" class="text"> 科普教育 </el-col>
+          <el-col :span="24" class="btn">
+            <van-cell title="中科在线" @click="btn('/service/zhongke')" is-link />
+            <van-cell title="吉科在线" @click="btn('/service/jike')" is-link />
+            <!-- <van-cell title="预约服务" @click="btn('6')" is-link /> -->
+          </el-col>
+        </el-col>
+        <el-col :span="24" class="one">
+          <el-col :span="24" class="text"> 研学杂记 </el-col>
+          <el-col :span="24" class="btn">
+            <van-cell title="研学杂记" @click="btn('7')" is-link />
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'admin',
+  props: {},
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {
+    btn(to) {
+      this.$router.push({ path: `/userCenter${to}` });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .one {
+    padding: 10px;
+    border-bottom: 1px solid #ebedf0;
+    .text {
+      font-size: 16px;
+      font-weight: bold;
+      border-bottom: 1px dashed #ccc;
+      padding: 0 0 10px 0;
+    }
+  }
+}
+</style>

+ 18 - 32
src/views/userCenter/parts/admin.vue

@@ -3,26 +3,12 @@
     <el-row>
       <el-col :span="24" class="main">
         <el-col :span="24" class="one">
-          <el-col :span="24" class="text"> 科普教育 </el-col>
-          <el-col :span="24" class="btn">
-            <van-cell title="科普微视频" @click="btn('/education/videos')" is-link />
-            <van-cell title="科学辟谣" @click="btn('/education/refute')" is-link />
-            <van-cell title="专家观点" @click="btn('/education/expert')" is-link />
-          </el-col>
-        </el-col>
-        <el-col :span="24" class="one">
-          <el-col :span="24" class="text"> 科普教育 </el-col>
-          <el-col :span="24" class="btn">
-            <van-cell title="中科在线" @click="btn('/service/zhongke')" is-link />
-            <van-cell title="吉科在线" @click="btn('/service/jike')" is-link />
-            <!-- <van-cell title="预约服务" @click="btn('6')" is-link /> -->
-          </el-col>
-        </el-col>
-        <el-col :span="24" class="one">
-          <el-col :span="24" class="text"> 研学杂记 </el-col>
-          <el-col :span="24" class="btn">
-            <van-cell title="研学杂记" @click="btn('7')" is-link />
-          </el-col>
+          <van-cell title="科普微视频" @click="btn('/education/videos')" is-link />
+          <van-cell title="科学辟谣" @click="btn('/education/refute')" is-link />
+          <van-cell title="专家观点" @click="btn('/education/expert')" is-link />
+          <van-cell title="中科在线" @click="btn('/service/zhongke')" is-link />
+          <van-cell title="吉科在线" @click="btn('/service/jike')" is-link />
+          <van-cell title="研学杂记" @click="btn('7')" is-link />
         </el-col>
       </el-col>
     </el-row>
@@ -61,16 +47,16 @@ export default {
 </script>
 
 <style lang="less" scoped>
-.main {
-  .one {
-    padding: 10px;
-    border-bottom: 1px solid #ebedf0;
-    .text {
-      font-size: 16px;
-      font-weight: bold;
-      border-bottom: 1px dashed #ccc;
-      padding: 0 0 10px 0;
-    }
-  }
-}
+// .main {
+// .one {
+//   padding: 10px;
+//   border-bottom: 1px solid #ebedf0;
+//   .text {
+//     font-size: 16px;
+//     font-weight: bold;
+//     border-bottom: 1px dashed #ccc;
+//     padding: 0 0 10px 0;
+//   }
+// }
+// }
 </style>

+ 5 - 3
src/views/userCenter/service/jikeDetail.vue

@@ -9,7 +9,7 @@
           <van-form label-width="4.2em">
             <van-field v-model="form.name" name="机构名称" label="机构名称" placeholder="机构名称" />
             <van-field v-model="form.contact" name="联系人" label="联系人" placeholder="联系人" />
-            <van-field v-model="form.phone" name="联系电话" label="联系电话" placeholder="联系电话" />
+            <van-field v-model="form.phone" name="联系电话" label="联系电话" placeholder="联系电话" maxlength="11" />
             <van-field v-model="form.password" name="账号密码" label="账号密码" placeholder="账号密码" type="password" v-if="id == undefined" />
             <van-field v-model="form.addr" name="联系地址" label="联系地址" placeholder="联系地址" />
             <van-field
@@ -129,8 +129,10 @@ export default {
       // 上传,赋值
       const res = await this.upload({ file, dir: 'videos' });
       if (this.$checkRes(res)) {
-        console.log(res);
-        this.$set(this.form, model, [{ name: res.name, url: res.uri }]);
+        let data = _.cloneDeep(this.form[model]);
+        let file = { name: res.name, url: res.uri };
+        data.push(file);
+        this.$set(this.form, model, data);
       }
     },
     toDelete(file, model) {

+ 8 - 4
src/views/userCenter/service/zhongkeDetail.vue

@@ -9,7 +9,7 @@
           <van-form label-width="4.2em">
             <van-field v-model="form.name" name="机构名称" label="机构名称" placeholder="机构名称" />
             <van-field v-model="form.contact" name="联系人" label="联系人" placeholder="联系人" />
-            <van-field v-model="form.phone" name="联系电话" label="联系电话" placeholder="联系电话" />
+            <van-field v-model="form.phone" name="联系电话" label="联系电话" placeholder="联系电话" maxlength="11" />
             <van-field v-model="form.password" name="账号密码" label="账号密码" placeholder="账号密码" type="password" v-if="id == undefined" />
             <van-field v-model="form.addr" name="联系地址" label="联系地址" placeholder="联系地址" />
             <van-field
@@ -91,7 +91,9 @@ export default {
   data: function () {
     return {
       clientHeight: '',
-      form: {},
+      form: {
+        img_file: [],
+      },
     };
   },
   async created() {
@@ -128,8 +130,10 @@ export default {
       // 上传,赋值
       const res = await this.upload({ file, dir: 'videos' });
       if (this.$checkRes(res)) {
-        console.log(res);
-        this.$set(this.form, model, [{ name: res.name, url: res.uri }]);
+        let data = _.cloneDeep(this.form[model]);
+        let file = { name: res.name, url: res.uri };
+        data.push(file);
+        this.$set(this.form, model, data);
       }
     },
     toDelete(file, model) {

+ 1 - 1
vue.config.js

@@ -23,7 +23,7 @@ module.exports = {
         target: 'http://broadcast.waityou24.cn',
       },
       '/api/live': {
-        target: 'http://broadcast.waityou24.cn', //http://127.0.0.1:9101//http://broadcast.waityou24.cn
+        target: 'http://127.0.0.1:9101', //http://127.0.0.1:9101//http://broadcast.waityou24.cn
         changeOrigin: true,
         ws: false,
       },