Commit c1bc07827751002bbaa9b5be0725a6986d7e0cbf

Authored by zhiyangdu
1 parent 6a4aab2e

新达人页数据绑定

src/components/horizList/horizList.vue
... ... @@ -45,10 +45,10 @@
45 45 <swiper-item v-if="com == '4'" @jump="jump"
46 46 :item="item">
47 47 </swiper-item>
48   - <recommend-Daren v-if="com == '5'" @jump="jump"
  48 + <shop-daren-hot v-if="com == '5'"
49 49 :item="item">
50 50  
51   - </recommend-Daren>
  51 + </shop-daren-hot>
52 52 </div>
53 53 </div>
54 54 </div>
... ... @@ -64,7 +64,7 @@
64 64 import goodsItem2 from "@/components/goodsItem_2/goodsItem_2";
65 65 import goodsItem3 from "@/components/goodsItem_3/goodsItem_3";
66 66 import swiperItem from "@/components/swiperItem/swiperItem";
67   - import recommendDaren from "@/components/recommendDaren/recommendDaren";
  67 + import shopDarenHot from "@/components/shopDarenHot/shopDarenHot";
68 68 export default {
69 69 name: "horizList",
70 70 data() {
... ... @@ -79,7 +79,7 @@
79 79 goodsItem2,
80 80 goodsItem3,
81 81 swiperItem,
82   - recommendDaren
  82 + shopDarenHot
83 83 },
84 84 methods: {
85 85  
... ...
src/components/recommendDaren/recommendDaren.less renamed to src/components/shopDarenHot/shopDarenHot.less
1 1 .recommendDaren{
2   - padding: 0 30px;
  2 + padding: 0 15px;
3 3 display: flex;
4 4 .daren_box{
5 5 width:210px;
... ... @@ -29,7 +29,7 @@
29 29 font-weight:400;
30 30 color:rgba(153,153,153,1);
31 31 line-height:25px;
32   - font-size: 18px;
  32 + overflow: hidden;
33 33 }
34 34 .btn{
35 35 width:120px;
... ...
src/components/recommendDaren/recommendDaren.vue renamed to src/components/shopDarenHot/shopDarenHot.vue
1 1 <template>
2   - <div class="recommendDaren">
  2 + <div v-if="item" class="recommendDaren">
3 3 <div class="daren_box">
4 4 <img class="head_portrait" src="/static/img/2.png" />
5 5 <div class="name">
6   - 冯提莫
  6 + {{item.title}}
7 7 </div>
8 8 <div class="desc">
9   - 国内女装大佬TOP10
  9 + {{item.titles}}
10 10 </div>
11 11 <div class="btn">
12 12 关注
... ... @@ -23,9 +23,9 @@
23 23  
24 24 }
25 25 },
26   - porps:["item"],
  26 + props:["item"],
27 27 created(){
28   -
  28 + console.log(this.item)
29 29 },
30 30 methods: {
31 31 }
... ... @@ -34,5 +34,5 @@
34 34  
35 35 <!-- Add "scoped" attribute to limit CSS to this component only -->
36 36 <style rel="stylesheet/less" lang="less" scoped>
37   - @import "recommendDaren";
  37 + @import "shopDarenHot";
38 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 1 <template>
2 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 5 <div class="user_info">
7 6 <div class="daren_box">
8 7 <div class="name">
9   - 冯提莫
  8 + {{shopDatenTop.title}}
10 9 </div>
11 10 <div class="tag">
12 11 人气
13 12 </div>
14 13 </div>
15 14 <div class="desc">
16   - 冯提莫描述
  15 + {{shopDatenTop.titles}}
17 16 </div>
18 17 </div>
19 18 <div class="btn">
... ... @@ -31,7 +30,7 @@
31 30  
32 31 }
33 32 },
34   - props: ["darenInfo"],
  33 + props: ["shopDatenTop"],
35 34 methods: {
36 35  
37 36 /**
... ... @@ -47,5 +46,5 @@
47 46  
48 47 <!-- Add "scoped" attribute to limit CSS to this component only -->
49 48 <style rel="stylesheet/less" lang="less" scoped>
50   - @import "darenInfo";
  49 + @import "shopDatenTop";
51 50 </style>
... ...
src/pages/newDaren/newDaren.vue
... ... @@ -8,11 +8,11 @@
8 8 }">
9 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 16 com="5">
17 17 </horiz-list>
18 18 <!-- 达人动态列表 -->
... ... @@ -180,23 +180,23 @@
180 180 import swiper from "@/components/swiper/swiper";
181 181 import darenListBox from "@/components/darenListBox/darenListBox";
182 182 import textTitleBox from "@/components/textTitleBox/textTitleBox";
183   - import darenInfo from "@/components/darenInfo/darenInfo";
  183 + import shopDatenTop from "@/components/shopDatenTop/shopDatenTop";
184 184 import horizList from "@/components/horizList/horizList";
185 185 export default {
186 186 name: "darenList",
187 187 data() {
188 188 return {
189 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 195 components:{
196 196 darenListBox,
197 197 textTitleBox,
198 198 swiper,
199   - darenInfo,
  199 + shopDatenTop,
200 200 horizList
201 201 },
202 202 created() {
... ... @@ -205,7 +205,7 @@
205 205 this.$set(this, "title", "达人");
206 206  
207 207 // 获取优选库精选活动
208   - // this.activityAd();
  208 + this.newDarenIndex();
209 209 },
210 210 methods: {
211 211  
... ... @@ -222,14 +222,14 @@
222 222 /**
223 223 * 获取优选库精选活动
224 224 */
225   - activityAd() {
  225 + newDarenIndex() {
226 226 // 加载中提示
227 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 233 method: "post"
234 234 }
235 235 );
... ... @@ -240,7 +240,7 @@
240 240 * @param {object} res [服务器返回数据]
241 241 * @param {object} ext [扩展参数]
242 242 */
243   - activityAdCallback(res, ext) {
  243 + newDarenIndexCallback(res, ext) {
244 244  
245 245 // 加载完成
246 246 Indicator.close();
... ... @@ -260,15 +260,11 @@
260 260 this.$set(this, "title", datas.title);
261 261  
262 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 268 // 设置ads数据
273 269 if (datas.ads && datas.ads.length) {
274 270 this.$set(this, "ads", datas.ads);
... ...