top-panel.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <view class="page-container" :class="{'is-apply': isApply}">
  3. <view class="u-bg" />
  4. <view class="main-content">
  5. <view class="title">
  6. 高校学院
  7. </view>
  8. <view v-if="isApply" class="special-apply-result">
  9. <view class="u-flex" style="margin-bottom: 54rpx;">
  10. <view class="apply-title">特别申请结果查询</view>
  11. <view class="apply-status">{{applyObj.applyStatusName}}</view>
  12. </view>
  13. <view class="daterange u-flex" style="margin-bottom: 24rpx;">
  14. <image src="/static/time_icon.png" style="width: 32rpx;height: 32rpx;margin-right: 16rpx;" mode="">
  15. </image>
  16. <view style="flex: 1;">{{applyObj.time || '22-04-20 ~ 22- 04-30'}}</view>
  17. </view>
  18. <view class="u-flex">
  19. <view class="">
  20. </view>
  21. <view class="u-button ">立即查询</view>
  22. </view>
  23. </view>
  24. <swiper v-else class="swiper" indicator-active-color="#007aff" circular :indicator-dots="true" :autoplay="true" :interval="3000"
  25. :duration="500">
  26. <swiper-item @click="change(item)" v-for="(item,index) in list" :key="index">
  27. <image :src="item.bannerImageUrl" style="width:100%" mode="widthFix"></image>
  28. </swiper-item>
  29. </swiper>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. export default {
  35. data() {
  36. return {
  37. list: [],
  38. applyObj: {},
  39. }
  40. },
  41. computed: {
  42. isApply() {
  43. return this.applyObj.applyStatus >= 1 && false // 不需要自定义
  44. }
  45. },
  46. mounted() {
  47. this.init()
  48. },
  49. methods: {
  50. async init() {
  51. this.$ajax.post('/shunt/banner').then(res => {
  52. this.list = res.data || []
  53. }).catch(error => {
  54. this.list = []
  55. })
  56. //
  57. this.$ajax.post('/shunt/special-apply-result').then(res => {
  58. this.applyObj = res.data || {}
  59. }).catch(error => {
  60. this.applyObj = {}
  61. })
  62. },
  63. change(item) {
  64. const {
  65. jumType,
  66. jumUrl,
  67. bannerTitle = '123'
  68. } = item || {}
  69. console.log(jumType, jumUrl);
  70. //0-无跳转,1-内部跳转体质,2-http跳转地址
  71. if (jumType == 1 && jumUrl) { //
  72. ['/', '/pages/index/index', '/pages/my/my'].indexOf(jumUrl) >= 0 ?
  73. uni.switchTab({
  74. url: jumUrl
  75. }) :
  76. uni.navigateTo({
  77. url: jumUrl
  78. })
  79. } else if (jumType == 2 && jumUrl) {
  80. console.log(111, jumUrl)
  81. uni.navigateTo({
  82. url: `/pages/common/webview/webview?url=${jumUrl}&title=${bannerTitle}`,
  83. });
  84. }
  85. },
  86. },
  87. }
  88. </script>
  89. <style scoped lang='scss'>
  90. .u-bg {
  91. display: none;
  92. height: 353rpx;
  93. background: url('/static/top_panel_bg.png');
  94. background-size: 100% 100%;
  95. background-repeat: no-repeat;
  96. background-position: center;
  97. background-origin: content-box;
  98. }
  99. .main-content {
  100. padding: 46rpx 32rpx 72rpx 32rpx;
  101. .title {
  102. font-size: 40rpx;
  103. font-weight: bold;
  104. color: #333333;
  105. margin-bottom: 52rpx;
  106. }
  107. .special-apply-result {
  108. background: #FFFFFF;
  109. box-shadow: 0px 4rpx 22rpx 0rpx rgba(232, 237, 251, 0.8);
  110. border-radius: 16rpx;
  111. padding: 32rpx;
  112. .apply-title {
  113. font-size: 36rpx;
  114. font-weight: bold;
  115. color: #333333;
  116. }
  117. .apply-status {
  118. font-size: 28rpx;
  119. font-weight: bold;
  120. color: #FFB300;
  121. }
  122. .daterange {
  123. font-size: 28rpx;
  124. font-weight: bold;
  125. color: #078EF7;
  126. }
  127. .u-button {
  128. background: rgba($color: #078EF7, $alpha: .18);
  129. font-size: 28rpx;
  130. font-weight: bold;
  131. color: #078EF7;
  132. height: 84rpx;
  133. border-radius: 40rpx;
  134. width: 250rpx;
  135. }
  136. }
  137. }
  138. .swiper {
  139. height: 300rpx;
  140. }
  141. .swiper-item {
  142. display: block;
  143. height: 300rpx;
  144. line-height: 300rpx;
  145. text-align: center;
  146. border-radius: 12rpx;
  147. }
  148. .is-apply {
  149. .u-bg {
  150. display: inherit;
  151. }
  152. .title {
  153. color: #FFFFFF;
  154. }
  155. }
  156. </style>