Selaa lähdekoodia

feat: 修改样式

linwenxin 1 vuosi sitten
vanhempi
commit
1b7e10d96b
4 muutettua tiedostoa jossa 37 lisäystä ja 94 poistoa
  1. 1 62
      src/mixins/index.js
  2. 4 2
      src/pages.json
  3. 2 2
      src/pages/message/index.vue
  4. 30 28
      src/pages/message/msgView.vue

+ 1 - 62
src/mixins/index.js

@@ -23,15 +23,6 @@ function loadStyleString(css) {
 
 // 存放页面公用数据、方法...
 export default {
-  data() {
-    return {
-
-    }
-  },
-  mixins: [],
-  onLoad() {
-
-  },
   mounted() {
     if (isWeixin()) {
       // 去除顶部
@@ -54,57 +45,5 @@ export default {
   },
   methods: {
     webViewHref: webViewHref,
-    //检查文件类型
-    $checkFileType(url) {
-      if (!url) return '';
-      if (url.indexOf('?') >= 0) {
-        url = url.slice(0, url.indexOf('?'));
-      }
-      const fileSuffix = url.substring(url.lastIndexOf(".") + 1);
-      const wordList = ['doc', 'docx', 'dot', 'wps', 'wpt'];
-      const excelList = ['xls', 'xlsx', 'xlt', 'et', 'ett'];
-      const pptList = ['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'];
-      const pdfList = ['pdf'];
-      const imgList = ['jpg', 'jpeg', 'png'];
-      const videoList = ['mp4'];
-      if (wordList.indexOf(fileSuffix) >= 0) {
-        return 'word';
-      } else if (excelList.indexOf(fileSuffix) >= 0) {
-        return 'excel';
-      } else if (pptList.indexOf(fileSuffix) >= 0) {
-        return 'ppt';
-      } else if (pdfList.indexOf(fileSuffix) >= 0) {
-        return 'pdf';
-      } else if (imgList.indexOf(fileSuffix) >= 0) {
-        return 'img';
-      } else if (videoList.indexOf(fileSuffix) >= 0) {
-        return 'video';
-      } else {
-        return '';
-      }
-    },
-
-    //密码转化成密文
-    $passwordFn(id, pas) {
-      let k = 123456789
-      for (let i = 0; i < id.length; i++) {
-        let a = (id[i].charCodeAt() % 13) + 1
-        k = ((k * a) % 9999999) + 1
-      }
-      k = (k % 98989898) + 99
-      for (let i = 0; i < pas.length; i++) {
-        let a = (pas[i].charCodeAt() % 17) + 1
-        k = ((k % 9876543) + 1) * a
-      }
-      let res = k % 100000000
-      // console.log(res, k, id, pas);
-      return new Intl.NumberFormat(undefined, {
-        minimumIntegerDigits: 8,
-        useGrouping: false
-      }).format(res)
-    },
-    test() {
-      console.log('mixins');
-    }
   }
-}
+}

+ 4 - 2
src/pages.json

@@ -26,13 +26,15 @@
     },
     {
       "path": "pages/message/index",
-      "style": {
+      "style": {
+        "disableScroll": true,
         "navigationBarTitleText": "消息"
       }
     },
     {
       "path": "pages/message/msgView",
-      "style": {
+      "style": {
+        "disableScroll": true,
         "navigationBarTitleText": "消息"
       }
     },

+ 2 - 2
src/pages/message/index.vue

@@ -8,8 +8,8 @@
     </view>
     <!-- 聊天内容 -->
     <view class="message_view">
-      <scroll-view class="message_view_scroll" :scroll-y="true" :scroll-top="scrollTop" @scrolltoupper="upper"
-        @scrolltolower="lower" @scroll="scroll">
+      <scroll-view class="message_view_scroll" :scroll-y="true" :scroll-top="scrollTop" :enhanced="true"
+        :bounces="false" :show-scrollbar="false" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll">
         <view class="message_user_aview" v-for="(item,index) in 15" :key="index" @click="goMsgView">
           <view class="message_user_a">
             <view class="message_user_info">

+ 30 - 28
src/pages/message/msgView.vue

@@ -24,35 +24,37 @@
     </view>
     <!-- 聊天内容 -->
     <view class="message_view">
-      <scroll-view class="message_view_scroll" :scroll-y="true" :scroll-top="scrollTop" @scrolltoupper="upper"
-        @scrolltolower="lower" @scroll="scroll">
-        <view v-for="(item,index) in 50" :key="index">
-          <!-- 右消息 -->
-          <view class="msg_view">
-            <!-- 占位 -->
-            <view class="msg_user_img_kong">
-            </view>
-            <view class="msg_view_info msg_view_info_right">
-              <view class="msg_view_conent">
-                12465479198kuhsadbckaehbl12465479198kuhsadbckaehbl12465479198kuhsadbckaehbl12465479198kuhsadbckaehbl
+      <scroll-view class="message_view_scroll" :scroll-y="true" :scroll-top="scrollTop" :enhanced="true"
+        :bounces="false" :show-scrollbar="false" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll">
+        <view style="box-sizing: border-box;padding: 10rpx 0;">
+          <view v-for="(item,index) in 50" :key="index">
+            <!-- 右消息 -->
+            <view class="msg_view">
+              <!-- 占位 -->
+              <view class="msg_user_img_kong">
+              </view>
+              <view class="msg_view_info msg_view_info_right">
+                <view class="msg_view_conent">
+                  12465479198kuhsadbckaehbl12465479198kuhsadbckaehbl12465479198kuhsadbckaehbl12465479198kuhsadbckaehbl
+                </view>
+                <view class="msg_view_time">2023-10-11 12:12:12</view>
+              </view>
+              <!-- 头像 -->
+              <view class="msg_user_img">
               </view>
-              <view class="msg_view_time">2023-10-11 12:12:12</view>
-            </view>
-            <!-- 头像 -->
-            <view class="msg_user_img">
-            </view>
-          </view>
-          <!-- 左消息 -->
-          <view class="msg_view">
-            <!-- 头像 -->
-            <view class="msg_user_img">
-            </view>
-            <view class="msg_view_info msg_view_info_left">
-              <view class="msg_view_conent">12465479198kuhsadbckaehbl</view>
-              <view class="msg_view_time">2023-10-11 12:12:12</view>
             </view>
-            <!-- 占位 -->
-            <view class="msg_user_img_kong">
+            <!-- 左消息 -->
+            <view class="msg_view">
+              <!-- 头像 -->
+              <view class="msg_user_img">
+              </view>
+              <view class="msg_view_info msg_view_info_left">
+                <view class="msg_view_conent">12465479198kuhsadbckaehbl</view>
+                <view class="msg_view_time">2023-10-11 12:12:12</view>
+              </view>
+              <!-- 占位 -->
+              <view class="msg_user_img_kong">
+              </view>
             </view>
           </view>
         </view>
@@ -114,7 +116,7 @@
       },
       scroll(e) {
         this.scrollTop = e.detail.scrollTop
-      }
+      },
     },
     // #endif
     // #ifndef H5