cyy-vue-material 1.0.33 → 1.0.34
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
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div v-if="!props.selectImg.length" class="holder">请上传图片</div>
|
|
4
|
+
<template v-else>
|
|
5
|
+
轮播图
|
|
6
|
+
<!-- <div
|
|
7
|
+
v-if="props.showStyle === 0"
|
|
8
|
+
class="golds"
|
|
9
|
+
:style="{ backgroundColor: props.backgroundColor, paddingTop: props.paddingTop + 'px', paddingBottom: props.paddingBottom + 'px' }"
|
|
10
|
+
>
|
|
11
|
+
<div class="golds-item" v-for="(item, index) in resultArr" :key="index" @click="linkClick(item)">
|
|
12
|
+
<img
|
|
13
|
+
:class="[props.photoSize === 1 ? 'photoSizeBig' : 'photoSizeSmall']"
|
|
14
|
+
:style="{ borderRadius: props.photoCorner + '%' }"
|
|
15
|
+
:lazy-load="true"
|
|
16
|
+
:src="item['imgUrl']"
|
|
17
|
+
/>
|
|
18
|
+
<div :style="{ color: props.fontColor }">{{ item.name }}</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
<div v-if="props.showStyle === 1">
|
|
22
|
+
<div class="classify-list" :style="{ paddingTop: props.paddingTop + 'px', paddingBottom: props.paddingBottom + 'px' }">
|
|
23
|
+
<div
|
|
24
|
+
class="classify-item"
|
|
25
|
+
:class="[props.photoSize === 1 ? 'classifyItemBig' : 'classifyItemSmall']"
|
|
26
|
+
:style="{ backgroundColor: props.backgroundColor }"
|
|
27
|
+
v-for="item in resultArr"
|
|
28
|
+
:key="index"
|
|
29
|
+
@click="linkClick(item)"
|
|
30
|
+
>
|
|
31
|
+
<div :class="[props.photoSize === 1 ? 'classifyFontBig' : 'classifyFontSmall']" :style="{ color: props.fontColor }">{{ item.name }}</div>
|
|
32
|
+
<img
|
|
33
|
+
:class="[props.photoSize === 1 ? 'classifyImgBig' : 'classifyImgSmall']"
|
|
34
|
+
:style="{ borderRadius: classifyPhotoCorner(props.photoCorner) + 'px' }"
|
|
35
|
+
:lazy-load="true"
|
|
36
|
+
:src="item['imgUrl']"
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div> -->
|
|
41
|
+
</template>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script>
|
|
46
|
+
import { isEmpty, isUndefined } from "lodash-es";
|
|
47
|
+
export default {
|
|
48
|
+
name: "cyy-ArsenalPicture",
|
|
49
|
+
data() {
|
|
50
|
+
return {
|
|
51
|
+
imgStyle: {
|
|
52
|
+
width: "100%",
|
|
53
|
+
boxSizing: "border-box",
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
props: {
|
|
58
|
+
props: {
|
|
59
|
+
photoCorner: Number, //图片边角
|
|
60
|
+
autoPlay: Number, //自动播放
|
|
61
|
+
autoplayInterval: Number, //轮播间隔
|
|
62
|
+
direction: Number, //方向
|
|
63
|
+
loop: Number, //循环播放
|
|
64
|
+
paddingTop: Number, //上边距
|
|
65
|
+
paddingBottom: Number, //下边距
|
|
66
|
+
selectImg: Array, //添加图片
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
mounted() {
|
|
70
|
+
console.log(this.props, 2023);
|
|
71
|
+
},
|
|
72
|
+
computed: {
|
|
73
|
+
resultArr() {
|
|
74
|
+
const { selectImg, defaultValue } = this.props;
|
|
75
|
+
const computedArr = selectImg.filter((item) => !isUndefined(item)).filter((item) => !Object.values(item).every((citem) => isUndefined(citem)));
|
|
76
|
+
let arr = defaultValue;
|
|
77
|
+
if (!isEmpty(computedArr)) {
|
|
78
|
+
arr = computedArr;
|
|
79
|
+
}
|
|
80
|
+
console.log(52, arr);
|
|
81
|
+
return arr;
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
methods: {
|
|
85
|
+
classifyPhotoCorner(item) {
|
|
86
|
+
if (item === 20) {
|
|
87
|
+
return 8;
|
|
88
|
+
}
|
|
89
|
+
if (item === 50) {
|
|
90
|
+
return 16;
|
|
91
|
+
}
|
|
92
|
+
return item;
|
|
93
|
+
},
|
|
94
|
+
linkClick(item) {
|
|
95
|
+
this.$emit("linkClick", item);
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
</script>
|
|
100
|
+
<style lang="less" scoped>
|
|
101
|
+
.holder {
|
|
102
|
+
width: 100%;
|
|
103
|
+
padding: 10px 0;
|
|
104
|
+
height: 60px;
|
|
105
|
+
background-color: rgb(80, 431, 73);
|
|
106
|
+
}
|
|
107
|
+
</style>
|
|
@@ -10,12 +10,7 @@
|
|
|
10
10
|
gap: `${props.margin}px`,
|
|
11
11
|
}"
|
|
12
12
|
>
|
|
13
|
-
<div
|
|
14
|
-
v-for="(item, index) in listArr"
|
|
15
|
-
class="cube-item"
|
|
16
|
-
:key="cyy"
|
|
17
|
-
@click="goGoodsDetail(item)"
|
|
18
|
-
>
|
|
13
|
+
<div v-for="(item, index) in listArr" class="cube-item" :key="cyy" @click="goGoodsDetail(item)">
|
|
19
14
|
<img
|
|
20
15
|
:src="imgUrl + item.dataPic"
|
|
21
16
|
mode="widthFix"
|
|
@@ -29,13 +24,9 @@
|
|
|
29
24
|
<section class="footerContent">
|
|
30
25
|
<div class="goodsPrice">
|
|
31
26
|
¥{{ item.pricesetNprice }}
|
|
32
|
-
<div class="scribing" v-if="props.markedPrice === 1">
|
|
33
|
-
¥{{ item.pricesetMakeprice }}
|
|
34
|
-
</div>
|
|
27
|
+
<div class="scribing" v-if="props.markedPrice === 1">¥{{ item.pricesetMakeprice }}</div>
|
|
35
28
|
</div>
|
|
36
|
-
<button @click="handleBuyGoods(item.skuNo)" class="goodsBuy">
|
|
37
|
-
立即购买
|
|
38
|
-
</button>
|
|
29
|
+
<button @click="handleBuyGoods(item.skuNo)" class="goodsBuy">立即购买</button>
|
|
39
30
|
</section>
|
|
40
31
|
</div>
|
|
41
32
|
</div>
|
|
@@ -73,7 +64,7 @@ export default {
|
|
|
73
64
|
color: "#aaa",
|
|
74
65
|
textAlign: "center",
|
|
75
66
|
},
|
|
76
|
-
imgUrl:
|
|
67
|
+
imgUrl: "",
|
|
77
68
|
};
|
|
78
69
|
},
|
|
79
70
|
mounted() {
|
|
@@ -81,12 +72,15 @@ export default {
|
|
|
81
72
|
},
|
|
82
73
|
methods: {
|
|
83
74
|
async init() {
|
|
75
|
+
this.imgUrl = getUrl(this);
|
|
76
|
+
console.log("this.imgUrl", this.imgUrl);
|
|
84
77
|
const { goods = [] } = this.props;
|
|
85
78
|
const goodsCode = goods.toString();
|
|
86
79
|
const paramObj = { goodsCode };
|
|
80
|
+
console.log("🐽🐽🐽🐽🐽🐽🐽🐽m", goodsCode);
|
|
87
81
|
const res = await fetchGoodImpl(this, paramObj);
|
|
88
82
|
this.listArr = get(res, "list", []);
|
|
89
|
-
console.log("🐽🐽🐽🐽🐽🐽🐽🐽", this.listArr);
|
|
83
|
+
console.log("🐽🐽🐽🐽🐽🐽🐽🐽w", this.listArr);
|
|
90
84
|
},
|
|
91
85
|
|
|
92
86
|
goGoodsDetail(item) {
|
|
@@ -216,8 +210,6 @@ button {
|
|
|
216
210
|
background-color: red;
|
|
217
211
|
color: white;
|
|
218
212
|
min-width: 74px;
|
|
219
|
-
height: calc(2em - 0.5em);
|
|
220
|
-
padding: 0 calc(1em - 0.25em);
|
|
221
213
|
margin: 0.5em 0.25em 0;
|
|
222
214
|
align-self: flex-end;
|
|
223
215
|
}
|
package/src/package/index.js
CHANGED
|
@@ -6,3 +6,4 @@ export { default as Slider } from "./cyy-slider/cyy-slider.vue";
|
|
|
6
6
|
export { default as GoodsOne } from "./cyy-goodsOne/cyy-goodsOne.vue";
|
|
7
7
|
export { default as ArsenalPicture } from "./cyy-ArsenalPicture/cyy-ArsenalPicture.vue";
|
|
8
8
|
export { default as ArsenalNavigation } from "./cyy-ArsenalNavigation/cyy-ArsenalNavigation.vue";
|
|
9
|
+
export { default as ArsenalCarousel } from "./cyy-ArsenalCarousel/cyy-ArsenalCarousel.vue";
|
package/src/utils/checkEnv.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export const isLc = process.env.NODE_ENV
|
|
1
|
+
export const isLc = process.env.NODE_ENV === "dev" || process.env.VUE_APP_PLATFORM === "low-code";
|
|
2
2
|
|
|
3
3
|
export const handlePlat = (params) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
let result = {};
|
|
5
|
+
for (let key in params) {
|
|
6
|
+
result[key] = sumPix(params[key]);
|
|
7
|
+
}
|
|
8
|
+
return result;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
const sumPix = (param) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
if (isLc) {
|
|
13
|
+
return param + "px";
|
|
14
|
+
}
|
|
15
|
+
return param * 2 + "rpx";
|
|
16
16
|
};
|