Sfoglia il codice sorgente

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

zhangxin 2 mesi fa
parent
commit
e3fee6657d
3 ha cambiato i file con 13 aggiunte e 13 eliminazioni
  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
 .brand_list_page {
1
 .brand_list_page {
2
     width: 100vw;
2
     width: 100vw;
3
-    height: 100vh;
3
+    // height: 100vh;
4
     display: flex;
4
     display: flex;
5
     flex-direction: column;
5
     flex-direction: column;
6
     .brand_list {
6
     .brand_list {
@@ -41,13 +41,16 @@
41
     .index_list{
41
     .index_list{
42
         flex: 1;
42
         flex: 1;
43
         overflow: auto;
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
     .no_brand{
54
     .no_brand{
52
         position:fixed;
55
         position:fixed;
53
         bottom:0;
56
         bottom:0;

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

@@ -40,7 +40,7 @@
40
 
40
 
41
 </template>
41
 </template>
42
 <script>
42
 <script>
43
-    import pinyin from 'pinyin'
43
+import { chineseToPinYin } from '@/utils/pinyin.js'
44
 export default {
44
 export default {
45
     components: {
45
     components: {
46
     },
46
     },
@@ -115,11 +115,9 @@ export default {
115
                 } else {
115
                 } else {
116
                     // 中文字符,使用拼音首字母
116
                     // 中文字符,使用拼音首字母
117
                     try {
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
                         } else {
121
                         } else {
124
                             firstLetter = '#'
122
                             firstLetter = '#'
125
                         }
123
                         }

+ 0 - 1
package.json

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