jufubao-base 1.0.18 → 1.0.19

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.18",
3
+ "version": "1.0.19",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -47,7 +47,7 @@
47
47
  "core-js": "^2.6.5",
48
48
  "flyio": "^0.6.2",
49
49
  "gxd-commands-bussiness": "^1.0.6",
50
- "gxd-uni-library": "1.0.40",
50
+ "gxd-uni-library": "1.1.3",
51
51
  "jweixin-module": "^1.6.0",
52
52
  "md5": "^2.3.0",
53
53
  "path-to-regexp": "^6.2.1",
@@ -41,7 +41,7 @@
41
41
  *目前仅支持电影票兑换券进行转换
42
42
  </view>
43
43
  <view class="jfb-base-card__body-card">
44
- <view v-for="(item,index) in cardList" :key="index" @click="handleBindLogin(item)"
44
+ <view v-for="(item,index) in showList" :key="index" @click="handleBindLogin(item)"
45
45
  class="jfb-base-card__body-card-item">
46
46
  <view class="jfb-base-card__body-card-item-left">
47
47
  <xd-font-icon size="55" icon="iconyouhuiquan"></xd-font-icon>
@@ -49,14 +49,10 @@
49
49
  </view>
50
50
  <view class="jfb-base-card__body-card-item-right">
51
51
  <view class="jfb-base-card__body-card-item-right-top">
52
- <view v-if="1">
52
+ <view>
53
53
  <xd-font-icon icon="iconkaquan" size="30" style="margin-right: 10rpx"></xd-font-icon>
54
54
  <view>{{item.card_type_name}}</view>
55
55
  </view>
56
- <view v-else>
57
- <view style="font-size: 48rpx">{{item.card_point}}</view>
58
- <view style="font-size: 18rpx;position: relative;top: 30rpx;margin-left: 5rpx">{{item.unit}}</view>
59
- </view>
60
56
  <view>
61
57
  <view>ID:{{item.card_number}}</view>
62
58
  <view>有效期至:{{item.end_time}}</view>
@@ -64,7 +60,7 @@
64
60
  </view>
65
61
  <view class="jfb-base-card__body-card-item-right-bottom">
66
62
  <view class="jfb-base-card__body-card-item-right-bottom-info">
67
- <view v-if="1" class="jfb-base-card__body-card-item-right-bottom-info-residue">
63
+ <view class="jfb-base-card__body-card-item-right-bottom-info-residue">
68
64
  剩余点数:{{item.card_point}}
69
65
  </view>
70
66
  <view class="jfb-base-card__body-card-item-right-bottom-info-deduction">
@@ -87,14 +83,10 @@
87
83
  </view>
88
84
  <view class="jfb-base-card__body-card-item-right">
89
85
  <view class="jfb-base-card__body-card-item-right-top">
90
- <view v-if="item.unit==='点'">
86
+ <view>
91
87
  <xd-font-icon color="#B8B7BE" icon="iconkaquan" size="30" style="margin-right: 10rpx"></xd-font-icon>
92
88
  <view>{{item.card_type_name}}</view>
93
89
  </view>
94
- <view v-else>
95
- <view style="font-size: 48rpx">{{item.card_point}}</view>
96
- <view style="font-size: 18rpx;position: relative;top: 30rpx;margin-left: 5rpx">{{item.unit}}</view>
97
- </view>
98
90
  <view>
99
91
  <view>ID:{{item.card_number}}</view>
100
92
  <view>有效期至:{{item.end_time}}</view>
@@ -102,7 +94,7 @@
102
94
  </view>
103
95
  <view class="jfb-base-card__body-card-item-right-bottom">
104
96
  <view class="jfb-base-card__body-card-item-right-bottom-info">
105
- <view v-if="item.unit==='点'" class="jfb-base-card__body-card-item-right-bottom-info-residue">
97
+ <view class="jfb-base-card__body-card-item-right-bottom-info-residue">
106
98
  剩余点数:{{item.card_point}}
107
99
  </view>
108
100
  <view class="jfb-base-card__body-card-item-right-bottom-info-deduction">
@@ -139,21 +131,30 @@
139
131
  jwxSDK: state => state.jwxSDK
140
132
  })
141
133
  },
134
+ watch: {
135
+ tabIndex(newVal, oldVal) {
136
+ if (newVal === 1) {
137
+ this.showList = this.cardList
138
+ } else {
139
+ this.showList = this.changeList
140
+ }
141
+ }
142
+ },
142
143
  data() {
143
144
  return {
144
145
  cutIndex: 1,
145
146
  tabIndex: 1,
146
147
  isBack: null, //是否使用返回键
147
148
  cardList: [],
148
- disableList: [],
149
+ showList: [],
150
+ changeList: [], disableList: [],
149
151
  inCallback: null, //内部跳转地址
150
-
151
- //todo
152
152
  }
153
153
  },
154
154
  created() {
155
-
156
- //todo
155
+ let {inCallback} = this.$route.query;
156
+ if (inCallback) inCallback = decodeURIComponent(inCallback);
157
+ this.inCallback = inCallback || this.settings.index;
157
158
  },
158
159
  methods: {
159
160
  handleToLink(path) {
@@ -183,19 +184,7 @@
183
184
  */
184
185
  handleBindLogin(item) {
185
186
  if (this.tabIndex === 1) {
186
- if (this.isBack === 1) {
187
- this.$xdUniHelper.navigateBack();
188
- return;
189
- }
190
-
191
- console.log('$storage.get', this.$storage.get('xd_callback'), this.callback, this.inCallback)
192
- //已经设置了xd_callback,但是callback没有被初始化
193
- if (this.$storage.get('xd_callback') && !this.callback) {
194
- this.$xdLog.push({
195
- '$storage.get': this.$storage.get('xd_callback'),
196
- callbackInit: false
197
- }, 'alert', 'info')
198
- }
187
+ console.log('bindCardLogin', this.inCallback)
199
188
 
200
189
  //无效卡
201
190
  if (item['is_valid'] !== 'Y') {
@@ -208,14 +197,9 @@
208
197
  data: {card_number: item['card_number']}
209
198
  }).then(res => {
210
199
  this.$xdHideLoading();
211
- console.log('bindCardLogin', this.callback, this.inCallback, this.$storage.get('xd_callback'))
212
- if (!this.callback && !this.inCallback && !this.$storage.get('xd_callback')) {
213
- this.$xdUniHelper.navigateTo({
214
- url: `/pages/chose/chose`
215
- });
216
- return
217
- }
218
- console.log('bindCardLogin', this.callback, this.inCallback, this.$storage.get('xd_callback'))
200
+ this.$xdUniHelper.redirectTo({
201
+ url: this.inCallback
202
+ });
219
203
  })
220
204
  .catch(res => {
221
205
  this.$xdHideLoading();
@@ -234,30 +218,30 @@
234
218
  },
235
219
  onJfbLoad(options) {
236
220
  console.log(this.jwxSDK, '000000')
237
- this.$nextTick(() => {
238
- let {inCallback, isBack} = this.$xdUniHelper.parseURL()['params'];
239
- if (inCallback) this.inCallback = decodeURIComponent(inCallback);
240
- if (isBack) this.isBack = Number(isBack);
241
- });
242
-
243
221
  jfbRootExec('getListCardBind', {
244
-
245
222
  vm: this,
246
223
  data: {}
247
-
248
224
  }).then((res) => {
249
- this.cardList = res.filter((item) => {
225
+ this.cardList = res.list.filter((item) => {
250
226
  if (item['is_valide'] !== 'N' && item['card_point'] !== 0) {
251
227
  return true
252
228
  }
253
229
  return false
254
230
  });
255
- this.disableList = res.filter((item) => {
231
+ this.disableList = res.list.filter((item) => {
256
232
  if (item['is_valide'] === 'N' || item['card_point'] === 0) {
257
233
  return true
258
234
  }
259
235
  return false
260
236
  });
237
+ this.changeList = this.cardList.filter(item => {
238
+ if (item['is_exchange'] === 'Y') {
239
+ return true
240
+ }
241
+ return false
242
+ })
243
+
244
+ this.showList = this.cardList
261
245
  }).catch()
262
246
  },
263
247
  onJfbScroll(options) {
@@ -94,6 +94,7 @@
94
94
  },
95
95
  onJfbBack(options) {
96
96
  console.log('event.onJfbBack', options)
97
+ this.$xdUniHelper.navigateBack()
97
98
  },
98
99
  }
99
100
  }
@@ -124,7 +124,7 @@
124
124
  show: false,
125
125
  textList: [],
126
126
  password: '',
127
- card_number: '101001000005479',
127
+ card_number: '',
128
128
 
129
129
  userInfo: null, //用户信息
130
130
  brandInfo: null, //brand
@@ -146,9 +146,11 @@
146
146
  this.brandInfo = getApp().globalData.$xd['brandInfo']
147
147
  // this.download = getBusinessImageUrl('base_download.png')
148
148
  // this.qrcode = getBusinessImageUrl('base_qr.png')
149
- this.init();
150
149
  // this.editPhone = this.userInfo.mobile
151
- // let {card_number} = this.$xdUniHelper.parseURL()['params'];
150
+ let card_number = options.card_number;
151
+ this.card_number = card_number
152
+ this.init();
153
+ console.log(this.card_number,'options')
152
154
  // if (card_number) {
153
155
  // this.card_number = card_number;
154
156
  // if (this.brandInfo['is_enable_pay_password'] === 'N') {
@@ -220,6 +222,7 @@
220
222
  },
221
223
  onJfbBack(options) {
222
224
  console.log('event.onJfbBack', options)
225
+ this.$xdUniHelper.navigateBack()
223
226
  },
224
227
  setInval(time) {
225
228
  if (time === 0) {
@@ -42,6 +42,7 @@
42
42
  <script>
43
43
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
44
44
  import {jfbRootExec} from "@/utils/xd.event";
45
+ import {Base64} from 'js-base64'
45
46
  import JfbBaseCardInfoMixin from "./JfbBaseCardInfoMixin";
46
47
  import XdButton from "@/components/XdButton/XdButton";
47
48
 
@@ -100,15 +101,17 @@
100
101
  {
101
102
  vm: this,
102
103
  data: {
103
- card_password: "59009501",
104
- card_number: "101001000005478"
104
+ card_password: this.card_password,
105
+ card_number: this.card_number
105
106
  }
106
107
 
107
108
  }).then((res) => {
108
109
  this.$xdAlert({
109
110
  content: '绑定成功',
110
111
  close: () => {
111
- this.$xdUniHelper.navigateBack()
112
+ this.$xdUniHelper.redirectTo({
113
+ url: '/pages/card/card'
114
+ })
112
115
  }
113
116
  })
114
117
  }).catch()
@@ -117,41 +120,43 @@
117
120
  {
118
121
  vm: this,
119
122
  data: {
120
- card_qrcode: "http://sandbox-c.jufubao.cn/web/wx/card/scan/bind?pa=101001000005479|8178cff8-fe34-11ea-b580-00163e047a75"
123
+ card_qrcode: this.qrcode
121
124
  }
122
125
  }).then((res) => {
123
126
  this.$xdAlert({
124
127
  content: '绑定成功',
125
128
  close: () => {
126
- this.$xdUniHelper.navigateBack()
129
+ this.$xdUniHelper.redirectTo({
130
+ url: '/pages/card/card'
131
+ })
127
132
  }
128
133
  })
129
134
  }).catch()
130
135
  }
131
136
  },
132
137
  onJfbLoad(options) {
133
- this.qrcode = options.qrcode || ''
134
- this.card_number = options.card_number || '101001000005478'
135
- this.card_password = options.pwd || '59009501'
138
+ this.qrcode = options.qrcode
139
+ this.card_number = Base64.decode(options.card_number)
140
+ this.card_password = Base64.decode(options.pwd)
136
141
  if (this.card_password) {
137
142
  jfbRootExec('getByPwdCardDetail',
138
143
  {
139
144
  vm: this,
140
145
  data: {
141
- card_password: "59009501",
142
- card_number: "101001000005478"
146
+ card_password: this.card_password,
147
+ card_number: this.card_number
143
148
  }
144
149
 
145
- }).then((res)=>{
146
- res.is_exchange_name = res.is_exchange==='Y'?'可转换':'不可转换'
147
- this.info = res
150
+ }).then((res) => {
151
+ res.is_exchange_name = res.is_exchange === 'Y' ? '可转换' : '不可转换'
152
+ this.info = res
148
153
  }).catch()
149
- } else if(this.qrcode) {
154
+ } else if (this.qrcode) {
150
155
  jfbRootExec('getByQrCardDetail',
151
156
  {
152
157
  vm: this,
153
158
  data: {
154
- card_qrcode: "http://sandbox-c.jufubao.cn/web/wx/card/scan/bind?pa=101001000005479|8178cff8-fe34-11ea-b580-00163e047a75"
159
+ card_qrcode: this.qrcode
155
160
  }
156
161
  }).then((res) => {
157
162
  res.is_exchange_name = res.is_exchange === 'Y' ? '可转换' : '不可转换'
@@ -174,6 +179,7 @@
174
179
  },
175
180
  onJfbBack(options) {
176
181
  console.log('event.onJfbBack', options)
182
+ this.$xdUniHelper.navigateBack()
177
183
  },
178
184
  }
179
185
  }
@@ -22,4 +22,15 @@ module.exports = [
22
22
  },
23
23
  disabled: true,
24
24
  },
25
+ {
26
+ mapFnName: 'getByIdCardDetail', //自定义方法名字(必选)
27
+ isRule: false,
28
+ title: '获得绑定的卡详情',
29
+ prefix: 'detal',
30
+ path: '/card/v1/card-bind/get-bind-card',
31
+ params: {
32
+ card_number: ['卡号', 'String', '必选'],
33
+ },
34
+ disabled: true,
35
+ },
25
36
  ];
@@ -119,7 +119,7 @@
119
119
  {
120
120
  vm: this,
121
121
  data: {
122
- card_number: '171004000000012',
122
+ card_number: this.card_number,
123
123
  }
124
124
  }).then((res)=>{
125
125
  this.success=true
@@ -133,7 +133,7 @@
133
133
  },
134
134
  onJfbLoad(options) {
135
135
  console.log(this.layoutInfo, options, 8888)
136
- this.card_number = options.card_number || '171004000000012'
136
+ this.card_number = options.card_number
137
137
  jfbRootExec('getByIdCardDetail', {
138
138
  vm: this,
139
139
  data: {
@@ -158,6 +158,7 @@
158
158
  },
159
159
  onJfbBack(options) {
160
160
  console.log('event.onJfbBack', options)
161
+ this.$xdUniHelper.navigateBack()
161
162
  },
162
163
  }
163
164
  }
@@ -0,0 +1,102 @@
1
+ <template>
2
+ <view
3
+ class="jfb-base-footer"
4
+ @click="handleSelect"
5
+ :class="{ editx : isEditx && active }"
6
+ >
7
+ <!--#ifdef H5-->
8
+ <view
9
+ class="jfb-base-footer__edit"
10
+ :class="{ editx : isEditx && active }"
11
+ v-if="isEditx && active"
12
+ >
13
+ <view class="jfb-base-footer__edit-icon" @click="delEdit">删除</view>
14
+ </view>
15
+ <!-- #endif -->
16
+ <view class="jfb-base-footer__body">
17
+ <view>测试插件( {{containerId}} )</view>
18
+ </view>
19
+ </view>
20
+ </template>
21
+
22
+ <script>
23
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
24
+ import { jfbRootExec } from "@/utils/xd.event";
25
+ import JfbBaseFooterMixin from "./JfbBaseFooterMixin";
26
+ import { getContainerPropsValue } from "@/utils/xd.base";
27
+ export default {
28
+ name: "JfbBaseFooter",
29
+ components: {
30
+ XdFontIcon
31
+ },
32
+ mixins: [
33
+ JfbBaseFooterMixin
34
+ ],
35
+ data() {
36
+ return {
37
+
38
+ //todo
39
+ }
40
+ },
41
+ watch: {
42
+ container(value) {
43
+ this.init(value)
44
+ }
45
+ },
46
+ created() {
47
+ this.init(this.container);
48
+
49
+ //todo
50
+ },
51
+ methods: {
52
+ onJfbLoad(options) {
53
+
54
+ // jfbRootExec('baiduUserLogin', {
55
+
56
+ // vm: this,// data: {
57
+
58
+ // account: 'gaoshiyong',// password: '123456789',// type: 3,// ...options
59
+
60
+ // }
61
+
62
+ // }).then().catch()
63
+ },
64
+ /**
65
+ * @description 监听事件变化
66
+ * @param container {object} 业务组件对象自己
67
+ */
68
+ init(value) {
69
+
70
+ //this.bgcolor = getContainerPropsValue(value, 'content.bgcolor', '#fff');
71
+
72
+ //this.height = getContainerPropsValue(value, 'content.height', 10);
73
+ },
74
+ onJfbScroll(options) {
75
+ console.log('event.onJfbScroll', options)
76
+ },
77
+ onJfbReachBottom(options) {
78
+ console.log('event.onJfbReachBottom', options)
79
+ },
80
+ onJfbShow(options) {
81
+ console.log('event.onJfbShow', options)
82
+ },
83
+ onJfbHide(options) {
84
+ console.log('event.onJfbHide', options)
85
+ },
86
+ onJfbBack(options) {
87
+ console.log('event.onJfbBack', options)
88
+ },
89
+ }
90
+ }
91
+
92
+ </script>
93
+
94
+ <style scoped lang="less">
95
+ @import "./JfbBaseFooterLess.less";
96
+
97
+ .jfb-base-footer {
98
+ &__body{
99
+
100
+ }
101
+ }
102
+ </style>
@@ -12,7 +12,7 @@
12
12
  }
13
13
 
14
14
  //start
15
- .jfb-base-verification-pay {
15
+ .jfb-base-footer {
16
16
  border: 1px dashed rgba(0, 0, 0, 0);
17
17
  box-sizing: border-box;
18
18
 
@@ -1,9 +1,5 @@
1
1
  'use strict';
2
2
 
3
- //@AttrImport
4
- import Attr from "./Attr";
5
- //@EndAttrImport
6
-
7
3
  import {getContainerPropsValue} from "@/utils/xd.base";
8
4
  export default {
9
5
  props: {
@@ -92,10 +88,6 @@ export default {
92
88
  containerId: null, //容器ID
93
89
  //#ifdef H5
94
90
 
95
- //@AttrData
96
- Attr, //对外开发编辑属性
97
- //@EndAttrData
98
-
99
91
  active: false, //是否选择当前状态
100
92
  isEditx: true, //当前为Editx模式
101
93
  edit: false, //是否开启编辑模式
@@ -311,7 +311,8 @@
311
311
  verification_code
312
312
  },
313
313
  }).then(res => {
314
- location.href = this.phoneLogin.redirect_url;
314
+ // location.href = this.phoneLogin.redirect_url;
315
+ this.toHomeAfterLogin();
315
316
  })
316
317
  }else if(accountLoginType == "pwd"){
317
318
  jfbRootExec("accountLogin", {
@@ -322,11 +323,21 @@
322
323
  password: password
323
324
  }
324
325
  }).then(res => {
325
- location.href = this.pwdLogin.redirect_url;
326
+ // location.href = this.pwdLogin.redirect_url;
327
+ this.toHomeAfterLogin();
326
328
  })
327
329
  }
328
330
 
329
331
  },
332
+ toHomeAfterLogin(){
333
+ let {redirect_url} = this.$route.query;
334
+ if(redirect_url) redirect_url = decodeURIComponent(redirect_url);
335
+ redirect_url = redirect_url || this.settings.index;
336
+ this.$xdUniHelper.redirectTo({
337
+ url: redirect_url
338
+ })
339
+ },
340
+
330
341
  //暂不登录, 去逛逛
331
342
  toNotLoginHome(){
332
343
  //location.href = not_login_home_url;
@@ -1,16 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = [
4
- {
5
- mapFnName: 'getSettleMainInfo',
6
- title: '门店核销 - 展示主界面数据',
7
- // path: '/store/v1/cash/settle/main-info',
8
- path: "/store/v1/cash/user-settle/main-info",
9
- isRule: false,
10
- params: {
11
- shop_id: ['门店id', 'Number', '必选'],
12
- },
13
- isConsole: true,
14
- disabled: true,
15
- },
16
- ];