cr %!s(int64=4) %!d(string=hai) anos
pai
achega
2d749a0e25
Modificáronse 3 ficheiros con 127 adicións e 32 borrados
  1. 36 0
      src/common/js/function.js
  2. 1 1
      src/pages/manage/index.vue
  3. 90 31
      src/pages/youxuan/good.vue

+ 36 - 0
src/common/js/function.js

@@ -368,4 +368,40 @@ export default {
368 368
         }
369 369
         return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
370 370
     },
371
+
372
+
373
+    /**
374
+     * 转化为指定格式日期
375
+     * @param date
376
+     * @param format
377
+     * @returns {string}
378
+     */
379
+    dateFormat(date, format = 'yyyy-MM-dd') {
380
+        if (date) {
381
+            date = date.replace(/-/g, '/')
382
+            date = new Date(Date.parse(date))
383
+
384
+            let o = {
385
+                'M+': date.getMonth() + 1, //月份
386
+                'd+': date.getDate(), //日
387
+                'h+': date.getHours(), //小时
388
+                'm+': date.getMinutes(), //分
389
+                's+': date.getSeconds(), //秒
390
+                'S': date.getMilliseconds(), //毫秒
391
+                'q+': Math.floor((date.getMonth() + 3) / 3), //季度
392
+            }
393
+
394
+            if (/(y+)/.test(format)) {
395
+                format = format.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
396
+            }
397
+            for (let k in o) {
398
+                if (new RegExp('(' + k + ')').test(format)) {
399
+                    format = format.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
400
+                }
401
+            }
402
+            return format
403
+        } else {
404
+            return ''
405
+        }
406
+    }
371 407
 }

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

@@ -91,7 +91,7 @@
91 91
 
92 92
         <!-- <button class="btn" @click="layout">退出登录</button> -->
93 93
 
94
-        <div class="ver">0.5.48</div>
94
+        <div class="ver">0.5.49</div>
95 95
         <wyg-bottom-tab
96 96
             ref="tabbar"
97 97
             :tabIndex="2"

+ 90 - 31
src/pages/youxuan/good.vue

@@ -50,6 +50,20 @@
50 50
                                         </div>
51 51
                                     </div>
52 52
                                 </div>
53
+                                <div
54
+                                    class="info__tag"
55
+                                    v-if="
56
+                                        activity.activityLabelBOList &&
57
+                                        activity.activityLabelBOList.length
58
+                                    "
59
+                                >
60
+                                    <span
61
+                                        class="tag-item"
62
+                                        v-for="item of activity.activityLabelBOList"
63
+                                        :key="item.prices"
64
+                                        >{{ item.prices }}</span
65
+                                    >
66
+                                </div>
53 67
                                 <div class="des" v-if="activity.description">
54 68
                                     <span class="key">说明:</span>
55 69
                                     <span
@@ -128,7 +142,8 @@
128 142
                                 <li
129 143
                                     class="menu__item"
130 144
                                     :class="{
131
-                                        'menu__item--active': sort === 0,
145
+                                        'menu__item--active':
146
+                                            sort === 0 || sort === -100,
132 147
                                     }"
133 148
                                     @click="setSort(0)"
134 149
                                 >
@@ -144,7 +159,8 @@
144 159
                                 <li
145 160
                                     class="menu__item"
146 161
                                     :class="{
147
-                                        'menu__item--active': sort === 2,
162
+                                        'menu__item--active':
163
+                                            sort === 2 || sort === -2,
148 164
                                     }"
149 165
                                     @click="setSort(2)"
150 166
                                 >
@@ -160,7 +176,8 @@
160 176
                                 <li
161 177
                                     class="menu__item"
162 178
                                     :class="{
163
-                                        'menu__item--active': sort === 1,
179
+                                        'menu__item--active':
180
+                                            sort === 1 || sort === -1,
164 181
                                     }"
165 182
                                     @click="setSort(1)"
166 183
                                 >
@@ -173,6 +190,23 @@
173 190
                                         }"
174 191
                                     ></div>
175 192
                                 </li>
193
+                                <li
194
+                                    class="menu__item"
195
+                                    :class="{
196
+                                        'menu__item--active':
197
+                                            sort === 4 || sort === -4,
198
+                                    }"
199
+                                    @click="setSort(4)"
200
+                                >
201
+                                    <div class="menu__text">佣金</div>
202
+                                    <div
203
+                                        class="menu__sort"
204
+                                        :class="{
205
+                                            'menu__sort--up': sort === 4,
206
+                                            'menu__sort--down': sort === -4,
207
+                                        }"
208
+                                    ></div>
209
+                                </li>
176 210
                             </ul>
177 211
                             <ul class="goods__list">
178 212
                                 <li
@@ -197,14 +231,20 @@
197 231
                                                         }}
198 232
                                                     </span>
199 233
 
200
-                                                    <span v-if="item.tagPrice" class="text-line">
234
+                                                    <span
235
+                                                        v-if="item.tagPrice"
236
+                                                        class="text-line"
237
+                                                    >
201 238
                                                         原价:¥{{
202 239
                                                             item.tagPrice / 100
203 240
                                                         }}
204 241
                                                     </span>
205 242
                                                 </div>
206 243
                                                 <div class="goods__sale">
207
-                                                    <span v-if="item.agentFee" class="red">
244
+                                                    <span
245
+                                                        v-if="item.agentFee"
246
+                                                        class="red"
247
+                                                    >
208 248
                                                         赚:¥{{
209 249
                                                             item.agentFee / 100
210 250
                                                         }}
@@ -322,6 +362,7 @@
322 362
 
323 363
 <script>
324 364
 import MyImage from "../../components/image/index";
365
+import fn from "../../common/js/function";
325 366
 export default {
326 367
     name: "",
327 368
     components: { MyImage },
@@ -370,10 +411,7 @@ export default {
370 411
             let quarter = month * 3;
371 412
             let year = quarter * 12;
372 413
             if (mius < 0) {
373
-                return `结束时间:${this.fn.dateFormat(
374
-                    dateStr,
375
-                    "MM-dd hh:mm"
376
-                )}`;
414
+                return `结束时间:${fn.dateFormat(dateStr, "MM-dd hh:mm")}`;
377 415
             } else if (mius < minute) {
378 416
                 return `距结束还有${Math.floor(mius / 1000)}秒`;
379 417
             } else if (mius < hour) {
@@ -383,10 +421,7 @@ export default {
383 421
             } else if (mius < month) {
384 422
                 return `距结束还有${Math.floor(mius / day)}天`;
385 423
             } else if (mius < quarter) {
386
-                return `结束时间:${this.fn.dateFormat(
387
-                    dateStr,
388
-                    "MM-dd hh:mm"
389
-                )}`;
424
+                return `结束时间:${fn.dateFormat(dateStr, "MM-dd hh:mm")}`;
390 425
             }
391 426
         },
392 427
     },
@@ -520,6 +555,14 @@ export default {
520 555
                     sendData.sortBy = 2;
521 556
                     sendData.asc = 0;
522 557
                     break;
558
+                case 4:
559
+                    sendData.sortBy = 4;
560
+                    sendData.asc = 1;
561
+                    break;
562
+                case -4:
563
+                    sendData.sortBy = 4;
564
+                    sendData.asc = 0;
565
+                    break;
523 566
             }
524 567
             return sendData;
525 568
         },
@@ -604,9 +647,18 @@ export default {
604 647
         },
605 648
 
606 649
         // 推送
607
-        pushGive(item, type) {
608
-            this.fn.showToast("暂无法使用");
609
-            //
650
+        pushGive(item) {
651
+            let sendData = {
652
+                pid: item.aid,
653
+            };
654
+
655
+            this.api
656
+                .get("Yx/SendActivity", sendData, {
657
+                    pass: true,
658
+                })
659
+                .then((res) => {
660
+                    this.fn.showToast(res.message);
661
+                });
610 662
         },
611 663
 
612 664
         // 分享
@@ -625,21 +677,10 @@ export default {
625 677
         pushProduct(item, type) {
626 678
             let sendData = {
627 679
                 pid: item.id,
628
-                // storeId: item.storeId,
629
-                platform: 1000,
630 680
             };
631
-            if (type === "text") {
632
-                sendData.sendTxt = false;
633
-                sendData.sendVideo = false;
634
-                sendData.sendImg = 0;
635
-            } else {
636
-                // sendData.sendTxt = true;
637
-                // sendData.sendVideo = true;
638
-                // sendData.sendImg = 3;
639
-            }
640 681
 
641 682
             this.api
642
-                .get(this.otherUrl + "Home/sendproduct", sendData, {
683
+                .get("/Yx/Sendproduct", sendData, {
643 684
                     pass: true,
644 685
                 })
645 686
                 .then((res) => {
@@ -2031,13 +2072,31 @@ page {
2031 2072
         text-indent: 2em;
2032 2073
     }
2033 2074
 }
2034
-.text-line{
2075
+.text-line {
2035 2076
     text-decoration: line-through;
2036 2077
 }
2037
-.blod{
2078
+.blod {
2038 2079
     font-weight: bold;
2039 2080
 }
2040
-.red{
2081
+.red {
2041 2082
     color: #ff4b26;
2042 2083
 }
2084
+.info__tag {
2085
+    margin-top: px(40);
2086
+    .tag-item {
2087
+        font-size: px(36);
2088
+        margin: 0 px(16) px(16) 0;
2089
+        padding: 0 px(7);
2090
+        display: inline-block;
2091
+        line-height: px(56);
2092
+        border: 1px solid #d9d9d9;
2093
+        border-radius: px(4);
2094
+        opacity: 1;
2095
+        transition: all 0.3s;
2096
+        white-space: nowrap;
2097
+        color: #fa8c16;
2098
+        background: #fff7e6;
2099
+        border-color: #ffd591;
2100
+    }
2101
+}
2043 2102
 </style>