jufubao-base 1.0.25 → 1.0.26

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -278,6 +278,13 @@
278
278
  reGetCode(){
279
279
  if(this.time > 0) return;
280
280
  const { phone_number } = this.accountForm;
281
+ if(!/^1[3-9]\d{9}$/.test(phone_number)){
282
+ uni.showToast({
283
+ title: "请填写正确的手机号",
284
+ icon: 'none'
285
+ });
286
+ return false;
287
+ }
281
288
 
282
289
  console.log("jfbRootExec: sendMsg");
283
290
  jfbRootExec('sendMsg', {
@@ -342,6 +349,17 @@
342
349
  doLoginForm(){
343
350
  const { accountLoginType } = this;
344
351
  const { phone_number, verification_code, password } = this.accountForm;
352
+ let err_tip = "";
353
+ if(!phone_number) err_tip = "手机号不能为空";
354
+ else if(accountLoginType == "phone" && !verification_code) err_tip = "验证码不能为空";
355
+ else if(accountLoginType == "pwd" && !password) err_tip = "密码不能为空";
356
+ if(err_tip){
357
+ return uni.showToast({
358
+ title: err_tip,
359
+ icon: 'none'
360
+ })
361
+ }
362
+
345
363
  if(accountLoginType == "phone"){
346
364
  //表单接口登录
347
365
  jfbRootExec('phoneLogin', {
@@ -136,6 +136,13 @@
136
136
  reGetCode(){
137
137
  if(this.time > 0) return;
138
138
  const { phone_number } = this.resetForm;
139
+ if(!/^1[3-9]\d{9}$/.test(phone_number)){
140
+ uni.showToast({
141
+ title: "请填写正确的手机号",
142
+ icon: 'none'
143
+ });
144
+ return false;
145
+ }
139
146
 
140
147
  jfbRootExec('sendMsg', {
141
148
  vm: this,
@@ -154,6 +161,13 @@
154
161
  })
155
162
  },
156
163
  toResetPassword(){
164
+ const { verification_code, phone_number } = this.resetForm;
165
+ if(!verification_code || !phone_number){
166
+ return uni.showToast({
167
+ title: "填写手机号跟验证码",
168
+ icon: 'none'
169
+ })
170
+ }
157
171
  jfbRootExec("verifyPhoneCode", {
158
172
  vm: this,
159
173
  data: this.resetForm
@@ -175,9 +189,9 @@
175
189
  // onJfbHide(options) {
176
190
  // console.log('event.onJfbHide', options)
177
191
  // },
178
- // onJfbBack(options) {
179
- // console.log('event.onJfbBack', options)
180
- // },
192
+ onJfbBack(options) {
193
+ this.$xdUniHelper.navigateBack();
194
+ },
181
195
  }
182
196
  }
183
197
 
@@ -130,6 +130,10 @@
130
130
  this.pwd_type = getContainerPropsValue(value, 'content.pwd_type');
131
131
  },
132
132
  doSetPassword(){
133
+ const { password, confirm_password } = this.resetForm;
134
+ if(!password || !confirm_password) return uni.showToast({title: "请输入密码",icon: 'none'});
135
+ if(password !== confirm_password) return uni.showToast({title: "密码不一致",icon: 'none'});
136
+
133
137
  let typeFn = "resetPwd"
134
138
  if(this.pwd_type == 1) typeFn = "setPwd"
135
139
  jfbRootExec(typeFn, {
@@ -141,20 +145,20 @@
141
145
  })
142
146
  })
143
147
  },
144
- onJfbScroll(options) {
145
- console.log('event.onJfbScroll', options)
146
- },
147
- onJfbReachBottom(options) {
148
- console.log('event.onJfbReachBottom', options)
149
- },
150
- onJfbShow(options) {
151
- console.log('event.onJfbShow', options)
152
- },
153
- onJfbHide(options) {
154
- console.log('event.onJfbHide', options)
155
- },
148
+ // onJfbScroll(options) {
149
+ // console.log('event.onJfbScroll', options)
150
+ // },
151
+ // onJfbReachBottom(options) {
152
+ // console.log('event.onJfbReachBottom', options)
153
+ // },
154
+ // onJfbShow(options) {
155
+ // console.log('event.onJfbShow', options)
156
+ // },
157
+ // onJfbHide(options) {
158
+ // console.log('event.onJfbHide', options)
159
+ // },
156
160
  onJfbBack(options) {
157
- console.log('event.onJfbBack', options)
161
+ this.$xdUniHelper.navigateBack();
158
162
  },
159
163
  }
160
164
  }
@@ -145,6 +145,13 @@
145
145
  reGetCode(){
146
146
  if(this.time > 0) return;
147
147
  const { phone_number } = this.accountForm;
148
+ if(!/^1[3-9]\d{9}$/.test(phone_number)){
149
+ uni.showToast({
150
+ title: "请填写正确的手机号",
151
+ icon: 'none'
152
+ });
153
+ return false;
154
+ }
148
155
 
149
156
  console.log("jfbRootExec: sendMsg");
150
157
  jfbRootExec('sendMsg', {
@@ -166,6 +173,8 @@
166
173
  doLoginForm(){
167
174
  const { provider_id } = this;
168
175
  const { phone_number, verification_code } = this.accountForm;
176
+ if(!phone_number || !verification_code) return uni.showToast({title: "手机号跟验证码不能为空",icon: 'none'});
177
+
169
178
  jfbRootExec('phoneCollect', {
170
179
  vm: this,
171
180
  data: {
@@ -193,9 +202,9 @@
193
202
  // onJfbHide(options) {
194
203
  // console.log('event.onJfbHide', options)
195
204
  // },
196
- // onJfbBack(options) {
197
- // console.log('event.onJfbBack', options)
198
- // },
205
+ onJfbBack(options) {
206
+ this.$xdUniHelper.navigateBack();
207
+ },
199
208
  }
200
209
  }
201
210
 
@@ -148,6 +148,13 @@
148
148
  reGetCode(){
149
149
  if(this.time > 0) return;
150
150
  const { phone_number } = this.accountForm;
151
+ if(!/^1[3-9]\d{9}$/.test(phone_number)){
152
+ uni.showToast({
153
+ title: "请填写正确的手机号",
154
+ icon: 'none'
155
+ });
156
+ return false;
157
+ }
151
158
 
152
159
  console.log("jfbRootExec: sendMsg");
153
160
  jfbRootExec('sendMsg', {
@@ -169,6 +176,7 @@
169
176
  doLoginForm(){
170
177
  const { auth_code, provider_id } = this;
171
178
  const { phone_number, verification_code } = this.accountForm;
179
+ if(!phone_number || !verification_code) return uni.showToast({title: "手机号跟验证码不能为空",icon: 'none'});
172
180
  jfbRootExec('phoneLogin', {
173
181
  vm: this,
174
182
  data: {
@@ -197,9 +205,9 @@
197
205
  // onJfbHide(options) {
198
206
  // console.log('event.onJfbHide', options)
199
207
  // },
200
- // onJfbBack(options) {
201
- // console.log('event.onJfbBack', options)
202
- // },
208
+ onJfbBack(options) {
209
+ this.$xdUniHelper.navigateBack();
210
+ },
203
211
  }
204
212
  }
205
213
 
@@ -14,19 +14,32 @@
14
14
  </view>
15
15
  <!-- #endif -->
16
16
  <view class="jfb-base-test-api__body">
17
- <view>JfbBaseTestApi</view>
17
+ <view>
18
+ <xd-button @click="getUserStatus" type="primary">获取用户登陆状态</xd-button>
19
+ </view>
20
+ <view>
21
+ <xd-button @click="getCardStatus" type="primary">获取用户登陆卡状态</xd-button>
22
+ </view>
23
+ <view>
24
+ <xd-button @click="handleGetByIdCardDetail('101001000005193')" type="primary">获取登陆('101001000005193')</xd-button>
25
+ </view>
18
26
  </view>
19
27
  </view>
20
28
  </template>
21
29
 
22
30
  <script>
23
31
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
24
- import { jfbRootExec } from "@/utils/xd.event";
32
+ import XdButton from "@/components/XdButton/XdButton";
33
+ import {
34
+ jfbRootExec,
35
+ jfbRootFnExec
36
+ } from "@/utils/xd.event";
25
37
  import JfbBaseTestApiMixin from "./JfbBaseTestApiMixin";
26
38
  export default {
27
39
  name: "JfbBaseTestApi",
28
40
  components: {
29
- XdFontIcon
41
+ XdFontIcon,
42
+ XdButton
30
43
  },
31
44
  mixins: [
32
45
  JfbBaseTestApiMixin
@@ -39,23 +52,54 @@
39
52
  },
40
53
  created() {
41
54
 
42
- //todo
55
+ console.log('created.api', this.pageAttr.permission['can_card'])
43
56
  },
44
57
  methods: {
45
58
  onJfbLoad(options) {
46
- console.log('222')
47
- jfbRootExec('getListBindCard', {
59
+
60
+
61
+ },
62
+ getUserStatus(){
63
+ jfbRootFnExec(this, 'checkLoginAndCardLogin')(
64
+ true,
65
+ 'login',
66
+ false,//是否自动跳转到用户登陆页
67
+ )
68
+ .then(status=>{
69
+ console.log(status)
70
+ })
71
+ .catch(error=>{
72
+ console.log(error)
73
+ });
74
+ },
75
+ getCardStatus() {
76
+ jfbRootFnExec(this, 'checkLoginAndCardLogin')(
77
+ true || this.pageAttr.permission['can_card'], //是否免登陆
78
+ 'card', //检查卡类型
79
+ false,//是否自动跳转到卡登陆页
80
+ )
81
+ .then(status => {
82
+ this.$xdHideLoading();
83
+ console.log(status)
84
+ })
85
+ .catch(error => {
86
+ console.log(error)
87
+ });
88
+ },
89
+ handleGetByIdCardDetail(number){
90
+ jfbRootExec('getByIdCardDetail', {
48
91
  vm: this,
49
92
  data: {
50
- ...options
51
- },
93
+ card_number: number,
94
+ }
52
95
  })
53
- .then(res=>{
96
+ .then(res => {
54
97
  console.log(res)
55
98
  })
56
- .catch()
57
- },
58
-
99
+ .catch(err => {
100
+ console.error(err)
101
+ })
102
+ }
59
103
  }
60
104
  }
61
105
 
@@ -67,7 +111,7 @@
67
111
  .jfb-base-test-api {
68
112
  &__body{
69
113
  & > view {
70
- height: unit(250, rpx);
114
+ margin: unit(20, rpx);
71
115
  }
72
116
  }
73
117
  }