jufubao-base 1.0.20 → 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.
- package/package.json +1 -1
- package/src/components/JfbBaseAfterOrderList/Api.js +60 -0
- package/src/components/JfbBaseAfterOrderList/Attr.js +154 -0
- package/src/components/JfbBaseAfterOrderList/JfbBaseAfterOrderList.vue +203 -0
- package/src/components/JfbBaseAfterOrderList/JfbBaseAfterOrderListLess.less +57 -0
- package/src/components/JfbBaseAfterOrderList/JfbBaseAfterOrderListMixin.js +222 -0
- package/src/components/JfbBaseBlock/JfbBaseBlock.vue +20 -0
- package/src/components/JfbBaseBlock/JfbBaseBlockMixin.js +41 -3
- package/src/components/JfbBaseCard/JfbBaseCardMixin.js +41 -3
- package/src/components/JfbBaseCardBind/JfbBaseCardBindMixin.js +41 -3
- package/src/components/JfbBaseCardDetail/JfbBaseCardDetailMixin.js +41 -3
- package/src/components/JfbBaseCardInfo/JfbBaseCardInfoMixin.js +41 -3
- package/src/components/JfbBaseCardMy/JfbBaseCardMyMixin.js +41 -3
- package/src/components/JfbBaseCardShift/JfbBaseCardShiftMixin.js +41 -3
- package/src/components/JfbBaseFooter/JfbBaseFooterMixin.js +41 -3
- package/src/components/JfbBaseLine/JfbBaseLineMixin.js +41 -3
- package/src/components/JfbBaseLogin/JfbBaseLogin.vue +172 -51
- package/src/components/JfbBaseLogin/JfbBaseLoginMixin.js +41 -3
- package/src/components/JfbBaseMy/Api.js +60 -0
- package/src/components/JfbBaseMy/Attr.js +54 -0
- package/src/components/JfbBaseMy/JfbBaseMy.vue +262 -0
- package/src/components/JfbBaseMy/JfbBaseMyLess.less +57 -0
- package/src/components/JfbBaseMy/JfbBaseMyMixin.js +222 -0
- package/src/components/JfbBaseOrderList/Api.js +60 -0
- package/src/components/JfbBaseOrderList/Attr.js +154 -0
- package/src/components/JfbBaseOrderList/JfbBaseOrderList.vue +285 -0
- package/src/components/JfbBaseOrderList/JfbBaseOrderListLess.less +57 -0
- package/src/components/JfbBaseOrderList/JfbBaseOrderListMixin.js +222 -0
- package/src/components/JfbBaseSetPwd/JfbBaseSetPwdMixin.js +41 -3
- package/src/components/JfbBaseSuccess/JfbBaseSuccess.vue +51 -1
- package/src/components/JfbBaseSuccess/JfbBaseSuccessMixin.js +41 -3
- package/src/components/JfbBaseTestApi/JfbBaseTestApiMixin.js +41 -3
- package/src/components/JfbBaseTestBody/JfbBaseTestBodyMixin.js +36 -2
- package/src/components/JfbBaseTestBottom/JfbBaseTestBottomMixin.js +36 -2
- package/src/components/JfbBaseTestTop/JfbBaseTestTopMixin.js +36 -2
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
style: [],
|
|
5
|
+
advanced: [],
|
|
6
|
+
content: [
|
|
7
|
+
//文本信息
|
|
8
|
+
{
|
|
9
|
+
label: '标题名称:', //label
|
|
10
|
+
ele: 'el-input', //package 名称
|
|
11
|
+
type: 'text',
|
|
12
|
+
valueKey: 'title', //form[valueKey]
|
|
13
|
+
value: '', //v-model
|
|
14
|
+
placeholder: '请输入标题名称',
|
|
15
|
+
classNmae: 'input40', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
|
|
16
|
+
disabled: true,
|
|
17
|
+
rules: [
|
|
18
|
+
{
|
|
19
|
+
required: true,
|
|
20
|
+
type: 'url',
|
|
21
|
+
message: '请输入域名地址',
|
|
22
|
+
trigger: 'blur'
|
|
23
|
+
},
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
//远程获取内容选择
|
|
28
|
+
{
|
|
29
|
+
label: '跳转路径:', //label
|
|
30
|
+
ele: 'xd-select-list', //package 名称
|
|
31
|
+
valueKey: 'jumpToLink', //form[valueKey]
|
|
32
|
+
value: '', //v-model
|
|
33
|
+
placeholder: '请选择加盟商',
|
|
34
|
+
multiple: false, //多选
|
|
35
|
+
collapseTags: false,
|
|
36
|
+
remoteApi: '/api/editx/pages',
|
|
37
|
+
remote: true,
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
//本地固定内容选择
|
|
41
|
+
{
|
|
42
|
+
label: '选择内容:', //label
|
|
43
|
+
ele: 'xd-select-list', //package 名称
|
|
44
|
+
valueKey: 'select', //form[valueKey]
|
|
45
|
+
value: '', //v-model
|
|
46
|
+
placeholder: '请选择选择内容',
|
|
47
|
+
multiple: false, //多选
|
|
48
|
+
remote: false,
|
|
49
|
+
list: [
|
|
50
|
+
{"label": "订单详情", "value": '/main/order/order'},
|
|
51
|
+
{"label": "购物车详情", "value": '/main/cart/cart'},
|
|
52
|
+
{"label": "商品详情", "value": '/main/product/product'},
|
|
53
|
+
{"label": "商品分类", "value": '/main/producttype/producttype'},
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
//本地固定单选选择
|
|
58
|
+
{
|
|
59
|
+
label: '单选列表(固定):', //label
|
|
60
|
+
ele: 'xd-radio', //package 名称
|
|
61
|
+
valueKey: 'radio_status_list', //form[valueKey]
|
|
62
|
+
value: 6, //v-model
|
|
63
|
+
disabled: true,
|
|
64
|
+
rules: [
|
|
65
|
+
{required: true, message: '请选择', trigger: ['blur', 'change']}
|
|
66
|
+
],
|
|
67
|
+
list: [
|
|
68
|
+
{"label": "万利达集团", "value": 4},
|
|
69
|
+
{"label": "中国联通", "value": 5},
|
|
70
|
+
{"label": "中国移动", "value": 6},
|
|
71
|
+
{"label": "味多美", "value": 7},
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
//远程固定单选选择
|
|
76
|
+
{
|
|
77
|
+
label: '单选列表(固定):', //label
|
|
78
|
+
ele: 'xd-radio', //package 名称
|
|
79
|
+
valueKey: 'radio_status_list', //form[valueKey]
|
|
80
|
+
value: 6, //v-model
|
|
81
|
+
disabled: false,
|
|
82
|
+
remoteApi: '/api/editx/pages',
|
|
83
|
+
remote: true,
|
|
84
|
+
rules: [
|
|
85
|
+
{required: true, message: '请选择', trigger: ['blur', 'change']}
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
//本地固定多选选择
|
|
90
|
+
{
|
|
91
|
+
label: '多选列表(固定):', //label
|
|
92
|
+
ele: 'xd-check', //package 名称
|
|
93
|
+
valueKey: 'xd-check_list', //form[valueKey]
|
|
94
|
+
value: 6, //v-model
|
|
95
|
+
disabled: true,
|
|
96
|
+
rules: [
|
|
97
|
+
{required: true, message: '请选择', trigger: ['blur', 'change']}
|
|
98
|
+
],
|
|
99
|
+
list: [
|
|
100
|
+
{"label": "万利达集团", "value": 4},
|
|
101
|
+
{"label": "中国联通", "value": 5},
|
|
102
|
+
{"label": "中国移动", "value": 6},
|
|
103
|
+
{"label": "味多美", "value": 7},
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
//远程多选选选择
|
|
108
|
+
{
|
|
109
|
+
label: '多选列表:', //label
|
|
110
|
+
ele: 'xd-check', //package 名称
|
|
111
|
+
valueKey: 'xd-check_remote-list', //form[valueKey]
|
|
112
|
+
value: 6, //v-model
|
|
113
|
+
disabled: false,
|
|
114
|
+
remoteApi: '/api/editx/pages',
|
|
115
|
+
remote: true,
|
|
116
|
+
rules: [
|
|
117
|
+
{required: true, message: '请选择', trigger: ['blur', 'change']}
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
//状态(二选一)单选选择
|
|
122
|
+
{
|
|
123
|
+
label: '状态(二选一):', //label
|
|
124
|
+
ele: 'xd-radio-status', //package 名称
|
|
125
|
+
valueKey: 'radio_status', //form[valueKey]
|
|
126
|
+
value: 'Y', //v-model
|
|
127
|
+
isall: true,
|
|
128
|
+
disabled: true,
|
|
129
|
+
backValueType: '', //返回值类型 1=>返回(Y,N)2=> [true|false] 3=>[1,0] 4=>[1,2]
|
|
130
|
+
placeholder: '请选择',
|
|
131
|
+
list: 'status', //status=>状态 best=>推荐 associate=>关联 yes=>是否 open=> 是否开启 check=>审核
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
//文本信息
|
|
135
|
+
{
|
|
136
|
+
label: '标题名称:', //label
|
|
137
|
+
ele: 'el-input', //package 名称
|
|
138
|
+
type: 'text',
|
|
139
|
+
valueKey: 'title', //form[valueKey]
|
|
140
|
+
value: '', //v-model
|
|
141
|
+
placeholder: '请输入标题名称',
|
|
142
|
+
classNmae: 'input40', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
|
|
143
|
+
disabled: true,
|
|
144
|
+
rules: [
|
|
145
|
+
{
|
|
146
|
+
required: true,
|
|
147
|
+
type: 'url',
|
|
148
|
+
message: '请输入域名地址',
|
|
149
|
+
trigger: 'blur'
|
|
150
|
+
},
|
|
151
|
+
]
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
class="jfb-base-order-list"
|
|
4
|
+
@click="handleSelect"
|
|
5
|
+
:class="{ editx : isEditx && active }"
|
|
6
|
+
>
|
|
7
|
+
<!--#ifdef H5-->
|
|
8
|
+
<view
|
|
9
|
+
class="jfb-base-order-list__edit"
|
|
10
|
+
:class="{ editx : isEditx && active }"
|
|
11
|
+
v-if="isEditx && active"
|
|
12
|
+
>
|
|
13
|
+
<view class="jfb-base-order-list__edit-icon" @click="delEdit">删除</view>
|
|
14
|
+
</view>
|
|
15
|
+
<!-- #endif -->
|
|
16
|
+
<view class="jfb-base-order-list__body">
|
|
17
|
+
<xd-tab
|
|
18
|
+
:list="tabList"
|
|
19
|
+
v-model="status"
|
|
20
|
+
></xd-tab>
|
|
21
|
+
|
|
22
|
+
<view class="jfb-base-order-list__body-order">
|
|
23
|
+
<view
|
|
24
|
+
@click="handleToLink(item)"
|
|
25
|
+
class="jfb-base-order-list__body-order-item"
|
|
26
|
+
v-for="(item,index) in orderList"
|
|
27
|
+
:key="index">
|
|
28
|
+
<view class="jfb-base-order-list__body-order-item-title">
|
|
29
|
+
<view>订单编号:{{item.order_number}}</view>
|
|
30
|
+
<view :style="{color:item.status==='Y'?'#FF6E6E':'#999999'}">{{item.statusName}}</view>
|
|
31
|
+
</view>
|
|
32
|
+
<view class="jfb-base-order-list__body-order-item-content">
|
|
33
|
+
<image
|
|
34
|
+
:src="item.img"></image>
|
|
35
|
+
<view class="jfb-base-order-list__body-order-item-content-info">
|
|
36
|
+
<view class="jfb-base-order-list__body-order-item-content-info-name">{{item.name}}</view>
|
|
37
|
+
<view class="jfb-base-order-list__body-order-item-content-info-price">
|
|
38
|
+
<view :style="{fontSize:'32rpx',color: $mainColor}">
|
|
39
|
+
<xd-unit
|
|
40
|
+
:price="item.price"
|
|
41
|
+
:color="$mainColor"
|
|
42
|
+
:fontSize="32"
|
|
43
|
+
></xd-unit>
|
|
44
|
+
</view>
|
|
45
|
+
<view style="font-size: 28rpx;color: #999999;display: flex;align-items: center">
|
|
46
|
+
<xd-font-icon size="20" icon="icondanchuangguanbi_xian" style="margin-right: 8rpx"></xd-font-icon>
|
|
47
|
+
{{item.num}}
|
|
48
|
+
</view>
|
|
49
|
+
</view>
|
|
50
|
+
</view>
|
|
51
|
+
</view>
|
|
52
|
+
<view class="jfb-base-order-list__body-order-item-bottom">
|
|
53
|
+
<view>下单时间:{{item.created}}</view>
|
|
54
|
+
<view>合计:
|
|
55
|
+
<xd-unit
|
|
56
|
+
:price="item.total"
|
|
57
|
+
:color="$mainColor"
|
|
58
|
+
:fontSize="28"
|
|
59
|
+
></xd-unit> </view>
|
|
60
|
+
</view>
|
|
61
|
+
</view>
|
|
62
|
+
</view>
|
|
63
|
+
</view>
|
|
64
|
+
</view>
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<script>
|
|
68
|
+
import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
69
|
+
import XdTab from "@/components/XdTab/XdTab";
|
|
70
|
+
import XdUnit from "@/components/XdUnit/XdUnit";
|
|
71
|
+
import { jfbRootExec } from "@/utils/xd.event";
|
|
72
|
+
import JfbBaseOrderListMixin from "./JfbBaseOrderListMixin";
|
|
73
|
+
import { getContainerPropsValue } from "@/utils/xd.base";
|
|
74
|
+
export default {
|
|
75
|
+
name: "JfbBaseOrderList",
|
|
76
|
+
components: {
|
|
77
|
+
XdFontIcon,
|
|
78
|
+
XdTab,
|
|
79
|
+
XdUnit
|
|
80
|
+
},
|
|
81
|
+
mixins: [
|
|
82
|
+
JfbBaseOrderListMixin
|
|
83
|
+
],
|
|
84
|
+
data() {
|
|
85
|
+
return {
|
|
86
|
+
tabList: [
|
|
87
|
+
{
|
|
88
|
+
name: '全部',
|
|
89
|
+
value: '0'
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: '已取消',
|
|
93
|
+
value: '1'
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: '已完成',
|
|
97
|
+
value: '2'
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
orderList: [
|
|
101
|
+
{
|
|
102
|
+
order_number: 2121212121212121,
|
|
103
|
+
status: 'Y',
|
|
104
|
+
statusName: '已完成',
|
|
105
|
+
img: 'https://img.js.design/assets/img/6359fa51fac2712f7f3ecfa0.png#08226879b3e8fe27fc089d9723a2d22b',
|
|
106
|
+
name: '万达影院兑换码',
|
|
107
|
+
isCode: true,
|
|
108
|
+
type: '普通',
|
|
109
|
+
time: '2022-11-01 16:20:00',
|
|
110
|
+
price: 39,
|
|
111
|
+
num: 1,
|
|
112
|
+
total: 128,
|
|
113
|
+
created: '2022-12-12 12:43'
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
order_number: 2121212121212121,
|
|
117
|
+
status: 'Y',
|
|
118
|
+
statusName: '已完成',
|
|
119
|
+
img: 'https://img.js.design/assets/img/6359fa51fac2712f7f3ecfa0.png#08226879b3e8fe27fc089d9723a2d22b',
|
|
120
|
+
name: '万达影院兑换码',
|
|
121
|
+
isCode: false,
|
|
122
|
+
type: '普通',
|
|
123
|
+
time: '2022-11-01 16:20:00',
|
|
124
|
+
price: 39,
|
|
125
|
+
num: 1,
|
|
126
|
+
total: 128,
|
|
127
|
+
created: '2022-12-12 12:43'
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
detailPath: '',
|
|
131
|
+
status: null, //全部、已完成、已取消
|
|
132
|
+
//todo
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
watch: {
|
|
136
|
+
container(value) {
|
|
137
|
+
this.init(value)
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
created() {
|
|
141
|
+
this.init(this.container);
|
|
142
|
+
|
|
143
|
+
//todo
|
|
144
|
+
},
|
|
145
|
+
methods: {
|
|
146
|
+
onJfbLoad(options) {
|
|
147
|
+
|
|
148
|
+
// jfbRootExec('baiduUserLogin', {
|
|
149
|
+
|
|
150
|
+
// vm: this,// data: {
|
|
151
|
+
|
|
152
|
+
// account: 'gaoshiyong',// password: '123456789',// type: 3,// ...options
|
|
153
|
+
|
|
154
|
+
// }
|
|
155
|
+
|
|
156
|
+
// }).then().catch()
|
|
157
|
+
},
|
|
158
|
+
/**
|
|
159
|
+
* @description 监听事件变化
|
|
160
|
+
* @param container {object} 业务组件对象自己
|
|
161
|
+
*/
|
|
162
|
+
init(value) {
|
|
163
|
+
|
|
164
|
+
//this.bgcolor = getContainerPropsValue(value, 'content.bgcolor', '#fff');
|
|
165
|
+
this.detailPath = getContainerPropsValue(value, 'content.path')
|
|
166
|
+
this.status = this.$xdUniHelper.parseURL()['params'].status;
|
|
167
|
+
//this.height = getContainerPropsValue(value, 'content.height', 10);
|
|
168
|
+
},
|
|
169
|
+
handleToLink(item) {
|
|
170
|
+
this.$xdUniHelper.navigateTo({
|
|
171
|
+
path: `${this.detailPath}?id=${item.order_id}`
|
|
172
|
+
})
|
|
173
|
+
},
|
|
174
|
+
onJfbScroll(options) {
|
|
175
|
+
console.log('event.onJfbScroll', options)
|
|
176
|
+
},
|
|
177
|
+
onJfbReachBottom(options) {
|
|
178
|
+
console.log('event.onJfbReachBottom', options)
|
|
179
|
+
},
|
|
180
|
+
onJfbShow(options) {
|
|
181
|
+
console.log('event.onJfbShow', options)
|
|
182
|
+
},
|
|
183
|
+
onJfbHide(options) {
|
|
184
|
+
console.log('event.onJfbHide', options)
|
|
185
|
+
},
|
|
186
|
+
onJfbBack(options) {
|
|
187
|
+
console.log('event.onJfbBack', options)
|
|
188
|
+
},
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
</script>
|
|
193
|
+
|
|
194
|
+
<style scoped lang="less">
|
|
195
|
+
@import "./JfbBaseOrderListLess.less";
|
|
196
|
+
|
|
197
|
+
.jfb-base-order-list {
|
|
198
|
+
&__body{
|
|
199
|
+
&-order {
|
|
200
|
+
padding: unit(40, rpx) 0;
|
|
201
|
+
|
|
202
|
+
&-item {
|
|
203
|
+
padding: unit(40, rpx);
|
|
204
|
+
border-radius: unit(20, rpx);
|
|
205
|
+
box-shadow: 0px unit(4, rpx) unit(24, rpx) 0px rgba(154, 0, 255, 0.05);
|
|
206
|
+
margin: 0 unit(40, rpx) unit(24, rpx) unit(40, rpx);
|
|
207
|
+
|
|
208
|
+
&-title {
|
|
209
|
+
display: flex;
|
|
210
|
+
align-items: center;
|
|
211
|
+
justify-content: space-between;
|
|
212
|
+
font-size: unit(24, rpx);
|
|
213
|
+
border-bottom: unit(2, rpx) solid #eee;
|
|
214
|
+
|
|
215
|
+
& > view:first-child {
|
|
216
|
+
color: #333;
|
|
217
|
+
padding-bottom: unit(24, rpx);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
& > view:nth-child(2) {
|
|
221
|
+
padding-bottom: unit(24, rpx);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
&-content {
|
|
226
|
+
display: flex;
|
|
227
|
+
align-items: center;
|
|
228
|
+
padding: unit(30, rpx) 0;
|
|
229
|
+
|
|
230
|
+
image {
|
|
231
|
+
width: unit(160, rpx);
|
|
232
|
+
height: unit(160, rpx);
|
|
233
|
+
border-radius: unit(8, rpx);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
&-info {
|
|
237
|
+
flex: 1;
|
|
238
|
+
display: flex;
|
|
239
|
+
flex-direction: column;
|
|
240
|
+
justify-content: space-between;
|
|
241
|
+
margin-left: unit(24, rpx);
|
|
242
|
+
height: unit(160, rpx);
|
|
243
|
+
|
|
244
|
+
&-name {
|
|
245
|
+
font-size: unit(32, rpx);
|
|
246
|
+
color: #333333;
|
|
247
|
+
font-weight: 500;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
&-item {
|
|
251
|
+
font-size: unit(24, rpx);
|
|
252
|
+
color: #999999;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
&-price {
|
|
256
|
+
display: flex;
|
|
257
|
+
justify-content: space-between;
|
|
258
|
+
align-items: center;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
&-bottom {
|
|
264
|
+
display: flex;
|
|
265
|
+
align-items: center;
|
|
266
|
+
justify-content: space-between;
|
|
267
|
+
font-size: unit(24, rpx);
|
|
268
|
+
border-top: unit(2, rpx) solid #eee;
|
|
269
|
+
|
|
270
|
+
& > view:first-child {
|
|
271
|
+
color: #999;
|
|
272
|
+
padding-top: unit(24, rpx);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
& > view:nth-child(2) {
|
|
276
|
+
padding-top: unit(24, rpx);
|
|
277
|
+
display: flex;
|
|
278
|
+
align-items: center;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
</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-order-list {
|
|
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,222 @@
|
|
|
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
|
+
mainColor: '',
|
|
106
|
+
successColor: '',
|
|
107
|
+
warningColor: '',
|
|
108
|
+
subMainColor: '',
|
|
109
|
+
infoColor: '',
|
|
110
|
+
defaultColor: '',
|
|
111
|
+
dangerColor: ''
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
created() {
|
|
115
|
+
|
|
116
|
+
//@AttrDataCreated
|
|
117
|
+
this.Attr = this.$xdUniHelper.customClone(Attr);
|
|
118
|
+
//@EndAttrDataCreated
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
//设置插件cid
|
|
122
|
+
if (this.cid) {
|
|
123
|
+
this.containerId = this.cid;
|
|
124
|
+
} else {
|
|
125
|
+
this.containerId = this.$xdUniHelper.randomChar(20);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
//初始化风格
|
|
129
|
+
this.initThemesToData();
|
|
130
|
+
|
|
131
|
+
//#ifdef H5
|
|
132
|
+
//监听用户点击状态显示虚框
|
|
133
|
+
XdBus.addEvent('select', ({containerId}) => {
|
|
134
|
+
this.active = containerId === this.containerId;
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
//业务面板选中插件操作
|
|
138
|
+
XdBus.addEvent('onBoardSelect', ({containerId}) => {
|
|
139
|
+
if (containerId === this.containerId) {
|
|
140
|
+
this.handleSelect()
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
// #endif
|
|
144
|
+
},
|
|
145
|
+
methods: {
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* 检查插件是否加载成功
|
|
149
|
+
*/
|
|
150
|
+
onCheck() {
|
|
151
|
+
},
|
|
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
|
+
|
|
173
|
+
//#ifdef H5
|
|
174
|
+
/**
|
|
175
|
+
* @description 点击删除操作按钮
|
|
176
|
+
*/
|
|
177
|
+
delEdit(){
|
|
178
|
+
XdBus.send('onDelPackage', {
|
|
179
|
+
containerId: this.containerId,
|
|
180
|
+
componentAtrr: this.componentAtrr,
|
|
181
|
+
cid: this.cid,
|
|
182
|
+
container: this.container
|
|
183
|
+
})
|
|
184
|
+
},
|
|
185
|
+
//#endif
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* @description 点击选择插件显示边框
|
|
189
|
+
*/
|
|
190
|
+
handleSelect() {
|
|
191
|
+
//#ifdef H5
|
|
192
|
+
if (this.active) return;
|
|
193
|
+
this.active = true;
|
|
194
|
+
let AttrObj = this.$xdUniHelper.checkVarType(this.Attr) === 'object' ?
|
|
195
|
+
this.Attr : { style: [], advanced: [], content: []};
|
|
196
|
+
console.log('handleSelect.Attr', AttrObj);
|
|
197
|
+
|
|
198
|
+
//设置已绑定数据
|
|
199
|
+
Object.keys(AttrObj).map(type=>{
|
|
200
|
+
AttrObj[type].map(item=>{
|
|
201
|
+
if(item.value !== undefined) item.value = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
202
|
+
if(item.defaultValue !== undefined) item.defaultValue = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
203
|
+
})
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
//发送点击组件事件
|
|
207
|
+
XdBus.send('onSelectPackage', {
|
|
208
|
+
containerId: this.containerId,
|
|
209
|
+
Attr: AttrObj,
|
|
210
|
+
container: this.$xdUniHelper.cloneDeep(this.container)
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
//绑定选中插件事件
|
|
214
|
+
XdBus.message('select', {
|
|
215
|
+
containerId: this.containerId,
|
|
216
|
+
})
|
|
217
|
+
//#endif
|
|
218
|
+
},
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
}
|
|
222
|
+
}
|