index.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <gui-page :customFooter="true" iphoneXButtomStyle="background:#F8F8F8"
  3. :footerSets="{height:150, zIndex:100, bg:'none'}" :isLoading="pageLoading">
  4. <!-- 页面主体 -->
  5. <view slot="gBody" class="gui-margin">
  6. <gui-demo-banner :title="fetch.config.name"
  7. :img="fetch.config.home_top"
  8. :desc="fetch.config.info"></gui-demo-banner>
  9. <block v-for="(v, k) in fetch.cate" :key="k">
  10. <view class="gui-margin-top">
  11. <text class="gui-h5 gui-color-gray gui-bold">{{v.name}}</text>
  12. </view>
  13. <view style="margin-top:15rpx" class="gui-flex gui-rows gui-wrap gui-space-between">
  14. <view class="demo" v-for="(v1, k1) in v.button" :key="k1" @click="location(v1)">
  15. <button type="default" class="gui-button gui-bg-primary" :style="{'background-color':v1.bgcolor + ' !important'}">
  16. <text class="gui-icons gui-button-text-mini gui-color-white"
  17. style="padding-right:10rpx;">{{v1.name}}</text>
  18. </button>
  19. </view>
  20. </view>
  21. </block>
  22. </view>
  23. <foot ref="foot" slot="gFooter" :value="foot_value"></foot>
  24. <dever-share ref="share" :data="fetch.share" v-if="fetch.share"></dever-share>
  25. </gui-page>
  26. </template>
  27. <script>
  28. import deverShare from '@/lib/dever/components/share.vue';
  29. import foot from '@/pages/index/foot.vue';
  30. export default {
  31. data() {
  32. return {
  33. foot_value : 0,
  34. fetch : {
  35. user : {},
  36. config : {
  37. home_top : '',
  38. },
  39. score : {},
  40. xuanchuan : [],
  41. share : false,
  42. },
  43. }
  44. },
  45. components:{
  46. deverShare,foot
  47. },
  48. onLoad() {
  49. this.getInfo();
  50. },
  51. onShow() {
  52. this.$nextTick(function() {
  53. this.$refs.foot.cur = this.foot_value;
  54. });
  55. },
  56. // 重新加载
  57. onPullDownRefresh: function() {
  58. this.getInfo();
  59. },
  60. methods: {
  61. getInfo : function() {
  62. this.Dever.get(this, 'app/collection/?l=api.home', {id:-1});
  63. },
  64. location : function(v) {
  65. this.Dever.location(v.link, 'webview', v.name);
  66. }
  67. }
  68. }
  69. </script>
  70. <style>
  71. .demo{width:210rpx; margin:10rpx;}
  72. .button{width:90rpx; height:90rpx; line-height:90rpx; border-radius:8rpx; margin:10rpx;}
  73. .button-text{font-size:38rpx; text-align:center;}
  74. </style>