Commit c1bc07827751002bbaa9b5be0725a6986d7e0cbf
1 parent
6a4aab2e
新达人页数据绑定
Showing
6 changed files
with
37 additions
and
42 deletions
src/components/horizList/horizList.vue
| @@ -45,10 +45,10 @@ | @@ -45,10 +45,10 @@ | ||
| 45 | <swiper-item v-if="com == '4'" @jump="jump" | 45 | <swiper-item v-if="com == '4'" @jump="jump" |
| 46 | :item="item"> | 46 | :item="item"> |
| 47 | </swiper-item> | 47 | </swiper-item> |
| 48 | - <recommend-Daren v-if="com == '5'" @jump="jump" | 48 | + <shop-daren-hot v-if="com == '5'" |
| 49 | :item="item"> | 49 | :item="item"> |
| 50 | 50 | ||
| 51 | - </recommend-Daren> | 51 | + </shop-daren-hot> |
| 52 | </div> | 52 | </div> |
| 53 | </div> | 53 | </div> |
| 54 | </div> | 54 | </div> |
| @@ -64,7 +64,7 @@ | @@ -64,7 +64,7 @@ | ||
| 64 | import goodsItem2 from "@/components/goodsItem_2/goodsItem_2"; | 64 | import goodsItem2 from "@/components/goodsItem_2/goodsItem_2"; |
| 65 | import goodsItem3 from "@/components/goodsItem_3/goodsItem_3"; | 65 | import goodsItem3 from "@/components/goodsItem_3/goodsItem_3"; |
| 66 | import swiperItem from "@/components/swiperItem/swiperItem"; | 66 | import swiperItem from "@/components/swiperItem/swiperItem"; |
| 67 | - import recommendDaren from "@/components/recommendDaren/recommendDaren"; | 67 | + import shopDarenHot from "@/components/shopDarenHot/shopDarenHot"; |
| 68 | export default { | 68 | export default { |
| 69 | name: "horizList", | 69 | name: "horizList", |
| 70 | data() { | 70 | data() { |
| @@ -79,7 +79,7 @@ | @@ -79,7 +79,7 @@ | ||
| 79 | goodsItem2, | 79 | goodsItem2, |
| 80 | goodsItem3, | 80 | goodsItem3, |
| 81 | swiperItem, | 81 | swiperItem, |
| 82 | - recommendDaren | 82 | + shopDarenHot |
| 83 | }, | 83 | }, |
| 84 | methods: { | 84 | methods: { |
| 85 | 85 |
src/components/recommendDaren/recommendDaren.less renamed to src/components/shopDarenHot/shopDarenHot.less
| 1 | .recommendDaren{ | 1 | .recommendDaren{ |
| 2 | - padding: 0 30px; | 2 | + padding: 0 15px; |
| 3 | display: flex; | 3 | display: flex; |
| 4 | .daren_box{ | 4 | .daren_box{ |
| 5 | width:210px; | 5 | width:210px; |
| @@ -29,7 +29,7 @@ | @@ -29,7 +29,7 @@ | ||
| 29 | font-weight:400; | 29 | font-weight:400; |
| 30 | color:rgba(153,153,153,1); | 30 | color:rgba(153,153,153,1); |
| 31 | line-height:25px; | 31 | line-height:25px; |
| 32 | - font-size: 18px; | 32 | + overflow: hidden; |
| 33 | } | 33 | } |
| 34 | .btn{ | 34 | .btn{ |
| 35 | width:120px; | 35 | width:120px; |
src/components/recommendDaren/recommendDaren.vue renamed to src/components/shopDarenHot/shopDarenHot.vue
| 1 | <template> | 1 | <template> |
| 2 | - <div class="recommendDaren"> | 2 | + <div v-if="item" class="recommendDaren"> |
| 3 | <div class="daren_box"> | 3 | <div class="daren_box"> |
| 4 | <img class="head_portrait" src="/static/img/2.png" /> | 4 | <img class="head_portrait" src="/static/img/2.png" /> |
| 5 | <div class="name"> | 5 | <div class="name"> |
| 6 | - 冯提莫 | 6 | + {{item.title}} |
| 7 | </div> | 7 | </div> |
| 8 | <div class="desc"> | 8 | <div class="desc"> |
| 9 | - 国内女装大佬TOP10 | 9 | + {{item.titles}} |
| 10 | </div> | 10 | </div> |
| 11 | <div class="btn"> | 11 | <div class="btn"> |
| 12 | 关注 | 12 | 关注 |
| @@ -23,9 +23,9 @@ | @@ -23,9 +23,9 @@ | ||
| 23 | 23 | ||
| 24 | } | 24 | } |
| 25 | }, | 25 | }, |
| 26 | - porps:["item"], | 26 | + props:["item"], |
| 27 | created(){ | 27 | created(){ |
| 28 | - | 28 | + console.log(this.item) |
| 29 | }, | 29 | }, |
| 30 | methods: { | 30 | methods: { |
| 31 | } | 31 | } |
| @@ -34,5 +34,5 @@ | @@ -34,5 +34,5 @@ | ||
| 34 | 34 | ||
| 35 | <!-- Add "scoped" attribute to limit CSS to this component only --> | 35 | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| 36 | <style rel="stylesheet/less" lang="less" scoped> | 36 | <style rel="stylesheet/less" lang="less" scoped> |
| 37 | - @import "recommendDaren"; | 37 | + @import "shopDarenHot"; |
| 38 | </style> | 38 | </style> |
src/components/darenInfo/darenInfo.less renamed to src/components/shopDatenTop/shopDatenTop.less
src/components/darenInfo/darenInfo.vue renamed to src/components/shopDatenTop/shopDatenTop.vue
| 1 | <template> | 1 | <template> |
| 2 | <div> | 2 | <div> |
| 3 | - <div class="item_box" @click="toDetail(darenInfo)"> | ||
| 4 | - <!--<img class="head_portrait" v-lazy="darenInfo.user_img" />--> | ||
| 5 | - <img class="head_portrait" src="/static/img/2.png" /> | 3 | + <div class="item_box" @click="toDetail(shopDatenTop)"> |
| 4 | + <img class="head_portrait" v-lazy="shopDatenTop.logo" /> | ||
| 6 | <div class="user_info"> | 5 | <div class="user_info"> |
| 7 | <div class="daren_box"> | 6 | <div class="daren_box"> |
| 8 | <div class="name"> | 7 | <div class="name"> |
| 9 | - 冯提莫 | 8 | + {{shopDatenTop.title}} |
| 10 | </div> | 9 | </div> |
| 11 | <div class="tag"> | 10 | <div class="tag"> |
| 12 | 人气 | 11 | 人气 |
| 13 | </div> | 12 | </div> |
| 14 | </div> | 13 | </div> |
| 15 | <div class="desc"> | 14 | <div class="desc"> |
| 16 | - 冯提莫描述 | 15 | + {{shopDatenTop.titles}} |
| 17 | </div> | 16 | </div> |
| 18 | </div> | 17 | </div> |
| 19 | <div class="btn"> | 18 | <div class="btn"> |
| @@ -31,7 +30,7 @@ | @@ -31,7 +30,7 @@ | ||
| 31 | 30 | ||
| 32 | } | 31 | } |
| 33 | }, | 32 | }, |
| 34 | - props: ["darenInfo"], | 33 | + props: ["shopDatenTop"], |
| 35 | methods: { | 34 | methods: { |
| 36 | 35 | ||
| 37 | /** | 36 | /** |
| @@ -47,5 +46,5 @@ | @@ -47,5 +46,5 @@ | ||
| 47 | 46 | ||
| 48 | <!-- Add "scoped" attribute to limit CSS to this component only --> | 47 | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| 49 | <style rel="stylesheet/less" lang="less" scoped> | 48 | <style rel="stylesheet/less" lang="less" scoped> |
| 50 | - @import "darenInfo"; | 49 | + @import "shopDatenTop"; |
| 51 | </style> | 50 | </style> |
src/pages/newDaren/newDaren.vue
| @@ -8,11 +8,11 @@ | @@ -8,11 +8,11 @@ | ||
| 8 | }"> | 8 | }"> |
| 9 | </swiper> | 9 | </swiper> |
| 10 | <!--达人信息--> | 10 | <!--达人信息--> |
| 11 | - <darenInfo :darenInfo="darenInfo"></darenInfo> | 11 | + <shopDatenTop v-if="shopDatenTop" :shopDatenTop="shopDatenTop"></shopDatenTop> |
| 12 | <!--推荐达人--> | 12 | <!--推荐达人--> |
| 13 | <!--导航--> | 13 | <!--导航--> |
| 14 | - <horiz-list class="components-box" v-if="recommendDaren && recommendDaren.length" @jump="jump" | ||
| 15 | - :lists="recommendDaren" | 14 | + <horiz-list class="components-box" v-if="shopDarenHot && shopDarenHot.length" @jump="jump" |
| 15 | + :lists="shopDarenHot" | ||
| 16 | com="5"> | 16 | com="5"> |
| 17 | </horiz-list> | 17 | </horiz-list> |
| 18 | <!-- 达人动态列表 --> | 18 | <!-- 达人动态列表 --> |
| @@ -180,23 +180,23 @@ | @@ -180,23 +180,23 @@ | ||
| 180 | import swiper from "@/components/swiper/swiper"; | 180 | import swiper from "@/components/swiper/swiper"; |
| 181 | import darenListBox from "@/components/darenListBox/darenListBox"; | 181 | import darenListBox from "@/components/darenListBox/darenListBox"; |
| 182 | import textTitleBox from "@/components/textTitleBox/textTitleBox"; | 182 | import textTitleBox from "@/components/textTitleBox/textTitleBox"; |
| 183 | - import darenInfo from "@/components/darenInfo/darenInfo"; | 183 | + import shopDatenTop from "@/components/shopDatenTop/shopDatenTop"; |
| 184 | import horizList from "@/components/horizList/horizList"; | 184 | import horizList from "@/components/horizList/horizList"; |
| 185 | export default { | 185 | export default { |
| 186 | name: "darenList", | 186 | name: "darenList", |
| 187 | data() { | 187 | data() { |
| 188 | return { | 188 | return { |
| 189 | title: "", // 标题 | 189 | title: "", // 标题 |
| 190 | - darenInfo:null, // 达人信息 | ||
| 191 | - banner:null, // 轮播 | ||
| 192 | - recommendDaren:[1,2] // 达人推荐列表 | 190 | + shopDatenTop: null, // 置顶达人信息 |
| 191 | + banner:[], // 轮播 | ||
| 192 | + shopDarenHot: null // 达人推荐列表 | ||
| 193 | } | 193 | } |
| 194 | }, | 194 | }, |
| 195 | components:{ | 195 | components:{ |
| 196 | darenListBox, | 196 | darenListBox, |
| 197 | textTitleBox, | 197 | textTitleBox, |
| 198 | swiper, | 198 | swiper, |
| 199 | - darenInfo, | 199 | + shopDatenTop, |
| 200 | horizList | 200 | horizList |
| 201 | }, | 201 | }, |
| 202 | created() { | 202 | created() { |
| @@ -205,7 +205,7 @@ | @@ -205,7 +205,7 @@ | ||
| 205 | this.$set(this, "title", "达人"); | 205 | this.$set(this, "title", "达人"); |
| 206 | 206 | ||
| 207 | // 获取优选库精选活动 | 207 | // 获取优选库精选活动 |
| 208 | - // this.activityAd(); | 208 | + this.newDarenIndex(); |
| 209 | }, | 209 | }, |
| 210 | methods: { | 210 | methods: { |
| 211 | 211 | ||
| @@ -222,14 +222,14 @@ | @@ -222,14 +222,14 @@ | ||
| 222 | /** | 222 | /** |
| 223 | * 获取优选库精选活动 | 223 | * 获取优选库精选活动 |
| 224 | */ | 224 | */ |
| 225 | - activityAd() { | 225 | + newDarenIndex() { |
| 226 | // 加载中提示 | 226 | // 加载中提示 |
| 227 | Indicator.open("加载中..."); | 227 | Indicator.open("加载中..."); |
| 228 | 228 | ||
| 229 | // 获取证书请求接口 | 229 | // 获取证书请求接口 |
| 230 | - this.http("/Api/" + this.getApiVersion().index + "/activityAd", { | ||
| 231 | - id: this.$route.query.id | ||
| 232 | - }, this.activityAdCallback, { | 230 | + this.http("/Api/" + this.getApiVersion().index + "/newDarenIndex", { |
| 231 | + uid: this.$route.query.uid | ||
| 232 | + }, this.newDarenIndexCallback, { | ||
| 233 | method: "post" | 233 | method: "post" |
| 234 | } | 234 | } |
| 235 | ); | 235 | ); |
| @@ -240,7 +240,7 @@ | @@ -240,7 +240,7 @@ | ||
| 240 | * @param {object} res [服务器返回数据] | 240 | * @param {object} res [服务器返回数据] |
| 241 | * @param {object} ext [扩展参数] | 241 | * @param {object} ext [扩展参数] |
| 242 | */ | 242 | */ |
| 243 | - activityAdCallback(res, ext) { | 243 | + newDarenIndexCallback(res, ext) { |
| 244 | 244 | ||
| 245 | // 加载完成 | 245 | // 加载完成 |
| 246 | Indicator.close(); | 246 | Indicator.close(); |
| @@ -260,15 +260,11 @@ | @@ -260,15 +260,11 @@ | ||
| 260 | this.$set(this, "title", datas.title); | 260 | this.$set(this, "title", datas.title); |
| 261 | 261 | ||
| 262 | // 设置banner数据 | 262 | // 设置banner数据 |
| 263 | - if (datas.banner && datas.banner.length) { | ||
| 264 | - this.$set(this, "banner", datas.banner); | ||
| 265 | - } | ||
| 266 | - | ||
| 267 | - // 设置navs数据 | ||
| 268 | - if (datas.navs && datas.navs.length) { | ||
| 269 | - this.$set(this, "navs", datas.navs); | ||
| 270 | - } | ||
| 271 | - | 263 | + this.banner.push(datas.shop_daten_ads) |
| 264 | + // 置顶达人 | ||
| 265 | + this.$set(this, "shopDatenTop", datas.shop_daten_top); | ||
| 266 | + // 达人推荐 | ||
| 267 | + this.$set(this, "shopDarenHot", datas.shop_daren_hot); | ||
| 272 | // 设置ads数据 | 268 | // 设置ads数据 |
| 273 | if (datas.ads && datas.ads.length) { | 269 | if (datas.ads && datas.ads.length) { |
| 274 | this.$set(this, "ads", datas.ads); | 270 | this.$set(this, "ads", datas.ads); |