cr %!s(int64=3) %!d(string=hai) anos
pai
achega
870159b5b7
Modificáronse 3 ficheiros con 76 adicións e 89 borrados
  1. 1 1
      src/pages/index/index.vue
  2. 2 2
      src/pages/manage/index.vue
  3. 73 86
      src/pages/yx/brand.vue

+ 1 - 1
src/pages/index/index.vue

@@ -625,7 +625,7 @@ export default {
625 625
                 title: "加载中...",
626 626
             });
627 627
             self.api
628
-                .get("/Order/GetList", {
628
+                .get("/Supplier/GetOrderList", {
629 629
                     storeId: this.curShopId || "",
630 630
                     status: self.list[self.tab].status,
631 631
                     pageIndex: self.list[self.tab].page,

+ 2 - 2
src/pages/manage/index.vue

@@ -38,13 +38,13 @@
38 38
                     ></my-image>
39 39
                     <span class="text">售后处理</span>
40 40
                 </li>
41
-                <li class="item" @click="jump('/pages/yx/order/index')">
41
+                <!-- <li class="item" @click="jump('/pages/yx/order/index')">
42 42
                     <my-image
43 43
                         class="img"
44 44
                         src="/static/icon/cashier-list.png"
45 45
                     ></my-image>
46 46
                     <span class="text">订单处理</span>
47
-                </li>
47
+                </li> -->
48 48
             </ul>
49 49
         </div>
50 50
 

+ 73 - 86
src/pages/yx/brand.vue

@@ -23,8 +23,7 @@
23 23
                         <li
24 24
                             class="category__item"
25 25
                             :class="{
26
-                                'category__item--active':
27
-                                    cateId === 'all',
26
+                                'category__item--active': cateId === 'all',
28 27
                             }"
29 28
                             @click="setCategory('all')"
30 29
                         >
@@ -77,9 +76,7 @@
77 76
                                         ></my-image>
78 77
                                         <div class="goods__info">
79 78
                                             <div class="goods__box">
80
-                                                <div
81
-                                                    class="goods__title"
82
-                                                >
79
+                                                <div class="goods__title">
83 80
                                                     {{ item.brandName }}
84 81
                                                 </div>
85 82
                                                 <div class="goods__sale black">
@@ -119,7 +116,7 @@
119 116
                                             <!-- 登录 -->
120 117
                                         </div>
121 118
                                     </div>
122
-<!-- 
119
+
123 120
                                     <div class="btns">
124 121
                                         <div
125 122
                                             class="btn"
@@ -136,24 +133,21 @@
136 133
                                             @click="setActivityDisplay(item)"
137 134
                                         >
138 135
                                             {{
139
-                                                item.display === 1
140
-                                                    ? "隐藏"
141
-                                                    : "取消隐藏"
136
+                                                item.display === 0
137
+                                                    ? "上线"
138
+                                                    : "下线"
142 139
                                             }}
143 140
                                         </div>
144 141
                                         <div
145 142
                                             class="btn"
146 143
                                             @click="pushGive(item)"
147 144
                                         >
148
-                                            推送到群
145
+                                            编辑
149 146
                                         </div>
150
-                                        <div
151
-                                            class="btn"
152
-                                            @click="shareApp(item)"
153
-                                        >
154
-                                            分享
147
+                                        <div class="btn" @click="item(item)">
148
+                                            删除
155 149
                                         </div>
156
-                                    </div> -->
150
+                                    </div>
157 151
                                 </li>
158 152
                             </ul>
159 153
                             <div
@@ -232,7 +226,7 @@ export default {
232 226
                 return `距结束还有${Math.floor(mius / hour)}小时`;
233 227
             } else if (mius < month) {
234 228
                 return `距结束还有${Math.floor(mius / day)}天`;
235
-            } else{
229
+            } else {
236 230
                 return `结束时间:${plugin.dateFormat(dateStr, "MM-dd hh:mm")}`;
237 231
             }
238 232
         },
@@ -292,7 +286,7 @@ export default {
292 286
                 pageIndex: this.activityPageIndex++,
293 287
                 // display: this.display,
294 288
             };
295
-            if(this.cateId !== 'all'){
289
+            if (this.cateId !== "all") {
296 290
                 sendData.cateId = this.cateId;
297 291
             }
298 292
             if (this.searchVal) {
@@ -336,65 +330,58 @@ export default {
336 330
 
337 331
         //  设置活动置顶
338 332
         setActivityTop(val) {
339
-            if (val.top > 0) {
340
-                // 取消置顶
341
-                this.api
342
-                    .get("/Yx/CancelActivityTop", {
343
-                        aid: val.aid,
344
-                    })
345
-                    .then((res) => {
346
-                        if (res.success) {
333
+            if (this.user.roleId !== "0") {
334
+                return this.fn.showToast("需管理员账号才能执行此操作");
335
+            }
336
+            this.api
337
+                .get(
338
+                    "/Supplier/SetActivityTop",
339
+                    {
340
+                        aid: val.activityNo,
341
+                        untop: val.top > 0 ? true : false,
342
+                    },
343
+                    { pass: true }
344
+                )
345
+                .then((res) => {
346
+                    if (res.success) {
347
+                        if (val.top > 0) {
347 348
                             val.top = 0;
348
-                            this.$forceUpdate();
349
-                            this.fn.showToast("取消成功");
350 349
                         } else {
351
-                            this.fn.showModal({
352
-                                title: "设置失败",
353
-                                content: res.message,
354
-                                showCancel: false,
355
-                            });
350
+                            val.top = 999;
356 351
                         }
357
-                    });
358
-            } else {
359
-                // 置顶
360
-                this.api
361
-                    .get("/Yx/SetActivityTop", {
362
-                        aid: val.aid,
363
-                    })
364
-                    .then((res) => {
365
-                        if (res.success) {
366
-                            val.top = 1;
367
-                            this.$forceUpdate();
368
-                            this.fn.showToast("置顶成功");
369
-                        } else {
370
-                            this.fn.showModal({
371
-                                title: "设置失败",
372
-                                content: res.message,
373
-                                showCancel: false,
374
-                            });
375
-                        }
376
-                    });
377
-            }
352
+                        this.$forceUpdate();
353
+                        this.fn.showToast("设置成功");
354
+                    } else {
355
+                        this.fn.showModal({
356
+                            title: "设置失败",
357
+                            content: res.message,
358
+                            showCancel: false,
359
+                        });
360
+                    }
361
+                });
378 362
         },
379 363
 
380 364
         // 设置活动显示或隐藏
381 365
         setActivityDisplay(val) {
382
-            let display = 0;
366
+            let offline = true;
383 367
             if (val.display === 1) {
384
-                // 隐藏
385
-                display = 0;
386 368
             } else {
387
-                // 置顶
388
-                display = 1;
369
+                offline = false;
389 370
             }
390 371
             this.api
391
-                .get("/Yx/SetActivityDisplay", {
392
-                    aid: val.aid,
393
-                    display,
394
-                })
372
+                .get(
373
+                    "/Supplier/SetActivityOffline",
374
+                    {
375
+                        id: val._id,
376
+                        offline,
377
+                    },
378
+                    { pass: true }
379
+                )
395 380
                 .then((res) => {
396 381
                     if (res.success) {
397
-                        val.display = display;
382
+                        val.display === 0
383
+                            ? (val.display = 0)
384
+                            : (val.display = 1);
398 385
                         this.$forceUpdate();
399 386
                         this.fn.showToast("设置成功");
400 387
                     } else {
@@ -407,35 +394,35 @@ export default {
407 394
                 });
408 395
         },
409 396
 
410
-        // 推送
411
-        pushGive(item) {
412
-              let sendData = {
413
-                aid: item.activityNo,
397
+        // 删除
398
+        remove(val) {
399
+            let sendData = {
400
+                id: val._id,
414 401
             };
415
-            console.log(sendData)
416 402
             this.api
417
-                .get("/Yx/SendActivity", sendData, {
403
+                .get("/Supplier/RemoveActivity", sendData, {
418 404
                     pass: true,
419 405
                 })
420 406
                 .then((res) => {
421
-                    let data = JSON.parse(res.data);
422
-                    this.fn.showToast(data.message);
407
+                    if (res.success) {
408
+                        let arr = [];
409
+                        for (let item of this.activityList) {
410
+                            if (item._id !== val._id) {
411
+                                arr.push(item);
412
+                            }
413
+                        }
414
+                        this.activityList = [...this.activityList];
415
+                        this.fn.showToast("删除成功");
416
+                    } else {
417
+                        this.fn.showModal({
418
+                            title: "删除失败",
419
+                            content: res.message,
420
+                            showCancel: false,
421
+                        });
422
+                    }
423 423
                 });
424 424
         },
425 425
 
426
-
427
-        // 分享
428
-        shareApp(val) {
429
-            uni.navigateToMiniProgram({
430
-                appId: "wx7d16ba51271496b8",
431
-                path: `/pages/recommend/list?shopId=${this.shopId}&aid=${val.activityNo}`,
432
-                extraData: {
433
-                    shopId: this.shopId,
434
-                    aid: val.activityNo,
435
-                },
436
-            });
437
-        },
438
-
439 426
         // 搜索
440 427
         search() {
441 428
             if (this.searchVal) {
@@ -782,7 +769,7 @@ page {
782 769
         max-height: px(88);
783 770
         line-height: px(44);
784 771
         margin-top: px(30);
785
-        font-size: px(40 );
772
+        font-size: px(40);
786 773
         color: #333;
787 774
     }
788 775