lrf402788946 4 gadi atpakaļ
vecāks
revīzija
ed5e7ca1a8
3 mainītis faili ar 26 papildinājumiem un 10 dzēšanām
  1. 1 1
      src/router/index.js
  2. 22 6
      src/views/index.vue
  3. 3 3
      vue.config.js

+ 1 - 1
src/router/index.js

@@ -15,7 +15,7 @@ const routes = [
 
 const router = new VueRouter({
   mode: 'history',
-  base: process.env.NODE_ENV === 'development' ? '' : 'mobiledirtea',
+  base: process.env.NODE_ENV === 'development' ? '' : 'trainnotice',
   routes,
 });
 

+ 22 - 6
src/views/index.vue

@@ -1,8 +1,9 @@
 <template>
   <div id="index">
     <el-row>
-      <el-col :span="24">
-        <span v-if="type == '1'">
+      {{ notice.content }}
+      <!--<el-col :span="24">
+         <span v-if="type == '1'">
           学校
         </span>
         <span v-else-if="type == '2'">
@@ -11,7 +12,7 @@
         <span v-else-if="type == '3'">
           <class-index :dayList="dayList" :lessonList="lessonList" :classInfo="classInfo" />
         </span>
-      </el-col>
+      </el-col> -->
     </el-row>
   </div>
 </template>
@@ -20,12 +21,14 @@
 import _ from 'lodash';
 import classIndex from './worker/index.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: notice } = createNamespacedHelpers('notice');
 export default {
   name: 'index',
   props: {},
-  components: { classIndex },
+  components: {}, //classIndex
   data: function() {
     return {
+      notice: {},
       type: '3',
       lessonList: [
         { _id: '5f2a10297f40d16be433e81b', subname: '报道+开班仪式', day: '0', date: '2020-04-07', time: '13:30-16:30' },
@@ -104,8 +107,18 @@ export default {
   },
   created() {
     this.dealLesson();
+    this.search();
   },
   methods: {
+    ...notice(['fetch', 'lookFetch']),
+    async search() {
+      const res = await this.fetch(this.noticeid);
+      if (res.errcode == '0') {
+        this.$set(this, `notice`, res.data);
+        const r = await this.lookFetch({ noticeid: this.noticeid, userid: this.userid });
+        if (r.errcode == '0') this.$toast.success('消息已确认');
+      }
+    },
     dealLesson() {
       let dl = _.cloneDeep(this.lessonList);
       dl = _.groupBy(dl, 'date');
@@ -125,8 +138,11 @@ export default {
     classid() {
       return this.$route.query.classid;
     },
-    infoid() {
-      return this.$route.query.infoid;
+    noticeid() {
+      return this.$route.query.noticeid;
+    },
+    userid() {
+      return this.$route.query.userid;
     },
   },
   metaInfo() {

+ 3 - 3
vue.config.js

@@ -2,8 +2,8 @@ const path = require('path');
 const question = path.resolve(__dirname, '../question-examine');
 const frame = path.resolve(__dirname, '../frame');
 module.exports = {
-  publicPath: process.env.NODE_ENV === 'development' ? '/' : '/trainNotice',
-  outputDir: 'trainNotice',
+  publicPath: process.env.NODE_ENV === 'development' ? '/' : '/trainnotice',
+  outputDir: 'trainnotice',
   configureWebpack: config => {
     Object.assign(config, {
       // 开发生产共同配置
@@ -37,7 +37,7 @@ module.exports = {
         ws: true,
       },
       '/api': {
-        target: 'http://free.liaoningdoupo.com',
+        target: 'http://127.0.0.1:2001',
         changeOrigin: true,
         ws: true,
       },