ZhaoJing 2 years ago
parent
commit
681475c712

File diff suppressed because it is too large
+ 301 - 279
package-lock.json


BIN
src/assets/home/banner3.png


BIN
src/assets/home/djzl.png


+ 65 - 5
src/pages/_home/index.vue

@@ -5,7 +5,8 @@ import { child } from '~/store/child';
 import img_bg from '~/assets/home/bg.png';
 import img_banner1 from '~/assets/home/banner1.png';
 import img_banner2 from '~/assets/home/banner2.jpg';
-
+import img_banner3 from '~/assets/home/banner3.png';
+import img_djzl from '~/assets/home/djzl.png';
 import img_qzzx from '~/assets/home/qzzx.png';
 import img_xskt from '~/assets/home/xskt.png';
 import img_stxk from '~/assets/home/stxk.png';
@@ -24,6 +25,7 @@ const images = [
 ];
 
 const gridList = [
+  { icon: img_djzl, text: '党建专栏', to: () => '/djzl' },
   { icon: img_qzzx, text: '求真在线', to: () => '/qzzx' },
   // { icon: img_xskt, text: '线上课堂', to: () => '/xskt' },
   {
@@ -70,6 +72,9 @@ function handleClickCard(row) {
     router.push(`/qzzx/qzzxxq/${row.id}`)
   }
 }
+function register() {
+  
+}
 </script>
 
 <template>
@@ -83,15 +88,26 @@ function handleClickCard(row) {
       <van-swipe-item v-for="image in images" :key="image">
         <img :src="image" class="w-full" />
       </van-swipe-item>
+      <van-swipe-item>
+        <img @click="register()" src="../../assets/home/banner3.png" style="height:100%" class="w-full" alt="">
+      </van-swipe-item>
     </van-swipe>
-    <van-grid :gutter="10" class="mt-4" icon-size="60px">
-      <template v-for="item in gridList" :key="item.text">
-        <van-grid-item v-if="item.permission || item.permission === undefined" :icon="item.icon" :text="item.text"
+    <van-grid :gutter="10" class="mt-4" icon-size="68px">
+      <template  v-for="item in gridList" :key="item.text">
+        <van-grid-item class="w-20" v-if="item.permission || item.permission === undefined" :icon="item.icon" :text="item.text"
           :to="item.to()" />
       </template>
     </van-grid>
   </div>
-
+  <div class="px-4 flex w-full notice">
+    <div class="w-40"> 
+      <span class="tz">通知</span>
+      <span class="gg ml-4px">公告</span>
+    </div>
+    <div class="text truncate cursor-pointer">
+      我是通知公告文字文字文字文字文字文字文字文字
+    </div>
+  </div>
   <van-tabs sticky swipeable>
     <van-tab v-for="cate in cateData" :title="cate.nic_name">
       <remote-list url="/news/info/index"
@@ -126,3 +142,47 @@ function handleClickCard(row) {
   background-color: #39a9ed;
 }
 </style>
+<style lang="scss" scoped>
+.bg{
+  // width: 100%;
+  // height: 193px;
+  // background-size: 100%;
+  // background-position: center;
+}
+  .notice{
+    align-items: center;
+    justify-content: space-between;
+    height: 60px;
+    line-height: 60px;
+    background-color: #fff;
+    border-top: 1.19px solid #D8E2F0;
+    border-bottom: 1.19px solid #D8E2F0;
+    .text{
+      height: 60px;
+      line-height: 65px;
+    }
+  }
+  .tz{
+    vertical-align: middle;
+    font-size: 28px;
+    font-family: Regular;
+    text-align: center;
+    color: #747474;
+    letter-spacing: 0px;
+  }
+  .gg{
+    vertical-align: text-top;
+    display: inline-block;
+    width: 35px;
+    height: 23px;
+    line-height: 23px;
+    text-align: center;
+    background: #ff8700;
+    border-radius: 4px;
+    font-size: 14px;
+    color: #fff;
+  }
+  .register{
+    
+  }
+</style>

+ 95 - 0
src/pages/djzl/api.js

@@ -0,0 +1,95 @@
+import request from '@/utils/request';
+export const qzzx_list = (data = {}) =>
+    request({
+        url: '/news/info/index',
+        data: {
+            page: data.page,
+            limit: data.limit,
+            keyword: data.keyword,
+            nic_id: data.nic_id
+
+
+
+        }
+    })
+export const qzzx_add = (data = {}) =>
+    request({
+        url: '/news/info/add',
+        data: {
+            issubmit: '1',
+            news_info: {
+                ni_title: data.ni_title,
+                ni_img: data.ni_img,
+                ni_tag: data.ni_tag,
+                ni_content: data.ni_content,
+                ni_fbr: data.ni_fbr,
+                ni_id: data.ni_id,
+                ni_url: data.ni_url,
+            }
+        }
+    })
+export const qzzx_edit = (data = {}) =>
+    request({
+        url: '/news/info/edit',
+        data: {
+            issubmit: '1',
+            ni_id: data.ni_id,
+            news_info: {
+                ni_title: data.ni_title,
+                ni_tag: data.ni_tag,
+                ni_content: data.ni_content,
+                ni_fbr: data.ni_fbr,
+                ni_id: data.ni_id,
+                ni_url: data.ni_url,
+            }
+        }
+    })
+export const qzzx_detail = (data = {}) =>
+    request({
+        url: '/news/info/detail',
+        data: {
+            issubmit: '1',
+            ni_id: data.ni_id,
+        }
+    })
+
+export const qzzx_del = (data = {}) =>
+    request({
+        url: '/news/info/delete',
+        data: {
+            issubmit: '1',
+            ni_id: data.ni_id,
+
+        }
+    })
+
+export const xwlx_list = (data = {}) =>
+    request({
+        url: '/news/info_cate/api_tree',
+        data: {
+            page: data.page,
+            limit: data.limit,
+            keyword: data.keyword,
+            type: data.type
+
+
+
+        }
+    })
+
+// 签到
+export const stxkjs_qd = (data = {}) => {
+    return request({
+        url: '/khfw/kcbkb_qd/edit',
+        data: {
+            kkq_id: data.kkq_id,
+            khfw_kcbkb_qd: data.khfw_kcbkb_qd
+        },
+    })
+}
+export const stxk_up = (data = {}) => {
+    return REQUEST['upload']({
+        url: 'upload/main/file',
+        data: { filedata: data.file }
+    })
+}

+ 10 - 0
src/pages/djzl/djzlxq/api.js

@@ -0,0 +1,10 @@
+import request from '@/utils/request';
+
+export const qzzx_detail = (data = {}) =>
+    request({
+        url: '/news/info/detail',
+        data: {
+            issubmit: '1',
+            ni_id: data.ni_id,
+        }
+    })

+ 157 - 0
src/pages/djzl/djzlxq/index.vue

@@ -0,0 +1,157 @@
+<template>
+  <div class="content">
+    <van-nav-bar title="详情" left-arrow @click-left="onClickLeft" />
+    <div class="content-list">
+      <div>
+        <p>
+          {{ zxxqInfo.name }}
+        </p>
+        <div>{{ zxxqInfo.cate_name }}</div>
+        <p>{{ zxxqInfo.create_dateline_format }}</p>
+      </div>
+    </div>
+
+    <img :src="https + '/' + zxxqInfo.img" alt="" />
+    <div class="text-content" v-html="zxxqInfo.content"></div>
+    <div class="img-list">
+      <img src="@/assets/images/qzzx.png" alt="" />
+      <img src="@/assets/images/qzzx.png" alt="" />
+      <img src="@/assets/images/qzzx.png" alt="" />
+    </div>
+  </div>
+</template>
+
+<script>
+import { qzzx_detail } from "./api";
+export default {
+  data() {
+    return {
+      active: 2,
+      tableData: [],
+      zxxqInfo: "",
+      https: window.GLOBAL_CONFIG.api,
+    };
+  },
+  methods: {
+    onClickLeft() {
+      this.$router.push({ name: "djzl" });
+    },
+
+    zxxqData() {
+      let data = {
+        ni_id: this.ni_id,
+      };
+
+      qzzx_detail(data).then((res) => {
+        if (res.code == 1) {
+          this.zxxqInfo = res.data.one_info;
+        }
+      });
+    },
+  },
+
+  mounted() {
+    if (this.$route.params.id != "") {
+      this.ni_id = this.$route.params.id;
+      this.zxxqData();
+    }
+  },
+};
+</script>
+
+<style  lang="scss" scoped>
+.content {
+  margin: 0 auto;
+  background-color: #fff;
+}
+::v-deep .van-nav-bar {
+  width: 100%;
+  height: 1 * 13.3vw;
+  line-height: 1 * 13.3vw;
+  background-color: #003eee;
+  .van-nav-bar__title {
+    color: #fff !important;
+    font-size: 0.36 * 13.3vw;
+    font-weight: 350;
+  }
+  .van-nav-bar__text {
+    color: #fff !important;
+    font-size: 0.32 * 13.3vw;
+    font-weight: 350;
+  }
+}
+.content-list {
+  box-sizing: border-box;
+  width: 7 * 13.3vw;
+  height: 1.6 * 13.3vw;
+  margin: 0.135 * 13.3vw 2% 0.135 * 13.3vw 3%;
+  display: flex;
+  flex-wrap: wrap;
+  margin: 0.2 * 13.3vw 0.31 * 13.3vw 0 0.17 * 13.3vw;
+
+  div {
+    width: 100%;
+    position: relative;
+    p:first-of-type {
+      font-size: 0.28 * 13.3vw;
+      font-family: Segoe UI, Segoe UI-Regular;
+      font-weight: 400;
+      text-align: left;
+      color: #000000;
+    }
+    p:last-of-type {
+      font-size: 0.24 * 13.3vw;
+      font-family: Segoe UI, Segoe UI-Regular;
+      font-weight: 400;
+      text-align: left;
+      color: #bdbdbd;
+      display: inline-block;
+      position: absolute;
+      right: 0;
+      bottom: 0.15 * 13.3vw;
+    }
+    div {
+      width: 1.2 * 13.3vw;
+      height: 0.42 * 13.3vw;
+      border: 0.01 * 13.3vw solid #0b2aca;
+      border-radius: 0.06 * 13.3vw;
+      font-size: 0.24 * 13.3vw;
+      font-family: Segoe UI, Segoe UI-Regular;
+      font-weight: 400;
+      text-align: center;
+      color: #003eee;
+      display: inline-block;
+      position: absolute;
+      left: 0;
+      bottom: 0.15 * 13.3vw;
+    }
+  }
+}
+.main-img {
+  width: 7.02 * 13.3vw;
+  height: 3.2 * 13.3vw;
+  margin: 0.2 * 13.3vw 0.31 * 13.3vw 0.37 * 13.3vw 0.17 * 13.3vw;
+}
+.text-content {
+  width: 7.01 * 13.3vw;
+  height: 5.35 * 13.3vw;
+  margin: 0 0.31 * 13.3vw 0 0.17 * 13.3vw;
+  opacity: 0.65;
+  font-size: 0.24 * 13.3vw;
+  font-family: PingFang-SC-Regular;
+  text-align: left;
+  color: #010101;
+  line-height: 0.48 * 13.3vw;
+}
+.img-list {
+  width: 7.01 * 13.3vw;
+  height: 2.3 * 13.3vw;
+  margin: 0 0.31 * 13.3vw 0 0.17 * 13.3vw;
+  img {
+    height: 2.3 * 13.3vw;
+    float: left;
+    width: 33.33%;
+    padding: 0.07 * 13.3vw;
+  }
+}
+</style>

+ 160 - 0
src/pages/djzl/index.vue

@@ -0,0 +1,160 @@
+<script setup>
+import { showSuccessToast } from 'vant';
+// import { resolveSingleFileString } from '~/utils/helper';
+import user from '~/store/user';
+import { child } from '~/store/child';
+
+function handleNavLeftClick() {
+  router.replace('/home')
+}
+
+
+
+const router = useRouter()
+function handleClickCard(row) {
+  if (row.ni_type == '1') {
+    window.open(row.brief)
+  } else {
+    router.push(`/djzl/djzlxq/${row.id}`)
+  }
+}
+
+
+let cateData = $ref([])
+let cateLoading = $ref(true)
+
+request({
+  url: '/news/info_cate/api_tree',
+  data: {
+    token: user._role === 'jz' ? child.token : user.token
+  }
+}).then(res => {
+  cateData = res.data
+  cateLoading = false
+})
+
+let overlayShow = $ref(false)
+const overlayForm = reactive({
+  nic_id: '',
+  ni_title: '',
+  ni_content: '',
+  ni_img: '',
+  ni_type: '1',
+})
+
+function handleNavRightClick() {
+  if (user._role === 'jz') return;
+
+  overlayForm.nic_id = ''
+  overlayForm.ni_title = ''
+  overlayForm.ni_content = ''
+  overlayForm.ni_img = ''
+  overlayForm.ni_type = '1'
+
+  overlayShow = true
+}
+
+function handleOverlaySubmit() {
+  // console.log('overlayForm :>> ', overlayForm);
+  request({
+    url: '/news/info/add',
+    data: {
+      news_info: overlayForm
+    }
+  }).then(res => {
+    if (res.code === '1') {
+      overlayShow = false
+      showSuccessToast('提交成功')
+    }
+  })
+}
+
+let pickerVal = $ref()
+let showPicker = $ref(false)
+function onFinish(val) {
+  // console.log('onFinish :>> ', val);
+  const { selectedOptions } = val
+  pickerVal = selectedOptions.map((option) => option.nic_name).join(' - ');
+}
+</script>
+
+<template>
+  <van-sticky>
+    <van-nav-bar v-if="user._role === 'jz'" title="党建专栏" left-arrow @click-left="handleNavLeftClick">
+    </van-nav-bar>
+    <van-nav-bar v-else title="党建专栏" right-text="新建" @click-right="handleNavRightClick" left-arrow
+      @click-left="handleNavLeftClick">
+    </van-nav-bar>
+  </van-sticky>
+
+  <van-tabs sticky swipeable>
+    <van-tab v-for="cate in cateData" :title="cate.nic_name">
+      <remote-list url="/news/info/index"
+        :d="{ nic_id: cate.nic_id, urltype: 1, token: user._role === 'jz' ? child.token : user.token }" class="mt-2">
+        <template #default="{ row: item }">
+          <van-card :title="item.name" :thumb="(item.img)" @click="handleClickCard(item)">
+            <template #price>
+              <van-tag plain type="primary">{{ item.nic_name }}</van-tag>
+            </template>
+            <template #num>
+              {{ item.datetime }}
+            </template>
+          </van-card>
+        </template>
+      </remote-list>
+    </van-tab>
+  </van-tabs>
+
+
+  <van-overlay :show="overlayShow" @click="overlayShow = false" class="flex justify-center items-center">
+    <div class="bg-white w-9/10 p-4 rounded-md dark:bg-black" @click.stop>
+      <div class="font-bold text-lg mb-4 pre">新建求真在线</div>
+
+      <van-form @submit="handleOverlaySubmit" label-width="5em">
+        <van-field name="nic_id" label="新闻类型" is-link readonly @click="showPicker = true" v-model="pickerVal"
+          :rules="[{ required: true, message: '新闻类型不能为空' }]"> </van-field>
+
+        <van-popup v-model:show="showPicker" round position="bottom">
+          <van-cascader v-model="overlayForm.nic_id" title="请选择新闻类型" :options="cateData" @close="showPicker = false"
+            @finish="onFinish" :field-names="{
+              text: 'nic_name',
+              value: 'nic_id',
+              children: 'treeList',
+            }" />
+        </van-popup>
+
+        <van-field name="ni_title" v-model="overlayForm.ni_title" placeholder="请输入新闻标题..." label="新闻标题"
+          :rules="[{ required: true, message: '新闻标题不能为空' }]"></van-field>
+
+        <van-field name="radio" label="内容类型">
+          <template #input>
+            <van-radio-group v-model="overlayForm.ni_type" direction="horizontal">
+              <van-radio name="1">美篇链接</van-radio>
+              <van-radio name="0">普通新闻</van-radio>
+            </van-radio-group>
+          </template>
+        </van-field>
+
+        <van-field v-model="overlayForm.ni_content" name="ni_content"
+          :placeholder="`请输入${overlayForm.ni_type === '1' ? '美篇链接' : '新闻内容'}...`" maxlength="500" show-word-limit rows="6"
+          type="textarea" autosize
+          :rules="[{ required: true, message: overlayForm.ni_type === '1' ? '美篇链接不能为空' : '新闻内容不能为空' }]"
+          :label="overlayForm.ni_type === '1' ? '美篇链接' : '新闻内容'" />
+
+        <van-field name="ni_img" label="封面图片" :rules="[{ required: true, message: '封面图片不能为空' }]">
+          <template #input>
+            <file-upload v-model="overlayForm.ni_img" :max-count="1"></file-upload>
+          </template>
+        </van-field>
+
+
+
+        <div style="margin: 16px;">
+          <van-button round block type="primary" native-type="submit">
+            提交
+          </van-button>
+        </div>
+      </van-form>
+    </div>
+  </van-overlay>
+</template>

+ 64 - 0
src/pages/djzl/xwxq.vue

@@ -0,0 +1,64 @@
+<script setup>
+import user from '~/store/user';
+import { child } from '~/store/child';
+
+const oss = window.GLOBAL_CONFIG.oss
+
+const props = defineProps({
+  id: {
+    type: String,
+    default: undefined,
+  },
+})
+
+const router = useRouter()
+function handleNavLeftClick() {
+  router.back()
+}
+
+let loading = $ref(true)
+let detailInfo = $ref()
+request({
+  url: '/news/info/detail',
+  data: {
+    ni_id: props.id,
+    token: user._role === 'jz' ? child.token : user.token
+  }
+}).then(res => {
+  if (res.code === '1') {
+    detailInfo = res.data.one_info
+  } else {
+
+  }
+  loading = false
+})
+
+</script>
+
+<template>
+
+  <van-sticky>
+    <van-nav-bar title="详情" left-arrow @click-left="handleNavLeftClick">
+    </van-nav-bar>
+  </van-sticky>
+
+  <div class="p-2 w-full">
+    <van-skeleton title :row="10" :loading="loading" class="flex">
+      <div class="text-sm mb-4 flex-none">
+        <div class="flex text-lg py-1">
+          <div class="mr-4 font-bold">{{  detailInfo.name  }}</div>
+        </div>
+
+        <div class="flex py-1 justify-between">
+          <van-tag type="primary">{{  detailInfo.nic_name  }}</van-tag>
+          <div class="mr-4">{{  detailInfo.create_dateline_format  }}</div>
+        </div>
+      </div>
+
+      <van-image :src="detailInfo.img" class="w-full"></van-image>
+
+
+      <div v-html="detailInfo.content" class="my-2 text-sm min-h-32"> </div>
+    </van-skeleton>
+  </div>
+</template>

+ 79 - 59
src/router/index.js

@@ -4,86 +4,106 @@ export default createRouter({
   history: createWebHashHistory(),
   routes: [
     {
-      path: '/',
-      redirect: '/home'
+      path: "/",
+      redirect: "/home",
     },
     {
-      path: '/home',
+      path: "/home",
       name: "home",
-      title: '首页',
+      title: "首页",
       component: () => import("~/pages/_home/index.vue"),
     },
     {
-      path: '/chat',
-      title: '消息',
-      children: [{
-        path: '',
-        name: 'chat',
-        component: () => import("~/pages/_chat/index.vue"),
-      }, {
-        name: 'chat_detail',
-        path: '/chat/:id',
-        component: () => import("~/pages/_chat/detail/index.vue"),
-      }]
+      path: "/chat",
+      title: "消息",
+      children: [
+        {
+          path: "",
+          name: "chat",
+          component: () => import("~/pages/_chat/index.vue"),
+        },
+        {
+          name: "chat_detail",
+          path: "/chat/:id",
+          component: () => import("~/pages/_chat/detail/index.vue"),
+        },
+      ],
     },
     {
-      path: '/user',
+      path: "/user",
       component: () => import("~/pages/_user/index.vue"),
     },
     {
-      path: '/stxk',
+      path: "/stxk",
       children: [
         {
-          path: 'jz',
+          path: "jz",
           children: [
             {
-              path: '',
-              component: () => import("~/pages/stxk/jz/index.vue")
+              path: "",
+              component: () => import("~/pages/stxk/jz/index.vue"),
             },
             {
-              path: 'kcxq/:id',
+              path: "kcxq/:id",
               component: () => import("~/pages/stxk/jz/kcxq.vue"),
               props: true,
             },
             {
-              path: 'wd',
+              path: "wd",
               children: [
                 {
-                  path: '',
-                  component: () => import("~/pages/stxk/jz/wd/index.vue")
+                  path: "",
+                  component: () => import("~/pages/stxk/jz/wd/index.vue"),
                 },
                 {
-                  path: 'kcxq/:id',
+                  path: "kcxq/:id",
                   component: () => import("~/pages/stxk/jz/wd/kcxq.vue"),
                   props: true,
                 },
                 {
-                  path: 'kcapxq/:id',
+                  path: "kcapxq/:id",
                   component: () => import("~/pages/stxk/jz/wd/kcapxq.vue"),
                   props: true,
-                }
-              ]
-            }
-          ]
+                },
+              ],
+            },
+          ],
         },
-      ]
+      ],
     },
     {
       path: "/qzzx",
 
       children: [
         {
-          path: '',
-          name: 'qzzx',
+          path: "",
+          name: "qzzx",
           component: () => import("~/pages/qzzx/index.vue"),
         },
         {
           // name: 'chat_detail',
-          path: 'qzzxxq/:id',
+          path: "qzzxxq/:id",
           component: () => import("~/pages/qzzx/xwxq.vue"),
-          props: true
-        }
-      ]
+          props: true,
+        },
+      ],
+    },
+    {
+      path: "/djzl",
+
+      children: [
+        {
+          path: "",
+          name: "djzl",
+          component: () => import("~/pages/djzl/index.vue"),
+        },
+        {
+          // name: 'chat_detail',
+          path: "djzlxq/:id",
+          component: () => import("~/pages/djzl/xwxq.vue"),
+          props: true,
+        },
+      ],
     },
     // {
     //   path: "/qzzx/qzzxxq/:id",
@@ -91,31 +111,31 @@ export default createRouter({
     //   component: () => import("~/pages/qzzx/qzzxxq/index.vue"),
     // },
     {
-      path: '/stxk_teacher',
-      component: () => import("~/pages/stxkjs/index.vue")
+      path: "/stxk_teacher",
+      component: () => import("~/pages/stxkjs/index.vue"),
     },
     {
-      path: '/stxk_teacher_class/:kkbk_id',
-      name: 'stxk_teacher_class',
+      path: "/stxk_teacher_class/:kkbk_id",
+      name: "stxk_teacher_class",
       component: () => import("~/pages/stxkjs/stxk_js_classdetail/index.vue"),
     },
     {
-      path: '/jscz',
-      component: () => import("~/pages/jscz/index.vue")
+      path: "/jscz",
+      component: () => import("~/pages/jscz/index.vue"),
     },
     {
-      path: '/jsyx/:yjkc_id',
-      name: 'jsyx',
-      component: () => import("~/pages/jscz/jsyx/index.vue")
+      path: "/jsyx/:yjkc_id",
+      name: "jsyx",
+      component: () => import("~/pages/jscz/jsyx/index.vue"),
     },
     {
-      path: '/stxkbzr',
-      component: () => import("~/pages/stxkbzr/index.vue")
+      path: "/stxkbzr",
+      component: () => import("~/pages/stxkbzr/index.vue"),
     },
     {
-      path: '/stxkjsd',
-      name: 'stxkjsd',
-      component: () => import("~/pages/stxkjsd/index.vue")
+      path: "/stxkjsd",
+      name: "stxkjsd",
+      component: () => import("~/pages/stxkjsd/index.vue"),
     },
     {
       path: "/stxkjsd/ckxq/:id",
@@ -123,17 +143,17 @@ export default createRouter({
       component: () => import("~/pages/stxkjsd/ckxq/index.vue"),
     },
     {
-      path: '/yshd/wjdc',
-      component: () => import("~/pages/yshd/wjdc/index.vue")
+      path: "/yshd/wjdc",
+      component: () => import("~/pages/yshd/wjdc/index.vue"),
     },
     {
-      path: '/xzxx',
-      component: () => import("~/pages/xzxx/index.vue")
+      path: "/xzxx",
+      component: () => import("~/pages/xzxx/index.vue"),
     },
     {
-      path: '/yshd/tpsj',
-      component: () => import("~/pages/yshd/tpsj/index.vue")
+      path: "/yshd/tpsj",
+      component: () => import("~/pages/yshd/tpsj/index.vue"),
     },
-  ]
-})
+  ],
+});
 

File diff suppressed because it is too large
+ 142 - 71
src/store/user.js