Forráskód Böngészése

feat:品牌列表调整:取消pinyin插件、样式调整

zhangxin 2 hónap óta
szülő
commit
e3fee6657d
3 módosított fájl, 13 hozzáadás és 13 törlés
  1. 9 6
      components/brand-list/index.scss
  2. 4 6
      components/brand-list/index.vue
  3. 0 1
      package.json

+ 9 - 6
components/brand-list/index.scss

@@ -1,6 +1,6 @@
1 1
 .brand_list_page {
2 2
     width: 100vw;
3
-    height: 100vh;
3
+    // height: 100vh;
4 4
     display: flex;
5 5
     flex-direction: column;
6 6
     .brand_list {
@@ -41,13 +41,16 @@
41 41
     .index_list{
42 42
         flex: 1;
43 43
         overflow: auto;
44
-        ::v-deep .uni-scroll-view-content{
45
-            padding-bottom: 120rpx;
46
-        }
47
-        ::v-deep .u-index-list{
48
-            height: 100%;
44
+        ::v-deep uni-scroll-view{
45
+            height: calc(100vh - 216rpx);
46
+            .uni-scroll-view-content{
47
+                padding-bottom: 120rpx;
48
+            }
49 49
         }
50 50
     }
51
+    .u-index-list{
52
+        height: 100%;
53
+    }
51 54
     .no_brand{
52 55
         position:fixed;
53 56
         bottom:0;

+ 4 - 6
components/brand-list/index.vue

@@ -40,7 +40,7 @@
40 40
 
41 41
 </template>
42 42
 <script>
43
-    import pinyin from 'pinyin'
43
+import { chineseToPinYin } from '@/utils/pinyin.js'
44 44
 export default {
45 45
     components: {
46 46
     },
@@ -115,11 +115,9 @@ export default {
115 115
                 } else {
116 116
                     // 中文字符,使用拼音首字母
117 117
                     try {
118
-                        const pinyinArray = pinyin(label, {
119
-                            style: pinyin.STYLE_FIRST_LETTER,
120
-                        })
121
-                        if (pinyinArray.length > 0 && /[a-zA-Z]/.test(pinyinArray[0][0].toUpperCase())) {
122
-                            firstLetter = pinyinArray[0][0].toUpperCase()
118
+                        const pinyin = chineseToPinYin(label)
119
+                        if (pinyin && pinyin.length > 0 && /[a-zA-Z]/.test(pinyin.charAt(0).toUpperCase())) {
120
+                            firstLetter = pinyin.charAt(0).toUpperCase()
123 121
                         } else {
124 122
                             firstLetter = '#'
125 123
                         }

+ 0 - 1
package.json

@@ -12,7 +12,6 @@
12 12
 		"jssip": "^3.10.1",
13 13
 		"lodash": "^4.17.21",
14 14
 		"mp-storage": "^1.0.1",
15
-		"pinyin": "^4.0.0",
16 15
 		"qs": "^6.11.0",
17 16
 		"recorder-core": "^1.3.24102001",
18 17
 		"vuex-persistedstate": "^2.5.4"