|
@@ -1,5 +1,5 @@
|
1
|
1
|
<template>
|
2
|
|
- <div class="page">
|
|
2
|
+ <div class="page" :class="{'page--iphoneX': iphoneX}">
|
3
|
3
|
<div class="form-card">
|
4
|
4
|
<section class="form-item">
|
5
|
5
|
<div class="label">
|
|
@@ -9,8 +9,13 @@
|
9
|
9
|
<div class="box">
|
10
|
10
|
<input type="text" />
|
11
|
11
|
</div>
|
12
|
|
- <div class="tool">
|
13
|
|
- <span class="unit">元</span>
|
|
12
|
+ <div class="tool code-tool">
|
|
13
|
+ <span class="generate">生成</span>
|
|
14
|
+ <my-image
|
|
15
|
+ class="scan-img"
|
|
16
|
+ @click="scan"
|
|
17
|
+ src="/static/icon/scan.png"
|
|
18
|
+ ></my-image>
|
14
|
19
|
</div>
|
15
|
20
|
</section>
|
16
|
21
|
<section class="form-item">
|
|
@@ -28,7 +33,13 @@
|
28
|
33
|
分类:
|
29
|
34
|
</div>
|
30
|
35
|
<div class="box">
|
31
|
|
- <input type="text" />
|
|
36
|
+ <picker :mode="'multiSelector'" :range="cateList">
|
|
37
|
+ <input
|
|
38
|
+ type="text"
|
|
39
|
+ :disabled="true"
|
|
40
|
+ placeholder="请选择"
|
|
41
|
+ />
|
|
42
|
+ </picker>
|
32
|
43
|
</div>
|
33
|
44
|
</section>
|
34
|
45
|
<section class="form-item">
|
|
@@ -37,7 +48,10 @@
|
37
|
48
|
重量:
|
38
|
49
|
</div>
|
39
|
50
|
<div class="box">
|
40
|
|
- <input type="text" />
|
|
51
|
+ <input type="digit" />
|
|
52
|
+ </div>
|
|
53
|
+ <div class="tool">
|
|
54
|
+ <span class="">kg</span>
|
41
|
55
|
</div>
|
42
|
56
|
</section>
|
43
|
57
|
<section class="form-item">
|
|
@@ -46,7 +60,10 @@
|
46
|
60
|
售价:
|
47
|
61
|
</div>
|
48
|
62
|
<div class="box">
|
49
|
|
- <input type="text" />
|
|
63
|
+ <input type="digit" />
|
|
64
|
+ </div>
|
|
65
|
+ <div class="tool">
|
|
66
|
+ <span class="">元</span>
|
50
|
67
|
</div>
|
51
|
68
|
</section>
|
52
|
69
|
<section class="form-item">
|
|
@@ -55,7 +72,10 @@
|
55
|
72
|
划线价:
|
56
|
73
|
</div>
|
57
|
74
|
<div class="box">
|
58
|
|
- <input type="text" />
|
|
75
|
+ <input type="digit" />
|
|
76
|
+ </div>
|
|
77
|
+ <div class="tool">
|
|
78
|
+ <span class="">元</span>
|
59
|
79
|
</div>
|
60
|
80
|
</section>
|
61
|
81
|
<section class="form-item">
|
|
@@ -64,28 +84,172 @@
|
64
|
84
|
库存:
|
65
|
85
|
</div>
|
66
|
86
|
<div class="box">
|
67
|
|
- <input type="text" />
|
|
87
|
+ <input type="number" />
|
|
88
|
+ </div>
|
|
89
|
+ </section>
|
|
90
|
+ </div>
|
|
91
|
+
|
|
92
|
+ <div class="form-card">
|
|
93
|
+ <div class="head">
|
|
94
|
+ <div class="tit">其他信息</div>
|
|
95
|
+ <div class="switch">
|
|
96
|
+ <switch :checked="showOther" @change="otherChange"></switch>
|
|
97
|
+ </div>
|
|
98
|
+ </div>
|
|
99
|
+ <block v-if="showOther">
|
|
100
|
+ <section class="form-item">
|
|
101
|
+ <div class="label">
|
|
102
|
+ <span class="required">*</span>
|
|
103
|
+ 模板详情:
|
|
104
|
+ </div>
|
|
105
|
+ <div class="box">
|
|
106
|
+ <radio-group @change="tempChange">
|
|
107
|
+ <label>
|
|
108
|
+ <radio :value="true" />
|
|
109
|
+ <text>是</text>
|
|
110
|
+ </label>
|
|
111
|
+ <label>
|
|
112
|
+ <radio :value="false" />
|
|
113
|
+ <text>否</text>
|
|
114
|
+ </label>
|
|
115
|
+ </radio-group>
|
|
116
|
+ </div>
|
|
117
|
+ </section>
|
|
118
|
+ <section class="form-item">
|
|
119
|
+ <div class="label">
|
|
120
|
+ <span class="required">*</span>
|
|
121
|
+ 初始销量:
|
|
122
|
+ </div>
|
|
123
|
+ <div class="box">
|
|
124
|
+ <input type="number" />
|
|
125
|
+ </div>
|
|
126
|
+ </section>
|
|
127
|
+ <section class="form-item">
|
|
128
|
+ <div class="label">
|
|
129
|
+ <span class="required">*</span>
|
|
130
|
+ 出售方式:
|
|
131
|
+ </div>
|
|
132
|
+ <div class="box">
|
|
133
|
+ <picker :mode="'selector'" :range="sellType">
|
|
134
|
+ <input type="text" :disabled="true" placeholder="请选择"/>
|
|
135
|
+ </picker>
|
|
136
|
+ </div>
|
|
137
|
+ </section>
|
|
138
|
+ <section class="form-item">
|
|
139
|
+ <div class="label">
|
|
140
|
+ <span class="required">*</span>
|
|
141
|
+ 限购数:
|
|
142
|
+ </div>
|
|
143
|
+ <div class="box">
|
|
144
|
+ <input type="number" />
|
|
145
|
+ </div>
|
|
146
|
+ </section>
|
|
147
|
+ <section class="form-item">
|
|
148
|
+ <div class="label">
|
|
149
|
+ <span class="required">*</span>
|
|
150
|
+ 供应商:
|
|
151
|
+ </div>
|
|
152
|
+ <div class="box">
|
|
153
|
+ <picker :mode="'selector'" :range="supplierList">
|
|
154
|
+ <input type="text" :disabled="true" placeholder="请选择"/>
|
|
155
|
+ </picker>
|
|
156
|
+ </div>
|
|
157
|
+ </section>
|
|
158
|
+ </block>
|
|
159
|
+ </div>
|
|
160
|
+
|
|
161
|
+ <div class="form-card img-card">
|
|
162
|
+ <section class="form-img-item">
|
|
163
|
+ <div class="tit">封面图</div>
|
|
164
|
+ <div class="list">
|
|
165
|
+ <easy-upload :types="'image'" :dataList="coverImg" :uploadUrl="'http://localhost:3000/upload'" :uploadCount="1" @successImage="successImage"></easy-upload>
|
|
166
|
+ </div>
|
|
167
|
+ </section>
|
|
168
|
+ <section class="form-img-item">
|
|
169
|
+ <div class="tit">主图</div>
|
|
170
|
+ <div class="list">
|
|
171
|
+ <easy-upload :types="'image'" :dataList="mainImg" :uploadUrl="'http://localhost:3000/upload'" :uploadCount="100" @successImage="successImage"></easy-upload>
|
|
172
|
+ </div>
|
|
173
|
+ </section>
|
|
174
|
+ <section class="form-img-item">
|
|
175
|
+ <div class="tit">详情图</div>
|
|
176
|
+ <div class="list">
|
|
177
|
+ <easy-upload :types="'image'" :dataList="detailImg" :uploadUrl="'http://localhost:3000/upload'" :uploadCount="100" @successImage="successImage"></easy-upload>
|
68
|
178
|
</div>
|
69
|
179
|
</section>
|
70
|
180
|
</div>
|
|
181
|
+
|
|
182
|
+ <button type="button" class="btn">保存</button>
|
71
|
183
|
</div>
|
72
|
184
|
</template>
|
73
|
185
|
|
74
|
186
|
<script>
|
75
|
187
|
import MyImage from "../../components/image/index";
|
|
188
|
+import easyUpload from "../../components/easy-upload/easy-upload";
|
76
|
189
|
|
77
|
190
|
export default {
|
78
|
191
|
name: "",
|
79
|
|
- components: { MyImage },
|
|
192
|
+ components: { MyImage,easyUpload },
|
80
|
193
|
|
81
|
194
|
// 数据
|
82
|
195
|
data() {
|
83
|
|
- return {};
|
|
196
|
+ return {
|
|
197
|
+ cateList: [], // 分类列表
|
|
198
|
+ sellType:['立即开售','放入仓库'], // 出售方式
|
|
199
|
+ supplierList:['测试供应商'], // 供应商
|
|
200
|
+ showOther: true,
|
|
201
|
+ mainImg:[],
|
|
202
|
+ coverImg:[],
|
|
203
|
+ detailImg:[],
|
|
204
|
+ };
|
|
205
|
+ },
|
|
206
|
+
|
|
207
|
+ async onShow() {
|
|
208
|
+ this.cateList = [
|
|
209
|
+ [1, 2, 3, 4, 5],
|
|
210
|
+ ["一", "二", "三", "四", "五"],
|
|
211
|
+ ];
|
84
|
212
|
},
|
85
|
213
|
|
86
|
|
- async onShow() {},
|
87
|
214
|
// 函数
|
88
|
|
- methods: {},
|
|
215
|
+ methods: {
|
|
216
|
+ // 条码扫描
|
|
217
|
+ scan() {
|
|
218
|
+ let self = this;
|
|
219
|
+ wx.scanCode({
|
|
220
|
+ success(res) {
|
|
221
|
+ console.log(res);
|
|
222
|
+ },
|
|
223
|
+ fail(res) {
|
|
224
|
+ console.log("扫码失败:", res);
|
|
225
|
+ },
|
|
226
|
+ });
|
|
227
|
+ },
|
|
228
|
+
|
|
229
|
+ // 生成条码
|
|
230
|
+ generateBarCode() {
|
|
231
|
+ // 后台编码生成方式
|
|
232
|
+ const timestamp = Date.parse(new Date());
|
|
233
|
+ },
|
|
234
|
+
|
|
235
|
+ // 其他面板切换
|
|
236
|
+ otherChange(e) {
|
|
237
|
+ this.showOther = !this.showOther;
|
|
238
|
+ },
|
|
239
|
+
|
|
240
|
+ // 模板详情切换
|
|
241
|
+ tempChange(e) {
|
|
242
|
+ let val = e.target.value;
|
|
243
|
+ if (val === "true") {
|
|
244
|
+ } else {
|
|
245
|
+ }
|
|
246
|
+ },
|
|
247
|
+
|
|
248
|
+ // 上传成功
|
|
249
|
+ successImage(e){
|
|
250
|
+ console.log(e);
|
|
251
|
+ }
|
|
252
|
+ },
|
89
|
253
|
|
90
|
254
|
// 数据计算
|
91
|
255
|
computed: {},
|
|
@@ -99,13 +263,26 @@ export default {
|
99
|
263
|
.form-card {
|
100
|
264
|
background-color: #fff;
|
101
|
265
|
padding: 0 px(30);
|
|
266
|
+ & ~ .form-card {
|
|
267
|
+ margin-top: px(25);
|
|
268
|
+ }
|
|
269
|
+ .head {
|
|
270
|
+ display: flex;
|
|
271
|
+ align-items: center;
|
|
272
|
+ justify-content: space-between;
|
|
273
|
+ height: px(140);
|
|
274
|
+ background-color: #fbfbfb;
|
|
275
|
+ border-bottom: 1px solid #f1f1f1;
|
|
276
|
+ border-top: 1px solid #f1f1f1;
|
|
277
|
+ font-size: px(48);
|
|
278
|
+ }
|
102
|
279
|
}
|
103
|
280
|
.form-item {
|
104
|
281
|
display: flex;
|
105
|
282
|
font-size: px(44);
|
106
|
283
|
height: px(140);
|
107
|
284
|
align-items: center;
|
108
|
|
- &~.form-item {
|
|
285
|
+ & ~ .form-item {
|
109
|
286
|
border-top: 1px solid #f1f1f1;
|
110
|
287
|
}
|
111
|
288
|
.label {
|
|
@@ -125,8 +302,52 @@ export default {
|
125
|
302
|
color: #999;
|
126
|
303
|
margin-left: px(10);
|
127
|
304
|
}
|
128
|
|
- .required{
|
|
305
|
+ .required {
|
129
|
306
|
color: #f00;
|
130
|
307
|
}
|
131
|
308
|
}
|
|
309
|
+.code-tool {
|
|
310
|
+ display: flex;
|
|
311
|
+ justify-content: flex-start;
|
|
312
|
+ align-items: center;
|
|
313
|
+ .scan-img {
|
|
314
|
+ flex-shrink: 0;
|
|
315
|
+ width: px(80);
|
|
316
|
+ height: px(80);
|
|
317
|
+ /deep/ img {
|
|
318
|
+ width: px(80);
|
|
319
|
+ height: px(80);
|
|
320
|
+ }
|
|
321
|
+ }
|
|
322
|
+ .generate {
|
|
323
|
+ color: #0097d1;
|
|
324
|
+ margin-right: px(30);
|
|
325
|
+ flex-shrink: 0;
|
|
326
|
+ }
|
|
327
|
+}
|
|
328
|
+radio-group{
|
|
329
|
+ label~label{
|
|
330
|
+ margin-left: px(40);
|
|
331
|
+ }
|
|
332
|
+}
|
|
333
|
+.img-card{
|
|
334
|
+ padding-top: px(30);
|
|
335
|
+ padding-bottom: px(30);
|
|
336
|
+}
|
|
337
|
+.form-img-item{
|
|
338
|
+ .tit{
|
|
339
|
+ padding: px(30);
|
|
340
|
+ font-size: px(44);
|
|
341
|
+ }
|
|
342
|
+ .list{
|
|
343
|
+
|
|
344
|
+ }
|
|
345
|
+}
|
|
346
|
+.btn{
|
|
347
|
+ margin-top: px(60);
|
|
348
|
+ background-color: rgb(0, 188, 38);
|
|
349
|
+ color: #fff;
|
|
350
|
+ border-radius: 0;
|
|
351
|
+ border: none;
|
|
352
|
+}
|
132
|
353
|
</style>
|