Commit fe7b41f8820d44452224bb319f6ad6f43c2a541b

Authored by 王强
1 parent 5b2d20fa

优选库——新版优选首页页面完成~

src/components/goodsItem_2/goodsItem_2.less
... ... @@ -86,4 +86,14 @@
86 86 }
87 87 }
88 88 }
  89 + &.pid-5 { // 排名样式
  90 + .content-box {
  91 + .title {
  92 + margin-top: 20px;
  93 + color: #666666;
  94 + font-size: 28px;
  95 + font-weight: 500;
  96 + }
  97 + }
  98 + }
89 99 }
... ...
src/components/goodsItem_2/goodsItem_2.vue
... ... @@ -7,8 +7,8 @@
7 7 <slot name="flag"></slot>
8 8 </div>
9 9 <div class="content-box">
10   - <div class="title" v-if="pid == undefined || pid == '1' || pid == '3' || pid == '4'">{{item.title}}</div>
11   - <div class="price-box">
  10 + <div class="title" v-if="pid == undefined || pid == '1' || pid == '3' || pid == '4' || pid == '5'">{{item.title}}</div>
  11 + <div class="price-box" v-if="pid != '5'">
12 12 <div class="symbol">¥&nbsp;</div>
13 13 <div class="price">{{item.price}}</div>
14 14 <div class="prices" v-if="(pid == '3' || pid == '4') && item.prices && parseFloat(item.prices) > 0 ">¥{{item.prices}}</div>
... ...
src/components/moreCom/moreCom.less 0 → 100644
  1 +@charset "UTF-8";
  2 +
  3 +.more-com {
  4 + background-color: transparent;
  5 + width: 100%;
  6 + height: auto;
  7 + .box {
  8 + display: flex;
  9 + justify-content: space-between;
  10 + align-items: center;
  11 + margin: 0 auto;
  12 + width: 90%;
  13 + height: auto;
  14 + .points {
  15 + display: flex;
  16 + justify-content: flex-start;
  17 + align-items: center;
  18 + color: #4A4A4A;
  19 + font-weight: 600;
  20 + .key {
  21 + font-size: 28px;
  22 + }
  23 + .value {
  24 + font-size: 32px;
  25 + }
  26 + }
  27 + .more {
  28 + display: flex;
  29 + justify-content: flex-start;
  30 + align-items: center;
  31 + .text {
  32 + color: #999999;
  33 + font-size: 22px;
  34 + font-weight: 400;
  35 + }
  36 + .icon-img {
  37 + display: block;
  38 + width: 22px;
  39 + height: 22px;
  40 + }
  41 + }
  42 + }
  43 +}
0 44 \ No newline at end of file
... ...
src/components/moreCom/moreCom.vue 0 → 100644
  1 +<template>
  2 + <div class="more-com" v-if="mores">
  3 + <div class="box">
  4 + <div class="points" v-if="mores.key && mores.value">
  5 + <div class="key">
  6 + {{mores.key}}:
  7 + </div>
  8 + <div class="value">
  9 + {{mores.value}}
  10 + </div>
  11 + </div>
  12 + <div class="points" v-else-if="mores.key">
  13 + <div class="key">
  14 + {{mores.key}}
  15 + </div>
  16 + </div>
  17 + <div class="points" v-else-if="mores.value">
  18 + <div class="value">
  19 + {{mores.value}}
  20 + </div>
  21 + </div>
  22 + <div class="points" v-else>
  23 + &nbsp;
  24 + </div>
  25 + <div class="more" @click="more(mores)">
  26 + <div class="text" v-if="mores.moreText">
  27 + {{mores.moreText}}
  28 + </div>
  29 + <div class="text" v-else>查看更多</div>
  30 + <img :src="mores.icon" class="icon-img" v-if="mores.icon" />
  31 + </div>
  32 + </div>
  33 + </div>
  34 +</template>
  35 +
  36 +<script>
  37 + export default {
  38 + name: 'moreCom',
  39 + data: function () {
  40 + return {
  41 +
  42 + }
  43 + },
  44 + props: ["mores"],
  45 + methods: {
  46 +
  47 + /**
  48 + * 更多
  49 + * @param {object} item [数据对象]
  50 + */
  51 + more(item) {
  52 + this.$emit("more", item);
  53 + }
  54 + }
  55 + }
  56 +</script>
  57 +
  58 +<!-- Add "scoped" attribute to limit CSS to this component only -->
  59 +<style rel="stylesheet/less" lang="less" scoped>
  60 + @import './moreCom';
  61 +</style>
... ...
src/components/textTitleBox/textTitleBox.less
... ... @@ -24,7 +24,9 @@
24 24 }
25 25 }
26 26 .more-box {
27   - display: contents;
  27 + display: flex;
  28 + justify-content: flex-start;
  29 + align-items: center;
28 30 color: #999999;
29 31 font-size: 26px;
30 32 font-weight: 400;
... ... @@ -33,6 +35,14 @@
33 35 white-space: nowrap;
34 36 text-overflow: ellipsis;
35 37 overflow: hidden;
  38 + & + .icon-img {
  39 + margin-left: 10px;
  40 + }
  41 + }
  42 + .icon-img {
  43 + display: block;
  44 + width: 36px;
  45 + height: 36px;
36 46 }
37 47 }
38 48 }
... ...
src/components/textTitleBox/textTitleBox.vue
... ... @@ -5,7 +5,9 @@
5 5 <div class="title">{{titles.title}}</div>
6 6 </div>
7 7 <div class="more-box" v-if="titles.more" @click="more(titles.more)">
8   - <div class="more-text">更多</div>
  8 + <div class="more-text" v-if="titles.moreText">{{titles.moreText}}</div>
  9 + <div class="more-text" v-else>更多</div>
  10 + <img :src="titles.icon" class="icon-img" v-if="titles.icon" />
9 11 </div>
10 12 </div>
11 13 </div>
... ...
src/pages/mall2/mall2.vue
... ... @@ -34,9 +34,9 @@
34 34 </div>
35 35  
36 36 <!-- 店铺列表 -->
37   - <div class="shop-list-box" v-if="goodsLists && goodsLists.length">
  37 + <div class="shop-list-box" v-if="shopLists && shopLists.length">
38 38  
39   - <div class="section shop-list" v-for="(items, index) in goodsLists" :key="index" @click="toDetail(items)">
  39 + <div class="section shop-list" v-for="(items, index) in shopLists" :key="index" @click="toDetail(items)">
40 40  
41 41 <!-- 头图 -->
42 42 <div class="header-img-box">
... ... @@ -75,7 +75,7 @@
75 75 title: "", // 标题
76 76 backs: null, // 后退按钮组
77 77 navs: null, // 导航
78   - goodsLists: null // 店铺列表
  78 + shopLists: null // 店铺列表
79 79 };
80 80 },
81 81 components: {
... ... @@ -113,7 +113,7 @@
113 113  
114 114  
115 115 // 临时,初始化店铺列表数据
116   - this.$set(this, 'goodsLists', [
  116 + this.$set(this, 'shopLists', [
117 117 {
118 118 header_img: 'static/img/box_banner.jpg',
119 119 list: [
... ... @@ -350,10 +350,11 @@
350 350 */
351 351 toDetail(item) {
352 352  
353   - // 判断是否有通用跳转函数
354   - if (typeof this.$parent.gotoDetail === 'function') {
355   - // 调用通用跳转
356   - this.$parent.gotoDetail(item);
  353 + // 跳转封装
  354 + if (typeof this.$parent.navBarJump === 'function') {
  355 +
  356 + // 页面跳转
  357 + this.$parent.navBarJump(item);
357 358 }
358 359 },
359 360  
... ...
src/pages/optimization/optimization.vue
... ... @@ -430,6 +430,14 @@
430 430 this.$set(this.newGoods, "list", [...this.newGoods.list, ...datas]);
431 431 break;
432 432 }
  433 +
  434 +
  435 +
  436 + console.log('newGoods', this.newGoods);
  437 +
  438 +
  439 +
  440 +
433 441  
434 442 // 设置还有需要加载的内容
435 443 this.$set(this.paging, "loading", false);
... ...
src/pages/optimization2/optimization2.less
... ... @@ -63,6 +63,12 @@
63 63 border-radius: 6px;
64 64 }
65 65 }
  66 + .points-box {
  67 + /deep/ .box {
  68 + padding: 28px 0;
  69 + border-top: 1px solid #DCDCDC;
  70 + }
  71 + }
66 72 }
67 73 &.anchor-list {
68 74 display: flex;
... ... @@ -70,11 +76,14 @@
70 76 align-items: center;
71 77 padding: 40px 0 30px 0;
72 78 }
73   -
74   -
75   -
76   -
77   -
  79 + &.goods-list {
  80 + background-color: transparent;
  81 + .title-box {
  82 + & + .column-list-box {
  83 + margin-top: 30px;
  84 + }
  85 + }
  86 + }
78 87 }
79 88 }
80 89 -}
  90 +}
81 91 \ No newline at end of file
... ...
src/pages/optimization2/optimization2.vue
... ... @@ -28,7 +28,7 @@
28 28  
29 29 <!-- 倒计时组件 -->
30 30 <count-down-com slot="extend"
31   - :time="new Date().getTime() + 900000 - new Date().getTime()"
  31 + :time="new Date().getTime() + 10000000 - new Date().getTime()"
32 32 sty="4">
33 33 </count-down-com>
34 34 </text-bg-title-com>
... ... @@ -37,7 +37,7 @@
37 37 <div class="list-box">
38 38  
39 39 <!-- 商品展示样式 2 -->
40   - <goods-item-2 class="item" v-for="(item, index) in goodsLists" :key="index" @click="toDiscount(item)"
  40 + <goods-item-2 class="item" v-for="(item, index) in goodsLists" :key="index" @jump="toDiscountList(item)"
41 41 :item="item"
42 42 pid="4">
43 43  
... ... @@ -49,22 +49,93 @@
49 49 </div>
50 50 </div>
51 51  
52   - <!-- 折扣专区 -->
  52 + <!-- 锚点区域 -->
53 53 <div class="section anchor-list" v-if="navs && navs.length">
54 54  
55 55 <!-- 锚点区域(单个图标) -->
56   - <icons-com v-for="(item, index) in navs" :key="index" @click="anchor(item)"
  56 + <icons-com v-for="(item, index) in navs" :key="index" @jump="anchor(item)"
57 57 :item="item">
58 58 </icons-com>
59 59 </div>
60 60  
  61 + <!-- 品质优选 -->
  62 + <div class="shop-list-box" v-if="shopLists && shopLists.length">
  63 +
  64 + <div class="section shop-list" v-for="(items, index) in shopLists" :key="index" @click="toOptimizationList(items)">
  65 +
  66 + <!-- 头图 -->
  67 + <div class="header-img-box">
  68 + <img :src="items.header_img + SIGN.BIG" class="header-img" />
  69 + </div>
  70 +
  71 + <!-- 商品列表 -->
  72 + <div class="list-box">
  73 +
  74 + <!-- 商品展示样式 2 -->
  75 + <goods-item-2 class="item" v-for="(item, i) in items.list" :key="i"
  76 + :item="item"
  77 + pid="3">
  78 + </goods-item-2>
  79 + </div>
  80 + </div>
  81 + </div>
  82 +
  83 +
61 84  
  85 + <!-- 热销排行 -->
  86 + <div class="section">
  87 +
  88 + <!-- 临时,热销排行占位图片 -->
  89 + <img src="static/img/hot_img.jpg" style="display: block;width: 100%;" />
  90 + </div>
62 91  
63 92  
64 93  
  94 + <!-- 积分商城 -->
  95 + <div class="section shop-list">
65 96  
  97 + <!-- 标题 -->
  98 + <text-bg-title-com
  99 + :titles="{
  100 + bg: 'static/img/text_bg_title_bg.jpg'
  101 + }">
  102 + </text-bg-title-com>
66 103  
  104 + <!-- 商品列表 -->
  105 + <div class="list-box">
67 106  
  107 + <!-- 商品展示样式 2 -->
  108 + <goods-item-2 class="item" v-for="(item, index) in goodsLists" :key="index" @jump="toDiscountList(item)"
  109 + :item="item"
  110 + pid="5">
  111 + </goods-item-2>
  112 + </div>
  113 +
  114 + <!-- 积分展示 -->
  115 + <more-com class="points-box" @more="pointsMore"
  116 + :mores="points">
  117 + </more-com>
  118 + </div>
  119 +
  120 + <!-- 猜你喜欢 -->
  121 + <div class="section goods-list">
  122 +
  123 + <!-- 标题 -->
  124 + <text-title-box @more='changeGoods'
  125 + :titles="{
  126 + title: '猜你喜欢',
  127 + more: true,
  128 + moreText: '换一组',
  129 + icon: 'static/img/icon_refresh.png'
  130 + }">
  131 + </text-title-box>
  132 +
  133 + <!-- 商品样式 7 列表 -->
  134 + <column-list-box class="column-list-box" v-if="likeLists && likeLists.list && likeLists.list.length" @jump="toDetail" @primary="primary"
  135 + :lists="likeLists"
  136 + com="7">
  137 + </column-list-box>
  138 + </div>
68 139 </div>
69 140  
70 141 <!-- 回到顶部按钮 -->
... ... @@ -84,10 +155,9 @@
84 155 import countDownCom from "@/components/countDownCom/countDownCom";
85 156 import goodsItem2 from "@/components/goodsItem_2/goodsItem_2";
86 157 import iconsCom from "@/components/iconsCom/iconsCom";
87   -
88   -
89   -
90   -
  158 + import moreCom from "@/components/moreCom/moreCom";
  159 + import textTitleBox from "@/components/textTitleBox/textTitleBox";
  160 + import columnListBox from "@/components/columnListBox/columnListBox";
91 161 import gotoTop from "@/components/gotoTop/gotoTop";
92 162  
93 163 export default {
... ... @@ -97,7 +167,10 @@
97 167 title: "", // 标题
98 168 backs: null, // 后退按钮组
99 169 navs: null, // 导航
100   - goodsLists: null // 店铺列表
  170 + goodsLists: null, // 折扣专区数据
  171 + shopLists: null, // 品质优选
  172 + points: null, // 用户积分
  173 + likeLists: null, // 猜你喜欢列表
101 174  
102 175  
103 176  
... ... @@ -110,9 +183,9 @@
110 183 countDownCom,
111 184 goodsItem2,
112 185 iconsCom,
113   -
114   -
115   -
  186 + moreCom,
  187 + textTitleBox,
  188 + columnListBox,
116 189 gotoTop
117 190 },
118 191 created() {
... ... @@ -222,6 +295,120 @@
222 295  
223 296  
224 297  
  298 + // 临时,初始化店铺列表数据
  299 + this.$set(this, 'shopLists', [
  300 + {
  301 + header_img: 'static/img/box_banner.jpg',
  302 + list: [
  303 + {
  304 + ads: "广告语",
  305 + id: "9519164",
  306 + price: "5.01",
  307 + prices: "6.00",
  308 + shop_type: "1",
  309 + simg: "http://wjjseller.cnlive.com/uploads/05ac5ee31c3bb363d95072559d205bd8.png",
  310 + title: "L'OCCITANE/欧舒丹 芍药花香润手霜 30ML 30ml"
  311 + },
  312 + {
  313 + ads: "广告语",
  314 + id: "9519164",
  315 + price: "5.01",
  316 + prices: "6.00",
  317 + shop_type: "1",
  318 + simg: "http://wjjseller.cnlive.com/uploads/05ac5ee31c3bb363d95072559d205bd8.png",
  319 + title: "L'OCCITANE/欧舒丹 芍药花香润手霜 30ML 30ml"
  320 + },
  321 + {
  322 + ads: "广告语",
  323 + id: "9519164",
  324 + price: "5.01",
  325 + prices: "6.00",
  326 + shop_type: "1",
  327 + simg: "http://wjjseller.cnlive.com/uploads/05ac5ee31c3bb363d95072559d205bd8.png",
  328 + title: "L'OCCITANE/欧舒丹 芍药花香润手霜 30ML 30ml"
  329 + }
  330 + ]
  331 + }
  332 + ]);
  333 +
  334 +
  335 +
  336 + // 临时,用户积分数据设置
  337 + this.$set(this, 'points', {
  338 + key: '我的积分',
  339 + value: '9850',
  340 + moreText: '查看更多',
  341 + icon: 'static/img/icon_more_arrow_right.png'
  342 + });
  343 +
  344 +
  345 +
  346 + // 临时,猜你喜欢产品列表
  347 + this.$set(this, 'likeLists', {
  348 + list: [
  349 + {
  350 + activity: "0",
  351 + activity_desc: "",
  352 + addtime: "1604544867",
  353 + ads: "23123",
  354 + code: "160454486791776561000",
  355 + id: "9525539",
  356 + price: "0.01",
  357 + prices: "0.00",
  358 + shop_type: "1",
  359 + simg: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2020/11/05/5fa3695e39ae6.png",
  360 + stock: "0",
  361 + stoptime: "0",
  362 + title: "aabbsdf350ml"
  363 + },
  364 + {
  365 + activity: "0",
  366 + activity_desc: "",
  367 + addtime: "1604544867",
  368 + ads: "23123",
  369 + code: "160454486791776561000",
  370 + id: "9525539",
  371 + price: "0.01",
  372 + prices: "0.00",
  373 + shop_type: "1",
  374 + simg: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2020/11/05/5fa3695e39ae6.png",
  375 + stock: "0",
  376 + stoptime: "0",
  377 + title: "aabbsdf350ml"
  378 + },
  379 + {
  380 + activity: "0",
  381 + activity_desc: "",
  382 + addtime: "1604544867",
  383 + ads: "23123",
  384 + code: "160454486791776561000",
  385 + id: "9525539",
  386 + price: "0.01",
  387 + prices: "0.00",
  388 + shop_type: "1",
  389 + simg: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2020/11/05/5fa3695e39ae6.png",
  390 + stock: "0",
  391 + stoptime: "0",
  392 + title: "aabbsdf350ml"
  393 + },
  394 + {
  395 + activity: "0",
  396 + activity_desc: "",
  397 + addtime: "1604544867",
  398 + ads: "23123",
  399 + code: "160454486791776561000",
  400 + id: "9525539",
  401 + price: "0.01",
  402 + prices: "0.00",
  403 + shop_type: "1",
  404 + simg: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2020/11/05/5fa3695e39ae6.png",
  405 + stock: "0",
  406 + stoptime: "0",
  407 + title: "aabbsdf350ml"
  408 + }
  409 + ]
  410 + });
  411 +
225 412  
226 413  
227 414  
... ... @@ -341,42 +528,101 @@
341 528 },
342 529  
343 530 /**
344   - * 折扣专区
  531 + * 跳转折扣专区列表
345 532 * @param {Object} item [通用跳转对象]
346 533 */
347   - toDiscount(item) {
  534 + toDiscountList(item) {
348 535  
349   - // 跳转折扣专区页面
  536 + // 跳转封装
350 537 if (typeof this.$parent.navBarJump === 'function') {
351 538  
  539 + // 设置跳转参数
  540 + let params = {
  541 +
  542 + };
352 543  
353   - console.log(item);
  544 + // 页面跳转
  545 + this.$parent.navBarJump(params);
  546 + }
  547 + },
  548 +
  549 + /**
  550 + * 锚点定位
  551 + * @param {Object} item [数据对象]
  552 + */
  553 + anchor(item) {
  554 +
  555 + },
  556 +
  557 + /**
  558 + * 跳转品质优选列表
  559 + * @param {Object} item [通用跳转对象]
  560 + */
  561 + toOptimizationList(item) {
  562 +
  563 + // 跳转封装
  564 + if (typeof this.$parent.navBarJump === 'function') {
354 565  
  566 + // 设置跳转参数
  567 + let params = {
355 568  
  569 + };
356 570  
357 571 // 页面跳转
358   - this.$parent.navBarJump(item);
  572 + this.$parent.navBarJump(params);
359 573 }
360 574 },
361 575  
  576 + /**
  577 + * 查看更多积分
  578 + * @param {Object} item [数据对象]
  579 + */
  580 + pointsMore(item) {
362 581  
  582 + console.log('pointsMore', item);
363 583  
  584 + },
364 585  
  586 + /**
  587 + * 换一租
  588 + * @param {Object} item [数据对象]
  589 + */
  590 + changeGoods(item) {
365 591  
  592 + console.log('changeGoods', item);
366 593  
  594 + },
367 595  
368 596 /**
369   - * 锚点定位
  597 + * 跳转商品详情
370 598 * @param {Object} item [数据对象]
371 599 */
372   - anchor(item) {
  600 + toDetail(item) {
  601 +
  602 + // 判断通用跳转函数是否存在
  603 + if (typeof this.$parent.gotoDetail === 'function') {
373 604  
374   -
375   - console.log('anchor', item);
376 605  
  606 + console.log('toDetail', item);
377 607  
  608 +
  609 + // 通用跳转
  610 + this.$parent.gotoDetail(item);
  611 + }
  612 + },
  613 + /**
  614 + * 列表加号按钮事件
  615 + * @param {Object} item [数据对象]
  616 + */
  617 + primary(item) {
  618 + this.toDetail(item);
378 619 },
379 620  
  621 +
  622 +
  623 +
  624 +
  625 +
380 626 /**
381 627 * 分享
382 628 */
... ...
static/img/header_discount_list.jpg 0 → 100644

66.5 KB

static/img/header_hot.png 0 → 100644

146 KB

static/img/hot_img.jpg 0 → 100644

37.9 KB

static/img/icon_list_arrow_right.png 0 → 100644

682 Bytes

static/img/icon_more_arrow_right.png 0 → 100644

184 Bytes

static/img/icon_refresh.png 0 → 100644

1.02 KB

static/img/icon_shopping_cart.png 0 → 100644

1.5 KB

static/img/icon_shopping_cart_active.png 0 → 100644

1.67 KB

static/img/icon_tips.png 0 → 100644

1013 Bytes