浏览代码

手机聊天页面框架

lrf402788946 5 年之前
父节点
当前提交
a2d91ce07a
共有 7 个文件被更改,包括 135 次插入6 次删除
  1. 2 4
      package-lock.json
  2. 29 0
      public/iconfont.css
  3. 2 1
      public/index.html
  4. 1 1
      src/components/slide-cell.vue
  5. 73 0
      src/layout/chat-frame.vue
  6. 5 0
      src/router.js
  7. 23 0
      src/views/chat/index.vue

+ 2 - 4
package-lock.json

@@ -2808,8 +2808,7 @@
       "version": "4.6.0",
       "resolved": "http://registry.npm.taobao.org/co/download/co-4.6.0.tgz",
       "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=",
-      "dev": true,
-      "optional": true
+      "dev": true
     },
     "coa": {
       "version": "2.0.2",
@@ -9514,8 +9513,7 @@
       "version": "4.0.8",
       "resolved": "http://registry.npm.taobao.org/rx-lite/download/rx-lite-4.0.8.tgz",
       "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=",
-      "dev": true,
-      "optional": true
+      "dev": true
     },
     "rx-lite-aggregates": {
       "version": "4.0.8",

文件差异内容过多而无法显示
+ 29 - 0
public/iconfont.css


+ 2 - 1
public/index.html

@@ -7,7 +7,8 @@
     <meta name="viewport"
       content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-    <title>visit-doctor</title>
+    <link rel="stylesheet" href="./iconfont.css">
+    <title>寻访</title>
   </head>
   <body>
     <noscript>

+ 1 - 1
src/components/slide-cell.vue

@@ -12,7 +12,7 @@
           style="height:100%"
         />
       </template>
-      <van-cell title-class="title__class">
+      <van-cell title-class="title__class" @click="$router.push({ path: '/chat/index' })">
         <!-- 用户/群组名称 -->
         <template #title>
           <van-row>

+ 73 - 0
src/layout/chat-frame.vue

@@ -0,0 +1,73 @@
+<template>
+  <div id="chat-frame">
+    <van-sticky :offset-top="0">
+      <van-nav-bar :left-arrow="returns ? true : false" :left-text="returns ? title : ''" @click-left="$router.push({ path: returns })">
+        <template #right>
+          <van-icon name="ellipsis" @click="toCheckMore()" />
+        </template>
+      </van-nav-bar>
+    </van-sticky>
+    <div style="margin-bottom:50px;">
+      <van-row v-for="i in 100" :key="i">
+        <van-col span="24">{{ i }}</van-col>
+      </van-row>
+    </div>
+    <van-row class="footer" type="flex" justify="center">
+      <van-col sapn="2" class="iconfont icon-yuyin icons">&nbsp; </van-col>
+      <van-col span="18" style="padding-right:5px;">
+        <van-field v-model="value" class="chat__input" />
+      </van-col>
+      <van-col sapn="2" class="iconfont icon-biaoqing icons">&nbsp; </van-col>
+      <van-col sapn="2" class="iconfont icon-21 icons">&nbsp; </van-col>
+    </van-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'chat-frame',
+  props: { title: null, returns: { type: null, default: null } },
+  components: {},
+  data: () => ({
+    value: '',
+  }),
+  created() {},
+  mounted() {
+    this.container = this.$refs.container;
+  },
+  computed: {},
+  methods: {
+    toCheckMore() {
+      //TODO 查看更多信息,返回父组件,根据不同情景查询
+      console.log('to More');
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.footer {
+  position: fixed;
+  bottom: 0;
+  width: 100%;
+  background: #cccccc;
+}
+.icons {
+  zoom: 1.5;
+  padding-top: 0.6rem;
+  padding-left: 0.1875rem;
+}
+.chat__input {
+  width: 100%;
+  background: #cccccc;
+  padding: 0.625rem 0;
+}
+/deep/.van-cell__value--alone {
+  color: #323233;
+  text-align: left;
+  background: #ffffff;
+}
+/deep/.van-field__control {
+  height: 27px;
+}
+</style>

+ 5 - 0
src/router.js

@@ -25,5 +25,10 @@ export default new Router({
       name: '医生主页',
       component: () => import('./views/doctor/index.vue'),
     },
+    {
+      path: '/chat/index',
+      name: '群聊',
+      component: () => import('./views/chat/index.vue'),
+    },
   ],
 });

+ 23 - 0
src/views/chat/index.vue

@@ -0,0 +1,23 @@
+<template>
+  <div id="index">
+    <chat-frame returns="/doctor/index" title="二群"></chat-frame>
+  </div>
+</template>
+
+<script>
+import chatFrame from '@/layout/chat-frame.vue';
+export default {
+  metaInfo: { title: '群聊' },
+  name: 'index',
+  props: {},
+  components: {
+    chatFrame,
+  },
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {},
+};
+</script>
+
+<style lang="less" scoped></style>