Commit 291ba088c6a0816de82e8186a9e5e15d73e205be
1 parent
f95ff15f
优选库——热销商品列表页面完成~
Showing
6 changed files
with
728 additions
and
85 deletions
src/components/goodsItem_8/goodsItem_8.less
| @@ -11,21 +11,23 @@ | @@ -11,21 +11,23 @@ | ||
| 11 | padding: 30px 0; | 11 | padding: 30px 0; |
| 12 | width: 90%; | 12 | width: 90%; |
| 13 | height: auto; | 13 | height: auto; |
| 14 | - .img-box { | 14 | + .left-box { |
| 15 | position: relative; | 15 | position: relative; |
| 16 | - display: flex; | ||
| 17 | - justify-content: center; | ||
| 18 | - align-items: center; | ||
| 19 | - background-color: transparent; | ||
| 20 | - // margin: 0 auto; | ||
| 21 | - width: 210px; | ||
| 22 | - height: 210px; | ||
| 23 | - border-radius: 12px; | ||
| 24 | - overflow: hidden; | ||
| 25 | - .simg { | ||
| 26 | - display: block; | ||
| 27 | - width: 210px; | 16 | + .img-box { |
| 17 | + display: flex; | ||
| 18 | + justify-content: center; | ||
| 19 | + align-items: center; | ||
| 20 | + background-color: transparent; | ||
| 21 | + // margin: 0 auto; | ||
| 22 | + width: 210px; | ||
| 28 | height: 210px; | 23 | height: 210px; |
| 24 | + border-radius: 12px; | ||
| 25 | + overflow: hidden; | ||
| 26 | + .simg { | ||
| 27 | + display: block; | ||
| 28 | + width: 210px; | ||
| 29 | + height: 210px; | ||
| 30 | + } | ||
| 29 | } | 31 | } |
| 30 | } | 32 | } |
| 31 | .content-box { | 33 | .content-box { |
src/components/goodsItem_8/goodsItem_8.vue
| 1 | <template> | 1 | <template> |
| 2 | <div class="goods-item-8-box" :class="'style-' + sty" v-if="item" @click="jump(item)"> | 2 | <div class="goods-item-8-box" :class="'style-' + sty" v-if="item" @click="jump(item)"> |
| 3 | <div class="main-box"> | 3 | <div class="main-box"> |
| 4 | - <div class="img-box"> | ||
| 5 | - <img v-lazy="item.simg + SIGN.SMALL" class="simg" /> | 4 | + <div class="left-box"> |
| 5 | + <div class="img-box"> | ||
| 6 | + <img v-lazy="item.simg + SIGN.SMALL" class="simg" /> | ||
| 7 | + </div> | ||
| 6 | <slot name="flag"></slot> | 8 | <slot name="flag"></slot> |
| 7 | </div> | 9 | </div> |
| 8 | <div class="content-box"> | 10 | <div class="content-box"> |
| @@ -17,7 +19,7 @@ | @@ -17,7 +19,7 @@ | ||
| 17 | <div class="decimal"></div> | 19 | <div class="decimal"></div> |
| 18 | <div class="prices" v-if="sty && item.prices && parseFloat(item.prices) > 0 && parseFloat(item.prices) > parseFloat(item.price)">¥{{item.prices}}</div> | 20 | <div class="prices" v-if="sty && item.prices && parseFloat(item.prices) > 0 && parseFloat(item.prices) > parseFloat(item.price)">¥{{item.prices}}</div> |
| 19 | </div> | 21 | </div> |
| 20 | - <div class="icon-box"> | 22 | + <div class="icon-box" @click.stop.prevent="primary(item)"> |
| 21 | <img src="static/img/icon_list_arrow_right.png" class="icon-img" v-if="sty == 2" /> | 23 | <img src="static/img/icon_list_arrow_right.png" class="icon-img" v-if="sty == 2" /> |
| 22 | <img src="static/img/icon_shopping_cart_active.png" class="icon-img" v-else /> | 24 | <img src="static/img/icon_shopping_cart_active.png" class="icon-img" v-else /> |
| 23 | </div> | 25 | </div> |
src/pages/discountList/discountList.vue
| @@ -39,7 +39,7 @@ | @@ -39,7 +39,7 @@ | ||
| 39 | <div class="section goods-list"> | 39 | <div class="section goods-list"> |
| 40 | 40 | ||
| 41 | <!-- 商品列表 --> | 41 | <!-- 商品列表 --> |
| 42 | - <goods-item-8 v-for="(item, index) in goodsLists" :key="index" | 42 | + <goods-item-8 v-for="(item, index) in goodsLists" :key="index" @jump="toDetail" @primary="primary" |
| 43 | :item="item" | 43 | :item="item" |
| 44 | sty="1"> | 44 | sty="1"> |
| 45 | 45 | ||
| @@ -79,13 +79,15 @@ | @@ -79,13 +79,15 @@ | ||
| 79 | import gotoTop from "@/components/gotoTop/gotoTop"; | 79 | import gotoTop from "@/components/gotoTop/gotoTop"; |
| 80 | 80 | ||
| 81 | export default { | 81 | export default { |
| 82 | - name: 'optimization', | 82 | + name: 'discountListPage', |
| 83 | data () { | 83 | data () { |
| 84 | return { | 84 | return { |
| 85 | title: "", // 标题 | 85 | title: "", // 标题 |
| 86 | backs: null, // 后退按钮组 | 86 | backs: null, // 后退按钮组 |
| 87 | goodsLists: null, // 商品列表 | 87 | goodsLists: null, // 商品列表 |
| 88 | 88 | ||
| 89 | + | ||
| 90 | + | ||
| 89 | } | 91 | } |
| 90 | }, | 92 | }, |
| 91 | components: { | 93 | components: { |
| @@ -455,72 +457,6 @@ | @@ -455,72 +457,6 @@ | ||
| 455 | }, | 457 | }, |
| 456 | 458 | ||
| 457 | /** | 459 | /** |
| 458 | - * 跳转折扣专区列表 | ||
| 459 | - * @param {Object} item [通用跳转对象] | ||
| 460 | - */ | ||
| 461 | - toDiscountList(item) { | ||
| 462 | - | ||
| 463 | - // 跳转封装 | ||
| 464 | - if (typeof this.$parent.navBarJump === 'function') { | ||
| 465 | - | ||
| 466 | - // 设置跳转参数 | ||
| 467 | - let params = { | ||
| 468 | - | ||
| 469 | - }; | ||
| 470 | - | ||
| 471 | - // 页面跳转 | ||
| 472 | - this.$parent.navBarJump(params); | ||
| 473 | - } | ||
| 474 | - }, | ||
| 475 | - | ||
| 476 | - /** | ||
| 477 | - * 锚点定位 | ||
| 478 | - * @param {Object} item [数据对象] | ||
| 479 | - */ | ||
| 480 | - anchor(item) { | ||
| 481 | - | ||
| 482 | - }, | ||
| 483 | - | ||
| 484 | - /** | ||
| 485 | - * 跳转品质优选列表 | ||
| 486 | - * @param {Object} item [通用跳转对象] | ||
| 487 | - */ | ||
| 488 | - toOptimizationList(item) { | ||
| 489 | - | ||
| 490 | - // 跳转封装 | ||
| 491 | - if (typeof this.$parent.navBarJump === 'function') { | ||
| 492 | - | ||
| 493 | - // 设置跳转参数 | ||
| 494 | - let params = { | ||
| 495 | - | ||
| 496 | - }; | ||
| 497 | - | ||
| 498 | - // 页面跳转 | ||
| 499 | - this.$parent.navBarJump(params); | ||
| 500 | - } | ||
| 501 | - }, | ||
| 502 | - | ||
| 503 | - /** | ||
| 504 | - * 查看更多积分 | ||
| 505 | - * @param {Object} item [数据对象] | ||
| 506 | - */ | ||
| 507 | - pointsMore(item) { | ||
| 508 | - | ||
| 509 | - console.log('pointsMore', item); | ||
| 510 | - | ||
| 511 | - }, | ||
| 512 | - | ||
| 513 | - /** | ||
| 514 | - * 换一租 | ||
| 515 | - * @param {Object} item [数据对象] | ||
| 516 | - */ | ||
| 517 | - changeGoods(item) { | ||
| 518 | - | ||
| 519 | - console.log('changeGoods', item); | ||
| 520 | - | ||
| 521 | - }, | ||
| 522 | - | ||
| 523 | - /** | ||
| 524 | * 跳转商品详情 | 460 | * 跳转商品详情 |
| 525 | * @param {Object} item [数据对象] | 461 | * @param {Object} item [数据对象] |
| 526 | */ | 462 | */ |
| @@ -538,7 +474,7 @@ | @@ -538,7 +474,7 @@ | ||
| 538 | } | 474 | } |
| 539 | }, | 475 | }, |
| 540 | /** | 476 | /** |
| 541 | - * 列表加号按钮事件 | 477 | + * 列表附件按钮事件 |
| 542 | * @param {Object} item [数据对象] | 478 | * @param {Object} item [数据对象] |
| 543 | */ | 479 | */ |
| 544 | primary(item) { | 480 | primary(item) { |
| @@ -550,6 +486,7 @@ | @@ -550,6 +486,7 @@ | ||
| 550 | 486 | ||
| 551 | 487 | ||
| 552 | 488 | ||
| 489 | + | ||
| 553 | /** | 490 | /** |
| 554 | * 分享 | 491 | * 分享 |
| 555 | */ | 492 | */ |
src/pages/hotSaleList/hotSaleList.less
0 → 100644
| 1 | +@charset "UTF-8"; | ||
| 2 | + | ||
| 3 | +.hot-sale-list-page { | ||
| 4 | + background-color: #F6F6F6; | ||
| 5 | + min-height: 100vh; | ||
| 6 | + .call-app-box { | ||
| 7 | + position: fixed; | ||
| 8 | + top: 0; | ||
| 9 | + z-index: 100; | ||
| 10 | + } | ||
| 11 | + .back-box { | ||
| 12 | + position: fixed; | ||
| 13 | + top: 0; | ||
| 14 | + z-index: 100; | ||
| 15 | + background-color: #ffffff; | ||
| 16 | + } | ||
| 17 | + .pl { | ||
| 18 | + background-color: transparent; | ||
| 19 | + width: 100%; | ||
| 20 | + &.is-open-app { | ||
| 21 | + height: 122px; | ||
| 22 | + } | ||
| 23 | + &.is-cnlive { | ||
| 24 | + height: 93px; | ||
| 25 | + } | ||
| 26 | + } | ||
| 27 | + .main-box { | ||
| 28 | + background-repeat: no-repeat; | ||
| 29 | + background-size: contain; | ||
| 30 | + .section { | ||
| 31 | + margin: 0 auto; | ||
| 32 | + width: 690px; | ||
| 33 | + height: auto; | ||
| 34 | + border-radius: 24px; | ||
| 35 | + overflow: hidden; | ||
| 36 | + &:last-child { | ||
| 37 | + margin-bottom: 0; | ||
| 38 | + } | ||
| 39 | + &.goods-list { | ||
| 40 | + padding-top: 300px; | ||
| 41 | + /deep/ .goods-item-8-box { | ||
| 42 | + background-color: #ffffff; | ||
| 43 | + margin-bottom: 30px; | ||
| 44 | + border-radius: 24px; | ||
| 45 | + } | ||
| 46 | + .discount-flag { | ||
| 47 | + position: absolute; | ||
| 48 | + top: 10px; | ||
| 49 | + left: 10px; | ||
| 50 | + z-index: 1; | ||
| 51 | + background: linear-gradient(90deg, #F9EE7A 0%, #FAD844 100%); | ||
| 52 | + padding: 1px 8px; | ||
| 53 | + color: #945A08; | ||
| 54 | + font-size: 20px; | ||
| 55 | + font-weight: 400; | ||
| 56 | + border-radius: 6px; | ||
| 57 | + } | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + } | ||
| 61 | +} | ||
| 0 | \ No newline at end of file | 62 | \ No newline at end of file |
src/pages/hotSaleList/hotSaleList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="hot-sale-list-page"> | ||
| 3 | + | ||
| 4 | + <!-- H5唤起App组件 --> | ||
| 5 | + <call-app-box class="call-app-box" ref="callApp" v-if="!isCNLive.value" | ||
| 6 | + :callApps="$parent.callApps"> | ||
| 7 | + </call-app-box> | ||
| 8 | + | ||
| 9 | + <!-- 后退导航 --> | ||
| 10 | + <back-box class="back-box" :style="'padding-top: ' + $parent.top.value + 'px'" v-if="isCNLive.value" @back="back" | ||
| 11 | + :backs="backs"> | ||
| 12 | + </back-box> | ||
| 13 | + | ||
| 14 | + <!-- pl --> | ||
| 15 | + <div class="pl" :class="{'is-cnlive': isCNLive.value, 'is-open-app': $parent.isOpenApp.value}"></div> | ||
| 16 | + | ||
| 17 | + <!-- 主区域 --> | ||
| 18 | + <div class="main-box" :style="{backgroundImage: 'url(' + headerImg + ')'}"> | ||
| 19 | + | ||
| 20 | + <!-- 商品列表 --> | ||
| 21 | + <div class="section goods-list"> | ||
| 22 | + | ||
| 23 | + <!-- 商品列表 --> | ||
| 24 | + <goods-item-8 v-for="(item, index) in goodsLists" :key="index" @jump="toDetail" @primary="primary" | ||
| 25 | + :item="item" | ||
| 26 | + sty="2"> | ||
| 27 | + | ||
| 28 | + <!-- 添加flag --> | ||
| 29 | + <flag slot="flag" v-if="flags && flags.icon && flags.icon[index]" | ||
| 30 | + :flag="flags.icon[index]" | ||
| 31 | + :position="flags.position" | ||
| 32 | + :width="flags.width"> | ||
| 33 | + </flag> | ||
| 34 | + </goods-item-8> | ||
| 35 | + </div> | ||
| 36 | + <div style="clear: both;"></div> | ||
| 37 | + </div> | ||
| 38 | + | ||
| 39 | + <!-- 回到顶部按钮 --> | ||
| 40 | + <goto-top | ||
| 41 | + :top="parseInt(150)"> | ||
| 42 | + </goto-top> | ||
| 43 | + </div> | ||
| 44 | +</template> | ||
| 45 | + | ||
| 46 | +<script> | ||
| 47 | + | ||
| 48 | + // 引入组件 | ||
| 49 | + import { Toast, Indicator } from "mint-ui"; | ||
| 50 | + import callAppBox from "@/components/callAppBox/callAppBox"; | ||
| 51 | + import backBox from "@/components/backBox/backBox"; | ||
| 52 | + import goodsItem8 from "@/components/goodsItem_8/goodsItem_8"; | ||
| 53 | + import flag from "@/components/flag/flag"; | ||
| 54 | + import gotoTop from "@/components/gotoTop/gotoTop"; | ||
| 55 | + | ||
| 56 | + export default { | ||
| 57 | + name: 'hotSaleListPage', | ||
| 58 | + data () { | ||
| 59 | + return { | ||
| 60 | + title: "", // 标题 | ||
| 61 | + backs: null, // 后退按钮组 | ||
| 62 | + headerImg: '', // 头部图片 | ||
| 63 | + goodsLists: null, // 商品列表 | ||
| 64 | + flags: null, // 产品排名flag | ||
| 65 | + | ||
| 66 | + | ||
| 67 | + } | ||
| 68 | + }, | ||
| 69 | + components: { | ||
| 70 | + callAppBox, | ||
| 71 | + backBox, | ||
| 72 | + goodsItem8, | ||
| 73 | + flag, | ||
| 74 | + gotoTop | ||
| 75 | + }, | ||
| 76 | + created() { | ||
| 77 | + | ||
| 78 | + // 设置标题 | ||
| 79 | + this.$set(this, "title", "热销排行"); | ||
| 80 | + | ||
| 81 | + // 判断是否在App内 | ||
| 82 | + if (this.isCNLive.value) { | ||
| 83 | + | ||
| 84 | + // 添加后退按钮组“后退”和“分享”按钮 | ||
| 85 | + this.$set(this, 'backs', { | ||
| 86 | + funcs: { | ||
| 87 | + back: { | ||
| 88 | + icon: "static/img/icon_back.png" | ||
| 89 | + }, | ||
| 90 | + funcArray: [ | ||
| 91 | + { | ||
| 92 | + icon: "static/img/icon_share.png", | ||
| 93 | + func: this.toShare | ||
| 94 | + } | ||
| 95 | + ] | ||
| 96 | + } | ||
| 97 | + }); | ||
| 98 | + | ||
| 99 | + // 设置标题 | ||
| 100 | + this.$set(this.backs, 'title', '热销排行'); | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + | ||
| 104 | + | ||
| 105 | + // 优选页面接口 | ||
| 106 | + // this.fansShopMessageList(); | ||
| 107 | + | ||
| 108 | + | ||
| 109 | + | ||
| 110 | + | ||
| 111 | + // 临时,设置头部图片地址 | ||
| 112 | + this.$set(this, 'headerImg', 'static/img/header_hot.png'); | ||
| 113 | + | ||
| 114 | + | ||
| 115 | + | ||
| 116 | + // 设置产品排名flag对象 | ||
| 117 | + this.$set(this, 'flags', { | ||
| 118 | + icon: [ | ||
| 119 | + 'static/img/icon_n1.png', | ||
| 120 | + 'static/img/icon_n2.png', | ||
| 121 | + 'static/img/icon_n3.png' | ||
| 122 | + ], | ||
| 123 | + position: { | ||
| 124 | + top: -6, | ||
| 125 | + left: 20 | ||
| 126 | + } | ||
| 127 | + }); | ||
| 128 | + | ||
| 129 | + | ||
| 130 | + | ||
| 131 | + | ||
| 132 | + // 临时,初始化列表数据 | ||
| 133 | + this.$set(this, 'goodsLists', [ | ||
| 134 | + { | ||
| 135 | + ads: "专区特供超值商品", | ||
| 136 | + id: "9524815", | ||
| 137 | + price: "50.00", | ||
| 138 | + prices: "300.00", | ||
| 139 | + shop: { | ||
| 140 | + id: "57", | ||
| 141 | + logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png", | ||
| 142 | + shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57", | ||
| 143 | + title: "李宁旗舰店", | ||
| 144 | + titles: "专区特供超值商品" | ||
| 145 | + }, | ||
| 146 | + shop_type: "1", | ||
| 147 | + shopid: "57", | ||
| 148 | + simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg", | ||
| 149 | + title: "传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐" | ||
| 150 | + }, | ||
| 151 | + { | ||
| 152 | + ads: "专区特供超值商品", | ||
| 153 | + id: "9524815", | ||
| 154 | + price: "50.00", | ||
| 155 | + prices: "20.00", | ||
| 156 | + shop: { | ||
| 157 | + id: "57", | ||
| 158 | + logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png", | ||
| 159 | + shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57", | ||
| 160 | + title: "李宁旗舰店", | ||
| 161 | + titles: "专区特供超值商品" | ||
| 162 | + }, | ||
| 163 | + shop_type: "1", | ||
| 164 | + shopid: "57", | ||
| 165 | + simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg", | ||
| 166 | + title: "传统汉堡焗套餐" | ||
| 167 | + }, | ||
| 168 | + { | ||
| 169 | + ads: "专区特供超值商品", | ||
| 170 | + id: "9524815", | ||
| 171 | + price: "50.00", | ||
| 172 | + prices: "300.00", | ||
| 173 | + shop: { | ||
| 174 | + id: "57", | ||
| 175 | + logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png", | ||
| 176 | + shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57", | ||
| 177 | + title: "李宁旗舰店", | ||
| 178 | + titles: "专区特供超值商品" | ||
| 179 | + }, | ||
| 180 | + shop_type: "1", | ||
| 181 | + shopid: "57", | ||
| 182 | + simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg", | ||
| 183 | + title: "传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐" | ||
| 184 | + }, | ||
| 185 | + { | ||
| 186 | + ads: "专区特供超值商品", | ||
| 187 | + id: "9524815", | ||
| 188 | + price: "50.00", | ||
| 189 | + prices: "300.00", | ||
| 190 | + shop: { | ||
| 191 | + id: "57", | ||
| 192 | + logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png", | ||
| 193 | + shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57", | ||
| 194 | + title: "李宁旗舰店", | ||
| 195 | + titles: "专区特供超值商品" | ||
| 196 | + }, | ||
| 197 | + shop_type: "1", | ||
| 198 | + shopid: "57", | ||
| 199 | + simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg", | ||
| 200 | + title: "传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐" | ||
| 201 | + }, | ||
| 202 | + { | ||
| 203 | + ads: "专区特供超值商品", | ||
| 204 | + id: "9524815", | ||
| 205 | + price: "50.00", | ||
| 206 | + prices: "300.00", | ||
| 207 | + shop: { | ||
| 208 | + id: "57", | ||
| 209 | + logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png", | ||
| 210 | + shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57", | ||
| 211 | + title: "李宁旗舰店", | ||
| 212 | + titles: "专区特供超值商品" | ||
| 213 | + }, | ||
| 214 | + shop_type: "1", | ||
| 215 | + shopid: "57", | ||
| 216 | + simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg", | ||
| 217 | + title: "传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐" | ||
| 218 | + }, | ||
| 219 | + { | ||
| 220 | + ads: "专区特供超值商品", | ||
| 221 | + id: "9524815", | ||
| 222 | + price: "50.00", | ||
| 223 | + prices: "300.00", | ||
| 224 | + shop: { | ||
| 225 | + id: "57", | ||
| 226 | + logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png", | ||
| 227 | + shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57", | ||
| 228 | + title: "李宁旗舰店", | ||
| 229 | + titles: "专区特供超值商品" | ||
| 230 | + }, | ||
| 231 | + shop_type: "1", | ||
| 232 | + shopid: "57", | ||
| 233 | + simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg", | ||
| 234 | + title: "传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐" | ||
| 235 | + }, | ||
| 236 | + { | ||
| 237 | + ads: "专区特供超值商品", | ||
| 238 | + id: "9524815", | ||
| 239 | + price: "50.00", | ||
| 240 | + prices: "300.00", | ||
| 241 | + shop: { | ||
| 242 | + id: "57", | ||
| 243 | + logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png", | ||
| 244 | + shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57", | ||
| 245 | + title: "李宁旗舰店", | ||
| 246 | + titles: "专区特供超值商品" | ||
| 247 | + }, | ||
| 248 | + shop_type: "1", | ||
| 249 | + shopid: "57", | ||
| 250 | + simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg", | ||
| 251 | + title: "传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐" | ||
| 252 | + }, | ||
| 253 | + { | ||
| 254 | + ads: "专区特供超值商品", | ||
| 255 | + id: "9524815", | ||
| 256 | + price: "50.00", | ||
| 257 | + prices: "300.00", | ||
| 258 | + shop: { | ||
| 259 | + id: "57", | ||
| 260 | + logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png", | ||
| 261 | + shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57", | ||
| 262 | + title: "李宁旗舰店", | ||
| 263 | + titles: "专区特供超值商品" | ||
| 264 | + }, | ||
| 265 | + shop_type: "1", | ||
| 266 | + shopid: "57", | ||
| 267 | + simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg", | ||
| 268 | + title: "传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐" | ||
| 269 | + }, | ||
| 270 | + { | ||
| 271 | + ads: "专区特供超值商品", | ||
| 272 | + id: "9524815", | ||
| 273 | + price: "50.00", | ||
| 274 | + prices: "300.00", | ||
| 275 | + shop: { | ||
| 276 | + id: "57", | ||
| 277 | + logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png", | ||
| 278 | + shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57", | ||
| 279 | + title: "李宁旗舰店", | ||
| 280 | + titles: "专区特供超值商品" | ||
| 281 | + }, | ||
| 282 | + shop_type: "1", | ||
| 283 | + shopid: "57", | ||
| 284 | + simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg", | ||
| 285 | + title: "传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐" | ||
| 286 | + }, | ||
| 287 | + { | ||
| 288 | + ads: "专区特供超值商品", | ||
| 289 | + id: "9524815", | ||
| 290 | + price: "50.00", | ||
| 291 | + prices: "300.00", | ||
| 292 | + shop: { | ||
| 293 | + id: "57", | ||
| 294 | + logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png", | ||
| 295 | + shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57", | ||
| 296 | + title: "李宁旗舰店", | ||
| 297 | + titles: "专区特供超值商品" | ||
| 298 | + }, | ||
| 299 | + shop_type: "1", | ||
| 300 | + shopid: "57", | ||
| 301 | + simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg", | ||
| 302 | + title: "传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐" | ||
| 303 | + }, | ||
| 304 | + { | ||
| 305 | + ads: "专区特供超值商品", | ||
| 306 | + id: "9524815", | ||
| 307 | + price: "50.00", | ||
| 308 | + prices: "300.00", | ||
| 309 | + shop: { | ||
| 310 | + id: "57", | ||
| 311 | + logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png", | ||
| 312 | + shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57", | ||
| 313 | + title: "李宁旗舰店", | ||
| 314 | + titles: "专区特供超值商品" | ||
| 315 | + }, | ||
| 316 | + shop_type: "1", | ||
| 317 | + shopid: "57", | ||
| 318 | + simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg", | ||
| 319 | + title: "传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐" | ||
| 320 | + }, | ||
| 321 | + { | ||
| 322 | + ads: "专区特供超值商品", | ||
| 323 | + id: "9524815", | ||
| 324 | + price: "50.00", | ||
| 325 | + prices: "300.00", | ||
| 326 | + shop: { | ||
| 327 | + id: "57", | ||
| 328 | + logo: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/20/5cbab33c82a82.png", | ||
| 329 | + shop_url: "https://wjjshop.cnlive.com/html/mall/1/#/pages/main/shopIndex/shop?shop_id=57", | ||
| 330 | + title: "李宁旗舰店", | ||
| 331 | + titles: "专区特供超值商品" | ||
| 332 | + }, | ||
| 333 | + shop_type: "1", | ||
| 334 | + shopid: "57", | ||
| 335 | + simg: "http://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/01/02/5c2c76eeb6584.jpg", | ||
| 336 | + title: "传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐传统汉堡焗套餐 传统汉堡焗套餐汉堡焗传统汉堡焗套餐" | ||
| 337 | + } | ||
| 338 | + ]); | ||
| 339 | + | ||
| 340 | + | ||
| 341 | + | ||
| 342 | + | ||
| 343 | + | ||
| 344 | + }, | ||
| 345 | + methods: { | ||
| 346 | + | ||
| 347 | + /** | ||
| 348 | + * 优选页面接口 | ||
| 349 | + */ | ||
| 350 | + fansShopMessageList() { | ||
| 351 | + | ||
| 352 | + // 校验登录 | ||
| 353 | + if (this.$parent.checkLogin()) { | ||
| 354 | + | ||
| 355 | + // 加载中提示 | ||
| 356 | + Indicator.open("加载中..."); | ||
| 357 | + | ||
| 358 | + // 获取证书请求接口 | ||
| 359 | + this.http("/Api/" + this.getApiVersion().dynamic + "/fansShopMessageList", { | ||
| 360 | + uid: this.getStore("uid") | ||
| 361 | + }, this.fansShopMessageListCallback, { | ||
| 362 | + method: "POST" | ||
| 363 | + }); | ||
| 364 | + } | ||
| 365 | + }, | ||
| 366 | + | ||
| 367 | + /** | ||
| 368 | + * 优选页面接口回调 | ||
| 369 | + * @param {Object} res [服务器返回数据] | ||
| 370 | + * @param {Object} ext [扩展参数] | ||
| 371 | + */ | ||
| 372 | + fansShopMessageListCallback(res, ext) { | ||
| 373 | + | ||
| 374 | + // 加载完成 | ||
| 375 | + Indicator.close(); | ||
| 376 | + | ||
| 377 | + // 返回处理 | ||
| 378 | + if (res.code == 200) { | ||
| 379 | + | ||
| 380 | + // 解构数据 | ||
| 381 | + let { data: datas } = res; | ||
| 382 | + | ||
| 383 | + /* 获取优选库“优选”数据 开始 */ | ||
| 384 | + | ||
| 385 | + | ||
| 386 | + | ||
| 387 | + /* 获取优选库“优选”数据 结束 */ | ||
| 388 | + | ||
| 389 | + } else if (res.code == 400) { | ||
| 390 | + | ||
| 391 | + // 获取优选失败 | ||
| 392 | + Toast(res.message); | ||
| 393 | + } else { | ||
| 394 | + | ||
| 395 | + // 获取优选失败 | ||
| 396 | + Toast("获取优选失败"); | ||
| 397 | + } | ||
| 398 | + }, | ||
| 399 | + | ||
| 400 | + /** | ||
| 401 | + * 商品列表 | ||
| 402 | + * @param {Int} groupId [平台分类id] | ||
| 403 | + * @param {Int} page [页码] | ||
| 404 | + * @param {String} CALL_STATUS [何处触发请求] | ||
| 405 | + */ | ||
| 406 | + shopGoodsList(groupId, page) { | ||
| 407 | + | ||
| 408 | + // 校验必填参数 | ||
| 409 | + if (groupId && page) { | ||
| 410 | + | ||
| 411 | + // 加载中 | ||
| 412 | + this.$set(this.paging, "loading", true); | ||
| 413 | + | ||
| 414 | + // 获取证书请求接口 | ||
| 415 | + this.http("/Api/" + this.getApiVersion().index + "/shopNewGoodsList", { | ||
| 416 | + groupid: groupId, | ||
| 417 | + page: page | ||
| 418 | + }, this.shopGoodsListCallback, { | ||
| 419 | + method: "POST" | ||
| 420 | + } | ||
| 421 | + ); | ||
| 422 | + } | ||
| 423 | + }, | ||
| 424 | + | ||
| 425 | + /** | ||
| 426 | + * 商品列表回调 | ||
| 427 | + * @param {Object} res [服务器返回数据] | ||
| 428 | + * @param {Object} ext [扩展参数] | ||
| 429 | + */ | ||
| 430 | + shopGoodsListCallback(res, ext) { | ||
| 431 | + | ||
| 432 | + // 下拉刷新结束 | ||
| 433 | + this.$set(this, "isLoading", false); | ||
| 434 | + | ||
| 435 | + // 返回处理 | ||
| 436 | + if (res.code == 200) { | ||
| 437 | + | ||
| 438 | + // 解构数据 | ||
| 439 | + let { data: datas } = res; | ||
| 440 | + | ||
| 441 | + /* 获取商品列表数据 开始 */ | ||
| 442 | + | ||
| 443 | + | ||
| 444 | + | ||
| 445 | + /* 获取商品列表数据 结束 */ | ||
| 446 | + | ||
| 447 | + } else if (res.code == 400) { | ||
| 448 | + | ||
| 449 | + // 获取最新上架列表失败 | ||
| 450 | + Toast(res.message); | ||
| 451 | + } else { | ||
| 452 | + | ||
| 453 | + // 获取最新上架列表失败 | ||
| 454 | + Toast("获取最新上架列表失败"); | ||
| 455 | + } | ||
| 456 | + }, | ||
| 457 | + | ||
| 458 | + /** | ||
| 459 | + * 跳转折扣专区列表 | ||
| 460 | + * @param {Object} item [通用跳转对象] | ||
| 461 | + */ | ||
| 462 | + toDiscountList(item) { | ||
| 463 | + | ||
| 464 | + // 跳转封装 | ||
| 465 | + if (typeof this.$parent.navBarJump === 'function') { | ||
| 466 | + | ||
| 467 | + // 设置跳转参数 | ||
| 468 | + let params = { | ||
| 469 | + | ||
| 470 | + }; | ||
| 471 | + | ||
| 472 | + // 页面跳转 | ||
| 473 | + this.$parent.navBarJump(params); | ||
| 474 | + } | ||
| 475 | + }, | ||
| 476 | + | ||
| 477 | + /** | ||
| 478 | + * 锚点定位 | ||
| 479 | + * @param {Object} item [数据对象] | ||
| 480 | + */ | ||
| 481 | + anchor(item) { | ||
| 482 | + | ||
| 483 | + }, | ||
| 484 | + | ||
| 485 | + /** | ||
| 486 | + * 跳转品质优选列表 | ||
| 487 | + * @param {Object} item [通用跳转对象] | ||
| 488 | + */ | ||
| 489 | + toOptimizationList(item) { | ||
| 490 | + | ||
| 491 | + // 跳转封装 | ||
| 492 | + if (typeof this.$parent.navBarJump === 'function') { | ||
| 493 | + | ||
| 494 | + // 设置跳转参数 | ||
| 495 | + let params = { | ||
| 496 | + | ||
| 497 | + }; | ||
| 498 | + | ||
| 499 | + // 页面跳转 | ||
| 500 | + this.$parent.navBarJump(params); | ||
| 501 | + } | ||
| 502 | + }, | ||
| 503 | + | ||
| 504 | + /** | ||
| 505 | + * 查看更多积分 | ||
| 506 | + * @param {Object} item [数据对象] | ||
| 507 | + */ | ||
| 508 | + pointsMore(item) { | ||
| 509 | + | ||
| 510 | + console.log('pointsMore', item); | ||
| 511 | + | ||
| 512 | + }, | ||
| 513 | + | ||
| 514 | + /** | ||
| 515 | + * 换一租 | ||
| 516 | + * @param {Object} item [数据对象] | ||
| 517 | + */ | ||
| 518 | + changeGoods(item) { | ||
| 519 | + | ||
| 520 | + console.log('changeGoods', item); | ||
| 521 | + | ||
| 522 | + }, | ||
| 523 | + | ||
| 524 | + /** | ||
| 525 | + * 跳转商品详情 | ||
| 526 | + * @param {Object} item [数据对象] | ||
| 527 | + */ | ||
| 528 | + toDetail(item) { | ||
| 529 | + | ||
| 530 | + // 判断通用跳转函数是否存在 | ||
| 531 | + if (typeof this.$parent.gotoDetail === 'function') { | ||
| 532 | + | ||
| 533 | + | ||
| 534 | + console.log('toDetail', item); | ||
| 535 | + | ||
| 536 | + | ||
| 537 | + // 通用跳转 | ||
| 538 | + this.$parent.gotoDetail(item); | ||
| 539 | + } | ||
| 540 | + }, | ||
| 541 | + /** | ||
| 542 | + * 列表加号按钮事件 | ||
| 543 | + * @param {Object} item [数据对象] | ||
| 544 | + */ | ||
| 545 | + primary(item) { | ||
| 546 | + this.toDetail(item); | ||
| 547 | + }, | ||
| 548 | + | ||
| 549 | + | ||
| 550 | + | ||
| 551 | + | ||
| 552 | + | ||
| 553 | + | ||
| 554 | + /** | ||
| 555 | + * 分享 | ||
| 556 | + */ | ||
| 557 | + toShare() { | ||
| 558 | + | ||
| 559 | + // 判断分享 | ||
| 560 | + if (typeof this.$parent.toShare === 'function') { | ||
| 561 | + this.$parent.toShare(38, this.$route.query.id || 0); | ||
| 562 | + } | ||
| 563 | + }, | ||
| 564 | + | ||
| 565 | + /** | ||
| 566 | + * 后退 | ||
| 567 | + */ | ||
| 568 | + back() { | ||
| 569 | + | ||
| 570 | + // 判断是否有处理函数 | ||
| 571 | + if (typeof this.$parent.back === 'function') { | ||
| 572 | + | ||
| 573 | + // 后退 | ||
| 574 | + this.$parent.back(); | ||
| 575 | + } else { | ||
| 576 | + | ||
| 577 | + // 后退 | ||
| 578 | + window.history.go(-1); | ||
| 579 | + } | ||
| 580 | + } | ||
| 581 | + }, | ||
| 582 | + head: { | ||
| 583 | + title () { | ||
| 584 | + return { | ||
| 585 | + inner: this.title | ||
| 586 | + } | ||
| 587 | + } | ||
| 588 | + }, | ||
| 589 | + watch: { | ||
| 590 | + | ||
| 591 | + // 设置页面标题 | ||
| 592 | + title(newVal) { | ||
| 593 | + if (this.$store.state.browser.toLowerCase() == "qq" && this.$store.state.deviceType.toLowerCase() == "iphone") { | ||
| 594 | + this.$iFrame.insertIFrame(newVal); | ||
| 595 | + } else { | ||
| 596 | + this.$emit("updateHead"); | ||
| 597 | + } | ||
| 598 | + } | ||
| 599 | + }, | ||
| 600 | + mounted() { | ||
| 601 | + | ||
| 602 | + // 如果是App外,设置唤起App和微信内分享参数 | ||
| 603 | + if (!this.isCNLive.value) { | ||
| 604 | + | ||
| 605 | + // 唤起详情页 | ||
| 606 | + if (typeof this.$parent.getOpenApp === "function") { | ||
| 607 | + this.$parent.getOpenApp({ | ||
| 608 | + type: 38, | ||
| 609 | + id: this.$route.query.id || 1, | ||
| 610 | + url: "" | ||
| 611 | + }); | ||
| 612 | + } | ||
| 613 | + | ||
| 614 | + // 分享详情页 | ||
| 615 | + if (typeof this.$parent.getShareData === "function") { | ||
| 616 | + this.$parent.getShareData({ | ||
| 617 | + type: 38, | ||
| 618 | + id: this.$route.query.id || 1, | ||
| 619 | + url: "" | ||
| 620 | + }); | ||
| 621 | + } | ||
| 622 | + } | ||
| 623 | + } | ||
| 624 | + } | ||
| 625 | +</script> | ||
| 626 | + | ||
| 627 | +<!-- Add "scoped" attribute to limit CSS to this component only --> | ||
| 628 | +<style rel="stylesheet/less" lang='less' scoped> | ||
| 629 | + @import "hotSaleList"; | ||
| 630 | +</style> | ||
| 0 | \ No newline at end of file | 631 | \ No newline at end of file |
src/router/index.js
| @@ -195,6 +195,17 @@ const router = new Router({ | @@ -195,6 +195,17 @@ const router = new Router({ | ||
| 195 | requireAuth: false | 195 | requireAuth: false |
| 196 | } | 196 | } |
| 197 | }, | 197 | }, |
| 198 | + { | ||
| 199 | + // 新版优选库“优选热销排行列表”页面 | ||
| 200 | + path: "/hotSaleList", | ||
| 201 | + name: "hotSaleList", | ||
| 202 | + component: resolve => { | ||
| 203 | + require(["@/pages/hotSaleList/hotSaleList"], resolve); | ||
| 204 | + }, | ||
| 205 | + meta: { | ||
| 206 | + requireAuth: false | ||
| 207 | + } | ||
| 208 | + }, | ||
| 198 | 209 | ||
| 199 | /* 优选和商城页面改版升级页面 结束 */ | 210 | /* 优选和商城页面改版升级页面 结束 */ |
| 200 | 211 |