|
@@ -19,9 +19,12 @@
|
19
|
19
|
></my-image>
|
20
|
20
|
</div>
|
21
|
21
|
<div class="tool">
|
22
|
|
- <!-- <span class="status" :class="{ up: item.status === 1 }">{{
|
23
|
|
- item.status === 0 ? "下架" : "上架"
|
24
|
|
- }}</span> -->
|
|
22
|
+ <span
|
|
23
|
+ class="status"
|
|
24
|
+ :class="{ up: item.status === 0 }"
|
|
25
|
+ @click="setOnline(item)"
|
|
26
|
+ >{{ item.status === 0 ? "下架中" : "上架中" }}</span
|
|
27
|
+ >
|
25
|
28
|
<div class="setting" @click="setting(item, 'root')">
|
26
|
29
|
设置
|
27
|
30
|
</div>
|
|
@@ -45,9 +48,14 @@
|
45
|
48
|
</div>
|
46
|
49
|
</div>
|
47
|
50
|
<div class="tool">
|
48
|
|
- <!-- <span class="status" :class="{ up: item.status === 1 }">{{
|
49
|
|
- item.status === 0 ? "下架" : "上架"
|
50
|
|
- }}</span> -->
|
|
51
|
+ <span
|
|
52
|
+ class="status"
|
|
53
|
+ :class="{ up: child.status === 0 }"
|
|
54
|
+ @click="setOnline(child)"
|
|
55
|
+ >{{
|
|
56
|
+ child.status === 0 ? "下架中" : "上架中"
|
|
57
|
+ }}</span
|
|
58
|
+ >
|
51
|
59
|
<div class="setting" @click="setting(child)">
|
52
|
60
|
设置
|
53
|
61
|
</div>
|
|
@@ -215,6 +223,47 @@ export default {
|
215
|
223
|
},
|
216
|
224
|
});
|
217
|
225
|
},
|
|
226
|
+ // 上下架
|
|
227
|
+ setOnline(val) {
|
|
228
|
+ if (val.status === 0) {
|
|
229
|
+ //下架中,点击上架
|
|
230
|
+ this.api
|
|
231
|
+ .get("/Product/TypeGoOnline", {
|
|
232
|
+ typeId: val.id,
|
|
233
|
+ })
|
|
234
|
+ .then((res) => {
|
|
235
|
+ if (res.success) {
|
|
236
|
+ // this.fn.showToast("上架成功");
|
|
237
|
+ val.status = 1;
|
|
238
|
+ this.$forceUpdate();
|
|
239
|
+ } else {
|
|
240
|
+ this.fn.showModal({
|
|
241
|
+ title: "上架失败",
|
|
242
|
+ content: res.message,
|
|
243
|
+ showCancel: false,
|
|
244
|
+ });
|
|
245
|
+ }
|
|
246
|
+ });
|
|
247
|
+ } else {
|
|
248
|
+ this.api
|
|
249
|
+ .get("/Product/TypeGoOffline", {
|
|
250
|
+ typeId: val.id,
|
|
251
|
+ })
|
|
252
|
+ .then((res) => {
|
|
253
|
+ if (res.success) {
|
|
254
|
+ // this.fn.showToast("下架成功");
|
|
255
|
+ val.status = 0;
|
|
256
|
+ this.$forceUpdate();
|
|
257
|
+ } else {
|
|
258
|
+ this.fn.showModal({
|
|
259
|
+ title: "下架失败",
|
|
260
|
+ content: res.message,
|
|
261
|
+ showCancel: false,
|
|
262
|
+ });
|
|
263
|
+ }
|
|
264
|
+ });
|
|
265
|
+ }
|
|
266
|
+ },
|
218
|
267
|
},
|
219
|
268
|
|
220
|
269
|
// 数据计算
|
|
@@ -316,14 +365,15 @@ export default {
|
316
|
365
|
}
|
317
|
366
|
}
|
318
|
367
|
.status {
|
319
|
|
- width: px(88);
|
320
|
|
- height: px(40);
|
|
368
|
+ width: px(120);
|
|
369
|
+ height: px(44);
|
321
|
370
|
background-color: #e7faf0;
|
322
|
371
|
border-radius: px(8);
|
323
|
372
|
border: 1px solid #d0f5e0;
|
324
|
373
|
font-size: px(32);
|
325
|
374
|
color: #13ce66;
|
326
|
|
- margin-right: px(20);
|
|
375
|
+ padding: px(6) px(3);
|
|
376
|
+ margin-right: px(30);
|
327
|
377
|
display: flex;
|
328
|
378
|
align-items: center;
|
329
|
379
|
justify-content: center;
|