jufubao-base 1.0.19 → 1.0.21

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.
Files changed (39) hide show
  1. package/package.json +2 -1
  2. package/src/components/JfbBaseAfterOrderList/Api.js +60 -0
  3. package/src/components/JfbBaseAfterOrderList/Attr.js +154 -0
  4. package/src/components/JfbBaseAfterOrderList/JfbBaseAfterOrderList.vue +203 -0
  5. package/src/components/JfbBaseAfterOrderList/JfbBaseAfterOrderListLess.less +57 -0
  6. package/src/components/JfbBaseAfterOrderList/JfbBaseAfterOrderListMixin.js +222 -0
  7. package/src/components/JfbBaseBlock/JfbBaseBlock.vue +20 -0
  8. package/src/components/JfbBaseBlock/JfbBaseBlockMixin.js +42 -4
  9. package/src/components/JfbBaseCard/JfbBaseCardMixin.js +42 -4
  10. package/src/components/JfbBaseCardBind/JfbBaseCardBindMixin.js +42 -4
  11. package/src/components/JfbBaseCardDetail/JfbBaseCardDetailMixin.js +42 -4
  12. package/src/components/JfbBaseCardInfo/JfbBaseCardInfoMixin.js +42 -4
  13. package/src/components/JfbBaseCardMy/JfbBaseCardMyMixin.js +42 -4
  14. package/src/components/JfbBaseCardShift/JfbBaseCardShiftMixin.js +42 -4
  15. package/src/components/JfbBaseFooter/Attr.js +82 -0
  16. package/src/components/JfbBaseFooter/JfbBaseFooter.vue +111 -40
  17. package/src/components/JfbBaseFooter/JfbBaseFooterMixin.js +49 -3
  18. package/src/components/JfbBaseLine/JfbBaseLineMixin.js +42 -4
  19. package/src/components/JfbBaseLogin/JfbBaseLogin.vue +172 -51
  20. package/src/components/JfbBaseLogin/JfbBaseLoginMixin.js +42 -4
  21. package/src/components/JfbBaseMy/Api.js +60 -0
  22. package/src/components/JfbBaseMy/Attr.js +54 -0
  23. package/src/components/JfbBaseMy/JfbBaseMy.vue +262 -0
  24. package/src/components/JfbBaseMy/JfbBaseMyLess.less +57 -0
  25. package/src/components/JfbBaseMy/JfbBaseMyMixin.js +222 -0
  26. package/src/components/JfbBaseOrderList/Api.js +60 -0
  27. package/src/components/JfbBaseOrderList/Attr.js +154 -0
  28. package/src/components/JfbBaseOrderList/JfbBaseOrderList.vue +285 -0
  29. package/src/components/JfbBaseOrderList/JfbBaseOrderListLess.less +57 -0
  30. package/src/components/JfbBaseOrderList/JfbBaseOrderListMixin.js +222 -0
  31. package/src/components/JfbBaseSetPwd/JfbBaseSetPwdMixin.js +42 -4
  32. package/src/components/JfbBaseSuccess/Attr.js +68 -0
  33. package/src/components/JfbBaseSuccess/JfbBaseSuccess.vue +327 -0
  34. package/src/components/JfbBaseSuccess/JfbBaseSuccessLess.less +57 -0
  35. package/src/components/JfbBaseSuccess/JfbBaseSuccessMixin.js +222 -0
  36. package/src/components/JfbBaseTestApi/JfbBaseTestApiMixin.js +42 -4
  37. package/src/components/JfbBaseTestBody/JfbBaseTestBodyMixin.js +37 -3
  38. package/src/components/JfbBaseTestBottom/JfbBaseTestBottomMixin.js +37 -3
  39. package/src/components/JfbBaseTestTop/JfbBaseTestTopMixin.js +37 -3
@@ -93,16 +93,31 @@ export default {
93
93
  //#ifdef H5
94
94
 
95
95
  //@AttrData
96
- Attr, //对外开发编辑属性
96
+ Attr:{}, //对外开发编辑属性
97
97
  //@EndAttrData
98
98
 
99
99
  active: false, //是否选择当前状态
100
100
  isEditx: true, //当前为Editx模式
101
101
  edit: false, //是否开启编辑模式
102
102
  // #endif
103
+
104
+ //风格键
105
+ mainColor: '',
106
+ successColor: '',
107
+ warningColor: '',
108
+ subMainColor: '',
109
+ infoColor: '',
110
+ defaultColor: '',
111
+ dangerColor: ''
103
112
  }
104
113
  },
105
114
  created() {
115
+
116
+ //@AttrDataCreated
117
+ this.Attr = this.$xdUniHelper.customClone(Attr);
118
+ //@EndAttrDataCreated
119
+
120
+
106
121
  //设置插件cid
107
122
  if (this.cid) {
108
123
  this.containerId = this.cid;
@@ -110,6 +125,9 @@ export default {
110
125
  this.containerId = this.$xdUniHelper.randomChar(20);
111
126
  }
112
127
 
128
+ //初始化风格
129
+ this.initThemesToData();
130
+
113
131
  //#ifdef H5
114
132
  //监听用户点击状态显示虚框
115
133
  XdBus.addEvent('select', ({containerId}) => {
@@ -132,6 +150,26 @@ export default {
132
150
  onCheck() {
133
151
  },
134
152
 
153
+ /***
154
+ * @description 业务组件风格map到data中
155
+ */
156
+ initThemesToData() {
157
+ Object.keys(this.styles).map(key => {
158
+ let k = key.replace('$', '');
159
+ if (this[k] !== undefined) this[k] = this.styles[key];
160
+ });
161
+ console.log('initThemesToData',this)
162
+ },
163
+
164
+ /**
165
+ * @description 其子级插件获取当前插件的业务组件风格列表
166
+ * @returns {*}
167
+ */
168
+ getParentThemes(){
169
+ return this.styles;
170
+ },
171
+
172
+
135
173
  //#ifdef H5
136
174
  /**
137
175
  * @description 点击删除操作按钮
@@ -153,8 +191,8 @@ export default {
153
191
  //#ifdef H5
154
192
  if (this.active) return;
155
193
  this.active = true;
156
- let AttrObj = this.$xdUniHelper.checkVarType(Attr) === 'object' ?
157
- Attr: { style: [], advanced: [], content: []};
194
+ let AttrObj = this.$xdUniHelper.checkVarType(this.Attr) === 'object' ?
195
+ this.Attr : { style: [], advanced: [], content: []};
158
196
  console.log('handleSelect.Attr', AttrObj);
159
197
 
160
198
  //设置已绑定数据
@@ -169,7 +207,7 @@ export default {
169
207
  XdBus.send('onSelectPackage', {
170
208
  containerId: this.containerId,
171
209
  Attr: AttrObj,
172
- container: this.container
210
+ container: this.$xdUniHelper.cloneDeep(this.container)
173
211
  });
174
212
 
175
213
  //绑定选中插件事件
@@ -0,0 +1,68 @@
1
+ 'use strict';
2
+
3
+ export default {
4
+ style: [],
5
+ content: [
6
+ {
7
+ label: '选择订单状态接口地址:',
8
+ ele: 'xd-select-list',
9
+ valueKey: 'order_status_url',
10
+ value: null,
11
+ placeholder: '请选择订单状态接口地址',
12
+ multiple: false,
13
+ classNmae: 'input80',
14
+ list: XdBus.getParentData('getOrderStatusApiList'),
15
+ rules: [
16
+ {
17
+ required: true,
18
+ message: '请选择订单状态接口地址',
19
+ trigger: 'change'
20
+ },
21
+ ]
22
+ },
23
+ {
24
+ label: '背景颜色:',
25
+ ele: 'xd-color',
26
+ valueKey: 'bgColor',
27
+ value: '#EC4D71',
28
+ placeholder: '请选择背景颜色',
29
+ classNmae: 'input80',
30
+ rules: [
31
+ {
32
+ required: true,
33
+ message: '请选择背景颜色',
34
+ trigger: 'blur'
35
+ },
36
+ ]
37
+ },
38
+ {
39
+ label: '轮询最大2的N次方(秒):',
40
+ ele: 'el-input',
41
+ type: 'number',
42
+ valueKey: 'maxTime',
43
+ value: 5,
44
+ placeholder: '请输入自定义按钮名称',
45
+ className: 'input80'
46
+ },
47
+ {
48
+ label: '自定义按钮名称:',
49
+ ele: 'el-input',
50
+ type: 'text',
51
+ valueKey: 'custom_btn_name',
52
+ value: '',
53
+ placeholder: '请输入自定义按钮名称',
54
+ className: 'input80'
55
+ },
56
+ {
57
+ "label": "自定义按钮跳转地址:",
58
+ "ele": "xd-select-pages-path",
59
+ "valueKey": "custom_btn_url",
60
+ "value": null,
61
+ "setting": {
62
+ router: XdBus.getParentData('getPagesTree'),
63
+ },
64
+ "inline": false,
65
+ },
66
+ ],
67
+ advanced: [],
68
+ }
@@ -0,0 +1,327 @@
1
+ <template>
2
+ <view
3
+ class="jfb-base-success"
4
+ @click="handleSelect"
5
+ :class="{ editx : isEditx && active }"
6
+ >
7
+ <!--#ifdef H5-->
8
+ <view
9
+ class="jfb-base-success__edit"
10
+ :class="{ editx : isEditx && active }"
11
+ v-if="isEditx && active"
12
+ >
13
+ <view class="jfb-base-success__edit-icon" @click="delEdit">删除</view>
14
+ </view>
15
+ <!-- #endif -->
16
+ <view class="jfb-base-success__body">
17
+ <xd-success
18
+ v-if="order_id !== null && packageData"
19
+ :bg-color="bgColor"
20
+ :title-background="background"
21
+ :key="xdMySuccess"
22
+ :max-time="maxTime"
23
+ @onBtn="handleOnBtnClick"
24
+ @getStatus="getStatus"
25
+ ></xd-success>
26
+ </view>
27
+ </view>
28
+ </template>
29
+
30
+
31
+ <script>
32
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
33
+ import {jfbRootExec} from "@/utils/xd.event";
34
+ import JfbBaseSuccessMixin from "./JfbBaseSuccessMixin";
35
+ import XdSuccess from "@/components/XdSuccess/XdSuccess";
36
+ import {getContainerPropsValue} from "@/utils/xd.base";
37
+ import {getNoUrl} from "@/utils/nourl";
38
+
39
+ export default {
40
+ name: "JfbBaseSuccess",
41
+ components: {
42
+ XdFontIcon,
43
+ XdSuccess
44
+ },
45
+ mixins: [
46
+ JfbBaseSuccessMixin
47
+ ],
48
+ data() {
49
+ return {
50
+ packageData: false, //插件数据已完成初始化
51
+ order_id: null, //订单号已完成初始化
52
+ maxTime: 5, //最长轮询2的N次方(秒)
53
+ detail: '',//自定义按钮跳转
54
+ index: '', //首页跳转
55
+ statusUrl: null, //获取订单状态接口地址
56
+
57
+ //请求参数
58
+ params:null,
59
+ view: window['jfbConfingView'] === 'preview',
60
+ bgColor: null,
61
+
62
+ //预览模式刷新插件
63
+ xdMySuccess: 'xdMySuccess',
64
+ background: '',
65
+ }
66
+ },
67
+ watch: {
68
+ container(value) {
69
+ this.init(value)
70
+ }
71
+ },
72
+ created() {
73
+ this.init(this.container);
74
+ },
75
+ methods: {
76
+ onJfbLoad(options) {
77
+ this.params = options;
78
+ this.order_id = options.order_id || '470274149596532736';
79
+ },
80
+
81
+ /**
82
+ * @description 打包预览模式
83
+ * @param cb {Function|null}
84
+ */
85
+ viewTrue(cb){
86
+ //status => 3000:成功 3002:失败 3001:进行中
87
+ let orderStatus = ['3001', '3000', '3002'][this.$xdUniHelper.random(0, 2)];
88
+ let info = {
89
+ icon: 'iconshijian',
90
+ iconSize: 80, //图标大小
91
+ iconColor: '#333', //图标颜色
92
+ orderName: '订单处理中', //订单状态名称
93
+ orderStatus: orderStatus, //订单状态名称,
94
+ content: '',
95
+ tips: '请耐心等待...',
96
+ };
97
+
98
+ //成功
99
+ if(orderStatus === '3000'){
100
+ info = {
101
+ icon: 'icondingdanwancheng',
102
+ iconSize: 80, //图标大小
103
+ iconColor: 'green', //图标颜色
104
+ orderName: '订单支付完成', //订单状态名称
105
+ orderStatus: orderStatus, //订单状态名称,
106
+ content: '',
107
+ tips: '非常感谢您购买我们的产品!',
108
+ }
109
+ }
110
+
111
+ //失败
112
+ if (orderStatus === '3002') {
113
+ info = {
114
+ icon: 'icongerenzhongxinchufabaocuo',
115
+ iconSize: 80, //图标大小
116
+ iconColor: 'red', //图标颜色
117
+ orderName: '订单支付失败', //订单状态名称
118
+ orderStatus: orderStatus, //订单状态名称,
119
+ content: '',
120
+ tips: '请返回订单重新支付!',
121
+ }
122
+ }
123
+
124
+ let result = {
125
+ //基础信息
126
+ info: {
127
+ descTitle: '温馨提示',
128
+ desc: '支付成功后,平台不会以付款异常、卡单、系统升级为由联系您。请勿泄露银行卡号、手机验证码,否则会造成钱款损失!谨防诈骗电话!',
129
+ btn: [
130
+ {'label': '返回首页', type: 'info', radius: '10rpx', value: 1},
131
+ {
132
+ label: getContainerPropsValue(this.container, 'content.custom_btn_name'),
133
+ type: 'primary',
134
+ radius: '12rpx',
135
+ value: 2
136
+ },
137
+ ],
138
+ },
139
+
140
+ //订单信息
141
+ order: info,
142
+
143
+ //app提示
144
+ app: {
145
+ use_desc: '本兑换码:仅限于万达电影官方APP使用'
146
+ },
147
+
148
+ //码信息
149
+ code: {
150
+ //电子码 (密码)
151
+ code: [
152
+ {label: "兑换码:", value: "jfbcake.oss-cn-beijing.aliyuncs.comliyuncs.com"},
153
+ {label: "兑换码:", value: "45122"}
154
+ ],
155
+
156
+ //电子码 (号码 + 密码)
157
+ numberAndPassword: [
158
+ [{label: "券号:", value: "1515"}, {label: "密码:", value: "45122"}],
159
+ [{label: "券号:", value: "1515"}, {label: "密码:", value: "45122"}]
160
+ ],
161
+
162
+ //条形码
163
+ barcode: [
164
+ {
165
+ label: "券号:cardcardcardcard0001 密码:21337",
166
+ value: "http://sandbox-m-cake.jufubao.cn/rest/3.0/cakeshop/order/order/barcode_img?c=&p=21337"
167
+ },
168
+ {
169
+ label: "券号:cardcardcardcard0001 密码:21337",
170
+ value: "http://sandbox-m-cake.jufubao.cn/rest/3.0/cakeshop/order/order/barcode_img?c=cardcardcardcard0001&p=21337"
171
+ }
172
+ ],
173
+
174
+ //二维码
175
+ twocode: [
176
+ {
177
+ label: "券号:cardcardcardcard0001 密码:21337",
178
+ value: "https://c.jufubao.cn/web/pb/qrcode/image?content=21337"
179
+ },
180
+ {
181
+ label: "券号:cardcardcardcard0001 密码:21337",
182
+ value: "https://c.jufubao.cn/web/pb/qrcode/image?content=21337"
183
+ }
184
+ ],
185
+ },
186
+ };
187
+ if(orderStatus !== '3000') {
188
+ delete result.app;
189
+ delete result.code;
190
+ }
191
+
192
+ cb(result);
193
+ },
194
+
195
+ /**
196
+ * @description 监听事件变化
197
+ * @param value {object} 业务组件对象自己
198
+ */
199
+ init(value) {
200
+ this.order_id = this.$xdUniHelper.parseURL()['params'].order_id || '470274149596532736';
201
+ this.detail = getContainerPropsValue(value, 'content.custom_btn_url', {label: '', value: ''}).value;
202
+ this.index = this.settings.index;
203
+ this.bgColor = getContainerPropsValue(value, 'content.bgColor', '#EC4D71');
204
+ this.maxTime = Number(getContainerPropsValue(value, 'content.maxTime', 5));
205
+ this.statusUrl = getContainerPropsValue(value, 'content.order_status_url', null);
206
+ this.xdMySuccess = this.$xdUniHelper.randomChar(20);
207
+ this.packageData = true;
208
+ this.background = this.pageAttr.configs['background_color'];
209
+
210
+ },
211
+ /**
212
+ * @description 获取订单详情,轮询时间使用2n次方递增方式
213
+ * @param resolve 回调函数
214
+ */
215
+ getStatus(resolve) {
216
+ if(this.view && 0) {
217
+ this.viewTrue(resolve);
218
+ return
219
+ }
220
+
221
+ //当前请求次未获取到参数返回正在进行中
222
+ if(this.params === null && this.packageData === false) {
223
+ return resolve({
224
+ icon: 'iconshijian',
225
+ iconSize: 80, //图标大小
226
+ iconColor: '#333', //图标颜色
227
+ orderName: '订单处理中', //订单状态名称
228
+ orderStatus: '3001', //订单状态名称,
229
+ });
230
+ }
231
+
232
+ console.log('getOrderStatus.start', this.statusUrl);
233
+ getNoUrl({url:this.statusUrl, params: {...this.params, order_id: this.order_id}})
234
+ .then(([res])=>{
235
+ console.log(res);
236
+ resolve(this.handleOrderResolve(res));
237
+ })
238
+ .catch(error => {
239
+ console.error(error);
240
+ this.$xdLog.catch(error)
241
+ })
242
+ },
243
+
244
+ handleOrderResolve({info, order}){
245
+ let icon = "iconshijian";
246
+ let iconColor = '#333';
247
+ let btn = [{'label': '返回首页', type: 'info', radius: '10rpx', value: 1}];
248
+ if(order.orderStatus == '3000'){
249
+ icon = "icondingdanwancheng";
250
+ iconColor = "green";
251
+ btn = btn.concat([
252
+ {
253
+ label: getContainerPropsValue(this.container, 'content.custom_btn_name'),
254
+ type: 'primary',
255
+ radius: '12rpx',
256
+ value: 2
257
+ }
258
+ ])
259
+ }else if(order.orderStatus == '3002'){
260
+ iconColor = "red";
261
+ icon = "icongerenzhongxinchufabaocuo";
262
+ btn = btn.concat([
263
+ {'label': '重新支付', type: 'info', radius: '10rpx', value: 3},
264
+ ])
265
+ }
266
+
267
+ let result = {
268
+ //基础信息
269
+ info: {
270
+ descTitle: info.descTitle,
271
+ desc: info.desc,
272
+ tips: order.tips,
273
+ btn: btn,
274
+ },
275
+
276
+ //订单信息
277
+ order: {
278
+ icon: icon,
279
+ iconSize: 80, //图标大小
280
+ iconColor: iconColor, //图标颜色
281
+ orderName: order.orderName, //订单状态名称
282
+ orderStatus: order.orderStatus, //订单状态名称,
283
+ content: '',
284
+ tips: order.tips,
285
+ },
286
+ };
287
+ return result;
288
+ },
289
+
290
+ handleOnBtnClick({btn}) {
291
+ if (btn['value'] === 1) {
292
+ this.$xdUniHelper.redirectTo({
293
+ url: this.index
294
+ }, false)
295
+ }
296
+ if (btn['value'] === 2) {
297
+ let other = this.$xdUniHelper.jsonToParams({...this.params, order_id: this.order_id});
298
+ this.$xdUniHelper.redirectTo({
299
+ url: `${this.detail}?${other}`
300
+ })
301
+ }
302
+ if (btn['value'] === 3) {
303
+ this.$xdUniHelper.navigateBack();
304
+ }
305
+ },
306
+
307
+ /**
308
+ * @description 页面返回按钮
309
+ * @param options
310
+ */
311
+ onJfbBack(options) {
312
+ this.$xdUniHelper.navigateBack()
313
+ },
314
+ }
315
+ }
316
+
317
+ </script>
318
+
319
+ <style scoped lang="less">
320
+ @import "./JfbBaseSuccessLess.less";
321
+
322
+ .jfb-base-success {
323
+ &__body {
324
+
325
+ }
326
+ }
327
+ </style>
@@ -0,0 +1,57 @@
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-success {
16
+ border: 1px dashed rgba(0, 0, 0, 0);
17
+ box-sizing: border-box;
18
+
19
+ &.editx {
20
+ position: relative;
21
+ border: 1px dashed blue;
22
+ box-sizing: border-box;
23
+
24
+ }
25
+
26
+ &:hover {
27
+ border: 1px dashed blue;
28
+ }
29
+
30
+
31
+ &__edit {
32
+ cursor: pointer;
33
+ position: absolute;
34
+ right: unit(0, rpx);
35
+ top: unit(-52, rpx);
36
+ height: unit(50, rpx);
37
+ line-height: unit(50, rpx);
38
+ display: flex;
39
+ justify-content: center;
40
+ align-items: center;
41
+ background: rgba(0, 0, 0, .6);
42
+ border-radius: unit(10, rpx);
43
+ box-shadow: 0 0 10px rbga(0, 0, 0, 0.3);
44
+ color: #fff;
45
+ font-size: unit(22, rpx);
46
+
47
+ &-icon{
48
+ padding: 0 unit(20, rpx);
49
+ }
50
+
51
+ &.editx {
52
+ box-sizing: border-box;
53
+
54
+ }
55
+ }
56
+ }
57
+ //end