Commit 2123babb1e98e640fcf33cbc6ef50d2815a1922b
1 parent
ec9cf534
数据绑定
Showing
3 changed files
with
32 additions
and
16 deletions
src/components/dresserList/dresserList.vue
| 1 | 1 | <template> |
| 2 | 2 | <div> |
| 3 | - <!--标题--> | |
| 4 | - <textTitleBox :titles="null"></textTitleBox> | |
| 5 | 3 | <div class="item_box"> |
| 6 | 4 | <img class="head_portrait" v-lazy="dresserList.user_img" src="static/img/1.png" alt="网家家"/> |
| 7 | 5 | <div class="user_info"> |
| ... | ... | @@ -19,7 +17,6 @@ |
| 19 | 17 | |
| 20 | 18 | |
| 21 | 19 | <script> |
| 22 | - import textTitleBox from "@/components/textTitleBox/textTitleBox"; | |
| 23 | 20 | export default { |
| 24 | 21 | name: 'dresserList', |
| 25 | 22 | data () { |
| ... | ... | @@ -28,9 +25,6 @@ |
| 28 | 25 | } |
| 29 | 26 | }, |
| 30 | 27 | props: ["dresserList"], |
| 31 | - components:{ | |
| 32 | - textTitleBox | |
| 33 | - }, | |
| 34 | 28 | created(){ |
| 35 | 29 | |
| 36 | 30 | }, | ... | ... |
src/pages/optimization/optimization.less
src/pages/optimization/optimization.vue
| 1 | 1 | <template> |
| 2 | 2 | <div class="optimization-box"> |
| 3 | - | |
| 3 | + <!-- 标题 --> | |
| 4 | + <text-title-box slot="title-box" @more="h5More()" | |
| 5 | + :titles="{ | |
| 6 | + title: '已关注人达人', | |
| 7 | + more: newGoodsMore | |
| 8 | + }"> | |
| 9 | + </text-title-box> | |
| 4 | 10 | <!-- 已关注达人列表(4条) --> |
| 5 | - | |
| 6 | - | |
| 7 | - | |
| 8 | - | |
| 9 | - | |
| 11 | + <div v-for="(item,index) in dresserList" v-if="index<4" :key="index"> | |
| 12 | + <dresserList :dresserList="item"></dresserList> | |
| 13 | + </div> | |
| 10 | 14 | <!-- 商品部分 --> |
| 11 | 15 | <div class="goods-list-box"> |
| 12 | 16 | |
| ... | ... | @@ -83,11 +87,12 @@ |
| 83 | 87 | import horizList from "@/components/horizList/horizList"; |
| 84 | 88 | import horizListFlex from "@/components/horizListFlex/horizListFlex"; |
| 85 | 89 | import textTitleBox from "@/components/textTitleBox/textTitleBox"; |
| 86 | - | |
| 90 | + import dresserList from "@/components/dresserList/dresserList"; | |
| 87 | 91 | export default { |
| 88 | 92 | data () { |
| 89 | 93 | return { |
| 90 | 94 | title: "", |
| 95 | + dresserList: null, // 达人列表 | |
| 91 | 96 | hotGoods: null, // 热销商品 |
| 92 | 97 | hotGoodsMore: null, // 热销商品更多 |
| 93 | 98 | newGoods: null, // 最新上架 |
| ... | ... | @@ -100,8 +105,7 @@ |
| 100 | 105 | horizList, |
| 101 | 106 | horizListFlex, |
| 102 | 107 | textTitleBox, |
| 103 | - | |
| 104 | - | |
| 108 | + dresserList | |
| 105 | 109 | }, |
| 106 | 110 | created() { |
| 107 | 111 | |
| ... | ... | @@ -112,7 +116,17 @@ |
| 112 | 116 | this.fansShopMessageList(); |
| 113 | 117 | }, |
| 114 | 118 | methods: { |
| 115 | - | |
| 119 | + /** | |
| 120 | + * 跳转到关注人列表数据 | |
| 121 | + */ | |
| 122 | + h5More(){ | |
| 123 | + this.$router.push({ | |
| 124 | + path:"/fansShopMessageList", | |
| 125 | + query:{ | |
| 126 | + uid:this.$route.query.uid | |
| 127 | + } | |
| 128 | + }) | |
| 129 | + }, | |
| 116 | 130 | /** |
| 117 | 131 | * 优选页面接口 |
| 118 | 132 | */ |
| ... | ... | @@ -152,6 +166,13 @@ |
| 152 | 166 | |
| 153 | 167 | /* 获取优选库“优选”数据 开始 */ |
| 154 | 168 | |
| 169 | + // 获取“达人列表数据” | |
| 170 | + if (datas.list && datas.list.length) { | |
| 171 | + | |
| 172 | + // 设置“最近购买”数据 | |
| 173 | + this.$set(this, "dresserList", datas.list); | |
| 174 | + } | |
| 175 | + | |
| 155 | 176 | // 获取“热销商品” |
| 156 | 177 | if (datas.hotGoods && datas.hotGoods.length) { |
| 157 | 178 | ... | ... |