Commit 021af894e08cea68af054dc390360454620cf9f3

Authored by 王强
1 parent 97954fdc

1、达人列表添加nav导航,返回按钮

2、达人页面猜你喜欢下边距50PX
src/components/backBox/backBox.less
@@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
32 justify-content: center; 32 justify-content: center;
33 align-items: center; 33 align-items: center;
34 background-color: transparent; 34 background-color: transparent;
35 - color: #FFFFFF; 35 + color: #333333;
36 font-size: 34px; 36 font-size: 34px;
37 width: 60vw; 37 width: 60vw;
38 height: 93px; 38 height: 93px;
@@ -54,4 +54,4 @@ @@ -54,4 +54,4 @@
54 } 54 }
55 } 55 }
56 } 56 }
57 -}  
58 \ No newline at end of file 57 \ No newline at end of file
  58 +}
src/pages/fansShopMessageList/fansShopMessageList.vue
1 <template> 1 <template>
2 - <div>  
3 - <!--<div class="title">-->  
4 - <!--已关注达人-->  
5 - <!--</div>-->  
6 - <div class="item_box">  
7 - <ul  
8 - v-infinite-scroll="loadMore"  
9 - infinite-scroll-disabled="loading"  
10 - :infinite-scroll-distance="list.length">  
11 - <li v-for="(item, index) in list" :key="index" @click="$parent.toDetail(item)">  
12 - <dresserList  
13 - :dresserList="item">  
14 - </dresserList>  
15 - </li>  
16 - </ul>  
17 - </div>  
18 - </div> 2 + <div>
  3 +
  4 + <!-- nav -->
  5 + <back-box @back="back"
  6 + :backs="backs">
  7 + </back-box>
  8 +
  9 + <!-- 已关注达人列表 -->
  10 + <div class="item_box">
  11 + <ul
  12 + v-infinite-scroll="loadMore"
  13 + infinite-scroll-disabled="loading"
  14 + :infinite-scroll-distance="list.length">
  15 + <li v-for="(item, index) in list" :key="index" @click="$parent.toDetail(item)">
  16 + <dresserList
  17 + :dresserList="item">
  18 + </dresserList>
  19 + </li>
  20 + </ul>
  21 + </div>
  22 + </div>
19 </template> 23 </template>
20 24
21 <script> 25 <script>
22 // 引入组件 26 // 引入组件
23 import { Toast, Indicator } from 'mint-ui'; 27 import { Toast, Indicator } from 'mint-ui';
  28 + import backBox from "@/components/backBox/backBox";
24 import dresserList from "@/components/dresserList/dresserList"; 29 import dresserList from "@/components/dresserList/dresserList";
25 30
26 - export default {  
27 - name: 'fansShopMessageList',  
28 - data () {  
29 - return {  
30 - list: [],  
31 - loading: false,  
32 - }  
33 - },  
34 - components:{  
35 - dresserList  
36 - },  
37 - created(){  
38 - document.title = "已关注达人";  
39 - // 获取关注人列表  
40 - this.fansShopMessageList();  
41 - },  
42 - methods: {  
43 - /**  
44 - * 已关注达人列表  
45 - */  
46 - fansShopMessageList () {  
47 - // 加载中提示  
48 - Indicator.open('加载中...');  
49 - // 请求接口  
50 - this.http("/api/Dynamic/fansShopMessageList", {  
51 - uid:this.$route.query.uid  
52 - },this.fansShopMessageListCallback, {  
53 - method: "post"  
54 - }); 31 + export default {
  32 + name: 'fansShopMessageList',
  33 + data() {
  34 + return {
  35 + title: "",
  36 + backs: {
  37 + title: "已关注达人",
  38 + funcs: {
  39 + back: {
  40 + icon: "static/img/icon_back.png"
  41 + }
  42 + }
  43 + },
  44 + list: [], // 达人列表
  45 + loading: false // 上拉加载控制
  46 + }
55 }, 47 },
  48 + components: {
  49 + backBox,
  50 + dresserList
  51 + },
  52 + created() {
  53 +
  54 + // 设置标题
  55 + this.$set(this, "title", "已关注达人");
  56 +
  57 + // 获取关注人列表
  58 + this.fansShopMessageList();
  59 + },
  60 + methods: {
  61 +
  62 + /**
  63 + * 已关注达人列表
  64 + */
  65 + fansShopMessageList () {
  66 +
  67 + // 校验登录
  68 + if (this.$parent.checkLogin()) {
56 69
57 - /**  
58 - * 已关注达人列表回调  
59 - * @param {object} res [服务器返回数据]  
60 - * @param {object} ext [扩展参数]  
61 - */  
62 - fansShopMessageListCallback(res, ext) {  
63 - // 加载完成  
64 - Indicator.close();  
65 - // 返回处理  
66 - if (res.code == 200) { 70 + // 加载中提示
  71 + Indicator.open('加载中...');
67 72
68 - // 解构数据  
69 - let {data: datas} = res; 73 + // 请求接口
  74 + this.http("/api/Dynamic/fansShopMessageList", {
  75 + uid: (this.$route.query.uid || this.getStore("uid"))
  76 + },this.fansShopMessageListCallback, {
  77 + method: "post"
  78 + });
  79 + }
  80 + },
70 81
71 - /*获取裂变数据*/ 82 + /**
  83 + * 已关注达人列表回调
  84 + * @param {object} res [服务器返回数据]
  85 + * @param {object} ext [扩展参数]
  86 + */
  87 + fansShopMessageListCallback(res, ext) {
  88 + // 加载完成
  89 + Indicator.close();
  90 + // 返回处理
  91 + if (res.code == 200) {
72 92
73 - // 设置标题  
74 - this.$set(this, "list", datas.list); 93 + // 解构数据
  94 + let {data: datas} = res;
  95 +
  96 + /*获取裂变数据*/
  97 +
  98 + // 设置标题
  99 + this.$set(this, "list", datas.list);
  100 + }
  101 + },
  102 +
  103 + /**
  104 + * 上拉加载
  105 + */
  106 + loadMore() {
  107 + // this.loading = true;
  108 + // setTimeout(() => {
  109 + // let last = this.list[this.list.length - 1];
  110 + // for (let i = 1; i <= 10; i++) {
  111 + // this.list.push(last + i);
  112 + // }
  113 + // this.loading = false;
  114 + // }, 2500);
  115 + },
  116 +
  117 + /**
  118 + * 后退
  119 + */
  120 + back() {
  121 +
  122 + // 判断是否有后退函数
  123 + if (typeof this.$parent.back === "function") {
  124 +
  125 + // 调用后退
  126 + this.$parent.back();
  127 + } else {
  128 +
  129 + // 后退
  130 + window.history.go(-1);
  131 + }
75 } 132 }
76 }, 133 },
77 - loadMore() {  
78 -// this.loading = true;  
79 -// setTimeout(() => {  
80 -// let last = this.list[this.list.length - 1];  
81 -// for (let i = 1; i <= 10; i++) {  
82 -// this.list.push(last + i);  
83 -// }  
84 -// this.loading = false;  
85 -// }, 2500); 134 + head: {
  135 + title () {
  136 + return {
  137 + inner: this.title
  138 + }
  139 + }
86 }, 140 },
  141 + watch: {
87 142
  143 + // 设置页面标题
  144 + title(newVal) {
  145 + if (this.$store.state.browser.toLowerCase() == "qq" && this.$store.state.deviceType.toLowerCase() == "iphone") {
  146 + this.$iFrame.insertIFrame(newVal);
  147 + } else {
  148 + this.$emit("updateHead");
  149 + }
  150 + }
  151 + }
88 } 152 }
89 - }  
90 </script> 153 </script>
91 154
92 <!-- Add "scoped" attribute to limit CSS to this component only --> 155 <!-- Add "scoped" attribute to limit CSS to this component only -->
src/pages/optimization/optimization.less
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 .components-box { 8 .components-box {
9 margin-bottom: 50px; 9 margin-bottom: 50px;
10 &:last-child { 10 &:last-child {
11 - margin-bottom: 0; 11 + // margin-bottom: 0;
12 } 12 }
13 } 13 }
14 } 14 }
src/pages/optimization/optimization.vue
@@ -89,10 +89,11 @@ @@ -89,10 +89,11 @@
89 89
90 // 引入组件 90 // 引入组件
91 import { Toast, Indicator } from "mint-ui"; 91 import { Toast, Indicator } from "mint-ui";
  92 + import dresserList from "@/components/dresserList/dresserList";
92 import horizList from "@/components/horizList/horizList"; 93 import horizList from "@/components/horizList/horizList";
93 import horizListFlex from "@/components/horizListFlex/horizListFlex"; 94 import horizListFlex from "@/components/horizListFlex/horizListFlex";
94 import textTitleBox from "@/components/textTitleBox/textTitleBox"; 95 import textTitleBox from "@/components/textTitleBox/textTitleBox";
95 - import dresserList from "@/components/dresserList/dresserList"; 96 +
96 export default { 97 export default {
97 data () { 98 data () {
98 return { 99 return {
@@ -107,10 +108,10 @@ @@ -107,10 +108,10 @@
107 } 108 }
108 }, 109 },
109 components: { 110 components: {
  111 + dresserList,
110 horizList, 112 horizList,
111 horizListFlex, 113 horizListFlex,
112 - textTitleBox,  
113 - dresserList 114 + textTitleBox
114 }, 115 },
115 created() { 116 created() {
116 117
@@ -121,17 +122,7 @@ @@ -121,17 +122,7 @@
121 this.fansShopMessageList(); 122 this.fansShopMessageList();
122 }, 123 },
123 methods: { 124 methods: {
124 - /**  
125 - * 跳转到关注人列表数据  
126 - */  
127 - h5More(){  
128 - this.$router.push({  
129 - path:"/fansShopMessageList",  
130 - query:{  
131 - uid:this.$route.query.uid  
132 - }  
133 - })  
134 - }, 125 +
135 /** 126 /**
136 * 优选页面接口 127 * 优选页面接口
137 */ 128 */
@@ -174,7 +165,7 @@ @@ -174,7 +165,7 @@
174 // 获取“达人列表数据” 165 // 获取“达人列表数据”
175 if (datas.list && datas.list.length) { 166 if (datas.list && datas.list.length) {
176 167
177 - // 设置“最近购买”数据 168 + // 设置“达人列表数据”数据
178 this.$set(this, "dresserList", datas.list); 169 this.$set(this, "dresserList", datas.list);
179 } 170 }
180 171
@@ -234,6 +225,20 @@ @@ -234,6 +225,20 @@
234 }, 225 },
235 226
236 /** 227 /**
  228 + * 跳转到关注人列表数据
  229 + */
  230 + h5More() {
  231 +
  232 + // 跳转达人列表页面
  233 + this.$router.push({
  234 + path:"/fansShopMessageList",
  235 + query:{
  236 + uid: (this.$route.query.uid || this.getStore("uid"))
  237 + }
  238 + })
  239 + },
  240 +
  241 + /**
237 * 跳转 242 * 跳转
238 * @param {object} item [数据对象] 243 * @param {object} item [数据对象]
239 */ 244 */
@@ -269,11 +274,6 @@ @@ -269,11 +274,6 @@
269 */ 274 */
270 more(item) { 275 more(item) {
271 276
272 -  
273 - console.log("more", item);  
274 -  
275 -  
276 -  
277 // 判断并调用通用跳转 277 // 判断并调用通用跳转
278 if (typeof this.$parent.gotoDetail === "function") { 278 if (typeof this.$parent.gotoDetail === "function") {
279 this.$parent.gotoDetail(item); 279 this.$parent.gotoDetail(item);
@@ -297,9 +297,6 @@ @@ -297,9 +297,6 @@
297 this.$emit("updateHead"); 297 this.$emit("updateHead");
298 } 298 }
299 } 299 }
300 - },  
301 - mounted() {  
302 -  
303 } 300 }
304 } 301 }
305 </script> 302 </script>
static/img/icon_back.png 0 → 100644

512 Bytes