1
0

recruit.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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" :class="getTheme + '-m-back ' + getTheme" @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. let currentRoute = this.currentRoute;
  44. for (let i = 0; i < this.tabBarNavs.length; i++) {
  45. if(currentRoute.includes(this.tabBarNavs[i].url.split('?')[0])) {
  46. return this.tabbarbool = true;
  47. }
  48. }
  49. return this.tabbarbool = false;
  50. },
  51. toApply() {
  52. this.stopLoad = true;
  53. uni.navigateTo({
  54. url: '/plugins/community/apply/apply'
  55. });
  56. },
  57. getSetting() {
  58. let that = this;
  59. that.$request({
  60. url: that.$api.community.setting,
  61. }).then(response=>{
  62. if(response.code == 0) {
  63. that.setting = response.data;
  64. uni.setNavigationBarTitle({
  65. title: that.setting.recruit_title
  66. });
  67. }else {
  68. that.$hideLoading();
  69. uni.showToast({
  70. title: response.msg,
  71. icon: 'none',
  72. duration: 1000
  73. });
  74. }
  75. }).catch(response => {
  76. that.$hideLoading();
  77. });
  78. },
  79. },
  80. onLoad() {
  81. let that = this;
  82. uni.getSystemInfo({
  83. success: function (res) {
  84. that.height = -res.screenHeight;
  85. 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) {
  86. that.iphone_x = true;
  87. }
  88. }
  89. });
  90. that.getSetting();
  91. }
  92. }
  93. </script>
  94. <style scoped lang="scss">
  95. .placeholder {
  96. height: #{154rpx};
  97. width: 100%;
  98. &.tabbarbool {
  99. padding-bottom: #{110rpx};
  100. }
  101. }
  102. .apply {
  103. position: fixed;
  104. bottom: 0;
  105. left: 0;
  106. z-index: 2;
  107. height: #{154rpx};
  108. width: 100%;
  109. background-color: #fff;
  110. padding-top: #{26rpx};
  111. padding-left: #{24rpx};
  112. &.tabbarbool {
  113. bottom: #{110rpx};
  114. &.tabbarbool.iphone_x {
  115. bottom: #{160rpx};
  116. }
  117. }
  118. .apply-btn {
  119. width: #{702rpx};
  120. height: #{88rpx};
  121. line-height: #{88rpx};
  122. border-radius: #{44rpx};
  123. text-align: center;
  124. color: #fff;
  125. font-size: #{32rpx};
  126. }
  127. }
  128. </style>