diff --git a/components.d.ts b/components.d.ts
index c2171da..2c66d1c 100644
--- a/components.d.ts
+++ b/components.d.ts
@@ -7,12 +7,14 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
+ Contact: typeof import('./src/components/contact/index.vue')['default']
Counter: typeof import('./src/components/Counter.vue')['default']
Notification: typeof import('./src/components/notification/index.vue')['default']
NutAvatar: typeof import('@nutui/nutui-taro')['Avatar']
NutCollapse: typeof import('@nutui/nutui-taro')['Collapse']
NutCollapseItem: typeof import('@nutui/nutui-taro')['CollapseItem']
NutDivider: typeof import('@nutui/nutui-taro')['Divider']
- NutNavbar: typeof import('@nutui/nutui-taro')['Navbar']
+ NutElevator: typeof import('@nutui/nutui-taro')['Elevator']
+ NutSearchbar: typeof import('@nutui/nutui-taro')['Searchbar']
}
}
diff --git a/package-lock.json b/package-lock.json
index a3e19e3..3ee5659 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -26,6 +26,7 @@
"@tarojs/runtime": "3.6.20",
"@tarojs/shared": "3.6.20",
"@tarojs/taro": "3.6.20",
+ "chinese2pinyin": "^1.0.1",
"graphql": "^16.8.1",
"graphql-tag": "^2.12.6",
"moment": "^2.29.4",
@@ -6820,6 +6821,11 @@
"node": "*"
}
},
+ "node_modules/chinese2pinyin": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/chinese2pinyin/-/chinese2pinyin-1.0.1.tgz",
+ "integrity": "sha512-qBbOtxO09/yjYuF4CnzpNutklSGNJxkb0U7keMuXpXQuk4l8KmNOAUL0aPFfZq6uoc0ZpOe0xoOktgfA2pUm3Q=="
+ },
"node_modules/chokidar": {
"version": "3.5.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
diff --git a/package.json b/package.json
index ec2cbe5..cdb60b3 100644
--- a/package.json
+++ b/package.json
@@ -53,6 +53,7 @@
"@tarojs/runtime": "3.6.20",
"@tarojs/shared": "3.6.20",
"@tarojs/taro": "3.6.20",
+ "chinese2pinyin": "^1.0.1",
"graphql": "^16.8.1",
"graphql-tag": "^2.12.6",
"moment": "^2.29.4",
diff --git a/src/components/contact/index.json b/src/components/contact/index.json
new file mode 100644
index 0000000..467ce29
--- /dev/null
+++ b/src/components/contact/index.json
@@ -0,0 +1,3 @@
+{
+ "component": true
+}
diff --git a/src/components/contact/index.scss b/src/components/contact/index.scss
new file mode 100644
index 0000000..0953b85
--- /dev/null
+++ b/src/components/contact/index.scss
@@ -0,0 +1,18 @@
+.nut-elevator__list__item__name {
+ height: auto;
+}
+.company {
+ height: "20rpx";
+ line-height: normal;
+}
+.name {
+ font-size:1.5em;
+ line-height: normal;
+}
+.vip {
+ line-height: normal;
+ vertical-align: baseline;
+}
+.vip > .badge {
+ line-height: normal;
+}
diff --git a/src/components/contact/index.vue b/src/components/contact/index.vue
new file mode 100644
index 0000000..761e168
--- /dev/null
+++ b/src/components/contact/index.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+ {{StringUtil.getBJXFirstChar(item.name)}}
+
+
+
+
+
+ {{item.name}}
+
+ 无姓名
+
+
+ VIP
+
+
+
+
+ {{item.company}}
+
+ 无公司信息
+
+
+
+
+
+
+
+
+
diff --git a/src/components/notification/index.vue b/src/components/notification/index.vue
index e6e9b1d..542b55b 100644
--- a/src/components/notification/index.vue
+++ b/src/components/notification/index.vue
@@ -1,6 +1,5 @@
@@ -38,14 +27,14 @@ for (const item of bjxJson) {
-
+
{{props.name}}
无姓名
- VIP
+ VIP
diff --git a/src/pages/contact/index.config.ts b/src/pages/contact/index.config.ts
index 7bf9538..614a25e 100644
--- a/src/pages/contact/index.config.ts
+++ b/src/pages/contact/index.config.ts
@@ -1,4 +1,6 @@
export default definePageConfig({
navigationBarTitleText: '',
- "usingComponents": {}
+ usingComponents: {
+ "fa": "../../components/fa"
+ }
})
diff --git a/src/pages/contact/index.vue b/src/pages/contact/index.vue
index c23e2ac..3dba1ab 100644
--- a/src/pages/contact/index.vue
+++ b/src/pages/contact/index.vue
@@ -1,8 +1,59 @@
+
+
- 我是通讯录!
+
+
+ 通讯录
+
+
+
+
+
+
+
+
-
-
diff --git a/src/pages/index/index.config.ts b/src/pages/index/index.config.ts
index d317daa..b436cd5 100644
--- a/src/pages/index/index.config.ts
+++ b/src/pages/index/index.config.ts
@@ -1,6 +1,6 @@
export default {
navigationBarTitleText: '',
- "usingComponents": {
- "fa": "../../components/fa/index"
+ usingComponents: {
+ "fa": "../../components/fa"
}
}
diff --git a/src/pages/invite/index.config.ts b/src/pages/invite/index.config.ts
index 7bf9538..614a25e 100644
--- a/src/pages/invite/index.config.ts
+++ b/src/pages/invite/index.config.ts
@@ -1,4 +1,6 @@
export default definePageConfig({
navigationBarTitleText: '',
- "usingComponents": {}
+ usingComponents: {
+ "fa": "../../components/fa"
+ }
})
diff --git a/src/pages/settings/index.config.ts b/src/pages/settings/index.config.ts
index 7bf9538..614a25e 100644
--- a/src/pages/settings/index.config.ts
+++ b/src/pages/settings/index.config.ts
@@ -1,4 +1,6 @@
export default definePageConfig({
navigationBarTitleText: '',
- "usingComponents": {}
+ usingComponents: {
+ "fa": "../../components/fa"
+ }
})
diff --git a/src/utils/StringUtil.ts b/src/utils/StringUtil.ts
index 55dfb30..15f6048 100644
--- a/src/utils/StringUtil.ts
+++ b/src/utils/StringUtil.ts
@@ -1,4 +1,10 @@
+import bjxJson from './baijiaxing.json'
+
export default class StringUtil {
+ /**
+ * 文字转RGB颜色
+ * @param str
+ */
static mbString2RgbHex = (str) => {
if (str == '') {
return "#CCC"
@@ -17,6 +23,23 @@ export default class StringUtil {
}
str = ar.join('')
- return "#"+ str.substring(0, 7)
+ return "#"+ str.substring(0, 6)
+ }
+
+ /**
+ * 获取百家姓的第一个字
+ * @param name
+ */
+ static getBJXFirstChar(name) {
+ if (name === null || name === "") {
+ return ""
+ }
+ for (const item of bjxJson) {
+ const regex = new RegExp('^'+item.name);
+ if (regex.test(name)) {
+ return item.name
+ }
+ }
+ return name.substring(0, 1)
}
}