jufubao-mall 2.0.82 → 2.0.83-beta1

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 (27) hide show
  1. package/.claude/settings.local.json +8 -0
  2. package/package.json +1 -1
  3. package/src/components/JfbMallCategoryAll/Api.js +40 -0
  4. package/src/components/JfbMallCategoryAll/Attr.js +20 -0
  5. package/src/components/JfbMallCategoryAll/JfbMallCategoryAll.vue +372 -0
  6. package/src/components/JfbMallCategoryAll/JfbMallCategoryAllLess.less +80 -0
  7. package/src/components/JfbMallCategoryAll/JfbMallCategoryAllMixin.js +30 -0
  8. package/src/components/JfbMallCategoryAll/Mock.js +1333 -0
  9. package/src/components/JfbMallCategoryAll/XdStoreProductType.vue +588 -0
  10. package/src/components/JfbMallCategoryAll/cusAttr/advanced.js +28 -0
  11. package/src/components/JfbMallCategoryAll/cusAttr/content.js +158 -0
  12. package/src/components/JfbMallCategoryAll/cusAttr/style.js +513 -0
  13. package/src/components/JfbMallCategoryProduct/Api.js +55 -0
  14. package/src/components/JfbMallCategoryProduct/Attr.js +20 -0
  15. package/src/components/JfbMallCategoryProduct/JfbMallCategoryProduct.vue +1109 -0
  16. package/src/components/JfbMallCategoryProduct/JfbMallCategoryProductLess.less +80 -0
  17. package/src/components/JfbMallCategoryProduct/JfbMallCategoryProductMixin.js +30 -0
  18. package/src/components/JfbMallCategoryProduct/Mock.js +1602 -0
  19. package/src/components/JfbMallCategoryProduct/cusAttr/advanced.js +53 -0
  20. package/src/components/JfbMallCategoryProduct/cusAttr/content.js +277 -0
  21. package/src/components/JfbMallCategoryProduct/cusAttr/style.js +381 -0
  22. package/src/components/JfbMallProductInfo/JfbMallProductInfo.vue +2 -1
  23. package/src/components/JfbMallProductInfo/XdSku.vue +5 -16
  24. package/src/components/JfbMallProductInfo/XdSkuJd.vue +5 -22
  25. package/src/components/JfbMallShop/JfbMallShop.vue +1 -1
  26. package/src/components/JfbMallShop/ShowQp.vue +4 -4
  27. package/get.package.path.js +0 -22
@@ -0,0 +1,8 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(git checkout *)",
5
+ "Bash(npx lessc *)"
6
+ ]
7
+ }
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-mall",
3
- "version": "2.0.82",
3
+ "version": "2.0.83-beta1",
4
4
  "private": false,
5
5
  "description": "聚福宝商城业务组件插件包",
6
6
  "main": "index.js",
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * @description API模型
5
+ * 建议:Ffff=>模块 Xxxx=>自定义名字
6
+ * 获取单记录(getByIdFfffXxxx)
7
+ * 获取列表记录(getByListFfffXxxx)
8
+ * 添加列表记录(addFfffXxxxx)
9
+ * 删除列表记录(removeFfffXxxxx|deleteFfffXxxx)
10
+ * 更新列表记录(updateFfffXxxxx)
11
+ * @type {*[]}
12
+ */
13
+ module.exports = [
14
+ {
15
+ mapFnName: 'getMallCategoryTree',
16
+ title: '分类 - 树列表',
17
+ path: '/product/v1/:xnamespace/category/index',
18
+ isRule: false,
19
+ params: {
20
+ xnamespace: ['xnamespace', 'String', '必选'],
21
+ group_id: ['分组ID', 'Number', '必选'],
22
+ need_tag: ['分类', 'Number', '必选'],
23
+ },
24
+ isConsole: true,
25
+ disabled: true,
26
+ },
27
+ {
28
+ mapFnName: 'getMallCategoryChildren',
29
+ title: '分类 - 获取子级',
30
+ path: '/product/v1/:xnamespace/category/children',
31
+ isRule: false,
32
+ params: {
33
+ xnamespace: ['xnamespace', 'String', '必选'],
34
+ group_id: ['分组ID', 'Number', '必选'],
35
+ parent_id: ['父级ID 0时只获取第一级', 'Number', '必选'],
36
+ },
37
+ isConsole: true,
38
+ disabled: true,
39
+ },
40
+ ];
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+ import style from "./cusAttr/style";
3
+ import advanced from "./cusAttr/advanced";
4
+ import content from "./cusAttr/content";
5
+
6
+ /**
7
+ * @description 当表单组件中有联动操作时候,使用方法进行返回
8
+ */
9
+ export default {
10
+ style: [],
11
+ advanced: [],
12
+ content: (data, gValue, gColor, oldData={})=>{
13
+
14
+ return [
15
+ ...content(data, gValue,gColor,oldData),
16
+ ...style(data, gValue,gColor,oldData),
17
+ ...advanced(data),
18
+ ].filter(i=>i)
19
+ },
20
+ };
@@ -0,0 +1,372 @@
1
+ <template>
2
+ <view
3
+ class="jfb-mall-category-all"
4
+ @click="handleEditxSelect"
5
+ :class="{ editx : isEditx && active }"
6
+ >
7
+ <!--#ifdef H5-->
8
+ <view
9
+ class="jfb-mall-category-all__edit"
10
+ :class="{ editx : isEditx && active }"
11
+ v-if="isEditx && active"
12
+ >
13
+ <view class="jfb-mall-category-all__edit-icon" @click.stop="delEdit">
14
+ <xd-font-icon icon="iconshanchu-01" color="#fff" size="30"></xd-font-icon>
15
+ </view>
16
+ </view>
17
+ <!-- #endif -->
18
+ <view class="jfb-mall-category-all__body">
19
+ <view v-if="loadingList" class="skeleton-wrap">
20
+ <view class="type-left">
21
+ <view v-for="i in 10" :key="i">
22
+ <view class="cate-item"></view>
23
+ </view>
24
+ </view>
25
+ <view class="type-right">
26
+ <view v-for="i in 10" :key="i">
27
+ <view class="type_title"><view></view></view>
28
+ <view class="type_list">
29
+ <view v-for="ii in 3" :key="ii" class="type_item">
30
+ <view></view>
31
+ <view></view>
32
+ </view>
33
+ </view>
34
+ </view>
35
+ </view>
36
+ </view>
37
+ <xd-store-product-type
38
+ :key="navKey"
39
+ v-if="onLoadStatus"
40
+ :layout-info="layoutInfo"
41
+ :color="mainColor"
42
+ :default-index="0"
43
+ :style-config="styleConfig"
44
+ @onNavList="handleNavList"
45
+ @onToDetail="handleToDetail"
46
+ ></xd-store-product-type>
47
+ </view>
48
+ </view>
49
+ </template>
50
+
51
+ <script>
52
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
53
+ import XdStoreProductType from "./XdStoreProductType";
54
+ import {jfbRootExec} from "@/utils/xd.event";
55
+ import JfbMallCategoryAllMixin from "./JfbMallCategoryAllMixin";
56
+ import componentsMixins from "@/mixins/componentsMixins";
57
+ import extsMixins from "@/mixins/extsMixins";
58
+ import { getContainerPropsValue, gCPVal } from "@/utils/xd.base";
59
+ import getServiceUrl from "@/common/getServiceUrl";
60
+ import Color from "color";
61
+
62
+ export default {
63
+ name: "JfbMallCategoryAll",
64
+ components: {
65
+ XdFontIcon,
66
+ XdStoreProductType
67
+ },
68
+ mixins: [componentsMixins, extsMixins, JfbMallCategoryAllMixin],
69
+ data() {
70
+ return {
71
+ isPreview: false,
72
+ allNavList: [],
73
+ loadingList: true,
74
+ xnamespace: "",
75
+ listPath: "",
76
+ selfMask: true,
77
+ onLoadStatus: false,
78
+ need_tag: null,
79
+ navKey: "navKey",
80
+
81
+ // content 属性
82
+ showRecommend: 'Y',
83
+ categoryParentType: 'child',
84
+ categoryParent: '',
85
+ recommendName: '',
86
+ layoutStyle: '1',
87
+
88
+ // 左侧导航样式
89
+ leftNavName: {},
90
+ leftNavItemSpacing: 0,
91
+ leftNavBgColor: '#F7F7F7',
92
+ leftNavBorder: '',
93
+ leftNavRadius: '10',
94
+ leftNavShadow: '',
95
+ leftNavPadding: {top:0, bottom:0, left:0, right:0},
96
+ // 右侧导航样式
97
+ rightNavMargin: [0],
98
+ rightNavPadding: {top:0, bottom:0, left:0, right:0},
99
+ rightNavBgColor: '#fff',
100
+ rightNavIconSize: 80,
101
+ rightNavIconPadding: 0,
102
+ rightNavIconTextColor: '#666',
103
+ rightNavIconTextSize: '12',
104
+ rightNavIconRadius: 'small',
105
+ rightNavIconBorder: '',
106
+ rightNavIconShadow: '',
107
+ rightNavIconBgColor: '',
108
+ rightNavIconTextGap: 0,
109
+ }
110
+ },
111
+ computed: {
112
+ styleConfig() {
113
+ return {
114
+ // content
115
+ xnamespace: this.xnamespace,
116
+ showRecommend: this.showRecommend,
117
+ need_tag: this.need_tag,
118
+ categoryParentType: this.categoryParentType,
119
+ categoryParent: this.categoryParent,
120
+ recommendName: this.recommendName,
121
+ layoutStyle: this.layoutStyle,
122
+ listPath: this.listPath,
123
+ // 左侧导航
124
+ leftNavName: this.leftNavName,
125
+ leftNavItemSpacing: this.leftNavItemSpacing,
126
+ leftNavBgColor: this.leftNavBgColor,
127
+ leftNavBorder: this.leftNavBorder,
128
+ leftNavRadius: this.leftNavRadius,
129
+ leftNavShadow: this.leftNavShadow,
130
+ leftNavPadding: this.leftNavPadding,
131
+ // 右侧导航
132
+ rightNavMargin: this.rightNavMargin,
133
+ rightNavPadding: this.rightNavPadding,
134
+ rightNavBgColor: this.rightNavBgColor,
135
+ rightNavIconSize: this.rightNavIconSize,
136
+ rightNavIconPadding: this.rightNavIconPadding,
137
+ rightNavIconTextColor: this.rightNavIconTextColor,
138
+ rightNavIconTextSize: this.rightNavIconTextSize,
139
+ rightNavIconRadius: this.rightNavIconRadius,
140
+ rightNavIconBorder: this.rightNavIconBorder,
141
+ rightNavIconShadow: this.rightNavIconShadow,
142
+ rightNavIconBgColor: this.rightNavIconBgColor,
143
+ rightNavIconTextGap: this.rightNavIconTextGap,
144
+ }
145
+ }
146
+ },
147
+ watch: {
148
+ container(value, oldValue) {
149
+ if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
150
+ if (this.$configProject['isPreview']) this.init(value)
151
+ },
152
+ need_tag: {
153
+ deep: true,
154
+ handler(n, o) {
155
+ this.navKey = new Date().getTime()
156
+ }
157
+ },
158
+ recommendName: {
159
+ handler(n) {
160
+ if(this.isPreview && n && this.allNavList.length > 0) {
161
+ this.allNavList[0].category_name = n
162
+ }
163
+ }
164
+ },
165
+ },
166
+ created() {
167
+ this.init(this.container);
168
+ this.isPreview = this.$configProject.isPreview;
169
+ },
170
+ methods: {
171
+ onJfbLoad(options) {
172
+ this.setNameSpace(options);
173
+ this.onLoadStatus = true;
174
+ },
175
+ init(container) {
176
+ this.listPath = getContainerPropsValue(container, 'content.listPath', {value: ""}).value;
177
+ this.xnamespace = getContainerPropsValue(container, 'content.xnamespace', this.projectAttr.business_code);
178
+ this.need_tag = getContainerPropsValue(container, 'content.need_tag', null);
179
+ this.showRecommend = gCPVal(container, 'showRecommend', 'Y');
180
+ this.categoryParentType = gCPVal(container, 'categoryParentType', 'child');
181
+ this.categoryParent = gCPVal(container, 'categoryParent', '');
182
+ this.recommendName = gCPVal(container, 'recommendName', '');
183
+ this.layoutStyle = gCPVal(container, 'layoutStyle', '1');
184
+
185
+ // ===== 左侧导航样式 =====
186
+ this.leftNavName = gCPVal(container, 'leftNavName', {});
187
+ this.leftNavItemSpacing = gCPVal(container, 'leftNavItemSpacing', 0);
188
+ this.leftNavBgColor = gCPVal(container, 'leftNavBgColor', '#F7F7F7');
189
+ this.leftNavBorder = gCPVal(container, 'leftNavBorder', {color: '#ddd',width: '1',style: 'solid'}, {isBorder: true});
190
+ this.leftNavRadius = gCPVal(container, 'leftNavRadius', '10');
191
+ this.leftNavShadow = gCPVal(container, 'leftNavShadow', {width:20, color:'rgba(0,0,0,0)'}, {isShadow: true});
192
+ this.leftNavPadding = gCPVal(container, 'leftNavPadding', {top:0, bottom:0, left:0, right:0}, {isPM: true, isCPM: true});
193
+
194
+ // ===== 右侧导航样式 =====
195
+ this.rightNavMargin = gCPVal(container, 'rightNavMargin', [0], {isPM: true, isCPM: true});
196
+ this.rightNavPadding = gCPVal(container, 'rightNavPadding', {top:0, bottom:0, left:0, right:0}, {isPM: true, isCPM: true});
197
+ this.rightNavBgColor = gCPVal(container, 'rightNavBgColor', '#fff');
198
+ this.rightNavIconSize = gCPVal(container, 'rightNavIconSize', 80);
199
+ this.rightNavIconPadding = gCPVal(container, 'rightNavIconPadding', 0);
200
+ this.rightNavIconTextColor = gCPVal(container, 'rightNavIconTextColor', '#666');
201
+ this.rightNavIconTextSize = gCPVal(container, 'rightNavIconTextSize', '12');
202
+ this.rightNavIconRadius = gCPVal(container, 'rightNavIconRadius', 'small');
203
+ this.rightNavIconBorder = gCPVal(container, 'rightNavIconBorder', {color: '#ddd',width: '1',style: 'solid'}, {isBorder: true});
204
+ this.rightNavIconShadow = gCPVal(container, 'rightNavIconShadow', {width:20, color:'rgba(0,0,0,0)'}, {isShadow: true});
205
+ this.rightNavIconBgColor = gCPVal(container, 'rightNavIconBgColor', '');
206
+ this.rightNavIconTextGap = gCPVal(container, 'rightNavIconTextGap', 0);
207
+ },
208
+ handleNavList(resolve) {
209
+ try {
210
+ jfbRootExec("getMallCategoryTree", {
211
+ vm: this,
212
+ data: {
213
+ xnamespace: this.xnamespace,
214
+ need_tag: this.need_tag,
215
+ group_id: 'default'
216
+ }
217
+ }).then(res => {
218
+ this.loadingList = false;
219
+ if(this.isPreview && !this.need_tag) {
220
+ this.allNavList = this.allNavList.filter(item => {
221
+ return item.category_id !== 5555
222
+ })
223
+ }
224
+ if(this.isPreview && this.need_tag) {
225
+ res.items.unshift({
226
+ category_name: '推荐分类',
227
+ category_id: 5555,
228
+ category_icon: 'https://jfb-public-images.oss-cn-qingdao.aliyuncs.com/uploads/20230317/43cc2cb3c71edb6415ec8cb662693471.webp.jpg',
229
+ parent_id: 2,
230
+ tag: 'rec',
231
+ children: [
232
+ {
233
+ category_name: '儿童车安全椅',
234
+ category_id: 4337,
235
+ category_icon: 'https://jfb-public-images.oss-cn-qingdao.aliyuncs.com/uploads/20230317/7a93387dedfc29f61745da6fc51517f4.jpg',
236
+ parent_id: 4360,
237
+ tag: 'rec',
238
+ children: []
239
+ },
240
+ {
241
+ category_name: '纸尿裤拉拉裤',
242
+ category_id: 4338,
243
+ category_icon: 'https://jfb-public-images.oss-cn-qingdao.aliyuncs.com/uploads/20230317/e3dc107d6c5fe5cce55a36f3631386da.png',
244
+ parent_id: 4360,
245
+ tag: '',
246
+ children: []
247
+ },
248
+ {
249
+ category_name: '营养辅食奶粉',
250
+ category_id: 4339,
251
+ category_icon: 'https://jfb-public-images.oss-cn-qingdao.aliyuncs.com/uploads/20230317/6a2edc1bf28f44671bdac27b73a0e0a5.jpg',
252
+ parent_id: 4360,
253
+ tag: '',
254
+ children: []
255
+ },
256
+ {
257
+ category_name: '孕产妇用品',
258
+ category_id: 4340,
259
+ category_icon: 'https://jfb-public-images.oss-cn-qingdao.aliyuncs.com/uploads/20230317/20c4d05eff9cb34757b42de770536c26.webp.jpg',
260
+ parent_id: 4360,
261
+ tag: '',
262
+ children: []
263
+ },
264
+ {
265
+ category_name: '婴童用品',
266
+ category_id: 4342,
267
+ category_icon: 'https://jfb-public-images.oss-cn-qingdao.aliyuncs.com/uploads/20230317/b8ec88d8b68a2cb50537a792820c6960.webp.jpg',
268
+ parent_id: 4360,
269
+ tag: '',
270
+ children: []
271
+ }
272
+ ]
273
+ })
274
+ }
275
+ let items = res.items.map(item => {
276
+ item['category_icon'] = getServiceUrl(item['category_icon'], 'size3');
277
+ item.children = item.children.map(child => {
278
+ child['category_icon'] = getServiceUrl(child['category_icon'], 'size3');
279
+ return child;
280
+ });
281
+ if(this.recommendName) {
282
+ item.category_name = this.recommendName
283
+ }
284
+ return item;
285
+ });
286
+ this.allNavList = items;
287
+ resolve(items)
288
+ }).catch(err => {
289
+ this.$xdLog.catch(err);
290
+ resolve([])
291
+ })
292
+ } catch (error) {
293
+ this.$xdLog.catch(error);
294
+ }
295
+ },
296
+ handleToDetail(item) {
297
+ let params = `pid=${item.pid}&need_tag=${this.need_tag}`;
298
+ if (item.cateId) {
299
+ params += `&cateId=${item.cateId}`;
300
+ }
301
+ this.$xdUniHelper.navigateTo({
302
+ url: `${this.listPath}?${params}`
303
+ })
304
+ },
305
+ onJfbBack(options) {
306
+ this.$xdUniHelper.navigateBack()
307
+ },
308
+ }
309
+ }
310
+ </script>
311
+
312
+ <style scoped lang="less">
313
+ @import "./JfbMallCategoryAllLess.less";
314
+
315
+ .jfb-mall-category-all {
316
+ &__body {
317
+ position: relative;
318
+ overflow: hidden;
319
+ z-index: 2;
320
+
321
+ .skeleton-wrap {
322
+ display: flex;
323
+ .type-left {
324
+ width: 200rpx;
325
+ display: flex;
326
+ flex-direction: column;
327
+ align-items: center;
328
+
329
+ & > view {
330
+ height: 110rpx;
331
+ display: flex;
332
+ align-items: center;
333
+ }
334
+ .cate-item {
335
+ .skeleton-item(100rpx);
336
+ }
337
+ }
338
+ .type-right {
339
+ flex: 1;
340
+ width: 100%;
341
+ padding: 20rpx;
342
+ .type_title {
343
+ height: 100rpx;
344
+ display: flex;
345
+ align-items: center;
346
+ & > view {
347
+ .skeleton-item(150rpx);
348
+ }
349
+ margin-bottom: 20rpx;
350
+ }
351
+ .type_list {
352
+ display: flex;
353
+ justify-content: space-around;
354
+ margin-bottom: 60rpx;
355
+ .type_item {
356
+ display: flex;
357
+ flex-direction: column;
358
+ align-items: center;
359
+ & > view:first-child {
360
+ .skeleton-item(120rpx, 120rpx, 50%);
361
+ }
362
+ & > view:last-child {
363
+ .skeleton-item(100rpx, 24rpx);
364
+ margin-top: 10rpx;
365
+ }
366
+ }
367
+ }
368
+ }
369
+ }
370
+ }
371
+ }
372
+ </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-mall-category-all {
16
+ box-sizing: border-box;
17
+
18
+ &__body{
19
+ position: relative;
20
+ overflow: hidden;
21
+ z-index: 2
22
+ }
23
+
24
+ &.editx,&.editx:hover {
25
+ position: relative;
26
+ min-height: unit(100, rpx);
27
+ z-index: 3;
28
+ &::after {
29
+ border: 2rpx dashed blue;
30
+ content: " ";
31
+ position: absolute;
32
+ top:0;
33
+ left:0;
34
+ bottom:0;
35
+ right:0;
36
+ z-index: var(--preview-z-index);
37
+ cursor: pointer;
38
+ }
39
+
40
+ }
41
+
42
+
43
+ &__edit {
44
+ cursor: pointer;
45
+ position: absolute;
46
+ right: unit(0, rpx);
47
+ top: unit(0, rpx);
48
+ height: unit(50, rpx);
49
+ z-index: 100;
50
+ display: flex;
51
+ justify-content: center;
52
+ align-items: center;
53
+ background: rgba(0, 0, 0, .4);
54
+ border-radius: 0 0 0 20rpx;
55
+ box-shadow: 0 0 10px rbga(0, 0, 0, 0.3);
56
+ color: #fff;
57
+ font-size: unit(22, rpx);
58
+ padding: 0 6rpx 0 6px;
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-mall-category-all {
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-mall-category-all'
20
+ }
21
+ },
22
+ created() {
23
+
24
+ //@AttrDataCreated
25
+ this.Attr = this.$xdUniHelper.customClone(Attr);
26
+ //@EndAttrDataCreated
27
+
28
+
29
+ },
30
+ }