cr лет назад: 4
Родитель
Сommit
8d43b6fc1f
3 измененных файлов с 441 добавлено и 1296 удалено
  1. 255 1225
      src/pages/youxuan/brand.vue
  2. 185 61
      src/pages/youxuan/good.vue
  3. 1 10
      src/pages/youxuan/index.vue

Разница между файлами не показана из-за своего большого размера
+ 255 - 1225
src/pages/youxuan/brand.vue


+ 185 - 61
src/pages/youxuan/good.vue

@@ -16,57 +16,63 @@
16 16
                 ></i>
17 17
             </div>
18 18
         </div>
19
+
19 20
         <div class="page__content">
20 21
             <div class="page__box">
21 22
                 <div class="page__right">
22
-  
23 23
                     <div class="goods">
24 24
                         <scroll-view
25 25
                             class="goods__scroll"
26 26
                             :scroll-y="true"
27 27
                             @scrolltolower="getMoreGoods"
28 28
                         >
29
-                            <ul class="menu">
30
-                                <li
31
-                                    class="menu__item"
32
-                                    :class="{
33
-                                        'menu__item--active':
34
-                                            sort === 'SaleDesc',
35
-                                    }"
36
-                                    @click="setSort('SaleDesc')"
37
-                                >
38
-                                    <div class="menu__text">销量</div>
39
-                                </li>
40
-                                <li
41
-                                    class="menu__item"
42
-                                    :class="{
43
-                                        'menu__item--active':
44
-                                            sort === 'NewDesc',
45
-                                    }"
46
-                                    @click="setSort('NewDesc')"
47
-                                >
48
-                                    <div class="menu__text">新品</div>
49
-                                </li>
50
-                                <li
51
-                                    class="menu__item"
52
-                                    :class="{
53
-                                        'menu__item--active':
54
-                                            sort === 'Price' ||
55
-                                            sort === 'PriceDesc',
56
-                                    }"
57
-                                    @click="setSort('Price')"
58
-                                >
59
-                                    <div class="menu__text">价格</div>
60
-                                    <div
61
-                                        class="menu__sort"
62
-                                        :class="{
63
-                                            'menu__sort--up': sort === 'Price',
64
-                                            'menu__sort--down':
65
-                                                sort === 'PriceDesc',
66
-                                        }"
67
-                                    ></div>
68
-                                </li>
69
-                            </ul>
29
+                            <div class="a-info" v-if="activity">
30
+                                <div class="head">
31
+                                    <my-image
32
+                                        class="a-img"
33
+                                        :src="activity.brandLogo"
34
+                                    ></my-image>
35
+                                    <div class="head-con">
36
+                                        <div class="a-name">
37
+                                            {{ activity.brandName }}
38
+                                        </div>
39
+                                        <div class="tags">
40
+                                            <span>263款</span>
41
+                                            <span>正品保障</span>
42
+                                            <span>包邮</span>
43
+                                        </div>
44
+                                        <div class="date">
45
+                                            {{ activity.endTime | viewDate }}
46
+                                        </div>
47
+                                    </div>
48
+                                </div>
49
+                                <div class="des">发货:xxxxx</div>
50
+                                <div class="des">
51
+                                    服务:退换无忧,支持7天无理由退换
52
+                                </div>
53
+                                <div class="a-btns">
54
+                                    <span @click="setActivityTop(activity)">
55
+                                        {{
56
+                                            activity.top === 0
57
+                                                ? "置顶"
58
+                                                : "取消置顶"
59
+                                        }}</span
60
+                                    >
61
+                                    <span @click="setActivityDisplay(activity)">
62
+                                        {{
63
+                                            activity.display === 1
64
+                                                ? "隐藏"
65
+                                                : "显示"
66
+                                        }}</span
67
+                                    >
68
+                                    <span @click="pushGive(activity)">
69
+                                        推送</span
70
+                                    >
71
+                                    <span @click="shareApp(activity)">
72
+                                        分享</span
73
+                                    >
74
+                                </div>
75
+                            </div>
70 76
                             <ul class="goods__list">
71 77
                                 <li
72 78
                                     class="goods__item"
@@ -122,20 +128,21 @@
122 128
 
123 129
                                     <div class="btns">
124 130
                                         <div class="btn" @click="share(item)">
125
-                                          操作1
131
+                                            海报
126 132
                                         </div>
127 133
                                         <div
128 134
                                             class="btn"
129 135
                                             @click="sendProduct(item, 'text')"
130 136
                                         >
131
-                                            
132
-                                            操作1
137
+                                            推荐
133 138
                                         </div>
134 139
                                         <div
135 140
                                             class="btn"
136
-                                            @click="sendProduct(item, 'product')"
141
+                                            @click="
142
+                                                sendProduct(item, 'product')
143
+                                            "
137 144
                                         >
138
-                                            操作1
145
+                                            分享
139 146
                                         </div>
140 147
                                         <div
141 148
                                             class="btn"
@@ -170,20 +177,14 @@
170 177
                 </div>
171 178
             </div>
172 179
         </div>
173
-        
174 180
     </div>
175 181
 </template>
176 182
 
177 183
 <script>
178 184
 import MyImage from "../../components/image/index";
179
-import uniPopup from "../../components/uni-popup/uni-popup";
180
-import uniPopupDialog from "../../components/uni-popup/uni-popup-dialog";
181
-import uniPopupSpec from "../../components/uni-popup/uni-popup-spec";
182
-import config from "../../common/js/config";
183
-import MyShare from "../../components/share/index";
184 185
 export default {
185 186
     name: "",
186
-    components: { MyImage, uniPopup, uniPopupDialog, MyShare, uniPopupSpec },
187
+    components: { MyImage },
187 188
     // 数据
188 189
     data() {
189 190
         return {
@@ -230,18 +231,63 @@ export default {
230 231
             shopList: null,
231 232
 
232 233
             curGood: null,
234
+
235
+            aid: "",
236
+            activity: {},
233 237
         };
234 238
     },
239
+    filters: {
240
+        viewDate(dateStr) {
241
+            if (!dateStr) {
242
+                return "";
243
+            }
244
+            if (isNaN(Date.parse(dateStr))) {
245
+                return dateStr;
246
+            }
247
+            dateStr = dateStr.replace(/-/g, "/");
248
+            let dateNow = Date.parse(dateStr);
249
+
250
+            let mius = dateNow - Date.now();
251
+
252
+            let minute = 1000 * 60;
253
+            let hour = minute * 60;
254
+            let day = hour * 24;
255
+            let month = day * 30;
256
+            let quarter = month * 3;
257
+            let year = quarter * 12;
258
+            if (mius < 0) {
259
+                return `结束时间:${this.fn.dateFormat(
260
+                    dateStr,
261
+                    "MM-dd hh:mm"
262
+                )}`;
263
+            } else if (mius < minute) {
264
+                return `距结束还有${Math.floor(mius / 1000)}秒`;
265
+            } else if (mius < hour) {
266
+                return `距结束还有${Math.floor(mius / minute)}分钟`;
267
+            } else if (mius < day) {
268
+                return `距结束还有${Math.floor(mius / hour)}小时`;
269
+            } else if (mius < month) {
270
+                return `距结束还有${Math.floor(mius / day)}天`;
271
+            } else if (mius < quarter) {
272
+                return `结束时间:${this.fn.dateFormat(
273
+                    dateStr,
274
+                    "MM-dd hh:mm"
275
+                )}`;
276
+            }
277
+        },
278
+    },
235 279
 
236
-    onLoad() {
280
+    onLoad(opts) {
237 281
         const self = this;
238 282
         if (this.user.storeId) {
239 283
             this.storeId = this.user.storeId;
240 284
         }
285
+        this.aid = opts.id;
241 286
     },
242 287
 
243 288
     async onShow() {
244 289
         this.getCategory();
290
+        this.getActivity();
245 291
     },
246 292
 
247 293
     onPullDownRefresh() {
@@ -262,6 +308,16 @@ export default {
262 308
 
263 309
     // 函数
264 310
     methods: {
311
+        getActivity() {
312
+            let sendData = {
313
+                cateId: 1,
314
+                pageIndex: 1,
315
+            };
316
+            this.api.get("/Yx/GetActivityList", sendData).then((res) => {
317
+                this.activity = res.data[0];
318
+            });
319
+        },
320
+
265 321
         // 设置排序
266 322
         setSort(val) {
267 323
             const self = this;
@@ -379,7 +435,6 @@ export default {
379 435
             });
380 436
         },
381 437
 
382
-
383 438
         // 搜索
384 439
         search() {
385 440
             if (this.searchVal) {
@@ -1164,8 +1219,8 @@ export default {
1164 1219
         },
1165 1220
 
1166 1221
         copyProductsPlay(item) {
1167
-            if(!this.isAdmin){
1168
-                return this.fn.showToast('非管理员无权操作!');
1222
+            if (!this.isAdmin) {
1223
+                return this.fn.showToast("非管理员无权操作!");
1169 1224
             }
1170 1225
             if (!this.shopList) {
1171 1226
                 this.getShopList(item);
@@ -1180,7 +1235,7 @@ export default {
1180 1235
             });
1181 1236
             this.api.get("/Store/GetShopList").then((res) => {
1182 1237
                 uni.hideLoading();
1183
-                for(let item of res.data){
1238
+                for (let item of res.data) {
1184 1239
                     item.label = item.name;
1185 1240
                     item.value = item.id;
1186 1241
                 }
@@ -1191,7 +1246,7 @@ export default {
1191 1246
 
1192 1247
         copyProducts(good) {
1193 1248
             this.curGood = good;
1194
-            this.$refs.shopSelect.open(good,this.shopList)
1249
+            this.$refs.shopSelect.open(good, this.shopList);
1195 1250
         },
1196 1251
     },
1197 1252
 
@@ -1486,7 +1541,7 @@ page {
1486 1541
         justify-content: space-between;
1487 1542
         padding: px(35) 0 0 0;
1488 1543
         background-color: #fff;
1489
-        border-top: 1px solid #f6f6f6;
1544
+        border-top: 3px solid #f1f1f1;
1490 1545
     }
1491 1546
 
1492 1547
     &__item {
@@ -1852,4 +1907,73 @@ page {
1852 1907
     margin-right: px(30);
1853 1908
 }
1854 1909
 
1910
+.a-info {
1911
+    background-color: #fff;
1912
+    margin: 0 px(30) px(50);
1913
+    border-radius: px(5);
1914
+    padding: px(30);
1915
+    .head {
1916
+        display: flex;
1917
+        justify-content: space-between;
1918
+        .a-img {
1919
+            display: block;
1920
+            width: px(180);
1921
+            flex-shrink: 0;
1922
+            margin-right: px(30);
1923
+            border: 1px solid #f1f1f1;
1924
+            border-radius: px(5);
1925
+            /deep/ img {
1926
+                height: px(180);
1927
+                width: px(180);
1928
+            }
1929
+        }
1930
+        .head-con {
1931
+            width: 100%;
1932
+        }
1933
+        .a-name {
1934
+            font-size: px(44);
1935
+            @include omits(2);
1936
+        }
1937
+    }
1938
+    .date {
1939
+        color: #666;
1940
+        font-size: px(40);
1941
+        margin-top: px(10);
1942
+    }
1943
+    .des {
1944
+        margin-top: px(30);
1945
+        font-size: px(40);
1946
+        line-height: 1.5;
1947
+        & ~ .des {
1948
+            margin-top: px(10);
1949
+        }
1950
+    }
1951
+    .tags {
1952
+        display: flex;
1953
+        align-items: center;
1954
+        color: #666;
1955
+        font-size: px(40);
1956
+        margin-top: px(20);
1957
+        span ~ span {
1958
+            margin-left: px(40);
1959
+        }
1960
+    }
1961
+}
1962
+.a-btns {
1963
+    display: flex;
1964
+    align-items: center;
1965
+    justify-content: space-between;
1966
+    margin-top: px(30);
1967
+    span {
1968
+        padding: px(20);
1969
+        min-width: px(150);
1970
+        height: px(60);
1971
+        display: flex;
1972
+        align-items: center;
1973
+        justify-content: center;
1974
+        border: 1px solid #f1f1f1;
1975
+        border-radius: px(10);
1976
+        font-size: px(40);
1977
+    }
1978
+}
1855 1979
 </style>

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

@@ -10,17 +10,12 @@
10 10
                         <div class="des">
11 11
                             <!-- {{ item.children ? item.children.length : 0 }}个品牌 -->
12 12
                         </div>
13
-                        <!-- <my-image
14
-                            class="arrow"
15
-                            :class="{ up: item.showChildren }"
16
-                            src="/static/common/arrows_left.png"
17
-                        ></my-image> -->
18 13
                         <div
19 14
                             class="link"
20 15
                             @click="
21 16
                                 jump({
22 17
                                     path: '/pages/youxuan/brand',
23
-                                    query: { id: child.id },
18
+                                    query: { cateId: item.categoryId },
24 19
                                 })
25 20
                             "
26 21
                         >
@@ -37,9 +32,6 @@
37 32
                         <span class="status status2" @click="setLevel(item)"
38 33
                             >推荐:{{ item.rcommandLevel }}</span
39 34
                         >
40
-                        <!-- <div class="setting" @click="setting(item, 'root')">
41
-                            设置
42
-                        </div> -->
43 35
                     </div>
44 36
                 </li>
45 37
             </black>
@@ -100,7 +92,6 @@ export default {
100 92
 
101 93
         // 显示隐藏
102 94
         setDisPlay(val) {
103
-            console.log(val);
104 95
             if (val.display === 0) {
105 96
                 //下架中,点击上架
106 97
                 this.api