xyvcard-wechat-auth 0.0.13 → 0.0.14

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.
@@ -45,8 +45,8 @@ export interface RefreshTokenReq {
45
45
  }
46
46
  export interface UpdateUserReq {
47
47
  tenant?: string;
48
- requestId: string;
49
- updateMask: string;
48
+ requestId?: string;
49
+ updateMask?: string;
50
50
  nickName?: string;
51
51
  avatar?: string;
52
52
  realName?: string;
@@ -7,26 +7,35 @@ Component({
7
7
  * 组件的属性列表
8
8
  */
9
9
  properties: {
10
- // 定义一个对象类型的属性
10
+ // 是否显示用户头像
11
11
  isUserAvatar: {
12
12
  type: Boolean,
13
13
  value: true
14
14
  },
15
+ // 是否显示昵称
15
16
  isUserNickName: {
16
17
  type: Boolean,
17
18
  value: true
18
19
  },
20
+ // 是否显示姓名
19
21
  isUserRealName: {
20
22
  type: Boolean,
21
23
  value: true
22
24
  },
25
+ // 是否显示手机号
23
26
  isUserMobilePhone: {
24
27
  type: Boolean,
25
28
  value: true
26
29
  },
30
+ // 用户数据
27
31
  form: {
28
32
  type: Object,
29
33
  value: {}
34
+ },
35
+ // 是否显示更换手机号
36
+ isChangePhone: {
37
+ type: Boolean,
38
+ value: true
30
39
  }
31
40
  },
32
41
  /**
@@ -39,9 +48,17 @@ Component({
39
48
  },
40
49
  lifetimes: {
41
50
  ready() {
51
+ if (this.data.form) {
52
+ this.setData({
53
+ userInfo: {
54
+ ...this.properties.form
55
+ }
56
+ });
57
+ } else {
58
+ this.getUserInfo();
59
+ }
42
60
  this.setData({
43
61
  userInfo: {
44
- ...this.properties.form,
45
62
  requestId: Math.random() * 10 + "",
46
63
  updateMask: "nickName,avatar,realName"
47
64
  }
@@ -52,6 +69,14 @@ Component({
52
69
  * 组件的方法列表
53
70
  */
54
71
  methods: {
72
+ // 获取用户信息
73
+ getUserInfo() {
74
+ authApi.userInfo().then((resp) => {
75
+ this.setData({
76
+ userInfo: resp.data
77
+ });
78
+ });
79
+ },
55
80
  // 获取微信昵称
56
81
  getNicknameValue(e) {
57
82
  this.setData({
@@ -102,6 +127,9 @@ Component({
102
127
  authApi.updateUserInfo(this.data.userInfo).then((res) => {
103
128
  if (res.code == 200) {
104
129
  db.userInfoStorage(res.data);
130
+ wx.navigateBack({
131
+ delta: 1
132
+ });
105
133
  }
106
134
  });
107
135
  }
@@ -27,7 +27,7 @@
27
27
  <view class="phone-left">手机号</view>
28
28
  <view class="phone-right">
29
29
  <view>{{ userInfo.mobilePhone }}</view>
30
- <button open-type="getPhoneNumber" class="phone-right-btn" bindgetphonenumber="getPhoneNumber" plain="true">更换手机号</button>
30
+ <button open-type="getPhoneNumber" class="phone-right-btn" bindgetphonenumber="getPhoneNumber" plain="true" wx:if="{{ isChangePhone }}">更换手机号</button>
31
31
  </view>
32
32
  </view>
33
33
  </view>
@@ -1 +1 @@
1
- .my-information{background-color:#f6f6f6;width:100%;height:100vh;position:relative}.my-information .main{background-color:#fff;padding:0 15px}.my-information .main .main-profile,.my-information .main .main-nickname,.my-information .main .main-phone{display:flex;justify-content:space-between;align-items:center;height:55px;border-bottom:1px solid #f5f5f5}.my-information .main .main-profile .profile-left,.my-information .main .main-profile .nickname-left,.my-information .main .main-profile .nickname-right,.my-information .main .main-profile .phone-left,.my-information .main .main-nickname .profile-left,.my-information .main .main-nickname .nickname-left,.my-information .main .main-nickname .nickname-right,.my-information .main .main-nickname .phone-left,.my-information .main .main-phone .profile-left,.my-information .main .main-phone .nickname-left,.my-information .main .main-phone .nickname-right,.my-information .main .main-phone .phone-left{font-size:15px;color:#333}.my-information .main .main-profile .profile-right .profile-image,.my-information .main .main-nickname .profile-right .profile-image,.my-information .main .main-phone .profile-right .profile-image{width:35px;height:35px}.my-information .main .main-profile .phone-right,.my-information .main .main-nickname .phone-right,.my-information .main .main-phone .phone-right{display:flex;justify-content:space-between;align-items:center;font-size:15px;color:#333}.my-information .main .main-profile .phone-right .phone-right-btn,.my-information .main .main-nickname .phone-right .phone-right-btn,.my-information .main .main-phone .phone-right .phone-right-btn{background-color:#e6edff;border-radius:12px;margin-left:10px;border:none;font-size:12px;color:#0551ff}.my-information .main .image-box-bgc{background-color:rgba(0,0,0,0);border-radius:0;line-height:0;border:0;padding:0}.my-information .main .nickname-input{text-align:right}.my-information .main .main-phone{border:none}
1
+ .my-information{background-color:#f6f6f6;width:100%;position:relative}.my-information .main{background-color:#fff;padding:0 15px}.my-information .main .main-profile,.my-information .main .main-nickname,.my-information .main .main-phone{display:flex;justify-content:space-between;align-items:center;height:55px;border-bottom:1px solid #f5f5f5}.my-information .main .main-profile .profile-left,.my-information .main .main-profile .nickname-left,.my-information .main .main-profile .nickname-right,.my-information .main .main-profile .phone-left,.my-information .main .main-nickname .profile-left,.my-information .main .main-nickname .nickname-left,.my-information .main .main-nickname .nickname-right,.my-information .main .main-nickname .phone-left,.my-information .main .main-phone .profile-left,.my-information .main .main-phone .nickname-left,.my-information .main .main-phone .nickname-right,.my-information .main .main-phone .phone-left{font-size:14px;color:#333}.my-information .main .main-profile .profile-right .profile-image,.my-information .main .main-nickname .profile-right .profile-image,.my-information .main .main-phone .profile-right .profile-image{width:35px;height:35px}.my-information .main .main-profile .phone-right,.my-information .main .main-nickname .phone-right,.my-information .main .main-phone .phone-right{display:flex;justify-content:space-between;align-items:center;font-size:15px;color:#333}.my-information .main .main-profile .phone-right .phone-right-btn,.my-information .main .main-nickname .phone-right .phone-right-btn,.my-information .main .main-phone .phone-right .phone-right-btn{background-color:#e6edff;border-radius:12px;margin-left:10px;border:none;font-size:12px;color:#0551ff}.my-information .main .image-box-bgc{background-color:rgba(0,0,0,0);border-radius:0;line-height:0;border:0;padding:0}.my-information .main .nickname-input{text-align:right}.my-information .main .main-phone{border:none}
@@ -1 +1 @@
1
- .index_bj{width:100%}.login_container{position:relative;margin-top:-35%;display:flex;flex-direction:column;align-items:center}.login_logo{width:250px}.login_box{border-top-left-radius:20px;border-top-right-radius:20px;background-color:#fff;padding:13% 3% 4%;margin-top:40px;display:flex;flex-direction:column;align-items:center}.login_box .login_btn{background-color:#2563eb;color:#fff;padding:16px 0;width:100%;font-size:14px}.login_box .protocol_agree{color:#999;font-size:14px;margin-top:20px}.login_box .protocol_agree text{color:#2563eb}.login_box .tips_box{color:#2563eb;font-size:12px;margin-top:40%}
1
+ .login_container{position:relative;margin-top:-35%;display:flex;flex-direction:column;align-items:center}.login_logo{width:250px}.login_box{border-top-left-radius:20px;border-top-right-radius:20px;background-color:#fff;padding:13% 3% 4%;margin-top:40px;display:flex;flex-direction:column;align-items:center}.login_box .login_btn{background-color:#2563eb;color:#fff;padding:16px 0;width:100%;font-size:14px}.login_box .protocol_agree{color:#999;font-size:14px;margin-top:20px}.login_box .protocol_agree text{color:#2563eb}.login_box .tips_box{color:#2563eb;font-size:12px;margin-top:40%}
@@ -3,7 +3,7 @@ const host = "gh.sooyie.cn";
3
3
  const agentUrl = "/v1/file/path/wxapp";
4
4
  const config = {
5
5
  dev: true,
6
- testNewUser: false,
6
+ testNewUser: true,
7
7
  name: "Jmash框架",
8
8
  baseUrl: https + host,
9
9
  // 接口域名
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xyvcard-wechat-auth",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",