Commit b5035dd9d70c850e26c39c3e21205d46436ccaed
1 parent
69f9d506
已关注达人动态增加头部返回按钮
Showing
1 changed file
with
31 additions
and
1 deletions
src/pages/moreDynamic/moreDynamic.vue
| 1 | <template> | 1 | <template> |
| 2 | <div class="item_box"> | 2 | <div class="item_box"> |
| 3 | + <!-- nav --> | ||
| 4 | + <back-box :style="'padding-top: ' + ($parent.top.value) + 'px'" @back="back" | ||
| 5 | + :backs="backs"> | ||
| 6 | + </back-box> | ||
| 3 | <div | 7 | <div |
| 4 | infinite-scroll-immediate-check="true" | 8 | infinite-scroll-immediate-check="true" |
| 5 | v-infinite-scroll="getNewDynamicList" | 9 | v-infinite-scroll="getNewDynamicList" |
| @@ -15,17 +19,27 @@ | @@ -15,17 +19,27 @@ | ||
| 15 | <script> | 19 | <script> |
| 16 | import { Toast, Indicator } from "mint-ui"; | 20 | import { Toast, Indicator } from "mint-ui"; |
| 17 | import darenListBox from "@/components/darenListBox/darenListBox"; | 21 | import darenListBox from "@/components/darenListBox/darenListBox"; |
| 22 | + import backBox from "@/components/backBox/backBox"; | ||
| 18 | export default { | 23 | export default { |
| 19 | name: 'recommendedDaren', | 24 | name: 'recommendedDaren', |
| 20 | data () { | 25 | data () { |
| 21 | return { | 26 | return { |
| 27 | + backs: { // nav导航条数据 | ||
| 28 | + title: "已关注达人动态", | ||
| 29 | + funcs: { | ||
| 30 | + back: { | ||
| 31 | + icon: "static/img/icon_back.png" | ||
| 32 | + } | ||
| 33 | + } | ||
| 34 | + }, | ||
| 22 | loading: false, // 加载 | 35 | loading: false, // 加载 |
| 23 | pages:0, // 分页 | 36 | pages:0, // 分页 |
| 24 | recommendedDarenMore:null | 37 | recommendedDarenMore:null |
| 25 | } | 38 | } |
| 26 | }, | 39 | }, |
| 27 | components:{ | 40 | components:{ |
| 28 | - darenListBox | 41 | + darenListBox, |
| 42 | + backBox | ||
| 29 | }, | 43 | }, |
| 30 | created(){ | 44 | created(){ |
| 31 | // 设置标题 | 45 | // 设置标题 |
| @@ -186,6 +200,22 @@ | @@ -186,6 +200,22 @@ | ||
| 186 | 200 | ||
| 187 | this.$parent.gotoDetail(item); | 201 | this.$parent.gotoDetail(item); |
| 188 | } | 202 | } |
| 203 | + }, | ||
| 204 | + /** | ||
| 205 | + * 后退 | ||
| 206 | + */ | ||
| 207 | + back() { | ||
| 208 | + | ||
| 209 | + // 判断是否有后退函数 | ||
| 210 | + if (typeof this.$parent.back === "function") { | ||
| 211 | + | ||
| 212 | + // 调用后退 | ||
| 213 | + this.$parent.back(); | ||
| 214 | + } else { | ||
| 215 | + | ||
| 216 | + // 后退 | ||
| 217 | + window.history.go(-1); | ||
| 218 | + } | ||
| 189 | } | 219 | } |
| 190 | } | 220 | } |
| 191 | } | 221 | } |