jufubao-base 1.0.63-beta2 → 1.0.63-beta202

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.63-beta2",
3
+ "version": "1.0.63-beta202",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -0,0 +1,106 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * @description 当表单组件中有联动操作时候,使用方法进行返回
5
+ */
6
+ export default {
7
+ style: [],
8
+ content: (data) => {
9
+ return [
10
+ {
11
+ label: '背景颜色:', //label
12
+ ele: 'xd-color', //package 名称
13
+ valueKey: 'bgcolor', //form[valueKey]
14
+ value: data.bgcolor || '', //v-model
15
+ placeholder: '请输入占位框背景颜色',
16
+ classNmae: 'input80', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
17
+ rules: [
18
+ {
19
+ required: true,
20
+ message: '请输入占位框背景颜色',
21
+ trigger: 'blur'
22
+ },
23
+ ]
24
+ },
25
+ {
26
+ label: '选中路径:', //label
27
+ ele: 'xd-select-pages-path', //package 名称
28
+ valueKey: 'select-pages-path', //form[valueKey]
29
+ value: data['select-pages-path'] || {},
30
+ setting: {
31
+ router: XdBus.getParentApi('getPagesTree')
32
+ },
33
+ inline: false,
34
+ },
35
+ data.bgcolor && {
36
+ label: '高度:', //label
37
+ ele: 'el-input', //package 名称
38
+ type: 'number',
39
+ valueKey: 'height', //form[valueKey]
40
+ value: data.height || 100, //v-model
41
+ placeholder: '请输入占位框高度,单位像素,默认:10px',
42
+ className: 'input80', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
43
+ rules: [
44
+ {
45
+ required: true,
46
+ message: '请输入占位框高度',
47
+ trigger: 'blur'
48
+ },
49
+ ]
50
+ },
51
+ {
52
+ label: '', //label
53
+ ele: 'slot', //package 名称
54
+ slot: 'is_reference',
55
+ },
56
+ ].filter(i=>i)
57
+ },
58
+ advanced: [
59
+ {
60
+ label: '背景颜色:', //label
61
+ ele: 'xd-color', //package 名称
62
+ valueKey: 'bgcolor', //form[valueKey]
63
+ value: '', //v-model
64
+ placeholder: '请输入占位框背景颜色',
65
+ classNmae: 'input80', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
66
+ rules: [
67
+ {
68
+ required: true,
69
+ message: '请输入占位框背景颜色',
70
+ trigger: 'blur'
71
+ },
72
+ ]
73
+ },
74
+ {
75
+ label: '选中路径:', //label
76
+ ele: 'xd-select-pages-path', //package 名称
77
+ valueKey: 'select-pages-path', //form[valueKey]
78
+ value: null,
79
+ setting: {
80
+ router: XdBus.getParentApi('getPagesTree')
81
+ },
82
+ inline: false,
83
+ },
84
+ {
85
+ label: '高度:', //label
86
+ ele: 'el-input', //package 名称
87
+ type: 'number',
88
+ valueKey: 'height', //form[valueKey]
89
+ value: null, //v-model
90
+ placeholder: '请输入占位框高度,单位像素,默认:10px',
91
+ classNmae: 'input80', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
92
+ rules: [
93
+ {
94
+ required: true,
95
+ message: '请输入占位框高度',
96
+ trigger: 'blur'
97
+ },
98
+ ]
99
+ },
100
+ {
101
+ label: '', //label
102
+ ele: 'slot', //package 名称
103
+ slot: 'is_reference',
104
+ },
105
+ ],
106
+ };
@@ -0,0 +1,110 @@
1
+ <template>
2
+ <view
3
+ class="jfb-base-background"
4
+ @click="handleEditxSelect"
5
+ :class="{ editx : isEditx && active }"
6
+ >
7
+ <!--#ifdef H5-->
8
+ <view
9
+ class="jfb-base-background__edit"
10
+ :class="{ editx : isEditx && active }"
11
+ v-if="isEditx && active"
12
+ >
13
+ <view class="jfb-base-background__edit-icon" @click="delEdit">删除</view>
14
+ </view>
15
+ <!-- #endif -->
16
+ <view class="jfb-base-background__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 JfbBaseBackgroundMixin from "./JfbBaseBackgroundMixin";
26
+ import { getContainerPropsValue } from "@/utils/xd.base";
27
+ import componentsMixins from "@/mixins/componentsMixins";
28
+ import extsMixins from "@/mixins/extsMixins";
29
+ export default {
30
+ name: "JfbBaseBackground",
31
+ components: {
32
+ XdFontIcon
33
+ },
34
+ mixins: [
35
+ componentsMixins, extsMixins, JfbBaseBackgroundMixin
36
+ ],
37
+ data() {
38
+ return {
39
+
40
+ //todo
41
+ }
42
+ },
43
+ watch: {
44
+ container(value) {
45
+ this.init(value)
46
+ }
47
+ },
48
+ created() {
49
+ this.init(this.container);
50
+
51
+ //todo
52
+ },
53
+ methods: {
54
+ onJfbLoad(options) {
55
+
56
+ // jfbRootExec('baiduUserLogin', {
57
+
58
+ // vm: this,// data: {
59
+
60
+ // account: 'gaoshiyong',// password: '123456789',// type: 3,// ...options
61
+
62
+ // }
63
+
64
+ // }).then().catch()
65
+ },
66
+ /**
67
+ * @description 监听事件变化
68
+ * @param container {object} 业务组件对象自己
69
+ */
70
+ init(container) {
71
+
72
+ //this.bgcolor = getContainerPropsValue(container, 'content.bgcolor', '#fff');
73
+
74
+ //this.height = getContainerPropsValue(container, 'content.height', 10);
75
+ },
76
+ onJfbScroll(options) {
77
+ console.log('event.onJfbScroll', options)
78
+ },
79
+ onJfbReachBottom(options) {
80
+ console.log('event.onJfbReachBottom', options)
81
+ },
82
+ onJfbShow(options) {
83
+ console.log('event.onJfbShow', options)
84
+ },
85
+ onJfbHide(options) {
86
+ console.log('event.onJfbHide', options)
87
+ },
88
+ onJfbBack(options) {
89
+ console.log('event.onJfbBack', options)
90
+ },
91
+ onJfbUpdate(...data) {
92
+ console.log('event.onJfbUpdate', data)
93
+ },
94
+ onJfbCustomEvent(options) {
95
+ console.log('event.onJfbReachBottom', options)
96
+ },
97
+ }
98
+ }
99
+
100
+ </script>
101
+
102
+ <style scoped lang="less">
103
+ @import "./JfbBaseBackgroundLess.less";
104
+
105
+ .jfb-base-background {
106
+ &__body{
107
+
108
+ }
109
+ }
110
+ </style>
@@ -0,0 +1,80 @@
1
+ /**
2
+ * @desc 获取绝对路径完整地址
3
+ * @param @path
4
+ **/
5
+ //例如:https://image.jufubao.cn/20220501010108/image/bg/default_gonghui_bg.png
6
+ @basePath: 'business/';
7
+ @doMain: '//sandbox-img.jufubao.cn/';
8
+
9
+ .getBusinessImageUrl(@path, @size: 'size8') {
10
+ @url: "@{doMain}@{basePath}@{path}?x-oss-process=style/@{size}";
11
+ background-image: url(@url);
12
+ }
13
+
14
+ //start
15
+ .jfb-base-background {
16
+ border: 1px dashed rgba(0, 0, 0, 0);
17
+ box-sizing: border-box;
18
+ min-height: unit(100, rpx);
19
+
20
+ &__body{
21
+ position: relative;
22
+ overflow: hidden;
23
+ z-index: 2
24
+ }
25
+
26
+ &.editx {
27
+ position: relative;
28
+ border: 1px dashed blue;
29
+ box-sizing: border-box;
30
+ z-index: 3
31
+
32
+ }
33
+
34
+ &:hover {
35
+ border: 1px dashed blue;
36
+ }
37
+
38
+ &.noBorder {
39
+ border-color: rgba(0,0,0,0);
40
+ border-width: 0;
41
+ }
42
+
43
+
44
+ &__edit {
45
+ cursor: pointer;
46
+ position: absolute;
47
+ right: unit(0, rpx);
48
+ top: unit(-52, rpx);
49
+ height: unit(50, rpx);
50
+ line-height: unit(50, rpx);
51
+ display: flex;
52
+ justify-content: center;
53
+ align-items: center;
54
+ background: rgba(0, 0, 0, .6);
55
+ border-radius: unit(10, rpx);
56
+ box-shadow: 0 0 10px rbga(0, 0, 0, 0.3);
57
+ color: #fff;
58
+ font-size: unit(22, rpx);
59
+
60
+ &-icon{
61
+ padding: 0 unit(20, rpx);
62
+ }
63
+
64
+ &.editx {
65
+ box-sizing: border-box;
66
+
67
+ }
68
+ }
69
+ }
70
+ //end
71
+
72
+
73
+ /**notPreview**/
74
+ .jfb-base-background {
75
+ &:before {
76
+ content: " ";
77
+ display: table;
78
+ }
79
+ }
80
+ /**endNotPreview**/
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+
4
+ //@AttrImport
5
+ import Attr from "./Attr";
6
+ //@EndAttrImport
7
+
8
+
9
+ export default {
10
+ data() {
11
+ return {
12
+ //#ifdef H5
13
+
14
+ //@AttrData
15
+ Attr:{}, //对外开发编辑属性
16
+ //@EndAttrData
17
+
18
+ // #endif
19
+ cssRoot: 'jfb-base-background'
20
+ }
21
+ },
22
+ created() {
23
+
24
+ //@AttrDataCreated
25
+ this.Attr = this.$xdUniHelper.customClone(Attr);
26
+ //@EndAttrDataCreated
27
+
28
+
29
+ },
30
+ }
@@ -262,6 +262,8 @@ export default {
262
262
  },
263
263
  data() {
264
264
  return {
265
+ options: {},
266
+
265
267
  //提示文案
266
268
  noticeBackgroundColor: "",
267
269
  notice: "",
@@ -473,14 +475,15 @@ export default {
473
475
  },
474
476
 
475
477
  onJfbLoad(options) {
478
+ this.options = options;
476
479
  let { inCallback } = options;
477
- if (inCallback) {
478
- this.$storage.set("inCallback", inCallback, 0.05);
479
- inCallback = Base64.decode(inCallback);
480
- } else {
481
- inCallback = this.$storage.get("inCallback");
482
- if (inCallback) {
480
+ if(!inCallback) this.$storage.remove("inCallback"); //作为入口
481
+ else {
482
+ this.$storage.set("inCallback", inCallback);
483
+ try{
483
484
  inCallback = Base64.decode(inCallback);
485
+ }catch (e){
486
+ inCallback = null;
484
487
  }
485
488
  }
486
489
 
@@ -10,10 +10,11 @@ export default {
10
10
  cardOrgList:[], //原始数据
11
11
  cardList:null, //计算后的卡列表
12
12
  cardPageNum: 0, //当前页面
13
- cardPageLen: 5, //每页获取数据调试
13
+ cardPageLen: 10, //每页获取数据调试
14
14
  cardComputedList:[], //当前获取的数据列表
15
15
  cardLoading: false, //加载状态值设置
16
16
  cardNextTop: 0, //计算到每一个节点的距离顶部Top值
17
+ cardIndex: 0,
17
18
  contentStatus: false, //内容框是否已经进行过计算距离顶部Top值状态
18
19
  hasContent: true, //是否可以进行继续加载状态
19
20
 
@@ -76,10 +77,13 @@ export default {
76
77
  })[0];
77
78
  card['height'] = item.height;
78
79
  card['top'] = this.cardNextTop;
79
- this.cardNextTop = this.cardNextTop + card['height'] + (paddingBottom * this.$rpxNum)
80
+ card['index'] = this.cardIndex;
81
+ this.cardNextTop = this.cardNextTop + card['height'] + (paddingBottom * this.$rpxNum);
82
+ this.cardIndex++;
80
83
  return card
81
84
  });
82
85
  this.cardList = (this.cardList||[]).concat(arr);
86
+ this.cardPageNum++;
83
87
  this.$xdHideLoading();
84
88
  }).exec();
85
89
  })
@@ -98,6 +102,9 @@ export default {
98
102
  this.cardPageNum*this.cardPageLen,
99
103
  this.cardPageNum*this.cardPageLen + this.cardPageLen
100
104
  );
105
+ if(this.cardComputedList.length < this.cardPageLen) {
106
+ this.hasContent = false;
107
+ }
101
108
  this.handleCardComputed(paddingBottom).then().catch();
102
109
  },
103
110
 
@@ -105,7 +112,6 @@ export default {
105
112
  if(this.cardLoading || !this.hasContent || this.cardPageNum ===0) return;
106
113
  this.cardLoading = true;
107
114
  this.$xdShowLoading({});
108
- this.cardPageNum++;
109
115
  this.$nextTick(()=>{
110
116
  setTimeout(()=>{
111
117
  this.cardLoading = false;
@@ -118,6 +124,7 @@ export default {
118
124
  if(this.cardComputedList.length < this.cardPageLen) {
119
125
  this.hasContent = false;
120
126
  }
127
+ this.cardPageNum++;
121
128
  },500)
122
129
  })
123
130
 
@@ -386,11 +386,13 @@ export default {
386
386
  },
387
387
  tabIndex(){
388
388
  this.clearDefault();
389
- this.handleCardInit(this.ajaxCardList, this.tabIndex === 1);
389
+ this.onJfbLoad(this.options);
390
390
  }
391
391
  },
392
392
  data() {
393
393
  return {
394
+ options:{},
395
+
394
396
  //提示文案
395
397
  noticeBackgroundColor: "",
396
398
  notice: "",
@@ -414,6 +416,7 @@ export default {
414
416
  disabledUrl: "",
415
417
  //cardLayout: "1", //票券布局
416
418
  showDisabled: 'Y',
419
+ showCardList: false,
417
420
 
418
421
  //活动
419
422
  dialogEvent: false,
@@ -623,14 +626,15 @@ export default {
623
626
  },
624
627
 
625
628
  onJfbLoad(options) {
629
+ this.options = options;
626
630
  let { inCallback } = options;
627
- if (inCallback) {
628
- this.$storage.set("inCallback", inCallback, 0.05);
629
- inCallback = Base64.decode(inCallback);
630
- } else {
631
- inCallback = this.$storage.get("inCallback");
632
- if (inCallback) {
631
+ if(!inCallback) this.$storage.remove("inCallback"); //作为入口
632
+ else {
633
+ this.$storage.set("inCallback", inCallback);
634
+ try{
633
635
  inCallback = Base64.decode(inCallback);
636
+ }catch (e){
637
+ inCallback = null;
634
638
  }
635
639
  }
636
640
 
@@ -667,13 +671,12 @@ export default {
667
671
  };
668
672
  });
669
673
  this.ajaxCardList = res;
670
- this.handleCardInit(this.ajaxCardList, this.tabIndex === 1);
671
-
672
-
673
674
  this.hasChangeStatus = this.getCardGroupItem(this.ajaxCardList.list.filter((item) => {
674
675
  return item["is_exchange"] === "Y";
675
676
  }), res['site_entry_settings']).length > 0;
676
677
 
678
+
679
+ this.handleCardInit(this.ajaxCardList, this.tabIndex === 1);
677
680
  this.$xdHideLoading();
678
681
  })
679
682
  .catch(() => this.$xdHideLoading());
@@ -91,7 +91,7 @@
91
91
  import componentsMixins from "@/mixins/componentsMixins";
92
92
  import extsMixins from "@/mixins/extsMixins";
93
93
  import {Base64} from "js-base64";
94
-
94
+
95
95
  export default {
96
96
  name: "JfbBaseCardV2",
97
97
  components: {
@@ -137,14 +137,23 @@
137
137
  methods: {
138
138
  onJfbLoad(options) {
139
139
  let { inCallback } = options;
140
- if (inCallback) inCallback = Base64.decode(inCallback);
140
+ if(!inCallback) this.$storage.remove("inCallback"); //作为入口
141
+ else {
142
+ this.$storage.set("inCallback", inCallback);
143
+ try{
144
+ inCallback = Base64.decode(inCallback);
145
+ }catch (e){
146
+ inCallback = null;
147
+ }
148
+ }
141
149
  this.inCallback = inCallback || this.settings.index;
142
-
150
+
151
+
143
152
  let params = {is_all: 'Y'};
144
153
  if (options['jfb_business_code']) {
145
154
  params['card_business_code'] = options['jfb_business_code'];
146
155
  }
147
-
156
+
148
157
  jfbRootExec("getListCardBind", {
149
158
  vm: this,
150
159
  data: params,
@@ -211,11 +220,11 @@
211
220
  url: `${this.cardInfoPath}?card_number=${item["card_number"]}`,
212
221
  });
213
222
  },
214
-
223
+
215
224
  onJfbBack(options) {
216
225
  this.$xdUniHelper.navigateBack()
217
226
  },
218
-
227
+
219
228
  }
220
229
  }
221
230
 
@@ -231,13 +240,13 @@
231
240
  right: 0;
232
241
  left: 0;
233
242
  background: #FFFFFF;
234
-
235
-
243
+
244
+
236
245
  padding: 0 unit(24, rpx);
237
246
  box-sizing: border-box;
238
247
  box-shadow: 0px 0px 8rpx 0px rgba(179, 193, 196, 0.5);
239
248
  z-index: 111;
240
-
249
+
241
250
  &>view {
242
251
  width: 100%;
243
252
  display: flex;
@@ -44,6 +44,7 @@
44
44
  import { getContainerPropsValue } from "@/utils/xd.base";
45
45
  import componentsMixins from "@/mixins/componentsMixins";
46
46
  import extsMixins from "@/mixins/extsMixins";
47
+ import {Base64} from "js-base64";
47
48
  export default {
48
49
  name: "JfbBaseCardV3",
49
50
  components: {
@@ -83,7 +84,15 @@
83
84
  methods: {
84
85
  onJfbLoad(options) {
85
86
  let { inCallback } = options;
86
- if (inCallback) inCallback = Base64.decode(inCallback);
87
+ if(!inCallback) this.$storage.remove("inCallback"); //作为入口
88
+ else {
89
+ this.$storage.set("inCallback", inCallback);
90
+ try{
91
+ inCallback = Base64.decode(inCallback);
92
+ }catch (e){
93
+ inCallback = null;
94
+ }
95
+ }
87
96
  this.inCallback = inCallback || this.settings.index;
88
97
 
89
98
  let params = {is_all: 'Y'};
@@ -43,7 +43,7 @@
43
43
  class="get_code"
44
44
  @click="reGetCode"
45
45
  :style="{ color: mainColor }"
46
- >{{ time ? time + "秒后获取" : "获取验证码" }}</view
46
+ >{{ jfbTimeer ? jfbTimeer + "秒后获取" : "获取验证码" }}</view
47
47
  >
48
48
  </view>
49
49
  </xd-form-item>
@@ -79,7 +79,7 @@
79
79
  class="jump_collect"
80
80
  @click="jumpCollect"
81
81
  >跳过</view>
82
-
82
+
83
83
  <!-- <view
84
84
  class="not_login"
85
85
  :style="{color: mainColor}"
@@ -121,7 +121,7 @@ export default {
121
121
  phone_number: "",
122
122
  verification_code: "",
123
123
  },
124
- time: 0,
124
+ jfbTimeer: 0,
125
125
  interval: null,
126
126
  provider_id: "",
127
127
  callback_url: "",
@@ -160,7 +160,7 @@ export default {
160
160
  url: `/pages/content/content?${params}`
161
161
  })
162
162
  },
163
-
163
+
164
164
  onJfbLoad(options) {
165
165
  this.provider_id = options.provider_id;
166
166
  this.callback_url = options.callback_url;
@@ -174,7 +174,11 @@ export default {
174
174
  //this.height = getContainerPropsValue(container, 'content.height', 10);
175
175
  },
176
176
  reGetCode() {
177
- if (this.time > 0) return;
177
+ this.$xdLog.setProject('get.code.handle', {
178
+ time: this.time,
179
+ jfbTimeer: this.jfbTimeer
180
+ });
181
+ if (this.jfbTimeer > 0) return;
178
182
  const { phone_number } = this.accountForm;
179
183
  if (!/^1[3-9]\d{9}$/.test(phone_number)) {
180
184
  uni.showToast({
@@ -193,10 +197,10 @@ export default {
193
197
  },
194
198
  }).then((res) => {
195
199
  this.$xdHideLoading()
196
- this.time = 120;
200
+ this.jfbTimeer = 120;
197
201
  this.interval = setInterval(() => {
198
- this.time--;
199
- if (this.time == 0) {
202
+ this.jfbTimeer--;
203
+ if (this.jfbTimeer == 0) {
200
204
  clearTimeout(this.interval);
201
205
  }
202
206
  }, 1000);
@@ -216,7 +220,7 @@ export default {
216
220
  const { provider_id } = this;
217
221
  const { phone_number, verification_code } = this.accountForm;
218
222
  if (!phone_number || !verification_code) return uni.showToast({ title: "手机号跟验证码不能为空", icon: "none" });
219
-
223
+
220
224
  this.$xdShowLoading({})
221
225
  jfbRootExec("phoneCollect", {
222
226
  vm: this,
@@ -237,7 +241,7 @@ export default {
237
241
  this.$xdLog.catch(error)
238
242
  });
239
243
  },
240
-
244
+
241
245
  onJfbBack(options) {
242
246
  this.$xdUniHelper.navigateBack();
243
247
  },