cyy-vue-material 1.0.10

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,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>
@@ -0,0 +1,267 @@
1
+ <template>
2
+ <view>
3
+ <view class="three-layout">
4
+ <view class="three-layout-title" @click="jumpToSearch(floorList.cmsContlistReDomainList)">
5
+ <view class="top-left" v-if="floorList.conttitleNameNow">{{ floorList.conttitleNameNow || "" }} </view>
6
+ <view class="top-right">
7
+ <view>更多</view>
8
+ <image :lazy-load="true" src="@/static/car/arrow.png"></image>
9
+ </view>
10
+ </view>
11
+
12
+ <view class="three-layout-content">
13
+ <view class="three-layout-bigImg">
14
+ <image :lazy-load="true" :src="floorList.conttitlePicurlNow ? checkImgUrl(floorList.conttitlePicurlNow) : ''" mode="aspectFill"></image>
15
+ </view>
16
+ <view class="three-layout-goods">
17
+ <scroll-view scroll-x="true" scroll-with-animation="true" class="scroll-list scroll-top">
18
+ <view class="scroll-item" v-for="(item, index) in floorList.cmsContlistReDomainList" :key="index" @click="toDetail(item.contlistPicurl3)">
19
+ <image :lazy-load="true" :src="checkImgUrl(item.contlistCon || item.contlistPicurl)" mode="aspectFill" lazy-load="true"></image>
20
+ <view class="mask-three-more" v-if="item.goodsSupplynum <= 0 || item.goodsProperty5 === '1'">{{ maskTitle(item.goodsProperty5) }}</view>
21
+ <p><vop-label :goodsType="item.contlistPrice1"></vop-label>{{ item.contlistName }}</p>
22
+ <view class="price-box">
23
+ <view class="now-price">¥{{ $toFix(item.contlistPrice, 2, 2) || 0 }}</view>
24
+ <view class="origin-price" v-if="item.contlistConNow == 1"> ¥{{ $toFix(item.contlistPicurl1, 2, 2) || 0 }}</view>
25
+ </view>
26
+ </view>
27
+ </scroll-view>
28
+ </view>
29
+ </view>
30
+ </view>
31
+ </view>
32
+ </template>
33
+
34
+ <script>
35
+ import { checkImgUrl } from "@/utils/checkImg.js";
36
+ export default {
37
+ props: {
38
+ floorList: Object, // 楼层数据
39
+ floorSymbol: String,
40
+ },
41
+ data() {
42
+ return {
43
+ checkImgUrl,
44
+ };
45
+ },
46
+ methods: {
47
+ toDetail(item) {
48
+ this.$emit("toDetail", item);
49
+ },
50
+ jumpToSearch(item) {
51
+ this.$emit("jumpToSearch", item, 1);
52
+ },
53
+ maskTitle(presale) {
54
+ if (presale === "1") {
55
+ return "预售中";
56
+ } else {
57
+ return "无库存";
58
+ }
59
+ },
60
+ },
61
+ mounted() {
62
+ // console.log(this.floorList, 'mounted');
63
+ },
64
+ watch: {},
65
+ filters: {},
66
+ };
67
+ </script>
68
+
69
+ <style lang="scss" scoped>
70
+ // 布局为三个一行排列方式 , 也为一部分通用部分
71
+ .three-layout {
72
+ // margin: 30rpx 25rpx;
73
+ // box-shadow: 0px 10rpx 20rpx 0px rgba(0, 0, 0, 0.1);
74
+ border-radius: 14rpx;
75
+ // background: pink;
76
+ // padding: 27rpx 20rpx 0rpx;
77
+ .mask {
78
+ position: absolute;
79
+ display: block;
80
+ width: 108rpx;
81
+ height: 108rpx;
82
+ line-height: 108rpx;
83
+ background-color: #000;
84
+ opacity: 0.5;
85
+ font-size: 26 rpx;
86
+ text-align: center;
87
+ color: #ffffff;
88
+ }
89
+ .mask-three-nomore {
90
+ position: absolute;
91
+ top: 0;
92
+ display: block;
93
+ width: 196rpx;
94
+ height: 196rpx;
95
+ line-height: 196rpx;
96
+ background-color: #000;
97
+ opacity: 0.5;
98
+ font-size: 26 rpx;
99
+ text-align: center;
100
+ color: #ffffff;
101
+ }
102
+ .mask-three-more {
103
+ position: absolute;
104
+ top: 0rpx;
105
+ display: block;
106
+ width: 196rpx;
107
+ height: 196rpx;
108
+ line-height: 196rpx;
109
+ background-color: #000;
110
+ opacity: 0.5;
111
+ font-size: 26 rpx;
112
+ text-align: center;
113
+ color: #ffffff;
114
+ }
115
+ .three-layout-title {
116
+ margin: 30rpx 25rpx;
117
+ display: flex;
118
+ justify-content: space-between;
119
+ .top-left {
120
+ font-size: 32rpx;
121
+ font-family: PingFangSC-Semibold, PingFang SC;
122
+ font-weight: 600;
123
+ color: #333333;
124
+ line-height: 44rpx;
125
+ }
126
+ .top-right {
127
+ display: flex;
128
+ align-items: center;
129
+ view {
130
+ color: #595959;
131
+ font-size: 24rpx;
132
+ }
133
+ image {
134
+ width: 12rpx;
135
+ height: 18rpx;
136
+ margin-left: 6rpx;
137
+ }
138
+ }
139
+ }
140
+ .three-layout-content {
141
+ margin: 30rpx 29rpx;
142
+ box-shadow: 0px 10rpx 20rpx 0px rgba(0, 0, 0, 0.1);
143
+ border-radius: 14rpx;
144
+ // border: 4rpx solid #f6f6f6;
145
+ background: #fff;
146
+ .three-layout-bigImg {
147
+ image {
148
+ border-radius: 14rpx 14rpx 0 0;
149
+ display: inline-block;
150
+ width: 100%;
151
+ height: 378rpx;
152
+ }
153
+ }
154
+ .three-layout-goods {
155
+ display: flex;
156
+ justify-content: center;
157
+ padding: 0rpx 20rpx;
158
+ padding-bottom: 20rpx;
159
+ .goods-items {
160
+ width: 212rpx;
161
+ }
162
+ }
163
+ }
164
+ }
165
+
166
+ .scroll-list {
167
+ width: 100%;
168
+ white-space: nowrap;
169
+ overflow: hidden;
170
+ // padding: 0 16rpx;
171
+ display: flex;
172
+ justify-content: space-between;
173
+ box-sizing: border-box;
174
+ // margin-top: 20rpx;
175
+
176
+ .scroll-item {
177
+ display: inline-block;
178
+ margin-right: 20rpx;
179
+
180
+ image {
181
+ width: 196rpx;
182
+ height: 196rpx;
183
+ border-radius: 10rpx;
184
+ }
185
+
186
+ p {
187
+ width: 196rpx;
188
+ white-space: normal;
189
+ display: -webkit-box;
190
+ -webkit-box-orient: vertical;
191
+ -webkit-line-clamp: 1;
192
+ overflow: hidden;
193
+ font-size: 24rpx;
194
+ font-family: PingFangSC-Regular, PingFang SC;
195
+ font-weight: 400;
196
+ color: #000000;
197
+ line-height: 34rpx;
198
+ }
199
+
200
+ .price-box {
201
+ margin-top: 5rpx;
202
+ display: flex;
203
+ align-items: center;
204
+
205
+ .now-price {
206
+ color: #eb2b27;
207
+ font-weight: bold;
208
+ font-size: 24rpx;
209
+ }
210
+
211
+ .origin-price {
212
+ color: #8c8c8c;
213
+ font-size: 22rpx;
214
+ text-decoration: line-through;
215
+ margin-left: 8rpx;
216
+ }
217
+ }
218
+ }
219
+ .un-scroll-item {
220
+ display: inline-block;
221
+ margin-right: 15rpx;
222
+
223
+ image {
224
+ width: 196rpx;
225
+ height: 196rpx;
226
+ // border-radius: 10rpx;
227
+ }
228
+
229
+ p {
230
+ width: 196rpx;
231
+ white-space: normal;
232
+ display: -webkit-box;
233
+ -webkit-box-orient: vertical;
234
+ -webkit-line-clamp: 1;
235
+ overflow: hidden;
236
+ font-size: 24rpx;
237
+ font-family: PingFangSC-Regular, PingFang SC;
238
+ font-weight: 400;
239
+ color: #000000;
240
+ line-height: 34rpx;
241
+ }
242
+
243
+ .price-box {
244
+ margin-top: 5rpx;
245
+ display: flex;
246
+ align-items: center;
247
+
248
+ .now-price {
249
+ color: #eb2b27;
250
+ font-weight: bold;
251
+ font-size: 24rpx;
252
+ }
253
+
254
+ .origin-price {
255
+ color: #8c8c8c;
256
+ font-size: 22rpx;
257
+ text-decoration: line-through;
258
+ margin-left: 8rpx;
259
+ }
260
+ }
261
+ }
262
+ }
263
+
264
+ .scroll-top {
265
+ margin-top: 20rpx;
266
+ }
267
+ </style>
@@ -0,0 +1,241 @@
1
+ <template>
2
+ <div>
3
+ <div v-if="!props.goods" :style="noDataStyle">请选择商品样式一</div>
4
+ <div v-else>
5
+ <div class="three-layout">
6
+ <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">
9
+ <div>更多</div>
10
+ <image :lazy-load="true" src=""></image>
11
+ </div>
12
+ </div>
13
+
14
+ <div class="three-layout-content">
15
+ <div class="three-layout-bigImg">
16
+ <image :lazy-load="true" :src="bill ? bill : ''" mode="aspectFill"></image>
17
+ </div>
18
+ <div class="three-layout-goods">
19
+ <scroll-div scroll-x="true" scroll-with-animation="true" class="scroll-list scroll-top">
20
+ <div class="scroll-item" v-for="(item, index) in listArr" :key="index" @click="toDetail()">
21
+ <image :lazy-load="true" src="" mode="aspectFill" lazy-load="true"></image>
22
+ <div class="mask-three-more" v-if="item.goodsSupplynum <= 0 || item.goodsProperty5 === '1'">{{ maskTitle(item.goodsProperty5) }}</div>
23
+ <p><vop-label :goodsType="item.contlistPrice1"></vop-label>{{ item.contlistName }}</p>
24
+ <div class="price-bo x">
25
+ <div class="now-price">¥{{ toFix(item.contlistPrice, 2, 2) || 0 }}</div>
26
+ <div class="origin-price" v-if="item.contlistConNow == 1">¥{{ toFix(item.contlistPicurl1, 2, 2) || 0 }}</div>
27
+ </div>
28
+ </div>
29
+ </scroll-div>
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </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
+ </div>
64
+ </template>
65
+
66
+ <script>
67
+ import { fetchGoodImpl, isLc } from "../../utils/index.js";
68
+ import { get } from "lodash-es";
69
+ export default {
70
+ name: "cyy-goodsOne",
71
+ props: {
72
+ props: {
73
+ title: Object,
74
+ more: Number,
75
+ bill: String,
76
+ SelectGoods: Object,
77
+ arrange: Number,
78
+ circular: Number,
79
+ margin: Number,
80
+ markedPrice: Number,
81
+ paddingTop: Number,
82
+ paddingLeft: Number,
83
+ paddingRight: Number,
84
+ paddingBottom: Number,
85
+ },
86
+ },
87
+ data() {
88
+ return {
89
+ listArr: [],
90
+ noDataStyle: {
91
+ width: "100%",
92
+ height: "180px",
93
+ lineHeight: "180px",
94
+ fontSize: "30px",
95
+ backgroundColor: "#ccc",
96
+ color: "#aaa",
97
+ textAlign: "center",
98
+ },
99
+ };
100
+ },
101
+ mounted() {
102
+ console.log(75);
103
+ this.init();
104
+ },
105
+ methods: {
106
+ async init() {
107
+ const { goods = [] } = this.props;
108
+ const goodsCode = goods.toString();
109
+ const paramObj = { goodsCode };
110
+ const res = await fetchGoodImpl(this, paramObj);
111
+ this.listArr = get(res, "list", []);
112
+ console.log("🐽🐽🐽🐽🐽🐽🐽🐽", this.listArr);
113
+ },
114
+
115
+ goGoodsDetail(item) {
116
+ if (isLc) {
117
+ return;
118
+ }
119
+ const { skuCode, skuNo } = item;
120
+ let params = {
121
+ skuCode: skuCode,
122
+ skuNo: skuNo,
123
+ };
124
+ this.$routers.push("detail", params);
125
+ },
126
+ jumpToSearch() {},
127
+ },
128
+ maskTitle(presale) {
129
+ if (presale === "1") {
130
+ return "预售中";
131
+ } else {
132
+ return "无库存";
133
+ }
134
+ },
135
+ };
136
+ </script>
137
+
138
+ <style lang="less" scoped>
139
+ .three-layout {
140
+ border-radius: 28px;
141
+ .mask-three-more {
142
+ position: absolute;
143
+ top: 0px;
144
+ display: block;
145
+ width: 392px;
146
+ height: 392px;
147
+ line-height: 392px;
148
+ background-color: #000;
149
+ opacity: 0.5;
150
+ font-size: 52px;
151
+ text-align: center;
152
+ color: #ffffff;
153
+ }
154
+ .three-layout-title {
155
+ margin: 60px 50px;
156
+ display: flex;
157
+ justify-content: space-between;
158
+ .top-left {
159
+ font-size: 64px;
160
+ font-family: PingFangSC-Semibold, PingFang SC;
161
+ font-weight: 600;
162
+ color: #333333;
163
+ line-height: 88px;
164
+ }
165
+ .top-right {
166
+ display: flex;
167
+ align-items: center;
168
+ div {
169
+ color: #595959;
170
+ font-size: 48px;
171
+ }
172
+ image {
173
+ width: 24px;
174
+ height: 36px;
175
+ margin-left: 12px;
176
+ }
177
+ }
178
+ }
179
+ .three-layout-content {
180
+ margin: 60px 58px;
181
+ box-shadow: 0px 20px 40px 0px rgba(0, 0, 0, 0.1);
182
+ border-radius: 28px;
183
+ background: #fff;
184
+ .three-layout-bigImg {
185
+ image {
186
+ border-radius: 28px 28px 0 0;
187
+ display: inline-block;
188
+ width: 100%;
189
+ height: 756px;
190
+ }
191
+ }
192
+ .three-layout-goods {
193
+ display: flex;
194
+ justify-content: center;
195
+ padding: 0px 40px;
196
+ padding-bottom: 40px;
197
+ .goods-items {
198
+ width: 424px;
199
+ }
200
+ }
201
+ }
202
+ }
203
+
204
+ .scroll-list {
205
+ width: 100%;
206
+ white-space: nowrap;
207
+ overflow: hidden;
208
+ display: flex;
209
+ justify-content: space-between;
210
+ box-sizing: border-box;
211
+
212
+ .scroll-item {
213
+ display: inline-block;
214
+ margin-right: 40px;
215
+
216
+ image {
217
+ width: 392px;
218
+ height: 392px;
219
+ border-radius: 20px;
220
+ }
221
+
222
+ p {
223
+ width: 392px;
224
+ white-space: normal;
225
+ display: -webkit-box;
226
+ -webkit-box-orient: vertical;
227
+ -webkit-line-clamp: 1;
228
+ overflow: hidden;
229
+ font-size: 48px;
230
+ font-family: PingFangSC-Regular, PingFang SC;
231
+ font-weight: 400;
232
+ color: #000000;
233
+ line-height: 68px;
234
+ }
235
+ }
236
+ }
237
+
238
+ .scroll-top {
239
+ margin-top: 40px;
240
+ }
241
+ </style>