cyy-vue-material 1.0.19 → 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.
@@ -1 +1 @@
1
- export * from './constant.js';
1
+ export * from './constant.js';
package/src/index.js CHANGED
@@ -1,19 +1,19 @@
1
- // Import vue component
2
- import { Goods, Title, Cube, Search, Slider, GoodsOne } from "./package";
3
-
4
- const components = [Goods, Title, Cube, Search, Slider, GoodsOne];
5
-
6
- // will install the plugin only once
7
- const install = function (Vue) {
8
- components.forEach((component) => {
9
- Vue.component(component.name, component);
10
- });
11
- };
12
-
13
- if (typeof window !== "undefined" && window.Vue) {
14
- install(window.Vue);
15
- }
16
-
17
- export * from "./package";
18
-
19
- export default install;
1
+ // Import vue component
2
+ import { Goods, Title, Cube, Search, Slider, GoodsOne } from "./package";
3
+
4
+ const components = [Goods, Title, Cube, Search, Slider, GoodsOne];
5
+
6
+ // will install the plugin only once
7
+ const install = function (Vue) {
8
+ components.forEach((component) => {
9
+ Vue.component(component.name, component);
10
+ });
11
+ };
12
+
13
+ if (typeof window !== "undefined" && window.Vue) {
14
+ install(window.Vue);
15
+ }
16
+
17
+ export * from "./package";
18
+
19
+ export default install;
@@ -1,153 +1,153 @@
1
- <template>
2
- <div>
3
- <div v-if="!props.goods" :style="noDataStyle">请选择商品</div>
4
- <div v-else>
5
- <div
6
- :class="['cube-container', props.arrange === 1 ? 'one' : 'two']"
7
- :style="{
8
- paddingTop: props.paddingTop + 'px',
9
- paddingLeft: props.paddingLeft + 'px',
10
- paddingRight: props.paddingRight + 'px',
11
- paddingBottom: props.paddingBottom + 'px',
12
- gap: props.margin + 'px'
13
- }"
14
- >
15
- <div
16
- v-for="(item, index) in listArr"
17
- class="cube-item"
18
- :key="cyy"
19
- @click="goGoodsDetail(item)"
20
- >
21
- <img
22
- :src="item.dataPic"
23
- mode="widthFix"
24
- alt=""
25
- :style="{
26
- borderRadius: props.circular === 2 ? '0px' : '10px'
27
- }"
28
- />
29
- <div class="goodsName">{{ item.goodsName }}</div>
30
- <div class="goodsPrice">
31
- ¥{{ item.pricesetNprice }}
32
- <div class="scribing" v-if="props.markedPrice === 1">
33
- ¥{{ item.pricesetMakeprice }}
34
- </div>
35
- </div>
36
- </div>
37
- </div>
38
- </div>
39
- </div>
40
- </template>
41
-
42
- <script>
43
- import { fetchGoodImpl, isLc } from '../../utils/index.js';
44
- import { get } from 'lodash-es';
45
- export default {
46
- name: 'cyy-goods',
47
- props: {
48
- props: {
49
- SelectGoods: Object,
50
- arrange: Number,
51
- circular: Number,
52
- margin: Number,
53
- markedPrice: Number,
54
- paddingTop: Number,
55
- paddingLeft: Number,
56
- paddingRight: Number,
57
- paddingBottom: Number
58
- }
59
- },
60
- data() {
61
- return {
62
- listArr: [],
63
- noDataStyle: {
64
- width: '100%',
65
- height: '180px',
66
- lineHeight: '180px',
67
- fontSize: '30px',
68
- backgroundColor: '#ccc',
69
- color: '#aaa',
70
- textAlign: 'center'
71
- }
72
- };
73
- },
74
- mounted() {
75
- console.log(75);
76
- this.init();
77
- },
78
- methods: {
79
- async init() {
80
- const { goods = [] } = this.props;
81
- const goodsCode = goods.toString();
82
- const paramObj = { goodsCode };
83
- const res = await fetchGoodImpl(this, paramObj);
84
- this.listArr = get(res, 'list', []);
85
- console.log('🐽🐽🐽🐽🐽🐽🐽🐽', this.listArr);
86
- },
87
-
88
- goGoodsDetail(item) {
89
- if (isLc) {
90
- return;
91
- }
92
- const { skuCode, skuNo } = item;
93
- let params = {
94
- skuCode: skuCode,
95
- skuNo: skuNo
96
- };
97
- this.$routers.push('detail', params);
98
- }
99
- }
100
- };
101
- </script>
102
-
103
- <style lang="less" scoped>
104
- .cube-container {
105
- display: grid;
106
- &.two {
107
- grid-template-columns: repeat(2, 1fr);
108
- .goodsName {
109
- padding: 15px 0 2px;
110
- font-size: 16px;
111
- }
112
- .goodsPrice {
113
- padding: 2px 0 20px;
114
- font-size: 14px;
115
- .scribing {
116
- font-size: 12px;
117
- }
118
- }
119
- }
120
- &.one {
121
- grid-template-columns: repeat(1, 1fr);
122
- .goodsName {
123
- padding: 20px 0 5px;
124
- font-size: 20px;
125
- }
126
- .goodsPrice {
127
- padding: 5px 0 20px;
128
- font-size: 18px;
129
- .scribing {
130
- font-size: 14px;
131
- }
132
- }
133
- }
134
-
135
- .cube-item {
136
- img {
137
- width: 100%;
138
- }
139
- .goodsName {
140
- color: #000000;
141
- }
142
- .goodsPrice {
143
- color: #fe4854;
144
-
145
- .scribing {
146
- display: inline-block;
147
- color: #ccc;
148
- text-decoration: line-through;
149
- }
150
- }
151
- }
152
- }
153
- </style>
1
+ <template>
2
+ <div>
3
+ <div v-if="!props.goods" :style="noDataStyle">请选择商品</div>
4
+ <div v-else>
5
+ <div
6
+ :class="['cube-container', props.arrange === 1 ? 'one' : 'two']"
7
+ :style="{
8
+ paddingTop: props.paddingTop + 'px',
9
+ paddingLeft: props.paddingLeft + 'px',
10
+ paddingRight: props.paddingRight + 'px',
11
+ paddingBottom: props.paddingBottom + 'px',
12
+ gap: props.margin + 'px'
13
+ }"
14
+ >
15
+ <div
16
+ v-for="(item, index) in listArr"
17
+ class="cube-item"
18
+ :key="cyy"
19
+ @click="goGoodsDetail(item)"
20
+ >
21
+ <img
22
+ :src="item.dataPic"
23
+ mode="widthFix"
24
+ alt=""
25
+ :style="{
26
+ borderRadius: props.circular === 2 ? '0px' : '10px'
27
+ }"
28
+ />
29
+ <div class="goodsName">{{ item.goodsName }}</div>
30
+ <div class="goodsPrice">
31
+ ¥{{ item.pricesetNprice }}
32
+ <div class="scribing" v-if="props.markedPrice === 1">
33
+ ¥{{ item.pricesetMakeprice }}
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ </div>
40
+ </template>
41
+
42
+ <script>
43
+ import { fetchGoodImpl, isLc } from '../../utils/index.js';
44
+ import { get } from 'lodash-es';
45
+ export default {
46
+ name: 'cyy-goods',
47
+ props: {
48
+ props: {
49
+ SelectGoods: Object,
50
+ arrange: Number,
51
+ circular: Number,
52
+ margin: Number,
53
+ markedPrice: Number,
54
+ paddingTop: Number,
55
+ paddingLeft: Number,
56
+ paddingRight: Number,
57
+ paddingBottom: Number
58
+ }
59
+ },
60
+ data() {
61
+ return {
62
+ listArr: [],
63
+ noDataStyle: {
64
+ width: '100%',
65
+ height: '180px',
66
+ lineHeight: '180px',
67
+ fontSize: '30px',
68
+ backgroundColor: '#ccc',
69
+ color: '#aaa',
70
+ textAlign: 'center'
71
+ }
72
+ };
73
+ },
74
+ mounted() {
75
+ console.log(75);
76
+ this.init();
77
+ },
78
+ methods: {
79
+ async init() {
80
+ const { goods = [] } = this.props;
81
+ const goodsCode = goods.toString();
82
+ const paramObj = { goodsCode };
83
+ const res = await fetchGoodImpl(this, paramObj);
84
+ this.listArr = get(res, 'list', []);
85
+ console.log('🐽🐽🐽🐽🐽🐽🐽🐽', this.listArr);
86
+ },
87
+
88
+ goGoodsDetail(item) {
89
+ if (isLc) {
90
+ return;
91
+ }
92
+ const { skuCode, skuNo } = item;
93
+ let params = {
94
+ skuCode: skuCode,
95
+ skuNo: skuNo
96
+ };
97
+ this.$routers.push('detail', params);
98
+ }
99
+ }
100
+ };
101
+ </script>
102
+
103
+ <style lang="less" scoped>
104
+ .cube-container {
105
+ display: grid;
106
+ &.two {
107
+ grid-template-columns: repeat(2, 1fr);
108
+ .goodsName {
109
+ padding: 15px 0 2px;
110
+ font-size: 16px;
111
+ }
112
+ .goodsPrice {
113
+ padding: 2px 0 20px;
114
+ font-size: 14px;
115
+ .scribing {
116
+ font-size: 12px;
117
+ }
118
+ }
119
+ }
120
+ &.one {
121
+ grid-template-columns: repeat(1, 1fr);
122
+ .goodsName {
123
+ padding: 20px 0 5px;
124
+ font-size: 20px;
125
+ }
126
+ .goodsPrice {
127
+ padding: 5px 0 20px;
128
+ font-size: 18px;
129
+ .scribing {
130
+ font-size: 14px;
131
+ }
132
+ }
133
+ }
134
+
135
+ .cube-item {
136
+ img {
137
+ width: 100%;
138
+ }
139
+ .goodsName {
140
+ color: #000000;
141
+ }
142
+ .goodsPrice {
143
+ color: #fe4854;
144
+
145
+ .scribing {
146
+ display: inline-block;
147
+ color: #ccc;
148
+ text-decoration: line-through;
149
+ }
150
+ }
151
+ }
152
+ }
153
+ </style>
@@ -3,9 +3,10 @@
3
3
  <div v-if="!props.goods" :style="noDataStyle">请选择商品样式一</div>
4
4
  <div v-else>
5
5
  <div class="three-layout">
6
+ 商品样式1
6
7
  <div class="three-layout-title" @click="jumpToSearch()">
7
- <div class="top-left" v-if="title.isShow">{{ title.title || "" }}</div>
8
- <div v-if="more === 1" class="top-right">
8
+ <div class="top-left" v-if="!props.title.isShow">{{ props.title.title || "" }}</div>
9
+ <div v-if="props.more === 1" class="top-right">
9
10
  <div>更多</div>
10
11
  <image :lazy-load="true" src=""></image>
11
12
  </div>
@@ -31,35 +32,6 @@
31
32
  </div>
32
33
  </div>
33
34
  </div>
34
-
35
- <!-- <div v-else>
36
- <div
37
- :class="['cube-container', props.arrange === 1 ? 'one' : 'two']"
38
- :style="{
39
- paddingTop: props.paddingTop + 'px',
40
- paddingLeft: props.paddingLeft + 'px',
41
- paddingRight: props.paddingRight + 'px',
42
- paddingBottom: props.paddingBottom + 'px',
43
- gap: props.margin + 'px',
44
- }"
45
- >
46
- <div v-for="(item, index) in listArr" class="cube-item" :key="cyy" @click="goGoodsDetail(item)">
47
- <img
48
- :src="item.dataPic"
49
- mode="widthFix"
50
- alt=""
51
- :style="{
52
- borderRadius: props.circular === 2 ? '0px' : '10px',
53
- }"
54
- />
55
- <div class="goodsName">{{ item.goodsName }}</div>
56
- <div class="goodsPrice">
57
- ¥{{ item.pricesetNprice }}
58
- <div class="scribing" v-if="props.markedPrice === 1">¥{{ item.pricesetMakeprice }}</div>
59
- </div>
60
- </div>
61
- </div>
62
- </div> -->
63
35
  </div>
64
36
  </template>
65
37
 
@@ -104,11 +76,16 @@ export default {
104
76
  },
105
77
  methods: {
106
78
  async init() {
79
+ console.log(196);
107
80
  const { goods = [] } = this.props;
81
+ console.log(197);
108
82
  const goodsCode = goods.toString();
83
+ console.log(198);
109
84
  const paramObj = { goodsCode };
85
+ console.log(199, paramObj);
110
86
  const res = await fetchGoodImpl(this, paramObj);
111
87
  this.listArr = get(res, "list", []);
88
+ console.log(201);
112
89
  console.log("🐽🐽🐽🐽🐽🐽🐽🐽", this.listArr);
113
90
  },
114
91
 
@@ -137,14 +114,14 @@ export default {
137
114
 
138
115
  <style lang="less" scoped>
139
116
  .three-layout {
140
- border-radius: 28px;
117
+ border-radius: 7px;
141
118
  .mask-three-more {
142
119
  position: absolute;
143
120
  top: 0px;
144
121
  display: block;
145
- width: 392px;
146
- height: 392px;
147
- line-height: 392px;
122
+ width: 98px;
123
+ height: 98px;
124
+ line-height: 98px;
148
125
  background-color: #000;
149
126
  opacity: 0.5;
150
127
  font-size: 52px;
@@ -152,50 +129,50 @@ export default {
152
129
  color: #ffffff;
153
130
  }
154
131
  .three-layout-title {
155
- margin: 60px 50px;
132
+ margin: 15px 12.5px;
156
133
  display: flex;
157
134
  justify-content: space-between;
158
135
  .top-left {
159
- font-size: 64px;
136
+ font-size: 16px;
160
137
  font-family: PingFangSC-Semibold, PingFang SC;
161
138
  font-weight: 600;
162
139
  color: #333333;
163
- line-height: 88px;
140
+ line-height: 22px;
164
141
  }
165
142
  .top-right {
166
143
  display: flex;
167
144
  align-items: center;
168
145
  div {
169
146
  color: #595959;
170
- font-size: 48px;
147
+ font-size: 12px;
171
148
  }
172
149
  image {
173
- width: 24px;
174
- height: 36px;
175
- margin-left: 12px;
150
+ width: 6px;
151
+ height: 9px;
152
+ margin-left: 3px;
176
153
  }
177
154
  }
178
155
  }
179
156
  .three-layout-content {
180
- margin: 60px 58px;
181
- box-shadow: 0px 20px 40px 0px rgba(0, 0, 0, 0.1);
182
- border-radius: 28px;
157
+ margin: 15px 14.5px;
158
+ box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.1);
159
+ border-radius: 7px;
183
160
  background: #fff;
184
161
  .three-layout-bigImg {
185
162
  image {
186
163
  border-radius: 28px 28px 0 0;
187
164
  display: inline-block;
188
165
  width: 100%;
189
- height: 756px;
166
+ height: 189px;
190
167
  }
191
168
  }
192
169
  .three-layout-goods {
193
170
  display: flex;
194
171
  justify-content: center;
195
- padding: 0px 40px;
196
- padding-bottom: 40px;
172
+ padding: 0px 10px;
173
+ padding-bottom: 10px;
197
174
  .goods-items {
198
- width: 424px;
175
+ width: 106px;
199
176
  }
200
177
  }
201
178
  }
@@ -211,31 +188,31 @@ export default {
211
188
 
212
189
  .scroll-item {
213
190
  display: inline-block;
214
- margin-right: 40px;
191
+ margin-right: 10px;
215
192
 
216
193
  image {
217
- width: 392px;
218
- height: 392px;
219
- border-radius: 20px;
194
+ width: 98px;
195
+ height: 98px;
196
+ border-radius: 5px;
220
197
  }
221
198
 
222
199
  p {
223
- width: 392px;
200
+ width: 98px;
224
201
  white-space: normal;
225
202
  display: -webkit-box;
226
203
  -webkit-box-orient: vertical;
227
204
  -webkit-line-clamp: 1;
228
205
  overflow: hidden;
229
- font-size: 48px;
206
+ font-size: 12px;
230
207
  font-family: PingFangSC-Regular, PingFang SC;
231
208
  font-weight: 400;
232
209
  color: #000000;
233
- line-height: 68px;
210
+ line-height: 17px;
234
211
  }
235
212
  }
236
213
  }
237
214
 
238
215
  .scroll-top {
239
- margin-top: 40px;
216
+ margin-top: 10px;
240
217
  }
241
218
  </style>