xyvcard-wechat-auth 0.0.40 → 0.0.42

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.
@@ -9,6 +9,10 @@ Component({
9
9
  type: Object,
10
10
  value: {}
11
11
  },
12
+ defaultAvatar: {
13
+ type: String,
14
+ value: ""
15
+ },
12
16
  token: {
13
17
  type: String,
14
18
  value: ""
@@ -2,6 +2,7 @@
2
2
  <block wx:if="{{ token }}">
3
3
  <view class="auth-user-l">
4
4
  <image src="{{ BASE_URL + userInfo.avatar }}" class="avatar-img" wx:if="{{ userInfo.avatar }}"></image>
5
+ <image src="{{ resourceUrl + '/' + defaultAvatar }}" class="avatar-img" wx:elif="{{ defaultAvatar }}"></image>
5
6
  <image src="{{ resourceUrl }}/tswk.png" class="avatar-img" wx:else></image>
6
7
  <view class="auth-user-r">
7
8
  <view class="user-edit">{{ userInfo.realName }}
@@ -1,4 +1,4 @@
1
- {
2
- "component": true,
3
- "usingComponents": {}
1
+ {
2
+ "component": true,
3
+ "usingComponents": {}
4
4
  }
@@ -1,5 +1,5 @@
1
- <view class="auth-btn-box">
2
- <button class="btn-left" style="background: {{ leftBgColor }}; color: {{ leftColor }}; border-radius: {{ leftRadius }}; border: {{ leftBorder }};" bind:tap="handleLeft">{{ leftText }}</button>
3
- <button class="btn-left" style="background: {{ centerBgColor }}; color: {{ centerColor }}; border-radius: {{ centerRadius }}; border: {{ centerBorder }};" bind:tap="handleCenter">{{ centerText }}</button>
4
- <button class="btn-right" style="background: {{ rightBgColor }}; color: {{ rightColor }}; border-radius: {{ rightRadius }}; border: {{ rightBorder }};" bind:tap="handleRight">{{ rightText }}</button>
5
- </view>
1
+ <view class="auth-btn-box">
2
+ <button class="btn-left" style="background: {{ leftBgColor }}; color: {{ leftColor }}; border-radius: {{ leftRadius }}; border: {{ leftBorder }};" bind:tap="handleLeft">{{ leftText }}</button>
3
+ <button class="btn-left" style="background: {{ centerBgColor }}; color: {{ centerColor }}; border-radius: {{ centerRadius }}; border: {{ centerBorder }};" bind:tap="handleCenter">{{ centerText }}</button>
4
+ <button class="btn-right" style="background: {{ rightBgColor }}; color: {{ rightColor }}; border-radius: {{ rightRadius }}; border: {{ rightBorder }};" bind:tap="handleRight">{{ rightText }}</button>
5
+ </view>
@@ -1,7 +1,7 @@
1
- {
2
- "component": true,
3
- "usingComponents": {
4
- "van-progress": "@vant/weapp/progress/index",
5
- "auth-popup": "../../auth-popup/index"
6
- }
1
+ {
2
+ "component": true,
3
+ "usingComponents": {
4
+ "van-progress": "@vant/weapp/progress/index",
5
+ "auth-popup": "../../auth-popup/index"
6
+ }
7
7
  }
@@ -1,8 +1,8 @@
1
- <button class="file-btn" bindtap="chooseFileModel" style="{{ fileStyle }}">上传附件</button>
2
-
3
- <van-progress wx:if="{{ percentage < 100 }}" percentage="{{ percentage }}" />
4
-
5
- <auth-popup show="{{ closeModel }}" titleShow="{{ false }}">
6
- <view class="item" bind:tap="handleUploadFile">微信</view>
7
- <view class="item" bind:tap="handleAlbumImg">相册</view>
8
- </auth-popup>
1
+ <button class="file-btn" bindtap="chooseFileModel" style="{{ fileStyle }}">上传附件</button>
2
+
3
+ <van-progress wx:if="{{ percentage < 100 }}" percentage="{{ percentage }}" />
4
+
5
+ <auth-popup show="{{ closeModel }}" titleShow="{{ false }}">
6
+ <view class="item" bind:tap="handleUploadFile">微信</view>
7
+ <view class="item" bind:tap="handleAlbumImg">相册</view>
8
+ </auth-popup>
@@ -18,6 +18,21 @@ Component({
18
18
  delIconUrl: {
19
19
  type: String,
20
20
  value: "/icon_image/close_circle2x.png"
21
+ },
22
+ // 图片和视频选择的来源(album 从相册选择 | camera 使用相机拍摄)
23
+ sourceType: {
24
+ type: String,
25
+ value: ""
26
+ },
27
+ // 上传之后的值 Array<FileInfo>
28
+ previewImageUrls: {
29
+ type: Array,
30
+ value: [],
31
+ observer(val) {
32
+ this.setData({
33
+ imageArray: val
34
+ });
35
+ }
21
36
  }
22
37
  },
23
38
  /**
@@ -42,17 +57,23 @@ Component({
42
57
  });
43
58
  return;
44
59
  }
45
- wx.showActionSheet({
46
- itemList: ["从相册中选择", "拍照"],
47
- itemColor: "#486aff",
48
- success: function(res) {
49
- if (res.tapIndex === 0) {
50
- that.chooseWxHeadImage("album");
51
- } else if (res.tapIndex == 1) {
52
- that.chooseWxHeadImage("camera");
60
+ if (that.properties.sourceType === "album") {
61
+ that.chooseWxHeadImage("album");
62
+ } else if (that.properties.sourceType === "camera") {
63
+ that.chooseWxHeadImage("camera");
64
+ } else {
65
+ wx.showActionSheet({
66
+ itemList: ["从相册中选择", "拍照"],
67
+ itemColor: "#486aff",
68
+ success: function(res) {
69
+ if (res.tapIndex === 0) {
70
+ that.chooseWxHeadImage("album");
71
+ } else if (res.tapIndex == 1) {
72
+ that.chooseWxHeadImage("camera");
73
+ }
53
74
  }
54
- }
55
- });
75
+ });
76
+ }
56
77
  },
57
78
  chooseWxHeadImage(type) {
58
79
  const that = this;
@@ -1,4 +1,4 @@
1
- {
2
- "component": true,
3
- "usingComponents": {}
1
+ {
2
+ "component": true,
3
+ "usingComponents": {}
4
4
  }
@@ -1,9 +1,9 @@
1
- <view class="upload-box">
2
- <view class="upload-image" wx:for="{{ imageArray }}" wx:key="index">
3
- <image src="{{ baseUrl + item.fileSrc }}" class="plus-image"></image>
4
- <image src="{{ resourceUrl + delIconUrl }}" class="delete-image" data-index="{{ index }}" bind:tap="handleDel"></image>
5
- </view>
6
- <view class="upload-cover" bind:tap="handleUploadImage">
7
- <image src="{{ resourceUrl + coverUpload }}" class="plus-image"></image>
8
- </view>
1
+ <view class="upload-box">
2
+ <view class="upload-image" wx:for="{{ imageArray }}" wx:key="index">
3
+ <image src="{{ baseUrl + item.fileSrc }}" class="plus-image"></image>
4
+ <image src="{{ resourceUrl + delIconUrl }}" class="delete-image" data-index="{{ index }}" bind:tap="handleDel"></image>
5
+ </view>
6
+ <view class="upload-cover" bind:tap="handleUploadImage">
7
+ <image src="{{ resourceUrl + coverUpload }}" class="plus-image"></image>
8
+ </view>
9
9
  </view>
@@ -64,7 +64,7 @@ Component({
64
64
  // 手机号授权登录
65
65
  wxPhoneLogin(event) {
66
66
  let that = this;
67
- if (!this.data.agreeStatus) {
67
+ if (!this.data.agreeStatus && this.properties.showPrivacyPolicy) {
68
68
  wx.showModal({
69
69
  title: "提示",
70
70
  content: "您是否已阅读《用户使用协议》《隐私权政策》?",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xyvcard-wechat-auth",
3
- "version": "0.0.40",
3
+ "version": "0.0.42",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",