소스 검색

Merge branch 'main' of https://gitlab.com/tea28/client

DaMowang 3 년 전
부모
커밋
13e7c0e530
3개의 변경된 파일162개의 추가작업 그리고 6개의 파일을 삭제
  1. 6 0
      src/pages.json
  2. 143 0
      src/pages/consultation-list/index.vue
  3. 13 6
      src/pages/notice/detail.vue

+ 6 - 0
src/pages.json

@@ -240,6 +240,12 @@
 			"style": {
 				"navigationBarTitleText": "公告详情"
 			}
+		},
+		{
+			"path": "pages/consultation-list/index",
+			"style": {
+				"navigationBarTitleText": "咨询列表"
+			}
 		}
 	],
 	"tabBar": {

+ 143 - 0
src/pages/consultation-list/index.vue

@@ -0,0 +1,143 @@
+<template>
+  <div class="home_page">
+    <div class="title">
+      <span>咨询列表</span>
+    </div>
+    <div>
+      <div
+        v-for="(item, index) of 6"
+        :key="index"
+        class="li"
+      >
+        <div class="li_top">
+          <div class="li_left">
+            <span>标题</span>
+            <span class="hint">作者</span>
+          </div>
+          <!-- <img src="@/assets/img/rightArrows.png" class="li_img" /> -->
+        </div>
+        <div class="text">
+          <span>我是测试啊</span>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+  
+<script>
+import { post } from "@/request/api.js";
+export default {
+  data() {
+    return {
+      noticeList: [],
+      page: 1,
+      pageSize: 10, //页数
+      totalPage: 0, //总页数
+      loading: false,
+      finished: false,
+    };
+  },
+  methods: {
+    //跳转
+    init() {
+      if (this.account) {
+        this.getNoticeList();
+      }
+    },
+    getNoticeList() {
+      let data = {
+        page: this.page,
+        page_size: this.pageSize,
+      };
+      basicApi.noticeList(data).then((res) => {
+        if (res.code == 200) {
+          this.noticeList = this.noticeList.concat(res.data.list);
+          this.totalPage = Math.ceil(res.data.total_count / this.pageSize);
+          this.page++;
+          this.loading = false;
+          if (this.page > this.totalPage) return (this.finished = true);
+        } else {
+          this.$toast(res.msg);
+        }
+      });
+    },
+    switchovers(route, item) {
+      if (route == "") return this.$toast(this.$t("lang.swap109"));
+      this.$router.push({ name: route, query: { item: JSON.stringify(item) } });
+      // this.$Router.pushPage({
+      //   name: route
+      // })
+    },
+  },
+  computed: {
+    ...mapState(["account"]),
+  },
+  created() {
+    this.init();
+  },
+  watch: {
+    account() {
+      this.init();
+    },
+  },
+};
+</script>
+  <style lang="scss" scoped>
+.home_page {
+  padding: 20px;
+}
+.title {
+  color: #fff;
+  margin: 20px 0;
+}
+.li {
+  background: #232b3e;
+  border-radius: 8px;
+  padding: 10px;
+  margin-bottom: 20px;
+  .li_top {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    border-bottom: 1px solid #2a272a;
+    padding-bottom: 10px;
+    .li_left {
+      display: flex;
+      flex-direction: column;
+      font-size: 14px;
+      color: #fff;
+      .hint {
+        color: #999;
+        font-size: 12px;
+        margin-top: 6px;
+      }
+    }
+    .li_img {
+      width: 10px;
+      height: 10px;
+    }
+  }
+  .text {
+    color: #999;
+
+    font-size: 12px;
+    margin-top: 10px;
+  }
+}
+.bare {
+  position: fixed;
+  top: 50%;
+  left: 50%;
+  transform: translateX(-50%) translateY(-50%);
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  font-size: 14px;
+  padding: 40px 0;
+  .bare_img {
+    width: 120px;
+    height: 100px;
+    margin-bottom: 8px;
+  }
+}
+</style>

+ 13 - 6
src/pages/notice/detail.vue

@@ -1,8 +1,15 @@
 <template>
   <view class="container">
     <!-- 公告详情 -->
-    <view class="title">{{noticeDetail.title}}</view>
-    <view class="time" v-if="noticeDetail">{{ $day(noticeDetail.add_time * 1000).format('YYYY-MM-DD HH:mm:ss') }}</view>
+    <view class="title">{{ noticeDetail.title }}</view>
+    <view class="time" v-if="noticeDetail">
+        <span>
+            <span>作者:{{noticeDetail.author ||  '数智云商城'}}</span>
+        </span>
+      <span :style="{'margin-left':'20rpx'}">
+          时间: {{ $day(noticeDetail.add_time * 1000).format("YYYY-MM-DD HH:mm:ss") }}
+      </span></view
+    >
     <jyf-parser :html="noticeDetail.content" class="mar_t50"></jyf-parser>
     <!-- 公告详情-end -->
   </view>
@@ -53,15 +60,15 @@ export default {
   border-top: 20rpx solid #f5f5f5;
   padding: 0 20rpx;
   box-sizing: border-box;
-  .title{
+  .title {
     margin-top: 20rpx;
     font-size: 48rpx;
     font-weight: bold;
   }
-  
-  .time{
+
+  .time {
     margin-top: 10rpx;
-    font-size: 30rpx;
+    font-size: 20rpx;
     color: #666363;
   }
 }