recruit.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <app-layout>
  3. <app-rich-text :content="setting.recruit_content"></app-rich-text>
  4. <view class="placeholder" :class="[`${tabbarbool? 'tabbarbool':''}`]"></view>
  5. <view class="apply safe-area-inset-bottom" :class="[ `${iphone_x? 'iphone_x':''}`,`${tabbarbool? 'tabbarbool':''}`]">
  6. <view class="apply-btn" :style="{'background-color': getTheme.color}" @click="toApply">立即申请</view>
  7. </view>
  8. </app-layout>
  9. </template>
  10. <script>
  11. import {mapGetters, mapState} from 'vuex';
  12. import appRichText from "../../../components/basic-component/app-rich/parse.vue";
  13. export default {
  14. data() {
  15. return {
  16. setting: {},
  17. currentRoute: this.$platDiff.route(),
  18. tabbarbool: false,
  19. iphone_x: false,
  20. }
  21. },
  22. computed: {
  23. ...mapState({
  24. tabBarNavs: state => state.mallConfig.navbar.navs,
  25. }),
  26. ...mapGetters('mallConfig', {
  27. getTheme: 'getTheme',
  28. })
  29. },
  30. watch: {
  31. tabBarNavs: {
  32. handler: function() {
  33. this.b();
  34. },
  35. immediate: true,
  36. }
  37. },
  38. components: {
  39. "app-rich-text": appRichText
  40. },
  41. methods: {
  42. b() {
  43. // #ifndef H5
  44. let currentRoute = this.currentRoute;
  45. for (let i = 0; i < this.tabBarNavs.length; i++) {
  46. if(currentRoute.includes(this.tabBarNavs[i].url.split('?')[0])) {
  47. return this.tabbarbool = true;
  48. }
  49. }
  50. // #endif
  51. return this.tabbarbool = false;
  52. },
  53. toApply() {
  54. this.stopLoad = true;
  55. uni.navigateTo({
  56. url: '/plugins/community/apply/apply'
  57. });
  58. },
  59. getSetting() {
  60. let that = this;
  61. that.$request({
  62. url: that.$api.community.setting,
  63. }).then(response=>{
  64. if(response.code == 0) {
  65. that.setting = response.data;
  66. uni.setNavigationBarTitle({
  67. title: that.setting.recruit_title
  68. });
  69. }else {
  70. that.$hideLoading();
  71. uni.showToast({
  72. title: response.msg,
  73. icon: 'none',
  74. duration: 1000
  75. });
  76. }
  77. }).catch(response => {
  78. that.$hideLoading();
  79. });
  80. },
  81. },
  82. onLoad() { this.$commonLoad.onload();
  83. let that = this;
  84. uni.getSystemInfo({
  85. success: function (res) {
  86. that.height = -res.screenHeight;
  87. if(res.model.indexOf('iPhone X') > -1 || res.model.indexOf('iPhone 11') > -1 || res.model.indexOf('iPhone11') > -1 || res.model.indexOf('iPhone12') > -1 || res.model.indexOf('Unknown Device') > -1) {
  88. that.iphone_x = true;
  89. }
  90. }
  91. });
  92. that.getSetting();
  93. }
  94. }
  95. </script>
  96. <style scoped lang="scss">
  97. .placeholder {
  98. height: #{154rpx};
  99. width: 100%;
  100. &.tabbarbool {
  101. padding-bottom: #{110rpx};
  102. }
  103. }
  104. .apply {
  105. position: fixed;
  106. bottom: 0;
  107. left: 0;
  108. z-index: 2;
  109. height: #{154rpx};
  110. width: 100%;
  111. background-color: #fff;
  112. padding-top: #{26rpx};
  113. padding-left: #{24rpx};
  114. &.tabbarbool {
  115. bottom: #{110rpx};
  116. &.tabbarbool.iphone_x {
  117. bottom: #{160rpx};
  118. }
  119. }
  120. .apply-btn {
  121. width: #{702rpx};
  122. height: #{88rpx};
  123. line-height: #{88rpx};
  124. border-radius: #{44rpx};
  125. text-align: center;
  126. color: #fff;
  127. font-size: #{32rpx};
  128. }
  129. }
  130. </style>