jufubao-base 1.0.19 → 1.0.20

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.19",
3
+ "version": "1.0.20",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -12,6 +12,7 @@
12
12
  "init.entry": "node ./build/commands/entry.init.js",
13
13
  "update": "node ./commands/update.pack.js",
14
14
  "create": "node ./commands/create.pack.js",
15
+ "change": "node ./commands/change.pack",
15
16
  "release": "node ./commands/npmignore && npm publish",
16
17
  "init": "cross-env isLocal=false node ./commands.js",
17
18
  "init.local": "cross-env isLocal=true node ./commands.js",
@@ -169,7 +169,7 @@ export default {
169
169
  XdBus.send('onSelectPackage', {
170
170
  containerId: this.containerId,
171
171
  Attr: AttrObj,
172
- container: this.container
172
+ container: this.$xdUniHelper.cloneDeep(this.container)
173
173
  });
174
174
 
175
175
  //绑定选中插件事件
@@ -169,7 +169,7 @@ export default {
169
169
  XdBus.send('onSelectPackage', {
170
170
  containerId: this.containerId,
171
171
  Attr: AttrObj,
172
- container: this.container
172
+ container: this.$xdUniHelper.cloneDeep(this.container)
173
173
  });
174
174
 
175
175
  //绑定选中插件事件
@@ -169,7 +169,7 @@ export default {
169
169
  XdBus.send('onSelectPackage', {
170
170
  containerId: this.containerId,
171
171
  Attr: AttrObj,
172
- container: this.container
172
+ container: this.$xdUniHelper.cloneDeep(this.container)
173
173
  });
174
174
 
175
175
  //绑定选中插件事件
@@ -169,7 +169,7 @@ export default {
169
169
  XdBus.send('onSelectPackage', {
170
170
  containerId: this.containerId,
171
171
  Attr: AttrObj,
172
- container: this.container
172
+ container: this.$xdUniHelper.cloneDeep(this.container)
173
173
  });
174
174
 
175
175
  //绑定选中插件事件
@@ -169,7 +169,7 @@ export default {
169
169
  XdBus.send('onSelectPackage', {
170
170
  containerId: this.containerId,
171
171
  Attr: AttrObj,
172
- container: this.container
172
+ container: this.$xdUniHelper.cloneDeep(this.container)
173
173
  });
174
174
 
175
175
  //绑定选中插件事件
@@ -169,7 +169,7 @@ export default {
169
169
  XdBus.send('onSelectPackage', {
170
170
  containerId: this.containerId,
171
171
  Attr: AttrObj,
172
- container: this.container
172
+ container: this.$xdUniHelper.cloneDeep(this.container)
173
173
  });
174
174
 
175
175
  //绑定选中插件事件
@@ -169,7 +169,7 @@ export default {
169
169
  XdBus.send('onSelectPackage', {
170
170
  containerId: this.containerId,
171
171
  Attr: AttrObj,
172
- container: this.container
172
+ container: this.$xdUniHelper.cloneDeep(this.container)
173
173
  });
174
174
 
175
175
  //绑定选中插件事件
@@ -0,0 +1,82 @@
1
+ 'use strict';
2
+ export default {
3
+ style: [],
4
+ advanced: [],
5
+ content: [
6
+ {
7
+ label: '', //label
8
+ ele: 'slot', //package 名称
9
+ slot: 'is_reference_title',
10
+ },
11
+ {
12
+ label: '背景颜色:', //label
13
+ ele: 'xd-color', //package 名称
14
+ valueKey: 'bgColor', //form[valueKey]
15
+ value: '#f9f9f9', //v-model
16
+ placeholder: '请选择背景颜色',
17
+ setting: {
18
+ isAlpha: false
19
+ },
20
+ classNmae: 'input80', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
21
+ rules: [
22
+ {
23
+ required: true,
24
+ message: '请选择背景颜色',
25
+ trigger: 'change'
26
+ },
27
+ ]
28
+ },
29
+ {
30
+ label: '菜单文字颜色:', //label
31
+ ele: 'xd-color', //package 名称
32
+ valueKey: 'color', //form[valueKey]
33
+ value: '#333', //v-model
34
+ setting: {
35
+ isAlpha: false
36
+ },
37
+ placeholder: '请选择菜单文字颜色',
38
+ classNmae: 'input80', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
39
+ },
40
+ {
41
+ label: '菜单文字选中颜色:', //label
42
+ ele: 'xd-color', //package 名称
43
+ valueKey: 'selectedColor', //form[valueKey]
44
+ setting: {
45
+ isAlpha: false
46
+ },
47
+ value: '#c00', //v-model
48
+ placeholder: '请选择菜单文字选中颜色',
49
+ classNmae: 'input80', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
50
+ },
51
+ {
52
+ label: '菜单配置:', //label
53
+ ele: 'xd-footer-setting', //package 名称
54
+ valueKey: 'footer-setting', //form[valueKey]
55
+ value: [],
56
+ setting: {
57
+ router: XdBus.getParentData('getPagesTree'),
58
+ },
59
+ handleCustom({action,data}){
60
+ console.log(`handleCustom.${action}`, data);
61
+ if(action === 'number') {
62
+ XdBus.getParentApi('getOptionsNoticeNumber')()
63
+ .then(res => {
64
+ data.cb(res.list)
65
+ })
66
+ .catch();
67
+ }
68
+ },
69
+ inline: false,
70
+ notice: '设置底部菜单的链接地址、标题(最多<sapn style="color: red">五个汉字</sapn>)、ICON图标(<a href="https://www.iconfont.cn/manage/index?spm=a313x.7781069.1998910419.db775f1f3&manage_type=myprojects&projectId=3378319&keyword=&project_type=&page=" style="color: blue" target="_blank">ICONFONT库</a>)、ICON大小(单位:<sapn style="color: red">像素</sapn>)和是否有消息数量显示(无数量显示可以不填写)',
71
+ rules: [
72
+ {required: true, message: '请添加内容', trigger: 'change'},
73
+ ],
74
+ },
75
+ {
76
+ label: '', //label
77
+ ele: 'slot', //package 名称
78
+ slot: 'is_reference',
79
+ },
80
+ ],
81
+ };
82
+
@@ -13,78 +13,149 @@
13
13
  <view class="jfb-base-footer__edit-icon" @click="delEdit">删除</view>
14
14
  </view>
15
15
  <!-- #endif -->
16
- <view class="jfb-base-footer__body">
17
- <view>测试插件( {{containerId}} )</view>
16
+ <view class="jfb-base-footer__body" :style="{height:height + 'rpx'}">
17
+ <xd-footer-bar
18
+ v-if="list !== null"
19
+ :height="height"
20
+ :tabbar="list"
21
+ :view="view"
22
+ :styles="styles"
23
+ :key="footerBarKey"
24
+ ></xd-footer-bar>
18
25
  </view>
19
26
  </view>
20
27
  </template>
21
28
 
22
29
  <script>
23
30
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
31
+ import XdFooterBar from "@/components/XdFooterBar/XdFooterBar";
24
32
  import { jfbRootExec } from "@/utils/xd.event";
25
33
  import JfbBaseFooterMixin from "./JfbBaseFooterMixin";
26
- import { getContainerPropsValue } from "@/utils/xd.base";
34
+ import {getNoUrl} from "@/utils/nourl";
35
+ import {
36
+ getContainerPropsValue,
37
+ getComponentAttr
38
+ } from "@/utils/xd.base";
27
39
  export default {
28
40
  name: "JfbBaseFooter",
29
41
  components: {
30
- XdFontIcon
42
+ XdFontIcon,
43
+ XdFooterBar
31
44
  },
32
45
  mixins: [
33
46
  JfbBaseFooterMixin
34
47
  ],
35
48
  data() {
36
49
  return {
37
-
38
- //todo
50
+ height: 0,
51
+ list: null,
52
+ view: false,
53
+ numObj: {},
54
+ footerBarKey: 'footerBarKey', //刷新
55
+
39
56
  }
40
57
  },
41
58
  watch: {
42
59
  container(value) {
43
- this.init(value)
60
+ this.init(value);
61
+ this.getNumber()
62
+ this.footerBarKey = this.$xdUniHelper.randomChar(20);
44
63
  }
45
64
  },
46
65
  created() {
66
+ this.view = window['jfbConfingView'] === 'preview';
67
+
68
+ //设置高度
69
+ if(window['jfbConfingView'] === 'preview') {
70
+ this.height = getComponentAttr(this.componentAttr, 'height') - 4;
71
+ }
72
+ else {
73
+ this.height = getComponentAttr(this.componentAttr, 'height');
74
+ }
75
+
47
76
  this.init(this.container);
48
-
49
- //todo
50
77
  },
51
78
  methods: {
52
79
  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()
80
+ this.getNumber()
63
81
  },
82
+
64
83
  /**
65
- * @description 监听事件变化
66
- * @param container {object} 业务组件对象自己
84
+ * @description 从后台获取消息数量
67
85
  */
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)
86
+ getNumber(){
87
+ let bar = getContainerPropsValue(this.container, 'content.footer-setting', []);
88
+ let params = [];
89
+ bar.map((item, index) => {
90
+ if(item.api) {
91
+ let urlObj = this.$xdUniHelper.parseURL(item.api);
92
+ params.push({
93
+ url: urlObj.path,
94
+ index: index,
95
+ params: {
96
+ ...urlObj.params,
97
+ }
98
+ })
99
+ }
100
+ });
101
+
102
+ //预览模式
103
+ if(this.view) {
104
+ this.setNumber(params, params.map(item=>{
105
+ return {
106
+ num: [9,99,199][this.$xdUniHelper.random(0,2)]
107
+ }
108
+ }));
109
+ return;
110
+ }
111
+
112
+ //打包模式
113
+ getNoUrl(params)
114
+ .then(res=>{
115
+ this.setNumber(params, res);
116
+ })
117
+ .catch(error=>{
118
+ console.log(error)
119
+ });
79
120
  },
80
- onJfbShow(options) {
81
- console.log('event.onJfbShow', options)
82
- },
83
- onJfbHide(options) {
84
- console.log('event.onJfbHide', options)
121
+
122
+ /**
123
+ * @description 设置系统消息数量
124
+ * @param params {Array} 请求参数
125
+ * @param result {Array} 返回结果
126
+ */
127
+ setNumber(params, result){
128
+ let index = {};
129
+ params.map((item, idx)=>{
130
+ if(result[idx]['num'] > 99) result[idx]['num'] = '99+';
131
+ index[item.index] = result[idx]['num'];
132
+ });
133
+ this.numObj = index;
134
+ this.init(this.container);
135
+ this.footerBarKey = this.$xdUniHelper.randomChar(20);
85
136
  },
86
- onJfbBack(options) {
87
- console.log('event.onJfbBack', options)
137
+
138
+ /**
139
+ * @description 监听事件变化
140
+ * @param value {object} 业务组件对象自己
141
+ */
142
+ init(value) {
143
+ //设置底部菜单
144
+ let bar = getContainerPropsValue(value, 'content.footer-setting', []);
145
+ this.list = {
146
+ bgColor: getContainerPropsValue(value, 'content.bgColor', '#fff'),
147
+ selectedColor: getContainerPropsValue(value, 'content.selectedColor', '#fff'),
148
+ color: getContainerPropsValue(value, 'content.color', '#333'),
149
+ list: bar.map((item,index)=>{
150
+ return {
151
+ name: item.name,
152
+ icon: item.icon,
153
+ path: item.path.value,
154
+ size: item.size,
155
+ num: this.numObj[index] ? this.numObj[index]: 0 ,
156
+ }
157
+ }),
158
+ };
88
159
  },
89
160
  }
90
161
  }
@@ -96,7 +167,7 @@
96
167
 
97
168
  .jfb-base-footer {
98
169
  &__body{
99
-
170
+ box-sizing: border-box;
100
171
  }
101
172
  }
102
173
  </style>
@@ -1,5 +1,9 @@
1
1
  'use strict';
2
2
 
3
+ //@AttrImport
4
+ import Attr from "./Attr";
5
+ //@EndAttrImport
6
+
3
7
  import {getContainerPropsValue} from "@/utils/xd.base";
4
8
  export default {
5
9
  props: {
@@ -88,6 +92,10 @@ export default {
88
92
  containerId: null, //容器ID
89
93
  //#ifdef H5
90
94
 
95
+ //@AttrData
96
+ Attr, //对外开发编辑属性
97
+ //@EndAttrData
98
+
91
99
  active: false, //是否选择当前状态
92
100
  isEditx: true, //当前为Editx模式
93
101
  edit: false, //是否开启编辑模式
@@ -161,7 +169,7 @@ export default {
161
169
  XdBus.send('onSelectPackage', {
162
170
  containerId: this.containerId,
163
171
  Attr: AttrObj,
164
- container: this.container
172
+ container: this.$xdUniHelper.cloneDeep(this.container)
165
173
  });
166
174
 
167
175
  //绑定选中插件事件
@@ -169,7 +169,7 @@ export default {
169
169
  XdBus.send('onSelectPackage', {
170
170
  containerId: this.containerId,
171
171
  Attr: AttrObj,
172
- container: this.container
172
+ container: this.$xdUniHelper.cloneDeep(this.container)
173
173
  });
174
174
 
175
175
  //绑定选中插件事件
@@ -169,7 +169,7 @@ export default {
169
169
  XdBus.send('onSelectPackage', {
170
170
  containerId: this.containerId,
171
171
  Attr: AttrObj,
172
- container: this.container
172
+ container: this.$xdUniHelper.cloneDeep(this.container)
173
173
  });
174
174
 
175
175
  //绑定选中插件事件
@@ -169,7 +169,7 @@ export default {
169
169
  XdBus.send('onSelectPackage', {
170
170
  containerId: this.containerId,
171
171
  Attr: AttrObj,
172
- container: this.container
172
+ container: this.$xdUniHelper.cloneDeep(this.container)
173
173
  });
174
174
 
175
175
  //绑定选中插件事件
@@ -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,277 @@
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
+ })
237
+ .catch(error => {
238
+ console.error(error);
239
+ this.$xdLog.catch(error)
240
+ })
241
+ },
242
+
243
+ handleOnBtnClick({btn}) {
244
+ if (btn['value'] === 1) {
245
+ this.$xdUniHelper.redirectTo({
246
+ url: this.index
247
+ }, false)
248
+ }
249
+ if (btn['value'] === 2) {
250
+ let other = this.$xdUniHelper.jsonToParams({...this.params, order_id: this.order_id});
251
+ this.$xdUniHelper.redirectTo({
252
+ url: `${this.detail}?${other}`
253
+ })
254
+ }
255
+ },
256
+
257
+ /**
258
+ * @description 页面返回按钮
259
+ * @param options
260
+ */
261
+ onJfbBack(options) {
262
+ this.$xdUniHelper.navigateBack()
263
+ },
264
+ }
265
+ }
266
+
267
+ </script>
268
+
269
+ <style scoped lang="less">
270
+ @import "./JfbBaseSuccessLess.less";
271
+
272
+ .jfb-base-success {
273
+ &__body {
274
+
275
+ }
276
+ }
277
+ </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
@@ -0,0 +1,184 @@
1
+ 'use strict';
2
+
3
+ //@AttrImport
4
+ import Attr from "./Attr";
5
+ //@EndAttrImport
6
+
7
+ import {getContainerPropsValue} from "@/utils/xd.base";
8
+ export default {
9
+ props: {
10
+ /**
11
+ * @description 插件在页面中到唯一ID
12
+ */
13
+ cid:{
14
+ type: null|String|Number,
15
+ default: null,
16
+ },
17
+ /**
18
+ * @description 业务插件相关数据集合
19
+ */
20
+ container:{
21
+ type: Object,
22
+ default() {
23
+ return {}
24
+ }
25
+ },
26
+ /**
27
+ * @description 页面框架属性
28
+ */
29
+ layoutInfo: {
30
+ type: Object,
31
+ default() {
32
+ return {}
33
+ }
34
+ },
35
+ /**
36
+ * @description 页面属性
37
+ */
38
+ pageAttr: {
39
+ type: Object,
40
+ default() {
41
+ return {}
42
+ }
43
+ },
44
+ /**
45
+ * @description 业务插件元素属性(插件管理时候填写属性)
46
+ */
47
+ componentAttr: {
48
+ type: Object|Array,
49
+ default() {
50
+ return {}
51
+ }
52
+ },
53
+ /**
54
+ * @description 业务插件所属插件库属性(业务插件库)
55
+ */
56
+ appAttr: {
57
+ type: Object|Array,
58
+ default() {
59
+ return {}
60
+ }
61
+ },
62
+ /**
63
+ * @description 项目配置
64
+ */
65
+ settings: {
66
+ type: Object,
67
+ default() {
68
+ return {}
69
+ }
70
+ },
71
+ /**
72
+ * @description 业务插件库所用风格属性
73
+ */
74
+ styles: {
75
+ type: Object || null,
76
+ default() {
77
+ return {}
78
+ }
79
+ },
80
+ /**
81
+ * @description 项目配置文件
82
+ */
83
+ projectAttr: {
84
+ type: Object || null,
85
+ default() {
86
+ return {}
87
+ }
88
+ }
89
+ },
90
+ data() {
91
+ return {
92
+ containerId: null, //容器ID
93
+ //#ifdef H5
94
+
95
+ //@AttrData
96
+ Attr, //对外开发编辑属性
97
+ //@EndAttrData
98
+
99
+ active: false, //是否选择当前状态
100
+ isEditx: true, //当前为Editx模式
101
+ edit: false, //是否开启编辑模式
102
+ // #endif
103
+ }
104
+ },
105
+ created() {
106
+ //设置插件cid
107
+ if (this.cid) {
108
+ this.containerId = this.cid;
109
+ } else {
110
+ this.containerId = this.$xdUniHelper.randomChar(20);
111
+ }
112
+
113
+ //#ifdef H5
114
+ //监听用户点击状态显示虚框
115
+ XdBus.addEvent('select', ({containerId}) => {
116
+ this.active = containerId === this.containerId;
117
+ });
118
+
119
+ //业务面板选中插件操作
120
+ XdBus.addEvent('onBoardSelect', ({containerId}) => {
121
+ if (containerId === this.containerId) {
122
+ this.handleSelect()
123
+ }
124
+ });
125
+ // #endif
126
+ },
127
+ methods: {
128
+
129
+ /**
130
+ * 检查插件是否加载成功
131
+ */
132
+ onCheck() {
133
+ },
134
+
135
+ //#ifdef H5
136
+ /**
137
+ * @description 点击删除操作按钮
138
+ */
139
+ delEdit(){
140
+ XdBus.send('onDelPackage', {
141
+ containerId: this.containerId,
142
+ componentAtrr: this.componentAtrr,
143
+ cid: this.cid,
144
+ container: this.container
145
+ })
146
+ },
147
+ //#endif
148
+
149
+ /**
150
+ * @description 点击选择插件显示边框
151
+ */
152
+ handleSelect() {
153
+ //#ifdef H5
154
+ if (this.active) return;
155
+ this.active = true;
156
+ let AttrObj = this.$xdUniHelper.checkVarType(Attr) === 'object' ?
157
+ Attr: { style: [], advanced: [], content: []};
158
+ console.log('handleSelect.Attr', AttrObj);
159
+
160
+ //设置已绑定数据
161
+ Object.keys(AttrObj).map(type=>{
162
+ AttrObj[type].map(item=>{
163
+ if(item.value !== undefined) item.value = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
164
+ if(item.defaultValue !== undefined) item.defaultValue = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
165
+ })
166
+ });
167
+
168
+ //发送点击组件事件
169
+ XdBus.send('onSelectPackage', {
170
+ containerId: this.containerId,
171
+ Attr: AttrObj,
172
+ container: this.$xdUniHelper.cloneDeep(this.container)
173
+ });
174
+
175
+ //绑定选中插件事件
176
+ XdBus.message('select', {
177
+ containerId: this.containerId,
178
+ })
179
+ //#endif
180
+ },
181
+
182
+
183
+ }
184
+ }
@@ -169,7 +169,7 @@ export default {
169
169
  XdBus.send('onSelectPackage', {
170
170
  containerId: this.containerId,
171
171
  Attr: AttrObj,
172
- container: this.container
172
+ container: this.$xdUniHelper.cloneDeep(this.container)
173
173
  });
174
174
 
175
175
  //绑定选中插件事件
@@ -161,7 +161,7 @@ export default {
161
161
  XdBus.send('onSelectPackage', {
162
162
  containerId: this.containerId,
163
163
  Attr: AttrObj,
164
- container: this.container
164
+ container: this.$xdUniHelper.cloneDeep(this.container)
165
165
  });
166
166
 
167
167
  //绑定选中插件事件
@@ -161,7 +161,7 @@ export default {
161
161
  XdBus.send('onSelectPackage', {
162
162
  containerId: this.containerId,
163
163
  Attr: AttrObj,
164
- container: this.container
164
+ container: this.$xdUniHelper.cloneDeep(this.container)
165
165
  });
166
166
 
167
167
  //绑定选中插件事件
@@ -161,7 +161,7 @@ export default {
161
161
  XdBus.send('onSelectPackage', {
162
162
  containerId: this.containerId,
163
163
  Attr: AttrObj,
164
- container: this.container
164
+ container: this.$xdUniHelper.cloneDeep(this.container)
165
165
  });
166
166
 
167
167
  //绑定选中插件事件