jufubao-mall 2.0.29 → 2.0.31

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.
@@ -0,0 +1,281 @@
1
+ 'use strict';
2
+ import {
3
+ dataVal,
4
+ statusDataVal,
5
+ statusShow,
6
+ customVal,
7
+ getRemoteOptions
8
+ } from "@/utils/AttrTools";
9
+
10
+ export default (data, gValue, gColor, oldData = {}) => {
11
+ let cellNum = dataVal({ data, key: 'column_num', dValue: 2, gValue });
12
+ let cartStyle = dataVal({ data, key: 'cartStyle', dValue: 'icongouwuche-01', gValue });
13
+ if (cellNum === 3) {
14
+ if (cartStyle.indexOf('btn_cart') === 0) cartStyle = 'icongouwuche-01'
15
+ }
16
+ let reKey;
17
+ let isKey = false;
18
+ if (oldData['column_num'] !== undefined && cellNum !== oldData['column_num']) {
19
+ reKey = Date.now();
20
+ isKey = true;
21
+ }
22
+ let options = getRemoteOptions('productV20List', data, gValue, dataVal);
23
+ return [
24
+ {
25
+ ele: 'title',
26
+ label: '基础',
27
+ size: 'small',
28
+ groupKey: 'content',
29
+ },
30
+ {
31
+ label: "业务线",
32
+ ele: "xd-choose-namespace",
33
+ valueKey: "xnamespace",
34
+ value: dataVal({ data, key: 'xnamespace', dValue: null, gValue }),
35
+ className: 'input100',
36
+ placeholder: '请选择业务线',
37
+ labelInline: true,
38
+ groupKey: 'content',
39
+ notice: '空继承上级业务线',
40
+ inline: false,
41
+ handleCustom: (cb) => {
42
+ XdBus.getParentApi('getOptionsNamespaces')()
43
+ .then(res => {
44
+ cb(res.list)
45
+ })
46
+ .catch();
47
+ }
48
+ },
49
+ {
50
+ ele: 'title',
51
+ label: '组件样式',
52
+ size: 'small',
53
+ groupKey: 'content',
54
+ },
55
+ {
56
+ label: "列表布局",
57
+ ele: "xd-style-image",
58
+ groupKey: 'content',
59
+ valueKey: "column_num",
60
+ value: dataVal({ data, key: 'column_num', dValue: 2, gValue }),
61
+ labelInline: true,
62
+ className: 'input100',
63
+ handleCustom(cusRes) {
64
+ XdBus.getParentApi('getCompStylesOptions')({
65
+ layout_ids: 'FzCwxOH7MQpT5ISYs8Xm6',
66
+ key: Date.now()
67
+ })
68
+ .then(res => {
69
+ res.list.map(item => {
70
+ item.value = Number(item.value)
71
+ return item;
72
+ })
73
+ cusRes.data.cb(res)
74
+ })
75
+ .catch(error => {
76
+ console.error(error);
77
+ });
78
+ },
79
+ },
80
+ {
81
+ label: "商品样式",
82
+ ele: "xd-style-image",
83
+ groupKey: 'content',
84
+ valueKey: "productStyle",
85
+ cusStyle: { marginBottom: '5px' },
86
+ value: customVal({
87
+ data,
88
+ key: 'productStyle',
89
+ fields: { 'itemBgcColorStatus': ['itemBgcColor'], 'bgBorder': ['contBorder', 'bs'] },
90
+ gValue,
91
+ sValue: "{\"border\":0,\"backgroundColor\":\"#fff\"}",
92
+ }),
93
+ labelInline: true,
94
+ className: 'input100',
95
+ handleCustom(cusRes) {
96
+ XdBus.getParentApi('getCompStylesOptions')({
97
+ layout_ids: 'Y4oxNuIUOgVMaTD1LeWxp',
98
+ key: Date.now()
99
+ })
100
+ .then(res => {
101
+ cusRes.data.cb(res)
102
+ })
103
+ .catch(error => {
104
+ console.error(error);
105
+ });
106
+ },
107
+ },
108
+ {
109
+ label: '分类图片(预览模式生效)',
110
+ ele: 'xd-radio',
111
+ valueKey: 'isCategoryImage',
112
+ value: dataVal({ data, key: 'isCategoryImage', dValue: 'Y', gValue }),
113
+ placeholder: '请选择是否显示分类图片',
114
+ multiple: false,
115
+ labelInline: true,
116
+ className: 'input80',
117
+ groupKey: 'content',
118
+ list: [
119
+ { label: '展示', value: 'Y' },
120
+ { label: '隐藏', value: 'N' },
121
+ ]
122
+ },
123
+ {
124
+ ele: 'title',
125
+ label: '展示内容',
126
+ size: 'small',
127
+ groupKey: 'content',
128
+ },
129
+ {
130
+ label: '品牌',
131
+ ele: 'xd-cus-switch',
132
+ valueKey: 'is_show_brand',
133
+ value: dataVal({ data, key: 'is_show_brand', dValue: 'N', gValue }),
134
+ className: 'input100',
135
+ groupKey: 'content',
136
+ labelInline: true,
137
+ cusStyle: { marginBottom: '10px' },
138
+ setting: {
139
+ tips: ['显示', '隐藏'],
140
+ isBackType: 'string'
141
+ },
142
+ },
143
+ {
144
+ ele: 'xd-line',
145
+ groupKey: 'content'
146
+ },
147
+ {
148
+ label: '购物车',
149
+ ele: 'xd-cus-switch',
150
+ valueKey: 'isAddCart',
151
+ value: dataVal({ data, key: 'isAddCart', dValue: 'Y', gValue }),
152
+ className: 'input100',
153
+ groupKey: 'content',
154
+ labelInline: true,
155
+ cusStyle: { marginBottom: '10px' },
156
+ setting: {
157
+ tips: ['显示', '隐藏'],
158
+ isBackType: 'string'
159
+ },
160
+ },
161
+ { ele: 'group_start' },
162
+ {
163
+ label: "",
164
+ ele: "xd-style-image",
165
+ groupKey: 'content',
166
+ valueKey: "cartStyle",
167
+ hidden: data['isAddCart'] !== 'Y',
168
+ value: cartStyle,
169
+ labelInline: true,
170
+ isKey: isKey,
171
+ key: reKey,
172
+ //isTplRef:true, //内容引用模版被禁用
173
+ className: 'input100',
174
+ handleCustom(cusRes) {
175
+ XdBus.getParentApi('getCompStylesOptions')({
176
+ layout_ids: 'ngwFA8G8RzLuFHyv5cMCl',
177
+ key: Date.now()
178
+ })
179
+ .then(res => {
180
+ if (cellNum === 1 || cellNum === 4 || cellNum === 2) {
181
+ cusRes.data.cb(res)
182
+ }
183
+ else {
184
+ res.list = res.list.filter(item => {
185
+ return item.value.indexOf('btn_') === -1
186
+ });
187
+ cusRes.data.cb(res)
188
+ }
189
+
190
+ })
191
+ .catch(error => {
192
+ console.error(error);
193
+ });
194
+ },
195
+ },
196
+ (data['isAddCart'] === 'Y' && data['cartStyle'] && data['cartStyle'].indexOf('btn_cart') === 0) && {
197
+ label: '按钮文字',
198
+ ele: 'el-input',
199
+ type: 'text',
200
+ valueKey: 'cartName',
201
+ value: dataVal({ data, key: 'cartName', dValue: '', gValue }),
202
+ placeholder: '请输入按钮文字,默认值:购买',
203
+ className: 'input100',
204
+ labelInline: true,
205
+ groupKey: 'content',
206
+ rules: [
207
+ {
208
+ required: false,
209
+ validator: (rule, value, callback) => {
210
+ if (typeof value === "string") value = value.trim();
211
+ // if(value.length === 0){
212
+ // callback('按钮文字不能为空');
213
+ // return
214
+ // }
215
+ if (value.length > 3) {
216
+ callback('按钮文字长度为:1-3字符');
217
+ return
218
+ }
219
+ callback();
220
+ },
221
+ trigger: ['blur', 'change']
222
+ }
223
+ ]
224
+ },
225
+ { ele: 'group_end' },
226
+ ...options,
227
+ {
228
+ ele: 'xd-line',
229
+ groupKey: 'content',
230
+ },
231
+ {
232
+ label: '价格',
233
+ ele: 'xd-cus-switch',
234
+ valueKey: 'isPrice',
235
+ value: dataVal({ data, key: 'isPrice', dValue: 'Y', gValue }),
236
+ className: 'input100',
237
+ groupKey: 'content',
238
+ labelInline: true,
239
+ cusStyle: { marginBottom: '10px' },
240
+ setting: {
241
+ tips: ['显示', '隐藏'],
242
+ isBackType: 'string'
243
+ },
244
+ },
245
+ {
246
+ ele: 'xd-line',
247
+ groupKey: 'content',
248
+ hidden: data.isPrice !== 'Y',
249
+ },
250
+ {
251
+ label: '划线价',
252
+ ele: 'xd-cus-switch',
253
+ valueKey: 'isShowDiscount',
254
+ value: dataVal({ data, key: 'isShowDiscount', dValue: 'Y', gValue }),
255
+ className: 'input100',
256
+ labelInline: true,
257
+ groupKey: 'content',
258
+ hidden: data.isPrice !== 'Y',
259
+ setting: {
260
+ tips: ['显示', '隐藏'],
261
+ isBackType: 'string'
262
+ },
263
+ },
264
+ { ele: 'group_start' },
265
+ {
266
+ label: '差值',
267
+ ele: 'el-input',
268
+ type: 'number',
269
+ valueKey: 'differ',
270
+ labelInline: true,
271
+ value: dataVal({ data, key: 'differ', dValue: '', gValue }),
272
+ hidden: data.isShowDiscount !== 'Y' || data.isPrice !== 'Y',
273
+ groupKey: 'content',
274
+ placeholder: '价差,默认值:1',
275
+ className: 'input80',
276
+ notice: '划线价取市场价,市场价-售价差值大于等于设置值时展示',
277
+ inline: false
278
+ },
279
+ { ele: 'group_end' },
280
+ ].filter(i=>i)
281
+ }