discovery.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view class="discovery tn-safe-area-inset-bottom" style="max-height: 100vh">
  3. <view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
  4. <view style="width: 100%;padding-bottom: 0;">
  5. <view style="display: flex;width: 100%;background: linear-gradient(0deg, #fff, #f8f8f">
  6. <view style="margin:16px">
  7. <image style="width: 56px; height: 50px; margin-right: 12px;" :mode="fit"
  8. src="../../static/logo.png"></image>
  9. </view>
  10. <view style="margin:16px 0;margin-left: -8px;">
  11. <view style="font-weight: bold;font-size: 22px;">速立保</view>
  12. <text style="margin-top:12px;color:#888;font-size:15px">生物制药产业一站式产品资源供需平台</text>
  13. </view>
  14. </view>
  15. </view>
  16. <view style="padding: 0px 0 4px 16px;font-weight: bold;">
  17. 优质入驻企业 ▼
  18. </view>
  19. <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" >
  20. <swiper-item v-for="item of companyList" :key="item.id" style="position:relative">
  21. <view style="position: absolute;bottom: 28px;right: 16px;color: #ffffff75;" class="swiper-item uni-bg-red">{{item.company}}</view>
  22. <image :src="item.picUrl?item.picUrl:'../../static/bg.png'" style="width: 100%;height: 100%;"></image>
  23. </swiper-item>
  24. </swiper>
  25. <view style="padding: 16px 0 4px 16px;font-weight: bold;">
  26. 优质供应 ▼
  27. </view>
  28. <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" >
  29. <swiper-item v-for="item of prodList" :key="item.id">
  30. <view style="position: absolute;bottom: 28px;right: 16px;color: #ffffff75;" class="swiper-item uni-bg-red">{{item.company}}</view>
  31. <image :src="item.picUrl?item.picUrl:'../../static/bg.png'" style="width: 100%;height: 100%;"></image>
  32. </swiper-item>
  33. </swiper>
  34. <!-- <image style="width: 180px;height: 150px" src="../../static/logo.png"></image>
  35. <view style="margin-top:24px"><text style="font-size:30px;">生物制药产业</text></view>
  36. <view><text style="font-size:30px">国际产品展示中心</text></view>
  37. <view style="margin-top:24px"><text style="font-size:20px;">生物制药产业一站式产品资源供需平台</text></view> -->
  38. <view style="display: flex;margin-top:32px;margin: 24px;">
  39. <view style="flex: 1;padding: 0 16px;" class="bg01" @click="showAdd">
  40. <text style="font-size: 32px;margin-right: 10px;vertical-align: sub;" class="tn-icon-email-fill" ></text>
  41. <text style="line-height: 72px;font-size: 18px;">我要什么</text>
  42. </view>
  43. <view style="flex: 1;padding: 0 16px;" class="bg02" @click="showAdd2">
  44. <text style="font-size: 32px;margin-right: 10px;vertical-align: sub;" class="tn-icon-paperbag-fill" ></text>
  45. <text style="line-height: 72px;font-size: 18px;">我有什么</text>
  46. </view>
  47. </view>
  48. <view class='tn-tabbar-height'></view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import request from '../../utils/request'
  54. export default {
  55. data() {
  56. return {
  57. indicatorDots: true,
  58. autoplay: false,
  59. companyList:[],
  60. prodList:[]
  61. }
  62. },
  63. onLoad(){
  64. this.loadData();
  65. },
  66. onReady() {
  67. this.$nextTick(() => {
  68. this.loadData()
  69. this.loadData2()
  70. })
  71. },
  72. methods: {
  73. loadData() {
  74. let that = this;
  75. request.post('/slbTopad/premiumCompanies', {
  76. }).then(res => {
  77. if (res&&res.success) {
  78. that.companyList = res.list||[]
  79. }
  80. })
  81. },
  82. loadData2() {
  83. let that = this;
  84. request.post('/slbTopad/premiumShareCompanies', {
  85. }).then(res => {
  86. if (res&&res.success) {
  87. that.prodList = res.list||[]
  88. }
  89. })
  90. },
  91. showAdd(){
  92. if(uni.getStorageSync('userNo')){
  93. uni.navigateTo({
  94. url:'/circlePages/circle'
  95. })
  96. }else{
  97. uni.navigateTo({
  98. url:'/pages/login/login'
  99. })
  100. }
  101. },
  102. showAdd2(){
  103. if(uni.getStorageSync('userNo')){
  104. uni.navigateTo({
  105. url:'/circlePages/addShare'
  106. })
  107. }else{
  108. uni.navigateTo({
  109. url:'/pages/login/login'
  110. })
  111. }
  112. }
  113. }
  114. }
  115. </script>
  116. <style>
  117. .swiper-item {
  118. text-align: center;
  119. }
  120. .swiper{
  121. height: 200px;
  122. }
  123. .bg01{
  124. color: #fff;
  125. background-image: url(./../../static/bg01.png);
  126. background-size: cover;
  127. height: 72px;
  128. border-radius: 20px;
  129. margin-right: 16px;
  130. }
  131. .bg02{
  132. color: #fff;
  133. background-image: url(./../../static/bg02.png);
  134. background-size: cover;
  135. height: 72px;
  136. border-radius: 20px;
  137. }
  138. /* 底部安全边距 start*/
  139. .tn-tabbar-height {
  140. min-height: 120rpx;
  141. height: calc(140rpx + env(safe-area-inset-bottom) / 2);
  142. height: calc(140rpx + constant(safe-area-inset-bottom));
  143. }
  144. </style>