xyvcard-wechat-auth 0.0.28 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,8 +11,8 @@ declare class AuthApiImpl {
11
11
  runAsUser(userId: string): Promise<ResponseData<any>>;
12
12
  updateUser(data: any): Promise<ResponseData<any>>;
13
13
  updatePwd(encodeOldPwd: string, encodeNewPwd: string): Promise<ResponseData<any>>;
14
- deptTree(deptId?: string): Promise<ResponseData<any>>;
15
- jobTree(jobId?: string): Promise<ResponseData<any>>;
14
+ deptTree(deptId?: string, tenant?: string): Promise<ResponseData<any>>;
15
+ jobTree(jobId?: string, tenant?: string): Promise<ResponseData<any>>;
16
16
  updateUserInfo(data: UpdateUserReq): Promise<ResponseData<UserInfo>>;
17
17
  replaceBindphone(data: PhoneNumberReq): Promise<ResponseData<boolean>>;
18
18
  findUserInfo(data: UserInfoReq): Promise<ResponseData<UserInfo>>;
@@ -99,9 +99,9 @@ class AuthApiImpl {
99
99
  });
100
100
  }
101
101
  // 部门Tree
102
- deptTree(deptId) {
102
+ deptTree(deptId, tenant) {
103
103
  const query = {
104
- tenant: db.getUserTenant(),
104
+ tenant: tenant ? tenant : config.tenant,
105
105
  excludeId: deptId
106
106
  };
107
107
  return request({
@@ -111,9 +111,9 @@ class AuthApiImpl {
111
111
  });
112
112
  }
113
113
  // 职务Tree
114
- jobTree(jobId) {
114
+ jobTree(jobId, tenant) {
115
115
  const query = {
116
- tenant: db.getUserTenant(),
116
+ tenant: tenant ? tenant : config.tenant,
117
117
  roleType: "job",
118
118
  hasRoleType: true,
119
119
  excludeId: jobId
@@ -1,6 +1,6 @@
1
1
  <view class="auth-search-box" style="{{ searchStyle }}">
2
- <image src="{{ resourceUrl + '/icon_image/icon_search.png' }}" class="search-icon" style="filter: drop-shadow(0 0 0 {{ iconColor }});"></image>
3
- <input class="search-input" style="color: {{ color }}; background-color: {{ backColor }}; width: {{ isSearchBtn ? '60%' : '100%' }}; {{ isSearchBtn ? '' : 'padding-right: 20px' }}" focus="{{ focus }}" placeholder="{{ placeholder }}" disabled="{{ disabled }}" value="{{ likeName }}" bindinput="handleInput" bind:tap="handleTap" />
2
+ <icon type="search" color="{{ iconColor }}" size="18" class="search-icon"></icon>
3
+ <input class="search-input" placeholder-style="color: {{ color }};" style="color: {{ color }}; background-color: {{ backColor }}; width: {{ isSearchBtn ? '60%' : '100%' }}; {{ isSearchBtn ? '' : 'padding-right: 20px' }}" focus="{{ focus }}" placeholder="{{ placeholder }}" disabled="{{ disabled }}" value="{{ likeName }}" bindinput="handleInput" bind:tap="handleTap" />
4
4
  <view class="search-btn" wx:if="{{ isSearchBtn }}">
5
5
  <slot></slot>
6
6
  </view>
@@ -5,6 +5,11 @@ Component({
5
5
  * 组件的属性列表
6
6
  */
7
7
  properties: {
8
+ // 是否开启字体渐变 白-黑
9
+ isGradient: {
10
+ type: Boolean,
11
+ value: false
12
+ },
8
13
  // 标题
9
14
  title: {
10
15
  type: String,
@@ -14,6 +19,11 @@ Component({
14
19
  isLeftIcon: {
15
20
  type: Boolean,
16
21
  value: true
22
+ },
23
+ // 字体的颜色
24
+ titleColor: {
25
+ type: String,
26
+ value: "#333"
17
27
  }
18
28
  },
19
29
  /**
@@ -33,7 +43,7 @@ Component({
33
43
  pageScrollTop: 0,
34
44
  // 胶囊球的宽度
35
45
  buttonWidth: getHeight().MenuButtonWidth,
36
- // 背景色
46
+ // 背景透明色
37
47
  color: ""
38
48
  }
39
49
  },
@@ -44,6 +54,47 @@ Component({
44
54
  // 返回
45
55
  handleBack() {
46
56
  this.triggerEvent("eventBackTo");
57
+ },
58
+ // 计算导航栏透明度(供父组件调用)
59
+ calculateOpacity(scrollTop) {
60
+ let defaultTitleColorwhite = "#fff";
61
+ let defaultTitleColorBlack = "#333";
62
+ let color, titleColor;
63
+ if (scrollTop == 0) {
64
+ color = "rgba(255, 255, 255, 0)";
65
+ titleColor = this.properties.isGradient ? defaultTitleColorwhite : defaultTitleColorBlack;
66
+ } else if (scrollTop > 0 && scrollTop <= 10) {
67
+ color = "rgba(255, 255, 255, 0.1)";
68
+ titleColor = this.properties.isGradient ? defaultTitleColorwhite : defaultTitleColorBlack;
69
+ } else if (scrollTop >= 10 && scrollTop < 20) {
70
+ color = "rgba(255, 255, 255, 0.2)";
71
+ titleColor = this.properties.isGradient ? defaultTitleColorwhite : defaultTitleColorBlack;
72
+ } else if (scrollTop >= 20 && scrollTop < 30) {
73
+ color = "rgba(255, 255, 255, 0.3)";
74
+ titleColor = this.properties.isGradient ? defaultTitleColorwhite : defaultTitleColorBlack;
75
+ } else if (scrollTop >= 30 && scrollTop < 40) {
76
+ color = "rgba(255, 255, 255, 0.4)";
77
+ titleColor = this.properties.isGradient ? defaultTitleColorwhite : defaultTitleColorBlack;
78
+ } else if (scrollTop >= 40 && scrollTop < 50) {
79
+ color = "rgba(255, 255, 255, 0.5)";
80
+ titleColor = this.properties.isGradient ? defaultTitleColorwhite : defaultTitleColorBlack;
81
+ } else if (scrollTop >= 50 && scrollTop < 60) {
82
+ color = "rgba(255, 255, 255, 0.6)";
83
+ titleColor = this.properties.isGradient ? defaultTitleColorwhite : defaultTitleColorBlack;
84
+ } else if (scrollTop >= 60 && scrollTop < 70) {
85
+ color = "rgba(255, 255, 255, 0.7)";
86
+ titleColor = this.properties.isGradient ? defaultTitleColorwhite : defaultTitleColorBlack;
87
+ } else if (scrollTop >= 70 && scrollTop < 80) {
88
+ color = "rgba(255, 255, 255, 0.8)";
89
+ titleColor = this.properties.isGradient ? defaultTitleColorwhite : defaultTitleColorBlack;
90
+ } else {
91
+ color = "rgba(255, 255, 255, 1)";
92
+ titleColor = defaultTitleColorBlack;
93
+ }
94
+ this.setData({
95
+ "style.color": color,
96
+ titleColor
97
+ });
47
98
  }
48
99
  }
49
100
  });
@@ -1,4 +1,6 @@
1
1
  {
2
2
  "component": true,
3
- "usingComponents": {}
3
+ "usingComponents": {
4
+ "van-icon": "@vant/weapp/icon/index"
5
+ }
4
6
  }
@@ -1,6 +1,6 @@
1
- <view style="background-color: {{ style.color }};">
2
- <view class="auth-top-navigation" style="padding-top: {{ style.paddingTop }}px; height: {{ style.height }}px;">
3
- <image src="{{ resourceUrl + '/member/arrow-left.png' }}" class="back-icon" wx:if="{{ isLeftIcon }}" bind:tap="handleBack"></image>
1
+ <view class="auth-top" style="background-color: {{ style.color }};">
2
+ <view class="auth-top-navigation" style="padding-top: {{ style.paddingTop }}px; height: {{ style.height }}px;color: {{ titleColor }}">
3
+ <van-icon name="arrow-left" size="22px" wx:if="{{ isLeftIcon }}" color="{{ titleColor }}" bind:tap="handleBack" />
4
4
  <text class="title">{{ title }}</text>
5
5
  </view>
6
6
  </view>
@@ -1 +1 @@
1
- .auth-top-navigation{display:flex;align-items:center;padding:0 10px}.auth-top-navigation .back-icon{width:13px;height:21px}.auth-top-navigation .title{flex:1;text-align:center;font-size:28rpx}
1
+ .auth-top{position:fixed;left:0;top:0;right:0;z-index:99999;transition:opacity .2s ease}.auth-top-navigation{display:flex;align-items:center;padding:0 10px}.auth-top-navigation .title{flex:1;text-align:center;font-size:28rpx}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xyvcard-wechat-auth",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",