Commit 5b2d20fa9cf085a8e5771cb96185d5c8a457975a
1 parent
9c47d6d1
优选库优选首页开发进行中~
Showing
8 changed files
with
701 additions
and
11 deletions
src/components/countDownCom/countDownCom.less
0 → 100644
| 1 | +@charset "UTF-8"; | |
| 2 | + | |
| 3 | +.count-down-com { | |
| 4 | + .count-down { | |
| 5 | + display: flex; | |
| 6 | + justify-content: flex-start; | |
| 7 | + align-items: center; | |
| 8 | + .container { | |
| 9 | + display: flex; | |
| 10 | + justify-content: center; | |
| 11 | + align-items: center; | |
| 12 | + .block { | |
| 13 | + display: flex; | |
| 14 | + justify-content: center; | |
| 15 | + align-items: center; | |
| 16 | + background-color: #ECECEC; | |
| 17 | + margin-left: 10px; | |
| 18 | + width: 36px; | |
| 19 | + height: 30px; | |
| 20 | + color: #333333; | |
| 21 | + font-size: 20px; | |
| 22 | + border-radius: 4px; | |
| 23 | + &.transparent { | |
| 24 | + background-color: transparent; | |
| 25 | + } | |
| 26 | + } | |
| 27 | + .colon { | |
| 28 | + margin-left: 10px; | |
| 29 | + color: #999999; | |
| 30 | + font-size: 20px; | |
| 31 | + } | |
| 32 | + } | |
| 33 | + &.style-2 { | |
| 34 | + .container { | |
| 35 | + .block { | |
| 36 | + background-color: #3C3C3C; | |
| 37 | + width: 46px; | |
| 38 | + height: 36px; | |
| 39 | + color: #FFFFFF; | |
| 40 | + font-size: 25px; | |
| 41 | + &.transparent { | |
| 42 | + background-color: transparent; | |
| 43 | + color: #333333; | |
| 44 | + } | |
| 45 | + } | |
| 46 | + .colon { | |
| 47 | + color: #3C3C3C; | |
| 48 | + font-size: 24px; | |
| 49 | + } | |
| 50 | + } | |
| 51 | + } | |
| 52 | + &.style-3 { | |
| 53 | + .container { | |
| 54 | + .block { | |
| 55 | + background-color: rgba(189, 164, 127, 1); | |
| 56 | + width: 36px; | |
| 57 | + height: 36px; | |
| 58 | + color: #FFFFFF; | |
| 59 | + font-size: 20px; | |
| 60 | + font-weight: 400; | |
| 61 | + } | |
| 62 | + .colon { | |
| 63 | + color: rgba(189, 164, 127, 1); | |
| 64 | + font-size: 20px; | |
| 65 | + font-weight: 400; | |
| 66 | + } | |
| 67 | + } | |
| 68 | + } | |
| 69 | + &.style-4 { | |
| 70 | + .container { | |
| 71 | + .block { | |
| 72 | + background-color: #3C3C3C; | |
| 73 | + width: 36px; | |
| 74 | + height: 36px; | |
| 75 | + color: #FCF7F1; | |
| 76 | + font-size: 20px; | |
| 77 | + font-weight: 400; | |
| 78 | + } | |
| 79 | + .colon { | |
| 80 | + color: #3C3C3C; | |
| 81 | + font-size: 20px; | |
| 82 | + font-weight: 400; | |
| 83 | + } | |
| 84 | + } | |
| 85 | + } | |
| 86 | + } | |
| 87 | +} | |
| 0 | 88 | \ No newline at end of file | ... | ... |
src/components/countDownCom/countDownCom.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="count-down-com" v-if="time"> | |
| 3 | + <van-count-down class="count-down" :class="'style-' + sty" :time="time" @finish="finish"> | |
| 4 | + <template v-slot="timeData"> | |
| 5 | + <div class="container" v-if="timeData.days > 0"> | |
| 6 | + <span class="block transparent">{{ timeData.days }}</span> | |
| 7 | + <span class="colon">天</span> | |
| 8 | + </div> | |
| 9 | + <div class="container"> | |
| 10 | + <span class="block">{{ timeData.hours }}</span> | |
| 11 | + <span class="colon" v-if="sty == '2'">时</span> | |
| 12 | + <span class="colon" v-else>:</span> | |
| 13 | + <span class="block">{{ timeData.minutes }}</span> | |
| 14 | + <span class="colon" v-if="sty == '2'">分</span> | |
| 15 | + <span class="colon" v-else>:</span> | |
| 16 | + <span class="block">{{ timeData.seconds }}</span> | |
| 17 | + <span class="colon" v-if="sty == '2'">秒</span> | |
| 18 | + </div> | |
| 19 | + </template> | |
| 20 | + </van-count-down> | |
| 21 | + </div> | |
| 22 | +</template> | |
| 23 | + | |
| 24 | +<script> | |
| 25 | + | |
| 26 | + // 引入组件 | |
| 27 | + import Vue from 'vue'; | |
| 28 | + import { CountDown } from 'vant'; | |
| 29 | + | |
| 30 | + Vue.use(CountDown); | |
| 31 | + | |
| 32 | + export default { | |
| 33 | + name: "count-down-com", | |
| 34 | + data: function () { | |
| 35 | + return { | |
| 36 | + | |
| 37 | + } | |
| 38 | + }, | |
| 39 | + props: ["time", "sty"], | |
| 40 | + methods: { | |
| 41 | + | |
| 42 | + /** | |
| 43 | + * 倒计时完成事件 | |
| 44 | + */ | |
| 45 | + finish() { | |
| 46 | + this.$emit("finish"); | |
| 47 | + } | |
| 48 | + } | |
| 49 | + } | |
| 50 | +</script> | |
| 51 | + | |
| 52 | +<!-- Add "scoped" attribute to limit CSS to this component only --> | |
| 53 | +<style rel="stylesheet/less" lang="less" scoped> | |
| 54 | + @import './countDownCom'; | |
| 55 | +</style> | |
| 0 | 56 | \ No newline at end of file | ... | ... |
src/components/goodsItem_2/goodsItem_2.vue
| ... | ... | @@ -7,11 +7,11 @@ |
| 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'">{{item.title}}</div> | |
| 10 | + <div class="title" v-if="pid == undefined || pid == '1' || pid == '3' || pid == '4'">{{item.title}}</div> | |
| 11 | 11 | <div class="price-box"> |
| 12 | 12 | <div class="symbol">¥ </div> |
| 13 | 13 | <div class="price">{{item.price}}</div> |
| 14 | - <div class="prices" v-if="pid == '3' && item.prices && parseFloat(item.prices) > 0 ">¥{{item.prices}}</div> | |
| 14 | + <div class="prices" v-if="(pid == '3' || pid == '4') && item.prices && parseFloat(item.prices) > 0 ">¥{{item.prices}}</div> | |
| 15 | 15 | </div> |
| 16 | 16 | <div class="ads" v-if="pid == '2'"> |
| 17 | 17 | {{item.title || ""}} | ... | ... |
src/main.js
| ... | ... | @@ -6,7 +6,7 @@ import VueHead from "vue-head"; |
| 6 | 6 | import sha1 from "sha1"; |
| 7 | 7 | import 'mint-ui/lib/style.css'; |
| 8 | 8 | import { Toast, Indicator,InfiniteScroll } from "mint-ui"; |
| 9 | -import { Rate, Popup, Lazyload, Search, PullRefresh, Picker, Image, ImagePreview, Tab, Tabs} from "vant"; | |
| 9 | +import { Rate, Popup, Lazyload, Search, PullRefresh, Picker, Image, ImagePreview, Tab, Tabs, CountDown} from "vant"; | |
| 10 | 10 | import App from "./App"; |
| 11 | 11 | import IdCard from './common/IdCard'; |
| 12 | 12 | import VueClipboard from 'vue-clipboard2'; |
| ... | ... | @@ -24,6 +24,7 @@ Vue.use(ImagePreview); |
| 24 | 24 | Vue.use(VueClipboard); |
| 25 | 25 | Vue.use(Tab); |
| 26 | 26 | Vue.use(Tabs); |
| 27 | +Vue.use(CountDown); | |
| 27 | 28 | Vue.use(Lazyload, { |
| 28 | 29 | preload: 90, |
| 29 | 30 | loading: "static/img/x.jpg", | ... | ... |
src/pages/mall2/mall2.vue
| ... | ... | @@ -34,9 +34,9 @@ |
| 34 | 34 | </div> |
| 35 | 35 | |
| 36 | 36 | <!-- 店铺列表 --> |
| 37 | - <div class="shop-list-box" v-if="shopLists && shopLists.length"> | |
| 37 | + <div class="shop-list-box" v-if="goodsLists && goodsLists.length"> | |
| 38 | 38 | |
| 39 | - <div class="section shop-list" v-for="(items, index) in shopLists" :key="index" @click="toDetail(items)"> | |
| 39 | + <div class="section shop-list" v-for="(items, index) in goodsLists" :key="index" @click="toDetail(items)"> | |
| 40 | 40 | |
| 41 | 41 | <!-- 头图 --> |
| 42 | 42 | <div class="header-img-box"> |
| ... | ... | @@ -72,10 +72,10 @@ |
| 72 | 72 | name: "mallBox", |
| 73 | 73 | data() { |
| 74 | 74 | return { |
| 75 | - title: "", // 标题 | |
| 76 | - backs: null, // 后退按钮组 | |
| 77 | - navs: null, // 导航 | |
| 78 | - shopLists: null // 店铺列表 | |
| 75 | + title: "", // 标题 | |
| 76 | + backs: null, // 后退按钮组 | |
| 77 | + navs: null, // 导航 | |
| 78 | + goodsLists: null // 店铺列表 | |
| 79 | 79 | }; |
| 80 | 80 | }, |
| 81 | 81 | components: { |
| ... | ... | @@ -113,7 +113,7 @@ |
| 113 | 113 | |
| 114 | 114 | |
| 115 | 115 | // 临时,初始化店铺列表数据 |
| 116 | - this.$set(this, 'shopLists', [ | |
| 116 | + this.$set(this, 'goodsLists', [ | |
| 117 | 117 | { |
| 118 | 118 | header_img: 'static/img/box_banner.jpg', |
| 119 | 119 | list: [ | ... | ... |
src/pages/optimization2/optimization2.less
0 → 100644
| 1 | +@charset "UTF-8"; | |
| 2 | + | |
| 3 | +.optimization-box { | |
| 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: linear-gradient(180deg, rgba(0, 0, 0, 0.39) 0%, rgba(0, 0, 0, 0) 100%); | |
| 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 | + padding-bottom: 40px; | |
| 29 | + .section { | |
| 30 | + background-color: #ffffff; | |
| 31 | + margin: 40px auto; | |
| 32 | + width: 690px; | |
| 33 | + height: auto; | |
| 34 | + border-radius: 24px; | |
| 35 | + overflow: hidden; | |
| 36 | + &:last-child { | |
| 37 | + margin-bottom: 0; | |
| 38 | + } | |
| 39 | + &.shop-list { | |
| 40 | + .header-img-box { | |
| 41 | + width: 100%; | |
| 42 | + height: 100%; | |
| 43 | + .header-img { | |
| 44 | + display: block; | |
| 45 | + width: 100%; | |
| 46 | + height: 100%; | |
| 47 | + } | |
| 48 | + } | |
| 49 | + .list-box { | |
| 50 | + display: flex; | |
| 51 | + justify-content: space-between; | |
| 52 | + align-items: center; | |
| 53 | + .discount-flag { | |
| 54 | + position: absolute; | |
| 55 | + top: 4px; | |
| 56 | + left: 22px; | |
| 57 | + z-index: 1; | |
| 58 | + background: linear-gradient(90deg, #F9EE7A 0%, #FAD844 100%); | |
| 59 | + padding: 1px 8px; | |
| 60 | + color: #945A08; | |
| 61 | + font-size: 20px; | |
| 62 | + font-weight: 400; | |
| 63 | + border-radius: 6px; | |
| 64 | + } | |
| 65 | + } | |
| 66 | + } | |
| 67 | + &.anchor-list { | |
| 68 | + display: flex; | |
| 69 | + justify-content: space-around; | |
| 70 | + align-items: center; | |
| 71 | + padding: 40px 0 30px 0; | |
| 72 | + } | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + } | |
| 79 | + } | |
| 80 | +} | ... | ... |
src/pages/optimization2/optimization2.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="optimization-box"> | |
| 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"> | |
| 19 | + | |
| 20 | + <!-- 折扣专区 --> | |
| 21 | + <div class="section shop-list"> | |
| 22 | + | |
| 23 | + <!-- 标题 --> | |
| 24 | + <text-bg-title-com | |
| 25 | + :titles="{ | |
| 26 | + bg: 'static/img/text_bg_title_bg.jpg' | |
| 27 | + }"> | |
| 28 | + | |
| 29 | + <!-- 倒计时组件 --> | |
| 30 | + <count-down-com slot="extend" | |
| 31 | + :time="new Date().getTime() + 900000 - new Date().getTime()" | |
| 32 | + sty="4"> | |
| 33 | + </count-down-com> | |
| 34 | + </text-bg-title-com> | |
| 35 | + | |
| 36 | + <!-- 商品列表 --> | |
| 37 | + <div class="list-box"> | |
| 38 | + | |
| 39 | + <!-- 商品展示样式 2 --> | |
| 40 | + <goods-item-2 class="item" v-for="(item, index) in goodsLists" :key="index" @click="toDiscount(item)" | |
| 41 | + :item="item" | |
| 42 | + pid="4"> | |
| 43 | + | |
| 44 | + <!-- 折扣角标 --> | |
| 45 | + <div class="discount-flag" slot="flag"> | |
| 46 | + 5折 | |
| 47 | + </div> | |
| 48 | + </goods-item-2> | |
| 49 | + </div> | |
| 50 | + </div> | |
| 51 | + | |
| 52 | + <!-- 折扣专区 --> | |
| 53 | + <div class="section anchor-list" v-if="navs && navs.length"> | |
| 54 | + | |
| 55 | + <!-- 锚点区域(单个图标) --> | |
| 56 | + <icons-com v-for="(item, index) in navs" :key="index" @click="anchor(item)" | |
| 57 | + :item="item"> | |
| 58 | + </icons-com> | |
| 59 | + </div> | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + </div> | |
| 69 | + | |
| 70 | + <!-- 回到顶部按钮 --> | |
| 71 | + <goto-top | |
| 72 | + :top="parseInt(150)"> | |
| 73 | + </goto-top> | |
| 74 | + </div> | |
| 75 | +</template> | |
| 76 | + | |
| 77 | +<script> | |
| 78 | + | |
| 79 | + // 引入组件 | |
| 80 | + import { Toast, Indicator } from "mint-ui"; | |
| 81 | + import callAppBox from "@/components/callAppBox/callAppBox"; | |
| 82 | + import backBox from "@/components/backBox/backBox"; | |
| 83 | + import textBgTitleCom from "@/components/textBgTitleCom/textBgTitleCom"; | |
| 84 | + import countDownCom from "@/components/countDownCom/countDownCom"; | |
| 85 | + import goodsItem2 from "@/components/goodsItem_2/goodsItem_2"; | |
| 86 | + import iconsCom from "@/components/iconsCom/iconsCom"; | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + import gotoTop from "@/components/gotoTop/gotoTop"; | |
| 92 | + | |
| 93 | + export default { | |
| 94 | + name: 'optimization', | |
| 95 | + data () { | |
| 96 | + return { | |
| 97 | + title: "", // 标题 | |
| 98 | + backs: null, // 后退按钮组 | |
| 99 | + navs: null, // 导航 | |
| 100 | + goodsLists: null // 店铺列表 | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + } | |
| 105 | + }, | |
| 106 | + components: { | |
| 107 | + callAppBox, | |
| 108 | + backBox, | |
| 109 | + textBgTitleCom, | |
| 110 | + countDownCom, | |
| 111 | + goodsItem2, | |
| 112 | + iconsCom, | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + gotoTop | |
| 117 | + }, | |
| 118 | + created() { | |
| 119 | + | |
| 120 | + // 设置标题 | |
| 121 | + this.$set(this, "title", "优选"); | |
| 122 | + | |
| 123 | + // 判断是否在App内 | |
| 124 | + if (this.isCNLive.value) { | |
| 125 | + | |
| 126 | + // 添加后退按钮组“后退”和“分享”按钮 | |
| 127 | + this.$set(this, 'backs', { | |
| 128 | + funcs: { | |
| 129 | + back: { | |
| 130 | + icon: "static/img/icon_back.png" | |
| 131 | + }, | |
| 132 | + funcArray: [ | |
| 133 | + { | |
| 134 | + icon: "static/img/icon_share.png", | |
| 135 | + func: this.toShare | |
| 136 | + } | |
| 137 | + ] | |
| 138 | + } | |
| 139 | + }); | |
| 140 | + | |
| 141 | + // 设置标题 | |
| 142 | + this.$set(this.backs, 'title', '优选'); | |
| 143 | + } | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + // 优选页面接口 | |
| 148 | + // this.fansShopMessageList(); | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + // 临时,初始化店铺列表数据 | |
| 154 | + this.$set(this, 'goodsLists', [ | |
| 155 | + { | |
| 156 | + ads: "广告语", | |
| 157 | + id: "9519164", | |
| 158 | + price: "5.01", | |
| 159 | + prices: "6.00", | |
| 160 | + shop_type: "1", | |
| 161 | + simg: "http://wjjseller.cnlive.com/uploads/05ac5ee31c3bb363d95072559d205bd8.png", | |
| 162 | + title: "L'OCCITANE/欧舒丹 芍药花香润手霜 30ML 30ml" | |
| 163 | + }, | |
| 164 | + { | |
| 165 | + ads: "广告语", | |
| 166 | + id: "9519164", | |
| 167 | + price: "5.01", | |
| 168 | + prices: "6.00", | |
| 169 | + shop_type: "1", | |
| 170 | + simg: "http://wjjseller.cnlive.com/uploads/05ac5ee31c3bb363d95072559d205bd8.png", | |
| 171 | + title: "L'OCCITANE/欧舒丹 芍药花香润手霜 30ML 30ml" | |
| 172 | + }, | |
| 173 | + { | |
| 174 | + ads: "广告语", | |
| 175 | + id: "9519164", | |
| 176 | + price: "5.01", | |
| 177 | + prices: "6.00", | |
| 178 | + shop_type: "1", | |
| 179 | + simg: "http://wjjseller.cnlive.com/uploads/05ac5ee31c3bb363d95072559d205bd8.png", | |
| 180 | + title: "L'OCCITANE/欧舒丹 芍药花香润手霜 30ML 30ml" | |
| 181 | + } | |
| 182 | + ]); | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + // 临时,设置锚点定位数据 | |
| 188 | + this.$set(this, 'navs', [ | |
| 189 | + { | |
| 190 | + id: "295", | |
| 191 | + shop_type: "", | |
| 192 | + simg: "https://wjjtest.ys2.cnliveimg.com/802shop/img/2020/04/23/5ea15e31d986d.jpg", | |
| 193 | + title: "品质优选", | |
| 194 | + to: "0", | |
| 195 | + type: "0" | |
| 196 | + }, | |
| 197 | + { | |
| 198 | + id: "295", | |
| 199 | + shop_type: "", | |
| 200 | + simg: "https://wjjtest.ys2.cnliveimg.com/802shop/img/2020/04/23/5ea15e31d986d.jpg", | |
| 201 | + title: "热销排行", | |
| 202 | + to: "0", | |
| 203 | + type: "0" | |
| 204 | + }, | |
| 205 | + { | |
| 206 | + id: "295", | |
| 207 | + shop_type: "", | |
| 208 | + simg: "https://wjjtest.ys2.cnliveimg.com/802shop/img/2020/04/23/5ea15e31d986d.jpg", | |
| 209 | + title: "积分商城", | |
| 210 | + to: "0", | |
| 211 | + type: "0" | |
| 212 | + }, | |
| 213 | + { | |
| 214 | + id: "295", | |
| 215 | + shop_type: "", | |
| 216 | + simg: "https://wjjtest.ys2.cnliveimg.com/802shop/img/2020/04/23/5ea15e31d986d.jpg", | |
| 217 | + title: "猜你喜欢", | |
| 218 | + to: "0", | |
| 219 | + type: "0" | |
| 220 | + } | |
| 221 | + ]); | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + }, | |
| 230 | + methods: { | |
| 231 | + | |
| 232 | + /** | |
| 233 | + * 优选页面接口 | |
| 234 | + */ | |
| 235 | + fansShopMessageList() { | |
| 236 | + | |
| 237 | + // 校验登录 | |
| 238 | + if (this.$parent.checkLogin()) { | |
| 239 | + | |
| 240 | + // 加载中提示 | |
| 241 | + Indicator.open("加载中..."); | |
| 242 | + | |
| 243 | + // 获取证书请求接口 | |
| 244 | + this.http("/Api/" + this.getApiVersion().dynamic + "/fansShopMessageList", { | |
| 245 | + uid: this.getStore("uid") | |
| 246 | + }, this.fansShopMessageListCallback, { | |
| 247 | + method: "POST" | |
| 248 | + }); | |
| 249 | + } | |
| 250 | + }, | |
| 251 | + | |
| 252 | + /** | |
| 253 | + * 优选页面接口回调 | |
| 254 | + * @param {Object} res [服务器返回数据] | |
| 255 | + * @param {Object} ext [扩展参数] | |
| 256 | + */ | |
| 257 | + fansShopMessageListCallback(res, ext) { | |
| 258 | + | |
| 259 | + // 加载完成 | |
| 260 | + Indicator.close(); | |
| 261 | + | |
| 262 | + // 返回处理 | |
| 263 | + if (res.code == 200) { | |
| 264 | + | |
| 265 | + // 解构数据 | |
| 266 | + let { data: datas } = res; | |
| 267 | + | |
| 268 | + /* 获取优选库“优选”数据 开始 */ | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + /* 获取优选库“优选”数据 结束 */ | |
| 273 | + | |
| 274 | + } else if (res.code == 400) { | |
| 275 | + | |
| 276 | + // 获取优选失败 | |
| 277 | + Toast(res.message); | |
| 278 | + } else { | |
| 279 | + | |
| 280 | + // 获取优选失败 | |
| 281 | + Toast("获取优选失败"); | |
| 282 | + } | |
| 283 | + }, | |
| 284 | + | |
| 285 | + /** | |
| 286 | + * 商品列表 | |
| 287 | + * @param {Int} groupId [平台分类id] | |
| 288 | + * @param {Int} page [页码] | |
| 289 | + * @param {String} CALL_STATUS [何处触发请求] | |
| 290 | + */ | |
| 291 | + shopGoodsList(groupId, page) { | |
| 292 | + | |
| 293 | + // 校验必填参数 | |
| 294 | + if (groupId && page) { | |
| 295 | + | |
| 296 | + // 加载中 | |
| 297 | + this.$set(this.paging, "loading", true); | |
| 298 | + | |
| 299 | + // 获取证书请求接口 | |
| 300 | + this.http("/Api/" + this.getApiVersion().index + "/shopNewGoodsList", { | |
| 301 | + groupid: groupId, | |
| 302 | + page: page | |
| 303 | + }, this.shopGoodsListCallback, { | |
| 304 | + method: "POST" | |
| 305 | + } | |
| 306 | + ); | |
| 307 | + } | |
| 308 | + }, | |
| 309 | + | |
| 310 | + /** | |
| 311 | + * 商品列表回调 | |
| 312 | + * @param {Object} res [服务器返回数据] | |
| 313 | + * @param {Object} ext [扩展参数] | |
| 314 | + */ | |
| 315 | + shopGoodsListCallback(res, ext) { | |
| 316 | + | |
| 317 | + // 下拉刷新结束 | |
| 318 | + this.$set(this, "isLoading", false); | |
| 319 | + | |
| 320 | + // 返回处理 | |
| 321 | + if (res.code == 200) { | |
| 322 | + | |
| 323 | + // 解构数据 | |
| 324 | + let { data: datas } = res; | |
| 325 | + | |
| 326 | + /* 获取商品列表数据 开始 */ | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + /* 获取商品列表数据 结束 */ | |
| 331 | + | |
| 332 | + } else if (res.code == 400) { | |
| 333 | + | |
| 334 | + // 获取最新上架列表失败 | |
| 335 | + Toast(res.message); | |
| 336 | + } else { | |
| 337 | + | |
| 338 | + // 获取最新上架列表失败 | |
| 339 | + Toast("获取最新上架列表失败"); | |
| 340 | + } | |
| 341 | + }, | |
| 342 | + | |
| 343 | + /** | |
| 344 | + * 折扣专区 | |
| 345 | + * @param {Object} item [通用跳转对象] | |
| 346 | + */ | |
| 347 | + toDiscount(item) { | |
| 348 | + | |
| 349 | + // 跳转折扣专区页面 | |
| 350 | + if (typeof this.$parent.navBarJump === 'function') { | |
| 351 | + | |
| 352 | + | |
| 353 | + console.log(item); | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + // 页面跳转 | |
| 358 | + this.$parent.navBarJump(item); | |
| 359 | + } | |
| 360 | + }, | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + /** | |
| 369 | + * 锚点定位 | |
| 370 | + * @param {Object} item [数据对象] | |
| 371 | + */ | |
| 372 | + anchor(item) { | |
| 373 | + | |
| 374 | + | |
| 375 | + console.log('anchor', item); | |
| 376 | + | |
| 377 | + | |
| 378 | + }, | |
| 379 | + | |
| 380 | + /** | |
| 381 | + * 分享 | |
| 382 | + */ | |
| 383 | + toShare() { | |
| 384 | + | |
| 385 | + // 判断分享 | |
| 386 | + if (typeof this.$parent.toShare === 'function') { | |
| 387 | + this.$parent.toShare(38, this.$route.query.id || 0); | |
| 388 | + } | |
| 389 | + }, | |
| 390 | + | |
| 391 | + /** | |
| 392 | + * 后退 | |
| 393 | + */ | |
| 394 | + back() { | |
| 395 | + | |
| 396 | + // 判断是否有处理函数 | |
| 397 | + if (typeof this.$parent.back === 'function') { | |
| 398 | + | |
| 399 | + // 后退 | |
| 400 | + this.$parent.back(); | |
| 401 | + } else { | |
| 402 | + | |
| 403 | + // 后退 | |
| 404 | + window.history.go(-1); | |
| 405 | + } | |
| 406 | + } | |
| 407 | + }, | |
| 408 | + head: { | |
| 409 | + title () { | |
| 410 | + return { | |
| 411 | + inner: this.title | |
| 412 | + } | |
| 413 | + } | |
| 414 | + }, | |
| 415 | + watch: { | |
| 416 | + | |
| 417 | + // 设置页面标题 | |
| 418 | + title(newVal) { | |
| 419 | + if (this.$store.state.browser.toLowerCase() == "qq" && this.$store.state.deviceType.toLowerCase() == "iphone") { | |
| 420 | + this.$iFrame.insertIFrame(newVal); | |
| 421 | + } else { | |
| 422 | + this.$emit("updateHead"); | |
| 423 | + } | |
| 424 | + } | |
| 425 | + }, | |
| 426 | + mounted() { | |
| 427 | + | |
| 428 | + // 如果是App外,设置唤起App和微信内分享参数 | |
| 429 | + if (!this.isCNLive.value) { | |
| 430 | + | |
| 431 | + // 唤起详情页 | |
| 432 | + if (typeof this.$parent.getOpenApp === "function") { | |
| 433 | + this.$parent.getOpenApp({ | |
| 434 | + type: 38, | |
| 435 | + id: this.$route.query.id || 1, | |
| 436 | + url: "" | |
| 437 | + }); | |
| 438 | + } | |
| 439 | + | |
| 440 | + // 分享详情页 | |
| 441 | + if (typeof this.$parent.getShareData === "function") { | |
| 442 | + this.$parent.getShareData({ | |
| 443 | + type: 38, | |
| 444 | + id: this.$route.query.id || 1, | |
| 445 | + url: "" | |
| 446 | + }); | |
| 447 | + } | |
| 448 | + } | |
| 449 | + } | |
| 450 | + } | |
| 451 | +</script> | |
| 452 | + | |
| 453 | +<!-- Add "scoped" attribute to limit CSS to this component only --> | |
| 454 | +<style rel="stylesheet/less" lang='less' scoped> | |
| 455 | + @import "optimization2"; | |
| 456 | +</style> | |
| 0 | 457 | \ No newline at end of file | ... | ... |
src/router/index.js
| ... | ... | @@ -163,7 +163,7 @@ const router = new Router({ |
| 163 | 163 | /* 优选和商城页面改版升级页面 开始 */ |
| 164 | 164 | |
| 165 | 165 | { |
| 166 | - // 优选库商城活动页 | |
| 166 | + // 新版优选库商城活动页 | |
| 167 | 167 | path: "/mall2", |
| 168 | 168 | name: "mall2", |
| 169 | 169 | component: resolve => { |
| ... | ... | @@ -173,6 +173,17 @@ const router = new Router({ |
| 173 | 173 | requireAuth: false |
| 174 | 174 | } |
| 175 | 175 | }, |
| 176 | + { | |
| 177 | + // 新版优选库“优选”页面 | |
| 178 | + path: "/optimization2", | |
| 179 | + name: "optimization2", | |
| 180 | + component: resolve => { | |
| 181 | + require(["@/pages/optimization2/optimization2"], resolve); | |
| 182 | + }, | |
| 183 | + meta: { | |
| 184 | + requireAuth: false | |
| 185 | + } | |
| 186 | + }, | |
| 176 | 187 | |
| 177 | 188 | /* 优选和商城页面改版升级页面 结束 */ |
| 178 | 189 | ... | ... |